# Problems with eqalign

The following will not compile with LaTeX. Can you give advice, please?

\documentclass[12pt]{article}
\usepackage{amsmath,amsthm,amssymb}
\begin{document}

\eqalign{a_1&=1+2+3\cr a_1+a_2 &=1+2+3+4\cr a_1+a_2+a_3 &=1+2+3+4+5\cr}
\end{document}

-
Welcome to TeX.sx! A tip: If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it). –  Anke Mar 18 '13 at 12:18
Isn't \eqalign plain TeX? If you're using amsmath anyway, I would recommend just using an align environment, i.e. \begin{align} a_1 &= 1+2+3\\ a_1+a_2 &= ... \end{align} –  benwilfut Mar 18 '13 at 12:25

I think you should use it like:

\documentclass[12pt]{article}
\usepackage{amsmath}
\begin{document}

\begin{align}
a_1         &= 1+2+3     \\
a_1+a_2     &= 1+2+3+4   \\
a_1+a_2+a_3 &= 1+2+3+4+5
\end{align}
\end{document}


-