GeneralTable of contents across several pages

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Skyflash
Posts: 4
Joined: Tue Apr 08, 2008 6:05 pm

Table of contents across several pages

Post by Skyflash »

Hi Guys (& Gals),

This might be a stupid question but i'll go ahead and ask it anyway.

I have a table of contents spread across several pages and at the bottom of one page I have the entry for say section 6 but at the top of the next page is the entry for subsection 6.1. This looks quite naff and I was wondering if there was anyway around this so that the entries are on the same page?

Any suggestions would be appreciated.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Table of contents across several pages

Post by Stefan Kottwitz »

Hi,

you could insert directly before section 6:

Code: Select all

\addtocontents{toc}{\protect\newpage}
Alternatively you could enlarge the first page of the toc before subsection 6.1 or earlier:

Code: Select all

\addtocontents{toc}{\protect\enlargethispage{\baselineskip}}
Stefan
Skyflash
Posts: 4
Joined: Tue Apr 08, 2008 6:05 pm

Re: Table of contents across several pages

Post by Skyflash »

That's great, worked a treat. You've saved me countless hours!

Cheers :)
Post Reply