答案1
在以下示例中,您将发现 的用法TiKZ
,尽管常规方法tabular
也可以用于这些目的。不要为结果烦恼;它使用二进制算术。
\documentclass[tikz,border=2mm]{standalone}
\usetikzlibrary{matrix, backgrounds,fit}
\begin{document}
\begin{tikzpicture}
\matrix (a) [matrix of math nodes,column sep=-1.5ex]
{
x^8 & +x^7 & +x^5 & +x^4 & & & & &x^3 & +x^2 & +1\\
x^8 & +x^7 & +x^5 & & & & & &x^5 & +x & +1\\
& & 0 & x^4 \\
& & & x^4 & +x^3 & &+ x \\
& & & & x^3 & &+ x \\
& & & & x^3 & +x2 & &+ 1 \\
& & & & & +x^2 & +x &+ 1 \\
};
\draw (a-1-9.north west)|-(a-1-11.south east);
\draw (a-2-1.south west)--(a-2-3.east|-a-2-1.south);
\draw (a-4-4.south west)--(a-4-7.east|-a-4-4.south);
\draw (a-6-5.south west)--(a-6-8.east|-a-6-5.south);
\begin{scope}[on background layer]
\node[rounded corners, inner sep=0mm,fit=(a-7-6) (a-7-8) , label={right:residu},fill=red,opacity=.5] (b) {};
\end{scope}
\end{tikzpicture}
\end{document}