The fancyhdr Package
Documentation | fancyhdr |
---|---|
Categories | layout |
Description | Manage running headers and footers. |
Options |
\usepackage{fancyhdr} % running headers and footers |
Examples |
\renewcommand{\footrulewidth}{0.4pt}
\renewcommand*{\ffcolor}{DarkOliveGreen}
\renewcommand*{\ffstyle}[1]{{\scriptsize\textcolor{\ffcolor}{\nouppercase#1}}}
\renewcommand{\headrule}{{\color{\ffcolor}%
\hrule width\headwidth height\headrulewidth \vskip-\headrulewidth}}
\renewcommand{\footrule}{{\color{\ffcolor}%
\hrule width\headwidth height\footrulewidth \vskip-\footrulewidth}}
% Set the general page style
\fancyhf{} % clear all fields
\fancyfoot[LO,RE]{\ffstyle{Document name}}
\fancyfoot[LE,RO]{\ffstyle{the Date}}
\fancyfoot[CO,CE]{\ffstyle{\thepage}}
% Set the style for the first page
\fancypagestyle{first}{\fancyhf{}%
\fancyfoot[LO,RE]{\ffstyle{Something different}}%
\fancyfoot[RO,LE]{\ffstyle{theDate}}%
\renewcommand\headrulewidth{0pt}
}
% To make the headers and footers show up, we need to set the pagestyles
\thispagestyle{first}
\pagestyle{fancy}
\lipsum[1]