# How to modify the headers of this book to lower case?

In the following standard \documentclass{book} all headers are in upper case.

How can I modify the code below to make lower case headers?

The even pages show the chapter number and name, and the odd pages show the section number and name. The first page of a chapter has no header, only the page number in the footer. The other pages show the page numbers on the headers: odd pages on the right and even pages on the left, as shown.

It was created with

\documentclass{book}
\usepackage{lipsum}

\begin{document}

\title{Standard \LaTeX{} Book}
\author{The Author}
\date{The Date}
\maketitle
\tableofcontents

\chapter{Test Chapter One}
\section{Test Section One}
\lipsum[1-6]
\section{Test Section Two}
\lipsum[1-6]
\section{Test Section Three}
\lipsum[1-6]

\chapter{Test Chapter Two}
\section{Test Section One}
\lipsum[1-6]
\section{Test Section Two}
\lipsum[1-6]

\end{document}


Remark: the question Page header - Upper and lower case is not sufficiently similar to this one to help me to find a possible solution by my own.

-

This is in my opinion the worse design error in the book class. Not because of the uppercase default (which I consider bad anyway), but because there's no way to easily change it. And the \MakeUppercase is hardwired in the macros.

You can change the behavior by loading the fancyhdr package, and adding

\usepackage{fancyhdr}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{#1}}
\pagestyle{fancy}
\fancyhf{}


to your preamble. You can also load \usepackage{emptypage} to remove headers and footers with the empty pages produced by \cleardoublepage.

The rule below headers is produced by default, so if you want it, comment out the \renewcommand{\headrulewidth}{0pt} line.

Or using a class that provides for changing the default, for instance memoir or scrbook.

-
Many thanks! This solves my problem too and replies to the additional question on how to add a headrule. – Américo Tavares Oct 21 '12 at 17:04
Is it possible to change the header from italic to normal, by adding some code? – Américo Tavares Jun 16 '13 at 13:26
@AméricoTavares Just use \normalfont instead of \itshape. – egreg Jun 16 '13 at 13:30
Many thanks! Done, worked as expected. – Américo Tavares Jun 16 '13 at 13:43

The regexpatch package can help you to remove the \MakeUppercase macros from \tableofcontents and the \chaptermark and \sectionmark macros:

\usepackage{regexpatch}% http://ctan.org/pkg/regexpatch
\makeatletter
% \*patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>}
\xpatchcmd{\chaptermark}{\MakeUppercase}{}{}{}%
\xpatchcmd{\sectionmark}{\MakeUppercase}{}{}{}%
\xpatchcmd*{\tableofcontents}{\MakeUppercase}{}{}{}%
\makeatother


\chaptermark and \sectionmark adds \MakeUppercase to all headings supplied, which is removed by the first two \xpatchcmd commands. \tableofcontents sets its own heading in \MakeUppercase, and is therefore not handled by \chaptermark - the reason for this is that it is actually a \chapter* and requires special attention. \xpatchcmd* does a search-and-replace-all on \MakeUppercase.

-
There are other places where the dreadful \MakeUppercase appears; a real case of bad design, IMO. :-( – egreg Oct 21 '12 at 16:36
Many thanks! This solves my problem. To add a headrule does one need to define headers and footers by means of \fancyhf? – Américo Tavares Oct 21 '12 at 16:43
@AméricoTavares: Yes, and I see that egreg already suggested a fancyhdr solution. – Werner Oct 21 '12 at 17:12
Thanks for the confirmation. – Américo Tavares Oct 21 '12 at 17:16
@AméricoTavares Well, one does not need to use \fancyhf, but it is a complicated task, and why do it again if someone else has prepared a nice package for you to use? :) – yo' Oct 21 '12 at 20:52