4
\documentclass[12pt,a4paper,openright]{mwrep}
\usepackage{lipsum}
\usepackage[top=2cm,bottom=2cm,left=3cm,right=2cm,twoside]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}\fancyfoot[EL,OR]{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\fancypagestyle{opening}{\fancyhf{}\fancyfoot[EL,OR]{\thepage}%
  \renewcommand{\headrulewidth}{0pt}
  \renewcommand{\footrulewidth}{0pt}}
\fancypagestyle{closing}{\fancyhf{}\fancyfoot[EL,OR]{\thepage}%
  \renewcommand{\headrulewidth}{0pt}
  \renewcommand{\footrulewidth}{0pt}}
\setlength{\footskip}{20pt}
\begin{document}
\chapter{c1}
\lipsum[1-15]
\chapter{c2}
\lipsum[1-15]
\end{document}

How can I include page numbers on empty pages?

2 Answers 2

4

openright causes a \cleardoublepage to be issued before the start of a new chapter. And, \cleardoublepage is defined as

\def\cleardoublepage{\clearpage
  \if@twoside
    \ifodd\c@page\else
      \hbox{}\thispagestyle{blank}\newpage
      \if@twocolumn\hbox{}\newpage\fi
    \fi
  \fi}

Note the \thispagestyle{blank} which clears any page headers/footers on the page. Removing that via a redefinition of \cleardoublepage will help.

enter image description here

\documentclass[12pt,a4paper,openright]{mwrep}
\usepackage{lipsum}
\usepackage[top=2cm,bottom=2cm,left=3cm,right=2cm,twoside]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}\fancyfoot[EL,OR]{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\fancypagestyle{opening}{\fancyhf{}\fancyfoot[EL,OR]{\thepage}%
  \renewcommand{\headrulewidth}{0pt}
  \renewcommand{\footrulewidth}{0pt}}
\fancypagestyle{closing}{\fancyhf{}\fancyfoot[EL,OR]{\thepage}%
  \renewcommand{\headrulewidth}{0pt}
  \renewcommand{\footrulewidth}{0pt}}
\setlength{\footskip}{20pt}

\makeatletter
\def\cleardoublepage{\clearpage
  \if@twoside
    \ifodd\c@page\else
      \hbox{}\newpage% previously included \thispagestyle{blank}
      \if@twocolumn\hbox{}\newpage\fi
    \fi
  \fi}
\makeatother

\begin{document}
\chapter{c1}
\lipsum[1-15]
\chapter{c2}
\lipsum[1-15]
\end{document}

This is similar to Gonzalo's answer, but allows you to modify the actual page style used for these blank pages, if needed.​

5

You can define a new page style adding the page number in the desired position and then \let the blank page style (internally used by mwrep for the empty pages) to be this newly defined one; a simple example adding page numbers centered in the footer (of course, you can use one of your already existing styles):

\documentclass[12pt,a4paper,openright]{mwrep}
\usepackage{lipsum}
\usepackage[top=2cm,bottom=2cm,left=3cm,right=2cm,twoside]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}\fancyfoot[EL,OR]{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\fancypagestyle{opening}{\fancyhf{}\fancyfoot[EL,OR]{\thepage}%
  \renewcommand{\headrulewidth}{0pt}
  \renewcommand{\footrulewidth}{0pt}}
\fancypagestyle{closing}{\fancyhf{}\fancyfoot[EL,OR]{\thepage}%
  \renewcommand{\headrulewidth}{0pt}
  \renewcommand{\footrulewidth}{0pt}}
\setlength{\footskip}{20pt}

\fancypagestyle{myempty}{%
\fancyhf{}
\fancyfoot[C]{\thepage}
}

\makeatletter
\let\ps@blank\ps@myempty
\makeatother

\begin{document}
\chapter{c1}
\lipsum[1-15]
\chapter{c2}
\lipsum[1-15]
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .