# Remove header and footer in titletoc

With the standard TOC, I use this code :

%make the second and other page from TOC without header and footer
\makeatletter
\patchcmd{\tableofcontents}% <cmd>
{\@starttoc}% <search>
{\thispagestyle{empty}\@starttoc}
{}{}% <success><failure>
\makeatother


and this code :

%make the first page from TOC without header and footer
\tableofcontents{\thispagestyle{empty}}


And it's working perfectly. But now, I'm trying to write a document with big Appendix. So I write the document in separated files and use the command \include at the end of my master document.

I need to write a separately TOC for my big Appendix, so I'm trying to use the package titletoc. Actually, both the TOCs are correctly generated with this code :

\startcontents
\printcontents{ }{0}{}
\chapter{blabla}
\chapter{bloblo}
...
\stopcontents


And the same code in the included appendix.

My problem is simple: how to remove header and footer in TOC generated by the titletoc package? Obviously, I tried this for the first page :

\printcontents{ }{0}{}{\thispagestyle{empty}}


And I have no idea how to patch the command \printcontents like the command \tableofcontents.

• You dont need to patch, call \pagestyle{empty} before \tableofcontents, and after, \pagestyle{plain/fancy/whatever} to change it back. \thispagestyle{...} only works for a single page, it automatically reverts to the existing style thereafter. – Nicholas Hamilton Jun 13 '13 at 18:59
• – Marco Daniel Jun 13 '13 at 19:02
• I have already tried this method, Marco. But i'm not satisfied from the result. If i do : \pagestyle{empty} \startcontents \printcontents{ }{0}{}{} \pagestyle{plain} The second page from my TOC have the plain footer. If i had a \clearpage after the \printcontents, the second page from my TOC have the empty footer but now i have an empty page with my plain footer before the first chapter... – Karim Jun 14 '13 at 6:38

The command \thispagestyle{empty} works also with titletoc. The example below creates two tocs whereby both has no header/footer:

\documentclass{report}
\usepackage{titletoc}
\usepackage{blindtext}

\begin{document}
\startcontents
\thispagestyle{empty}
\printcontents{ }{0}{}
\Blinddocument\Blinddocument
\stopcontents

\clearpage
\appendix
\startcontents
\thispagestyle{empty}
\printcontents{ }{0}{}
\Blinddocument\Blinddocument
\stopcontents
\end{document}