One important difference is that split
obeys to the centertags
(default) or tbtags
option. Here is an example
\documentclass[twocolumn]{article}
\usepackage[
% tbtags,
% leqno,
]{amsmath}
\begin{document}
\begin{align}
a&=b\\
\begin{split}
c&=d+{}\\
&=e+{}\\
&=f
\end{split}\\
g&=h
\end{align}
\end{document}
Now the same with uncommented tbtags
:
Now also leqno
is uncommented:
To the contrary, aligned
will have the equation number according to the vertical alignment option: centered for \begin{aligned}...\end{aligned}
, at the top for \begin{aligned}[t]...\end{aligned}
, at the bottom for \begin{aligned}[b]...\end{aligned}
. Thus it's better to use split
whenever possible, if equation numbers are involved. (I rarely use equation numbers, so I usually don't bother.)
The first difference we find is in the syntax for calling the two environments:
\begin{align}
doesn't want an additional argument, while
\begin{alignat}{<number>}
requires it. Both environments create alignments based on pairs of rl
columns; align
will create as many as desired based on the environment's contents, while alignat
requires you to specify how many pairs you want in advance.
However, the two environments differ much more than described above. The align
environment will add horizontal space between the column pairs
<r col><l col> <space> <r col><l col> <space> <...>
while alignat
will insert no horizontal space. For an instance, see Align-environment: Align on the left side, where an alignment of type
<l col><l col>
is desired, which is obtained by using empty right aligned columns:
\begin{alignat}{2}
&ABC &&= ABC - AB\\
&ABCD &&= ABC - ABCDEFG
\end{alignat}
Both environments have an implicit {}
at the beginning of cells in the left aligned columns, to help getting good spacing when a cell starts with a relation or operation symbol.
Other uses of alignat
are when we want finer control on the horizontal spacing between (pairs of) columns. Such spacing should be specified explicitly such as in
\begin{alignat*}{3}
& m \quad && \text{módulo} \quad && m>0\\
& a \quad && \text{multiplicador} \quad && 0<a<m\\
& c \quad && \text{constante aditiva} \quad && 0\leq c<m\\
& x_0 \quad && \text{valor inicial} \quad && 0\leq x_0 <m
\end{alignat*}
(see Aligning equations with text with alignat). Such a control is not possible with align
, because it adds the same horizontal space between all column pairs.
Both environments have the *
form and accept \tag
or \notag
in any row.
There are also the “inner” versions aligned
and alignedat
, that obey the same rules, for use inside math mode (inline formulas, displayed formulas, math alignments).
Best Answer
I've always found the description of
alignat
based on the number of&
tokens confusing. It's simpler than that: first you decide how many parts your alignment consists of, then adjust the number of&
tokens.Both
align
andalignat
build tables consisting of pairs of a right aligned column and a left aligned column.The argument to
\begin{alignat}
tells how many pairs you want. So, for instance,\begin{alignat}{3}
sets things up for a total of six columns (three pairs); therefore the number of&
in each line is five.