Page LayoutTable of contents

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
lulu
Posts: 3
Joined: Wed Mar 18, 2015 2:23 am

Table of contents

Post by lulu »

Hello everyone,

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

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: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Table of contents

Post by Stefan Kottwitz »

Welcome to the forum!

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 Infominimal working example, i.e. a minimized copy of your document, compilable (with preamble) but without your content text, I'm sure we would find a solution.

Stefan
LaTeX.org admin
lulu
Posts: 3
Joined: Wed Mar 18, 2015 2:23 am

Table of contents

Post by lulu »

Hello,

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 !
Last edited by Stefan Kottwitz on Wed Mar 18, 2015 3:56 pm, edited 1 time in total.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Table of contents

Post by Johannes_B »

Hi and welcome,

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}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
lulu
Posts: 3
Joined: Wed Mar 18, 2015 2:23 am

Re: Table of contents

Post by lulu »

Many thanks, it has worked and does not seem to have engendered undesired things in the document !
Post Reply