Page Layout ⇒ Table of contents
Table of contents
I am currently writing a report and I have a page limit and I have been advised to, for once, put the table of contents on the same page as the abstract and I have been looking up everywhere for the information and I cannot seem to know where to find it. Hopefully someone here will know. I basically want to have a title saying "summary" then my summary then the "table of contents" title and then the TOC. I found how to add text to the TOC but it still puts the TOC title at the very top of the page !
Many thanks
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: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
Table of contents
It all depends on the document class you are using, on the template if you use one, and on your code.
If you would provide a

Stefan
Table of contents
Thank you very much for your reply and the welcome wishes, here is my example (it's a "book", for the document class) :
Code: Select all
\documentclass[openany]{book}
\begin{document}
\thispagestyle{empty}
\section*{Summary}
\setcounter{page}{0}
\paragraph*{}
Here is my summary
\setcounter{page}{0}
\thispagestyle{empty}
\tableofcontents \thispagestyle{empty}
\setcounter{chapter}{1} \setcounter{section}{0}
\section{Introduction} \setcounter{page}{1} \fancypagestyle{plain}
\paragraph{} The rest of my report goes on
\end{document}
My code might/must be redundant, sometimes I just try until it works and don't mind having a redundant code.
Thanks for your help !
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Table of contents
you can do the old and well known hack, but it is noting more than a hack. It introduces inconsistensies into the document. But if you have to do so...
Code: Select all
\documentclass[openany]{book}
\usepackage{indentfirst}
\begin{document}
\pagestyle{empty}
\pagenumbering{gobble}
\chapter*{Summary}
\indent Here is my summary
\begingroup\let\clearpage\relax
\tableofcontents \endgroup
\chapter{Introduction}
\pagenumbering{arabic}
%\fancypagestyle{plain}
The rest of my report goes on
\end{document}