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

I have already asked a similar question here:

Incorrect ToC/Index cross-references when resetting memoir class counters

and received a satisfactory answer. Now, I wish to apply the chapter counter reset (using \counterwithin*) to a more complex document, but this seems to fail. I simply wish to restart the chapter counter within each Part of a Book, and within each Book of my document structure, which goes like this:

  • Book1

    • Part1
      • Chapter1
      • ...
    • Part2
      • Chapter1
      • ...
    • ...
  • Book2

    • Chapter1
    • ...
  • Book3

    • Chapter1
    • ...

I currently have the following MWE:










I can't seem to get proper cross-referencing in my ToC for chapters in Book2 and Book3. Should I splice the \counterwithin* commands somehow throughout the sections?

share|improve this question
up vote 11 down vote accepted

Because you have duplicate chapter numbers, you need to tell hyperref to use a unique number for the links. You can add the following to your preamble:


You can see the warnings in the log file when this arises.

share|improve this answer
Nailed! Thanks. – Olivier Drolet Nov 23 '11 at 16:54

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.