From ee3af70cb9138790653f40f56054c53886e163f8 Mon Sep 17 00:00:00 2001 From: "Ryan A. Hagenson" Date: Tue, 6 Aug 2019 19:48:14 -0500 Subject: [PATCH] Prevent pagebreak at start of sections via needspace --- awesome-cv.cls | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/awesome-cv.cls b/awesome-cv.cls index 4805d69..0768f79 100644 --- a/awesome-cv.cls +++ b/awesome-cv.cls @@ -54,7 +54,7 @@ \RequirePackage{ragged2e} % Needed to configure page layout \RequirePackage{geometry} -% Needed to make header & footer effeciently +% Needed to make header & footer efficiently \RequirePackage{fancyhdr} % Needed to manage colors \RequirePackage{xcolor} @@ -88,7 +88,8 @@ pdfsubject={}, pdfkeywords={} } - +% Require additional space to be filled by content +\RequirePackage{needspace} %------------------------------------------------------------------------------- % Configuration for directory locations @@ -571,6 +572,7 @@ % Define a section for CV % Usage: \cvsection{} \newcommand{\cvsection}[1]{% + \needspace{5\baselineskip} \vspace{\acvSectionTopSkip} \sectionstyle{#1} \phantomsection @@ -580,6 +582,7 @@ % Define a subsection for CV % Usage: \cvsubsection{} \newcommand{\cvsubsection}[1]{% + \needspace{5\baselineskip} \vspace{\acvSectionContentTopSkip} \vspace{-3mm} \subsectionstyle{#1} @@ -742,3 +745,4 @@ \letterenclosurestyle{\@letterenclname: \@letterenclosure} \\ } } +