# Forcing pagestyle to change in a formatting issue

I used the "report" document class for my Ph.D thesis and the formatting requirement is that 1) There should be a CHAPTER header right aligned and Page header left aligned on top of each subsequent page in the TOC. 2) There should be a Figure header left aligned and Page header right aligned at the top of each subsequent page of the LIST OF FIGURES. 3) In the MAIN TEXT and REFERENCES remove the HEADERS at the top of the page. To cope with 1) and 2) I used the following LaTeX commands:

\addtocontents{toc}{\protect\thispagestyle{empty}}
\thispagestyle{fancy}
\fancyhf{}
\tableofcontents

\newpage

\clearpage
\renewcommand{\cftlabel}{Figure}

\thispagestyle{fancy}
\fancyhf{}
\listoffigures


Then I used the following to input the main body of the thesis:

\doublespace
\pagenumbering{arabic}
\pagestyle{plain}
\include{chapter1} %Prevent abstract environment to reset pagenumbering, do not use \begin{abstract} ... \end{abstract}. Instead, try \section{Abstract} as a surrogate.
\include{chapter2}
\include{chapter3}
\include{chapter4}
\include{chapter5}
\include{chapter6}
\include{chapter7}


However, the issue is that there is still no page numbers on any of the main context pages, and the the effect of \addtocontents{lof}{\protect\thispagestyle{empty}} \thispagestyle{fancy} remains valid throughout the entire document: all the materials in the chapters and later in the references and appendices have a Figure header left aligned and Page header right aligned at the top of each pages (starting from the "LIST OF FIGURE" page), I tried a lot to fix this issue (so that the requirement 3) can be met) but I did not succeed, may I know which's going on and how I can I fix it? Thank you very much!

Use the package fancyhdr to define two new styles: the first to be use in the ToC pages and the second for the LoF pages. The rest of the document will follow the plain style: no headers and only the page number in the footer.

(1) In ToC => CHAPTER in left header and Pages in right header, after the first page. Footer with the page number like the plain style.

(2) In LoF => FIGURE in left header and Pages in right header, after the first page. Footer with the page number like the plain style.

(3) No headers in the main text.

This is complete code.

\documentclass[12pt,a4paper]{report}

% ***************************  added ONLY to generate many chapters and figures
\usepackage{pgffor}

\foreach \C in {1,...,#1} {%
\chapter{Chapter \C}\kant[1]
}%
}

\foreach \F in {1,...,#1} {%
{\begin{figure}[t]\caption{}\end{figure}}
}%
}
\usepackage{kantlipsum} % dummy text

%************************************************

\usepackage{fancyhdr}
\fancypagestyle{TOC}{% Define ToC style
\fancyhf{}
\fancyfoot[C]{\thepage}
}

\fancypagestyle{FIG}{% Define LoF style
\fancyhf{}
\fancyfoot[C]{\thepage}
}

\begin{document}

\pagestyle{TOC} % use TOC style
\tableofcontents
\cleardoublepage% needed to start a new style<<<

\pagestyle{FIG}% use FIG style
\listoffigures
\cleardoublepage% needed to start a new style<<<

\pagenumbering{arabic}
\pagestyle{plain}

\AddChapters{50} % add 50 chapters to fill the ToC, with three figures each

\end{document}

• Thank you! I hope you can also help on the latest question of mine... Mar 21, 2022 at 22:53