
Responder1
Aqui está outra array
solução baseada em . O array
apresenta um total de 9 colunas: 5 colunas para as potências de x
e 4 colunas para os símbolos +
e -
, que são, portanto, alinhados verticalmente entre si.
Uma \rlap
instrução é usada para fazer com que o final .
(ponto final) e o símbolo QED se projetem além da borda direita do arquivo array
.
\documentclass{article}
\usepackage{array} % for "\newcolumntype" macro
\usepackage{booktabs}% for "\midrule" macro
\usepackage{amsthm} % for "\qedsymbol" macro
\newcolumntype{C}{>{{}}c<{{}}}
\newcommand{\ltimes}{\multicolumn{1}{l}{\times}}
\begin{document}
\[
\setlength\arraycolsep{0pt}
\renewcommand\arraystretch{1.5}
\begin{array}{*{4}{rC}r}
& & & - & 3x^2 & + & 2x & - & 4 \\
& &\ltimes& & 5x^2 & & & + & 3 \\
\midrule
& & & - & 9x^2 & + & 6x & - & 12\\
-15x^4 & + & 10x^3 & - & 20x^2 \\
\midrule
-15x^4 & + & 10x^3 & - & 29x^2 & + & 6x & - & 12\rlap{.\quad\qedsymbol}\\
\end{array}
\]
\end{document}
Responder2
Parece que ele usou array
, que é mais ou menos igual, tabular
mas no modo matemático. Eu preferiria sem todos os espaços.
\documentclass{article}
\usepackage{booktabs}
\begin{document}
\begin{displaymath}
\begin{array}{*{5}{@{}r@{}}}
& & -3x^2 & {}+2x & {}-4\\
& \times & 5x^2 & & {}+3\\\midrule
& & -9x^2 & {}+6x & {}-12\\
-15x^4 & {}+10x^3 & {}-20x^2\\\midrule
-15x^4 & {}+10x^3 & {}-29x^2 & {}+6x & {}-12
\end{array}
\end{displaymath}
\end{document}
Responder3
Proponho outra solução, baseada em alignedat
:
\documentclass{article}
\usepackage{booktabs}
\usepackage{mathtools}
\begin{document}
\[ \begin{array}{@{}c@{}}
\begin{alignedat}{5}
& & & & -3&x^2 & {}+2&x & {}-4& \\
& & & &{}\times 5&x^2 & & & {}+3 & \\\midrule[0.4pt]
& & & & -9 & x^2 & {}+6 &x & {}-12& \\
-15 & x^4 & {}+10 & x^3 &{}-20 & x^2\\\midrule[0.4pt]
-15 & x^4 & {}+10 & x^3 & {}-29&x^2 & {}+6 &x & {}-12&
\end{alignedat}
\end{array} \]
\end{document}
Responder4
Com autoaligne
e com a ajuda de um truque emhttps://tex.stackexchange.com/a/339525/4427
\documentclass{article}
\usepackage{autoaligne}
%% A trick for an empty delimiter
\newcommand{\makeempty}[1]{%
\begingroup\lccode`~=`#1 \lowercase{\endgroup\def~}{\mathbin{\phantom{+}}}%
\mathcode`#1="8000
}
\begin{document}
\[
\setlength{\medmuskip}{18mu}
\makeempty{V}
\definirseparateurs{\\}{+||-||V}{}
\autoaligne{
+- 3x^2 + 2x - 4 \\
V \times\hfill V 5x^2 ++ 3 \\
\noalign{\vspace{3pt}\hrule\vspace{3pt}}
+- 9x^2 + 6x - 12 \\
\-15x^4 + 10x^3 - 20x^2 \\
\noalign{\vspace{3pt}\hrule\vspace{3pt}}
\-15x^4 + 10x^3 - 29x^2 + 6x - 12
}
\]
\end{document}
Se quiser mais compacto, remova a \setlength
linha:
Aqui está uma representação mais precisa do original.
\documentclass{article}
\usepackage{amsthm,array}
\begin{document}
\[
\setlength{\extrarowheight}{1ex}
\begin{array}{@{}rclcrcrclll}
&&& - & 3x^2 & + & 2x & - & 4 \\[1ex]
&& \times & & 5x^2 &&& + & 3 \\[1ex]
\cline{1-10}
&&& - & 9x^2 & + & 6x & - & 12 \\[1ex]
-15x^4 & + & 10x^3 & - & 20x^2 \\[1ex]
\cline{1-10}
-15x^4 & + & 10x^3 & - & 29x^2 & + & 6x & - & 12 && \qedsymbol
\end{array}
\]
\end{document}