I am currently trying to set up a document for a project report. I am having difficulties with the headers and footers.
I would like to have the footer on every page and the footer should look like the picture shown below.
To achieve this footer, I am currently using the fancyhdr
package with the fancy pagestyle as shown in the code snippet below.
\pagestyle{fancy}
%% FOOTER
\fancyfoot[C]{\small \thepage} % PAGE NUMBER
\fancyfoot[L]{\small ENEL895 \\ Version 1.0} % PAPER CODE AND VERSION
\fancyfoot[R]{\small \today} % TODAY'S DATE
\renewcommand{\footrulewidth}{1pt} % FOOTER RULE LINE
The problem I am encountering for the footer is for the TOC (I have put \thispagestyle{fancy}
next to the TOC and all chapters to try and get the headers and footers). The TOC is spread across 2 pages, the first page only has the page number for the footer, whereas the second page has the correct header and footer.
The TOC header and footer for both pages should look like the picture shown below.
The header is where it gets complicated. For the header, I require all the front matter (everything before Chapter 1) to have the section title on the right side of the header and the lettercase should be exactly the same as the title case (i.e. not capitalised and not italicised). The TOC Header (shown above) is an example of what I mean. As for the chapters, I would like the first chapter page to have no header and only the footer specified above. For the remaining pages of the chapter, I would like the chapter on the left (Format: Chapter # - Chapter Name) and the section on the right (Format: # Section Name) of the header.
The header and footer for the first page of the chapter should look like the image shown below.
The header and footer for the remaining pages of the chapter should look like the picture shown below (Ignore the fact that I have shown the first page of the chapter).
Another difficulty I have encountered with the header is that the appendix header has Chapter A instead of Appendix A. I would like this to be on the left hand side of the header and the first page of the appendix should have no header (just like the chapters).
Appendix Header Difficulty:
Here is a MWE of my document so far (sorry it has a lot of comments and the output is not the same as the images shown in this thread).
\documentclass[12pt,a4paper]{report}
%----------------------------------------------------------------------------------------
% PACKAGES
%----------------------------------------------------------------------------------------
%% PAGE MARGINS
\usepackage[margin=1in]{geometry}
%% RANDOM LOREM IPSUM TEXT TO FILL
\usepackage{blindtext}
%% TOC BABEL
\usepackage[english]{babel}
%% HYPERLINKING
\usepackage[colorlinks=true]{hyperref}
\hypersetup{%
colorlinks,
linkcolor={red!50!black},
citecolor={blue!50!black},
urlcolor={blue!80!black}
}
%% HEADERS AND FOOTERS
\usepackage{fancyhdr}
%% HEADING TITLES (TITLE SECTIONS)
\usepackage{titlesec}
%% MAKES THE TOC WORK BETTER IMO (NOT SURE HOW)
\usepackage{tocloft}
%% INCLUDE PDF PAGES
\usepackage{pdfpages}
%----------------------------------------------------------------------------------------
% PAGE STYLE - HEADERS AND FOOTERS SETUP
%----------------------------------------------------------------------------------------
\pagestyle{fancy}
%% HEADER
\fancyhead[L]{\leftmark} % SECTION NAME-FIRST SECTION/PREVIOUS SECTION
\fancyhead[R]{\nouppercase{\rightmark}} % CHAPTER NAME
%--------------------------------------------------------------------------
%% FOOTER
\fancyfoot[C]{\small \thepage} % PAGE NUMBER
\fancyfoot[L]{\small ENEL895 \\ Version 1.0} % PAPER CODE AND VERSION
\fancyfoot[R]{\small \today} % TODAY'S DATE
\renewcommand{\footrulewidth}{1pt} % FOOTER RULE LINE
%--------------------------------------------------------------------------
%----------------------------------------------------------------------------------------
% REDEFINING CHAPTER AND SECTION (LEFT AND RIGHT MARKS) TO BE THE % CHAPTER & SECTION NAMES AND NOT CAPITALISED.
%----------------------------------------------------------------------------------------
%% CHAPTER DEFINED AS RIGHT MARK (Chapter # - Chapter Name)
\renewcommand{\chaptermark}[1]{%
\markboth{}{\chaptername
\ \thechapter ~- #1}}
%% SECTION DEFINED AS LEFT MARK (# Section Name)
\renewcommand{\sectionmark}[1]{\markboth{\thesection\ #1}{}}
%----------------------------------------------------------------------------------------
% REDEFINE THE CHAPTER HEADING FORMAT AND VERTICAL SPACING
%----------------------------------------------------------------------------------------
%% SIZE AND FORMAT OF CHAPTER HEADING TITLE
\titleformat{\chapter}[display]
{\normalfont\Huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
% ALTERS "BEFORE" SPACING (SECOND ARGUMENT) TO 0
\titlespacing*{\chapter}{0pt}{0pt}{20pt}
%----------------------------------------------------------------------------------------
% EDITING THE TOC TITLE AND DOTTED LINE SEGMENTS FOR CHAPTERS
%----------------------------------------------------------------------------------------
%% CHANGE TITLE TO "Table of Contents"
\addto\captionsenglish{% Replace "english" with the language you use
\renewcommand{\contentsname}%
{Table of Contents}%
}
%% ADD DOTTED LINES FOR CHAPTERS IN TOC
\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}} % for chapters, if you really want!
%----------------------------------------------------------------------------------------
% CHANGE LINE SPACING TO 1.5
%----------------------------------------------------------------------------------------
\renewcommand{\baselinestretch}{1.5}
%--------------------------------------------------------------------------
%--------------------------------------------------------------------------
%----------------------------------------------------------------------------------------
% END OF PREAMBLE AND START OF DOCUMENT
%----------------------------------------------------------------------------------------
%--------------------------------------------------------------------------
%--------------------------------------------------------------------------
\begin{document}
%----------------------------------------------------------------------------------------
% PDF TITLE PAGE (NOT INCLUDED FOR MWE)
%----------------------------------------------------------------------------------------
%-----------------------------PDF PAGE---------------------------------
\pagenumbering{roman}
%----------------------------------------------------------------------------------------
% STATEMENT OF ORIGINALITY
%----------------------------------------------------------------------------------------
\section*{\LARGE\center{Statement of Originality\markboth{}{Statement of Originality}}}
\addcontentsline{toc}{chapter}{{Statement of Originality}}
\thispagestyle{fancy}
\newpage
%----------------------------------------------------------------------------------------
% ACKNOWLEDGEMENTS
%----------------------------------------------------------------------------------------
\section*{\LARGE\center{Acknowledgements (optional)\markboth{}{Acknowledgements}}}
\addcontentsline{toc}{chapter}{{Acknowledgements}}
\thispagestyle{fancy}
\newpage
%----------------------------------------------------------------------------------------
% ABSTRACT
%----------------------------------------------------------------------------------------
\section*{\LARGE\center{Abstract\markboth{}{Abstract}}}
\addcontentsline{toc}{chapter}{{Abstract}}
\thispagestyle{fancy}
\newpage
%----------------------------------------------------------------------------------------
% ACRONYMS (OPTIONAL)
%----------------------------------------------------------------------------------------
\section*{\LARGE\center{Acronyms (optional)\markboth{}{Acronyms}}}
\addcontentsline{toc}{chapter}{{Acronyms}}
\thispagestyle{fancy}
\newpage
%----------------------------------------------------------------------------------------
% SYMBOLS (OPTIONAL)
%----------------------------------------------------------------------------------------
\section*{\LARGE\center{Symbols (optional)\markboth{}{Symbols}}}
\addcontentsline{toc}{chapter}{{Symbols}}
\thispagestyle{fancy}
\newpage
%----------------------------------------------------------------------------------------
% TABLE OF CONTENTS
%----------------------------------------------------------------------------------------
\begin{center}
\hypersetup{linkcolor=black} % Make Links Black
\vspace*{-40pt}
\tableofcontents\thispagestyle{fancy}\markboth{}{Table of Contents}
\addcontentsline{toc}{chapter}{Table of Contents}
\newpage
\vspace*{-40pt}
\listoffigures\thispagestyle{fancy}\markboth{}{}
\addcontentsline{toc}{chapter}{List of Figures}
\newpage
\vspace*{-40pt}
\listoftables\thispagestyle{fancy}\markboth{}{}
\addcontentsline{toc}{chapter}{List of Tables}
\end{center}
\newpage
\pagenumbering{arabic}
%----------------------------------------------------------------------------------------
% MAIN TEXT (CHAPTERS)
%----------------------------------------------------------------------------------------
\chapter{Introduction}
\section{Introduction}\thispagestyle{fancy}
\Blindtext
\blindtext
\chapter{Literature Review}\thispagestyle{fancy}
\section{Background/Problem}
\blindtext
\section{Analysis..}
\Blindtext
\Blindtext
\chapter{Methodology}\thispagestyle{fancy}
\section{Procedure}
\blindtext\\
\blindtext \\
\blindtext\\
\blindtext
\section{Simulation?}
\blindtext\\
\blindtext \\
\blindtext
\chapter{Results and Discussion}\thispagestyle{fancy}
\section{Results Verification?}
\Blindtext
\chapter{Future Developments}\thispagestyle{fancy}
\section{Recommendations for Future Work}
\blindtext\\
\blindtext
\chapter{Conclusion}\thispagestyle{fancy}
\section{Conclusion}
\blindtext
%----------------------------------------------------------------------------------------
% APPENDIX
%----------------------------------------------------------------------------------------
\begin{appendix}
\chapter{Example 1}\thispagestyle{fancy}
\section{Testing}
\Blindtext
\chapter{Example 2}\thispagestyle{fancy}
\section{Extra}
\blindtext
\end{appendix}
%----------------------------------------------------------------------------------------
% BIBLIOGRAPHY/REFERENCES
%----------------------------------------------------------------------------------------
%-------------------------------REFS-----------------------------------
\end{document}
Sorry this thread is so long, I just thought I should try and thoroughly explain my issues and my desired outcome. I am currently using the fancyhdr
package but if you believe I should be using the KOMA Script equivalent, feel free to leave a comment on how I should use it (I have not used KOMA Script before).
Thanks.