[Tex/LaTex] Which one should I use: \begin{align} or \begin{aligned}
equations
Which one should I use: \begin{align} or \begin{aligned}?
Best Answer
If you have a series of equations that you want to have mutual alignment, then you would use align. If the equations are part of a larger equation, then aligned is the right environment.
I often will use \begin{equation}\begin{aligned} ... \end{aligned}\end{equation} to give a single equation number to a group, for example if I'm showing steps.
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 useeqnarray.
To make the displayed equation start hard at the left edge of the text block, you should (a) load the amsmath package with the option fleqn (short for "flush left equation", I suppose) and (b) set the \mathindent length parameter to 0pt.
Best Answer
If you have a series of equations that you want to have mutual alignment, then you would use
align
. If the equations are part of a larger equation, thenaligned
is the right environment.I often will use
\begin{equation}\begin{aligned} ... \end{aligned}\end{equation}
to give a single equation number to a group, for example if I'm showing steps.