Tell me more ×
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 make produce a table of contents by \tableofcontents with page style empty? It doesn't work with \thispagestyle{empty} or \pagestyle{empty}.

share|improve this question

1 Answer

You could use this in your preamble to change the first (otherwise commonly plain) TOC page to empty style:

\AtBeginDocument{\addtocontents{toc}{\protect\thispagestyle{empty}}} 

The other pages behave like expected if you use \pagestyle{empty} like you firstly did. So your document may look like

\documentclass{book}
\AtBeginDocument{\addtocontents{toc}{\protect\thispagestyle{empty}}} 
\begin{document}
\pagestyle{empty}
\tableofcontents
\cleardoublepage
\pagestyle{headings}
...
share|improve this answer
3  
Am I missing something, or does this only work for single-page ToC's? – lockstep Nov 22 '10 at 20:34
1  
@lockstep: you're right, the originally used \pagestyle{empty} which Regis used is still required before \tableofcontents. The line posted by me is an addition which modifies the first TOC page which would otherwise might keep plain page style. Thanks for pointing that out. – Stefan Kottwitz Nov 22 '10 at 21:04

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.