0

I'm having trouble using \polynom for variables with negative exponents.

When I run

\polylongdiv[style=A]{1+2z^{-2}+z^{-4}}{z^{-1} - z^{-3}} 

I get something not at all correct.

Is there a more manual way input the answer and the subtracted variables?

Mico
  • 506,678
Ryan T
  • 1

1 Answers1

1

The polynum package uses internal macros to decide how to perform the long division, and I'm not aware of any high level options to change its behaviour. But of course you can do the long division manually using an array. \cline is useful to draw horizontal lines spanning only part of the array.

The simplest set-up would have you using just two, left-justified columns, the first being empty apart from in the second row for the divisor. Here is example code to get you started:

\documentclass{article}
\begin{document}
\begin{equation*}
    \def\arraystretch{1.6} % Stetch the arrary, increasing row separation (looks nicer)
    \begin{array}{ll} % Two left justified colums
    &1+2z^{-2}+1z^{-4}  \\  \cline{2-2} % hoizontal line spanning second column only
    \left.z^{-1} - z^{-3}\right)\, & \\
    \end{array}
\end{equation*}
\end{document}

output1

To achieve a better output, you may want to add additional columns (for example, see this related answer).

pip
  • 1,847