40

I have a scrbook document with an openright option, i.e. every once in a while a blank left page appears in the document. Not that I really want to do this, but how could I include the infamous "This page has been intentionally left blank" in those blank pages cleanly, i.e. without too many hacks?

Bonus points for including a different famous quote on each blank page instead of the dull default ;)

6
  • 8
    Well this is like the paradox of the liar from Crete... :)
    – Count Zero
    Jun 22, 2012 at 13:03
  • 2
    To avoid the paradox, use "This page is intentionally printed only with this statement." Jun 27, 2012 at 18:22
  • 2
    I am using "This page is filler so that important sections start on the right hand side of the book."
    – Eponymous
    May 13, 2014 at 16:14
  • 1
    Another correct avoidance of the paradox: This page is unintentionally left not blank.
    – teed
    Nov 11, 2017 at 1:18
  • 1
    Late to the party, but: I've never understood what's wrong with: "This page intentionally not left blank." That's precisely what it is; you could have left it blank, but intentionally you wrote something to avoid so. Dec 22, 2020 at 12:57

4 Answers 4

35

You could redefine \cleardoublepage. Here's an example:

\documentclass[openright]{scrbook}
\newcommand*{\blankpage}{%
\vspace*{\fill}
{\centering This page would be intentionally left blank if we would not wish to inform about that.\par}
\vspace{\fill}}
\makeatletter
\renewcommand*{\cleardoublepage}{\clearpage\if@twoside \ifodd\c@page\else
\blankpage
\thispagestyle{empty}
\newpage
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother
\begin{document}
Text
\chapter{First chapter}
\end{document}

\blankpage just prints what you like, both vertically and horizontally centered.

7
  • I guess the downside of this is that if \cleardoublepage changes at upgrade time, evil things could happen. Oh well, this is TeX, I don't expect much in terms of inheritance ;) Aug 15, 2010 at 1:46
  • 3
    KOMA-Script and so scrbook define 14 such commands, from \clearpage to \cleardoubleevenstandardpage, so it could be further customized. ;)
    – Stefan Kottwitz
    Aug 15, 2010 at 1:51
  • This works well for \mainmatter, but not for \frontmatter and \backmatter. Is there any tweak to do that for the whole document?
    – Pygmalion
    Oct 6, 2014 at 7:34
  • I am using the book style. This works well for the last pages of each chapter. But I don't see such sentence appearing right after the \part pages in which we normally have nothing printed.
    – enthu
    Nov 9, 2014 at 15:40
  • @EnthusiasticStudent Perhaps it doesn't use \cleardoublepage which has been redefined here. So you could hook into another macro at that place.
    – Stefan Kottwitz
    Nov 9, 2014 at 20:24
10

memoir has \cleartooddpage (and \cleartoevenpage) which do just this. Paraphrased from the manual:

A likely example for the optional argument is

\cleartooddpage[\vspace*{\fill}   
THIS
PAGE ACCIDENTALLY PRINTED
ON   
\vspace*{\fill}]

which will put ‘THIS PAGE ACCIDENTALLY PRINTED ON’ in the centre of any potential skipped (empty) even numbered page.

8

I haven't seen an answer that handles correct centering in both horizontal and vertical direction. For analysis the answer of Stefan Kottwitz is taken:

% Set parameters for analyzing/debugging
\showboxdepth=\maxdimen
\showboxbreadth=\maxdimen
\tracingonline=1

\documentclass[openright]{scrbook}
\newcommand*{\blankpage}{%
  \vspace*{\fill}
  \centering
  This page would be intentionally left blank if we would not wish
  to inform about that.
  \vspace{\fill}%

  \showlists
}
\makeatletter
\renewcommand*{\cleardoublepage}{%
  \clearpage
  \if@twoside
    \ifodd\c@page
    \else
      \blankpage
      \thispagestyle{empty}
      \newpage
      \if@twocolumn
        \hbox{}\newpage
      \fi
    \fi
  \fi
}
\makeatother

\begin{document}
Text
\chapter{First chapter}
\end{document}

\showlists stops the TeX run and displays the current vertical list. This is written into the .log file and, if \tracingonline is set to a positive number, it is also printed on the terminal.

Excerpt from the .log file:

