7

I am writing a document using the book class. The problem is, that I want the headers to be in lowercase letters. How to force them to be lower case?

A sample code is

\documentclass{book}
\usepackage{lipsum}
\begin{document}
\chapter{Chapter one $e^--p^+$}
        \lipsum[1-10]
\end{document}

and the ouptut looks like that

enter image description here

Thanos
  • 12,446
  • Does this help: http://tex.stackexchange.com/questions/46525/preventing-makeuppercase-from-affecting-mathematics – Marco Daniel Jun 28 '13 at 15:43
  • Do you want to keep the case of the entire heading? So your header reads Chapter 1. Chapter one $e^--p^+$ and not CHAPTER 1. CHAPTER ONE $E^--P^+$? Or just CHAPTER 1. CHAPTER ONE $e^--p^+$? – Werner Jun 28 '13 at 15:44
  • 1
    If you're not using any form of automatic uppercase in your document, add \let\MakeUppercase\relax to your document preamble. – Werner Jun 28 '13 at 15:53
  • 1
    the ams document classes define a routine \uppercasenonmath that was written for this purpose. you might be able to extract it (and some other required definitions) from amsbook.cls. the macro documentation is in amsclass.dtx, which can be found on ctan in the macros/latex/required/amslatex/amscls/ area; a somewhat more "readable" version (a pdf file generated from the .dtx) can be had with texdoc amsclass' on a tex live installation (if the documentation has been installed), or from ctan in thedoc` subdirectory of the cited area. – barbara beeton Jun 28 '13 at 18:51
  • @Werner: I believe that your suggestion is very nice! It suits me best! Do you mind, answering the question, in order to accept your answer? Thank you very much! – Thanos Jun 29 '13 at 07:48

3 Answers3

10

Setting the headers with fancyhdr in order to avoid automatic uppercasing is easy; add font choice commands such as \itshape before \nouppercase.

\documentclass{book}

\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\fancyhf{}
\fancyhead[LO]{\nouppercase{\rightmark}}
\fancyhead[RE]{\nouppercase{\leftmark}}
\fancyhead[LE,RO]{\thepage}

% This is just for the example
\usepackage{kantlipsum}
\newcommand\achap{
  \chapter{Title with math $a+b=c$}
  \section{Abc}\kant\section{Bcd}\kant\section{Cde}\kant}

\begin{document}
\frontmatter
\tableofcontents
\mainmatter
\achap\achap\achap\achap
\achap\achap\achap\achap
\end{document}
egreg
  • 1,121,712
6

If you're not using any form of automatic capitalization in your document, add

\let\MakeUppercase\relax

to your document preamble. This makes \MakeUppercase (used in the default book document class to make the capitalize the headers) turn into a no-op.

enter image description here

However, other elements of your document might still use this without you knowing it. It's better to define these headers in an abstract and manageable way through page styles. Here's one using titleps:

\usepackage{titleps}% http://ctan.org/pkg/titleps
\makeatletter
\newpagestyle{main}{% Define page style main
  \sethead%
    [\slshape\thesection.\ \sectiontitle][][]% [<even-left>][<even-centre>][<even-right>]
    {}{}{\slshape\@chapapp~\thechapter.\ \chaptertitle}% {<odd-left>}{<odd-centre>}{<odd-right>}
  \setfoot{}{\thepage}{}% {<left>}{<centre>}{<right>}
}
\pagestyle{main}% Use page style main

Some more details are available from the titleps documentation or from titleps for fan­cy­hdr users.

Werner
  • 603,163
3

Related to your edit you can redefine the default definition of \chaptermark:

\documentclass{book}
\usepackage{lipsum}
\makeatletter
\def\chaptermark#1{\markright{
     \ifnum \c@secnumdepth >\m@ne\if@mainmatter
        \@chapapp\ \thechapter. \ %
          \fi\fi #1}}
\makeatother
\begin{document}
\chapter{Chapter one $e^--p^+$}
        \lipsum[1-10]
\end{document}

A second approach would be the usage of the package fancyhdr as suggest in the comment:

\documentclass{book}
\usepackage{lipsum}
\usepackage{fancyhdr}
\fancyhead[RE]{\nouppercase{\leftmark}}
\fancyhead[LO]{\nouppercase{\rightmark}}
\pagestyle{fancy}
\begin{document}
\chapter{Chapter one $e^--p^+$}
        \lipsum[1-10]
\end{document}
Marco Daniel
  • 95,681