对齐多线方程式

对齐多线方程式

我有两个问题。

首先:如何将所有 S 左对齐?

第二:如何让每个S的第二行与第一行对齐,而不是像原来那样居中。

\begin{equation}
\begin{gathered}\label{eq:suav2}
S_0^+ = \frac{240}{36}[11f_i - 18f_{i-1} + 9f_{i-2} - 2f_{i-3}]^2 + 
1040[2f_i - 5f_{i-1} + 4f_{i-2} - f_{i-3}]^2 + \\
9732[f_i - 3f_{i-1} + 3f_{i-2} - f_{i-3}]^2 \\
S_1^+ = \frac{240}{36}[f_{i-2} - 6f_{i-1} + 3f_{i} + 2f_{i+1}]^2 + 
1040[-2f_{i} + f_{i-1} + f_{i+1}]^2 + \\
9732[-3f_i + 3f_{i-1} - f_{i-2} + f_{i+1}]^2 \\
S_2^+ = \frac{240}{36}[-2f_{i-1} - 3f_{i} + 6f_{i+1} - 2f_{i+2}]^2 + 
1040[-2f_{i} + f_{i-1} + f_{i+1}]^2 + \\
9732[3f_i - f_{i-1} - 3f_{i+1} + f_{i+2}]^2 \\
S_3^+ = \frac{240}{36}[-11f_{i} + 18f_{i+1} - 9f_{i+2} + 2f_{i+3}]^2 + 
1040[2f_{i} - 5f_{i+1} + 4f_{i+2} - f_{i+3}]^2 + \\
9732[-f_i + 3f_{i+1} - 3f_{i+2} + f_{i+3}]^2 
\end{gathered}
\end{equation}

在此处输入图片描述

答案1

使用aligned而不是gathered

在此处输入图片描述

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{equation}
  \begin{aligned}
  S_0^+ ={}& \frac{240}{36}[11f_i - 18f_{i-1} + 9f_{i-2} - 2f_{i-3}]^2 + 
            1040[2f_i - 5f_{i-1} + 4f_{i-2} - f_{i-3}]^2 + {} \\
          & 9732[f_i - 3f_{i-1} + 3f_{i-2} - f_{i-3}]^2 \\
  S_1^+ ={}& \frac{240}{36}[f_{i-2} - 6f_{i-1} + 3f_{i} + 2f_{i+1}]^2 + 
            1040[-2f_{i} + f_{i-1} + f_{i+1}]^2 + {} \\
          & 9732[-3f_i + 3f_{i-1} - f_{i-2} + f_{i+1}]^2 \\
  S_2^+ ={}& \frac{240}{36}[-2f_{i-1} - 3f_{i} + 6f_{i+1} - 2f_{i+2}]^2 + 
            1040[-2f_{i} + f_{i-1} + f_{i+1}]^2 + {} \\
          & 9732[3f_i - f_{i-1} - 3f_{i+1} + f_{i+2}]^2 \\
  S_3^+ ={}& \frac{240}{36}[-11f_{i} + 18f_{i+1} - 9f_{i+2} + 2f_{i+3}]^2 + 
            1040[2f_{i} - 5f_{i+1} + 4f_{i+2} - f_{i+3}]^2 + {} \\
          & 9732[-f_i + 3f_{i+1} - 3f_{i+2} + f_{i+3}]^2 
  \end{aligned}
\end{equation}

\end{document}

为了方便使用,我使用了={}&...&=更传统的关系对齐方式。

答案2

我建议另外两种方案:

\documentclass{article}
\usepackage{geometry}
\usepackage{amsmath}

\begin{document}

\begin{equation}
  \raisetag{2cm}
  \begin{aligned}
    S₀^+ & =
    \begin{aligned}[t]
      \frac{240}{36}[11f_i - 18f_{i-1} + 9f_{i-2} - 2f_{i-3}]² & +
      1040[2f_i - 5f_{i-1} + 4f_{i-2} - f_{i-3}]² \\[-0.7ex]
                                                                & + 9732[f_i - 3f_{i-1} + 3f_{i-2} - f_{i-3}]²
    \end{aligned} \\
    S₁^+ & =
    \begin{aligned}[t]
      \frac{240}{36}[f_{i-2} - 6f_{i-1} + 3f_{i} + 2f_{i+1}]² & +
      1040[-2f_{i} + f_{i-1} + f_{i+1}]² \\[-0.7ex]
                                                               & + 9732[-3f_i + 3f_{i-1} - f_{i-2} + f_{i+1}]²
    \end{aligned} \\
    S₂^+ & =
    \begin{aligned}[t]
      \frac{240}{36}[-2f_{i-1} - 3f_{i} + 6f_{i+1} - 2f_{i+2}]² & +
      1040[-2f_{i} + f_{i-1} + f_{i+1}]² \\[-0.7ex]
                                                                 & + 9732[3f_i - f_{i-1} - 3f_{i+1} + f_{i+2}]²
    \end{aligned} \\
    S₃^+ & =
    \begin{aligned}[t]
      \frac{240}{36}[-11f_{i} + 18f_{i+1} - 9f_{i+2} + 2f_{i+3}]² & +
      1040[2f_{i} - 5f_{i+1} + 4f_{i+2} - f_{i+3}]² \\[-0.7ex]
                                                                   & + 9732[-f_i + 3f_{i+1} - 3f_{i+2} + f_{i+3}]²
    \end{aligned}
  \end{aligned}
\end{equation}
\vspace{1cm}
\begin{equation}
  \begin{aligned}
    S₀^+ & =
    \begin{aligned}[t]
      \frac{240}{36}[11f_i - 18f_{i-1} + 9f_{i-2} - 2f_{i-3}]² +
      1040[2f_i - 5f_{i-1} + 4f_{i-2} - f_{i-3}]² \\[-0.7ex]
      {} + 9732[f_i - 3f_{i-1} + 3f_{i-2} - f_{i-3}]²
    \end{aligned} \\
    S₁^+ & =
    \begin{aligned}[t]
      \frac{240}{36}[f_{i-2} - 6f_{i-1} + 3f_{i} + 2f_{i+1}]² +
      1040[-2f_{i} + f_{i-1} + f_{i+1}]² \\[-0.7ex]
      {} + 9732[-3f_i + 3f_{i-1} - f_{i-2} + f_{i+1}]²
    \end{aligned} \\
    S₂^+ & =
    \begin{aligned}[t]
      \frac{240}{36}[-2f_{i-1} - 3f_{i} + 6f_{i+1} - 2f_{i+2}]² +
      1040[-2f_{i} + f_{i-1} + f_{i+1}]² \\[-0.7ex]
      {} + 9732[3f_i - f_{i-1} - 3f_{i+1} + f_{i+2}]²
    \end{aligned} \\
    S₃^+ & =
    \begin{aligned}[t]
      \frac{240}{36}[-11f_{i} + 18f_{i+1} - 9f_{i+2} + 2f_{i+3}]² +
      1040[2f_{i} - 5f_{i+1} + 4f_{i+2} - f_{i+3}]² \\[-0.7ex]
      {} + 9732[-f_i + 3f_{i+1} - 3f_{i+2} + f_{i+3}]²
    \end{aligned}
  \end{aligned}
\end{equation}

\end{document} 

在此处输入图片描述

相关内容