Package mathtools with showonlyrefs switch swallows parts of equation numbers in appendices
4,723
For this feature of \mathtools
to work you need to reference the equations using \eqref
, not \ref
.
\documentclass{revtex4}
\usepackage{mathtools}
\mathtoolsset{showonlyrefs}
\begin{document}
\section{section}
See \eqref{eqn a b} and \eqref{eqn b c}.
\begin{align}
a=b \label{eqn a b}
\end{align}
\begin{appendix}
\section{appendix}
\begin{align}
b=c \label{eqn b c}
\end{align}
\end{appendix}
\end{document}
Author by
highsciguy
Updated on November 05, 2020Comments

highsciguy over 2 years
I want to use the mathtools package with
showonlyrefs
to achieve that only referenced equations are numbered. In the complete document I get the expected behavior for regular equations in the subsections. In the MWE the behavior for main text and appendix is the same. For example the reference to the first numbered equation would appear as(1)
in the text. However it doesn't work for equations in appendices which should (with my preamble below) appear as(A1)
and(A2)
etc. but do all appear as(A)
. My example is:\documentclass{revtex4}% same issue for e.g. article \usepackage{mathtools} \mathtoolsset{showonlyrefs} \begin{document} \section{section} See \ref{eqn a b} and \ref{eqn b c}. \begin{align} a=b \label{eqn a b} \end{align} \begin{appendix} \section{appendix} \begin{align} b=c \label{eqn b c} \end{align} \end{appendix} \end{document}
Any idea how to have it display the complete unique reference?