LaTeX forum ⇒ Page LayoutSuppress 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

Postby Amor » Mon Dec 16, 2013 7:05 pm

Hi,

I have some problem with my ToC. The problem is that I don't wont page numbers on ToC pages. I used this.
  1. \tableofcontents
  2. \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).

Tags:

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

Postby localghost » Mon Dec 16, 2013 7:15 pm

What about simply switching between two page styles?
  1. \pagestyle{empty}
  2. \tableofcontents
  3. \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
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ 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

Postby Amor » Mon Dec 16, 2013 7:22 pm

It didn't help but I found this code that did the job :D
  1. \tableofcontents
  2. \addtocontents{toc}{
  3. \protect\thispagestyle{empty}}
  4. \thispagestyle{empty}
  5. \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).

User avatar
cgnieder
Site Moderator
Posts: 1993
Joined: Sat Apr 16, 2011 7:27 pm

Postby cgnieder » Mon Dec 16, 2013 8:22 pm

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:

  1. \documentclass{article}
  2. \begin{document}
  3.  
  4. \pagestyle{empty}
  5. \tableofcontents
  6.  
  7. \clearpage
  8. \pagestyle{plain}
  9. \section{Test}
  10.  
  11. \end{document}


Regards
site moderator & package author


Return to “Page Layout”

Who is online

Users browsing this forum: No registered users and 3 guests