compose polynomial in latex
1,778
You could use an array
in conjunction with the booktabs
package:
Notes:
- 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.
Code:
\documentclass{article}
\usepackage{amsmath}
\usepackage{booktabs}
\newcommand*{\Ph}{\hphantom{{}+{}}}%
\begin{document}
$\begin{array}{r l@{} l@{} l@{} l@{} l@{}}
&x^4 &{}+ 1 \\
\cmidrule{2-6}
\multicolumn{1}{r |}{x^3 + x^2 + 1} &x^4 & &{}+ x^2 &{}+ x &{}+ 1 \\
&x^4 &{}+ x^3 & &{}+ x & \\
\cmidrule{2-5}
& &\Ph x^3 &{}+ x^2 & &{}+1\\
& &\Ph x^3 &{}+ x^2 & &{}+1\\
\cmidrule(l{10pt}){3-6}
\end{array}$
\end{document}
Related videos on Youtube
Author by
Mazzy
Updated on June 12, 2020Comments
-
Mazzy over 3 years
I would create such a similar thing:
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 thatpolynom
package give me. How can I create that image ?-
T. Verron almost 11 yearsWhat would you be giving as an input?
-
Mazzy almost 11 yearsI gave \polylongdiv{}{}
-
T. Verron almost 11 yearsI mean... Would you give only the polynomials
x^3 + x^2 + 1
andx+1
, or the full computation, possibly with alignment characters? -
Mazzy almost 11 yearsI would have the full computation with alignment characters...
-
T. Verron almost 11 yearsThen you could edit the question to make it clear. You understand that it does greatly change the nature and difficulty of the task.
-
egreg almost 11 years@Mazzy TeX is not good in higher algebra, I'm afraid. :)
-
Werner almost 11 yearsRelated: How to draw polynomial division?
-