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.

This question already has an answer here:

Is is possible to use only equation or align environments without the * and then automatically suppress the equation number if there is nothing refering to that equation? It would make the LaTeX-life much easier I think.

share|improve this question

marked as duplicate by lockstep, Jesse, Thorsten, Martin Schröder, Peter Jansson Jan 23 at 13:23

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2  
See also tex.stackexchange.com/questions/4728/… –  Lev Bishop Apr 14 '11 at 14:12

2 Answers 2

up vote 13 down vote accepted

see package mathtools and section "3.2.2 Showing only referenced tags". You'll get the documentation by running texdoc mathtools or run texdoctk if you run Linux

share|improve this answer
    
Thanks! The package looks very useful. –  Jonas Teuwen Apr 14 '11 at 13:31

I coded up a workaround before I noticed Herbert's answer. Here it is anyway:

\documentclass{article}
% TEX.SE \url{http://tex.stackexchange.com/q/15820/1402}
\usepackage{amsmath}
\usepackage{etoolbox}

\makeatletter
\appto{\equation}{%
  \notag
  \preto{\label}{%
    \refstepcounter{equation}
    \tag{\arabic{equation}}%
  }
}
\makeatother

\begin{document}

\begin{equation}
A = A
\end{equation}

\begin{equation}\label{B}
B = B
\end{equation}

\begin{equation}
C = C
\end{equation}

Proof: See Equation~\ref{B}.

\end{document}

It's my first use of the etoolbox macros to prepend and append code to hooks. This method first appends \notag to every equation beginning, thus suppressing equation numbering; then prepends to \label the code which steps the counter and resets the tag.

share|improve this answer

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