
답변1
또 다른 기반 솔루션이 있습니다 array
. 이 array
기능에는 총 9개의 열이 있습니다. 5개의 거듭제곱 열과 x
4개의 열 +
및 -
기호가 수직으로 정렬되어 있습니다.
\rlap
마지막 .
(마침표)과 QED 기호를 의 오른쪽 가장자리 너머로 돌출시키는 명령 이 사용됩니다 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}
답변2
그는 수학 모드에서 array
와 거의 동일하지만 을 사용한 것 같습니다 . tabular
나는 모든 공백이 없는 것을 선호합니다.
\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}
답변3
나는 다음을 기반으로 또 다른 솔루션을 제안합니다 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}
답변4
autoaligne
트릭의 도움 으로https://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}
더 컴팩트하게 하려면 다음 \setlength
줄을 제거하세요.
원본을 좀 더 정확하게 표현한 것은 다음과 같습니다.
\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}