强制删除最后一页

强制删除最后一页

我的文档末尾有一个空白页,有没有简单的方法可以强制删除它?理想情况下

\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 就能将多余的不可见内容放入最后一页。

显然,答案来得晚了,这只是一种解决方法,但也许它仍然可以对某些人有所帮助......

相关内容