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?

1 Answer 1


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.


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.