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 \   
  • Try using alingn instead eqnarray
    – c.p.
    Sep 30, 2012 at 1:04
  • 1
    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, 2012 at 2:47
  • Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. Dec 28, 2018 at 18:08

2 Answers 2


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.


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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