53

How to remove the page number from the table of contents page?

lockstep
  • 250,273

6 Answers6

68

See this FAQ answer. In the simplest case you just use \thispagestyle{empty} after \tableofcontents. However there are several complications, so see the linked answer.

One problem not discussed in the FAQ is if the table of contents is longer than 1 page. For this situation you can write \addtocontents{toc}{\protect\thispagestyle{empty}} somewhere before your first chapter.

O'Neil
  • 205
Lev Bishop
  • 45,462
  • 9
    Thanks for your answer! But could you please edit it to include the actual answer in the site and not just point to an external site? See quality standards for answers for the rationale behind this. – Juan A. Navarro Sep 13 '10 at 17:34
  • 1
    Just to get your attention, I second Juan's request. – doncherry Nov 01 '11 at 13:08
  • 7
    I have TOC on 3 pages and if I use \thispagestyle{empty} after the \tableofcontents only the 3rd page has no page number. Then I add the \addtocontents{toc}{\protect\thispagestyle{empty}} in front of the first chapter and I get rid of the page number on the 1st page while page number on the 2nd page remains... – 71GA Sep 04 '13 at 17:17
  • 2
    @71GA in that case I guess you can add also \addtocontents{toc}{\protect\pagestyle{empty}} next to the other \addtocontents{} – Lev Bishop Sep 04 '13 at 18:14
  • 3
    See also http://tex.stackexchange.com/a/41558/5206 – vanto Nov 25 '14 at 22:31
  • This works only on article – Yosi Dahari Dec 26 '17 at 19:22
12

A combination of the following two commands after \tableofcontents worked for me:

\addtocontents{toc}{\protect\thispagestyle{empty}}
\pagenumbering{gobble}
Troy
  • 13,741
RandomGuy
  • 121
  • 5
    Welcome to TeX.SE! What is the difference between your answer and the answer of LeV Bishop? Please explain what your code does ... – Mensch Mar 07 '18 at 01:18
3

i have three pages of table contents and two lists of figures also. the document genrates automtically the number of pages. but we can undisplay the number of pages with the first cmd. then when you want to display the number again use the second cmd

\pagenumbering{gobble}

then when you want to display the numbers of pages simply type:

\pagenumbering{arabic}
2

For me worked the following code:

\addtocontents{toc}{\protect\thispagestyle{empty}}
\tableofcontents
\thispagestyle{empty}
\newpage
\setcounter{page}{1}
\input{inc/1.Introduccion}
...
Stefan Pinnow
  • 29,535
guest
  • 31
1

Here is the complete solution for multi-page ToC:

\addtocontents{toc}{\protect\pagestyle{empty}}
\addtocontents{toc}{\protect\thispagestyle{empty}}
\tableofcontents
\thispagestyle{empty}

This also removes the header and footer.

0

If you are using the \usepackage{fancyhdr},then the \pagenumbering{gobble}command is not very effective, for it will "gobble" the Arabic number but left other self-defined info. If you are using \thispagestyle{empty} way, or with \protect`macro, there may still be pages incorrect.

I've tried and got a new way to solve the problem.

  1. First, we have a basic assumption that the main chapter is form page 1, so you can insert a \setcounter{page}{1} on the first page of the document except TOC.

  2. Then, we try to determine if the page number equals to the real page number especially after we reset the page number. We use \usepackage{xassoccnt} to find the absolute page of the "page", and in the toc part, we know it equals to the real page, but in the main part, it does not.

\usepackage{xassoccnt}
\newcounter{realpage}
\DeclareAssociatedCounters{page}{realpage}
\AtBeginDocument{%
  \stepcounter{realpage}
}
\newcommand\evifooter{%
\ifnum\the\value{page}=\the\value{realpage}%
\large Toc Page \thepage%If you do not need it, leave blank.
\else%
\large Main Chapter Page \thepage%
\fi%
}
  1. Third, we use the fancyhdr package to make the footer.
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\fancyfoot[C]{\evifooter}

In sum, this way can help deal with all situations in which we need to set header of footer differently.