diff options
Diffstat (limited to 'macros/latex/contrib/moderncv/moderncvheadi.sty')
-rw-r--r-- | macros/latex/contrib/moderncv/moderncvheadi.sty | 54 |
1 files changed, 38 insertions, 16 deletions
diff --git a/macros/latex/contrib/moderncv/moderncvheadi.sty b/macros/latex/contrib/moderncv/moderncvheadi.sty index 087cf776e2..9dfb35a06c 100644 --- a/macros/latex/contrib/moderncv/moderncvheadi.sty +++ b/macros/latex/contrib/moderncv/moderncvheadi.sty @@ -1,5 +1,5 @@ %% start of file `moderncvheadi.sty'. -%% Copyright 2006-2015 Xavier Danaux (xdanaux@gmail.com), 2020-2022 moderncv maintainers (github.com/moderncv). +%% Copyright 2006-2015 Xavier Danaux (xdanaux@gmail.com), 2020-2024 moderncv maintainers (github.com/moderncv). % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License version 1.3c, @@ -10,7 +10,7 @@ % identification %------------------------------------------------------------------------------- \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{moderncvheadi}[2022-02-21 v2.3.1 modern curriculum vitae and letter header variant: 1] +\ProvidesPackage{moderncvheadi}[2024-07-18 v2.4.1 modern curriculum vitae and letter header variant: 1] % details options: "details" (default) or "nodetails" \@initializeif{\if@details}\@detailsfalse @@ -23,6 +23,11 @@ \@initializeif{\if@right}\@rightfalse \DeclareOption{right} {\@leftfalse\@righttrue} +% top options: align header elements by their top instead of their bottom +% default: bottom +\@initializeif{\if@top}\@topfalse +\DeclareOption{top}{\@toptrue} + \DeclareOption*{}% avoid choking on unknown options \ExecuteOptions{details,left} \ProcessOptions*\relax% \ProcessOptions* processes the options in the order provided (i.e., with the later ones possibly overriding the former ones), while \ProcessOptions processes them in the order of the package @@ -43,10 +48,12 @@ \renewcommand*{\quotefont}{\large\slshape} % styles -\renewcommand*{\namestyle}[1]{{\namefont\textcolor{color0}{#1}}} -\renewcommand*{\titlestyle}[1]{{\titlefont\textcolor{color2}{#1}}} -\renewcommand*{\addressstyle}[1]{{\addressfont\textcolor{color2}{#1}}} -\renewcommand*{\quotestyle}[1]{{\quotefont\textcolor{color1}{#1}}} +\renewcommand*{\namestyle}[1]{{\namefont\textcolor{namecolor}{#1}}} +\renewcommand*{\firstnamestyle}[1]{{\namefont\textcolor{firstnamecolor}{#1}}} +\renewcommand*{\lastnamestyle}[1]{{\namefont\textcolor{lastnamecolor}{#1}}} +\renewcommand*{\titlestyle}[1]{{\titlefont\textcolor{titlecolor}{#1}}} +\renewcommand*{\addressstyle}[1]{{\addressfont\textcolor{addresscolor}{#1}}} +\renewcommand*{\quotestyle}[1]{{\quotefont\textcolor{quotecolor}{#1}}} %------------------------------------------------------------------------------- @@ -72,7 +79,7 @@ \collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link \protected@edef\socialsdetails{\socialsdetails\protect\makenewline\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}}% \savebox{\makecvheaddetailsbox}{% - \addressfont\color{color2}% + \addressfont\color{addresscolor}% \if@left\begin{tabular}[b]{@{}r@{}}\fi% \if@right\begin{tabular}[b]{@{}l@{}}\fi% \ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet% @@ -81,7 +88,8 @@ \ifthenelse{\isundefined{\@born}}{}{\makenewline\bornsymbol\@born}% \phonesdetails% needs to be pre-rendered as loops and tabulars seem to conflict \ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}% - \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httpslink{\@homepage}}% + \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol% + \ifthenelse{\equal{\@homepageprotocol}{http}}{\httplink{\@homepage}}{\httpslink{\@homepage}}}% \socialsdetails% needs to be pre-rendered as loops and tabulars seem to conflict \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}% \end{tabular} @@ -94,7 +102,7 @@ {% \if@left% \hspace*{\separatorcolumnwidth}\fi% - \color{color1}% + \color{pictureframecolor}% \setlength{\fboxrule}{\@photoframewidth}% \ifdim\@photoframewidth=0pt% \setlength{\fboxsep}{0pt}\fi% @@ -112,9 +120,14 @@ \begin{minipage}[b]{\makecvheadnamewidth}% \if@left\raggedright\fi% \if@right\raggedleft\fi% - \namestyle{\@firstname\ \@lastname}% + \firstnamestyle{\@firstname}~\lastnamestyle{\@lastname}% \ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\titlestyle{\@title}}% \end{minipage}}% + % raise boxes if top option is set + \if@top% + \savebox{\makecvheadnamebox}{\raisebox{-\height+\baselineskip}{\usebox{\makecvheadnamebox}}}% + \savebox{\makecvheaddetailsbox}{\raisebox{-\height+\baselineskip}{\usebox{\makecvheaddetailsbox}}}% + \savebox{\makecvheadpicturebox}{\raisebox{-\height+\baselineskip}{\usebox{\makecvheadpicturebox}}}\fi% % rendering \if@left% \usebox{\makecvheadnamebox}% @@ -126,11 +139,17 @@ \rlap{\usebox{\makecvheaddetailsbox}}% \llap is used to suppress the width of the box, allowing overlap if the value of makecvheadnamewidth is forced \hfill% \usebox{\makecvheadnamebox}\fi% - \\[2.5em]% % optional quote \ifthenelse{\isundefined{\@quote}}% - {}% - {{\centering\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\\[2.5em]}}% + {\vspace{2.5em}}% + {% + \\[2.5em]% + {% + \centering% + \begin{minipage}{\quotewidth}% + \centering% + \quotestyle{\@quote}% + \end{minipage}\\[2.5em]}}% \par}% to avoid weird spacing bug at the first section if no blank line is left after \makecvhead @@ -150,7 +169,7 @@ % optional detailed information \if@details% \raggedleft% - \addressfont\textcolor{color2}{% + \addressfont\textcolor{addresscolor}{% {\bfseries\upshape\@firstname~\@lastname}\@firstdetailselementfalse% % optional detailed information \ifthenelse{\isundefined{\@addressstreet}}{}{\makenewline\addresssymbol\@addressstreet% @@ -159,9 +178,10 @@ \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number \makenewline\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}% \ifthenelse{\isundefined{\@email}}{}{\makenewline\emailsymbol\emaillink{\@email}}% - \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol\httpslink{\@homepage}}% + \ifthenelse{\isundefined{\@homepage}}{}{\makenewline\homepagesymbol% + \ifthenelse{\equal{\@homepageprotocol}{http}}{\httplink{\@homepage}}{\httpslink{\@homepage}}}% \ifthenelse{\isundefined{\@extrainfo}}{}{\makenewline\@extrainfo}}\fi% - \end{minipage}\\[1em] + \end{minipage}\\[2em] % recipient block \begin{minipage}[t]{.5\textwidth} \raggedright% @@ -173,6 +193,8 @@ \hfill% US style % \\[1em]% UK style \@date\\[2em]% US informal style: "January 1, 1900"; UK formal style: "01/01/1900" + % optional subject + \ifthenelse{\isundefined{\@subject}}{}{{\bfseries\@subject\\[2em]}} % opening \raggedright% \@opening\\[1.5em]% |