mirror of
https://github.com/moderncv/moderncv.git
synced 2026-02-06 10:05:19 +01:00
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:
parent
56d1b65d9e
commit
272289901e
6 changed files with 79 additions and 0 deletions
|
|
@ -74,7 +74,17 @@
|
|||
\@initializelength{\baseletterheight}
|
||||
\settoheight{\baseletterheight}{\sectionstyle{o}}
|
||||
\setlength{\baseletterheight}{\baseletterheight-0.95ex}
|
||||
|
||||
% 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}
|
||||
\RenewDocumentCommand{\section}{sm}{%
|
||||
\@cvneedspace{\cvsectionstretchability}% avoid orphaned sections
|
||||
\par\addvspace{2.5ex}%
|
||||
\phantomsection{}% reset the anchor for hyperrefs
|
||||
\addcontentsline{toc}{section}{#2}%
|
||||
|
|
@ -82,6 +92,7 @@
|
|||
\par\nobreak\addvspace{1ex}\@afterheading}% to avoid a pagebreak after the heading
|
||||
|
||||
\RenewDocumentCommand{\subsection}{sm}{%
|
||||
\@cvneedspace{\cvsubsectionstretchability}% avoid orphaned sections
|
||||
\par\addvspace{1ex}%
|
||||
\phantomsection{}% reset the anchor for hyperrefs
|
||||
\addcontentsline{toc}{subsection}{#2}%
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue