곱셈 서식

곱셈 서식

들러서 제 질문을 봐주셔서 감사합니다.

교수님께서 노트에 보여주신 것처럼 숙제의 형식을 지정하려고 하는데 다음과 같이 보이도록 코드를 작성하는 방법을 모르겠습니다(아래 참조).

귀하가 제공할 수 있는 도움을 주시면 감사하겠습니다.

제품 찾기

답변1

또 다른 기반 솔루션이 있습니다 array. 이 array기능에는 총 9개의 열이 있습니다. 5개의 거듭제곱 열과 x4개의 열 +-기호가 수직으로 정렬되어 있습니다.

\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}

여기에 이미지 설명을 입력하세요

관련 정보