# How can I label only one line of an equation array?

Consider the following commands to create a labelled multi-line equation array:

\begin{eqnarray}
\label{eqn:1}
X&=&Y+Z\\
&\leq & U \times W.

\end{eqnarray}


It creates a two-line equations with two numbers. How can I associate only one equation number to this two-line equations? or better, how can I associated different equation numbers to each line? (of course, without breaking the equation array into several disjoint equations!)

-
Please don't use eqnarray. See \eqnarray vs \align. – Werner Sep 29 '13 at 6:04

amsmath provides a similar interface to eqnarray, but is better in terms of it's horizontal spacing/alignment:

\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\begin{document}
\begin{align}
X &= Y + Z \label{eqn:1} \\
&\leq U \times W. \nonumber \\
& = Y + Z \tag{a}
\end{align}
\end{document}


\nonumber removes the number for that line in the align environment. \tag can also be used to create a manual tag.

-
Though I never use it myself. I still forget when answering questions on this site that it's recommended not to use eqnarray. – A.Ellett Sep 29 '13 at 6:18
\tag*{a} for labels without parentheses – Herbert Sep 29 '13 at 6:33
Thanks for your answer. – Vahid Shirbisheh Sep 29 '13 at 6:41

if only one equation number is wanted for a group, the split environment from amsmath is a reasonable candidate; it must be "wrapped" in an equation environment for the equation number to appear.

if all the equations in a group are to be numbered, then (as pointed out in other answers) the align environment is more suitable.

$$\begin{split} X &=Y+Z\\ &\leq U \times W \end{split} \label{eqn:1}$$

\begin{align}
X &=Y+Z \label{eqn:2}\\
&\leq U \times W \label{eqn:3}
\end{align}


-
All these cases are applicable from time to time. Thanks for your answer. – Vahid Shirbisheh Sep 29 '13 at 14:50

Use \notag:

\begin{eqnarray}
\label{eqn:1}
X&=&Y+Z\\
\notag
&\leq & U \times W.
\end{eqnarray}


But, as @werner reminds us, it is not advised to use eqnarray, align does a better job:

\begin{align}
\label{eqn:1}
X & = Y + Z \\
\notag & \leq  U \times W.
\end{align}


This requires that you load the package amsmath to have access to \notag

Math environments in LaTeX are not happy with empty lines. If you want each line to have a number, just don't use \notag.

See How to get only one vertically centered equation number in align environment with two equations for how to get one equation number for multiple lines.

-
Thanks for your answer. How can I label each line individually? – Vahid Shirbisheh Sep 29 '13 at 5:50
@VahidShirbisheh -- instead of \notag, put a \label on the second line. each line can be individually labeled for later reference. – barbara beeton Sep 29 '13 at 13:24