The following MWE produces a PDF whose TOC has two entries: “Foo” and “Bar” with correct page numbers. So far, so good. However, upon clicking on the link to “Bar”, I am taken to the page for “Foo” instead.



(Produced with pdflatex, run twice.)

This MWE is whittled down from a (much!) more complex document but the above does seem to reproduce the error reliably.

Re-setting the chapter count seems to confuse hyperref, even though the page references are still accurate. Notice that in my real document, \backmatter does other things, including setting the numbering style to alphabetical so there’s no chance of confusion even though both chapters are ostensibly labelled as “Chapter 1”.

How do I fix this? Is this a bug? Are there workarounds?

2 Answers 2


Hyperref is just too clever sometimes. Make it dumber, and hence more robust:

  • 11
    Wow, this actually works, and makes sense. But it’s not guessable from the documentation’s description of the option. Documentation fail. :-( Nov 28, 2010 at 18:01
  • 2
    This helped me with hyperref getting its PDF bookmarks all tangled up because I was resetting chapter numbering in my book parts. +1!
    – DevSolar
    Sep 21, 2011 at 15:46
  • +1 well deserved! Got my problem in scientific workplace fixed where my hiërarchy got totally messed up.
    – Nick
    Nov 8, 2013 at 15:48
  • 1
    @KonradRudolph I can confirm this works having stumbled into the same problem and used the same fix, but how in the world does this make sense? :(
    – ffledgling
    Nov 1, 2015 at 16:21
  • 6
    @ffledgling Look at Ulrike’s answer: by default, hyperref derives internal link identifiers based on chapter numbers. However, when using different sections, there are two chapters with number 1. So by making hyperref dumber, we force it to adopt internal consecutive identifiers, rather than identifiers that map to actual chapter numbering. Nov 1, 2015 at 16:49

You have two chapter 1. Naturally this confuse hyperref. You must give the internal counter a unique "look". E.g.:


  • 3
    Naturally. ;-) But I did originally set \thechapter without effect. And \theHchapter doesn’t even appear in the documentation (nor does any other occurrence of ‘theH’, according to grep). Nov 28, 2010 at 17:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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