## LaTeX forum ⇒ Page Layout ⇒ Suppress Page Numbers on ToC Pages Topic is solved

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Amor
Posts: 2
Joined: Mon Dec 16, 2013 6:55 pm

### Suppress Page Numbers on ToC Pages

Hi,

I have some problem with my ToC. The problem is that I don't wont page numbers on ToC pages. I used this.
\tableofcontents\thispagestyle{empty}

It works if the ToC is only one page. But it is on two pages and on the second page there is no number but on the first page there is a number. How can I solve this problem?
Last edited by localghost on Mon Dec 16, 2013 7:11 pm, edited 1 time in total.
Reason: Source code has to be tagged as such to keep a post clear and legible (see Board Rules).

localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm
What about simply switching between two page styles?
\pagestyle{empty}\tableofcontents\pagestyle{plain}

For a more detailed answer instead of this random shot it requires a self-contained and minimal example.

Best regards and welcome to the board
Thorsten
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

Amor
Posts: 2
Joined: Mon Dec 16, 2013 6:55 pm
It didn't help but I found this code that did the job
\tableofcontents \addtocontents{toc}{\protect\thispagestyle{empty}} \thispagestyle{empty} \newpage
Last edited by localghost on Mon Dec 16, 2013 7:49 pm, edited 1 time in total.
Reason: Source code has to be tagged as such to keep a post clear and legible (see Board Rules).

cgnieder
Site Moderator
Posts: 1993
Joined: Sat Apr 16, 2011 7:27 pm
Amor wrote:It didn't help

Probably because you're using a class where \tableofcontents issues a page style implicitly. A minimal working example would tell.

Thorsten's code works fine in a standard class:

\documentclass{article}\begin{document} \pagestyle{empty}\tableofcontents \clearpage\pagestyle{plain}\section{Test} \end{document}

Regards
site moderator & package author