diff options
author | Karl Berry <karl@freefriends.org> | 2015-07-29 20:38:14 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2015-07-29 20:38:14 +0000 |
commit | e76534e995ef3134f513b1a9951be0156c997631 (patch) | |
tree | 66887cff813a6f9f7b72f0831165ea188043fab0 /Master/texmf-dist/tex/latex/moderncv/moderncvfooti.sty | |
parent | 6c09dd71fc1b55b7990d439747f090fa57a84b77 (diff) |
moderncv (29jul15)
git-svn-id: svn://tug.org/texlive/trunk@37992 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/moderncv/moderncvfooti.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/moderncv/moderncvfooti.sty | 134 |
1 files changed, 134 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/moderncv/moderncvfooti.sty b/Master/texmf-dist/tex/latex/moderncv/moderncvfooti.sty new file mode 100644 index 00000000000..1a66d0f64ec --- /dev/null +++ b/Master/texmf-dist/tex/latex/moderncv/moderncvfooti.sty @@ -0,0 +1,134 @@ +%% start of file `moderncvfooti.sty'. +%% Copyright 2006-2015 Xavier Danaux (xdanaux@gmail.com). +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License version 1.3c, +% available at http://www.latex-project.org/lppl/. + + +%------------------------------------------------------------------------------- +% identification +%------------------------------------------------------------------------------- +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{moderncvfooti}[2015/07/28 v2.0.0 modern curriculum vitae and letter footer variant: 1] + + +%------------------------------------------------------------------------------- +% required packages +%------------------------------------------------------------------------------- + + +%------------------------------------------------------------------------------- +% overall foot definition +%------------------------------------------------------------------------------- +% fonts +\renewcommand*{\addressfont}{\normalsize\mdseries\slshape} + +% symbols +% footer symbol used to separate footer elements +\newcommand*{\footsymbol}{% + {~~~{\rmfamily\textbullet}~~~}}% the \rmfamily is required to force Latin Modern fonts when using sans serif, as OMS/lmss/m/n is not defined and gets substituted by OMS/cmsy/m/n + +% lengths +\@initializelength{\footwidth}% +\renewcommand*{\recomputefootlengths}{% + \setlength{\footwidth}{0.8\textwidth}} + +% commands +% internal command to add an element to the footer +% it collects the elements in a temporary box, and checks when to flush the box +\@initializebox{\footbox}% +\@initializebox{\foottempbox}% +\@initializelength{\footboxwidth}% +\@initializeif{\if@firstfootelement}\@firstfootelementtrue% +% adds an element to the footer, separated by footsymbol +% usage: \addtofoot[footsymbol]{element} +\newcommand*{\addtofoot}[2][\footsymbol]{% + \if@firstfootelement% + \savebox{\foottempbox}{\usebox{\footbox}#2}% + \else% + \savebox{\foottempbox}{\usebox{\footbox}#1#2}\fi% + \settowidth{\footboxwidth}{\usebox{\foottempbox}}% + \ifnum\footboxwidth<\footwidth% + \savebox{\footbox}{\usebox{\foottempbox}}% + \@firstfootelementfalse% + \else% + \flushfoot\\% + \savebox{\footbox}{#2}% + \savebox{\foottempbox}{#2}% + \settowidth{\footboxwidth}{\usebox{\footbox}}% + \@firstfootelementfalse\fi} +% internal command to flush the foot +\newcommand*{\flushfoot}{% + \strut\usebox{\footbox}% + \savebox{\footbox}{}% + \savebox{\foottempbox}{}% + \setlength{\footboxwidth}{0pt}} + + +%------------------------------------------------------------------------------- +% resume foot definition +%------------------------------------------------------------------------------- +% lenghts +\renewcommand*{\recomputecvfootlengths}{\recomputefootlengths} + +% commands +\renewcommand*{\makecvfoot}{% + \recomputecvfootlengths{}% + \fancypagestyle{plain}{% + \fancyfoot[c]{% + \parbox[b]{\footwidth}{% + \centering% + \color{color2}\addressfont% + \vspace{\baselineskip}% forces a white line to ensure space between main text and footer (as footer height can't be known in advance) + \ifthenelse{\isundefined{\@addressstreet}}{}{\addtofoot[]{\addresssymbol\@addressstreet}% + \ifthenelse{\equal{\@addresscity}{}}{}{\addtofoot[~--~]{\@addresscity}}% if \addresstreet is defined, \addresscity and \addresscountry will always be defined but could be empty + \ifthenelse{\equal{\@addresscountry}{}}{}{\addtofoot[~--~]{\@addresscountry}}% + \flushfoot\@firstfootelementtrue\\}% + \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number + \addtofoot{\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}}% + \ifthenelse{\isundefined{\@email}}{}{\addtofoot{\emailsymbol\emaillink{\@email}}}% + \ifthenelse{\isundefined{\@homepage}}{}{\addtofoot{\homepagesymbol\httplink{\@homepage}}}% + \collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link + \addtofoot{\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}}% + \ifthenelse{\isundefined{\@extrainfo}}{}{\addtofoot{\@extrainfo}}% + \ifthenelse{\lengthtest{\footboxwidth=0pt}}{}{\flushfoot}% 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}} + + +%------------------------------------------------------------------------------- +% letter foot definition +%------------------------------------------------------------------------------- +% commands +\renewcommand*{\recomputeletterfootlengths}{\recomputefootlengths} +\renewcommand*{\makeletterfoot}{% + \recomputeletterfootlengths{}% + \fancypagestyle{plain}{% + \fancyfoot[c]{% + \parbox[b]{\footwidth}{% + \centering% + \addressfont\color{color2}% + \vspace{\baselineskip}% forces a white line to ensure space between main text and footer (as footer height can't be known in advance) + \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~\@lastname}\\% the \strut is required to ensure the line is exactly \baselineskip tall + \ifthenelse{\isundefined{\@addressstreet}}{}{\addtofoot[]{\addresssymbol\@addressstreet}% + \ifthenelse{\equal{\@addresscity}{}}{}{\addtofoot[~--~]{\@addresscity}}% if \addresstreet is defined, \addresscity and addresscountry will always be defined but could be empty + \ifthenelse{\equal{\@addresscountry}{}}{}{\addtofoot[~--~]{\@addresscountry}}% + \flushfoot\@firstfootelementtrue\\}% + \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number + \addtofoot{\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}}% + \ifthenelse{\isundefined{\@email}}{}{\addtofoot{\emailsymbol\emaillink{\@email}}}% + \ifthenelse{\isundefined{\@homepage}}{}{\addtofoot{\homepagesymbol\httplink{\@homepage}}}% + \collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link + \addtofoot{\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}}% + \ifthenelse{\isundefined{\@extrainfo}}{}{\addtofoot{\@extrainfo}}% + \ifthenelse{\lengthtest{\footboxwidth=0pt}}{}{\flushfoot}% 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}} + + +\endinput + + +%% end of file `moderncvfooti.sty'. |