
我試圖將許多項的總和分解為多行,如下所示:
\documentclass[12pt,a4paper]{book}
\usepackage{amsmath}
\begin{document}
\begin{align*}
L &= \sum { A && \text{This equation sums ABC} \\
\times B \\
\times C }
\end{align*}
\end{document}
但我明白了Missing } inserted
。這樣做的動機是為了\text
不被推得太靠右。
答案1
正如@daleif 在評論中已經指出的那樣,您必須刪除將 後的材料括起來的一對虛假大括號\sum
。此外,您幾乎肯定應該為第 2 行和第 3 行的資料提供對齊點。
\documentclass[12pt,a4paper]{book}
\usepackage{amsmath}
\begin{document}
\hrule % just to illustrate width of textblock
\begin{align*}
L &= \sum \text{A-stuff} \tag*{This equation sums ABC} \\
&\quad \times \text{B-stuff} \\
&\quad \times \text{C-stuff}
\end{align*}
\end{document}
答案2
使用aligned
:
\documentclass[12pt,a4paper]{book}
\usepackage{amsmath}
\begin{document}
\begin{align*}
L &= \sum \Bigl( \begin{aligned}[t]
& A \\
& \times B \\
& \times C \Bigr)
\end{aligned}
&& \text{This text is not so far}
\\
M &= ABC && \text{This text is not so far}
\end{align*}
Just for a check:
\begin{align*}
M &= ABC && \text{This text is not so far} \\
K &= XYZ && \text{This text is not so far}
\end{align*}
\end{document}
答案3
謝謝。扔在括號中而
\phantom
不是\quad
......
\documentclass[12pt,a4paper]{book}
\usepackage{amsmath}
\begin{document}
\begin{align*}
L &= \sum \big( A \\
& \phantom{= \sum \big(} \times B \\
& \phantom{= \sum \big(} \times C
\big)
\end{align*}
\end{document}
現在,有沒有辦法做這樣的事情:
L &\setphantom{= \sum \big(} A \\
& \getphantom \times B \\
& \getphantom \times C
\big)