1

My document has a blank page at the end, Is there an easy way to forcibly delete it? ideally

\deletepage{2}

I have already tried altering the margins, but it screws with friggeri-cv layout

edit:

document.tex:

\documentclass[]{friggeri-cv}
\begin{document}

\header{xxxxx}{xxxxxxx}{}
\patchcmd{\aside}
  {\begin{textblock}{3.6}(1.5, 4.33)}
  {\begin{textblock}{5.3}(0, 4.33)}
  {}{}
\begin{aside}
\section{XXXX}
xxxxxxxxxxxxx
\end{aside}
\section{xxxxxxxxx}

\begin{entrylist}

\entry{xxxx}{xxxx {\normalfont xxxxxxxxxxx xxxxxxxx xxxxxxxx xxxx xxxxx}}{xxxxxxxxxx xx xxx xxxxxx}
    {xxxx xxx xxxxxx xxxxxxxxx xxxx xxxxxxxxxxxxxxxxxx}
\entry{xxxx}{xxxx {\normalfont xxxxxxxxxxxxx xxxxxxxx xxxxxxxxxxx}}{xxxxxxxxxx xx xxxxxxxx}
    {xxx xxxxxxxxxxxxxx xx xxxxxxxxxxx xxxxxxx xxxxx xxxx, xxxxxxxxx xxxxxxxx xxxx, xxxx xxxxxxxxx xxx xxxxxxxxx xxxxxxxxxxxx}
\entry{xxxx}{xxxx {\normalfont xxx xxxxxxxxxxxxxxxx xxxxxxxxx}}{xxxxxxxxxx xx xxxxxxxxxx}
    {xxxxxxxxxxxx xxxx xxxxx xx x xxx xxxxxxx xxxxxxxxxxx xxxxxx xxxxxxxx xx xxxxx xxxxxxxx xxx xxxxxxxxxx xxxxxxxx xxxxxx xx xxxxx xxxxxxx x xxxxxxxx xxxx xx xxxxx x xxxxxx xxxxxxxx xx xxxxx xxx xxxxxx xxxxxxx xxxxxx xx xxx xxxx xxxxx.}
\entry{xxxx}{xxxx {\normalfont xxxxxxxxx xxxxxxxxxxxxx xxxx xxxxxx xxxxxxxx xxxxxx}}{xxxx xxxxx xxxxxxxxxx}
    {xxxxxxxx xx xxxxxxxxx xxxx x xxxxxx xxx xxxxx xxxxxxxxx xxx xxxxxxxxxxxxxx xx xxxxxxx xxxxxxxxx xxxxxxxxxxxx xxxxxx xxxxxxxx xxx xxxxxxxxx  xxxxxxxxx xxxxxxxxxx x}

\entry{xxxx}{xxxx {\normalfont xx xxxxxxxxxxxx xx xxxxxxxxxx xxxxxxxx}}{xxxxx xxxxxxxxx xxxxx}
    {xxxxxxxx xxxxx xx xxxxxxxxx xxx xxx xxxxxx xxxx xxxxxx xxx}

\entry{xxxx}{xxxx {\normalfont xxxxxxxx xx x xxxxxxx xxxx}}{xxxxxxxx xxxxxxxxxx}
    {xxxxxxxx xx x xxxxxxxx x xxxx xx xxxxxxxxxxxxxxx xxxxxxxx xxxxxxxxx xxx xxxxxxxxxxx}

\entry{xxxx-xxxx}{xxxxxxxx 
{\normalfont xx xxxxxxxxxxxxx xxxxxxxxxxx}}
{xxx xxxxxxxxxx xx xxxxxxxx}
{\nolinebreak
xxxxxxx:
\begin{itemize}
\item {xxxxx xxxx xxxxxxx: xxxxxxxxx xxxxxxxxxx xx xxxxx xx xxxxx}
\item {xxxxxxxxxx xxx xxxxxxxxxxx xxxxxxx}
\item {xx xxx xxxxx}
\item {xxxxxxxxx xxxxxxxxx xx xxxxxxxx xxxxxxxxxxxx xxxxxxxxx}
\item {xxxxxxx xxxxxxxxxxxx xxxxxxxxx}
\end{itemize} 
}

