[Tex/LaTex] Remove header and footer in titletoc

header-footertable of contentstitletoc

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.

Best Answer

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}
Related Question