UK TeX FAQ -- question label fancyhdr

### 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.

While fancyhdr will work with KOMA-script classes, an alternative package, scrpage2, eases integration with the classes. Scrpage2 may also be used as a fancyhdr replacement, providing similar facilities. The KOMA-script classes themselves permit some modest redefinition of head- and footlines, without the use of the extra package.

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

Documentation of fancyhdr is distributed with the package, in a separate file; documentation of scrpage2 is integrated with the scrgui* documentation files that are distributed with the KOMA-script classes.

`fancyhdr.sty`
  macros/latex/contrib/fancyhdr (or browse the directory)
`KOMA script bundle`
  macros/latex/contrib/koma-script (or browse the directory)
`memoir.cls`
  macros/latex/contrib/memoir (or browse the directory)

This question on the Web: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=fancyhdr