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

Is there some counter that holds the number of \chapter that are in a \part? Or do I need to define and run my own counter?

share|improve this question
up vote 3 down vote accepted

No such counter exists, as far as I know. However, a running count of the number of chapters within a part can easily be done (see below).

Accessing the total number of chapters within a part at any point of the document (e.g. at the very beginning of a the part in question) is a little trickier. That would probably require running a first pass, retrieving information on the number of chapters from the auxiliary files, processing it, and running a second pass. I don't know how to do that.






\thetotalch    %returns 3, here

\thetotalch    %returns 2, here

share|improve this answer
Thank you very much. :) – Foo Bar Apr 22 '13 at 16:13

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.