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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would create such a similar thing:

enter image description here

I tried using polynom package but the operation I'm doing aren't the common operation because I'm working on galois field so I don't want the result that polynom package give me. How can I create that image ?

share|improve this question
What would you be giving as an input? – T. Verron Nov 27 '12 at 22:56
I gave \polylongdiv{}{} – Mazzy Nov 27 '12 at 22:59
I mean... Would you give only the polynomials x^3 + x^2 + 1 and x+1, or the full computation, possibly with alignment characters? – T. Verron Nov 27 '12 at 23:04
I would have the full computation with alignment characters... – Mazzy Nov 27 '12 at 23:05
@Mazzy TeX is not good in higher algebra, I'm afraid. :) – egreg Nov 27 '12 at 23:30
up vote 6 down vote accepted

You could use an array in conjunction with the booktabs package:

enter image description here


  • This example was more focused on the alignment issues and not the drawing issues, so there us probably much room for improvent related to the drawing portion.




$\begin{array}{r  l@{} l@{} l@{} l@{} l@{}}
                                    &x^4 &{}+ 1  \\
\multicolumn{1}{r |}{x^3 + x^2 + 1} &x^4 &        &{}+ x^2 &{}+ x &{}+ 1 \\
                                    &x^4 &{}+ x^3 &        &{}+ x & \\
                                    &    &\Ph x^3 &{}+ x^2 &      &{}+1\\
                                    &    &\Ph x^3 &{}+ x^2 &      &{}+1\\
share|improve this answer
it works perfect...thanks so much... – Mazzy Nov 29 '12 at 10:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.