The TeX FAQ

Frequently Asked Question List for TeX

Formatting

Alternative head- and footlines in LaTeX

The standard LaTeX document classes define a small set of “page styles” which specify head- and footlines for your document (though they can be used for other purposes, too). The standard set is very limited, but LaTeX is capable of much more. The internal LaTeX coding needed to change page styles is not particularly challenging, but there’s no need — there are packages that provide useful abstractions that match the way we typically think about these things.

The fancyhdr package provides simple mechanisms for defining pretty much every head- or footline variation you could want; the directory also contains some documentation and one or two smaller packages. Fancyhdr also deals with the tedious behaviour of the standard styles with initial pages, by enabling you to define different page styles for initial and for body pages.

The scrlayer-scrpage package provides another approach to controlling page headers and footers. Use this package instead of fancyhdr for improved integration with the KOMA-script classes.

Memoir also contains the functionality of fancyhdr, and has several predefined styles.

FAQ ID: Q-fancyhdr
Tags: structure