I am using the book document class and I am using the fancyhdr package. In my header, I am using \leftmark
on the even pages and \rightmark
on the odd pages.
I would like \leftmark
to display "Chapter 1: Chapter One" instead of "Chapter 1. Chapter One".
I would like \rightmark
to display "Section 1: Section One" instead of "Section 1. Section One".
How can I do this? Here is my code. Thanks in advance.
\documentclass[a4paper,12pt,twoside]{book}
\usepackage{lipsum}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{fancyhdr}
% Code for headers
\renewcommand{\headrulewidth}{2pt}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE,RO]{\textbf{\thepage}}
\fancyhead[CE]{\nouppercase{\leftmark}}
\fancyhead[CO]{Section \nouppercase{\rightmark}}
% Code to add page number on the right side of the footer on the chapter start page.
\fancypagestyle{plain}{
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\fancyfoot[R]{\textbf{\thepage}}
}
\begin{document}
\chapter{Chapter One}
\section{Section One}
\lipsum
\lipsum
\end{document}