Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question
add comment

2 Answers

up vote 6 down vote accepted

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.

share|improve this answer
1  
It won't work in memoir, though. –  egreg Mar 11 '12 at 20:46
add comment

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} 
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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