1

I have a standard report with a title page, but for some strange reason I am getting a blank page on page 1 every time. I have traced the code and I do not appear to be having any \clearpage commands. Can someone tell me what is causing this.

Minimum Working Example (test.tex):

\documentclass[paper=a4, fontsize=11pt]{report}
\usepackage[T1]{fontenc}                               % 8 bit encoding allows for more string types
\usepackage{array}                                     % For cell centering in tables
\usepackage{fourier}                                   % Superior font package
\usepackage{ulem}                                      % for strikethroughs
\usepackage[english]{babel}                            % English language/hyphenation (allows for smarter hyphenation)
\usepackage[protrusion=true,expansion=true]{microtype} % Better typography
\usepackage{amsmath,amsfonts,amsthm}                   % Math packages
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}
\usepackage{graphicx}                                  % for importing images. By default will load with pdflatex argument. Use PDF images whenver possible because, provided they are vector, they scale better.
\usepackage{caption}                                   % Caption images
\usepackage{subcaption}                                % Sub-caption Images
\usepackage{color,soul}                                % For text coloring and highlighting
\usepackage{url}                                       % For creating URLs
\usepackage{xstring}                                   % if conditionals in new commands
\usepackage{listings}                                  % Embed code
\usepackage{hyperref}                                  % For displaying different document links
%\usepackage{dirtree}                                   % Folder tree structure
%\usepackage[acronym]{glossaries}                      % Glossaries instead of newcommand. make sure to use [acronym] insteaad of [toc]
\usepackage[acronym]{glossaries-extra}                 % Glossaries instead of newcommand. make sure to use [acronym] insteaad of [toc]. Glossaries-extra to make use of supressing linking of glossaries but not acronyms
\usepackage{sectsty}                                   % Custom sectioning (sectsty package)
\usepackage{fancyhdr}                                  % Custom headers/footers (fancyhdr package)
\usepackage{placeins}                                  % Place Tables at exact location
\usepackage{lipsum}                                    % For lorum ipsum
\usepackage{enumitem}                                  % Reduce spacing in lists
\usepackage[table]{xcolor}                                    % Tooltip boxes
\usepackage{longtable}
\usepackage[tikz]{bclogo}
\usepackage[framemethod=tikz]{mdframed}
\usepackage[many]{tcolorbox}
\usepackage{multirow}                                  % Multi row data in tables
\usepackage[latin1]{inputenc}                          % used for tikz below
\usepackage{tikz}                                      % Used for flowcharts
\usepackage{float}
\usepackage{indentfirst}
\usepackage{fontawesome}                               %Using the \faIls symbol for virtual commodity
\usepackage{tabularx}
\usepackage{setspace} %for double spacing

\doublespacing

%\renewcommand*{\acronymtype}{acronym}

