5

How can I properly redefine \tableofcontentsto include a \newpage or \clearpageafter the table of contents?

8

You can use a completly LaTeX2e solution:

\makeatletter
\g@addto@macro\tableofcontents{\clearpage}
\makeatother

Or simple:

\let\tableofcontentsORIG\tableofcontents
\renewcommand\tableofcontents{\tableofcontentsORIG\clearpage}

The solution works with the standard definition of \tableofcontents used in article or book.

  • 1
    It won't work in memoir, though. – egreg Mar 11 '12 at 20:46
2

You may redefine \tableofcontents after storing the already existing \tableofcontents. The new version just call the previous version and adds a clearpage.

A small MWE:

\documentclass{article}
\usepackage[english]{babel}
\usepackage{blindtext}%dummy text
%>>>>THIS IS THE SOLUTION>>>>>
\let\oldtableofcontents\tableofcontents%remember the definition
\renewcommand\tableofcontents{
  \oldtableofcontents%use the standard toc
  \clearpage
}
%<<<<END SOLUTION
\begin{document}
\tableofcontents
\Blinddocument%create dummy text with sections
\end{document} 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.