这三段文字分别是
(1) (x+1的系数)
(2) ((x+2)^{2} 的系数)
(3) ((x+1)^{3} 的系数)
笔记:- 这三个文本的对齐方式必须类似于以下内容:-
\documentclass[11pt,a4paper]{article}
\usepackage{array,booktabs}
\newcommand*{\Ph}{\hphantom{)}}%
\begin{document}
Expand $(x+1)^{2}$, $(x+1)^{2}$, $(x+1)^{3}$,\dots, $(x+1)^{n}$. Proceeded by successive distribution, using detached coefficients.\\\\
\noindent
$\begin{array}{@{} >{{}}r *{12}{ @{}>{{}}r<{{}}@{} } }
& 1 & + & 1 & \\
\times \\
& 1 & + & 1 \\
\midrule
& 1 & + & 1 \\
& & + & 1 & + & 1\\
\midrule
& 1 & + & 2 & + & 1 \\
& 1 & + & 1 \\
\midrule
& 1 & + & 2 & + & 1 \\
& & + & 1 & + & 2 & + & 1\\
\midrule
& 1 & + & 3 & + & 3 & + & 1 \\
\end{array}$
\end{document}
答案1
您可以添加一个额外的列并将文本放置在其中,然后使用\cmidrule
而不是\midrule
仅在前几列上绘制线条。
\documentclass[11pt,a4paper]{article}
\usepackage{array,booktabs,amsmath}
\newcommand*{\Ph}{\hphantom{)}}%
\begin{document}
Expand $(x+1)^{2}$, $(x+1)^{2}$, $(x+1)^{3}$,\dots, $(x+1)^{n}$. Proceeded by successive distribution, using detached coefficients.\\\\
\noindent
$\begin{array}{@{} >{{}}r *{7}{ @{}>{{}}r<{{}}@{} } @{}>{\quad}l }
& 1 & + & 1 & & & && \text{(The coefficients of $x+1$)}\\
\times \\
& 1 & + & 1 \\
\cmidrule{1-8}
& 1 & + & 1 \\
& & + & 1 & + & 1\\
\cmidrule{1-8}
& 1 & + & 2 & + & 1 &&& \text{(The coefficients of $(x+1)^2$)}\\
& 1 & + & 1 \\
\cmidrule{1-8}
& 1 & + & 2 & + & 1 \\
& & + & 1 & + & 2 & + & 1\\
\cmidrule{1-8}
& 1 & + & 3 & + & 3 & + & 1 & \text{(The coefficients of $(x+1)^3$)}\\
\end{array}$
\end{document}