From febe25906b22b27a2a7317fe9fa214ffa0206c93 Mon Sep 17 00:00:00 2001 From: Pieter van Oostrum Date: Sat, 15 Oct 2022 20:00:33 +0200 Subject: [PATCH] Correct line spacing with multi-line names and titles See https://tex.stackexchange.com/q/661729/113546 and https://github.com/xdanaux/moderncv/issues/99 --- moderncvheadi.sty | 6 +++--- moderncvheadii.sty | 4 ++-- moderncvheadiii.sty | 4 ++-- moderncvheadiv.sty | 6 +++--- moderncvheadvi.sty | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/moderncvheadi.sty b/moderncvheadi.sty index 087cf77..4010191 100644 --- a/moderncvheadi.sty +++ b/moderncvheadi.sty @@ -43,8 +43,8 @@ \renewcommand*{\quotefont}{\large\slshape} % styles -\renewcommand*{\namestyle}[1]{{\namefont\textcolor{color0}{#1}}} -\renewcommand*{\titlestyle}[1]{{\titlefont\textcolor{color2}{#1}}} +\renewcommand*{\namestyle}[1]{{\namefont\textcolor{color0}{#1}\par}} +\renewcommand*{\titlestyle}[1]{{\titlefont\textcolor{color2}{#1}\par}} \renewcommand*{\addressstyle}[1]{{\addressfont\textcolor{color2}{#1}}} \renewcommand*{\quotestyle}[1]{{\quotefont\textcolor{color1}{#1}}} @@ -113,7 +113,7 @@ \if@left\raggedright\fi% \if@right\raggedleft\fi% \namestyle{\@firstname\ \@lastname}% - \ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\titlestyle{\@title}}% + \ifthenelse{\equal{\@title}{}}{}{\vspace{1.25em}\titlestyle{\@title}}% \end{minipage}}% % rendering \if@left% diff --git a/moderncvheadii.sty b/moderncvheadii.sty index b699242..265b3c1 100644 --- a/moderncvheadii.sty +++ b/moderncvheadii.sty @@ -48,7 +48,7 @@ % styles \renewcommand*{\namestyle}[1]{{\namefont\textcolor{color0}{#1}}} -\renewcommand*{\titlestyle}[1]{{\titlefont\textcolor{color2}{#1}}} +\renewcommand*{\titlestyle}[1]{{\titlefont\textcolor{color2}{#1}\par}} \renewcommand*{\addressstyle}[1]{{\addressfont\textcolor{color2}{#1}}} \renewcommand*{\quotestyle}[1]{{\quotefont\textcolor{color1}{#1}}} @@ -157,7 +157,7 @@ \titlestyle{\MakeLowercase\@title}% \else% \titlestyle{\@title}\fi% - }\\[2.5em]% + }\vspace{2.5ex}% % optional quote \ifthenelse{\isundefined{\@quote}}% {}% diff --git a/moderncvheadiii.sty b/moderncvheadiii.sty index e4dbafd..64bb4ba 100644 --- a/moderncvheadiii.sty +++ b/moderncvheadiii.sty @@ -37,7 +37,7 @@ % styles \renewcommand*{\namestyle}[1]{{\namefont\textcolor{color1}{#1}}} -\renewcommand*{\titlestyle}[1]{{\titlefont\textcolor{color2!85}{#1}}} +\renewcommand*{\titlestyle}[1]{{\titlefont\textcolor{color2!85}{#1}\par}} \renewcommand*{\addressstyle}[1]{{\addressfont\textcolor{color2}{#1}}} \renewcommand*{\quotestyle}[1]{{\quotefont\textcolor{color1}{#1}}} @@ -85,7 +85,7 @@ \ifthenelse{\equal{\@title}{}}{}{\titlestyle{~|~\@title}}% \isundefined doesn't work on \@title, as LaTeX itself defines \@title (before it possibly gets redefined by \title) % optional detailed information \if@details{% - \\% + %\\% \addressfont\color{color2}% \ifthenelse{\isundefined{\@addressstreet}}{}{\addtomakeheaddetails{\addresssymbol\@addressstreet}% \ifthenelse{\equal{\@addresscity}{}}{}{\addtomakeheaddetails[~--~]{\@addresscity}}% if \addresstreet is defined, \addresscity and \addresscountry will always be defined but could be empty diff --git a/moderncvheadiv.sty b/moderncvheadiv.sty index 9b59dac..58c1cb5 100644 --- a/moderncvheadiv.sty +++ b/moderncvheadiv.sty @@ -38,8 +38,8 @@ \renewcommand*{\quotefont}{\large\itshape} % styles -\renewcommand*{\namestyle}[1]{{\namefont\textcolor{color0}{#1}}} -\renewcommand*{\titlestyle}[1]{{\titlefont\textcolor{color2}{#1}}} +\renewcommand*{\namestyle}[1]{{\namefont\textcolor{color0}{#1}\par}} +\renewcommand*{\titlestyle}[1]{{\titlefont\textcolor{color2}{#1}\par}} \renewcommand*{\addressstyle}[1]{{\addressfont\textcolor{color2}{#1}}} \renewcommand*{\quotestyle}[1]{{\quotefont\textcolor{color1}{#1}}} @@ -92,7 +92,7 @@ {}% \begin{minipage}[b]{\makecvheadnamewidth}% \namestyle{\@firstname\ \@lastname}% - \ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\titlestyle{\@title}}% + \ifthenelse{\equal{\@title}{}}{}{\vspace{1.25em}\titlestyle{\@title}}% \end{minipage}% % optional photo \usebox{\makecvheadpicturebox}\\[2.5em]% diff --git a/moderncvheadvi.sty b/moderncvheadvi.sty index 8595901..f45f0a4 100644 --- a/moderncvheadvi.sty +++ b/moderncvheadvi.sty @@ -44,7 +44,7 @@ % styles \renewcommand*{\namestyle}[1]{{\namefont\textcolor{color1}{#1}}} -\renewcommand*{\titlestyle}[1]{{\titlefont\textcolor{color2!85}{#1}}} +\renewcommand*{\titlestyle}[1]{{\titlefont\textcolor{color2!85}{#1}\par}} \renewcommand*{\addressstyle}[1]{{\addressfont\textcolor{color2}{#1}}} \renewcommand*{\quotestyle}[1]{{\quotefont\textcolor{color1}{#1}}} @@ -54,7 +54,7 @@ % name and title \if@left\hfill\fi% \namestyle{\@firstname~\@lastname}% - \ifthenelse{\equal{\@title}{}}{}{\titlestyle{~|~\@title}}\\[-.35em]% \isundefined doesn't work on \@title, as LaTeX itself defines \@title (before it possibly gets redefined by \title) + \ifthenelse{\equal{\@title}{}}{}{\titlestyle{~|~\@title}}\vspace{-.35em}% \isundefined doesn't work on \@title, as LaTeX itself defines \@title (before it possibly gets redefined by \title) % rule {\color{color1}\rule{\textwidth}{.25ex}}}