I have a paper where all equations are numbered, but I want to number equations only if they are actually referred to in the .tex file using \ref{}
. How can I make that happen? Alternatively, how can I make all equations that have no \label
next to them (because then I know I don't refer to them) not have a number? Do I have to use \nonumber
separately for each such equation?
[Tex/LaTex] How to number equations only if they are referred to in the text
cross-referencingequationsnumbering
Best Answer
The
mathtools
package provides a switchshowonlyrefs
. You could use that to achieve that only those equations would be numbered which are referred to in the text.Usage:
or
or set it to false this way if desired.