Table of contents in a LaTeX book: make the TOC entry different from the actual chapter headings in the text

Use

  \chapter[TOC form]{text form} 

at the start of each chapter. The TOC will have “TOC form” (supplied between square brackets) and the chapter itself will have “text form” (supplied between curly braces).

If the TOC form itself contains a closing square bracket (]), the compiler will think the balanced brackets [] have ended and generate an error. But rather than escaping the extra ], which may lead to confusion with the math display environment, place the whole TOC form within braces:

  \chapter[{TOC form with closing bracket}]{text form}

I normally use the package titlesec for fine control of chapter headings, but what is described above will work without it.

Remember that you have to compile your code twice in order to get the TOC to be updated correctly: once to typeset the whole text, and then once more to generate the TOC based on the typeset text.

———
[Edited] for clarity.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s