Fancy headers in LaTeX books

First in a series of notes on book formating under LaTeX. This is the header.tex file that defines the format for the headers and footers for each page. It’s pretty standard, as described in e.g. the Page Layout chapter of the wikibook on LaTeX. The only trick is taken from Mark Schenk’s page about his MSc Thesis: this piece of code makes empty pages (typically, the ones on even pages across the first pages of some chapters) completely and immaculately empty.


% Code for creating empty pages
% No headers on empty pages before new chapter
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
\makeatother \clearpage{\pagestyle{plain}\cleardoublepage}


{\markboth{\chaptername\ \thechapter.\ #1}{}}
{\markright{\S \thesection.\ #1}{}}




%\fancypagestyle{plain}{ %
%\fancyhf{} % remove everything
%\renewcommand{\headrulewidth}{0pt} % remove lines as well


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s