I make use of autoref thoughout my now rather long document. I have an appendix with sections, though currently a small number, so changes could be made here.

I want references in my document to sections within the appendix to say something like appendix A.1 instead of section A.1 but still refer to sections not in the appendix by section. I had an idea along the lines of creating some alias to section which had their own autorefname and using these instead of section. I tried and failed to use aliascnt for this. I don't know if it was because I was doing it wrongly or because it can't do what I wanted.

Any help would be appreciated!

2 Answers 2


I assume you're using a class that includes the \chapter command (e.g. book or report). In that case, within the appendix \autoref will refer to chapters as "Appendix", but to sections still as "section" (contrary to the article class, where sections would constitute an "Appendix"). Solution: (EDIT: My first "solution" was very ill-advised) Load cleveref after hyperref and use \cref instead of \autoref. (Yes, the links won't be as pretty as before.)


\usepackage{cleveref}% Load AFTER hyperref!

% \crefname{subappendix}{fairy tale}{fairy tales}




As shown in \cref{foo} and especially in \cref{bar} \dots




As shown in \cref{bla} and especially in \cref{blubb} \dots

  • 1
    Dear lockstep, thanks very much for this. In fact I had tried this solution with no success. There is possibly a misunderstanding about what I want it to do... I would like a reference to the appendix, written before the start of the appendix to refer to it as "appendix A.1" not just references (autorefs) written after the start of the appendix.
    – aghsmith
    Commented Nov 22, 2010 at 19:00
  • ok, i'm excited by the new solution, just investigating it now
    – aghsmith
    Commented Nov 22, 2010 at 20:07
  • Ok. I can see that cref is going to take a while to master. but in the mean time it has sorted out the underlying problem. I'm a bit worried that my labels might not all be 100% propper but... we will see. Cheers
    – aghsmith
    Commented Nov 22, 2010 at 20:28
  • You can get nicer looking links with something along the lines of \crefformat{chapter}{#2chapter~#1#3} and \Crefformat{chapter}{#2Chapter~#1#3}.
    – mpr
    Commented Oct 29, 2011 at 4:33
  • 3
    @lockstep: Is there really no way to do this without cleveref?
    – einpoklum
    Commented Jan 26, 2012 at 19:39

The simplest workaround is to define a new command:


and use it for appendix sections:


The star in \ref* means not to make this reference number into a link since \hyperref[#1]{...} already does so.

  • Tried this - doesn't work.
    – dshgna
    Commented Aug 20, 2021 at 18:35

You must log in to answer this question.

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