\end{entrylist}
\section{xxxxxxxxxx}
\subsection{xxxx xxxx xxxx}
\begin{entrylist}
\entry
{xxxx-xxxxxxx}
{xxxxx xxx}
{xxxxx, xx}
{xxxx xx xxxxx xxxxxxxxx / xx xxxxxxx\\
xxxxxxxxxxx xxx xxx xxxxxxxx xx x xxx xxxxxx xxxxx xxxx xx xxxxx xxxxxxxxx, xxxx xxxxxxxx: xxxxxxx xxxx, xxxxxxx xxx xxxxxxxxx xxx xxxx xxxx xxxxxxxxx x xxxx-xxxx xxxxxxxxx xxxxx xxxx xxxxxx xxx xxxxxxx xx xxxxxxx xx xxxxxxxxxxxxx xx xxxxxxxxxx. xxxxxxxxxxx xxx xxxxxxxxx x xxxxxxxx xxxxx xxxx xxx xxxxx xxxx x xxxxxxxx xxxxxxxxxxx xxxxxx, xxxx xxxxxxxxx xxxxx xxxxx xxxxxxx xxxx xx x xxxxx xxxxxxxxxx xxx xx xxxxxxxxx xxxxxx xx xxxxxxxxxxxxx xxxxxx xxxx xxx xxxxxxxx xxx xxxxxxxxxx}
\end{entrylist}
\subsection
{xxxx xxxxxx xxxxxxxx}
\begin{entrylist}
\entry
{}
{xxxxxx}
{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}
{xxxx xxxxxx xxxxx xx xxx xxxxx (xxxx xxxxxxxxxx xxxxxxx  xxxxxxx xxx xxxx xxxx xxx xxxx xxxxxxx xxx xxxxxxxx xxx xxx xxx xxxxx x xx xxxxxxxxxxx) xxxxxxx xx x x xxx xxxxxxxxxxx xxx xxx xxxx xxxxx xxxx xx xxxxxxx xxxxxxxx xxxx xxxxx xxxxxxx xxxxxxxxxxx xxxxx, xxxx xxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxx}
\end{entrylist}
\end{document}

friggeri-cv.cls:

\ProvidesClass{friggeri-cv}[2012/04/30 CV class]
\NeedsTeXFormat{LaTeX2e}

\DeclareOption{print}{\def\@cv@print{}}
\DeclareOption*{%
  \PassOptionsToClass{\CurrentOption}{article}%
}
\ProcessOptions\relax
\LoadClass{article}

\RequirePackage{xcolor}

\definecolor{white}{RGB}{255,255,255}

\definecolor{darkgray}{HTML}{333333}
\definecolor{gray}{HTML}{4D4D4D}
\definecolor{lightgray}{HTML}{999999}

\definecolor{green}{HTML}{C2E15F}
\definecolor{orange}{HTML}{FDA333}
\definecolor{purple}{HTML}{D3A4F9}
\definecolor{red}{HTML}{FB4485}
\definecolor{blue}{HTML}{6CE0F1}

\ifdefined\@cv@print
  \colorlet{green}{gray}
  \colorlet{orange}{gray}
  \colorlet{purple}{gray}
  \colorlet{brown}{gray}
  \colorlet{red}{gray}
  \colorlet{blue}{gray}
  \colorlet{fillheader}{white}
  \colorlet{header}{gray}
\else
  \colorlet{fillheader}{gray}
  \colorlet{header}{white}
\fi
\colorlet{textcolor}{gray}
\colorlet{headercolor}{gray}

\RequirePackage[quiet]{fontspec}
\RequirePackage[math-style=TeX,vargreek-shape=unicode]{unicode-math}

\newfontfamily\bodyfont[]{Helvetica Neue}
\newfontfamily\thinfont[]{HelveticaNeue-UltraLight}
\newfontfamily\headingfont[]{Helvetica Neue Condensed Bold}

\defaultfontfeatures{Mapping=tex-text}
\setmainfont[Mapping=tex-text, Color=textcolor]{Helvetica Neue Light}

%\setmathfont{XITS Math}

\RequirePackage{tikz}

\newcommand{\rolefont}{%
  \fontsize{14pt}{24pt}\selectfont%
  \thinfont%
  \color{white}%
}

