# ToC on the title page in a report

I am writing a thesis, and as long as it's a draft, I would like to keep the amount of non-content to a minimum. That said, I would like my title page to be just a heading with the name of the thesis, a short abstract and the ToC.

The ToC itself is problematic for me. Using report, the ToC does reserve a full page for itself, probably given the chapter-style heading. I have tried several packages (like minitoc, titletoc, ...) to no avail, I have tried redefining the command, but that only worked in article mode.

So I only need the contents of the ToC, without the heading (or without the heading forcing a new page), to be generated.

-

Use the internal command \@starttoc{toc} to typeset the contents of the ToC. Additionally, use the notitlepage class option.

\documentclass[notitlepage]{report}

\makeatletter
\newcommand*{\toccontents}{\@starttoc{toc}}
\makeatother

\begin{document}

\author{(Author)}
\title{(Title)}
\maketitle

\toccontents

\chapter{foo}

\end{document}


-
Strange, I tried 'starttoc' before, but it did not work, now it works like a charm! Guess I forgot something... thanks! –  Ondrej Feb 26 '12 at 18:27

A trick might be to use the notitlepage option, so \maketitle will not produce a page with the data. Then we can make LaTeX into thinking that \chapter does nothing (note that this is inside an environment, where redefining a command is safe since the redefinition will disappear at the end of the environment; don't do this without enclosing the \renewcommand in a group; it certainly qualifies as a hack):

\documentclass[notitlepage]{report}

\usepackage{lipsum}
\begin{document}

\begin{titlepage}
\thispagestyle{empty}

\title{A draft of my thesis}
\author{A. U. Thor}
\maketitle

\vfill

\begin{abstract}
\lipsum[2]
\end{abstract}

\vfill

\renewcommand{\chapter}[2]{}
\tableofcontents

\vfill

\end{titlepage}

\chapter{Intro}
\lipsum[1]
\end{document}


This works because \tableofcontents does \chapter*{...} and so, redefining \chapter with two arguments to do nothing will ignore the * and the real argument. You'll get no heading for the table of contents; you can add one by

\begin{center}
\bfseries\contentsname
\end{center}


just before \tableofcontents, so that the result will be similar to the abstract's heading.

For a cleaner version one should either use \makeatletter and \makeatother to access \@starttoc (as in lockstep's) answer or patching \tableofcontents with etoolbox. Being this for a quick hack to be used only in preliminary versions, I believe that this is the simplest trick.

-
This does work, but since I use chapters in the document, I cannot allow them to be undefined. Anyway it's an interesting idea I hadn't thought of. Thanks. –  Ondrej Feb 26 '12 at 18:29
The redefinition of \chapter is performed in a group, so it disappears after \end{titlepage}. I'll add it in the answer. –  egreg Feb 26 '12 at 18:55
Oh, I did not have the group in there, that is why it did not work for me. Sorry. Definitely an appealing approach, will remember it! –  Ondrej Feb 26 '12 at 19:50