10

I have several chapters and several appendices. I am using the hyperref package, and everything is numbered (all the chapters, appendices, etc...) My appendices also have sections within them and I refer to those sections in the text.

All the links to the appendices or anywhere in them go to the wrong place. For example, my toc links to appendix 1 go to chapter 1, not appendix 1. Links to appendix 2 go to chapter 2, etc... Also, links to sections within an appendix go to a random page in the chapter in the document (not to the appendix).

This is somewhat urgent so any help is greatly appreciated.

If I can't make the links work, is there a way to disable the linking just for appendices? Links work fine all over the document otherwise.

3
  • 3
    Welcome to TeX.SE. It would be helpful if you composed a fully compilable MWE including \documentclass and the appropriate packages that reproduces the problem. Otherwise we have to guess as to what is going wrong. Commented May 2, 2014 at 18:22
  • 6
    Just before your \appendix, add \renewcommand{\theHchapter}{A\arabic{chapter}}, which should update the way hyperref sees a link to a chapter. These should cascade down to \sections as well (just a guess)... It all depends on your \documentclass and the way you construct your appendices.
    – Werner
    Commented May 2, 2014 at 18:23
  • Thank you so much! adding that command before \appendix did the trick.
    – user50989
    Commented May 3, 2014 at 0:10

1 Answer 1

5

And use

\renewcommand{\theHsection}{A\arabic{section}}

if you have the same trouble with the article class. For more information, the hyperref manual explains how hyperref modifies important LaTeX counters (sections, chapter, ...) into \theH<counter> for referencing.

1
  • ... You put this just before your first appendix's \section{}
    – drevicko
    Commented Feb 3, 2023 at 5:45

You must log in to answer this question.

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