I'm using fancyhdr for editing the header of my document. I have the following code:
\documentclass[a4paper,12pt,oneside,titlepage]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}
\usepackage{lmodern}
\usepackage{microtype}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\rhead{\small\bfseries\leftmark\quad\thepage}
\renewcommand{\headrulewidth}{0.4pt}
\fancypagestyle{plain}{
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}}
\renewcommand{\chaptermark}[1]{
\markboth{\thechapter.\ #1}{}}
\begin{document}
\tableofcontents
\markboth{\contentsname}{\contentsname}
\listoftables
\markboth{\listtablename}{\listtablename}
\listoffigures
\markboth{\listfigurename}{\listfigurename}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\chapter{Test}
\end{document}
which correctly display chapter number, chapter name (in lower case), page number and a line below, in the top right corner of each page, except the first of each chapter. I only have an issue with the table of contents: the second page show "INDEX ii", while the third (correctly) show "Index iii". Why I have this inconsistency?
\tableofcontents
, and I getCONTENTS <page#>
in the header on each page of the table of contents. How do you issue your table of contents? Do you override the default chapter marks?oneside
andopenright
? The latter only seems to make sense fortwoside
.\chaptermark
doesn't get called for the contents section. You can manually adjust theleftmark
for the contents with something like\addtocontents{toc}{\protect\markboth{\contentsname}{}}
.