TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The \appendix command resets the section counter to zero:


Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
> \appendix=\long macro:
->\par \setcounter {section}{0}\setcounter {subsection}{0}\gdef \thesection {\@
Alph \c@section }.

My understanding of \section is that it creates a bookmark based on the current counter number? In the following, I feel that I reproduce the critical parts of what \appendix does before declaring \section{six}, but it does not work.


Instead, \section{six} has a bookmark which leads to \section{four}. The output of LaTeX understandably shows:

pdfTeX warning (ext4): destination with the same identifier
(name{appendix.A}) has been already used, duplicate ignored

So I don't understand why this is happening. Does \appendix do more than what I think it is doing? The redefinition \thesection does not seem relevant here.

share|improve this question
up vote 4 down vote accepted

The hyperref package modifies \appendix, so that it does indeed more than just resetting the counters and changing \thesection.



> \appendix=macro:
->\ltx@IfUndefined {chapter}{\gdef \theHsection {\Alph {section}}}{\gdef \theHc
hapter {\Alph {chapter}}}\xdef \Hy@chapapp {\Hy@appendixstring }\HyOrg@appendix

So it also sets \Hy@chapapp to the value of \Hy@appendixstring (which defaults to appendix). I suppose (but haven't checked) that the links hyperref creates are called \Hy@chapapp.\theH⟨current sectional unit⟩.

\HyOrg@appendix just contains the original definition of \appendix, which is also executed.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.