I'm trying to use LaTeX to create a document but a random page is created after the front page and I'm not sure of the best way to remove it. As you can see in the document class I've added openany which should make the document one-sided and yet this page is still being randomly added. I've added the code below and an image of what's produced. Any help would be very much appreciated.

\documentclass[a4paper, 12pt, openany]{book}
\graphicspath{ {figures/} }

\RequirePackage{etoolbox} % for "\patchcmd" macro
% No extra space between chapter number and chapter header lines:
\patchcmd{\@makechapterhead} {\vskip 20}{\vskip 0} {}{}
% Reduce extra space between chapter header and section header lines by 50%:
\patchcmd{\@makechapterhead} {\vskip 40}{\vskip 20}{}{}
\patchcmd{\@makeschapterhead}{\vskip 40}{\vskip 20}{}{} % for unnumbered chapters

            \textbf{Engineering + Engineering = Engineering}
            Design of of something something something
            \textbf{John Smith}
            A thesis submitted to the School of Engineering\\ 
            at the University of Hull for the degree of\\ 
            School of  Engineering\\
            University of Hull\\
            United Kingdom\\
            October 2023
    \emph{“Some Sort of Inspirational Quote.” }
    John Smith

enter image description here

1 Answer 1


\frontmatter is the cause behind this as it inserts a \cleardoublepage. While \newpage and \clearpage are gobbled if used successively, \cleardoublepage does more than just clear a page or possibly more. In order to succeed in possibly clearing a blank page as well, it inserts an \hbox{} on a page (which prints nothing) and then issues another \newpage, otherwise it may be gobbled. Here's the actual definition (from latex.ltx):

\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else

So, here's your sequence of instructions:

  % <title stuff>



The titlepage is constructed on page 1. Then you insert a \newpage, putting you on page 2. Issuing \frontmatter on page 2, leaves \cleardoublepage to call:

\clearpage % ...this is gobbled, since the it follows from a \newpage
\if@twoside % ...this is true within book
  \ifodd\c@page % ...this is false, so
  \else %         ...follow this branch
    \hbox{}%      ...insert something that doesn't print anything
    \newpage%     ...issue a (legal) \newpage
    \if@twocolumn%...this is false...

You can remove the blank page using atbegshi's \AtBeginShipoutNext{\AtBeginShipoutDiscard}:


  % <title stuff>


\AtBeginShipoutNext{\AtBeginShipoutDiscard}% Discard next blank page


or just do whatever \frontmatter does manually. Here's \frontmatter's definition from book.cls:


Since you're changing the page numbering anyway, just use

  % <title stuff>


\csname @mainmatterfalse\endcsname

(which avoids using a \makeatletter...\makeatother pair).

You must log in to answer this question.

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