TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

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

I have custom colouring in the section headings, i.e. \section{\textcolor[red]{Heading}}, so when I use \tableofcontents it prints the table of contents including all the unnecessary colouring. Is there a way I can print the table of contents in all black text, but keep the actual colour coding I did for the sections?

share|improve this question

Use the "ToC" entry of \section[<ToC entry>]{<body entry>}:


If this is performed on a case-by-case basis, then the above solution is fine. However, for more consistent changes across (say) all section headings, you should consider using a package like sectsty or titlesec. For more on this option, see Is it possible to change text color for all headings?

share|improve this answer
Looks like this is the only solution anyone can think of, BUT I also thought of a sneaky solution just now :)! Print the TOC in black and white, and the rest in colour!! :D Thanks for your solution! – Dan Nov 10 '12 at 1:22

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.