mirror of
https://github.com/moderncv/moderncv.git
synced 2026-02-06 10:05:19 +01:00
new approach with minipage: eliminate wrong vspace fancy sections
This commit is contained in:
parent
d88a8cf436
commit
3a0fa92f01
2 changed files with 7 additions and 17 deletions
|
|
@ -1,3 +1,6 @@
|
||||||
|
version 2.?.? (29 Jun 2023)
|
||||||
|
- Fix wrong cvlistitem vspace caused by multiline section titles in fancy style (#69)
|
||||||
|
|
||||||
version 2.3.1 (2022-02-21)
|
version 2.3.1 (2022-02-21)
|
||||||
- Fix duplicate GitLab icon (#105)
|
- Fix duplicate GitLab icon (#105)
|
||||||
- Revert using detokenize in social links (#97)
|
- Revert using detokenize in social links (#97)
|
||||||
|
|
|
||||||
|
|
@ -44,8 +44,6 @@
|
||||||
\@initializelength{\separatorcolumnwidth} \setlength{\separatorcolumnwidth}{0.025\textwidth}
|
\@initializelength{\separatorcolumnwidth} \setlength{\separatorcolumnwidth}{0.025\textwidth}
|
||||||
\@initializelength{\separatorrulewidth} \setlength{\separatorrulewidth}{1.2\p@}%
|
\@initializelength{\separatorrulewidth} \setlength{\separatorrulewidth}{1.2\p@}%
|
||||||
\@initializelength{\maincolumnwidth}
|
\@initializelength{\maincolumnwidth}
|
||||||
\@initializelength{\multilinecompensationlength}
|
|
||||||
\@initializelength{\thissectionwidth}
|
|
||||||
% used by \cvdoubleitem
|
% used by \cvdoubleitem
|
||||||
\@initializelength{\doubleitemcolumnwidth}
|
\@initializelength{\doubleitemcolumnwidth}
|
||||||
% used by \cvlistitem
|
% used by \cvlistitem
|
||||||
|
|
@ -56,9 +54,6 @@
|
||||||
\@initializelength{\listdoubleitemcolumnwidth}
|
\@initializelength{\listdoubleitemcolumnwidth}
|
||||||
%\@initializelength{\listdoubleitemmaincolumnwidth}
|
%\@initializelength{\listdoubleitemmaincolumnwidth}
|
||||||
|
|
||||||
% numbers
|
|
||||||
% used by \calculatecompensation
|
|
||||||
\@initializecommand{\numoflines}{0}
|
|
||||||
% commands
|
% commands
|
||||||
\@initializecommand{\recomputecvbodylengths}{%
|
\@initializecommand{\recomputecvbodylengths}{%
|
||||||
% body lengths
|
% body lengths
|
||||||
|
|
@ -72,21 +67,13 @@
|
||||||
% regular lengths
|
% regular lengths
|
||||||
\setlength{\parskip}{0\p@}}
|
\setlength{\parskip}{0\p@}}
|
||||||
|
|
||||||
\newcommand{\calculatecompensation}[1]{%
|
|
||||||
% calculate the number of lines used by sections and subsections
|
|
||||||
\settowidth{\thissectionwidth}{#1}%
|
|
||||||
\renewcommand{\numoflines}{\numexpr\thissectionwidth/\hintscolumnwidth\relax}%
|
|
||||||
\setlength{\multilinecompensationlength}{\dimexpr\hintscolumnwidth*\numoflines\relax}%
|
|
||||||
}
|
|
||||||
|
|
||||||
\@initializeif{\if@aftersection}\@aftersectionfalse%
|
\@initializeif{\if@aftersection}\@aftersectionfalse%
|
||||||
\RenewDocumentCommand{\section}{sm}{%
|
\RenewDocumentCommand{\section}{sm}{%
|
||||||
\addvspace{2.5ex}%
|
\addvspace{2.5ex}%
|
||||||
\phantomsection{}% reset the anchor for hyperrefs
|
\phantomsection{}% reset the anchor for hyperrefs
|
||||||
\addcontentsline{toc}{section}{#2}%
|
\addcontentsline{toc}{section}{#2}%
|
||||||
\calculatecompensation{\sectionstyle{#2}}% calculate the vspace compensation for current section
|
% minipage for correct spacing with multiline sections #69
|
||||||
\noindent\rlap{\@cvitem{\raggedleft\sectionstyle{#2}\ifthenelse{\multilinecompensationlength<2}{}{\vspace{-\multilinecompensationlength}}}{}}%
|
\noindent\rlap{\@cvitem{\begin{minipage}[t][1ex]{\hintscolumnwidth}\raggedleft\sectionstyle{#2}\end{minipage}}{}}%
|
||||||
%\noindent\rlap{\@cvitem{\raggedleft\sectionstyle{#2}}{}}%
|
|
||||||
\nobreak\@afterheading\@aftersectiontrue\ignorespaces}
|
\nobreak\@afterheading\@aftersectiontrue\ignorespaces}
|
||||||
|
|
||||||
%\@initializeif{\if@aftersubsection}\@aftersubsectionfalse%
|
%\@initializeif{\if@aftersubsection}\@aftersubsectionfalse%
|
||||||
|
|
@ -97,8 +84,8 @@
|
||||||
\par\ignorespaces\fi%
|
\par\ignorespaces\fi%
|
||||||
\phantomsection{}% reset the anchor for hyperrefs
|
\phantomsection{}% reset the anchor for hyperrefs
|
||||||
\addcontentsline{toc}{subsection}{#2}%
|
\addcontentsline{toc}{subsection}{#2}%
|
||||||
\calculatecompensation{\subsectionstyle{#2}}% calculate the vspace compensation for current section
|
% minipage for correct spacing with multiline subsections #69
|
||||||
\noindent\rlap{\@cvitem{\if@aftersection\else\@moderncvstrut{4pt}{24pt}\fi\raggedleft\subsectionstyle{#2}\ifthenelse{\multilinecompensationlength<2}{}{\vspace{-\multilinecompensationlength}}}{}}%
|
\noindent\rlap{\@cvitem{\begin{minipage}[t][1ex]{\hintscolumnwidth}\if@aftersection\else\@moderncvstrut{4pt}{24pt}\fi\raggedleft\subsectionstyle{#2}\end{minipage}}{}}%
|
||||||
\nobreak\@afterheading\@aftersectiontrue\ignorespaces}
|
\nobreak\@afterheading\@aftersectiontrue\ignorespaces}
|
||||||
|
|
||||||
\renewcommand*{\cvitem}[3][.5ex]{%
|
\renewcommand*{\cvitem}[3][.5ex]{%
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue