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}.

-

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}
\begin{document}
\pagestyle{empty}
\tableofcontents
\cleardoublepage
...

-
Am I missing something, or does this only work for single-page ToC's? –  lockstep Nov 22 '10 at 20:34
@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
@StefanKottwitz I have Table of Contents that is 3 pages long. With your solution, as well as other solutions, even after using \pagestyle{empty} next to \tableofcontents middle (second) page of table of contents still does have page number in the footer. So it looks like your solution removes page numbers only from first and last page. Do you have any idea for on removing middle page footer as well? –  Rafal Dec 7 '13 at 12:33

Using tocloft,

\usepackage{tocloft}


it is as simple as placing this line:

\tocloftpagestyle{empty}


somewhere in the preamble.

-
Same as with Stefan solution, using tocloft empty option does not remove middle page numbers in 3-page ToC. –  Rafal Dec 7 '13 at 12:35

If you use the fancyhdr package, you can remove the page numbering for a multiple-page table of contents as follows:

\clearpage                       % Otherwise \pagestyle affects the previous page.
{                                % Enclosed in braces so that re-definition is temporary.
\pagestyle{empty}              % Removes numbers from middle pages.
\fancypagestyle{plain}         % Re-definition removes numbers from first page.
{
\fancyhf{}%                       % Clear all header and footer fields.
\renewcommand{\headrulewidth}{0pt}% Clear rules (remove these two lines if not desired).
\renewcommand{\footrulewidth}{0pt}%
}
\tableofcontents
\thispagestyle{empty}          % Removes numbers from last page.
}


It seems there are three headers that need to be altered separately:

1. The first page, which always uses the plain style, no matter what. (Therefore, it needs to be redefined manually.)
2. The middle pages, which follow the current pagestyle.
3. The last page, which has to be altered with thispagestyle.

You can add the fancyhdr package by adding the following line in the preamble:

\usepackage{fancyhdr}


The advantage of this solution is that it preserves page numbering as you would expect.

Another option, if all you are using is a plain page number, is to remove it using

\clearpage
\pagenumbering{gobble}
\tableofcontents


You could then restore it (if you are using Arabic numerals) with

\pagenumbering{arabic}


(Valid options include arabic, roman, Roman, alph, and Alph.)

If, when using this option, for some reason you want the page numbering to continue before and after the table of contents, you will need to save the page number and restore it:

\newcounter{savepage}             % Creates a counter for saving the page
\setcounter{savepage}{\thepage}   % Saves the page