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
  • 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. Jul 1, 2021 at 19:54

1 Answer 1

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}

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

\hyperref[secondsection]{test}

\hyperref[firstappendix]{Appendix}

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

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

\end{document}
1
  • 1
    \autoref{appendix:appendix1} works like a charm it produces Appendix A Nov 1, 2023 at 10:15

You must log in to answer this question.

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