I'm using the 'book' class to write a long manuscript, and I followed someone else's instructions in order to modify the headers and footers of this class. In particular, I didn't like the style of these headers, the fact that the page numbers are placed in a header instead than in a footer, and the silly habit of producing headers on an empty page before a new chapter.
The following code was suggested in some forum. It does a nice job with the headers and footers, and also with the page numbers, at least up to the mainmatter. That is, it doesn't include the page number on the empty page before the TOC or the preface, but it does for every section afterwards (namely, before the 'introduction', and before every new chapter). I'm not sure why it's doing that, but it sure is annoying me a great deal. I like this pagestyle, but I just want to get rid of those annoying page numbers on the empty pages. Can you help?
Below, I copy the specific piece of code aforementioned, and then the remainder of the preamble. Many thanks in advance.
Code: Select all
% Code for creating empty pages
% No headers on empty pages before new chapter
\makeatletter
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
\hbox{}
\thispagestyle{plain}
\newpage
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother \clearpage{\pagestyle{plain}\cleardoublepage}
% Define pagestyle
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\chaptermark}[1]{\markboth{ \emph{#1}}{}}
\fancyhead[LO]{}
\fancyhead[RE]{\leftmark}
\fancyfoot[LE,RO]{\thepage}
Code: Select all
\documentclass[11pt,a4paper,leqno]{book}
\usepackage{mathptmx}
\usepackage[UKenglish]{babel}
\usepackage{apacite}
\usepackage[round]{natbib}
\usepackage{covington}
\usepackage{paralist}
\usepackage{tikz}
\usepackage{tikz-qtree}
\usepackage{latexsym}
\usepackage{graphics}
\usepackage{epic,eepic}
\usepackage{appendix}
\usepackage{setspace}
\usepackage{fancyhdr}
\newcommand\bookepigraph[4]{
\vspace{1em}\hfill{}\begin{minipage}{#1}{\begin{spacing}{0.9}
\small\noindent\textit{#2}\end{spacing}
\vspace{1em}
\hfill{}{#3}\\
\vspace{-1em}\begin{flushright}{#4}\end{flushright}}\vspace{2em}
\end{minipage}}
% Code for creating empty pages
% No headers on empty pages before new chapter
\makeatletter
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
\hbox{}
\thispagestyle{plain}
\newpage
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother \clearpage{\pagestyle{plain}\cleardoublepage}
% Define pagestyle
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\chaptermark}[1]{\markboth{ \emph{#1}}{}}
\fancyhead[LO]{}
\fancyhead[RE]{\leftmark}
\fancyfoot[LE,RO]{\thepage}
\title{}
\author{}
\date{}
\begin{document}
\maketitle
\renewcommand\thepage{}
\tableofcontents
\listoffigures
\frontmatter