Tweakable orphaned sections - revive old PR (#231)

* introduce different first and lastname styles.

* fix orphaned section headers (needs testing). Closes #10.

* introduce \cvsectionstretchability and \cvsubsectionstretchability

* set default stretchability to 0.9\baselineskip

* add fix orphaned section notice to changelog

---------

Co-authored-by: David <forenkram@gmx.de>
This commit is contained in:
daniel 2025-02-02 11:38:16 +01:00 committed by GitHub
commit 272289901e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 79 additions and 0 deletions

View file

@ -72,8 +72,18 @@
% regular lengths
\setlength{\parskip}{0\p@}}
% leave the stretchability zero by default
% \setlength{\cvsectionstretchability}{0.0pt}
% \setlength{\cvsubsectionstretchability}{0.0pt}
% must be between -100 and 9999. The higher the less likely a page break will occur.
% This is where the page break should occur, so this number should not bee too high
% \RenewDocumentCommand\withinstretchpenalty{}{0}
% must be between -100 and 9999. The higher the less likely a page break will occur.
% \RenewDocumentCommand\poststretchpenalty{}{9999}
\@initializeif{\if@aftersection}\@aftersectionfalse%
\RenewDocumentCommand{\section}{sm}{%
\@cvneedspace{\cvsectionstretchability}% avoid orphaned sections
\addvspace{2.5ex}%
\phantomsection{}% reset the anchor for hyperrefs
\addcontentsline{toc}{section}{#2}%
@ -83,6 +93,7 @@
%\@initializeif{\if@aftersubsection}\@aftersubsectionfalse%
\RenewDocumentCommand{\subsection}{sm}{%
\@cvneedspace{\cvsubsectionstretchability}% avoid orphaned sections
%\addvspace{1ex}%
\vspace*{-\arrayrulewidth}% HACK; I don't understand where the space is coming from, nor what it's exact value is :(
\if@aftersection%