0

My report contains a table of contents spanning three pages, and a list of figures page spanning three pages, and a table of contents on a single page. Unfortunately the header and footer is not appearing on the first page of contents, as well as the first page of list of figures, and it isn't appearing on the list of tables page as well.

\documentclass{report}

\usepackage{fancyhdr}
\usepackage{hyperref}

\fancypagestyle{plain}{
  \fancyhf{}
  \renewcommand{\headrulewidth}{0pt}
  \renewcommand{\footrulewidth}{0pt}
  \rfoot{\thepage}}
\pagestyle{plain}

\patchcmd{\chapter}{\thispagestyle{plain}}{\thispagestyle{fancy}}{}{}

\begin{document}

\clearpage
\thispagestyle{fancy}
\rhead{xyz}
\lhead{year}
\renewcommand{\headrulewidth}{1.6pt}
\renewcommand{\footrulewidth}{1.6pt}
\lfoot{blah}
\cfoot{}
\rfoot{\thepage}
\hypersetup{linkcolor = black}

\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{Contents}
\tableofcontents

\clearpage
\addcontentsline{toc}{chapter}{List of Figures}
\cleardoublepage
\phantomsection
\listoffigures
\hypersetup{linkcolor=black}
\addtocontents{lof}{~\hfill\textbf{Pg.No}\par}


\clearpage
\addcontentsline{toc}{chapter}{List of Tables}
\cleardoublepage
\phantomsection
\listoftables
\hypersetup{linkcolor=black}
\addtocontents{lot}{~\hfill\textbf{Pg.No}\par}

\chapter{Title}

dummy text.

\end{document}

How do I make the header and footer to appear on the first pages of contents, list of figures, and list of tables?

0 Answers0