I'm formatting the final draft of my thesis and have noticed a problem with the chapter and section titles as they appear in the headers.
At the moment I'm using fancyhdr to get the chapter and section titles on alternate pages in the headers. For separate reasons I don't want my introduction chapter and conclusion chapter to be numbered, and I don't want the concluding section of each chapter to be numbered. To achieve this, I've used the \chapter* and \section* commands. However, this has had three unwanted results regarding the chapter/section titles which appear in some of the headers:
- 'Contents' appears as the chapter title in the header for the introduction:
But I would like it to say 'Introduction'.
- The previous section name appears as the section title in the header for the concluding section of the chapters:
But I would like it to say 'Conclusion'.
- The previous chapter title appears as the chapter title in the header for the conclusion chapter:
Again, I'd like this to say 'Conclusion'.
Here's a MWE:
\documentclass[12pt, twoside]{report}
\usepackage[explicit]{titlesec} %adjust titles
\usepackage{lipsum} %random text
%%%%%%%%Chapter and section titles in headers
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{} %clears header
\fancyhead[CE]{\nouppercase{\textit{\leftmark}}} %puts chapter title on even page in lower-case italics
\fancyhead[CO]{\nouppercase{\textit{\rightmark}}} %puts section title on odd page in lower-case italics
\renewcommand{\headrulewidth}{0pt} %gets rid of line
\renewcommand{\chaptermark}[1]{\markboth{#1}{}} %gets rid of chapter number
\renewcommand{\sectionmark}[1]{\markright{#1}} %gets rid of section number
%%%%%%%%%
\titleformat{\chapter}[display]{\LARGE\bfseries\centering}{\thechapter}{10pt}{#1}
\titleformat{\section}{\normalfont\fontsize{20}{20}\centering}{\thesection}{1em}{\MakeUppercase{#1}}
\titleformat{\subsection}{\normalfont\centering}{\thesubsection}{1em}{\textit{{#1}}}
\usepackage{subfiles} %allows multi-file projects
\setcounter{tocdepth}{1} %removes subsubsections from toc
%%%%%%%%%removes dots from toc
\makeatletter
\renewcommand{\@dotsep}{10000}
\makeatother
%%%%%%%%%
\begin{document}
\tableofcontents
\chapter*{Introduction}
\addcontentsline{toc}{chapter}{Introduction}
\renewcommand{\thesection}{\arabic{section}}
\section{An Introductory Section}
\lipsum
\lipsum[1]
\section{Another Introductory Section}
\lipsum
\chapter{A Chapter}
\renewcommand{\thesection}{\thechapter.\arabic{section}}
\lipsum[2-3]
\section{A Section}
\lipsum[4-8]
\section*{Conclusion}
\lipsum[8-9]
\chapter{Another Chapter}
\renewcommand{\thesection}{\thechapter.\arabic{section}}
\lipsum[1-2]
\chapter*{Conclusion}
\addcontentsline{toc}{chapter}{Conclusion}
\lipsum
\end{document}
I'm aware that similar questions have been asked (e.g. Unnumbered chapter in toc and heading) but they seem to be about KOMA-Script. Given that this is a final draft, if it's possible to do this using fancyhdr and without having to change loads of things that'd be ideal. Thanks!