Time for action – customizing headers with the fancyhdr package

The default shape of the page headings is slanted. Furthermore, they are written in capital letters. We shall use bold typeface instead and we will use capital letters only for the chapter title. We will load the fancyhdr package and use its commands to achieve that:

  1. Load the first version of our example. Insert the highlighted lines:
    \documentclass[a4paper,12pt]{book}
    \usepackage[english]{babel}
    \usepackage{blindtext}
    \usepackage{fancyhdr}
    \fancyhf{}
    \fancyhead[LE]{\leftmark}
    \fancyhead[RO]{\nouppercase{\rightmark}}
    \fancyfoot[LE,RO]{\thepage}
    \pagestyle{fancy} \begin{document} \chapter{Exploring the page layout} In this chapter we will study the layout of pages. \section{Some filler ...

Get LaTeX Beginners Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.