# Hidden reference to equation

How to make a hidden reference to an equation, such that \mathtoolsset{showonlyrefs=true} is overridden (assuming it is active)?

Alternatively, how to switch off showonlyrefs temporarily (regardless of whether it be set or not)?

You can use the command \noeqref{<label>}. This ensures that the corresponding equation has a number regardless of the value of showonlyrefs.

MWE:

\documentclass[a4paper,12pt]{report}

\usepackage{mathtools}
\mathtoolsset{showonlyrefs=true}

\begin{document}

$$\label{eq:ab}\noeqref{eq:ab} a=b$$
%
Some text follows
%
$$\label{eq:bc} b=c$$
%
Some text follows again
%
$$\label{eq:dc} d=c$$

\end{document}


Output: