Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.
\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?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

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.​

share|improve this answer

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}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.