123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205 |
- %% start of file `moderncvheadii.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{moderncvheadii}[2015/07/28 v2.0.0 modern curriculum vitae and letter header variant: 2]
- % details options: "details" or "nodetails" (default)
- \@initializeif{\if@details}\@detailsfalse
- \DeclareOption{details}{\@detailstrue}
- \DeclareOption{nodetails}{\@detailsfalse}
- % name design options: "alternate" (lowercase names & title, no spacing)
- \@initializeif{\if@alternate}\@alternatefalse
- \DeclareOption{alternate}{\@alternatetrue}
- % left/right options: "left" or "right" (default)
- \@initializeif{\if@left} \@leftfalse
- \DeclareOption{left} {\@lefttrue\@rightfalse}
- \@initializeif{\if@right}\@rightfalse
- \DeclareOption{right} {\@leftfalse\@righttrue}
- \DeclareOption*{}% avoid choking on unknown options
- \ExecuteOptions{nodetails,right}
- \ProcessOptions*\relax% \ProcessOptions* processes the options in the order provided (i.e., with the later ones possibly overriding the former ones), while \ProcessOptions processes them in the order of the package
- %-------------------------------------------------------------------------------
- % required packages
- %-------------------------------------------------------------------------------
- %-------------------------------------------------------------------------------
- % overall head definition
- %-------------------------------------------------------------------------------
- % fonts
- \renewcommand*{\namefont}{\fontsize{38}{40}\mdseries\upshape}
- \renewcommand*{\titlefont}{\LARGE\mdseries\slshape}
- \renewcommand*{\addressfont}{\normalsize\mdseries\slshape}
- \renewcommand*{\quotefont}{\large\slshape}
- % styles
- \renewcommand*{\namestyle}[1]{{\namefont\textcolor{color0}{#1}}}
- \renewcommand*{\titlestyle}[1]{{\titlefont\textcolor{color2}{#1}}}
- \renewcommand*{\addressstyle}[1]{{\addressfont\textcolor{color2}{#1}}}
- \renewcommand*{\quotestyle}[1]{{\quotefont\textcolor{color1}{#1}}}
- % commands
- \@initializecommand{\makeheaddetailssymbol}{%
- {~~~{\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
- % 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{\makeheaddetailsbox}%
- \@initializebox{\makeheaddetailstempbox}%
- \@initializelength{\makeheaddetailswidth}%
- \@initializelength{\makeheaddetailsboxwidth}%
- \@initializeif{\if@firstmakeheaddetailselement}\@firstmakeheaddetailselementtrue%
- % adds an element to the makehead, separated by makeheadsymbol
- % usage: \addtomakehead[makeheadsymbol]{element}
- \newcommand*{\addtomakeheaddetails}[2][\makeheaddetailssymbol]{% TODO: use \@initializecommand, which requires modifying its definition to handle mandatory and optional arguments
- \if@firstmakeheaddetailselement%
- \savebox{\makeheaddetailstempbox}{\usebox{\makeheaddetailsbox}#2}%
- \else%
- \savebox{\makeheaddetailstempbox}{\usebox{\makeheaddetailsbox}#1#2}\fi%
- \settowidth{\makeheaddetailsboxwidth}{\usebox{\makeheaddetailstempbox}}%
- \ifnum\makeheaddetailsboxwidth<\makeheaddetailswidth%
- \savebox{\makeheaddetailsbox}{\usebox{\makeheaddetailstempbox}}%
- \@firstmakeheaddetailselementfalse%
- \else%
- \flushmakeheaddetails\\\null% \null is required as there is no box on the line after \\, so glue such as \hfill (and leaders) disappear; this is in contrast to after \par, where the next line starts with an indent box (even after \noindent)
- \savebox{\makeheaddetailsbox}{#2}%
- \savebox{\makeheaddetailstempbox}{#2}%
- \settowidth{\makeheaddetailsboxwidth}{\usebox{\makeheaddetailsbox}}%
- \@firstmakeheaddetailselementfalse\fi}
- % internal command to flush the makehead
- \@initializecommand{\flushmakeheaddetails}{%
- \if@right\hfill\fi%
- \strut\usebox{\makeheaddetailsbox}%
- \savebox{\makeheaddetailsbox}{}%
- \savebox{\makeheaddetailstempbox}{}%
- \setlength{\makeheaddetailsboxwidth}{0pt}}
- %-------------------------------------------------------------------------------
- % resume head definition
- %-------------------------------------------------------------------------------
- % lengths
- \@initializelength{\quotewidth}
- % optional makecvheadname width to force a certain width (if set/remains to 0pt, the width is calculated automatically)
- \@initializelength{\makecvheadnamewidth}
- \renewcommand*{\recomputecvheadlengths}{%
- \setlength{\makeheaddetailswidth}{\textwidth}%
- \setlength{\quotewidth}{0.65\textwidth}}
- % commands
- \renewcommand*{\makecvhead}{% TODO: use \@initializecommand, which requires modifying its definition to handle \par
- % recompute lengths (in case we are switching from letter to resume, or vice versa)
- \recomputecvlengths%
- % optional picture (pre-rendering)
- \@initializebox{\makecvheadpicturebox}%
- \savebox{\makecvheadpicturebox}{%
- \ifthenelse{\isundefined{\@photo}}%
- {}%
- {%
- \setlength\fboxrule{\@photoframewidth}%
- \ifdim\@photoframewidth=0pt%
- \setlength{\fboxsep}{0pt}\fi%
- {\color{color1}\framebox{\includegraphics[width=\@photowidth]{\@photo}}}}}%
- % name (pre-rendering)
- \@initializelength{\makecvheadpicturewidth}%
- \settowidth{\makecvheadpicturewidth}{\usebox{\makecvheadpicturebox}}%
- \@initializebox{\makecvheadnamebox}%
- \savebox{\makecvheadnamebox}{%
- \parbox[b]{\textwidth-\makecvheadpicturewidth}{%
- \if@left\raggedright\fi%
- \if@right\raggedleft\fi%
- \namefont%
- \if@alternate% alternate design: first- and lastname in lowercase with no space in between (distinction is made by color difference)
- {\color{color2!50}\MakeLowercase\@firstname}{\color{color2}\MakeLowercase\@lastname}%
- \else% default design: first- and lastname as given with a space in between
- {\color{color2!50}\@firstname} {\color{color2}\@lastname}\fi}}%
- % rendering
- \if@left%
- \usebox{\makecvheadnamebox}%
- \usebox{\makecvheadpicturebox}\fi
- \if@right%
- \usebox{\makecvheadpicturebox}%
- \usebox{\makecvheadnamebox}\fi\\[-.35em]%
- {\color{color2!50}\rule{\textwidth}{.25ex}}%
- % optional detailed information
- \if@details{%
- \\\null%
- \addressfont\color{color2}%
- \ifthenelse{\isundefined{\@addressstreet}}{}{\addtomakeheaddetails{\addresssymbol\@addressstreet}%
- \ifthenelse{\equal{\@addresscity}{}}{}{\addtomakeheaddetails[~--~]{\@addresscity}}% if \addresstreet is defined, \addresscity and \addresscountry will always be defined but could be empty
- \ifthenelse{\equal{\@addresscountry}{}}{}{\addtomakeheaddetails[~--~]{\@addresscountry}}%
- \flushmakeheaddetails\@firstmakeheaddetailselementtrue\\\null}%
- \collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
- \addtomakeheaddetails{\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}}%
- \ifthenelse{\isundefined{\@email}}{}{\addtomakeheaddetails{\emailsymbol\emaillink{\@email}}}%
- \ifthenelse{\isundefined{\@homepage}}{}{\addtomakeheaddetails{\homepagesymbol\httplink{\@homepage}}}%
- \collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
- \addtomakeheaddetails{\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}}%
- \ifthenelse{\isundefined{\@extrainfo}}{}{\addtomakeheaddetails{\@extrainfo}}%
- \flushmakeheaddetails}\fi% need to force a \par after this to avoid weird spacing bug at the first section if no blank line is left after \makehead
- % optional title
- \ifthenelse{\equal{\@title}{}}{}{%
- \\[1.25em]\null% \null is required as there is no box on the line after \\, so glue such as \hfill (and leaders) disappear; this is in contrast to after \par, where the next line starts with an indent box (even after \noindent)
- \if@right\hfill\fi%
- \if@alternate%
- \titlestyle{\MakeLowercase\@title}%
- \else%
- \titlestyle{\@title}\fi%
- }\\[2.5em]%
- % optional quote
- \ifthenelse{\isundefined{\@quote}}%
- {}%
- {{\null\hfill%
- \begin{minipage}{\quotewidth}%
- \centering%
- \quotestyle{\@quote}%
- \end{minipage}\hfill\null\\[2.5em]}}%
- \par}% to avoid weird spacing bug at the first section if no blank line is left after \maketitle
- %-------------------------------------------------------------------------------
- % letter head definition
- %-------------------------------------------------------------------------------
- % lengths
- %\renewcommand*{\recomputeletterheadlengths}{}
- % commands
- \renewcommand*{\makeletterhead}{%
- % recompute lengths (in case we are switching from letter to resume, or vice versa)
- \recomputeletterlengths%
- % recipient block
- \begin{minipage}[t]{.5\textwidth}
- \raggedright%
- \addressfont%
- {\bfseries\upshape\@recipientname}\\%
- \@recipientaddress%
- \end{minipage}
- % date
- \hfill% US style
- % \\[1em]% UK style
- \@date\\[2em]% US informal style: "January 1, 1900"; UK formal style: "01/01/1900"
- % 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}}
- \endinput
- %% end of file `moderncvheadii.sty'.
|