Added modern.
1 %% start of file `moderncv.cls'.
2 %% Copyright 2006-2008 Xavier Danaux (xdanaux@gmail.com).
4 % This work may be distributed and/or modified under the
5 % conditions of the LaTeX Project Public License version 1.3c,
6 % available at http://www.latex-project.org/lppl/.
9 %-------------------------------------------------------------------------------
11 %-------------------------------------------------------------------------------
12 \NeedsTeXFormat{LaTeX2e}
13 \ProvidesClass{moderncv}[2008/06/17 v0.7 modern curriculum vitae document class]
16 %-------------------------------------------------------------------------------
18 %-------------------------------------------------------------------------------
19 \newif\if@DEBUG\@DEBUGfalse
22 %-------------------------------------------------------------------------------
25 % (need to be done before the external package loading, for example because
26 % we need \paperwidth, \paperheight and \@ptsize to be defined before loading
27 % geometry and fancyhdr)
28 %-------------------------------------------------------------------------------
30 \DeclareOption{a4paper}{
31 \setlength\paperheight{297mm}
32 \setlength\paperwidth{210mm}}
33 \DeclareOption{a5paper}{
34 \setlength\paperheight{210mm}
35 \setlength\paperwidth{148mm}}
36 \DeclareOption{b5paper}{
37 \setlength\paperheight{250mm}
38 \setlength\paperwidth{176mm}}
39 \DeclareOption{letterpaper}{
40 \setlength\paperheight{11in}
41 \setlength\paperwidth{8.5in}}
42 \DeclareOption{legalpaper}{
43 \setlength\paperheight{14in}
44 \setlength\paperwidth{8.5in}}
45 \DeclareOption{executivepaper}{
46 \setlength\paperheight{10.5in}
47 \setlength\paperwidth{7.25in}}
48 \DeclareOption{landscape}{
49 \setlength\@tempdima{\paperheight}
50 \setlength\paperheight{\paperwidth}
51 \setlength\paperwidth{\@tempdima}}
55 \DeclareOption{10pt}{\renewcommand\@ptsize{0}}
56 \DeclareOption{11pt}{\renewcommand\@ptsize{1}}
57 \DeclareOption{12pt}{\renewcommand\@ptsize{2}}
60 \DeclareOption{draft}{\setlength\overfullrule{5pt}}
61 \DeclareOption{final}{\setlength\overfullrule{0pt}}
64 \newif\if@lmodern\@lmoderntrue
65 \DeclareOption{nolmodern}{\@lmodernfalse}
68 \newif\if@color\@colortrue
69 \DeclareOption{nocolor}{\@colorfalse}
71 % execute default options
72 \ExecuteOptions{a4paper,11pt,color,final}
74 % process given options
76 \input{size1\@ptsize.clo}
79 %-------------------------------------------------------------------------------
81 %-------------------------------------------------------------------------------
83 \RequirePackage{ifthen}
86 \RequirePackage{ifpdf}
90 \RequirePackage[pdftex]{color}
92 \RequirePackage[dvips]{color}
96 \RequirePackage[T1]{fontenc}
98 % scalable Computer Modern fonts
104 \RequirePackage{lmodern}\fi}
106 % symbols like \Telefon, \Mobilefone, \Letter and \Email
107 \RequirePackage{marvosym}
109 % extended characters of T1 in .ps + other guillemets
110 %\RequirePackage{ae,aecompl,aeguill}
113 \addtolength{\oddsidemargin}{-54pt}
114 \addtolength{\textwidth}{109pt}
115 \addtolength{\topmargin}{-70pt}
116 \addtolength{\textheight}{122pt}
117 \addtolength{\marginparsep}{-5pt}
118 \addtolength{\marginparwidth}{-10pt}
123 \RequirePackage[pdftex,]{hyperref}
125 \RequirePackage[dvips]{hyperref}\fi
130 pdfpagemode = UseNone,%
131 % pdfstartview = XYZ,%
133 pdfcreator = \LaTeX{} with `moderncv' package,%
134 pdfproducer = \LaTeX}
138 pdfauthor = \@firstname~\@familyname,%
140 pdfsubject = \@firstname~\@familyname,%
141 pdfkeywords = \@firstname~\@familyname{} curriculum vit\ae{}}}}
146 \RequirePackage[pdftex]{graphicx}
148 \RequirePackage[dvips]{graphicx}\fi
150 % headers and footers
151 \usepackage{fancyhdr}
152 \fancypagestyle{plain}{%
153 \renewcommand{\headrulewidth}{0pt}
154 \renewcommand{\footrulewidth}{0pt}
158 % compatibility package with older versions of moderncv
159 \RequirePackageWithOptions{moderncvcompatibility}
162 %-------------------------------------------------------------------------------
164 %-------------------------------------------------------------------------------
165 % minimal base settings
166 \setlength\lineskip{1\p@}
167 \setlength\normallineskip{1\p@}
168 \renewcommand\baselinestretch{}
169 \setlength{\parindent}{0pt}
170 \setlength{\parskip}{0pt}
171 \setlength\columnsep{10\p@}
172 \setlength\columnseprule{0\p@}
174 \pagenumbering{arabic}
179 %-------------------------------------------------------------------------------
180 % style commands definitions
181 %-------------------------------------------------------------------------------
183 \providecommand*{\listitemsymbol}{\textbullet}
184 \providecommand*{\addresssymbol}{}
185 \providecommand*{\mobilesymbol}{\Mobilefone}
186 \providecommand*{\phonesymbol}{\Telefon}
187 \providecommand*{\faxsymbol}{\FAX}
188 \providecommand*{\emailsymbol}{\Letter}
191 \definecolor{firstnamecolor}{rgb}{0,0,0}
192 \definecolor{familynamecolor}{rgb}{0,0,0}
193 \definecolor{titlecolor}{rgb}{0,0,0}
194 \definecolor{addresscolor}{rgb}{0,0,0}
195 \definecolor{quotecolor}{rgb}{0,0,0}
196 \definecolor{sectionrectanglecolor}{rgb}{0,0,0}
197 \definecolor{sectiontitlecolor}{rgb}{0,0,0}
198 \definecolor{subsectioncolor}{rgb}{0,0,0}
199 \definecolor{hintcolor}{rgb}{0,0,0}
202 \providecommand*{\firstnamefont}{}
203 \providecommand*{\familynamefont}{}
204 \providecommand*{\titlefont}{}
205 \providecommand*{\addressfont}{}
206 \providecommand*{\quotefont}{}
207 \providecommand*{\sectionfont}{}
208 \providecommand*{\subsectionfont}{}
209 \providecommand*{\hintfont}{\small\sffamily}
212 \providecommand*{\firstnamestyle}[1]{{\firstnamefont\color{firstnamecolor}#1}}
213 \providecommand*{\familynamestyle}[1]{{\familynamefont\color{familynamecolor}#1}}
214 \providecommand*{\titlestyle}[1]{{\titlefont\color{titlecolor}#1}}
215 \providecommand*{\addresstyle}[1]{{\addressfont\color{addresscolor}#1}}
216 \providecommand*{\quotestyle}[1]{{\quotefont\color{quotecolor}#1}}
217 \providecommand*{\sectionstyle}[1]{{\sectionfont\color{sectiontitlecolor}#1}}
218 \providecommand*{\subsectionstyle}[1]{{\subsectionfont\color{subsectioncolor}#1}}
219 \providecommand*{\hintstyle}[1]{{\hintfont\color{hintcolor}#1}}
221 % themes: casual (default), classic, ...
222 \newcommand*{\moderncvtheme}[2][]{
223 \def\@moderncvtheme{#2}
224 \def\@moderncvthemeoptions{#1}}
225 \moderncvtheme{casual} % default theme
226 \AtBeginDocument{\RequirePackage[\@moderncvthemeoptions]{moderncvtheme\@moderncvtheme}}
229 %-------------------------------------------------------------------------------
230 % structure commands definitions
231 %-------------------------------------------------------------------------------
232 \newcommand*{\firstname}[1]{\def\@firstname{#1}}
233 \newcommand*{\familyname}[1]{\def\@familyname{#1}}
234 \renewcommand*{\title}[1]{\def\@title{#1}}
235 \newcommand*{\address}[2]{\def\@addressstreet{#1}\def\@addresscity{#2}}
236 \newcommand*{\mobile}[1]{\def\@mobile{#1}}
237 \newcommand*{\phone}[1]{\def\@phone{#1}}
238 \renewcommand*{\fax}[1]{\def\@fax{#1}}
239 \newcommand*{\email}[1]{\def\@email{#1}}
240 \newcommand*{\extrainfo}[1]{\def\@extrainfo{#1}}
241 \def\@photowidth{0pt}
242 \newcommand*{\photo}[2][64pt]{\def\@photowidth{#1}\def\@photo{#2}}
243 \newcommand*{\quote}[1]{\def\@quote{#1}}
245 % length used by the moderncv layout
247 \newlength{\quotewidth}
249 \newlength{\hintscolumnwidth}
250 \newlength{\separatorcolumnwidth}
251 \setlength{\separatorcolumnwidth}{0.025\textwidth}
252 \newlength{\maincolumnwidth}
254 \newlength{\doubleitemmaincolumnwidth}
256 \newlength{\listitemsymbolwidth}
257 \settowidth{\listitemsymbolwidth}{\listitemsymbol{}~}
258 \newlength{\listitemmaincolumnwidth}
259 % listdoubleitem lengths
260 \newlength{\listdoubleitemmaincolumnwidth}
261 % recompute all the lengths that depends on the text width
262 \newcommand*{\recomputethemelengths}{}
263 \newcommand*{\recomputelengths}{%
264 \setlength{\quotewidth}{0.65\textwidth}%
266 \setlength{\maincolumnwidth}{\textwidth}%
267 \addtolength{\maincolumnwidth}{-\separatorcolumnwidth}%
268 \addtolength{\maincolumnwidth}{-\hintscolumnwidth}%
270 \setlength{\listitemmaincolumnwidth}{\maincolumnwidth}%
271 \addtolength{\listitemmaincolumnwidth}{-\listitemsymbolwidth}%
273 \setlength{\doubleitemmaincolumnwidth}{\maincolumnwidth}%
274 \addtolength{\doubleitemmaincolumnwidth}{-\hintscolumnwidth}%
275 \addtolength{\doubleitemmaincolumnwidth}{-\separatorcolumnwidth}%
276 \setlength{\doubleitemmaincolumnwidth}{0.5\doubleitemmaincolumnwidth}%
277 % listdoubleitem lengths
278 \setlength{\listdoubleitemmaincolumnwidth}{\maincolumnwidth}%
279 \addtolength{\listdoubleitemmaincolumnwidth}{-\listitemsymbolwidth}%
280 \setlength{\listdoubleitemmaincolumnwidth}{0.475\listdoubleitemmaincolumnwidth}%
282 \renewcommand{\headwidth}{\textwidth}%
283 \recomputethemelengths}
284 \setlength{\hintscolumnwidth}{0.15\textwidth}
288 \title{}% to avoid LaTeX complaining that \maketitle is a called without first a call to \title
289 \renewcommand*{\maketitle}{}%
291 % draws a colored rectangle
292 % usage: \colorrule[optional height]{width}
293 %\newcommand*{\colorrule}[2][1ex]{{\color{sectionrectanglecolor}{\rule{#2}{#1}}}}
295 % usage: \section{<title>}
296 \newcommand*{\section}[1]{%
297 \vspace*{2.5ex \@plus 1ex \@minus .2ex}%
298 \phantomsection{}% reset the anchor for hyperrefs
299 \addcontentsline{toc}{part}{#1}%
300 \parbox[m]{\hintscolumnwidth}{\raggedleft\hintfont{\color{sectionrectanglecolor}\rule{\hintscolumnwidth}{1ex}}}%
301 \hspace{\separatorcolumnwidth}%
302 \parbox[m]{\maincolumnwidth}{\sectionstyle{#1}}\\[1ex]}
303 % \cvline[1ex]{\color{sectionrectanglecolor}\rule[0]{\hintscolumnwidth}{1ex}}{\sectionstyle{#1}}}% gives bad alignment of rectangle; too bad m{width} columns seem not to work as a valid column definition for tabular environments
305 % usage: \subsection{title}
306 \newcommand*{\subsection}[1]{%
307 \cvline[0.45em]{}{\subsectionstyle{#1}}}
309 % usage: \cvline{margintext}{linetext}
310 \newcommand*{\cvline}[3][.25em]{%
311 \begin{tabular}{@{}p{\hintscolumnwidth}@{\hspace{\separatorcolumnwidth}}p{\maincolumnwidth}@{}}%
312 \raggedleft\hintfont{#2} &{#3}%
315 % usage: \cvdoubleitem{subtitle}{text}{subtitle}{text}
316 \newcommand*{\cvdoubleitem}[4]{%
317 \cvline{#1}{\begin{minipage}[t]{\doubleitemmaincolumnwidth}#2\end{minipage}%
319 \begin{minipage}[t]{\hintscolumnwidth}\raggedleft\hintfont{#3}\end{minipage}\hspace*{\separatorcolumnwidth}\begin{minipage}[t]{\doubleitemmaincolumnwidth}#4\end{minipage}}}
321 % usage: \cvlistitem[symbol]{point1}
322 \newcommand*{\cvlistitem}[2][\listitemsymbol{}]{%
323 \cvline[0pt]{}{#1~\begin{minipage}[t]{\listitemmaincolumnwidth}#2\end{minipage}}}
325 % usage: \cvlistdoubleitem[symbol]{point1}{point2}
326 \newcommand*{\cvlistdoubleitem}[3][\listitemsymbol{}]{%
327 \cvline[0pt]{}{#1~\begin{minipage}[t]{\listdoubleitemmaincolumnwidth}#2\end{minipage}%
329 \ifthenelse{\equal{#3}{}}%
331 {#1~\begin{minipage}[t]{\listdoubleitemmaincolumnwidth}#3\end{minipage}}}}
333 % usage: \cventry{years}{degree/job title}{institution/employer}{localization}{optionnal: grade/...}{optional: comment/job description}
334 \newcommand*{\cventry}[6]{%
337 \ifx#3\else{, {\slshape#3}}\fi%
338 \ifx#4\else{, #4}\fi%
339 \ifx#5\else{, #5}\fi%
341 \ifx#6\else{\newline{}\begin{minipage}[t]{\linewidth}\small#6\end{minipage}}\fi
344 % usage (inside 'language' cvsection environment): \cvlanguage{name}{level}{comment}
345 \newcommand*{\cvlanguage}[3]{%
346 \cvline{#1}{\begin{minipage}[t]{.225\maincolumnwidth}\textbf{#2}\end{minipage}\hfill\begin{minipage}[t]{0.725\maincolumnwidth}\raggedleft\footnotesize\itshape #3\end{minipage}}}
348 % usage (inside 'computer skills' cvsection environment): \cvcomputer{category}{programs}{category}{programs}
349 \newcommand*{\cvcomputer}[4]{%
350 \cvdoubleitem{#1}{\small#2}{#3}{\small#4}}
352 % usage: \link[optional text]{link}
353 \newcommand*{\link}[2][]{%
354 \ifthenelse{\equal{#1}{}}%
358 % usage: \httplink[optional text]{link}
359 \newcommand*{\httplink}[2][]{%
360 \ifthenelse{\equal{#1}{}}%
361 {\href{http://#2}{#2}}%
362 {\href{http://#2}{#1}}}
364 % usage: \emaillink[optional text]{link}
365 \newcommand*{\emaillink}[2][]{%
366 \ifthenelse{\equal{#1}{}}%
367 {\href{mailto:#2}{#2}}%
368 {\href{mailto:#2}{#1}}}
370 % usage: \nopagenumbers{}
371 \newif\if@displaypagenumbers\@displaypagenumberstrue
372 \newcommand*{\nopagenumbers}{\@displaypagenumbersfalse}
374 \if@displaypagenumbers%
375 \@ifundefined{r@lastpage}{}{%
376 \ifthenelse{\pageref{lastpage} > 1}{%
377 \fancypagestyle{plain}{%
378 \fancyfoot[r]{\addressfont\color{quotecolor}\footnotesize\thepage/\pageref{lastpage}}}%
379 \pagestyle{plain}}{}}%
380 \AtEndDocument{\label{lastpage}}%
383 % thebibliography environment, for use with BibTeX
384 \newcommand{\refname}{Publications}
385 \newlength{\bibindent}
386 \setlength{\bibindent}{1.5em}
387 % bibliography item label
388 \newcommand*{\bibliographyitemlabel}{}% use \@biblabel{\arabic{enumiv}} for BibTeX labels
389 \newenvironment{thebibliography}[1]%
394 \begin{list}{\bibliographyitemlabel}%
396 \setlength{\topsep}{0pt}%
397 \setlength{\labelwidth}{\hintscolumnwidth}%
398 \setlength{\labelsep}{\separatorcolumnwidth}%
399 \leftmargin\labelwidth%
400 \advance\leftmargin\labelsep%
403 \let\p@enumiv\@empty%
404 \renewcommand\theenumiv{\@arabic\c@enumiv}}%
405 \sloppy\clubpenalty4000\widowpenalty4000%
407 % \sfcode `\=1000\relax%
410 \def\@noitemerr{\@latex@warning{Empty `thebibliography' environment}}%
413 \newcommand\newblock{\hskip .11em\@plus.33em\@minus.07em}
414 \let\@openbib@code\@empty
416 % the classical \today definition
417 \def\today{\ifcase\month\or
418 January\or February\or March\or April\or May\or June\or
419 July\or August\or September\or October\or November\or December\fi
420 \space\number\day, \number\year}
426 %% end of file `moderncv.cls'.