2

I am using \hyperlink{name}{text} to link different sections of my document. In {name} I write the number of the section, such as 3.4.1 and in {text} I write what I want to appear in the document. However, appendices are not numbered (they simply appear as Appendix A, Appendix B, Appendix C... followed by the title of the appendix). How can I link them using \hyperlink{name}{text}?

  • 1
    Actually, the appendices are numbered using the section or chapter counter (depending on the document class). They simply use \Alph instead of \arabic in \thesection. If you look in the aux file you should see the anchor names as the last entry in \newlabel. – John Kormylo Jul 01 '21 at 19:54

1 Answers1

5

As you can see in the question Different mechanics of \hyperlink vs. \hyperref you are currently relying on labels that are automatically created. For the appendix you apparently need to set the labels yourself using \label and referecing using \hyperref (something I would recommend). Also have look at the hyperref manual

Here is an example for your case:

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

% This relies on the automatically created label \hyperlink{section.1}{Link To Introduction}

\hyperref[secondsection]{test}

\hyperref[firstappendix]{Appendix}

% You might enjoy this, because it automatically includes the sectionname \autoref{firstappendix}

\clearpage % this will create an automatic label section.1 - % This will change if you add a section before this one! \section{Introduction} \clearpage \section{Second Section}\label{secondsection} \clearpage \appendix \section{First Appendix}\label{firstappendix}

\end{document}

nhck
  • 740