From dbb2f13a3e40354620562d86b1f644c1a98dccd7 Mon Sep 17 00:00:00 2001 From: Fabrice Le Goff Date: Wed, 14 Dec 2022 17:03:17 +0100 Subject: [PATCH] add option to classic style to align header elements to the top --- moderncvheadi.sty | 10 ++++++++++ moderncvstyleclassic.sty | 1 + 2 files changed, 11 insertions(+) diff --git a/moderncvheadi.sty b/moderncvheadi.sty index 3c8e979..b625f4a 100644 --- a/moderncvheadi.sty +++ b/moderncvheadi.sty @@ -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 @@ -115,6 +120,11 @@ \namestyle{\@firstname\ \@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}% diff --git a/moderncvstyleclassic.sty b/moderncvstyleclassic.sty index 3018cc6..ff75507 100644 --- a/moderncvstyleclassic.sty +++ b/moderncvstyleclassic.sty @@ -16,6 +16,7 @@ \@initializecommand{\moderncvstyleheadoptions}{} \DeclareOption{left} {\edef\moderncvstyleheadoptions{\moderncvstyleheadoptions,left}} \DeclareOption{right}{\edef\moderncvstyleheadoptions{\moderncvstyleheadoptions,right}} +\DeclareOption{top}{\edef\moderncvstyleheadoptions{\moderncvstyleheadoptions,top}} % toggle use of symbol fonts. \@initializeif{\if@symbols}\@symbolsfalse