除了手动检查我无知地使用 eqnarray 的十几个实例之外,都必须将其全部更改为 align。
我首先尝试执行 finad replace all 并替换 align,然后例如进行以下更改:
\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}
最初只是
\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}
现在我收到数百个错误提示,仅由这四个组成
! LaTeX Error: Environment align undefined.
! Misplaced alignment tab character &.
! Missing $ inserted.
! Extra }, or forgotten $.
还有希望吗?
答案1
环境align
由包定义amsmath
。将其添加\usepackage{amsmath}
到您的序言中,一切就都好了。