[texhax] How to add book parts names in table of contents?

Philip G. Ratcliffe philip.ratcliffe at uninsubria.it
Fri Jun 29 09:58:23 CEST 2007


> I have a book which is divided in several parts:
> 
> Part 1: general
> 
> 	Chapter 1: title of chapter 1
> 	Chapter 2: " "  "  "  "    2
>         ...
> 	Chapter 8: " "  "  "  "    8
> 
> Part 2: something else
> 
> 	Chapter 9: title of chapter 9
> 	...
>         Chapter 15: title of chapter 15
> 
> Part 3: another part
> 	Chapter 16: title of chapter 16
> 
> etc etc...
> 
> How can I add the "Part N" numbers and titles in the right places in
> the initial Table of Contents? I don't need them to appear _between
> chapters, only in the ToC. Is it possible? How?

Try something along the lines of

      \addcontentsline{toc}{part}{\thepart\hspace{1em}My part title}%

where each part starts.  If you don't actually use the \part command, you'll
also need to add 

      \refstepcounter{part}%

before each insertion.  Oh, and you will need to be using the book class.

Cheers,  Phil



More information about the texhax mailing list