How to Use Greek Letters with `\polyset` in LaTeX
At a glance
- 1. Load the package
Use the polynom package; \polyset is not a standard LaTeX command.
- 2. Set a parser variable
Declare a simple variable such as x with \polyset{vars=x} for polynomial calculations.
- 3. Typeset Greek normally
Use commands such as \alpha in math mode for ordinary mathematical notation.
- 4. Substitute for display
If the parser does not accept a Greek command, calculate with x and write the result using the Greek symbol.
The command \polyset is provided by the LaTeX package polynom. It configures how that package handles polynomial calculations; it does not define Greek letters. To print a Greek letter, use its usual math-mode command, such as \alpha inside $...$ or \[...\].
The complication is that polynom reads polynomial expressions using its own input syntax. Its parser is not a general-purpose TeX math engine, so a control sequence like \alpha may not be accepted as the polynomial variable even though it typesets correctly in ordinary math mode. A reliable approach is to do the package calculation with a simple variable, then write the Greek-letter version in standard math notation.
Set a variable for polynom
Load the package and use \polyset to configure its variable. For example, \polyset{vars=x} sets x as the variable for the calculation. Then give the polynomial expressions to a command such as \polylongdiv.
Here is a minimal document showing a polynomial calculation with x, followed by the same identity written with \alpha:
\documentclass{article}
\usepackage{polynom}
\begin{document}
\polyset{vars=x}
\polylongdiv{x^2-1}{x-1}
The corresponding identity using a Greek letter is
\[
\alpha^2-1=(\alpha-1)(\alpha+1).
\]
\end{document}
The polynom package is needed for \polyset and \polylongdiv. The \alpha command in the displayed identity is standard LaTeX math notation; it is not being passed to the polynomial parser. The identity holds for every value of \alpha.
Why \alpha may fail as a parser variable
There are two different jobs involved:
- Typesetting: TeX expands
\alphaas a Greek symbol in math mode. - Polynomial parsing:
polynominterprets its input according to the package’s polynomial syntax and variable settings.
A command that is valid in the first context is not automatically valid in the second. For example, placing \alpha in a \polyset option or directly in a polynomial argument does not guarantee that the parser will recognize it as a variable. If the package reports an error or produces unexpected output, first replace the Greek command with a simple variable such as x and check that the calculation works.
A practical substitution method
Suppose you want to divide by . Use the corresponding calculation with :
with zero remainder. Then express the result using the intended symbol:
The substitution is valid because the polynomial identity holds for any value of the variable. The condition excludes the value that makes the denominator zero. For a long-division layout, let polynom work with x, and typeset the final Greek-letter statement separately.
Common mistakes
- Using
\alphaoutside math mode. Write\(\alpha\)or$\alpha$in running text, and use\[\alpha\]for a displayed expression. - Treating
\polysetas a Greek-letter command. It configures thepolynompackage; use\alpha,\beta, and similar commands to print Greek letters. - Assuming every TeX expression is valid parser input. Polynomial packages often accept a narrower syntax than ordinary LaTeX math. Test with a simple variable and a small polynomial first.
- Putting display notation into the option value. The option
vars=xis a package setting, not a place to enter a complete mathematical expression.
If you need the polynomial package to display a Greek symbol directly as its variable, check the documentation for the version you are using to see whether its parser supports that token. If it does not, use a simple placeholder for the calculation and write the final result with the Greek letter in ordinary math mode.
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.