# Get rid of page number on 1st page of ToC in LaTeX!

LaTeX, or more generally TeX, is undoubtly the best typesetting tool available, and what’s more, it’s for free (for Windows users – check out MiKTeX!). Yet, there are few things that should work in a certain “obvious” way, yet they don’t (fortunately, there’s very few of them).

One of them is quite a surprising thing – pagestyle{empty} command does not affect first page of the table of contents. Yet, all the other pages of ToC it does! The same holds for list of figures and list of tables.
This is quite an annoyance, especially if you put ToC at the beginning of the document, and want to have all the pages, before the real contents starts, without the page numbering.

So, how to get rid of the page number on the first page of table of contents in LaTeX? You have to dig into the header and footer setting for this.

First thing is to use fancyhdr package – put usepackage{fancyhdr} command anywhere before the begin{document}.

Second, right before issuing the tableofcontents command, redefine the “plain page style” to an empty one, like this:

fancypagestyle{plain}
{
fancyfoot{}
}	% clear header and footer of plain page because of ToC

And after the ToC, just get back to the “classical” plain page style (this is important – even if you use your “fancy” page style, each page containing first page of chapter is “plain”, unless you redefine this behaviour), like this:

fancypagestyle{plain}
{
fancyfoot[C]{thepage}
}	% re-define plain page after the ToC

This block has to be “on a new page” – either after you issue newpage or cleardoublepage command, or after your first chapter{...} command.

## 19 responses to “Get rid of page number on 1st page of ToC in LaTeX!”

1. Denny says:

Nice!

Thanks for the info, i’ve been cracking my head open on this one…
it’s also possible to do clear the plain pagestyle within an encapsulating environment, so you don’t have to redefine it afterwards

{
\fancypagestyle{plain}
{
\fancyfoot{}
} % clear header and footer of plain page because of ToC
\tableofcontents
}

2. JustChecking says:

You’re welcome, I’m glad I could be of any help!

Thanks for the snippet, I found it later also, yet I was lazy to update the post to include it…

Cheers!

3. hamster2k says:

This also worked for me:

\renewcommand\thepage{}
\tableofcontents
\newpage
\renewcommand\thepage{\arabic{page}}

Cheers

4. JustChecking says:

Thanks for the tip!

Now we have here 3 available solutions… Neat 🙂

5. Daniel says:

How do you get rid of page numbers without getting rid of the footer?

6. JustChecking says:

I’m not quite sure what exactly you mean; you can blank-out just parts of footer and header, like this:

\fancyfoot[C]{} % clears central part of footer

Cheers

7. This did the trick for me (without needing fancyhdr)

\renewcommand\thepage{}
\tableofcontents
\listoffigures
\newpage
\renewcommand\thepage{\arabic{page}}

8. Forgot to mention: I did this to reset the page counter before my first page of content.

\setcounter{page}{1}

9. Greg says:

This also seems to work:
before the \tableofcontents command.

10. duk says:

This works too:

\makeatletter
\let\ps@plain\ps@empty
\makeatother

🙂

11. Sam says:

Thank you so much for this tip. I ended up using the one that redefines \thepage because I got some slight weirdnesses when I used fancyhdr. This was the last formatting bug I had to fix and it was really annoying.

12. Austin Mohr says:

I think the simplest way is to place \pagestyle{empty} in the header (this removes the page number for pages 2 and beyond) and place \thispagestyle{empty} anywhere in the BODY of the first page (that is, after some text has been written to the page).

13. Jonas says:

Great, thanks for the tip!

14. MRK says:

Dear all,
I am writing my dissertation. I am have problems with producing the desirable pdf. The problems I am getting are:
1. No bookmark for Title Page or ToC.
2. List of Figures and List of Tables bookmarks point to Title Page.
3. Bibliography and vita are bookmarked under Part III (Appendices).
4. ToC lists a page number for each of the Parts’ pages.

My main file is copied here. What I want to end up with is:
1. Top level bookmarks with correct targets for:
a. Title Page
b. ToC
c. List of Figures
d. List of Tables
e. Main matter components
f. Bibliography
g. Vita
h. Appendices
2. I want each of the Parts’ pages not to have a page number on the ToC.

The use of “Part: Documentation” is only a workaround and not a solution. I do not like it, but I do not have a working alternative now.

I tried using the appendices environment but kept receiving an error message about redefining a command that was not defined before. My guess is that the Appendix package is running into a conflict with another package. My problem is that I cannot figure out which one is the offensive package.

