# Numbering equation using eqnarray*

I am using eqnarray to write long equations. However when I use it instead of equation environment the equations are not numbered. Can anyone help me to solve this.

This is the syntax that I am using.

\begin{eqnarray*}
f_{lin}(z) & = &  f(z_{0}) +
\frac{\partial f(z)}{\partial \ddot{\theta}}\bigg|_{z = z_{0}}\ddot{\theta} +
\frac{\partial f(z)}{\partial \ddot{\alpha}}\bigg |_{z = z_{0}}\ddot{\alpha} +
\frac{\partial f(z)}{\partial \dot{\theta}}\bigg |_{z = z_{0}}\dot{\theta} \\
& &  + \frac{\partial f(z)}{\partial \dot{\alpha}}\bigg |_{z = z_{0}}\dot{\alpha} +
\frac{\partial f(z)}{\partial \theta}\bigg |_{z = z_{0}}\theta +
\frac{\partial f(z)}{\partial \alpha}\bigg |_{z = z_{0}}\alpha
\end{eqnarray*}

-
Don't use eqnarray – Ryan Reich Jun 14 '14 at 14:50
The * form means don't number use eqnarray to get a number (but better to use align) – David Carlisle Jun 14 '14 at 14:55

In addition to recommending that you use the align environment (provided by the amsmath package) instead of the eqnarray* environment, I would also suggest you make each line's first + symbol the alignment point, rather than the = symbol; that way, the structure of the equation should become very readily apparent. And, since the string \bigg|_{z = z_{0}} occurs no fewer than six times, it's handy to create a shortcut macro for it.

\documentclass{article}
\usepackage{amsmath} % provides the "align" environment
\newcommand\atz{\bigg\vert_{z=z_0}\!} % a shortcut macro
\begin{document}
\begin{align}
f_{\textit{lin}}(z) =  f(z_{0})
&+
\frac{\partial f(z)}{\partial \ddot{\theta}}\atz \ddot{\theta} +
\frac{\partial f(z)}{\partial \ddot{\alpha}}\atz \ddot{\alpha} +
\frac{\partial f(z)}{\partial \dot{\theta}}\atz \dot{\theta} \notag \\
&+ \frac{\partial f(z)}{\partial \dot{\alpha}}\atz \dot{\alpha} +
\frac{\partial f(z)}{\partial \theta}\atz \theta +
\frac{\partial f(z)}{\partial \alpha}\atz \alpha
\end{align}
\end{document}


If you don't want to use the align environment, you could use a split environment inside an equation environment; the main difference is that there's a single equation number that's centered vertically across the rows of the equation:

\documentclass{article}
\usepackage{amsmath}
\newcommand\atz{\bigg\vert_{z=z_0}\!} % a shortcut macro
\begin{document}
$$\begin{split} f_{\textit{lin}}(z) = f(z_{0}) &+ \frac{\partial f(z)}{\partial \ddot{\theta}}\atz \ddot{\theta} + \frac{\partial f(z)}{\partial \ddot{\alpha}}\atz \ddot{\alpha} + \frac{\partial f(z)}{\partial \dot{\theta}}\atz \dot{\theta} \\[1ex] % some additional vertical separation &+ \frac{\partial f(z)}{\partial \dot{\alpha}}\atz \dot{\alpha} + \frac{\partial f(z)}{\partial \theta}\atz \theta + \frac{\partial f(z)}{\partial \alpha}\atz \alpha \end{split}$$
\end{document}

-
in this case, aligned would work the same as split within a single equation. – barbara beeton Jun 14 '14 at 20:20
+1 split is the way to go. – Andrew Swann Jun 15 '14 at 11:33

Load ackage amsmath and then use:

\begin{align}
f_{lin}(z) & =  f(z_{0}) +
\frac{\partial f(z)}{\partial \ddot{\theta}}\bigg|_{z = z_{0}}\ddot{\theta} +
\frac{\partial f(z)}{\partial \ddot{\alpha}}\bigg |_{z = z_{0}}\ddot{\alpha} +
\frac{\partial f(z)}{\partial \dot{\theta}}\bigg |_{z = z_{0}}\dot{\theta} \\\nonumber
& \quad  + \frac{\partial f(z)}{\partial \dot{\alpha}}\bigg |_{z = z_{0}}\dot{\alpha} +
\frac{\partial f(z)}{\partial \theta}\bigg |_{z = z_{0}}\theta +
\frac{\partial f(z)}{\partial \alpha}\bigg |_{z = z_{0}}\alpha
\end{align}

-