I have finished my work and just optical adjustment: I want to remove any header/footer from Table of Contents, but not from the start of every chapter. I have found that \frontmatter and \mainmatter should do the trick, but that only achieved to remove any header/footer from page 2 (which was great).

with \documentclass[a4paper,12p,twoside]{book} I want to achieve:

i) Title page with only footer

ii) totally blank

iii) TOC - no header/footer

iv) TOC cont - no header/footer

page 1) Foreword - only footer

page 2) header/footer


Here is the code:

\usepackage[table]{xcolor}                   %% allow colour

\usepackage[textwidth=450pt, textheight=680pt,top=3cm, left=2.5cm]{geometry} %margins

\usepackage{titletoc}% http://ctan.org/pkg/titletoc
    \titlecontents{chapter}% <section-type>
      [0pt]% <left>
      {}% <above-code>
      {\bfseries\chaptername\ \thecontentslabel\quad}% <numbered-entry-format>
      {}% <numberless-entry-format>
      {\bfseries\hfill\contentspage}% <filler-page-format>

% dots for chapters
\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}} % for chapters

\usepackage{fancyhdr}       %% allow header, footer
\fancyhf{} % clear header and footer fields
\fancyheadoffset{1 cm}
\fancyfootoffset{1 cm}
\lhead[\bfseries \textcolor{Lblue} {ST Handbook}]{}
\rhead[]{\textcolor{Tmaroon} {\leftmark}}
\lfoot[\textcolor{Cgray} {page \thepage}]{\textcolor{Cgray} {Chartered XXX}}
\rfoot[]{\textcolor{Cgray} {page \thepage}}

\fancypagestyle{pchap}{ % pchap
    \fancyheadoffset{1 cm}
    \fancyfootoffset{1 cm}
    \lfoot[\textcolor{Cgray} {page \thepage}]{\textcolor{Cgray} {Chartered XXX}}
    \rfoot[]{\textcolor{Cgray} {page \thepage}}
    } % pchap

    \fancypagestyle{firstpage}{% first page different
    \lfoot{\textcolor{Cgray} {Chartered XXX}}
    \rfoot{\bfseries \textcolor{Lblue} {ST}}
    }% first page different

\usepackage{datetime} % dates - my altered dates below
      \monthname[\THEMONTH] \THEYEAR} %just month written and Year
      \longdate \ordinaldate{\THEDAY} \monthname[\THEMONTH] \THEYEAR} %normal date
    \newcommand\twodigits[1] {\ifnum#1<10 0#1\else #1\fi}
       \THEYEAR--\twodigits{\THEMONTH}--\twodigits{\THEDAY}} % digit date for quote no.

\setlength{\parindent}{0pt} % never indent first line




      { \bfseries \textcolor{Lblue} {\Huge{ST HANDBOOK}}}
     \hfill revised \normal \today \\





\section {A}


    \section {B}
     soeoco \vspace{5cm} 
    \advance\cntas 1

 soeoco \vspace{5cm} 
\advance\cnta 1


Can I distinguish between \frontmatter and \mainmatter?

2 Answers 2


The problem with the Table of Contents is that it uses \thispagestyle{plain} as all Chapter opening pages do.

Adding \thispagestyle{empty} will not help: if you put it before \tableofcontents it will be overridden by the embedded \thispagestyle{plain}, and if you put it after, it will apply to the last page.

The trick is to sneak in a \thispagestyle{empty} as first element of the Table of Contents, which will be executed on the first page, but after the title (with its \thispagestyle{plain}) has been set up.


I have found one possible work around (not sure if efficient, but it does it for my work):




                  \thispagestyle{pchap}% plain page style in mainmatter
                  \thispagestyle{empty}% empty page style outside of mainmatter

I would love to hear if there is a better solution/structure to my work.

You must log in to answer this question.

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