[Tex/LaTex] How to remove header and footer from contents page and list of figures

fancyhdrheader-footer

This is the code I've used for the header and footer. How do I remove header and footer from contents page and list of figures?

\usepackage{times}
\usepackage{fancyhdr}
\usepackage{graphicx}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\footrulewidth}{0.4pt}
\rhead{\fontsize{10}{12}\selectfont \textit{\textbf{2014-2015}}}
\lhead{\fontsize{10}{12}\selectfont \textit{\textbf{ECG SIMULATION AND ACQUISITION}}}
\rfoot{\fontsize{10}{12}\selectfont \textit{\textbf{\thepage}}}
\lfoot{\fontsize{10}{12}\selectfont \textit{\textbf{Dept. of ECE, RNSIT, BANGALORE}}}

Best Answer

One possibility is

\AtBeginDocument{%
  \addtocontents{toc}{\protect\thispagestyle{empty}}%
  \addtocontents{lof}{\protect\thispagestyle{empty}}%
}

in the preamble. If there are more than one page in the table of contents or list of figures you have to use \pagestyle{empty} additionally.

Example:

\documentclass{report}
\usepackage{times}
\usepackage{fancyhdr}
\usepackage{graphicx}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\footrulewidth}{0.4pt}
\rhead{\fontsize{10}{12}\selectfont \textit{\textbf{2014-2015}}}
\lhead{\fontsize{10}{12}\selectfont \textit{\textbf{ECG SIMULATION AND ACQUISITION}}}
\rfoot{\fontsize{10}{12}\selectfont \textit{\textbf{\thepage}}}
\lfoot{\fontsize{10}{12}\selectfont \textit{\textbf{Dept. of ECE, RNSIT, BANGALORE}}}

\AtBeginDocument{%
  \addtocontents{toc}{\protect\thispagestyle{empty}}%
  \addtocontents{lof}{\protect\thispagestyle{empty}}%
}

\usepackage{blindtext}% dummy text
\begin{document}
%
\pagestyle{empty}
\tableofcontents
\listoffigures
%
\clearpage
\pagestyle{fancy}
\Blinddocument\Blinddocument\Blinddocument\Blinddocument
\Blinddocument\Blinddocument\Blinddocument\Blinddocument
\begin{figure}
  \fbox{Figure}
  \caption{A figure}
\end{figure}
\end{document}

enter image description here


If you use a KOMA-Script class

\AfterTOCHead{\thispagestyle{empty}}

removes the header and footer from the first page of table of contents and all lists that are controlled by KOMA-Script.

Related Question