0

I am trying to remove the blank pages between the various sections of the document, but I don't know which command I can use. I already tried to remove the command: \afterpage{\blankpage} but the blank pages still appear. How can I do this?

\documentclass[11pt]{book}
% Omitting Page Numbers
\pagenumbering{gobble} 

% Packages
\usepackage[a4paper,left=2.5cm,right=2.5cm,top=4cm,bottom=4.9cm]{geometry}
\renewcommand{\baselinestretch}{1.15}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{fontspec}
\usepackage{natbib}
\setcitestyle{square}
\usepackage{afterpage}  % blank pages
\usepackage{multirow}  % table
\usepackage[table, dvipsnames]{xcolor}  % table
\usepackage{xpatch}  % table
\usepackage{tabu}  % table
\usepackage{hhline}  % cell color does not overlap cell line
\usepackage{fancyhdr}  % headers
\usepackage{breakcites}  % references do not go though margins
\usepackage{sectsty}  % change chapter title size
\setcounter{tocdepth}{3}  % four level contents
\setcounter{secnumdepth}{3}  % numbered four level contents
\usepackage{amsfonts}  % math
\usepackage{amsmath}  % math
\usepackage[nottoc,notlof,notlot]{tocbibind}
\usepackage[pagebackref]{hyperref}  % references

\newcommand{\rectangle}{{  % rectangle
  \ooalign{$\sqsubset\mkern3mu$\cr$\mkern3mu\sqsupset$\cr}
}}

\newcommand\BibTeX{B{\sc ib}\TeX}

% References
\hypersetup{
   colorlinks=true,
   linkcolor=MidnightBlue,
   filecolor=MidnightBlue,
   citecolor=BrickRed,
   urlcolor=MidnightBlue,
   bookmarksopen=true,
   linktocpage=true,
   pdfpagemode=UseOutlines,
   pdfstartpage=1
}

% Blank Page
\newcommand\blankpage{
    \null
    \thispagestyle{empty}
    \addtocounter{page}{-1}
    \newpage}

% Hide Blank Pages Numbers + Headers
\let\origdoublepage\cleardoublepage
\newcommand{\clearemptydoublepage}{%
  \clearpage
  {\pagestyle{empty}\origdoublepage}%
}

% Space between numbers and text
\geometry{footskip=2.45cm}

\begin{document}

\begingroup

\newgeometry{left=3cm, right=3cm, top=1cm, bottom=1.2cm}
\renewcommand{\baselinestretch}{1.9}

%\include{parts/capa_provisoria}
\include{parts/capa_definitiva}

\afterpage{\blankpage}

\endgroup

% Preamble for Thesis
\setmainfont{Times New Roman}
\newgeometry{left=2.5cm,right=2.5cm,top=2.5cm,bottom=4.9cm}
\renewcommand{\baselinestretch}{1.15}
\pagenumbering{Roman}
\pagestyle{plain}
\let\cleardoublepage\clearemptydoublepage  % hide blank pages numbers + headers

\include{parts/acknowledgements}

\include{parts/abstract}

\include{parts/resumo}

%\include{parts/resumo_alargado}

\include{parts/contents}

\include{parts/list_of_figures}

\include{parts/list_of_tables}

\afterpage{\blankpage}

% After Introductory Pages
\pagenumbering{arabic}
\pagestyle{fancy}
\newgeometry{left=2.5cm,right=2.5cm,top=4cm,bottom=4.9cm,headsep=1cm}
\setlength{\headheight}{14pt} 

\chaptertitlefont{\Huge} % to fit chapter title to one line
\chapternumberfont{\Huge} 

\include{parts/introduction}

\include{parts/related_work}

\include{parts/a_silver_standard_corpus_of_phenotype_gene_relations}

\include{parts/extracting_phenotype-gene_relations}

\include{parts/conclusion}

\pagestyle{plain}  % no more header 

\include{parts/references}

\end{document}

  • Where exactly do you get blank pages? Are they inserted so that each new chapter starts on a odd numbered page? – leandriis May 07 '20 at 14:54
  • 1
    Try adding openany to the \documentclass options. The default is openright. – Bernard May 07 '20 at 14:57
  • @leandriis Behind the cover, the table of contents, the acknowledgements and each chapter there is a blank page that I want to be removed. – Carmen González May 07 '20 at 15:08
  • @Bernard thanks for your suggestion. openany does not remove the blank page behind the list of tables. How can I also remove this blank page? – Carmen González May 07 '20 at 15:11
  • Could you post a minimal, yet complete, example code having this problem? It doesn't remove the blank page after ordinary chapters? – Bernard May 07 '20 at 15:18
  • 6
    One way to remove ALL the blank pages is to use the [oneside] option for book. Another is use \let\cleardoublepage=\clearpage. \blankpage is just a bad idea. – John Kormylo May 07 '20 at 15:18
  • 2
    \blankpage forces a blank page – David Carlisle May 07 '20 at 15:36
  • 5
    if you are setting the thesis on two sides of the paper like a book then iit will be very strange if you do not ensure that you always have odd page numbers on the right and even on the left, your \blankpage breaks that. It is also most common (but not universal) for chapters to always start on the right hand page hence the blank page, but if you want to allow chapters on the left there is no need for all your redefinitions just use [openamy] or if you do not want to distinguish left and right ages at all, use [oneside] – David Carlisle May 08 '20 at 01:29
  • 1
    @CarmenGonzález David has explained it. Do not leave the chapter titles "hidden" in the left-hand side ("verso" page). Think that when you open a book, the first thing you see is the right-hand side ("recto" page). Is it mandatory? In general, no, but in particular, there are universities that consider this a [basic design] (https://libguides.lib.msu.edu/c.php?g=97090&p=908734), others don't give a damn, and some even ask to avoid blank pages. First, look at the rules of your University. If there's nothing about, ask yourself: Will the thesis court read it printed or in the PDF? – Fran May 08 '20 at 09:52
  • @DavidCarlisle Thanks for the advice. Do the blank pages on the back of the sheet or left-hand side have no number at the bottom, but count towards the right number of pages? Or do I have to put a number on the blank pages? – Carmen González May 08 '20 at 17:43
  • @Fran Thanks for the advice. Do the blank pages on the back of the sheet or left-hand side have no number at the bottom, but count towards the right number of pages? Or do I have to put a number on the blank pages? – Carmen González May 08 '20 at 17:43
  • 1
    they often don't have a printed number but count to the numbering, look at printed books, open it at any page and the right hand page will have an odd number – David Carlisle May 08 '20 at 17:51
  • 1
    See here about the format of blank pages. – Fran May 08 '20 at 17:56
  • Thank you all! I will follow your advice and leave the pages blank, but now I understand better why they exist. I understood better the commands needed to place and remove the blank pages in case I need them in the future and, certainly, your comments will not only be useful for me, but for everyone who is doing work or master's/doctoral theses. – Carmen González May 08 '20 at 18:35

1 Answers1

1

Just simply add: \let\cleardoublepage=\clearpage to get rid of any blankpages anywhere after packages