Today while googling about producing mathematical graphics in LaTeX for the reedition of my Math Handbook, I stumbled upon a page on TUG pointing to an article named Avoid eqnarray!.
The article goes on to discuss why it’s a bad idea ™ to use the eqnarray environment (and it’s natural companion eqnarray*) in LaTeX for producing series of equations or long algebraic manipulations.
That came quite as a surprise to me, since I grew up using eqnarray as an indispensable tool in my LaTeX toolbox – I can trace it back to my very first LaTeX documment back in high school as far as 2000. It’s been more than seven years of my using the wrong environment!
Anyways, I decided to share the link to the article here so I can help spread the word about it (though I have no hope of converting 32k lines of LaTeX legacy content anytime soon…). By the way, if you don’t want to read the PDF, all you’ve got to do to make your code OK is use the align environment contained in the amsmath package. What you currently write as:
1 2 3 4 | \begin{eqnarray*} x^2 &=& y^2 + z^2 \\ &=& z^2 + w^2 \end{eqnarray*} |
Should become:
1 2 3 4 | \begin{align*} x^2 &= y^2 + z^2 \\ &= z^2 + w^2 \end{align*} |
… and you’ll be all set.
Hi Fernando, thank you for sharing it.
I was reading the article written by Lars Madsen:
http://www.tug.org/pracjourn/2006-4/madsen/madsen.pdf
He gives a good explanation for how come is better to use “align” instead of “eqnarray” environment.
The first problem is the spacing inconsistency. Other kind of problems happen as well, like citing the wrong formula.
Regards,
Alexandre.