源代码:
\begin{align*}
& = \frac{\frac{a}{c} - \frac{b}{d}}{\frac{a}{c} + \frac{b}{d}} - \frac{a-b}{a+b} & = \frac{\alpha a - b}{\alpha a + b} - \frac{a-b}{a+b}\\
& = \frac{2(\alpha - 1)ab}{\alpha a^2+(1+\alpha)ab+b^2} & = \frac{2(\alpha - 1)}{\alpha \beta +(1+\alpha) + \frac{1}{\beta}}
\end{align*}
答案1
您没有正确使用环境的语法align*
:如果每行有多个对齐点,并希望第二组中的材料与符号对齐=
而不是右对齐,则需要使用&&=
,而不是&=
。
话虽如此,为了避免在两组之间造成不必要的差距,我会使用alignat*
环境而不是环境。此外,正如@egreg 在评论中指出的那样,甚至可能不需要将右侧方程组与它们的符号对齐——至少对于您提供的示例方程来说不需要。align*
=
\documentclass{article}
\usepackage{amsmath,xcolor}
\begin{document}
\textcolor{red}{incorrect}
\begin{align*}
&= \frac{\frac{a}{c}-\frac{b}{d}}{\frac{a}{c} + \frac{b}{d}} - \frac{a-b} {a+b}
&= \frac{\alpha a - b}{\alpha a + b} - \frac{a-b}{a+b}\\
&=\frac{2(\alpha - 1)ab}{\alpha a^2+(1+\alpha)ab+b^2}
&=\frac{2(\alpha - 1)}{\alpha \beta +(1+\alpha) + \frac{1}{\beta}}
\end{align*}
\textcolor{red}{correct but unattractive}
\begin{align*}
&= \frac{\frac{a}{c}-\frac{b}{d}}{\frac{a}{c} + \frac{b}{d}} - \frac{a-b} {a+b}
&&= \frac{\alpha a - b}{\alpha a + b} - \frac{a-b}{a+b}\\
&=\frac{2(\alpha - 1)ab}{\alpha a^2+(1+\alpha)ab+b^2}
&&=\frac{2(\alpha - 1)}{\alpha \beta +(1+\alpha) + \frac{1}{\beta}}
\end{align*}
\textcolor{red}{better: use \texttt{alignat*} instead of \texttt{align*}}
\begin{alignat*}{2}
&= \frac{\frac{a}{c}-\frac{b}{d}}{\frac{a}{c} + \frac{b}{d}} - \frac{a-b} {a+b}
&&= \frac{\alpha a - b}{\alpha a + b} - \frac{a-b}{a+b}\\
&=\frac{2(\alpha - 1)ab}{\alpha a^2+(1+\alpha)ab+b^2}
&&=\frac{2(\alpha - 1)}{\alpha \beta +(1+\alpha) + \frac{1}{\beta}}
\end{alignat*}
\textcolor{red}{even better: don't align the second set of \texttt{=} symbols}
\begin{align*}
&= \frac{\frac{a}{c}-\frac{b}{d}}{\frac{a}{c} + \frac{b}{d}} - \frac{a-b} {a+b}
= \frac{\alpha a - b}{\alpha a + b} - \frac{a-b}{a+b}\\
&=\frac{2(\alpha - 1)ab}{\alpha a^2+(1+\alpha)ab+b^2}
=\frac{2(\alpha - 1)}{\alpha \beta +(1+\alpha) + \frac{1}{\beta}}
\end{align*}
\end{document}