
Я пытаюсь разбить сумму многих терминов на несколько строк следующим образом:
\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)