# Fancy Page Headers

Fancy headers allow you to customize the header and footer line.

## Document layout:

% ...
\usepackage{fancyhdr}
% ...
\begin{document}
% ...
\end{document}


## Index page:

To find out how to force your index to use fancy headers see Indexes

## Example for an article:

% ...
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
\fancyhf{}
\fancyhead[LE,RO]{\bfseries\thepage}
\fancyhead[LO]{\bfseries\rightmark}
\fancyhead[RE]{\bfseries\leftmark}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0.5pt}
\addtolength{\headheight}{0.5pt}
\addtolength{\footskip}{0.5pt}
\cfoot{<author>}
% ...
\begin{document}
% ...
\end{document}


NOTE: Fancyhdr will use Margin lengths (as in Small Page Margins), therefore margins should be set before fancyhdr.

Feedback is always welcome! If you'd like to get in touch with me concerning the contents of this article, please use Twitter.