diff --git a/CHANGELOG b/CHANGELOG index 6afd162..55e4f32 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,11 @@ +version 0.20 (xx Mar 2012) + - added commands to generate letters for every resume style: \recipient, \date, + \opening, \closing, \enclosure, \makelettertitle and \makeletterclosing. The + old \maketitle and \makefooter commands are now deprecated and replaced by + \makecvtitle (resp. \makelettertitle) and \makecvfooter (resp. \makeletterfooter). + - changed the alignment algorithm for the personal data display in the oldstyle + style, as to align on the baseline of the first line with the surrounding text. + version 0.19 (06 Feb 2012) - reintroduced the ability to force the width reserved to display the name in the resume header for the classic style (\maketitlenamewidth). diff --git a/examples/template-es.pdf b/examples/template-es.pdf index a1034bc..1a78bc7 100644 Binary files a/examples/template-es.pdf and b/examples/template-es.pdf differ diff --git a/examples/template-zh.pdf b/examples/template-zh.pdf index 830560a..43a99f1 100644 Binary files a/examples/template-zh.pdf and b/examples/template-zh.pdf differ diff --git a/examples/template.pdf b/examples/template.pdf index 6a4d37b..ff81242 100644 Binary files a/examples/template.pdf and b/examples/template.pdf differ diff --git a/examples/template_banking_black.pdf b/examples/template_banking_black.pdf index 5557382..53f25c6 100644 Binary files a/examples/template_banking_black.pdf and b/examples/template_banking_black.pdf differ diff --git a/examples/template_banking_red.pdf b/examples/template_banking_red.pdf index eb5cc18..40e4ec7 100644 Binary files a/examples/template_banking_red.pdf and b/examples/template_banking_red.pdf differ diff --git a/examples/template_casual_orange.pdf b/examples/template_casual_orange.pdf index 460f165..04f4936 100644 Binary files a/examples/template_casual_orange.pdf and b/examples/template_casual_orange.pdf differ diff --git a/examples/template_classic_green.pdf b/examples/template_classic_green.pdf index 68b159e..13d585d 100644 Binary files a/examples/template_classic_green.pdf and b/examples/template_classic_green.pdf differ diff --git a/examples/template_multibib.pdf b/examples/template_multibib.pdf index 6f1d5cc..afc0bbb 100644 Binary files a/examples/template_multibib.pdf and b/examples/template_multibib.pdf differ diff --git a/moderncv.cls b/moderncv.cls index fc08fd2..15f88e5 100644 --- a/moderncv.cls +++ b/moderncv.cls @@ -10,13 +10,7 @@ % identification %------------------------------------------------------------------------------- \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{moderncv}[2012/02/06 v0.19 modern curriculum vitae document class] - - -%------------------------------------------------------------------------------- -% debugging -%------------------------------------------------------------------------------- -\newif\if@DEBUG\@DEBUGfalse +\ProvidesClass{moderncv}[2012/02/06 v0.19 modern curriculum vitae and letter document class] %------------------------------------------------------------------------------- @@ -96,10 +90,9 @@ % symbols like \Telefon, \Mobilefone, \Letter and \Email \RequirePackage{marvosym} -% hyper links +% hyper links (hyperref is loaded at the end of the preamble to pass options required by loaded packages such as CJK) \RequirePackage{url} \urlstyle{tt} -% load hyperref at the end of the preamble to pass options required by loaded packages (like CJK) \AtEndPreamble{ \@ifpackageloaded{CJK} {\RequirePackage[unicode]{hyperref}} @@ -131,6 +124,20 @@ \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} \fancyhf{}} +% page numbers in footer if more than 1 page +\newif\if@displaypagenumbers\@displaypagenumberstrue +\newcommand*{\nopagenumbers}{\@displaypagenumbersfalse} +\AtEndPreamble{% + \AtBeginDocument{% + \if@displaypagenumbers% + \@ifundefined{r@lastpage}{}{% + \ifthenelse{\pageref{lastpage}>1}{% + \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) + \pagestyle{plain}}{}}% + \AtEndDocument{\label{lastpage}}\else\fi}} \pagestyle{plain} % lengths calculations @@ -167,14 +174,30 @@ %\setlength\doublerulesep{2\p@} %\setlength\tabbingsep{\labelsep} -\pagestyle{empty} \raggedbottom \onecolumn %------------------------------------------------------------------------------- -% design commands definitions +% overall design commands definitions %------------------------------------------------------------------------------- +% elements +\newcommand*{\firstname}[1]{\def\@firstname{#1}} +\newcommand*{\familyname}[1]{\def\@familyname{#1}} +\renewcommand*{\title}[1]{\def\@title{#1}} +\newcommand*{\address}[2]{\def\@addressstreet{#1}\def\@addresscity{#2}} +\newcommand*{\mobile}[1]{\def\@mobile{#1}} +\newcommand*{\phone}[1]{\def\@phone{#1}} +\renewcommand*{\fax}[1]{\def\@fax{#1}} +\newcommand*{\email}[1]{\def\@email{#1}} +\newcommand*{\homepage}[1]{\def\@homepage{#1}} + +% colors +\definecolor{color0}{rgb}{0,0,0}% main default color, normally left to black +\definecolor{color1}{rgb}{0,0,0}% primary theme color +\definecolor{color2}{rgb}{0,0,0}% secondary theme color +\definecolor{color3}{rgb}{0,0,0}% tertiary theme color + % symbols % itemize labels (the struts were added to correct inter-item spacing (works for single line items, until a solution is found for multi-line ones...) \newcommand*{\labelitemi}{\strut\textcolor{color1}{\Neutral}}% alternative" \fontencoding{U}\fontfamily{ding}\selectfont\tiny\symbol{'102} @@ -195,22 +218,13 @@ \newcommand*{\emailsymbol}{\Letter~} \newcommand*{\homepagesymbol}{{\Large\ComputerMouse}~} -% colors -\definecolor{color0}{rgb}{0,0,0}% main default color, normally left to black -\definecolor{color1}{rgb}{0,0,0}% primary theme color -\definecolor{color2}{rgb}{0,0,0}% secondary theme color -\definecolor{color3}{rgb}{0,0,0}% tertiary theme color - -% fonts -\newcommand*{\namefont}{} -\newcommand*{\titlefont}{} -\newcommand*{\addressfont}{} -\newcommand*{\quotefont}{} -\newcommand*{\sectionfont}{} -\newcommand*{\subsectionfont}{} -\newcommand*{\hintfont}{} +%fonts \AtBeginDocument{\normalfont\color{color0}} +% makes the footer (normally used both for the resume and the letter) +% usage: \makefooter +\newcommand*{\makefooter}{}% + % loads a style scheme \newcommand*{\moderncvstyle}[1]{ \RequirePackage{moderncvstyle#1}} @@ -220,69 +234,71 @@ \RequirePackage{moderncvcolor#1}} % recompute all automatic lengths -\newcommand*{\recomputelengths}{} +\newcommand*{\recomputelengths}{\recomputecvlengths} \AtBeginDocument{\recomputelengths{}} %------------------------------------------------------------------------------- -% structure commands definitions +% resume design commands definitions %------------------------------------------------------------------------------- -% cv elements -\newcommand*{\firstname}[1]{\def\@firstname{#1}} -\newcommand*{\familyname}[1]{\def\@familyname{#1}} -\renewcommand*{\title}[1]{\def\@title{#1}} -\newcommand*{\address}[2]{\def\@addressstreet{#1}\def\@addresscity{#2}} -\newcommand*{\mobile}[1]{\def\@mobile{#1}} -\newcommand*{\phone}[1]{\def\@phone{#1}} -\renewcommand*{\fax}[1]{\def\@fax{#1}} -\newcommand*{\email}[1]{\def\@email{#1}} -\newcommand*{\homepage}[1]{\def\@homepage{#1}} +% elements \newcommand*{\extrainfo}[1]{\def\@extrainfo{#1}} \newcommandx*{\photo}[3][1=64pt,2=0.4pt,usedefault]{\def\@photowidth{#1}\def\@photoframewidth{#2}\def\@photo{#3}}% the 1st (optional) argument is the width of the photo, the 2nd (optional) argument is the thickness of the frame around it. \newcommand*{\quote}[1]{\def\@quote{#1}} -% makes the cv title -% usage: \maketitle -\newcommand*{\maketitle}{}% -\title{}% to avoid LaTeX complaining that \maketitle is a called without first a call to \title +% fonts +\newcommand*{\namefont}{} +\newcommand*{\titlefont}{} +\newcommand*{\addressfont}{} +\newcommand*{\quotefont}{} +\newcommand*{\sectionfont}{} +\newcommand*{\subsectionfont}{} +\newcommand*{\hintfont}{} -% makes the cv footer -% usage: \makefooter -\newcommand*{\makefooter} +% recompute all resume lengths +\newcommand*{\recomputecvlengths}{} -% makes a cv section +% makes the resume title +% usage: \makecvtitle +\newcommand*{\makecvtitle}{}% + +% makes the resume footer +% usage: \makecvfooter +\newcommand*{\makecvfooter}{\makefooter}% + +% makes a resume section % usage: \section{} \newcommand*{\section}[1]{} % starred variant, which is identical but defined to allow its use (e.g. for natbib compatibility, who uses \section*{} for the bibliography header) \RequirePackage{suffix} \AtBeginDocument{\WithSuffix\newcommand\section*{\section}} -% makes a cv subsection +% makes a resume subsection % usage: \subsection{title} \newcommand*{\subsection}[1]{} \AtBeginDocument{\WithSuffix\newcommand\subsection*{\subsection}} -% makes a cv line with a header and a corresponding text +% makes a resume line with a header and a corresponding text % usage: \cvitem[spacing]{header}{text} \newcommand*{\cvitem}[3][.25em]{} -% makes a cv line 2 headers and their corresponding text +% makes a resume line 2 headers and their corresponding text % usage: \cvdoubleitem[spacing]{header1}{text1}{header2}{text2} \newcommand*{\cvdoubleitem}[5][.25em]{} -% makes a cv line with a list item +% makes a resume line with a list item % usage: \cvlistitem[label]{item} \newcommand*{\cvlistitem}[2][\listitemsymbol]{} -% makes a cv line with 2 list items +% makes a resume line with 2 list items % usage: \cvlistdoubleitem[label]{item1}{item2} \newcommand*{\cvlistdoubleitem}[3][\listitemsymbol]{} -% makes a typical cv job / education entry +% makes a typical resume job / education entry % usage: \cventry[spacing]{years}{degree/job title}{institution/employer}{localization}{optionnal: grade/...}{optional: comment/job description} \newcommand*{\cventry}[7][.25em]{} -% makes a cv entry with a proficiency comment +% makes a resume entry with a proficiency comment % usage: \cvitemwithcomment[spacing]{header}{text}{comment} \newcommand*{\cvitemwithcomment}[4][.25em]{} @@ -307,23 +323,8 @@ {\href{mailto:#2}{#2}}% {\href{mailto:#2}{#1}}} -% page numbers in footer if more than 1 page -\newif\if@displaypagenumbers\@displaypagenumberstrue -\newcommand*{\nopagenumbers}{\@displaypagenumbersfalse} -\AtEndPreamble{% - \AtBeginDocument{% - \if@displaypagenumbers% - \@ifundefined{r@lastpage}{}{% - \ifthenelse{\pageref{lastpage}>1}{% - \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) - \pagestyle{plain}}{}}% - \AtEndDocument{\label{lastpage}}\else\fi}} - % thebibliography environment, for use with BibTeX and possibly multibib -\newcommand{\refname}{Publications} +\newcommand*{\refname}{Publications} \newlength{\bibindent} \setlength{\bibindent}{1.5em} % bibliography item label @@ -334,7 +335,7 @@ \AtEndPreamble{\@ifpackageloaded{multibib}{\renewcommand*{\bibliographyhead}[1]{\subsection{#1}}}{}} % thebibliography environment definition \newenvironment{thebibliography}[1]{}{} -\newcommand\newblock{\hskip .11em\@plus.33em\@minus.07em} +\newcommand*{\newblock}{\hskip .11em\@plus.33em\@minus.07em} \let\@openbib@code\@empty % itemize, enumerate and description environment @@ -383,6 +384,32 @@ % \parbox[#1]{\widthofautobox{#2}}{#2}} +%------------------------------------------------------------------------------- +% letter design commands definitions +%------------------------------------------------------------------------------- +% elements +\newcommand*{\recipient}[2]{\def\@recipientname{#1}\def\@recipientaddress{#2}} +\renewcommand*{\date}[1]{\def\@date{#1}} +\newcommand*{\opening}[1]{\def\@opening{#1}} +\newcommand*{\closing}[1]{\def\@closing{#1}} +\newcommand*{\enclosure}[1]{\def\@enclosure{#1}} + +% recompute all letter lengths +\newcommand*{\recomputeletterlengths}{} + +% makes the letter title +% usage: \makelettertitle +\newcommand*{\makelettertitle}{}% + +% makes the letter footer +% usage: \makeletterfooter +\newcommand*{\makeletterfooter}{\makefooter}% + +% makes the letter closing +% usage: \makeletterclosing +\newcommand*{\makeletterclosing}{}% + + \endinput diff --git a/moderncvcolorblack.sty b/moderncvcolorblack.sty index e3c7d5c..5f28ec0 100644 --- a/moderncvcolorblack.sty +++ b/moderncvcolorblack.sty @@ -10,7 +10,7 @@ % identification %------------------------------------------------------------------------------- \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{moderncvcolorblack}[2012/02/06 v0.19 modern curriculum vitae color scheme: black] +\ProvidesPackage{moderncvcolorblack}[2012/02/06 v0.19 modern curriculum vitae and letter color scheme: black] %------------------------------------------------------------------------------- diff --git a/moderncvcolorblue.sty b/moderncvcolorblue.sty index 67e9707..980f2fa 100644 --- a/moderncvcolorblue.sty +++ b/moderncvcolorblue.sty @@ -10,7 +10,7 @@ % identification %------------------------------------------------------------------------------- \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{moderncvcolorblue}[2012/02/06 v0.19 modern curriculum vitae color scheme: blue] +\ProvidesPackage{moderncvcolorblue}[2012/02/06 v0.19 modern curriculum vitae and letter color scheme: blue] %------------------------------------------------------------------------------- diff --git a/moderncvcolorgreen.sty b/moderncvcolorgreen.sty index 847bf62..03af802 100644 --- a/moderncvcolorgreen.sty +++ b/moderncvcolorgreen.sty @@ -10,7 +10,7 @@ % identification %------------------------------------------------------------------------------- \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{moderncvcolorgreen}[2012/02/06 v0.19 modern curriculum vitae color scheme: green] +\ProvidesPackage{moderncvcolorgreen}[2012/02/06 v0.19 modern curriculum vitae and letter color scheme: green] %------------------------------------------------------------------------------- diff --git a/moderncvcolorgrey.sty b/moderncvcolorgrey.sty index 90e9d6e..911b0ee 100644 --- a/moderncvcolorgrey.sty +++ b/moderncvcolorgrey.sty @@ -10,7 +10,7 @@ % identification %------------------------------------------------------------------------------- \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{moderncvcolorgrey}[2012/02/06 v0.19 modern curriculum vitae color scheme: grey] +\ProvidesPackage{moderncvcolorgrey}[2012/02/06 v0.19 modern curriculum vitae and letter color scheme: grey] %------------------------------------------------------------------------------- diff --git a/moderncvcolororange.sty b/moderncvcolororange.sty index 7a46392..1b9400d 100644 --- a/moderncvcolororange.sty +++ b/moderncvcolororange.sty @@ -10,7 +10,7 @@ % identification %------------------------------------------------------------------------------- \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{moderncvcolororange}[2012/02/06 v0.19 modern curriculum vitae color scheme: orange] +\ProvidesPackage{moderncvcolororange}[2012/02/06 v0.19 modern curriculum vitae and letter color scheme: orange] %------------------------------------------------------------------------------- diff --git a/moderncvcolorpurple.sty b/moderncvcolorpurple.sty index 8e761f4..906fc42 100644 --- a/moderncvcolorpurple.sty +++ b/moderncvcolorpurple.sty @@ -10,7 +10,7 @@ % identification %------------------------------------------------------------------------------- \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{moderncvcolorpurple}[2012/02/06 v0.19 modern curriculum vitae color scheme: purple] +\ProvidesPackage{moderncvcolorpurple}[2012/02/06 v0.19 modern curriculum vitae and letter color scheme: purple] %------------------------------------------------------------------------------- diff --git a/moderncvcolorred.sty b/moderncvcolorred.sty index 1516f4f..88749f4 100644 --- a/moderncvcolorred.sty +++ b/moderncvcolorred.sty @@ -10,7 +10,7 @@ % identification %------------------------------------------------------------------------------- \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{moderncvcolorred}[2012/02/06 v0.19 modern curriculum vitae color scheme: red] +\ProvidesPackage{moderncvcolorred}[2012/02/06 v0.19 modern curriculum vitae and letter color scheme: red] %------------------------------------------------------------------------------- diff --git a/moderncvcompatibility.sty b/moderncvcompatibility.sty index 8d19622..0331840 100644 --- a/moderncvcompatibility.sty +++ b/moderncvcompatibility.sty @@ -10,7 +10,7 @@ % identification %------------------------------------------------------------------------------- \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{moderncvcompatibility}[2012/02/06 v0.19 modern curriculum vitae compatibility patches] +\ProvidesPackage{moderncvcompatibility}[2012/02/06 v0.19 modern curriculum vitae and letter compatibility patches] %------------------------------------------------------------------------------- @@ -74,6 +74,11 @@ \moderncvcolor{#1}% \moderncvstyle{#2}} +% compatibility with versions <= 0.19 +\newcommand*{\maketitle}{\makecvtitle}% +\title{}% to avoid LaTeX complaining that \maketitle is a called without first a call to \title + + \endinput diff --git a/moderncvstylebanking.sty b/moderncvstylebanking.sty index e22c47f..1552410 100644 --- a/moderncvstylebanking.sty +++ b/moderncvstylebanking.sty @@ -10,7 +10,7 @@ % identification %------------------------------------------------------------------------------- \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{moderncvstylebanking}[2012/02/06 v0.19 modern curriculum vitae scheme: banking] +\ProvidesPackage{moderncvstylebanking}[2012/02/06 v0.19 modern curriculum vitae and letter style scheme: banking] %------------------------------------------------------------------------------- diff --git a/moderncvstylecasual.sty b/moderncvstylecasual.sty index e4d6a61..4b9b463 100644 --- a/moderncvstylecasual.sty +++ b/moderncvstylecasual.sty @@ -10,7 +10,7 @@ % identification %------------------------------------------------------------------------------- \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{moderncvstylecasual}[2012/02/06 v0.19 modern curriculum vitae style scheme: casual] +\ProvidesPackage{moderncvstylecasual}[2012/02/06 v0.19 modern curriculum vitae and letter style scheme: casual] %------------------------------------------------------------------------------- diff --git a/moderncvstyleclassic.sty b/moderncvstyleclassic.sty index 2ee5989..e623fc6 100644 --- a/moderncvstyleclassic.sty +++ b/moderncvstyleclassic.sty @@ -10,7 +10,7 @@ % identification %------------------------------------------------------------------------------- \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{moderncvstyleclassic}[2012/02/06 v0.19 modern curriculum vitae style scheme: classic] +\ProvidesPackage{moderncvstyleclassic}[2012/02/06 v0.19 modern curriculum vitae and letter style scheme: classic] %------------------------------------------------------------------------------- diff --git a/moderncvstyleoldstyle.sty b/moderncvstyleoldstyle.sty index 9877e45..0e332e0 100644 --- a/moderncvstyleoldstyle.sty +++ b/moderncvstyleoldstyle.sty @@ -10,12 +10,14 @@ % identification %------------------------------------------------------------------------------- \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{moderncvstyleoldstyle}[2012/02/06 v0.19 modern curriculum vitae style: oldstyle] +\ProvidesPackage{moderncvstyleoldstyle}[2012/02/06 v0.19 modern curriculum vitae and letter style scheme: oldstyle] %------------------------------------------------------------------------------- % required packages %------------------------------------------------------------------------------- +% change the layout of the page on the fly, for resume or letter layout +\RequirePackage{changepage} %------------------------------------------------------------------------------- @@ -24,12 +26,27 @@ %------------------------------------------------------------------------------- -% style definition +% overall style definition %------------------------------------------------------------------------------- % fonts \IfFileExists{kurier.sty} {\RequirePackage[light,math]{kurier}} {} + +% symbols +\renewcommand*{\listitemsymbol}{\labelitemi~} +\renewcommand*{\addresssymbol}{} +\renewcommand*{\mobilesymbol}{\textbf{M}~} +\renewcommand*{\phonesymbol}{\textbf{T}~} +\renewcommand*{\faxsymbol}{\textbf{F}~} +\renewcommand*{\emailsymbol}{\textbf{E}~} +\renewcommand*{\homepagesymbol}{} + + +%------------------------------------------------------------------------------- +% resume style definition +%------------------------------------------------------------------------------- +% fonts \renewcommand*{\namefont}{\fontsize{34}{36}\mdseries\upshape} \renewcommand*{\titlefont}{\LARGE\mdseries\slshape} \renewcommand*{\addressfont}{\small\mdseries} @@ -47,16 +64,7 @@ \newcommand*{\subsectionstyle}[1]{{\subsectionfont\textcolor{color1}{#1}}} \newcommand*{\hintstyle}[1]{{\hintfont\textcolor{color0}{#1}}} -% symbols -\renewcommand*{\listitemsymbol}{\labelitemi~} -\renewcommand*{\addresssymbol}{} -\renewcommand*{\mobilesymbol}{\textbf{M}~} -\renewcommand*{\phonesymbol}{\textbf{T}~} -\renewcommand*{\faxsymbol}{\textbf{F}~} -\renewcommand*{\emailsymbol}{\textbf{E}~} -\renewcommand*{\homepagesymbol}{} - -% length used +% lengths \newlength{\quotewidth} \newlength{\hintscolumnwidth} \setlength{\hintscolumnwidth}{0.3\textwidth}% @@ -69,8 +77,8 @@ \newlength{\listitemmaincolumnwidth} \newlength{\listdoubleitemmaincolumnwidth} -% recompute all the lengths that depends on the text width -\renewcommand*{\recomputelengths}{% +% commands +\renewcommand*{\recomputecvlengths}{% \setlength{\quotewidth}{0.65\textwidth}% % main lenghts \setlength{\maincolumnwidth}{\textwidth-\hintscolumnwidth-\separatorcolumnwidth}% @@ -85,27 +93,28 @@ % fancyhdr lengths \renewcommand{\headwidth}{\textwidth}} -\newcommand{\makeinfo}[1]{% - \newbox{\makeinfobox}% - \savebox{\makeinfobox}{\parbox[b]{\hintscolumnwidth}{\if@DEBUG\rule{20cm}{.1pt}\\\fi#1}}% - \newlength{\makeinfoheight}% - \setlength{\makeinfoheight}{\totalheightof{\usebox{\makeinfobox}}}% the total height of the parbox is the sum of its height (\the\ht\makeinfobox) and its depth (\the\dp\makeinfobox); the \totalheightof command is provided by the "calc" package - \usebox{\makeinfobox}\vspace*{-\makeinfoheight}% +\newcommand{\makecvinfo}[1]{% + \newbox{\makecvinfobox}% + \savebox{\makecvinfobox}{\parbox[t]{\hintscolumnwidth}{#1}}% + \newlength{\makecvinfoheight}% + \setlength{\makecvinfoheight}{\totalheightof{\usebox{\makecvinfobox}}}% the total height of the parbox is the sum of its height (\the\ht\makeinfobox) and its depth (\the\dp\makeinfobox); the \totalheightof command is provided by the "calc" package + \usebox{\makecvinfobox}\vspace*{-\makecvinfoheight}% \newlength{\leftcolumnwidth}% - \setlength{\leftcolumnwidth}{\hintscolumnwidth+\separatorcolumnwidth} - \par\nointerlineskip\vspace*{-\parskip}\vspace*{-2.5ex}\leftskip=\leftcolumnwidth\if@DEBUG\rule{20cm}{.1pt}\fi}% the -2.5ex vertical slip is to counter the 2.5ex skip of sections + \setlength{\leftcolumnwidth}{\hintscolumnwidth+\separatorcolumnwidth}% + \par\vspace*{-\baselineskip}\vspace*{-\parskip}\leftskip=\leftcolumnwidth} \newif\if@firstdetailselement\@firstdetailselementtrue -\newcommand*{\maketitledetailsnewline}{ +\newcommand*{\makecvtitledetailsnewline}{ \if@firstdetailselement% + \strut% to ensure baseline alignment with the first section, that also contains a \strut \else% \\[.2em]\fi% \@firstdetailselementfalse% \addressfont\color{color2}} -\renewcommand*{\maketitle}{ +\renewcommand*{\makecvtitle}{ % optional picture box - \newbox{\maketitlepicturebox}% - \savebox{\maketitlepicturebox}{% + \newbox{\makecvtitlepicturebox}% + \savebox{\makecvtitlepicturebox}{% \ifthenelse{\isundefined{\@photo}}% {}% {% @@ -115,28 +124,28 @@ \setlength{\fboxsep}{0pt}\fi% \framebox{\includegraphics[width=\@photowidth]{\@photo}}}}% % name and title - \newlength{\maketitlepicturewidth}\settowidth{\maketitlepicturewidth}{\usebox{\maketitlepicturebox}}% - \newlength{\maketitlenamewidth}\setlength{\maketitlenamewidth}{\textwidth-\maketitlepicturewidth}% - \begin{minipage}[b]{\maketitlenamewidth}% + \newlength{\makecvtitlepicturewidth}\settowidth{\makecvtitlepicturewidth}{\usebox{\makecvtitlepicturebox}}% + \newlength{\makecvtitlenamewidth}\setlength{\makecvtitlenamewidth}{\textwidth-\makecvtitlepicturewidth}% + \begin{minipage}[b]{\makecvtitlenamewidth}% \namestyle{\@firstname\ \@familyname}% \ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\titlestyle{\@title}}% \end{minipage}% % optional photo - \usebox{\maketitlepicturebox}\\[2.5em]% + \usebox{\makecvtitlepicturebox}\\[2.5em]% % optional quote \ifthenelse{\isundefined{\@quote}}% {}% {{\centering\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}\\[2.5em]}}% % optional details - \makeinfo{% - \ifthenelse{\isundefined{\@addressstreet}}{}{\maketitledetailsnewline\addresssymbol\@addressstreet% - \ifthenelse{\equal{\@addresscity}{}}{}{\maketitledetailsnewline\@addresscity}}% if \addresstreet is defined, \addresscity will always be defined but could be empty - \ifthenelse{\isundefined{\@mobile}}{}{\maketitledetailsnewline\mobilesymbol\@mobile}% - \ifthenelse{\isundefined{\@phone}}{}{\maketitledetailsnewline\phonesymbol\@phone}% - \ifthenelse{\isundefined{\@fax}}{}{\maketitledetailsnewline\faxsymbol\@fax}% - \ifthenelse{\isundefined{\@email}}{}{\maketitledetailsnewline\emailsymbol\emaillink{\@email}}% - \ifthenelse{\isundefined{\@homepage}}{}{\maketitledetailsnewline\homepagesymbol\httplink{\@homepage}}% - \ifthenelse{\isundefined{\@extrainfo}}{}{\maketitledetailsnewline\@extrainfo}}} + \makecvinfo{% + \ifthenelse{\isundefined{\@addressstreet}}{}{\makecvtitledetailsnewline\addresssymbol\@addressstreet% + \ifthenelse{\equal{\@addresscity}{}}{}{\makecvtitledetailsnewline\@addresscity}}% if \addresstreet is defined, \addresscity will always be defined but could be empty + \ifthenelse{\isundefined{\@mobile}}{}{\makecvtitledetailsnewline\mobilesymbol\@mobile}% + \ifthenelse{\isundefined{\@phone}}{}{\makecvtitledetailsnewline\phonesymbol\@phone}% + \ifthenelse{\isundefined{\@fax}}{}{\makecvtitledetailsnewline\faxsymbol\@fax}% + \ifthenelse{\isundefined{\@email}}{}{\makecvtitledetailsnewline\emailsymbol\emaillink{\@email}}% + \ifthenelse{\isundefined{\@homepage}}{}{\makecvtitledetailsnewline\homepagesymbol\httplink{\@homepage}}% + \ifthenelse{\isundefined{\@extrainfo}}{}{\makecvtitledetailsnewline\@extrainfo}}} \renewcommand*{\section}[1]{% \par\addvspace{2.5ex}% @@ -236,6 +245,58 @@ } +%------------------------------------------------------------------------------- +% letter style definition +%------------------------------------------------------------------------------- +% commands +\newlength{\textwidthdelta}% +\renewcommand*{\recomputeletterlengths}{% + \recomputecvlengths{}% + \setlength{\parskip}{6\p@}% + \leftskip=0pt% + \setlength{\textwidthdelta}{+\marginparwidth+\marginparsep}% + \setlength{\marginparwidth}{\hintscolumnwidth}% + \setlength{\marginparsep}{2\separatorcolumnwidth}% + \addtolength{\textwidthdelta}{-\marginparwidth-\marginparsep}% +% \changepage{}{\textwidthdelta}{-\textwidthdelta}{}{}{}{}{}{}%\changepage{<textheight>}{<textwidth>}{<evensidemargin>}{<oddsidemargin>}{<columnsep>}{<topmargin>}{<headheight>}{<headsep>}{<footskip>} + \changepage{}{-\marginparwidth-\marginparsep}{}{}{}{}{}{}{}%\changepage{<textheight>}{<textwidth>}{<evensidemargin>}{<oddsidemargin>}{<columnsep>}{<topmargin>}{<headheight>}{<headsep>}{<footskip>} + } + +\renewcommand*{\makelettertitle}{ + \recomputeletterlengths{}% + % recipient block + {\bfseries \@recipientname}\\% + \upshape \@recipientaddress\\[1em]% + % date + \@date\\[2em]% + % opening + \@opening\\[1.5em]% + % sender contact info + \hspace{0pt}% + \marginpar{% + \addressfont\textcolor{color2}{% + {\bfseries \@firstname~\@familyname}\@firstdetailselementfalse% + \ifthenelse{\isundefined{\@addressstreet}}{}{\makecvtitledetailsnewline\addresssymbol\@addressstreet% + \ifthenelse{\equal{\@addresscity}{}}{}{\makecvtitledetailsnewline\@addresscity}}% + \ifthenelse{\isundefined{\@mobile}}{}{\makecvtitledetailsnewline\mobilesymbol\@mobile}% + \ifthenelse{\isundefined{\@phone}}{}{\makecvtitledetailsnewline\phonesymbol\@phone}% + \ifthenelse{\isundefined{\@fax}}{}{\makecvtitledetailsnewline\faxsymbol\@fax}% + \ifthenelse{\isundefined{\@email}}{}{\makecvtitledetailsnewline\emailsymbol\emaillink{\@email}}% + \ifthenelse{\isundefined{\@homepage}}{}{\makecvtitledetailsnewline\homepagesymbol\httplink{\@homepage}}% + \ifthenelse{\isundefined{\@extrainfo}}{}{\makecvtitledetailsnewline\@extrainfo}}}% + % ensure no extra spacing after \makelettertitle due to a possible blank line +% \ignorespacesafterend% not working + \par\vspace*{-\baselineskip}\vspace*{-\parskip}} + +\renewcommand*{\makeletterclosing}{ + \@closing\\[3em] + {\bfseries \@firstname~\@familyname}% + \ifthenelse{\isundefined{\@enclosure}}{}{% + \\% + \vfill% + {\color{color2}\itshape Enclosure: \@enclosure}}} + + \endinput