# Selective equation numbering in LaTeX [duplicate]

Possible Duplicate:
How do I number equations only if they are referred to in the text?

I would like to number only the equations I actually refer in a manuscript. I know plenty of ways to do this manually, but as the manuscript progresses and I change which equations I refer to later I am likely to forget to change the display style of those equations.

I would really like a way to make latex automatically recognize that an equations is being referred and typeset all equations not referred unnumbered, and typeset all equations that are referred using \ref{} with numbers in the right margin.

-

## migrated from stackoverflow.comAug 16 '11 at 10:40

This question came from our site for professional and enthusiast programmers.

## marked as duplicate by Seamus, lockstep, Caramdir, Alan Munn, Martin Scharrer♦Aug 17 '11 at 16:57

\usepackage{mathtools}

Awkwardly, as pointed out in the comments, this only works if each equation is referenced at least once with \eqref. (As long as there is one \eqref, other \refs to the same equation will work.
(Originally a proposed edit by user7295) You might also have to use \eqref instead of \ref. –  lockstep Aug 17 '11 at 12:09