Can you give me some advice for how to obtain the following format of the TOC?

  1. Chapter’s heading 1-7

  2. Chapter’s heading 9-10

  3. Chapter’s heading 11-15

  • 2
    Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. Did you try building some minimal working example (MWE) ? if so please post Nov 14, 2013 at 16:31
  • Have you seen this? Probably it may solve your problem.
    – crixstox
    Nov 14, 2013 at 17:08
  • does the 7 mean that page 8 is blank, or that the last \section from the first \chapter is on page 7?
    – user4686
    Nov 21, 2013 at 15:32
  • It is means that last line of chapter 1 is appearing on page 7. It may be possible that the document will be of two-sided and page 8 may be blank Dec 13, 2013 at 13:15

1 Answer 1


My solution consists of appropriate labeling (in the very beginning and the very end of each chapter), defining a macro \chaprange that retrives the pages from a pair of labels formatting them to <p1>-<p2> (as requested), and in redefining \addcontentsline. Moreover, there are three macros controlling the page numbering pattern:

  1. \chaprangeon activates the functionality;
  2. \chaprangeoff temporary disables the functionality;
  3. \breakchaprange disables the functionality if the last chapter is not the content ending your document.

The Code






\chapter{Title 1}

\section{Subtitle 1}

\chapter{Title 2}

\chapter{Title 3}


\chapter{Additional Content}

Important: This code requires three compilation cycles to work properly.

Example output



  • Aug/28/'15 Solution available as package chaprange (v0.99a: first test version)
  • Aug/08/'15 Changed the names of the user macros and fixed a few minor details in the example.
  • July/25/'15 The Code now works only on chapters without any need of patching sections, subsections, etc.
  • Oct/30/'14 Consider this followup-question if you are using sectioning commands of deeper levels than sections and have problems with the correct formatting.

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.