Friday, February 22, 2008

How to keep page headers from being all-caps

When writing your thesis, sometimes you don't want your page headers to be in the default all-caps. This is especially important if your chapter or section titles contain chemical formulas that would look really ugly if converted to all-caps. This is a conundrum that K.Yun has been idly pondering for some time now.

I've found a solution that uses the package "fancyhdr" which is available here. The documentation is here. "fancyhdr" lets you format your headers in all sorts of way: italic, bold, not-all-caps -- it even let's your draw a horizontal rule below your header.

Here is what you can input to get rid of the all-caps but otherwise keep everything the same:

\usepackage{fancyhdr}
\fancypagestyle{headings}{%
\fancyhead{}
\fancyhead[ER]{\nouppercase{ \slshape \leftmark}}
\fancyhead[OL]{\nouppercase{ \slshape \rightmark}}
\fancyhead[EL,OR]{\thepage}
\fancyfoot{}
\renewcommand{\headrulewidth}{0pt}
}

All of the above goes before the \begin{document} in your latex file.

But why keep everything the same if "fancyhdr" let's you format your header in an infinite number of ways?