You should use the environments from amsmath. In practice, equation
and align
are all you usually need.
If you have a single equation, use equation
. (Or equation*
if you don't want it numbered. Most of the other environments below also have similar * variants.)
If you have a single equation spanning multiple lines, you can either use multline
, or use split
(inside equation
) to have the parts aligned.
If you have multiple equations and you want them to be aligned, use align
(or align*
).
If you simply want to typeset multiple equations independently (with no alignment), use gather
.
There are also flalign
and alignat
, for some special cases. See the Short Math Guide for LaTeX or texdoc amsldoc
(PDF) for more documentation on these environments.
\[
simply says "set the following in a math display", like plain TeX 's $$
(which you should not use), and is equivalent to displaymath
. You can use it if you want an unnumbered equation and are too lazy to type (not good practice, semantically speaking), or, I guess, when you're simply "displaying" some long bit of mathematics that isn't an actual equation. And never use eqnarray.
the equation
environment is meant for a "single" equation, which may be either one line or a "subsidiary" multi=line group such as aligned
. it will not break, even with an explicit \displaybreak
.
furthermore, nesting align
within equation
will produce an error message:
! Package amsmath Error: Erroneous nesting of equation structures;
(amsmath) trying to recover with `aligned'.
trying to use \displaybreak
in this situation will produce another error:
! Package amsmath Error: \displaybreak cannot be applied here.
error messages should be heeded.
if you remove the equation
environment and simply use align
, in the presence of the global \allowdisplaybreaks
command, the multi-line display will break at the end of a page at the normal page length. even without \allowdisplaybreaks
, an explicit \displaybreak
will force a break after the line on which the command appears.
if no numbers are wanted on any line, the environment align*
can be used. and if only a single tag is wanted for the group, with align*
it is possible to insert a manual label using the \tag{...}
command on the desired line. the value will have to be handled manually. to do that, just before the display, issue the command
\stepcounter{equation}
and for the explicit label, use \tag{\theequation}
.
Best Answer
Don't use successive
equation
s to number a system of equations. Rather usealign
which naturally numbers each in the same, consistent way. To avoid selective numbering, use\nonumber
(or\notag
), and to provide unique tags to select equations, use\tag{<tag>}
.The starred version
align*
removes all automatic numbering (like placing\nonumber
next to each equation).align
does make sure the successive equations don't overlap, and also that the equations align horizontally with the placed&
alignment marks.aligned
is similar, but is typically used to create an alignment with a single number. Here is the same example withaligned
: