0

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.

3
  • 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. Commented Jun 13, 2013 at 18:59
  • 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
    Commented Jun 14, 2013 at 6:38

1 Answer 1

3

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}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .