# Plain/Empty page style for multipage ToC with package fancyhdr

(edit) Added MWE at the end of the question.

Maybe it has something to do with redefining \thepage? If so, I don't know how to make sure otherwise that all pages other than ToC, \chapter and \part are in the new fancyhrd style.

I am trying to get rid of the fancyhdr header (including the page number in my definition) for my table of content, which is 3 pages long.

I've already tried multiple related answers, but none of them seem to work in my case. For example, I tried:

\begingroup
\makeatletter
\let\ps@fancy\ps@emptystyle
\tableofcontents
\clearpage
\endgroup


suggested here, but it doesn't seem to do anything.

I also tried:

\tableofcontents
\thispagestyle{empty}


suggested here, which works in removing the fancyhdr header from page 1 and 3 of the ToC, but not the second.

Any idea what else can I try to get this working?

\documentclass[11pt, a4paper, final]{report}

\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{blindtext}

\usepackage{hyperref}

\usepackage{fancyhdr}

\pagestyle{fancy}
\fancyfoot{}

\fancypagestyle{plain}{
\fancyhf{}
\fancyfoot{}}

\begin{document}

\tableofcontents
\thispagestyle{empty}

\setcounter{page}{0}

\Blinddocument
\Blinddocument
\Blinddocument
\Blinddocument
\Blinddocument
\Blinddocument
\Blinddocument
\Blinddocument
\Blinddocument
\Blinddocument
\Blinddocument
\Blinddocument
\Blinddocument
\Blinddocument
\Blinddocument
\Blinddocument
\Blinddocument
\Blinddocument
\Blinddocument
\Blinddocument

\end{document}

• Ans why not \pagestyle{empty} just before \tableofcontents, then\pagestyle{fancy}? – Bernard Jun 17 '17 at 21:48
• @Bernard: At least for book.cls \tableofcontents uses \chapter*{\contentsname}, meaning \thispagestyle{plain} is used right at the start of that comment, I fear \pagestyle{empty} would have no effect there! But as the document class is not known here, my comment is guessing only and you may be right – user31729 Jun 17 '17 at 22:42
• @Christian Hupfer: That's why I didn't post any answer. – Bernard Jun 17 '17 at 22:45
• @Bernard: Nor will I do... – user31729 Jun 17 '17 at 22:45
• Please post a compilable document that has this issue. – user31729 Jun 17 '17 at 22:46

If you can load package tocbasic, then you can use

\usepackage{tocbasic}
\renewcommand*{\tableofcontents}{\listoftoc[{\contentsname}]{toc}}% ToC under control of tocbasic
\AfterStartingTOC[toc]{\clearpage}


Note that tocbasic can not be used together with tocloft.

Code:

\documentclass[11pt, a4paper, final]{report}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{blindtext}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyfoot{}

\fancypagestyle{plain}{
\fancyhf{}
\fancyfoot{}}

\usepackage{tocbasic}
\renewcommand*{\tableofcontents}{\listoftoc[{\contentsname}]{toc}}% ToC under control of tocbasic
\AfterStartingTOC[toc]{\clearpage}

\usepackage{hyperref}
\begin{document}
\pagenumbering{roman}% use a different numbering scheme to avoide the same identifier problem
\tableofcontents

\cleardoublepage
\pagenumbering{arabic}
\Blinddocument\Blinddocument\Blinddocument\Blinddocument\Blinddocument
\Blinddocument\Blinddocument\Blinddocument\Blinddocument\Blinddocument
\Blinddocument\Blinddocument\Blinddocument\Blinddocument\Blinddocument
\Blinddocument\Blinddocument\Blinddocument\Blinddocument\Blinddocument
\end{document}

• This seems to work. Just to be sure: I don't need to use the previous \thispagestyle{empty} and \addtocontents{toc}{\protect\thispagestyle{empty}} anymore, right? – Bert Zangle Jun 18 '17 at 11:31
• Yes, you do not need these additional lines anymore. The suggestion uses hooks provided by tocbasic. – esdd Jun 18 '17 at 12:05
• Thanks! (also for fixing the warning issues). Will mark as answered. – Bert Zangle Jun 18 '17 at 12:31