Page LayoutSuppress Page Numbers on ToC Pages

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

Suppress Page Numbers on ToC Pages

Post by Amor »

Hi,

I have some problem with my ToC. The problem is that I don't wont page numbers on ToC pages. I used this.

Code: Select all

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

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Suppress Page Numbers on ToC Pages

Post by localghost »

What about simply switching between two page styles?

Code: Select all

\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
Amor
Posts: 2
Joined: Mon Dec 16, 2013 6:55 pm

Suppress Page Numbers on ToC Pages

Post by Amor »

It didn't help but I found this code that did the job :D

Code: Select all

\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.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Suppress Page Numbers on ToC Pages

Post by cgnieder »

Amor wrote:It didn't help
Probably because you're using a class where \tableofcontents issues a page style implicitly. A Infominimal working example would tell.

Thorsten's code works fine in a standard class:

Code: Select all

\documentclass{article}
\begin{document}

\pagestyle{empty}
\tableofcontents

\clearpage
\pagestyle{plain}
\section{Test}

\end{document}
Regards
site moderator & package author
Post Reply