1

Here is the Springer Nature template on Overleaf, here is the download version.

I can reference a table from an appendix and the displayed name is correct (e.g. Table A1), however, the hyperlink is false and directs me to Table 1 rather than Table A1.

MWE using Springer Nature template:

\documentclass[pdflatex,sn-mathphys]{sn-jnl}

\begin{document}
\section{Test references}\label{sec_intro}
Table \ref{tab} in Section \ref{sec_tables}. Table \ref{tab-test} in Appendix \ref{secA1}.

\newpage
\section{Normal section}\label{sec_tables}
\begin{table}[h]
\caption{Caption text}\label{tab}%
X
\end{table}

\newpage
\begin{appendices}
\section{Appendix}\label{secA1}
\begin{table}[h]
\caption{Caption text}\label{tab-test}%
X
\end{table}
\end{appendices}

\end{document}

I'm thankful for any hint. I assume it's a problem with the sn-jnl.cls but I'm not confident at all.

1
  • Welcome to TeX.SE.
    – Mico
    Commented Dec 14, 2022 at 10:05

1 Answer 1

0

I assume it's a problem with the sn-jnl.cls.

Correct.

The Springer template in question appears to modify the appearance of the section counter and resets the counters for sections, equations, tables, and figures to zero when the appendices environment is entered. However, the template evidently fails to take care of adquately informing the hyperref package -- which, incidentally, is loaded automatically by the document class -- about this change.

The workaround? Insert the instruction

\renewcommand\theHtable{AABB\arabic{table}}

immediately after \begin{appendices}. Here, "AABB" is simply any unique string. See section 5.2., "Options for destination names", of the user guide of the hyperref package for more information on this topic.

If, in addition, you also have figure environments in the appendix and wish to cross-reference them elsewhere in the document, be sure to run

\renewcommand\theHfigure{AABB\arabic{figure}}

as well.

enter image description here

\documentclass[pdflatex,sn-mathphys]{sn-jnl}

\begin{document}

\section{Test references}\label{sec_intro}

Table \ref{tab} in Section \ref{sec_tables}. 
Table \ref{tab-testA} in Appendix \ref{sec:AppA}.


\newpage
\section{Normal section}\label{sec_tables}

\begin{table}[h] \caption{Caption text}\label{tab} XYZ \end{table}

\newpage
\begin{appendices}

%% For use with 'hyperref': Choose a unique identifier, e.g., 
%%   the string 'AABB', to redefine the '\theHtable' macro
\renewcommand\theHtable{AABB\arabic{table}} % <-- new

\section{Supplemental Material}\label{sec:AppA}
\begin{table}[h] \caption{Caption text}\label{tab-testA} UVW \end{table}

\end{appendices}

\end{document}
1
  • Thank you so much, works like a charm. So happy I don't need to change the template cls file!
    – Jay
    Commented Dec 14, 2022 at 10:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .