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}
\RequirePackage{fullpage}
\RequirePackage{graphicx}
\RequirePackage{ragged2e}
\RequirePackage{mathptmx}
\RequirePackage{anyfontsize}
\RequirePackage{t1enc}
\RequirePackage{setspace}
\RequirePackage[utf8]{inputenc}
\graphicspath{ {figures/} }
\RequirePackage{array}
\RequirePackage{etoolbox} % for "\patchcmd" macro
\makeatletter
% 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
\makeatother
\begin{document}
\begin{titlepage}
\begin{center}
\vspace*{1cm}
\Huge
\textbf{Engineering + Engineering = Engineering}
\vspace{0.5cm}
\LARGE
Design of of something something something
\includegraphics[width=0.7\columnwidth]{university.jpg}
\centering
\textbf{John Smith}
\vfill
A thesis submitted to the School of Engineering\\
at the University of Hull for the degree of\\
MASTER OF ENGINEERING
\vspace{0.8cm}
\Large
School of Engineering\\
University of Hull\\
United Kingdom\\
October 2023
\end{center}
\end{titlepage}
\newpage
\frontmatter
\pagenumbering{Roman}
\centering
\topskip0pt
\vspace*{\fill}
\Huge
\normalsize
\par
\emph{“Some Sort of Inspirational Quote.” }
John Smith
\vspace*{\fill}
Best Answer
\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 (fromlatex.ltx
):So, here's your sequence of instructions:
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:You can remove the blank page using
atbegshi
's\AtBeginShipoutNext{\AtBeginShipoutDiscard}
:or just do whatever
\frontmatter
does manually. Here's\frontmatter
's definition frombook.cls
:Since you're changing the page numbering anyway, just use
(which avoids using a
\makeatletter
...\makeatother
pair).