0

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{}
\rhead{Page}
\lhead{CHAPTER}
\tableofcontents

\addtocontents{toc}{~\hfill Page\par}
\newpage

\clearpage
\addcontentsline{toc}{part}{LIST OF FIGURES}
\addtocontents{toc}{CHAPTER \par}
\renewcommand{\cftlabel}{Figure}
\addtocontents{lof}{Figure~\hfill Page \par}

\addtocontents{lof}{\protect\thispagestyle{empty}}
\thispagestyle{fancy}
\fancyhf{}
\rhead{Page}
\lhead{Figure}
\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!

1 Answer 1

1

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. a

(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.

b

(3) No headers in the main text.

c

This is complete code.

\documentclass[12pt,a4paper]{report}


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

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

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

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


\usepackage{fancyhdr}
\fancypagestyle{TOC}{% Define ToC style
\fancyhf{}
\fancyhead[R]{Page}
\fancyhead[L]{CHAPTER}
\fancyfoot[C]{\thepage}
}

\fancypagestyle{FIG}{% Define LoF style
    \fancyhf{}
    \fancyhead[R]{Page}
    \fancyhead[L]{FIGURE}
    \fancyfoot[C]{\thepage}
}
\renewcommand{\headrulewidth}{0pt} % remove the line of the header
    
\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}
1
  • Thank you! I hope you can also help on the latest question of mine... Mar 21, 2022 at 22:53

You must log in to answer this question.

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