How can I change the header of ToC
by using the solution given by @Bordaigorl here? I want small capitals, like in abstract, chapters and appendix in my example. The same problem is for LoF
and LoT
. Sorry for the messy code!
\documentclass[twoside]{book}
\usepackage{fancyhdr}
\usepackage[titles]{tocloft}
\usepackage{lipsum} % just for the example
\makeatletter
\fancyhead{}
\fancyfoot{}
\fancyhead[RO]{\textsc{\rightmark}}
\fancyhead[LE]{\textsc{\leftmark}}
\fancyfoot[LE]{\thepage}
\fancyfoot[RO]{\thepage}
\fancypagestyle{plain}{%
\fancyhf{}
\fancyfoot[LE]{\thepage}
\fancyfoot[RO]{\thepage}
}
\pagestyle{fancy}
\g@addto@macro{\frontmatter}{%
\renewcommand*{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand*{\sectionmark}[1]{\markright{#1}{}}
}
\g@addto@macro{\mainmatter}{%
\renewcommand*{\chaptermark}[1]{\markboth{Chapter\space\thechapter:\space#1}{}}
\renewcommand*{\sectionmark}[1]{\markright{\thesection:\space#1}{}}
}
\g@addto@macro{\appendix}{%
\renewcommand*{\chaptermark}[1]{\markboth{Appendix\space\thechapter:\space#1}{}}
\renewcommand*{\sectionmark}[1]{\markright{\thesection:\space#1}{}}
\addtocontents{loa}{\protect\renewcommand{\protect\cftchappresnum}{\appendixname\space}}
}
\g@addto@macro{\backmatter}{%
\renewcommand*{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand*{\sectionmark}[1]{\markright{#1}{}}
}
\makeatother
\begin{document}
\frontmatter
\tableofcontents
\cleardoublepage
\listoffigures
\cleardoublepage
\listoftables
\cleardoublepage
\chapter{Abstract}
\section{Abs1}
\lipsum
\section{Abs2}
\lipsum
\cleardoublepage
\mainmatter
\chapter{A}
\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{A}\section{Section A}
\lipsum
\cleardoublepage
\chapter{B}
\section{B}\section{B}\section{B}\section{B}\section{B}\section{B}\section{B}\section{B}\section{B}\section{B}\section{B}\section{B}\section{B}\section{B}\section{B}\section{B}\section{B}\section{B}\section{B}\section{B}\section{B}\section{B}\section{B}\section{B}\section{B}\section{B}\section{B}\section{B}\section{Section B}
\lipsum
\cleardoublepage
\appendix
\chapter{Appendies}
\section{app}\section{app}\section{app}\section{app}\section{app}\section{app}\section{app}\section{app}\section{app}\section{app}\section{app}\section{app}\section{app}\section{app}\section{app}\section{app}\section{app}\section{app}\section{app}\section{Section App}
\lipsum
\cleardoublepage
\backmatter
\chapter{Bibliography}
\section{Section Bib}
\lipsum
\end{document}