![跨多个对齐对齐术语总和](https://linux22.com/image/350663/%E8%B7%A8%E5%A4%9A%E4%B8%AA%E5%AF%B9%E9%BD%90%E5%AF%B9%E9%BD%90%E6%9C%AF%E8%AF%AD%E6%80%BB%E5%92%8C.png)
方括号内的术语对齐得很好,但我不知道如何将它们向左移动。LaTeX 代码和输出可以在下面找到。
\begin{alignat}{3}
\sum_{k=m}^{\infty} p_\infty(k) &= m(m+1) \sum_{k=m}^{\infty} \left( \frac{1}{k} - \frac{2}{k+1} + \frac{1}{k+2} \right) \\
&= m(m+1) \: &[ \frac{1}{m} &- \frac{2}{m+1} + \frac{1}{m+2} \\
& \hspace{5pt} &+ \frac{1}{m+1} &- \frac{2}{m+2} + \frac{1}{m+3} \\
& \hspace{5pt} &+ \frac{1}{m+2} &- \frac{2}{m+3} + \frac{1}{m+4} \\
& \hspace{5pt} &+ \frac{1}{m+3} &- \frac{2}{m+4} + \frac{1}{m+5} \\
& \hspace{5pt} + ... ]
\end{alignat}
我尝试使用双 &&,但效果不佳。我应该如何放置 & 符号,以便术语在多行中整齐对齐?
答案1
改变对齐点:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\begin{alignedat}{2}
\sum_{k=m}^{\infty} p_\infty(k)
&= m(m+1) &&\sum_{k=m}^{\infty} \left( \frac{1}{k} - \frac{2}{k+1} + \frac{1}{k+2} \right) \\
&= m(m+1) &&\biggl[ \frac{1}{m} - \frac{2}{m+1} + \frac{1}{m+2} \\
& &&\,+ \frac{1}{m+1} - \frac{2}{m+2} + \frac{1}{m+3} \\
& &&\,+ \frac{1}{m+2} - \frac{2}{m+3} + \frac{1}{m+4} \\
& &&\,+ \frac{1}{m+3} - \frac{2}{m+4} + \frac{1}{m+5} \\
& &&\,+ \dotsb\biggr]
\end{alignedat}
\end{equation}
\end{document}
使用嵌套可能更简单aligned
:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\begin{aligned}
\sum_{k=m}^{\infty} p_\infty(k)
&= m(m+1) \sum_{k=m}^{\infty} \left( \frac{1}{k} - \frac{2}{k+1} + \frac{1}{k+2} \right) \\
&= m(m+1) \begin{aligned}[t]
\biggl[ & \frac{1}{m} - \frac{2}{m+1} + \frac{1}{m+2} \\
&+ \frac{1}{m+1} - \frac{2}{m+2} + \frac{1}{m+3} \\
&+ \frac{1}{m+2} - \frac{2}{m+3} + \frac{1}{m+4} \\
&+ \frac{1}{m+3} - \frac{2}{m+4} + \frac{1}{m+5} \\
&+ \dotsb\biggr]
\end{aligned}
\end{aligned}
\end{equation}
\end{document}