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

Could someone please give me a hint on how the virtual chapter is inserted ine the table of contents in the example below? I've tried to use \addcontentsline before this virtual chapter, but this splits sections of chapter 1 in the table of contents. screenshot

share|improve this question
up vote 2 down vote accepted

Use \addtocontents instead of \addcontentsline. The former is generic, the latter is used only to add "normal" entries.

share|improve this answer
Thank you, @Boris! I've used the line \addtocontents{toc}{\protect \contentsline {chapter}{Randomized algorithms}{\pageref{page:randalgs}}{} } – Alexander S. Kulikov Feb 14 '13 at 19:03

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.