eqnarray
¶The eqnarray
environment is obsolete. It has infelicities,
including spacing that is inconsistent with other mathematics elements.
(See “Avoid eqnarray!” by Lars Madsen
https://tug.org/TUGboat/tb33-1/tb103madsen.pdf). New documents
should include the amsmath
package and use the displayed
mathematics environments provided there, such as the align
environment. We include a description only for completeness and for
working with old documents.
Synopsis:
\begin{eqnarray} first formula left &first formula middle &first formula right \\ ... \end{eqnarray}
or
\begin{eqnarray*} first formula left &first formula middle &first formula right \\ ... \end{eqnarray*}
Display a sequence of equations or inequalities. The left and right sides are typeset in display mode, while the middle is typeset in text mode.
It is similar to a three-column array
environment, with items
within a row separated by an ampersand (&
), and with rows
separated by double backslash \\
).
The starred form of line break (\\*
) can also be used to separate
equations, and will disallow a page break there (see \\
).
The unstarred form eqnarray
places an equation number on every
line (using the equation
counter), unless that line contains a
\nonumber
command. The starred form eqnarray*
omits
equation numbering, while otherwise being the same.
The command \lefteqn
is used for splitting long formulas across
lines. It typesets its argument in display style flush left in a box of
zero width.
This example shows three lines. The first two lines make an inequality, while the third line has not entry on the left side.
\begin{eqnarray*} \lefteqn{x_1+x_2+\cdots+x_n} \\ &\leq &y_1+y_2+\cdots+y_n \\ &= &z+y_3+\cdots+y_n \end{eqnarray*}