[Tex/LaTex] In align environment, how can you label some (but not all) of the equations

aligncross-referencing

I know that the align environment labels all the lines, while the align* environment labels none of the lines. Is there a way to have the align environment label only some of the lines?

For example, suppose I have something like this:

\begin{align}
x+y 
\\
x-y 
\\
xy
\end{align}

This labels all three lines. Is there a way to only label, say, the second line (x-y)?

Best Answer

Use the command \notag

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
x+y 
\notag\\
x-y 
\\
xy
\end{align}
\end{document}

EDIT: You can also use the command \nonumber (see comment)

EDIT: If you want to tag only one equation you can use \tag. In the following example I combine the command \tag with \refstepcounter to create the command \tageq

\documentclass{article}
\usepackage{amsmath}
\newcommand*\tageq{\refstepcounter{equation}\tag{\theequation}}
\begin{document}
\begin{align*}
x+y 
\\
x-y \tageq\label{1}
\\
xy
\end{align*}

\ref{1}
\end{document}
Related Question