I've now tried mathtools for the first time, for the sake of showonlyrefs. It works fine, except if I put an \eqref command into a figure caption, in which case I get:
! Argument of \@caption has an extra }.
! Paragraph ended before \@caption was complete.
Here is the MWE:
\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}
\mathtoolsset{showonlyrefs=true,showmanualtags=true} % do not number unreferenced equations
\begin{document}
\begin{equation}\label{eq:EVE-HEH}
x
\end{equation}
\begin{figure}
\caption{See eigenvalue equation \eqref{eq:EVE-HEH}.}
\end{figure}
\end{document}
What do I do wrong?
Update: Found here that \protect before \eqref in caption helps, and indeed it does. However this is not mentioned in the mathtools. Is it the right solution?