\numberwithin{equation}{section}                       % Equationnumbering: section.eq#
\numberwithin{figure}{section}                         % Figurenumbering: section.fig#
\numberwithin{table}{section}                          % Tablenumbering: section.tab#
\setlength{\parskip}{1em}                              % larger space between paragraphs
\newcommand{\horrule}[1]{\rule{\linewidth}{#1}}        % Maketitle metadata
\setlist{nolistsep}
\definecolor{bgblue}{RGB}{245,243,253}
\definecolor{ttblue}{RGB}{91,194,224}
\definecolor{blue}{rgb}{0,0,0.82}                      % for listings
\definecolor{dkgreen}{rgb}{0,0.6,0}                    % for listings
\definecolor{gray}{rgb}{0.5,0.5,0.5}                   % for listings
\definecolor{mauve}{rgb}{0.58,0,0.82}                  % for listings
\setcounter{secnumdepth}{5}                            % depth at which to stop numbering sections
\setcounter{tocdepth}{5}                               % depth at which to stop table of contents
\allsectionsfont{\normalfont\scshape}                  % Change font of al section commands
\hypersetup{
    colorlinks,
    citecolor=blue,
    filecolor=black,
    linkcolor=blue,
    urlcolor=blue,
    breaklinks=true
}
%linkcolor is for glossaries
\makeglossaries
\pagestyle{fancyplain}
                               % Right footer (used as page number)
\renewcommand{\headrulewidth}{0pt}                     % Remove header underlines
\renewcommand{\footrulewidth}{0pt}                     % Remove footer underlines
\setlength{\headheight}{13.6pt}
%\usetikzlibrary{shapes,arrows,trees}
\usetikzlibrary{calc,trees,positioning,arrows,chains,shapes.geometric,%
    decorations.pathreplacing,decorations.pathmorphing,shapes,%
        matrix,shapes.symbols}

\mdfdefinestyle{mystyle}{                              %
  rightline=true,
  innerleftmargin=10,
  innerrightmargin=10,
  outerlinewidth=3pt,
  topline=false,
  rightline=true,
  bottomline=false,
  skipabove=\topsep,
  skipbelow=\topsep
}

\newtcolorbox{myboxi}[1][]{
  breakable,
  title=#1,
  colback=white,
  colbacktitle=white,
  coltitle=black,
  fonttitle=\bfseries,
  bottomrule=0pt,
  toprule=0pt,
  leftrule=3pt,
  rightrule=3pt,
  titlerule=0pt,
  arc=0pt,
  outer arc=0pt,
  colframe=black,
}

\newtcolorbox{myboxii}[1][]{
  breakable,
  freelance,
  title=#1,
  colback=white,
  colbacktitle=white,
  coltitle=black,
  fonttitle=\bfseries,
  bottomrule=0pt,
  boxrule=0pt,
  colframe=white,
  overlay unbroken and first={
  \draw[red!75!black,line width=3pt]
    ([xshift=5pt]frame.north west) --
    (frame.north west) --
    (frame.south west);
  \draw[red!75!black,line width=3pt]
    ([xshift=-5pt]frame.north east) --
    (frame.north east) --
    (frame.south east);
  },
  overlay unbroken app={
  \draw[red!75!black,line width=3pt,line cap=rect]
    (frame.south west) --
    ([xshift=5pt]frame.south west);
  \draw[red!75!black,line width=3pt,line cap=rect]
    (frame.south east) --
    ([xshift=-5pt]frame.south east);
  },
  overlay middle and last={
  \draw[red!75!black,line width=3pt]
    (frame.north west) --
    (frame.south west);
  \draw[red!75!black,line width=3pt]
    (frame.north east) --
    (frame.south east);
  },
  overlay last app={
  \draw[red!75!black,line width=3pt,line cap=rect]
    (frame.south west) --
    ([xshift=5pt]frame.south west);
  \draw[red!75!black,line width=3pt,line cap=rect]
    (frame.south east) --
    ([xshift=-5pt]frame.south east);
  },
}

\lstset{frame=tb,
   language=php,
   aboveskip=3mm,
   belowskip=3mm,
   showstringspaces=false,
   columns=flexible,
   basicstyle={\small\ttfamily},
   numbers=none,
   numberstyle=\tiny\color{gray},
   keywordstyle=\color{blue},
   otherkeywords={var,class, @param, @pre, @post, @return, public, protected, private, bool},
   commentstyle=\color{dkgreen},
   morecomment=[l][\color{magenta}]{\#},
   stringstyle=\color{mauve},
   breaklines=true,
   breakatwhitespace=true,
   moredelim=**[is][\color{blue}]{@}{@},
   moredelim=**[is][\color{gray}]{`}{`},
   tabsize=3
}
\lstnewenvironment{code}[1][]%Don't break listings at end of page
  {\noindent\minipage{\linewidth}\medskip}
  {\endminipage}

   \newcommand{\renewglossaryentry}[1]{%
   \ifglsentryexists{#1}
   {\global\csundef{glo@#1@name}}
   {
      \newglossaryentry{#1}
   }
}

\setabbreviationstyle[acronym]{long-short}

% Glossaries
\glssetcategoryattribute{glossary}{nohyper}{false}
\glssetcategoryattribute{acronym}{nohyper}{false}

\newglossaryentry{sample-glossary-entry}
{
    name={Sample Glossary Entry},
        text={sample glossary entry},
        first={\textbf{Sample Glossary Entry}},
        plural={sample glossary entries},
        firstplural={\textbf{Sample Glossary Entries}},
        description={Sample glossary entry for the general glossary},
        category={glossary}
}

\fancyhead[L]{}
\fancyhead[C]{Internal Use Only}  
\fancyhead[R]{}                                             % Page Header
\fancyfoot[L]{}                                        % Left footer
\fancyfoot[C]{CONFIDENTIAL}                                        % Center footer
\fancyfoot[R]{\thepage} 

\title{
   %\vspace{-1in}   
   \usefont{OT1}{bch}{b}{n}
   \normalfont \normalsize \textsc{Title} \\ [25pt]
   \horrule{0.5pt} \\[0.4cm]
   \Huge Description\\
   \huge Details\\
   \LARGE {\color{red} More Details}\\
   \LARGE \today\\
   \horrule{2pt} \\[0.5cm]
}
\author{
   \normalfont                              \normalsize
   John Smith\\[-3pt]       \normalsize
   James Bond\\[-3pt]       \normalsize
   Jean Luc Picard\\[-3pt]      \normalsize
   \vspace*{20mm}
   \date{\today}
}

%%% Begin document
\begin{document}

\pagenumbering{gobble}
\maketitle
\clearpage

\printglossary
\clearpage
\tableofcontents
\clearpage

\pagenumbering{arabic}

\chapter{Some Chpater}
bla bla bla
\section{Some Section}
This is the \gls{sample-glossary-entry}.

\end{document}

I am compiling like so:

pdflatex test
pdflatex test
makeglossaries test
pdflatex test
4
  • Putting this solution in your preamble gets rid of the page: tex.stackexchange.com/a/140329/121944
    – AML
    May 31, 2018 at 14:40
  • 2
    The \vspace*{20mm} in your author information is causing the problem.
    – AML
    May 31, 2018 at 14:47
  • 2
    Unrelated to the problem, but please mind the loading order when using hyperref. Despite some exceptions, this package should be loaded last.
    – leandriis
    May 31, 2018 at 14:49
  • @AML if you put it as an answer I will accept. O.W. I can answer myself. Cheers
    – puk
    May 31, 2018 at 14:57

2 Answers 2

1

OPTION #1 (This one gives a cleaner result)

According to this solution from Werner, adding the following code to the preamble gets rid of the blank first page:

\usepackage{atbegshi}% http://ctan.org/pkg/atbegshi
\AtBeginDocument{\AtBeginShipoutNext{\AtBeginShipoutDiscard}}

OPTION #2

Alternatively, getting rid of \vspace*{20mm} in your author information eliminates the blank first page, though you'll need to find another way to correct for the spacing.

1

You could also make use of the titlepage environment as shown in the following example:

\documentclass[paper=a4, fontsize=11pt]{report} 
\usepackage[T1]{fontenc}
\usepackage{fourier}
\usepackage{setspace}
\doublespacing
\usepackage{showframe}

\newcommand{\horrule}[1]{\rule{\linewidth}{#1}}

\begin{document}
\begin{titlepage}
\centering  
   \usefont{OT1}{bch}{b}{n}
   \normalfont \normalsize \textsc{Title} \\ [25pt]
   \horrule{0.5pt} \\[0.4cm]
   \Huge Description

   \huge Details

   \LARGE { More Details}

   \LARGE \today\\
   \horrule{2pt} \\[0.5cm]

   \normalfont\normalsize
   John Smith\\[-3pt] 
   James Bond\\[-3pt]
   Jean Luc Picard\\[-3pt]

  \vspace*{20mm}
  \today
\end{titlepage}
\end{document}

You must log in to answer this question.

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