0

I hope the title is pretty self explanatory.

So basically, I would like a write an "see appendix X" in the main body, but without knowing what that appendix will be named Appendix A/B/C etc. Because I might add a new appendix later on. So what I was thinking is something a little like a combination of \ref and \item command that allows me to refer to the precise name of the section(appendix) without knowing the specific sequence and name of said appendix beforehand.

1
  • Do not forget to mark the question as solved ( if solved :-) ).
    – Gnoppi
    Jul 3, 2021 at 9:41

2 Answers 2

1

If you try with \label{appendix_1} right after the beginning of the appendix and you mention it like [Appendix \ref{appendix_1}], would it work? Because in this case, it would change the name automatically as you add new stuff in the appendix

0

Maybe you can have a look at the cleveref package.

\documentclass{article}
\usepackage[colorlinks=true]{hyperref}
\usepackage{cleveref}
\usepackage{lipsum}

\begin{document}
    \section{Section1}\label{sec:1}
    See \cref{sec:2} or \cref{ssec:2} (we capital letter: \Cref{sec:2} or \Cref{ssec:2})
    You can even get the titles: See \nameref{sec:2} or \nameref{ssec:2}
    
    \subsection{Subsection1}\label{ssec:1}
    \lipsum[2]
    
    \appendix
    \section{Section2}\label{sec:2}
    See \cref{sec:1} or \cref{ssec:1}
    
    \subsection{Subsection2}\label{ssec:2}
    \lipsum[2]
\end{document}

enter image description here

2
  • *with capital letter, of course!
    – NBur
    Jul 2, 2021 at 9:30
  • From the example provided, it seams the question is about number of appendix, not its name. Simple \lebl/\ref does the job. Jul 3, 2021 at 1:36

You must log in to answer this question.

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