答案1
Plain TeX 的解决方案:
$$
\vbox{\halign{\hfil$#{}$&\hfil$#$\hfil\cr
(a+b)^0 =& 1 \cr
(a+b)^1 =& a+b \cr
(a+b)^2 =& a^2+2ab+b^2 \cr
(a+b)^3 =& a^3+3a^2b+3ab^2+b^3 \cr
(a+b)^4 =& a^4+4a^3b+6a^2b^2+4ab^3+b^4 \cr
(a+b)^5 =& a^5+5a^4b+10a^3b^2+10a^2b^3+5ab^4+b^5 \cr
}}
$$
\bye
该代码也可在 LaTeX 中运行,因为它仅基于 TeX 原语\vbox
, \halign
, \hfil
, \cr
。
答案2
答案3
您可以使用IEEEeqnarray
:
\documentclass{article}
\usepackage{amsmath}
\usepackage{IEEEtrantools}
\begin{document}
\begin{IEEEeqnarray*}{rCc}
(a+b)^0 &=& 1 \\
(a+b)^1 &=& a+b \\
(a+b)^2 &=& a^2+2ab+b^2 \\
(a+b)^3 &=& a^3+3a^2b+3ab^2+b^3 \\
(a+b)^4 &=& a^4+4a^3b+6a^2b^2+4ab^3+b^4 \\
(a+b)^5 &=& a^5+5a^4b+10a^3b^2+10a^2b^3+5ab^4+b^5
\end{IEEEeqnarray*}
\end{document}
答案4
此版本使用\mathmakebox
(mathtools 包)。
\documentclass{article}
\usepackage{mathtools}
\newsavebox{\tempbox}
\begin{document}
\savebox{\tempbox}{$\displaystyle a^5+5a^4b+10a^3b^2+10a^2b^3+5ab^4+b^5$}% widest entry
\begin{align*}
(a+b)^0 &= \mathmakebox[\wd\tempbox]{1} \\
(a+b)^1 &= \mathmakebox[\wd\tempbox]{a+b} \\
(a+b)^2 &= \mathmakebox[\wd\tempbox]{a^2+2b+b^2} \\
(a+b)^3 &= \mathmakebox[\wd\tempbox]{a^3+3a^2b+3ab^2+b^3} \\
(a+b)^4 &= \mathmakebox[\wd\tempbox]{a^4+4a^3b+6a^2b^2+4ab^3+b^4} \\
(a+b)^5 &= \usebox\tempbox
\end{align*}
\end{document}