Page LayoutPagebreak after TOC title and before TOC listing

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
Dr. Doerke
Posts: 16
Joined: Sat Dec 06, 2008 7:55 pm

Pagebreak after TOC title and before TOC listing

Post by Dr. Doerke »

Perhaps this has been solved and I just don't know how query it. This is the code I'm using:

Code: Select all

\newpage{}
\renewcommand\contentsname{\large{Table of Contents}}
\pagestyle{plain}
\pagenumbering{arabic}
\tableofcontents
What I get is one page showing "Table of Contents" and white space. The TOC listing begins on the next page. I would like the listing to appear under the "Table of Contents". How do I prevent the page break after "Table of Contents"?
Last edited by Stefan Kottwitz on Tue Apr 10, 2012 4:32 pm, edited 1 time in total.

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

Pagebreak after TOC title and before TOC listing

Post by Stefan Kottwitz »

This code does not cause the problem. Here it is extended to make it compilable:

Code: Select all

\documentclass{article}
\begin{document}
\newpage{}
\renewcommand\contentsname{\large{Table of Contents}}
\pagestyle{plain}
\pagenumbering{arabic}
\tableofcontents
\section{A section}
\end{document}
The output:
toc.png
toc.png (3.65 KiB) Viewed 3467 times
No pagebreak, as you can see. So please provide further information, the best would be if you would post a Infominimal working example, like I did, which shows the undesired output. It would be good to do this when posting a question, to save time.

Stefan
LaTeX.org admin
Dr. Doerke
Posts: 16
Joined: Sat Dec 06, 2008 7:55 pm

Re: Pagebreak after TOC title and before TOC listing

Post by Dr. Doerke »

I've used the code as you have suggested and this is what I get
Attachments
toc page break.PNG
toc page break.PNG (19.16 KiB) Viewed 3428 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Pagebreak after TOC title and before TOC listing

Post by Stefan Kottwitz »

I did not suggest any code. Actually, I would make it differently. I only extended your code a bit to make it compilable for testing, for verifying that the problem doesn't occur. And because it does not happen, it proves that the problem is not caused in your code snippet. It is somewhere else, which you did not show. That's why I asked you to post a Infominimal working example. Please follow this link to learn why and how.

Stefan
LaTeX.org admin
Post Reply