2

I have supplemental material, which should have its own set of figures, equations, etc. These can be numbered correctly by resetting the figure counter and adding "S" to the label. However, when I do this, the hyperlink to Figure S1 goes to Figure 1.

How can I fix this? A potential workaround would be to set the figure counter to 10 instead of 0 upon starting the supplemental material, then printing S(n-10), but I can't figure out how to do that. I'm using revtex but I'm not sure it makes a difference in this case.

MWE, in which the link to S1 points at Figure 1.

\documentclass{article}
\usepackage{hyperref}
\begin{document}

\begin{figure}\caption{Main figure}\label{fig:1}\end{figure}

Reference to Figure \ref{fig:1}.
\clearpage

\setcounter{figure}{0}
\renewcommand{\thefigure}{S\arabic{figure}}

\begin{figure}\caption{Supplemental figure}\label{fig:s1}\end{figure}

Reference to Figure \ref{fig:s1}.

\end{document}

1 Answer 1

2

If you change hyperref's command as well, the hyperlink to Figure S1 points to the right figure.

\documentclass{article}
\usepackage{hyperref}
\begin{document}

\begin{figure}\caption{Main figure}\label{fig:1}\end{figure}

Reference to Figure \ref{fig:1}.
\clearpage

\setcounter{figure}{0}
\renewcommand{\thefigure}{S\arabic{figure}}
\renewcommand{\theHfigure}{S\arabic{figure}}

\begin{figure}\caption{Supplemental figure}\label{fig:s1}\end{figure}

Reference to Figure \ref{fig:s1}.

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.