[Tex/LaTex] I used eqnarray ignorantly and now must change all to align.. any solutions

alignequations

Other than manually going over all the dozen plus instances where I ignorantly used eqnarray must all be changed to align.

I first tried doing a finad replace all and replaced align, and then, for example, making the changes:

\begin{align}
S(x) &= S_0+S_1 x+\sum_{n=2}^\infty S_{n+1} x^n - \sum_{n=2}^\infty S_{n-1} x^n  -\sum_{n=2}^\infty x^n\\
&= S_0+S_1 x+\frac{1}{x}\sum_{n=2}^\infty S_{n+1} x^{n+1} - x\sum_{n=2}^\infty S_{n-1} x^{n-1}  -\sum_{n=2}^\infty x^n\\
&= S_0+S_1 x+\frac{1}{x}(S(x) - S_0 - S_1 x -S_2 x^2) - x(S(x) - S_0 )  -\frac{x^2}{1-x}
\end{align}

To what was initially just

\begin{eqnarray}
S(x) = S_0+S_1 x+\sum_{n=2}^\infty S_{n+1} x^n - \sum_{n=2}^\infty S_{n-1} x^n -\sum_{n=2}^\infty x^n\\
 S(x) = S_0+S_1 x+\frac{1}{x}\sum_{n=2}^\infty S_{n+1} x^{n+1} - x\sum_{n=2}^\infty S_{n-1} x^{n-1} -\sum_{n=2}^\infty x^n\\
 S(x) = S_0+S_1 x+\frac{1}{x}(S(x) - S_0 - S_1 x -S_2 x^2) - x(S(x) - S_0 ) -\frac{x^2}{1-x} 
\end{eqnarray}

Now I am getting hundreds of error prompts, constituted solely of these four

! LaTeX Error: Environment align undefined.
! Misplaced alignment tab character &.
! Missing $ inserted.
! Extra }, or forgotten $.

Is there any hope?

Best Answer

The align environment is defined by the amsmath package. Add \usepackage{amsmath} to your preamble and all should be well.

Related Question