[Tex/LaTex] eqnarray vs align



I want to include a list of related equations, say, for a proof, in my LaTeX document. As far as I know, I have two good options, eqnarray and align.


What is the difference between eqnarray and align, and how do I know which I should be using? Or does it matter at all?

Best Answer

Although eqnarray may seem to work "well enough", Avoid eqnarray! Avoid eqnarray! Avoid eqnarray!

Two main problems are mentioned in the doc above:

  • eqnarray sets horizontal space around the = operator that is not consistent with the space set in other environments, such as \[...\] or $$...$$ (it is wider).
  • eqnarray (also eqnarray* !) has an ill-defined equation numbering, which leads to numbering errors on referencing—mostly when using the command \nonumber

Use align and the rest of the ams environments. See texdoc amsldoc (PDF) or the short math guide for LaTeX for documentation on how to use them.

Related Question