Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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)?

share|improve this question
1  
Related question: Suppress equation number when not refered to –  Martin Scharrer Aug 24 '11 at 18:41

2 Answers 2

up vote 11 down vote accepted

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 \tabeq

\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}
share|improve this answer
2  
For standard LaTeX math environments you can also use \nonumber, but amsmath is recommended which uses \notag. There is also \tag{<label>} which allows you to set any other text instead of the number. –  Martin Scharrer Aug 24 '11 at 18:37
1  
You need to \notag the third line as well... –  Seamus Aug 24 '11 at 20:41
    
Thanks! This is really useful! One question I still have though is, if I only want to tag one equation out of many, is there a way to do it without using \notag a bunch of times? Is there a way to use \tag in an align* environment but to have it follow the numbering of the document? –  Alan C Aug 25 '11 at 4:24
    
@Alan C: I edit my post. –  Marco Daniel Aug 25 '11 at 16:13
\documentclass{article}
\usepackage{mathtools}
\mathtoolsset{showonlyrefs}
\begin{document}

\begin{align}
 y &= x+y \\
 y &= x-y \label{1} \\
 y &= xy
\end{align}

See Eqn.~\refeq{1} \ldots
\end{document}

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.