Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want to get the following polynomial long division like this:

Polynomial Long Division

But as you know, when I use command \polylongdiv (package polynom), I always get the following:

polydiv result

How can I get the result as in the first picture? At present, I have no idea to do so. Here is my tex file:

\documentclass{article}

\usepackage{polynom}

\begin{document}

$$\polylongdiv{x^3-12x^2-42}{x-3}$$

\end{document}
share|improve this question

closed as unclear what you're asking by Joseph Wright Feb 2 at 7:43

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Question is not the same, but the code in How to correct excessive lines at the corner and bad line spaces in polynom.sty? replaces the ")" with a (better placed) vertical line. (For reference: the code comes from latex-community.org/forum/viewtopic.php?p=30051#p30051, and was written by Thorsten Donig.) –  Torbjørn T. Oct 28 '12 at 13:59
    
@azhi: Would you be able to adequately verbalize the difference between the two outputs? For example, do you really want elements like 0x? The horizontal alignment seems to be a major difference. To what extent? Do you want things to still line up with other elements horizontally? –  Werner Nov 1 '12 at 6:21
    
If you're looking for the 0x terms, then see this answer –  Scott H. Nov 1 '12 at 6:25
    
I want the result of the command $\polylongdiv{x^3-12x^2-42}{x-3}$ to be as that of the first picture. Yes, I do really want the elements like $0X$. But what I want most is that the third line of the second picture to be $x^3-3x^2$, other than $-x^3+3x^2$, the fifth line to be $-9x^2+27x$, other than $9x^2-27x$, the seventh line to be $-27x+81$, other than $27x-81$. –  azhi Nov 1 '12 at 11:24
    
the way that \polylongdiv is rendering it is strictly correct, aligning terms of the same power. –  Nicholas Hamilton Dec 15 '12 at 16:46

Browse other questions tagged or ask your own question.