In order to avoid wasting time in adding/removing *
s to number or not equations, I use \mathtools{showonlyrefs=true}
in the preamble.
Nevertheless, sometimes I'd like to number unreferenced equations. For instance, if just one of two subequations is referenced I want both to be numbered.
So the question is: how can I force the numbering of an unreferenced equation (or subequation) if \mathtools{showonlyrefs=true}
is used in the preamble?
1 Answer
mathtools
provides \noeqref
for this purpose. To show the number of an equation with label eq:abc
, add \noeqref{eq:abc}
. The command is similar to \nocite
for citations.
\documentclass{article}
\usepackage{mathtools}
\mathtoolsset{showonlyrefs}
\begin{document}
Reference to \eqref{1}.
\noeqref{3}
\begin{gather}
a=b \label{1} \\
a=c \label{2} \\
a=d \label{3} \\
\end{gather}
\end{document}