### vertical mode entered at line 0
### current page:
\write-{}
\glue(\topskip) 11.0
\rule(0.0+0.0)x*
\penalty 10000
\glue 0.0 plus 1.0fill
\glue 0.0
\glue(\parskip) 0.0 plus 1.0
\glue(\baselineskip) 5.99585
\hbox(7.60416+2.12917)x418.25555, glue set - 0.1209
.\glue(\leftskip) 0.0 plus 1.0fil
.\hbox(0.0+0.0)x0.0
.\OT1/cmr/m/n/10.95 T
.\OT1/cmr/m/n/10.95 h
.\OT1/cmr/m/n/10.95 i
.\OT1/cmr/m/n/10.95 s
.\glue 3.65 plus 1.825 minus 1.21666
.\OT1/cmr/m/n/10.95 p
.\OT1/cmr/m/n/10.95 a
.\OT1/cmr/m/n/10.95 g
.\OT1/cmr/m/n/10.95 e
...
.\OT1/cmr/m/n/10.95 t
.\OT1/cmr/m/n/10.95 h
.\OT1/cmr/m/n/10.95 a
.\OT1/cmr/m/n/10.95 t
.\OT1/cmr/m/n/10.95 .
.\glue 4.86665 plus 5.47499 minus 0.40555
.\penalty 10000
.\glue(\parfillskip) 0.0
.\glue(\rightskip) 0.0 plus 1.0fil
\glue 0.0 plus 1.0fill
\glue 0.0
total height 26.72917 plus 1.0 plus 2.0fill
 goal height 595.80026
prevdepth 2.12917, prevgraf 1 line

! OK.

Horizontal centering

The \hbox with the text starts with:

\hbox(7.60416+2.12917)x418.25555, glue set - 0.1209
.\glue(\leftskip) 0.0 plus 1.0fil
.\hbox(0.0+0.0)x0.0
.\OT1/cmr/m/n/10.95 T

That means the left space is 0pt plus 1fil. \leftskip is set by \centering and the stretch componentplus 1.0fil is needed for centering.

The box ends with:

.\OT1/cmr/m/n/10.95 t
.\OT1/cmr/m/n/10.95 .
.\glue 4.86665 plus 5.47499 minus 0.40555
.\penalty 10000
.\glue(\parfillskip) 0.0
.\glue(\rightskip) 0.0 plus 1.0fil

Again the stretch component plus 1.0fil of \rightskip comes from \centering and is needed for centering. But there is a glue after the final dot:

.\glue 4.86665 plus 5.47499 minus 0.40555

That means there is extra white space at the end of the line. It comes from the space after the final dot before \vspace:

... that.
\vspace{\fill}

The paragraph has not yet ended, when \vspace is called. Therefore the space is not added directly, but via \vadjust. The following paragraph end usually removes the latest whitespace, thus that the latest line or white space before an emtpy line or \par does not need to be removed. However, the space before \vadjust is not seen by the paragraph end and appears in the output. This can be fixed by explicitely ending the paragraph:

... that.\par
\vspace{\fill}

Vertical centering

The bottom end looks fine:

\glue 0.0 plus 1.0fill
\glue 0.0

Just the fill component is present. But at the upper part we can find some additional contributions to the vertical space:

\glue(\topskip) 11.0
\rule(0.0+0.0)x*
\penalty 10000
\glue 0.0 plus 1.0fill
\glue 0.0
\glue(\parskip) 0.0 plus 1.0
\glue(\baselineskip) 5.99585

1. Full `\topskip` is inserted at the top of a page because of the following invisible rule, added by the star form `\vspace*`. Setting it to `0pt` locally fixes this.

2. When a new paragraph starts `\parskip` is added that might have larger values than shown here. Because we have just one paragraph here, setting it to zero is the easiest way.

3. The value for `\baselineskip` comes from the line breaking algorithm. The value is calculated from the setting of `\baselineskip` (`13.6pt`) minus the height of the line (`7.6pt`). This can be suppressed by `\nointerlineskip`.

New definition of \blankpage:

\newcommand*{\blankpage}{%
  \begingroup
    \setlength{\topskip}{0pt}%
    \setlength{\parskip}{0pt}%
    \vspace*{\fill}%
    \centering
    \nointerlineskip % suppresses partial \baselineskip above text
    This page would be intentionally left blank if we would not wish
    to inform about that.\par
    \vspace{\fill}%
  \endgroup
  % \showlists
}

Excerpt from the .log file with \showlists for new \blankpage:

### vertical mode entered at line 0
### current page:
\write-{}
\glue(\topskip) 0.0
\rule(0.0+0.0)x*
\penalty 10000
\glue 0.0 plus 1.0fill
\glue 0.0
\glue(\parskip) 0.0
\hbox(7.60416+2.12917)x418.25555, glue set 1.30571fil
.\glue(\leftskip) 0.0 plus 1.0fil
.\hbox(0.0+0.0)x0.0
.\OT1/cmr/m/n/10.95 T
.\OT1/cmr/m/n/10.95 h
.\OT1/cmr/m/n/10.95 i
.\OT1/cmr/m/n/10.95 s
.\glue 3.65 plus 1.825 minus 1.21666
.\OT1/cmr/m/n/10.95 p
.\OT1/cmr/m/n/10.95 a
.\OT1/cmr/m/n/10.95 g
.\OT1/cmr/m/n/10.95 e
...
.\OT1/cmr/m/n/10.95 t
.\OT1/cmr/m/n/10.95 h
.\OT1/cmr/m/n/10.95 a
.\OT1/cmr/m/n/10.95 t
.\OT1/cmr/m/n/10.95 .
.\penalty 10000
.\glue(\parfillskip) 0.0
.\glue(\rightskip) 0.0 plus 1.0fil
total height 7.60416 plus 1.0fill
 goal height 595.80026
### recent contributions:
\glue 0.0 plus 1.0fill
\glue 0.0
prevdepth 2.12917, prevgraf 1 line

! OK.

Support of twocolumn

With a small modification \blankpage will also work with twocolumn, when the text is put in the left column, but should be centered in the whole text area:

\newcommand*{\blankpage}{%
  \begingroup
    \setlength{\topskip}{0pt}%
    \vspace*{\fill}%
    \nointerlineskip % suppresses partial \baselineskip above text
    \hbox to \linewidth{%
      \hbox to \textwidth{%
        \hfill
        This page would be intentionally left blank if we would not wish
        to inform about that.%
        \hfill
      }%
      \hss
    }%
    \vspace{\fill}%
  \endgroup
  % \showlists
}
5

Loading package scrlayer you can define a layer page style blank

\usepackage{scrlayer}
\DeclareNewLayer[
    foreground,
    %textarea,% use only the textarea
    contents=\blankpage
  ]{blankpage.fg}
\DeclarePageStyleByLayers{blank}{blankpage.fg}

With

\KOMAoptions{cleardoublepage=blank}

this page style will be used on all blank pages. It works also if you use open=left or twocolumn.

\documentclass[
  %open=left,% <- works with open=left
  %twocolumn% <- works in twocolumn mode
]{scrbook}

\newcommand*{\blankpage}{%
  \par\vspace*{\fill}%
  {\centering This page would be intentionally left blank
   if we would not wish to inform about that.\par}
  \vspace{\fill}%
}

\usepackage{scrlayer}
\DeclareNewLayer[
    foreground,
    textarea,% use only the textarea
    contents=\blankpage
  ]{blankpage.fg}
\DeclarePageStyleByLayers{blank}{blankpage.fg}
\KOMAoptions{cleardoublepage=blank}

\usepackage{lipsum}% for dummy text

\begin{document}
\frontmatter
\tableofcontents
\mainmatter
\chapter{First chapter}
\lipsum[1-2]
\chapter{Second chapter}
\end{document}

Note that package scrlayer-scrpage already loads scrlayer. But if really necessary you can use scrlayer together with the outdated scrpage2 or withfancyhdr.


If you are using a standard class instead a KOMA-Script class you can load scrextend to do the same:

\documentclass[
  %twocolumn% <- works in twocolumn mode
]{book}

\usepackage{scrextend}

\newcommand*{\blankpage}{%
  \par\vspace*{\fill}%
  {\centering This page would be intentionally left blank
   if we would not wish to inform about that.\par}
  \vspace{\fill}%
}

\usepackage{scrlayer}
\DeclareNewLayer[
    foreground,
    textarea,% use only the textarea
    contents=\blankpage
  ]{blankpage.fg}
\DeclarePageStyleByLayers{blank}{blankpage.fg}
\KOMAoptions{cleardoublepage=blank}

\usepackage{lipsum}% for dummy text

\begin{document}
\frontmatter
\tableofcontents
\mainmatter
\chapter{First chapter}
\lipsum[1-2]
\chapter{Second chapter}
\end{document}

You must log in to answer this question.

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