Принудительное удаление последней страницы

Принудительное удаление последней страницы

В конце моего документа есть пустая страница. Есть ли простой способ принудительно удалить ее? В идеале

\deletepage{2}

Я уже пробовал менять поля, но это портит макет friggeri-cv

редактировать:

документ.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

решение1

У меня была похожая проблема. Самым простым решением было сделать это вне TeX. Интегрируйте следующую команду в ваш Makefile/скрипт:

$ pdfseparate -l 1 document.pdf output.pdf

Я знаю, что это не чистое решение TeX, но этот вопрос без ответа уже довольно старый, и я надеюсь, что это кому-нибудь поможет.

решение2

У меня была ситуация, которая может совпадать с вашей: последняя страница заполнена, и TeX создает дополнительную пустую страницу. Очевидно (как упомянул @egreg), есть что-то невидимое, что TeX должен перенести на эту дополнительную страницу.

Мне помогло увеличение последней страницы с помощью \enlargethispage{\baselineskip}, как описано здесь:Сожмите еще несколько строк на текущей странице. Благодаря этому TeX смог разместить дополнительный невидимый материал на последней странице.

Очевидно, ответ приходит поздно, и это всего лишь обходной путь, но, возможно, он все равно кому-то поможет...

Связанный контент