Latex 数学公式环境汇总

2023年8月7日

amsmath (CTAN): AMS mathematical facilities for LaTeX. amsldoc.pdf

The split environment is a special subordinate form that is used only inside one of the others. It cannot be used inside multline, however. split supports only one alignment (&) column; if more are needed, aligned or alignedat should be used. The width of a split structure is the full line width.

Like multline, the split environment is for single equations that are too long to fi t on one line and hence must be split into multiple lines.

所以尽量不要用split,因为它只能有一个alignment column。

The gather environment is used for a group of consecutive equations when there is no alignment desired among them; each one is centered separately within the text width.

Any equation in a gather may consist of a \begin{split} . . .\end{split} structure

The align environment is used for two or more equations when vertical alignment is desired

A variant environment alignat allows the horizontal space between equations to be explicitly specified. This environment takes one argument, the number of “equation columns”

align环境的对齐模式是:左对齐,右对齐,空白。

alignat环境的对齐模式是:左对齐,右对齐。注意没有空白。

\begin{align}
x &+ y &= z \\
a &+ b + c &= d
\end{align}

[latex]\begin{align}
x &+ y &= z \\
a &+ b + c &= d
\end{align}[/latex]

\begin{alignat}{2}
x &+ y &= z \\
a &+ b + c &= d
\end{alignat}

[latex]\begin{alignat}{2}
x &+ y &= z \\
a &+ b + c &= d
\end{alignat}[/latex]

两种环境按具体需求来选用,但如果要固定一个,就选择alignat,因为我们用\quad之类的命令手动加入空白。