TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have this problem all the time: I am trying to write a very large polynomial, but when I use eqnarray it does not look very nice. Is there a way to make it look nicer ? I am using a two column template so it I have limited space.

&& B =-0.76562-2.38354S-0.17144R+0.81956\lambda      \nonumber \\
&&-0.18059SR+0.14635S\lambda+0.0253R\lambda+0.02885S^2 \nonumber \\

share|improve this question
Try using alingn instead eqnarray – c.p. Sep 30 '12 at 1:04
I fully agree with all exhortations that you should use an align environment instead of an eqnarray environment. The eqnarray environment suffers from several rather severe shortcomings. However, if you absolutely must use the latter environment anyway, at least start off the first line with B&=&-0.76562 instead of && B =-0.76562. – Mico Sep 30 '12 at 2:47

Your interest in prettifying the expression is most likely around the alignment. Regardless, don't use eqnarray. Rather use the capabilities of amsmath's align environment(s):

enter image description here

\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\section{A section}
Here is some text. Your original \verb|eqnarray|:
&& B =-0.76562-2.38354S-0.17144R+0.81956\lambda      \nonumber \\
&&-0.18059SR+0.14635S\lambda+0.0253R\lambda+0.02885S^2 \nonumber \\
&&+0.00815R^2+0.00332\lambda^2-0.00112SR\lambda+0.01041S^2R\nonumber \\
&&-0.00665S^2\lambda+0.000005SR^2+0.00016S\lambda^2 \nonumber \\
&&-0.000173R^2\lambda+0.00317S^3+0.000006R^3\nonumber \\
Here is an \verb|align| version:
B &= -0.76562-2.38354S-0.17144R+0.81956\lambda \nonumber \\
  &\noeq -0.18059SR+0.14635S\lambda+0.0253R\lambda \nonumber \\
  &\noeq +0.02885S^2+0.00815R^2+0.00332\lambda^2 \nonumber \\
  &\noeq -0.00112SR\lambda+0.01041S^2R-0.00665S^2\lambda \nonumber \\
  &\noeq +0.000005SR^2+0.00016S\lambda^2-0.000173R^2\lambda \nonumber \\
  &\noeq +0.00317S^3+0.000006R^3-0.00017\lambda^3

As a motivation, see \eqnarray vs \align, where you will find additional reference to not using eqnarray.

share|improve this answer

I would recommend using the alignat environment instead as the alignment of the binary operators makes the equation easier to read:

enter image description here

Here is the extended example from Werner's solution using alignat:

enter image description here


  • Similar to the align environment, the alignat provides multiple rl alignments but without the spacing in between the pairs of rl equations. The && was necessary to make the following column left aligned (and skip past the right aligned column).
  • The {} before the plus and minus was to ensure that they were treated as binary operators.



Example from MWE:
B &= &&{}-0.76562   &&{}-2.38354S        &&{}-0.17144R       &&{}+ 0.81956\lambda \\
  &  &&{}-0.18059SR &&{}+0.14635S\lambda &&{}+0.0253R\lambda &&{}+ 0.02885S^2
Extended example from Werner's solution:
B &= &&{}-0.76562           &&{}-2.38354S         &&{}-0.17144R          &&{}+0.81956\lambda  \\
  &  &&{}-0.18059SR         &&{}+0.14635S\lambda  &&{}+0.0253R\lambda    &&{}+0.02885S^2 \\
  &  &&{}+0.00815R^2        &&{}+0.00332\lambda^2 &&{}-0.00112SR\lambda  &&{}+0.01041S^2R\\
  &  &&{}-0.00665S^2\lambda &&{}+0.000005SR^2     &&{}+0.00016S\lambda^2 &&{}-0.000173R^2\lambda  \\
  &  &&{}+0.00317S^3        &&{}+0.000006R^3      &&{}-0.00017\lambda^3
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.