Fixed the vertical alignment of the footers

This commit is contained in:
Xavier Danaux
2012-07-30 03:36:47 +02:00
parent da511d93dd
commit 46e9e33ee2
3 changed files with 16 additions and 9 deletions

View File

@ -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,

View File

@ -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}

View File

@ -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}{