-
Notifications
You must be signed in to change notification settings - Fork 0
/
moderncvstylecasual.sty
191 lines (171 loc) · 8.89 KB
/
moderncvstylecasual.sty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
%% start of file `moderncvstylecasual.sty'.
%% Copyright 2006-2012 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{moderncvstylecasual}[2012/10/31 v1.2.0 modern curriculum vitae and letter style scheme: casual]
%-------------------------------------------------------------------------------
% required packages
%-------------------------------------------------------------------------------
%-------------------------------------------------------------------------------
% package options
%-------------------------------------------------------------------------------
\RequirePackage{moderncvstyleclassic}
%-------------------------------------------------------------------------------
% overall style definition
%-------------------------------------------------------------------------------
% commands
% footer symbol used to separate footer elements
\newcommand*{\footersymbol}{%
{~~~{\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
\newsavebox{\footerbox}%
\newsavebox{\footertempbox}%
\newlength{\footerwidth}%
\newlength{\footerboxwidth}%
\newif\if@firstfooterelement\@firstfooterelementtrue%
% adds an element to the footer, separated by footersymbol
% usage: \addtofooter[footersymbol]{element}
\newcommand*{\addtofooter}[2][\footersymbol]{%
\if@firstfooterelement%
\savebox{\footertempbox}{\usebox{\footerbox}#2}%
\else%
\savebox{\footertempbox}{\usebox{\footerbox}#1#2}\fi%
\settowidth{\footerboxwidth}{\usebox{\footertempbox}}%
\ifnum\footerboxwidth<\footerwidth%
\savebox{\footerbox}{\usebox{\footertempbox}}%
\@firstfooterelementfalse%
\else%
\flushfooter\\%
\savebox{\footerbox}{#2}%
\savebox{\footertempbox}{#2}%
\settowidth{\footerboxwidth}{\usebox{\footerbox}}%
\@firstfooterelementfalse\fi}
% internal command to flush the footer
\newcommand*{\flushfooter}{%
\strut\usebox{\footerbox}%
\savebox{\footerbox}{}%
\savebox{\footertempbox}{}%
\setlength{\footerboxwidth}{0pt}}
%-------------------------------------------------------------------------------
% resume style definition
%-------------------------------------------------------------------------------
% fonts
\renewcommand*{\namefont}{\fontsize{38}{40}\mdseries\upshape}
\renewcommand*{\addressfont}{\normalsize\mdseries\slshape}
\renewcommand*{\titlefont}{\fontsize{12}{12}\mdseries\upshape}
% commands
\renewcommand*{\makecvtitle}{%
% recompute lengths (in case we are switching from letter to resume, or vice versa)
\recomputecvlengths%
% ensure footer with personal information
\makecvfooter%
% optional picture
\newbox{\makecvtitlepicturebox}%
\savebox{\makecvtitlepicturebox}{%
\ifthenelse{\isundefined{\@photo}}%
{}%
{%
\setlength\fboxrule{\@photoframewidth}%
\ifdim\@photoframewidth=0pt%
\setlength{\fboxsep}{0pt}\fi%
{\color{color1}\framebox{\includegraphics[width=\@photowidth]{\@photo}}}}}%
\usebox{\makecvtitlepicturebox}%
% name
\@initializelength{\makecvtitlepicturewidth}%
\settowidth{\makecvtitlepicturewidth}{\usebox{\makecvtitlepicturebox}}%
\parbox[b]{\textwidth-\makecvtitlepicturewidth}{%
\raggedleft\namefont{\color{color2!50}\@firstname} {\color{color2}\@familyname}}\\[-.35em]% alternate design: \MakeLowercase and no space
{\color{color2!50}\rule{\textwidth}{.25ex}}%
% optional title
\ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\null\hfill\titlestyle{\@title}}\\[2.5em]% \null is required as there is no box on the line after \\, so glue (and leaders) disappears; this is in contrast to after \par, where the next line starts with an indent box (even after \noindent).
% % optional quote : comment all this part to change the global shape
% \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
\renewcommand*{\makecvfooter}{%
\setlength{\footerwidth}{0.8\textwidth}%
\fancypagestyle{plain}{%
\fancyfoot[c]{%
\parbox[b]{\footerwidth}{%
\centering%
\color{color2}\addressfont%
\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}}%
\ifthenelse{\isundefined{\@phone}}{}{\addtofooter{\phonesymbol\@phone}}%
\ifthenelse{\isundefined{\@fax}}{}{\addtofooter{\faxsymbol\@fax}}%
\ifthenelse{\isundefined{\@email}}{}{\addtofooter{\emailsymbol\emaillink{\@email}}}%
\ifthenelse{\isundefined{\@homepage}}{}{%
\ifthenelse{\equal{\@homepagetitle}{}}% \homepagetitle could be empty
{\addtofooter{\homepagesymbol\httplink{\@homepage}}}%
{\addtofooter{\homepagesymbol\httplink[\@homepagetitle]{\@homepage}}}}%
\ifthenelse{\isundefined{\@extrainfo}}{}{\addtofooter{\@extrainfo}}%
\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}}
%-------------------------------------------------------------------------------
% letter style definition
%-------------------------------------------------------------------------------
\renewcommand*{\makelettertitle}{%
% recompute lengths (in case we are switching from letter to resume, or vice versa)
\recomputeletterlengths%
% ensure footer with personal information
\makeletterfooter%
% 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: "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*{\makeletterfooter}{%
\setlength{\footerwidth}{0.8\textwidth}%
\fancypagestyle{plain}{%
\fancyfoot[c]{%
\parbox[b]{\footerwidth}{%
\centering%
\addressfont\color{color2}%
\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}}%
\ifthenelse{\isundefined{\@phone}}{}{\addtofooter{\phonesymbol\@phone}}%
\ifthenelse{\isundefined{\@fax}}{}{\addtofooter{\faxsymbol\@fax}}%
\ifthenelse{\isundefined{\@email}}{}{\addtofooter{\emailsymbol\emaillink{\@email}}}%
\ifthenelse{\isundefined{\@homepage}}{}{%
\ifthenelse{\equal{\@homepagetitle}{}}% \homepagetitle could be empty
{\addtofooter{\homepagesymbol\httplink{\@homepage}}}%
{\addtofooter{\homepagesymbol\httplink[\@homepagetitle]{\@homepage}}}}%
\ifthenelse{\isundefined{\@extrainfo}}{}{\addtofooter{\@extrainfo}}%
\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}{
\@closing\\[3em]%
{\bfseries\@firstname~\@familyname}%
\ifthenelse{\isundefined{\@enclosure}}{}{%
\\%
\vfil%
{\color{color2}\itshape\enclname: \@enclosure}}%
\vfil}
\endinput
%% end of file `moderncvstylecasual.sty'.