\newcommand{\header}[3]{%
  \begin{tikzpicture}[remember picture,overlay]
 %   \node [rectangle, fill=fillheader, anchor=north, minimum width=\paperwidth, minimum height=4cm] (box) at (current page.north){};
     \node [rectangle, fill=fillheader, anchor=north, minimum width=\paperwidth, minimum height=2.5cm] (box) at (current page.north){};
    \node [anchor=center] (name) at (box) {%
      \fontsize{40pt}{72pt}\color{header}%
      {\thinfont #1}{\bodyfont  #2}
    };
    \node [anchor=north] at (name.south) {%
      \fontsize{14pt}{24pt}\color{header}%
      \thinfont #3%
    };
  \end{tikzpicture}
%  \vspace{2.5cm}
  \vspace{1cm}
  \vspace{-2\parskip}
}

\RequirePackage{parskip}

\newcounter{colorCounter}
\def\@sectioncolor#1#2#3{%
  {%
    \color{%
      \ifcase\value{colorCounter}%
        blue\or%
        red\or%
        orange\or%
        green\or%
        purple\or%
        brown\else%
        headercolor\fi%
    } #1#2#3%
  }%
  \stepcounter{colorCounter}%
}

\renewcommand{\section}[1]{
  \par\vspace{\parskip}
  {%
    \LARGE\headingfont\color{headercolor}%
    \@sectioncolor #1%
  }
  \par\vspace{\parskip}
}

