I am hyperlinking with
\usepackage{hyperref}
and using the following command to start a Supplementary Information section:
\begin\newcommand{\beginsupplement}{
\setcounter{section}{0}
\renewcommand{\thesection}{S\arabic{section}}
\setcounter{equation}{0}
\renewcommand{\theequation}{S\arabic{equation}}
\setcounter{figure}{0}
\renewcommand{\thefigure}{S\arabic{figure}}}
Before I call \usepackage{hyperref}, the equations, figures, and sections are all numbered 1, 2, ... and link properly to the equations, figures, and sections that they refer to.
After I call \usepackage{hyperref}, the equations, figures, and sections are all numbered S1, S2, ... and the equations and sections link properly. However, the figures inexplicably do not.
My figures are labeled as
\begin{figure*}
\centering
\includegraphics[width=8cm]{subfig1.png}
\includegraphics[width=8cm]{subfig2.png}
\vspace{0.5cm}
\includegraphics[width=8cm]{subfig3.png}
\includegraphics[width=8cm]{subfig4.png}
\caption{Caption text here.}
\label{fig:spresults1}
\end{figure*}
The number S3 appears properly when I reference Fig. S3 in the Supplementary Information, but when I click the link, it takes me to Fig. 3 in the main text. However, equations and sections work properly - Eq. S14 links to Eq. S14 not Eq. 14.
\ref itself is working fine, but I think there is an issue in the hyperref package. Does anyone know a way around this?