[Tex/LaTex] How to remove header and footer in Table of contents and LOF and LOT

header-footer

I have used fancyhdr package for giving header and footer for my report work and to give header and footer for chapter name beginning, I have used this code:

\makeatletter
\let\ps@plain\ps@fancy
\makeatother

This code works to insert header and footer for chapter beginning. But it also adds header and footer for TOC, LOF and LOT. I don't need header and footer for those. Can anyone help me with this.

Thanks in advance.

Best Answer

You can define two different page styles: one for the TOC, LOF and LOT and another for the main text.

\documentclass{report}

\usepackage{fancyhdr}

\fancypagestyle{front}{% style for TOC, LOF, LOT
  \fancyhf{}
  \renewcommand{\headrulewidth}{0pt}
  \cfoot{\thepage}
}
\fancypagestyle{main}{% style for the mainmatter
  \fancyhf{}
  \renewcommand\headrulewidth{.4pt}
  \fancyhead[C]{\slshape \leftmark}
  \fancyfoot[C]{\thepage}
}
\makeatletter
  \newcommand\frontpagestyle{\cleardoublepage\pagestyle{front}\let\ps@plain\ps@front}
  \newcommand\mainpagestyle{\cleardoublepage\pagestyle{main}\let\ps@plain\ps@main}
\makeatother

\usepackage{blindtext}
\begin{document}
\frontpagestyle% switch to the pagestyle front
\tableofcontents
\listoffigures
\listoftables

\mainpagestyle% switch to the pagestyle main
\Blinddocument\Blinddocument\Blinddocument\Blinddocument\Blinddocument
\Blinddocument\Blinddocument\Blinddocument\Blinddocument\Blinddocument
\end{document}

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{automata}
\usetikzlibrary{positioning}

\begin{document}