Consider the following MWE:

\documentclass{book}
\usepackage{fancyhdr}
\usepackage{lipsum}

\title{Test}
\author{Me}
\date{\today}

\begin{document}
\maketitle

\tableofcontents

\chapter{$1+1=2$} % normal face everywhere
\lipsum[1-5]
\chapter{$\mathbf{1+1=2}$} % bold face everywhere
\lipsum[5-10]
\chapter[$4+4=8$]{$\mathbf{4+4=8}$} % bold face in title, normal face in toc and header
\lipsum[10-15]

\end{document}


The three chapters all have math in their titles. Naturally, I want them to behave nicely, that is,

• bold face when printed on the chapter title page,
• normal face when printed in the header.

The first two conditions are easy to meet by using \mathbf in the chapter titles (as done for the second chapter), but then, the bold face also appears in the header. When using normal face in the optional argument title, it also disappears from the line in the table of contents.

How can I have the correct boldface/normalface behavior for math in chapter titles when using the book document class and fancyhdr?

• You can use \boldmath; e.g., \chapter{\boldmath Chapter $1+1=2$} – user94293 Jan 25 '17 at 1:15

Use \protect\boldmath in your \chaper title (since it's a moving argument) and set \let\boldmath\relax as part of your fancyhdr construction:

\documentclass{book}

\usepackage{amsfonts,fancyhdr,lipsum}

\pagestyle{fancy}
\chapter{\protect\boldmath${1+1=2}$}