amsmath 中的多个多行方程

amsmath 中的多个多行方程

我遇到了以下问题。我有多个方程式需要对齐和编号,但其中一些方程式太长,无法放在一行中。

这是我的小例子:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\huge Here are my equations:
\begin{align}
 A & = B should be numbered \\
 A & = C another very long equation which must be split at a resaonable place, but still numbered
\end{align}
\end{document}

enter image description here

答案1

以下是 3 种可能性,希望能够说明问题。我假设有两组对齐方式,第二组有很长的方程式:

\documentclass[11pt]{article}
\usepackage{mathtools}

\begin{document}

Here are my equations:

\begin{align}
  \shortintertext{with \texttt{aligned}: }
  A & = B & \text{should be } & \text{ numbered }\\
  A & = C & \text{another very long } & \!\begin{aligned}[t] & \text{ equation which must be split} \\
  & \text{ at a reasonable place,}\\
  & \text{ but still numbered} \end{aligned}
\end{align}

\begin{align}
  \shortintertext{with \texttt{aligned} again: }
  A & = B & \text{should be } & \text{ numbered }\\
  A & = C & \text{another very long } & \!\begin{aligned}[t]  \text{ equation which must be split} &   \\
  \text{ at a reasonable place,} & \\
  \text{ but still numbered} &  \end{aligned}
\end{align}

\begin{align}
  \shortintertext{A variant with \texttt{multlined}: }
  A & = B & \text{should be }        & \text{ numbered }                                            \\
  A & = C & \text{another very long } & \!\begin{multlined}[t]  \text{ equation which must be split} \\
  \text{ at a reasonable place,}\\[-0.8ex]
  \text{ but still numbered}
  \end{multlined}
\end{align}

\end{document}

enter image description here

答案2

正如上面的@Christian Hupfer 评论所建议的那样

\documentclass{article}
\usepackage{mathtools}

\begin{document}
\huge Here with multlined:
\begin{align}
 A & = B should be numbered \\
 A & = \begin{multlined}[t][0.7\textwidth]
        C + another + very +\\ 
        long + equation + which + \\
        must + bev split + at + \\
        a + resaonable + place, +  \\
        but + still + numbered
        \end{multlined}
\end{align}
or with split
\begin{align}
 A = \; & B should be numbered \\
\begin{split}
 A =\; & C + another + very +\\
   &    long + equation + which + \\
   &    must + bev split + at + \\
   &    a + resaonable + place, +  \\
   &    but + still + numbered
        \end{split}
\end{align}
\end{document}

enter image description here

相关内容