[Tex/LaTex] Which command should I use for displayed equations

amsmathequationsmath-mode

A number of related questions have already been asked about this issue:

But I'm still confused by the conflicting suggestions that have been given so far. So I'm trying again.

Which should be the preferred command to produce a displayed equation in my LaTeX documents?

So far the suggestions indicate that one should use \[ ... \], maybe \begin{equation*} ... \end{equation*}, or maybe even the gather* or align* environments from amsmath.

And one should definitely avoid using either $$...$$ or the eqnarray environment.

Now I have to say that, from a language perspective, I have a strong preference for the equation* environment because it is less cryptic than the \[ ... \] notation and it is semantically the most accurate.

So, is it fine to use equation*? Maybe only after loading amsmath? Or should the equation/equation* environment be redefined to something else so that spacing, package support, or whatever is improved?

Best Answer

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.

Related Question