diff options
author | Karl Berry <karl@freefriends.org> | 2012-03-26 23:18:00 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-03-26 23:18:00 +0000 |
commit | 0e7c4deae1d24a03668f9705a75bbf8ffa2c4849 (patch) | |
tree | 4bc0e9d39031c8d72847de68fe1cf9beee23f4f4 /Master/texmf-dist/tex/latex/moderncv/moderncvstylebanking.sty | |
parent | b752131531e9fb94c91b98195ae4706d7aa23070 (diff) |
moderncv 1.0 (26mar12)
git-svn-id: svn://tug.org/texlive/trunk@25745 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/moderncv/moderncvstylebanking.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/moderncv/moderncvstylebanking.sty | 159 |
1 files changed, 105 insertions, 54 deletions
diff --git a/Master/texmf-dist/tex/latex/moderncv/moderncvstylebanking.sty b/Master/texmf-dist/tex/latex/moderncv/moderncvstylebanking.sty index e22c47fe577..a8ca0e9eb89 100644 --- a/Master/texmf-dist/tex/latex/moderncv/moderncvstylebanking.sty +++ b/Master/texmf-dist/tex/latex/moderncv/moderncvstylebanking.sty @@ -10,7 +10,7 @@ % identification %------------------------------------------------------------------------------- \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{moderncvstylebanking}[2012/02/06 v0.19 modern curriculum vitae scheme: banking] +\ProvidesPackage{moderncvstylebanking}[2012/03/26 v1.0 modern curriculum vitae and letter style scheme: banking] %------------------------------------------------------------------------------- @@ -26,12 +26,60 @@ %------------------------------------------------------------------------------- -% style definition +% overall style definition +%------------------------------------------------------------------------------- +% commands +\newcommand*{\maketitlesymbol}{% + {~~~\textbullet~~~}}% \textbullet forces the use of the CMSY font, even when latin modern fonts are used :( +% internal command to add an element to the footer +% it collects the elements in a temporary box, and checks when to flush the box +\newsavebox{\maketitlebox}% +\newsavebox{\maketitletempbox}% +\newlength{\maketitlewidth}% +\newlength{\maketitleboxwidth}% +% adds an element to the maketitle, separated by maketitlesymbol +% usage: \addtomaketitle[maketitlesymbol]{element} +\newcommand*{\addtomaketitle}[2][\maketitlesymbol]{% + \savebox{\maketitletempbox}{\usebox{\maketitlebox}#1#2}% + \settowidth{\maketitleboxwidth}{\usebox{\maketitletempbox}}% + \ifnum\maketitleboxwidth<\maketitlewidth% + \savebox{\maketitlebox}{\usebox{\maketitletempbox}} + \else% + \flushmaketitle{}\\% + \savebox{\maketitlebox}{#2}% + \savebox{\maketitletempbox}{#2}\fi} +% internal command to flush the maketitle +\newcommand*{\flushmaketitle}{% + \strut\usebox{\maketitlebox}% + \savebox{\maketitlebox}{}% + \savebox{\maketitletempbox}{}} +\renewcommand*{\maketitle}{% + \setlength{\maketitlewidth}{0.8\textwidth}% + \hfil% + \parbox{\maketitlewidth}{% + \centering% + % name (title is not visible) + \namestyle{\@firstname~\@familyname}\\% + % detailed information + \addressfont\color{color2}% + \ifthenelse{\isundefined{\@addressstreet}}{}{\addtomaketitle[]{\addresssymbol\@addressstreet}% + \ifthenelse{\equal{\@addresscity}{}}{}{\addtomaketitle[~--~]{\@addresscity}}\flushmaketitle}% if \addresstreet is defined, \addresscity will always be defined but could be empty + \ifthenelse{\isundefined{\@mobile}}{}{\addtomaketitle[]{\mobilesymbol\@mobile}}% + \ifthenelse{\isundefined{\@phone}}{}{\addtomaketitle{\phonesymbol\@phone}}% + \ifthenelse{\isundefined{\@fax}}{}{\addtomaketitle{\faxsymbol\@fax}}% + \ifthenelse{\isundefined{\@email}}{}{\addtomaketitle{\emailsymbol\emaillink{\@email}}}% + \ifthenelse{\isundefined{\@homepage}}{}{\addtomaketitle{\homepagesymbol\httplink{\@homepage}}}% + \ifthenelse{\isundefined{\@extrainfo}}{}{\addtomaketitle{\@extrainfo}}% + \flushmaketitle}\\[2.5em]}% need to force a \par after this to avoid weird spacing bug at the first section if no blank line is left after \maketitle + + +%------------------------------------------------------------------------------- +% resume style definition %------------------------------------------------------------------------------- % fonts \renewcommand*{\namefont}{\Huge\bfseries\upshape} \renewcommand*{\titlefont}{\LARGE\mdseries\slshape} -\renewcommand*{\addressfont}{\normalsize\mdseries\upshape} +\renewcommand*{\addressfont}{\small\mdseries\upshape} \renewcommand*{\quotefont}{\large\slshape} \renewcommand*{\sectionfont}{\Large\bfseries\upshape} \renewcommand*{\subsectionfont}{\large\upshape\fontseries{sb}\selectfont} @@ -46,7 +94,7 @@ \newcommand*{\subsectionstyle}[1]{{\subsectionfont\textcolor{color1}{#1}}} \newcommand*{\hintstyle}[1]{{\hintfont\textcolor{color0}{#1}}} -% length used +% lengths \newlength{\quotewidth} \newlength{\hintscolumnwidth} \setlength{\hintscolumnwidth}{0.3\textwidth}% @@ -59,7 +107,7 @@ \newlength{\listitemmaincolumnwidth} \newlength{\listdoubleitemmaincolumnwidth} -% recompute all the lengths that depends on the text width +% commands \renewcommand*{\recomputelengths}{% \setlength{\quotewidth}{0.65\textwidth}% % main lenghts @@ -75,58 +123,19 @@ % fancyhdr lengths \renewcommand{\headwidth}{\textwidth}} -% cv footer -\newcommand*{\maketitlesymbol}{% - {~~~\textbullet~~~}}% \textbullet forces the use of the CMSY font, even when latin modern fonts are used :( -% internal command to add an element to the footer -% it collects the elements in a temporary box, and checks when to flush the box -\newsavebox{\maketitlebox}% -\newsavebox{\maketitletempbox}% -\newlength{\maketitlewidth}% -\newlength{\maketitleboxwidth}% -% adds an element to the maketitle, separated by maketitlesymbol -% usage: \addtomaketitle[maketitlesymbol]{element} -\newcommand*{\addtomaketitle}[2][\maketitlesymbol]{% - \savebox{\maketitletempbox}{\usebox{\maketitlebox}#1#2}% - \settowidth{\maketitleboxwidth}{\usebox{\maketitletempbox}}% - \ifnum\maketitleboxwidth<\maketitlewidth% - \savebox{\maketitlebox}{\usebox{\maketitletempbox}} - \else% - \flushmaketitle{}\\% - \savebox{\maketitlebox}{#2}% - \savebox{\maketitletempbox}{#2}\fi} -% internal command to flush the maketitle -\newcommand*{\flushmaketitle}{% - \strut\usebox{\maketitlebox}% - \savebox{\maketitlebox}{}% - \savebox{\maketitletempbox}{}} -\renewcommand*{\maketitle}{% - \setlength{\maketitlewidth}{0.8\textwidth}% - \hfil% - \parbox{\maketitlewidth}{% - \centering% - % name (title is not visible) - \namestyle{\@firstname~\@familyname}\\% - % detailed information - \color{color2}\addressfont% - \ifthenelse{\isundefined{\@addressstreet}}{}{\addtomaketitle[]{\addresssymbol\@addressstreet}% - \ifthenelse{\equal{\@addresscity}{}}{}{\addtomaketitle[~--~]{\@addresscity}}\flushmaketitle}% if \addresstreet is defined, \addresscity will always be defined but could be empty - \ifthenelse{\isundefined{\@mobile}}{}{\addtomaketitle[]{\mobilesymbol\@mobile}}% - \ifthenelse{\isundefined{\@phone}}{}{\addtomaketitle{\phonesymbol\@phone}}% - \ifthenelse{\isundefined{\@fax}}{}{\addtomaketitle{\faxsymbol\@fax}}% - \ifthenelse{\isundefined{\@email}}{}{\addtomaketitle{\emailsymbol\emaillink{\@email}}}% - \ifthenelse{\isundefined{\@homepage}}{}{\addtomaketitle{\homepagesymbol\httplink{\@homepage}}}% - \ifthenelse{\isundefined{\@extrainfo}}{}{\addtomaketitle{\@extrainfo}}% - \flushmaketitle}\\[2.5em]% - % optional quote - \ifthenelse{\isundefined{\@quote}}% - {}% - {{\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 \maketitle +\renewcommand*{\makecvtitle}{% + % recompute lengths (in case we are switching from letter to resume, or vice versa) + \recomputecvlengths% + \maketitle% + % optional quote + \ifthenelse{\isundefined{\@quote}}% + {}% + {{\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 \maketitle} \renewcommand*{\section}[1]{% \par\addvspace{2.5ex}% - \phantomsection{}% + \phantomsection{}% reset the anchor for hyperrefs \addcontentsline{toc}{section}{#1}% \strut\sectionstyle{#1}% {\color{color1}\hrule}% @@ -206,6 +215,48 @@ \end{list}% } + +%------------------------------------------------------------------------------- +% letter style definition +%------------------------------------------------------------------------------- +% commands +\renewcommand*{\recomputeletterlengths}{ + \recomputecvlengths% + \setlength{\parskip}{6\p@}} + +\renewcommand*{\makelettertitle}{% + % recompute lengths (in case we are switching from letter to resume, or vice versa) + \recomputeletterlengths% + % sender block + \maketitle% + \par% + % recipient block + \begin{minipage}[t]{.5\textwidth} + \raggedright% + \addressfont% + {\bfseries\upshape\@recipientname}\\% + \@recipientaddress% + \end{minipage} + % date + \hfill % US style +% \\[1em] % UK style + \hbox{\today}\\[2em]% US informal style: "April 6, 2006"; UK formal style: "05/04/2006" + % opening + \raggedright% + \@opening\\[1.5em]% + % ensure no extra spacing after \makelettertitle due to a possible blank line +% \ignorespacesafterend% not working + \hspace{0pt}\par\vspace{-\baselineskip}\vspace{-\parskip}} + +\renewcommand*{\makeletterclosing}{ + \@closing\\[3em]% + {\bfseries \@firstname~\@familyname}% + \ifthenelse{\isundefined{\@enclosure}}{}{% + \\% + \vfill% + {\color{color2}\itshape Enclosure: \@enclosure}}} + + \endinput |