\renewcommand{\subsection}[1]{
  \par\vspace{.5\parskip}%
  {\Large\headingfont\color{headercolor} #1}
  \par\vspace{.25\parskip}%
}

\renewcommand{\subsubsection}[2]{
  \par\vspace{.5\parskip}%
  {\Large\headingfont\color{headercolor} #2}
  \par\vspace{.25\parskip}%
}

\pagestyle{empty}

\setlength{\tabcolsep}{0pt}
\newenvironment{entrylist}{%
  \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}ll}
}{%
  \end{tabular*}
}
\renewcommand{\bfseries}{\headingfont\color{headercolor}}
\newcommand{\entry}[4]{%
  #1&\parbox[t]{11.8cm}{%
    \textbf{#2}%
    \hfill%
    {\footnotesize\addfontfeature{Color=lightgray} #3}\\%
    #4\vspace{\parsep}%
  }\\}

\RequirePackage[absolute,overlay]{textpos}
\setlength{\TPHorizModule}{1cm}
\setlength{\TPVertModule}{1cm}
\newenvironment{aside}{%
  \let\oldsection\section
  \renewcommand{\section}[1]{
    \par\vspace{\baselineskip}{\Large\headingfont\color{headercolor} ##1}
  }
  \begin{textblock}{3.6}(1.5, 4.33)
  \begin{flushright}
  \obeycr
}{%
  \restorecr
  \end{flushright}
  \end{textblock}
  \let\section\oldsection
}

\RequirePackage[style=verbose, maxnames=99, sorting=ydnt]{biblatex}

\DeclareFieldFormat[article]{title}{#1\par}
\DeclareFieldFormat[book]{title}{#1\par}
\DeclareFieldFormat[inproceedings]{title}{#1\par}
\DeclareFieldFormat[misc]{title}{#1\par}
\DeclareFieldFormat[report]{title}{#1\par}

\DeclareBibliographyDriver{article}{%
  \printfield{title}%
  \newblock%
  \printnames{author}%
  \par%
  \newblock%
  {%
    \footnotesize\addfontfeature{Color=lightgray}\itshape%
    \usebibmacro{journal+issuetitle}%
    \setunit{\space}%
    \printfield{pages}%
    \newunit%
    \printlist{publisher}%
    \setunit*{\addcomma\space}%
    \printfield{year}%
    \newunit%
  }
  \par\vspace{0.3\baselineskip}
}

\DeclareBibliographyDriver{book}{%
  \printfield{title}%
  \newblock%
  \printnames{author}%
  \par%
  \newblock%
  {%
    \footnotesize\addfontfeature{Color=lightgray}\itshape%
    \printlist{publisher}%
    \setunit*{\addcomma\space}%
    \printfield{note}%
    \setunit*{\addcomma\space}%
    \printfield{year}%
    \setunit{\addcomma\space}%
    \printlist{location}%
    \newunit%
  }
  \par\vspace{0.3\baselineskip}
}


\DeclareBibliographyDriver{inproceedings}{%
  \printfield{title}%
  \newblock%
  \printnames{author}%
  \par%
  \newblock%
  {%
    \footnotesize\addfontfeature{Color=lightgray}%
    \printfield{booktitle}%
    \setunit{\addcomma\space}%
    \printfield{year}%
    \setunit{\addcomma\space}%
    \printlist{location}%
    \newunit%
  }
  \par\vspace{0.3\baselineskip}
}

\DeclareBibliographyDriver{misc}{%
  \printfield{title}%
  \newblock%
  \printnames{author}%
  \par%
  \newblock%
  {%
    \footnotesize\addfontfeature{Color=lightgray}\itshape%
    \printfield{booktitle}%
    \setunit*{\addcomma\space}%
    \printfield{note}%
    \setunit*{\addcomma\space}%
    \printfield{year}%
    \setunit{\addcomma\space}%
    \printlist{location}%
    \newunit%
  }
  \par\vspace{0.3\baselineskip}
}

\DeclareBibliographyDriver{report}{%
  \printfield{title}%
  \newblock%
  \printnames{author}%
  \par%
  \newblock%
  {%
    \footnotesize\addfontfeature{Color=lightgray}\itshape%
    \printfield{type}%
    \setunit{\space}%
    \printfield{number}%
    \setunit{\addcomma\space}%
    \printfield{year}%
    \newunit%
  }
  \par\vspace{0.3\baselineskip}
}

\DeclareNameFormat{author}{%
  \small\addfontfeature{Color=lightgray}%
  \ifblank{#3}{}{#3\space}#1%
  \ifthenelse{\value{listcount}<\value{liststop}}
    {\addcomma\space}
    {}%
}

\defbibheading{bibheading}[\bibname]{%
   \subsubsection*{#1}
   \markboth{#1}{#1}
}

\newcommand{\printbibsection}[2]{
  \begin{refsection}
    \nocite{*}
    \printbibliography[sorting=chronological, type={#1}, title={#2}, heading=bibheading]
  \end{refsection}
}

\DeclareSortingScheme{chronological}{
  \sort[direction=descending]{\field{year}}
  \sort[direction=descending]{\field{month}}
}

\RequirePackage[left=6.1cm,top=2cm,right=1.5cm,bottom=2.5cm,nohead,nofoot]{geometry}
\RequirePackage{hyperref}
\hypersetup{
    colorlinks=false,       
    linkcolor=red,          
    citecolor=red,        
    filecolor=red,      
    urlcolor = red}

% A fix for \href{}{} colors not working with fontspec
\makeatletter
\def\HyColor@@@@UseColor#1\@nil{\addfontfeatures{Color=#1}}
\makeatother
Mensch
  • 65,388
DSUK
  • 11
  • 8
    Probably better to eliminate whatever's causing it. Would it be possible to provide an MWE showing your set up and then we might be able to help you get rid of it – Au101 Feb 11 '16 at 23:22
  • 4
    Welcome to TeX.SX! A blank page at the end is not “blank”: it contains something invisible, otherwise TeX would not make it. Some more information is needed. – egreg Feb 11 '16 at 23:31
  • 3
    From memory, friggeri-cv has some pretty inflexible elements in it. I assume one of them is to blame. (One of the reasons I don't suggest using the class/template.) Post the code if you want help understanding what is going on. And of course pdftk, the swissarmy knite of PDF manipulation, can prune away arbitrary pages. – jon Feb 12 '16 at 03:28
  • Does that produce an extra blank page for you? If not, then please revise your example file. Note that I don't have the required fonts, and when I substitute the Helvetica Neue fonts for (say) SourceSansPro (as in this answer), I only get one page.... – jon Feb 12 '16 at 19:25
  • yep, It creates 2 pages when I use XeTeX 3.1415926-2.5-0.9999.3-2014012222 (TeX Live 2013/Debian) – DSUK Feb 12 '16 at 20:34
  • I mananged to test switching over the fonts, It does only span 1 page with SourceSansPro and 2 with Helvetica – DSUK Feb 12 '16 at 21:06
  • 2
    The example prints two pages, but the second one is not blank – egreg Feb 12 '16 at 21:34

2 Answers2

2

I had a similar problem. The easiest solution was to do it outside of TeX. Integrate the following command into your Makefile/script:

$ pdfseparate -l 1 document.pdf output.pdf

I know this is not a pure TeX solution, but this unanswered question is a bit old and I hope this helps someone.

yuri
  • 121
  • 4
1

I had a situation that may match yours: The last page is full, and TeX creates an extra empty page. Obviously (as @egreg has mentioned) there is something invisible that TeX has to carry over to that extra page.

What helped me was to enlarge the last page by using \enlargethispage{\baselineskip}, as explained here: Squeeze some more lines on the current page. With this, TeX was able to fit the extra invisible stuff into the last page.

Obviously, the answer comes late and this is only a workaround, but maybe it still helps someone...