将方程分成多行时,sp​​lit、multline、align 和 breqn 之间有什么区别?

将方程分成多行时,sp​​lit、multline、align 和 breqn 之间有什么区别?

抱歉,这个问题听起来有点业余,但我还没有找到一个很好的总结,关于这四种多行方程式环境之间的区别。它们有什么不同,在不同情况下我应该选择哪一个?

答案1

正如评论中所述,amsmath文档breqn中有几个很好的例子,而且该mathtools包中还有几个对齐的扩展版本amsmath。但这里的通常风格是内联回答而不是参考手册,所以这是一份提供您提到的环境的基本用法的文档。

在此处输入图片描述

\documentclass{article}

\usepackage{amsmath}
\usepackage{breqn}

\begin{document}

Align, from amsmath package:
numbered equations aligned at points marked
with \verb|&| usually just before a relation.
\begin{align}
a_1& =b_1+c_1\\
a_2& =b_2+c_2-d_2+e_2
\end{align}

split, also from amsmath,
similar alignment to align, but the whole construct fits within
equation (or other display math) and is numbered as a unit.
\begin{equation}\label{xx}
\begin{split}
a& =b+c-d\\
 & \quad +e-f\\
 & =g+h\\
 & =i
\end{split}
\end{equation}

multline, from amsmath
for lonq expressions taking more than one line,
with no specifed alignment points.
\begin{multline}
a+b+c+d+e+f+g+h+i+j+k+\\
l+m+n+o+p+q+r+s+t+w+x+y+z
\end{multline}


breqn is not part of the amsmath collection and is a highly experimental
package that tries to automate the line breaking.
Here it automatically spots the relations and adds
the line breaks and alignment points.
It also automatically handles the trailing full stop after the display.
\begin{dmath}
T(n) \hiderel{\leq} T(2^{\lceil\lg n\rceil})
  \leq c(3^{\lceil\lg n\rceil}
    -2^{\lceil\lg n\rceil})
  <3c\cdot3^{\lg n}
  =3c\,n^{\lg3}
\end{dmath}.

\end{document}

相关内容