2

There are tons of questions about removing blank pages from twoside documents, e.g. theses. However, there are a lot fewer about adding blank pages (or pages with a header only) that aren't simply solved by using twoside.

I'd like to add (numbered) pages at certain spots in a oneside document with class book - essentially, to emulate the same page numbering from twoside but without the change in margins which makes viewing such a document on a device a pain. (I would like to physically print the twoside version and want both versions to have the same numbering. I don't mind extra pages.) It seems that cleardoublepage is not what I want since according to any documentation I can find, it only adds the extra page in twoside mode. I'm okay with this not being automatic - I only have to add them at the end of chapters, after all. Does anyone know if this is possible without extreme hacking of things like the geometry package?

Possibly related questions that didn't seem to answer my question:

Ironically, apparently this bug in one package is sort of exactly what I am looking for ... but I don't use that package and don't want to rely on a bug!

Final note, just in case it would make a difference: I am using xelatex and cannot easily switch to pdflatex.

5
  • 1
    As a start, try redefining \cleardoublepage ignore any consideration of whether or not you're in twoside mode: \makeatletter \def\cleardoublepage{\clearpage \ifodd\c@page\else\hbox{}\newpage\if@twocolumn\hbox{}\newpage\fi\fi}\makeatother. The definition of \cleardoublepage was taken from latex.ltx.
    – Werner
    Commented Jan 14, 2021 at 22:47
  • If you know exactly where the page breaks before you want a blank page (with header), you can insert this: <blank line>\clearpage \mbox{ } \clearpage. If you want the blank page inserted after the current page is complete, it's not quite so simple, and I'd have to experument. Commented Jan 14, 2021 at 22:49
  • 2
    What \documentclass are you using?
    – Werner
    Commented Jan 14, 2021 at 23:02
  • @Werner I think I mentioned it was book. I figure that might make a difference?
    – kcrisman
    Commented Jan 15, 2021 at 13:01
  • @barbarabeeton that sounds like something I could try. Basically, I have discrete chapters that in twoside always start on the right page (appropriately) but I'd like the numbering in oneside to be the same, so I think I can just try adding your suggestion after each one - or the one in the answer. Thank you.
    – kcrisman
    Commented Jan 15, 2021 at 13:03

3 Answers 3

1

The following minimal example updates the default \cleardoublepage (only when not in twoside mode) to completely ignore the twoside option as part of its conditioning mechanism.

%\documentclass[twoside]{book}
\documentclass{book}

\usepackage{lipsum}

\makeatletter
% Update \cleardoublepage to be similar in oneside and twoside
\if@twoside\else
  \def\cleardoublepage{%
    \clearpage
    \ifodd\c@page\else
      \hbox{}\newpage
      \if@twocolumn
        \hbox{}\newpage
      \fi
    \fi
  }
\fi
\makeatother

\begin{document}
    
\tableofcontents

\sloppy
\chapter{First chapter}
\lipsum[1-45]

\chapter{Second chapter}
\lipsum[1-50]

\chapter{Third chapter}
\lipsum[1-50]

\end{document}

You could also try this (re)definition of \cleardoublepage:

\let\oldcleardoublepage\cleardoublepage
\renewcommand{\cleardoublepage}{{%
  \@twosidetrue% Force twoside mode temporarily
  \oldcleardoublepage
}}
1
  • This is going to be by far the easiest to implement - I have a place to add macros for exactly this kind of thing, and the results were perfect with extremely minimal editing. Thank you!
    – kcrisman
    Commented Jan 15, 2021 at 19:21
3

\newpage\null will produce a blank page.

For example this code will produce a book twoside with, as expected, chapters starting in odd pages:

\documentclass[12pt,a4paper,twoside]{book}

\usepackage{kantlipsum} %dummy text

\begin{document}
    
\tableofcontents
    
\chapter{One}
1. \kant[1-3]

\chapter{Two}
5. \kant[5-9]   

\chapter{Three}
11. \kant[11-15]        
    
\end{document}

Adding blank pages in the appropriate places, this will produced the same TOC with oneside

\documentclass[12pt,a4paper,oneside]{book}

\usepackage{kantlipsum} %dummy text

\begin{document}
    
\tableofcontents

\newpage\null % add a blank page
\chapter{One}
1. \kant[1-3]

\chapter{Two}
5. \kant[5-9]   

\newpage\null   % add another blank page
\chapter{Three}
11. \kant[11-15]        
    
\end{document}

Two side, chapter in odd pages, book margins

2d

On side, some chapters in even pages, e.g. the first chapter starts immediately after the TOC, on page 2.

1s

One side with 2 added pages. Now all chapters start on even pages, with equal margins.

1s af

It might be useful to add \newpage\null\thispagestyle{plain}, when creating a blank page, or \newpage\null\thispagestyle{empty} to suppress all the headers.

Notes

(1) With twoside it is easy to have the same margin on odd and even pages with \setlength{\evensidemargin}{\oddsidemargin} before \begin{document}

(2) Still, it is sometimes necessary to create blank pages in a book using \newpage\null\thispagestyle{empty}

(3) \null is the same as \hbox{}.

1
  • Thanks, I'll have to try that later. This is a model explanation - the MWE is just long enough to be interesting, and the images make it very clear what to expect. If I was very snazzy I might even have to put "this page intentionally left blank" but probably I'll just see which page style the twoside has. (The LaTeX is auto-generated by another program, so I am having to hand-edit it for things like this.)
    – kcrisman
    Commented Jan 15, 2021 at 13:07
0

You don't want to manually add blank pages, but rather to have the same margins on either side, which can be easily obtained with geometry.

With the same code as in Simon's answer,

\documentclass[12pt,a4paper,twoside]{book}
\usepackage[hratio=1:1,textwidth=345pt]{geometry}

\usepackage{kantlipsum} %dummy text

\begin{document}

\tableofcontents

\chapter{One}
1. \kant[1-3]

\chapter{Two}
5. \kant[5-9]

\chapter{Three}
11. \kant[11-15]

\end{document}

you will see the blank page automatically generated. The magic dimension 345pt is the usual size in the book class. Change it to suit your taste.

enter image description here

If you want some gutter, you can do as follows:

\documentclass[12pt,a4paper,twoside]{book}
\usepackage{layout}

\usepackage{geometry}

\dimen0=\dimexpr(\paperwidth-345pt)/2\relax
\geometry{
  bindingoffset=7mm,
  inner=\dimexpr\dimen0-7mm\relax,
  textwidth=345pt,
}

\usepackage{kantlipsum} %dummy text

\begin{document}

\layout

\tableofcontents

\chapter{One}
1. \kant[1-3]

\chapter{Two}
5. \kant[5-9]

\chapter{Three}
11. \kant[11-15]

\end{document}

I added \layout to better show what's happening. Fix the lengths to suit your needs.

4
  • Actually, I really do want the "two-sided" margins for the two-sided version, so that when it prints and is bound there is enough gutter for that. Otherwise I'd just print out the one-sided version as I have in the past.
    – kcrisman
    Commented Jan 15, 2021 at 16:11
  • @kcrisman You can use the bindingoffset option.
    – egreg
    Commented Jan 15, 2021 at 16:43
  • Would using that simply replicate the twoside option?
    – kcrisman
    Commented Jan 15, 2021 at 16:45
  • @kcrisman I added how to do it.
    – egreg
    Commented Jan 15, 2021 at 17:51

You must log in to answer this question.

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