Any help is greatly appreciated.

Best regards,
MRK
%
% This is file iuthesis.tex’,
% generated with the docstrip utility.
%
% The original source files were:
%
% iuthesis.dtx (with options: docs’)
% IUThesis Document Class (N. Danner)
%
% iuthesis: Document class for IU Thesis.
% N. Danner (nxxxxx@indiana.edu)
%
% RCS Info:
% iuthesis.dtx,v 1.2.0.23 1999/06/04 14:30:00 ndanger Exp
%
\def\fileversion{1.2.0.23}
\def\filedate{1999/06/04}
\errorcontextlines=999
%\raggedbottom
%\documentclass[letterpaper,14pt,fleqn]{report}
\documentclass[12pt,reqno,final]{iuthesis}
\renewcommand{\thepart}{\Roman{part}}
\usepackage{listings} % identify the language with \lstset{language=FORTRAN}
\usepackage{verbatim}
\usepackage{fancyvrb}
\usepackage{rotating}
\usepackage[usenames]{color} % to include .jpg figures
\usepackage{graphicx} % to include .jpg figures
\usepackage{natbib}
\usepackage[version=3]{mhchem}
\usepackage{setspace}
\usepackage{caption}
\usepackage{lscape}
\DeclareCaptionFont{singlespacing}{\singlespacing}
%The following six lines make it possible for Figure number to go continuous over all chapters using the package: {remreset}.
\usepackage{remreset}
\makeatletter
\@removefromreset{figure}{chapter}
\makeatother
\renewcommand{\thefigure}{\arabic{figure}}
\makeatother
\usepackage{morehelp}
\usepackage[centertags]{amsmath}
\usepackage{datetime}
\usepackage{fancyhdr}
\usepackage{ifpdf}
%\ifpdf
\usepackage[
pdftex,
pagebackref = true,
anchorcolor = red,
citecolor = blue,
filecolor = red,
urlcolor = red,
pdfborder={0 0 0}
bookmarks,
%bookmarksopen,
pdffitwindow,
pdftitle = {My Dissertation},
pdfauthor = {Me},
]{hyperref}
\title{Geol. of the IL Basin}
\author{}

\department{Geological Sciences}
\submitdate{2 May 2011}

\begin{document}
%
%
\lstset{language=Fortran}
% Dedication
% \begin{dedication}
% \textbf{Dedication}\\
% \bigskip
% \par
% To my parents, wife, and daughters\\
% \par
% \ldots \par \ldots \par \ldots
% \end{dedication}

% Dedication
\begin{dedication}
To my parents, wife\\
\par
\ldots \par \ldots \par \ldots
\end{dedication}

% Acknowledgements
\begin{acknowledgements}
Thank God, advisor, committee members, IUB computing facilities, and Aramco\\
\par
\ldots \par \ldots \par \ldots
\end{acknowledgements}

% Abstract
\begin{abstract}
In this dissertation, I will discuss\\
\par
\ldots \par \ldots \par \ldots
\end{abstract}

\frontmatter

% generate the Title
\maketitle
% generate the Signature page
\signaturepage
% generate the Dedication page
\makededication[2in]
% generate the Acknowledgement page
\makeack
% generate the Abstract page
\makeabstract
\tableofcontents
% insert the list of figures
\listoffigures
% insert the list of tables
\listoftables

\mainmatter
\part{Reaction-Transport}
\include{chapter_01}
\include{chapter_02}
%\include{chapter_03}
%\include{chapter_04}
%
%
\part{Stratigraphic Modeling}
\include{chapter_05}
%

\backmatter
\include{vita}
%
%
\part{Appendices}
\appendix
%\appendixpage
%\appendixname
%\noappendicestocpagenum
%
%\begin{appendices}
\include{MeshGen_Code}
\include{Rxn_Rate}
\include{Chem_Transport}
%\end{appendices}
%
%
%\part{Documentation}
{\setlength{\baselineskip}{0.75\baselineskip}
\bibliographystyle{agufull}
%\bibliography{mrk-thesis}\par}
\bibliography{mrk-thesis-full}\par}
\backmatter
\include{vita}
%

\end{document}
%
% End of file `iuthesis.tex’.

15. Dexter says:

Thanks for the tips.

\renewcommand\thepage{\arabic{page}}
\setcounter{page}{1}

They were live savers.

16. DarioP says:

+1 for the Greg comment, I was posting the same: