# How to automatically avoid numbering all non referenced equations in latex?

I am writing a fairly long document and decided to pospone the decision about which equations to number, so I just wrote all my math in enviroment, planning to add all the due asterisks in a second time.

I have labeled most equations and referenced them fairly often through the document.

I was wondering if there was any way to tell Latex to check which equations I have referenced elsewhere in the document and to automatically add the asterisks to all the equations that I have not used elsewhere because that would save me some time.

EDIT: \mathtoolsset{showonlyrefs} fix did not work it just renumbered every reference to 1.1 and removed all the numbers beside equations. autonum instead removed all the numbers beside equations and replaced every reference with "??"

Load package mathtools (which loads amsmath) and add to your preamble:
\mathtoolsset{showonlyrefs}

• You could mention also autonum. With this mathtools option I've had my problems (My first question on the site :-)) Nov 16, 2019 at 13:43
• You even can load cleveref and type \cref, it will save you some typing (to be loaded after hyperref) Nov 16, 2019 at 18:36