[Tex/LaTex] memoir class: how to set \pagestyle on blank page that gets inserted before a new chapter

blank-pagechaptersmemoir

I am typesetting a book in LaTeX, using the memoir document class.

As a preference, I am using openright, so that chapters begin on righthand (Recto) pages.

Situation: Using this preference, LaTeX will insert a blank page prior to a new chapter, when necessary, so that the new chapter will open on a righthand page. However, this blank page that gets inserted prior to the chapter is completely blank – no page number or anything. (\pagestyle{empty})

My overall question: How do I make it, so that this blank page, has a page number on it? (\pagestyle{plain})

Below I have provided the details on what I did to try to solve this issue, and further refined the question. But first here is a simple tex file to demonstrate the issue, along with a picture which shows how the resulting document looks.

\documentclass[a4paper,smalldemyvopaper,12pt,twoside,onecolumn,operight,extrafontsizes]{memoir}
\usepackage[utf8x]{inputenc}
\usepackage[osf]{Alegreya,AlegreyaSans} % this will give the nice font

% title page
\title{This is an example document}
\author{Just Another Brick in the Wall}


\begin{document}

\maketitle
\clearpage
\tableofcontents

\mainmatter

\chapter{A Chapter With No Blank Page Inserted Before It}

No blank page will get inserted prior to this chapter, because it already begins on a righthand (Recto) page naturally.

\chapter{A Chapter That Gets a Blank Page Inserted before it}

Because the previous chapter ended on a righthand page, a blank page will get inserted before this chapter begins, so that it will start on a righthand page. Notice how there is no page number on that blank page - I'd like to change that somehow!

\end{document}

This is what the resulting pdf looks like (Notice on page 4/5, there is no page number – that is what I would like to change!) Resulting Document

Here is what I tried; it should refine the question a bit: I looked at the source code for the memoir class, to understand how the \chapter macro works. I looked at the source code here (please correct me if I'm looking at the wrong code): http://ctan.mirrors.hoobly.com/macros/latex/contrib/memoir/memoir.dtx

If you search in that link for \newcommand\chapter, you will find the macro defined. At the beginning of the \chapter macro, there is a command \clearforchapter. As I understand from the memoir class documentation, \clearforchapter is a command which will set the chapter on to the correct page (insert the blank page for me, I'm assuming). So, I thought maybe this command sets a \pagestyle{empty} and that I could redefine it. However, searching the source code, I can't find where \clearforchapter command is defined.

Therefore, here are two more specific questions which might solve the problem:

(1) Does anyone know if there is a simple option, which will instruct LaTeX to use a 'plain' pagestyle, for dummy pages that get inserted before a chapter? (Similar to how you can do \aliaspagestyle{afterpart}{plain} in the preamble, to change the pagestyles of the blank page that comes after 'part')

(2) Does anyone know where this \clearforchapter macro is defined? Is it part of another class? (So I can look at what it does and try to redefine it? I'm wondering if it has a \pagestyle{empty} in it)?

Thank you very much. I am new to this and appreciate your help.

Best Answer

Memoir uses the page style cleared for these pages (see manual page 106). With

\aliaspagestyle{cleared}{plain}

in your preamble (see page 109) you can set it to plain.

Remark: If you search for the definition of a macro, don't search for \newcommand\somecommand, just search for \somecommand. There are several possibilities to define a macro: \def, \newcommand{...}, or \let, to name a few. In your case it was \gdef\clearforchapter.

Related Question