mirror of
https://github.com/moderncv/moderncv.git
synced 2026-02-06 10:05:19 +01:00
fix orphaned section headers (needs testing). Closes #10.
This commit is contained in:
parent
aa49f4cc8f
commit
6a466c547d
7 changed files with 403 additions and 0 deletions
|
|
@ -67,8 +67,21 @@
|
|||
% regular lengths
|
||||
\setlength{\parskip}{0\p@}}
|
||||
|
||||
\@initializelength{\baseletterheight}
|
||||
\settoheight{\baseletterheight}{\sectionstyle{o}}
|
||||
\setlength{\baseletterheight}{\baseletterheight-0.95ex}
|
||||
% Set \cvstretchability to the height of E for Experience
|
||||
% \settoheight{\cvstretchability}{\sectionstyle{E}}
|
||||
\setlength{\cvstretchability}{\baseletterheight}%3\baselineskip
|
||||
% 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{}{40}
|
||||
% 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{\cvstretchability}% avoit orphaned sections
|
||||
\addvspace{2.5ex}%
|
||||
\phantomsection{}% reset the anchor for hyperrefs
|
||||
\addcontentsline{toc}{section}{#2}%
|
||||
|
|
@ -77,6 +90,7 @@
|
|||
|
||||
%\@initializeif{\if@aftersubsection}\@aftersubsectionfalse%
|
||||
\RenewDocumentCommand{\subsection}{sm}{%
|
||||
\@cvneedspace{\cvstretchability}% avoit 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%
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue