在 \sum 或 \int 內分割方程

在 \sum 或 \int 內分割方程

我試圖將許多項的總和分解為多行,如下所示:

\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)

相關內容