I have a small macro when referencing a section/appendix:
\newcommand{\secref}[1]{Sec.~\ref{#1}}
Now, when referencing a section, it works just fine and puts something like Sec. 2.5
. When referencing an appendix, however, it puts Sec. Appendix A
.
How does LaTeX decide whether it puts just the number (in the case of sections), or whether it puts Appendix
and the "number" A
? How can I influence this? How can I achieve a reference macro that automatically puts Sec./App./Chap. as appropriate?
cleveref
which adds the type of reference, and is customisable?cleveref
seems to be a good solution in general, but there still remains the question how\ref
decides what it prints.clever.cfg
file. This being said, the case ofappendix
is probably trickier and probably require using theappendix
andapptools
packages.