[Tex/LaTex] Display different colors in the table of contents
colortable of contents
I wonder if there is a way in a table of contents to display only chapters with different colors, such as in the sample below:
Best Answer
Using a patch for \@chapter to provide this automatically, with some colour switching according to the chapter number, having a 'table' of colours defined in \currentchaptitlecolor. The sequence of colours is of course completely arbitrary and can be changed at will.
The patch does work for \mainmatter - chapter content only (yet).
Using linktoc=page or linktocpage, in the hyperref setup, allows you get sections' page numbers with red colored borders while the section name remains plain text.
This option doesn't change the rest of the document.
Best Answer
Using a patch for
\@chapter
to provide this automatically, with some colour switching according to the chapter number, having a 'table' of colours defined in\currentchaptitlecolor
. The sequence of colours is of course completely arbitrary and can be changed at will.The patch does work for
\mainmatter
- chapter content only (yet).