From 46e9e33ee2c0c22068472716fbb279f83eb46f39 Mon Sep 17 00:00:00 2001 From: Xavier Danaux Date: Mon, 30 Jul 2012 03:36:47 +0200 Subject: [PATCH] Fixed the vertical alignment of the footers --- CHANGELOG | 7 +++++-- moderncv.cls | 2 +- moderncvstylecasual.sty | 16 ++++++++++------ 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 12ab6f1..9ba2d8d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,9 @@ version 1.1.0 (29 Jul 2012) - fixed the switching from letter to resume, correcting spacing errors when a - letter is typeset before the resume (as noticed by Ulrich G.). + letter is typeset before the resume, as noticed by U. Gabor. + - fixed the vertical alignment of the footers, as reported by T. Homa. + Footers are now aligned to the bottom and the letter and cv footers are + perfectly aligned in the "casual" style. - prepared moderncv for fontspec font loading (still commented in code). - changed the handling of the "sans" and "roman" class options, to be reflected at the beginning of the document and override style font choices. @@ -12,7 +15,7 @@ version 1.1.0 (29 Jul 2012) evenly between leaders. - added two options to change the "Enclosure" string used for the letter enclosure: either specify another string as optional argument to \enclosure, - or redefine \enclname (as suggested by D. Wille). + or redefine \enclname, as suggested by D. Wille. version 1.0.0 (26 Mar 2012) - added commands to generate letters for every resume style: \recipient, \date, diff --git a/moderncv.cls b/moderncv.cls index 026f054..bd56e93 100644 --- a/moderncv.cls +++ b/moderncv.cls @@ -164,7 +164,7 @@ \newlength{\pagenumberwidth}% \settowidth{\pagenumberwidth}{\color{color2}\addressfont\itshape\strut\thepage/\pageref{lastpage}}% \fancypagestyle{plain}{% - \fancyfoot[r]{\parbox{\pagenumberwidth}{\color{color2}\addressfont\itshape\strut\thepage/\pageref{lastpage}}}}% the parbox is required to ensure alignment with a possible center footer (e.g., as in the casual style) + \fancyfoot[r]{\parbox[b]{\pagenumberwidth}{\color{color2}\addressfont\itshape\strut\thepage/\pageref{lastpage}}}}% the parbox is required to ensure alignment with a possible center footer (e.g., as in the casual style) \pagestyle{plain}}{}}% \AtEndDocument{\label{lastpage}}\else\fi}} \pagestyle{plain} diff --git a/moderncvstylecasual.sty b/moderncvstylecasual.sty index 8364429..3ba8100 100644 --- a/moderncvstylecasual.sty +++ b/moderncvstylecasual.sty @@ -58,7 +58,8 @@ \newcommand*{\flushfooter}{% \strut\usebox{\footerbox}% \savebox{\footerbox}{}% - \savebox{\footertempbox}{}} + \savebox{\footertempbox}{} + \setlength{\footerboxwidth}{0pt}} %------------------------------------------------------------------------------- @@ -103,7 +104,7 @@ \setlength{\footerwidth}{0.8\textwidth}% \fancypagestyle{plain}{% \fancyfoot[c]{% - \parbox{\footerwidth}{% + \parbox[b]{\footerwidth}{% \centering% \color{color2}\addressfont% \ifthenelse{\isundefined{\@addressstreet}}{}{\addtofooter[]{\addresssymbol\@addressstreet}% @@ -114,7 +115,8 @@ \ifthenelse{\isundefined{\@email}}{}{\addtofooter{\emailsymbol\emaillink{\@email}}}% \ifthenelse{\isundefined{\@homepage}}{}{\addtofooter{\homepagesymbol\httplink{\@homepage}}}% \ifthenelse{\isundefined{\@extrainfo}}{}{\addtofooter{\@extrainfo}}% - \flushfooter}}}% + \ifthenelse{\lengthtest{\footerboxwidth=0pt}}{}{\flushfooter}% the lengthtest is required to avoid flushing an empty footer, which could cause a blank line due to the \\ after the address, if no other personal info is used + }}}% \pagestyle{plain}} @@ -148,10 +150,11 @@ \setlength{\footerwidth}{0.8\textwidth}% \fancypagestyle{plain}{% \fancyfoot[c]{% - \parbox{\footerwidth}{% + \parbox[b]{\footerwidth}{% \centering% \addressfont\color{color2}% - {\bfseries\upshape\@firstname~\@familyname}\\ + \vspace{-\baselineskip}% to cancel out the extra vertical space taken by the name (below) and ensure perfect alignment of letter and cv footers + \strut{\bfseries\upshape\@firstname~\@familyname}\\% the \strut is required to ensure the line is exactly \baselineskip tall \ifthenelse{\isundefined{\@addressstreet}}{}{\addtofooter[]{\addresssymbol\@addressstreet}% \ifthenelse{\equal{\@addresscity}{}}{}{\addtofooter[~--~]{\@addresscity}}\flushfooter\@firstfooterelementtrue\\}% if \addresstreet is defined, \addresscity will always be defined but could be empty \ifthenelse{\isundefined{\@mobile}}{}{\addtofooter{\mobilesymbol\@mobile}}% @@ -160,7 +163,8 @@ \ifthenelse{\isundefined{\@email}}{}{\addtofooter{\emailsymbol\emaillink{\@email}}}% \ifthenelse{\isundefined{\@homepage}}{}{\addtofooter{\homepagesymbol\httplink{\@homepage}}}% \ifthenelse{\isundefined{\@extrainfo}}{}{\addtofooter{\@extrainfo}}% - \flushfooter}}}% + \ifthenelse{\lengthtest{\footerboxwidth=0pt}}{}{\flushfooter}% the lengthtest is required to avoid flushing an empty footer, which could cause a blank line due to the \\ after the address, if no other personal info is used + }}}% \pagestyle{plain}} \renewcommand*{\makeletterclosing}{