default/moderncv.cls
changeset 0 9784821a1c6f
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/default/moderncv.cls	Sat Jul 03 12:15:48 2010 +0200
     1.3 @@ -0,0 +1,426 @@
     1.4 +%% start of file `moderncv.cls'.
     1.5 +%% Copyright 2006-2008 Xavier Danaux (xdanaux@gmail.com).
     1.6 +%
     1.7 +% This work may be distributed and/or modified under the
     1.8 +% conditions of the LaTeX Project Public License version 1.3c,
     1.9 +% available at http://www.latex-project.org/lppl/.
    1.10 +
    1.11 +
    1.12 +%-------------------------------------------------------------------------------
    1.13 +%                identification
    1.14 +%-------------------------------------------------------------------------------
    1.15 +\NeedsTeXFormat{LaTeX2e}
    1.16 +\ProvidesClass{moderncv}[2008/06/17 v0.7 modern curriculum vitae document class]
    1.17 +
    1.18 +
    1.19 +%-------------------------------------------------------------------------------
    1.20 +%                debugging
    1.21 +%-------------------------------------------------------------------------------
    1.22 +\newif\if@DEBUG\@DEBUGfalse
    1.23 +
    1.24 +
    1.25 +%-------------------------------------------------------------------------------
    1.26 +%                class options
    1.27 +%
    1.28 +% (need to be done before the external package loading, for example because
    1.29 +% we need \paperwidth, \paperheight and \@ptsize to be defined before loading
    1.30 +% geometry and fancyhdr)
    1.31 +%-------------------------------------------------------------------------------
    1.32 +% paper size option
    1.33 +\DeclareOption{a4paper}{
    1.34 +  \setlength\paperheight{297mm}
    1.35 +  \setlength\paperwidth{210mm}}
    1.36 +\DeclareOption{a5paper}{
    1.37 +  \setlength\paperheight{210mm}
    1.38 +  \setlength\paperwidth{148mm}}
    1.39 +\DeclareOption{b5paper}{
    1.40 +  \setlength\paperheight{250mm}
    1.41 +  \setlength\paperwidth{176mm}}
    1.42 +\DeclareOption{letterpaper}{
    1.43 +  \setlength\paperheight{11in}
    1.44 +  \setlength\paperwidth{8.5in}}
    1.45 +\DeclareOption{legalpaper}{
    1.46 +  \setlength\paperheight{14in}
    1.47 +  \setlength\paperwidth{8.5in}}
    1.48 +\DeclareOption{executivepaper}{
    1.49 +  \setlength\paperheight{10.5in}
    1.50 +  \setlength\paperwidth{7.25in}}
    1.51 +\DeclareOption{landscape}{
    1.52 +  \setlength\@tempdima{\paperheight}
    1.53 +  \setlength\paperheight{\paperwidth}
    1.54 +  \setlength\paperwidth{\@tempdima}}
    1.55 +
    1.56 +% font size options
    1.57 +\newcommand\@ptsize{}
    1.58 +\DeclareOption{10pt}{\renewcommand\@ptsize{0}}
    1.59 +\DeclareOption{11pt}{\renewcommand\@ptsize{1}}
    1.60 +\DeclareOption{12pt}{\renewcommand\@ptsize{2}}
    1.61 +
    1.62 +% draft/final option
    1.63 +\DeclareOption{draft}{\setlength\overfullrule{5pt}}
    1.64 +\DeclareOption{final}{\setlength\overfullrule{0pt}}
    1.65 +
    1.66 +% nolmodern option
    1.67 +\newif\if@lmodern\@lmoderntrue
    1.68 +\DeclareOption{nolmodern}{\@lmodernfalse}
    1.69 +
    1.70 +% nocolor option
    1.71 +\newif\if@color\@colortrue
    1.72 +\DeclareOption{nocolor}{\@colorfalse}
    1.73 +
    1.74 +% execute default options
    1.75 +\ExecuteOptions{a4paper,11pt,color,final}
    1.76 +
    1.77 +% process given options
    1.78 +\ProcessOptions\relax
    1.79 +\input{size1\@ptsize.clo}
    1.80 +
    1.81 +
    1.82 +%-------------------------------------------------------------------------------
    1.83 +%                required packages
    1.84 +%-------------------------------------------------------------------------------
    1.85 +% ifthen package
    1.86 +\RequirePackage{ifthen}
    1.87 +
    1.88 +% ifpdf package
    1.89 +\RequirePackage{ifpdf}
    1.90 +
    1.91 +% color package
    1.92 +\ifpdf
    1.93 +  \RequirePackage[pdftex]{color}
    1.94 +\else
    1.95 +  \RequirePackage[dvips]{color}
    1.96 +\fi
    1.97 +
    1.98 +% fontenc package
    1.99 +\RequirePackage[T1]{fontenc}
   1.100 +
   1.101 +% scalable Computer Modern fonts
   1.102 +%\usepackage{type1cm}
   1.103 +
   1.104 +% latin modern fonts
   1.105 +\AtEndOfClass{%
   1.106 +  \if@lmodern
   1.107 +    \RequirePackage{lmodern}\fi}
   1.108 +
   1.109 +% symbols like \Telefon, \Mobilefone, \Letter and \Email
   1.110 +\RequirePackage{marvosym}
   1.111 +
   1.112 +% extended characters of T1 in .ps + other guillemets
   1.113 +%\RequirePackage{ae,aecompl,aeguill}
   1.114 +
   1.115 +% page geometry
   1.116 +\addtolength{\oddsidemargin}{-54pt}
   1.117 +\addtolength{\textwidth}{109pt}
   1.118 +\addtolength{\topmargin}{-70pt}
   1.119 +\addtolength{\textheight}{122pt}
   1.120 +\addtolength{\marginparsep}{-5pt}
   1.121 +\addtolength{\marginparwidth}{-10pt}
   1.122 +
   1.123 +% hyperrefs
   1.124 +\RequirePackage{url}
   1.125 +\ifpdf
   1.126 +  \RequirePackage[pdftex,]{hyperref}
   1.127 +\else
   1.128 +  \RequirePackage[dvips]{hyperref}\fi
   1.129 +\hypersetup{%
   1.130 +  breaklinks,
   1.131 +  baseurl       = http://,%
   1.132 +  pdfborder     = 0 0 0,%
   1.133 +  pdfpagemode   = UseNone,%
   1.134 +%  pdfstartview  = XYZ,%
   1.135 +  pdfstartpage  = 1,%
   1.136 +  pdfcreator    = \LaTeX{} with `moderncv' package,%
   1.137 +  pdfproducer   = \LaTeX}
   1.138 +\AtEndOfClass{%
   1.139 +  \AtBeginDocument{%
   1.140 +    \hypersetup{%
   1.141 +      pdfauthor     = \@firstname~\@familyname,%
   1.142 +      pdftitle      = \@title,%
   1.143 +      pdfsubject    = \@firstname~\@familyname,%
   1.144 +      pdfkeywords   = \@firstname~\@familyname{} curriculum vit\ae{}}}}
   1.145 +\urlstyle{tt}
   1.146 +
   1.147 +% graphics
   1.148 +\ifpdf
   1.149 +  \RequirePackage[pdftex]{graphicx}
   1.150 +\else
   1.151 +  \RequirePackage[dvips]{graphicx}\fi
   1.152 +
   1.153 +% headers and footers
   1.154 +\usepackage{fancyhdr}
   1.155 +\fancypagestyle{plain}{%
   1.156 +  \renewcommand{\headrulewidth}{0pt}
   1.157 +  \renewcommand{\footrulewidth}{0pt}
   1.158 +  \fancyhf{}}
   1.159 +\pagestyle{plain}
   1.160 +
   1.161 +% compatibility package with older versions of moderncv
   1.162 +\RequirePackageWithOptions{moderncvcompatibility}
   1.163 +
   1.164 +
   1.165 +%-------------------------------------------------------------------------------
   1.166 +%                class definition
   1.167 +%-------------------------------------------------------------------------------
   1.168 +% minimal base settings
   1.169 +\setlength\lineskip{1\p@}
   1.170 +\setlength\normallineskip{1\p@}
   1.171 +\renewcommand\baselinestretch{}
   1.172 +\setlength{\parindent}{0pt}
   1.173 +\setlength{\parskip}{0pt}
   1.174 +\setlength\columnsep{10\p@}
   1.175 +\setlength\columnseprule{0\p@}
   1.176 +\pagestyle{empty}
   1.177 +\pagenumbering{arabic}
   1.178 +\raggedbottom
   1.179 +\onecolumn
   1.180 +
   1.181 +
   1.182 +%-------------------------------------------------------------------------------
   1.183 +%                style commands definitions
   1.184 +%-------------------------------------------------------------------------------
   1.185 +% symbols used 
   1.186 +\providecommand*{\listitemsymbol}{\textbullet}
   1.187 +\providecommand*{\addresssymbol}{}
   1.188 +\providecommand*{\mobilesymbol}{\Mobilefone}
   1.189 +\providecommand*{\phonesymbol}{\Telefon}
   1.190 +\providecommand*{\faxsymbol}{\FAX}
   1.191 +\providecommand*{\emailsymbol}{\Letter}
   1.192 +
   1.193 +% colors
   1.194 +\definecolor{firstnamecolor}{rgb}{0,0,0}
   1.195 +\definecolor{familynamecolor}{rgb}{0,0,0}
   1.196 +\definecolor{titlecolor}{rgb}{0,0,0}
   1.197 +\definecolor{addresscolor}{rgb}{0,0,0}
   1.198 +\definecolor{quotecolor}{rgb}{0,0,0}
   1.199 +\definecolor{sectionrectanglecolor}{rgb}{0,0,0}
   1.200 +\definecolor{sectiontitlecolor}{rgb}{0,0,0}
   1.201 +\definecolor{subsectioncolor}{rgb}{0,0,0}
   1.202 +\definecolor{hintcolor}{rgb}{0,0,0}
   1.203 +
   1.204 +% fonts
   1.205 +\providecommand*{\firstnamefont}{}
   1.206 +\providecommand*{\familynamefont}{}
   1.207 +\providecommand*{\titlefont}{}
   1.208 +\providecommand*{\addressfont}{}
   1.209 +\providecommand*{\quotefont}{}
   1.210 +\providecommand*{\sectionfont}{}
   1.211 +\providecommand*{\subsectionfont}{}
   1.212 +\providecommand*{\hintfont}{\small\sffamily}
   1.213 +
   1.214 +% styles
   1.215 +\providecommand*{\firstnamestyle}[1]{{\firstnamefont\color{firstnamecolor}#1}}
   1.216 +\providecommand*{\familynamestyle}[1]{{\familynamefont\color{familynamecolor}#1}}
   1.217 +\providecommand*{\titlestyle}[1]{{\titlefont\color{titlecolor}#1}}
   1.218 +\providecommand*{\addresstyle}[1]{{\addressfont\color{addresscolor}#1}}
   1.219 +\providecommand*{\quotestyle}[1]{{\quotefont\color{quotecolor}#1}}
   1.220 +\providecommand*{\sectionstyle}[1]{{\sectionfont\color{sectiontitlecolor}#1}}
   1.221 +\providecommand*{\subsectionstyle}[1]{{\subsectionfont\color{subsectioncolor}#1}}
   1.222 +\providecommand*{\hintstyle}[1]{{\hintfont\color{hintcolor}#1}}
   1.223 +
   1.224 +% themes: casual (default), classic, ...
   1.225 +\newcommand*{\moderncvtheme}[2][]{
   1.226 +  \def\@moderncvtheme{#2}
   1.227 +  \def\@moderncvthemeoptions{#1}}
   1.228 +\moderncvtheme{casual}   % default theme
   1.229 +\AtBeginDocument{\RequirePackage[\@moderncvthemeoptions]{moderncvtheme\@moderncvtheme}}
   1.230 +
   1.231 +
   1.232 +%-------------------------------------------------------------------------------
   1.233 +%                structure commands definitions
   1.234 +%-------------------------------------------------------------------------------
   1.235 +\newcommand*{\firstname}[1]{\def\@firstname{#1}}
   1.236 +\newcommand*{\familyname}[1]{\def\@familyname{#1}}
   1.237 +\renewcommand*{\title}[1]{\def\@title{#1}}
   1.238 +\newcommand*{\address}[2]{\def\@addressstreet{#1}\def\@addresscity{#2}}
   1.239 +\newcommand*{\mobile}[1]{\def\@mobile{#1}}
   1.240 +\newcommand*{\phone}[1]{\def\@phone{#1}}
   1.241 +\renewcommand*{\fax}[1]{\def\@fax{#1}}
   1.242 +\newcommand*{\email}[1]{\def\@email{#1}}
   1.243 +\newcommand*{\extrainfo}[1]{\def\@extrainfo{#1}}
   1.244 +\def\@photowidth{0pt}
   1.245 +\newcommand*{\photo}[2][64pt]{\def\@photowidth{#1}\def\@photo{#2}}
   1.246 +\newcommand*{\quote}[1]{\def\@quote{#1}}
   1.247 +
   1.248 +% length used by the moderncv layout
   1.249 +% quote length
   1.250 +\newlength{\quotewidth}
   1.251 +% section lengths
   1.252 +\newlength{\hintscolumnwidth}
   1.253 +\newlength{\separatorcolumnwidth}
   1.254 +\setlength{\separatorcolumnwidth}{0.025\textwidth}
   1.255 +\newlength{\maincolumnwidth}
   1.256 +% doubleitem lengths
   1.257 +\newlength{\doubleitemmaincolumnwidth}
   1.258 +% listitem lengths
   1.259 +\newlength{\listitemsymbolwidth}
   1.260 +\settowidth{\listitemsymbolwidth}{\listitemsymbol{}~}
   1.261 +\newlength{\listitemmaincolumnwidth}
   1.262 +% listdoubleitem lengths
   1.263 +\newlength{\listdoubleitemmaincolumnwidth}
   1.264 +% recompute all the lengths that depends on the text width
   1.265 +\newcommand*{\recomputethemelengths}{}
   1.266 +\newcommand*{\recomputelengths}{%
   1.267 +  \setlength{\quotewidth}{0.65\textwidth}%
   1.268 +  % main lenghts
   1.269 +  \setlength{\maincolumnwidth}{\textwidth}%
   1.270 +  \addtolength{\maincolumnwidth}{-\separatorcolumnwidth}%
   1.271 +  \addtolength{\maincolumnwidth}{-\hintscolumnwidth}%
   1.272 +  % listitem lengths
   1.273 +  \setlength{\listitemmaincolumnwidth}{\maincolumnwidth}%
   1.274 +  \addtolength{\listitemmaincolumnwidth}{-\listitemsymbolwidth}%
   1.275 +  % doubleitem lengths
   1.276 +  \setlength{\doubleitemmaincolumnwidth}{\maincolumnwidth}%
   1.277 +  \addtolength{\doubleitemmaincolumnwidth}{-\hintscolumnwidth}%
   1.278 +  \addtolength{\doubleitemmaincolumnwidth}{-\separatorcolumnwidth}%
   1.279 +  \setlength{\doubleitemmaincolumnwidth}{0.5\doubleitemmaincolumnwidth}%
   1.280 +  % listdoubleitem lengths
   1.281 +  \setlength{\listdoubleitemmaincolumnwidth}{\maincolumnwidth}%
   1.282 +  \addtolength{\listdoubleitemmaincolumnwidth}{-\listitemsymbolwidth}%
   1.283 +  \setlength{\listdoubleitemmaincolumnwidth}{0.475\listdoubleitemmaincolumnwidth}%
   1.284 +  % fancyhdr lengths
   1.285 +  \renewcommand{\headwidth}{\textwidth}%
   1.286 +  \recomputethemelengths}
   1.287 +\setlength{\hintscolumnwidth}{0.15\textwidth}
   1.288 +\recomputelengths
   1.289 +
   1.290 +% makes the cv title
   1.291 +\title{}% to avoid LaTeX complaining that \maketitle is a called without first a call to \title
   1.292 +\renewcommand*{\maketitle}{}%
   1.293 +
   1.294 +% draws a colored rectangle
   1.295 +% usage: \colorrule[optional height]{width}
   1.296 +%\newcommand*{\colorrule}[2][1ex]{{\color{sectionrectanglecolor}{\rule{#2}{#1}}}}
   1.297 +
   1.298 +% usage: \section{<title>}
   1.299 +\newcommand*{\section}[1]{%
   1.300 +	\vspace*{2.5ex \@plus 1ex \@minus .2ex}%
   1.301 +  \phantomsection{}% reset the anchor for hyperrefs
   1.302 +  \addcontentsline{toc}{part}{#1}%
   1.303 +  \parbox[m]{\hintscolumnwidth}{\raggedleft\hintfont{\color{sectionrectanglecolor}\rule{\hintscolumnwidth}{1ex}}}%
   1.304 +  \hspace{\separatorcolumnwidth}%
   1.305 +  \parbox[m]{\maincolumnwidth}{\sectionstyle{#1}}\\[1ex]}
   1.306 +%  \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
   1.307 +
   1.308 +% usage: \subsection{title}
   1.309 +\newcommand*{\subsection}[1]{%
   1.310 +  \cvline[0.45em]{}{\subsectionstyle{#1}}}
   1.311 +
   1.312 +% usage: \cvline{margintext}{linetext}
   1.313 +\newcommand*{\cvline}[3][.25em]{%
   1.314 +  \begin{tabular}{@{}p{\hintscolumnwidth}@{\hspace{\separatorcolumnwidth}}p{\maincolumnwidth}@{}}%
   1.315 + 	  \raggedleft\hintfont{#2} &{#3}%
   1.316 +  \end{tabular}\\[#1]}
   1.317 +
   1.318 +% usage: \cvdoubleitem{subtitle}{text}{subtitle}{text}
   1.319 +\newcommand*{\cvdoubleitem}[4]{%
   1.320 + \cvline{#1}{\begin{minipage}[t]{\doubleitemmaincolumnwidth}#2\end{minipage}%
   1.321 + \hfill%
   1.322 + \begin{minipage}[t]{\hintscolumnwidth}\raggedleft\hintfont{#3}\end{minipage}\hspace*{\separatorcolumnwidth}\begin{minipage}[t]{\doubleitemmaincolumnwidth}#4\end{minipage}}}
   1.323 +
   1.324 +% usage: \cvlistitem[symbol]{point1}
   1.325 +\newcommand*{\cvlistitem}[2][\listitemsymbol{}]{%
   1.326 +  \cvline[0pt]{}{#1~\begin{minipage}[t]{\listitemmaincolumnwidth}#2\end{minipage}}}
   1.327 +
   1.328 +% usage: \cvlistdoubleitem[symbol]{point1}{point2}
   1.329 +\newcommand*{\cvlistdoubleitem}[3][\listitemsymbol{}]{%
   1.330 +  \cvline[0pt]{}{#1~\begin{minipage}[t]{\listdoubleitemmaincolumnwidth}#2\end{minipage}%
   1.331 +  \hfill%
   1.332 +  \ifthenelse{\equal{#3}{}}%
   1.333 +    {}%
   1.334 +    {#1~\begin{minipage}[t]{\listdoubleitemmaincolumnwidth}#3\end{minipage}}}}
   1.335 +
   1.336 +% usage: \cventry{years}{degree/job title}{institution/employer}{localization}{optionnal: grade/...}{optional: comment/job description}
   1.337 +\newcommand*{\cventry}[6]{%
   1.338 +  \cvline{#1}{%
   1.339 +    {\bfseries#2}%
   1.340 +    \ifx#3\else{, {\slshape#3}}\fi%
   1.341 +    \ifx#4\else{, #4}\fi%
   1.342 +    \ifx#5\else{, #5}\fi%
   1.343 +    .%
   1.344 +    \ifx#6\else{\newline{}\begin{minipage}[t]{\linewidth}\small#6\end{minipage}}\fi
   1.345 +    }}%
   1.346 +
   1.347 +% usage (inside 'language' cvsection environment): \cvlanguage{name}{level}{comment}
   1.348 +\newcommand*{\cvlanguage}[3]{%
   1.349 +  \cvline{#1}{\begin{minipage}[t]{.225\maincolumnwidth}\textbf{#2}\end{minipage}\hfill\begin{minipage}[t]{0.725\maincolumnwidth}\raggedleft\footnotesize\itshape #3\end{minipage}}}
   1.350 +
   1.351 +% usage (inside 'computer skills' cvsection environment): \cvcomputer{category}{programs}{category}{programs}
   1.352 +\newcommand*{\cvcomputer}[4]{%
   1.353 +  \cvdoubleitem{#1}{\small#2}{#3}{\small#4}}
   1.354 +
   1.355 +% usage: \link[optional text]{link}
   1.356 +\newcommand*{\link}[2][]{%
   1.357 +  \ifthenelse{\equal{#1}{}}%
   1.358 +    {\href{#2}{#2}}%
   1.359 +    {\href{#2}{#1}}}
   1.360 +
   1.361 +% usage: \httplink[optional text]{link}
   1.362 +\newcommand*{\httplink}[2][]{%
   1.363 +  \ifthenelse{\equal{#1}{}}%
   1.364 +    {\href{http://#2}{#2}}%
   1.365 +    {\href{http://#2}{#1}}}
   1.366 +
   1.367 +% usage: \emaillink[optional text]{link}
   1.368 +\newcommand*{\emaillink}[2][]{%
   1.369 +  \ifthenelse{\equal{#1}{}}%
   1.370 +    {\href{mailto:#2}{#2}}%
   1.371 +    {\href{mailto:#2}{#1}}}
   1.372 +
   1.373 +% usage: \nopagenumbers{}
   1.374 +\newif\if@displaypagenumbers\@displaypagenumberstrue
   1.375 +\newcommand*{\nopagenumbers}{\@displaypagenumbersfalse}
   1.376 +\AtBeginDocument{%
   1.377 +  \if@displaypagenumbers%
   1.378 +    \@ifundefined{r@lastpage}{}{%
   1.379 +      \ifthenelse{\pageref{lastpage} > 1}{%
   1.380 +      \fancypagestyle{plain}{%
   1.381 +        \fancyfoot[r]{\addressfont\color{quotecolor}\footnotesize\thepage/\pageref{lastpage}}}%
   1.382 +      \pagestyle{plain}}{}}%
   1.383 +  \AtEndDocument{\label{lastpage}}%
   1.384 +  \fi}
   1.385 +
   1.386 +% thebibliography environment, for use with BibTeX
   1.387 +\newcommand{\refname}{Publications}
   1.388 +\newlength{\bibindent}
   1.389 +\setlength{\bibindent}{1.5em}
   1.390 +% bibliography item label
   1.391 +\newcommand*{\bibliographyitemlabel}{}% use \@biblabel{\arabic{enumiv}} for BibTeX labels
   1.392 +\newenvironment{thebibliography}[1]%
   1.393 +  {%
   1.394 +    \section{\refname}%
   1.395 +%    \vspace*{-0.65em}%
   1.396 +    \small%
   1.397 +    \begin{list}{\bibliographyitemlabel}%
   1.398 +      {%
   1.399 +        \setlength{\topsep}{0pt}%
   1.400 +        \setlength{\labelwidth}{\hintscolumnwidth}%
   1.401 +        \setlength{\labelsep}{\separatorcolumnwidth}%
   1.402 +        \leftmargin\labelwidth%
   1.403 +        \advance\leftmargin\labelsep%
   1.404 +        \@openbib@code%
   1.405 +        \usecounter{enumiv}%
   1.406 +        \let\p@enumiv\@empty%
   1.407 +        \renewcommand\theenumiv{\@arabic\c@enumiv}}%
   1.408 +        \sloppy\clubpenalty4000\widowpenalty4000%
   1.409 +%        \sfcode`\.\@m%
   1.410 +%        \sfcode `\=1000\relax%
   1.411 +  }%
   1.412 +  {%
   1.413 +    \def\@noitemerr{\@latex@warning{Empty `thebibliography' environment}}%
   1.414 +    \end{list}%
   1.415 +  }
   1.416 +\newcommand\newblock{\hskip .11em\@plus.33em\@minus.07em}
   1.417 +\let\@openbib@code\@empty
   1.418 +
   1.419 +% the classical \today definition
   1.420 +\def\today{\ifcase\month\or
   1.421 +  January\or February\or March\or April\or May\or June\or
   1.422 +  July\or August\or September\or October\or November\or December\fi
   1.423 +  \space\number\day, \number\year}
   1.424 +
   1.425 +
   1.426 +\endinput
   1.427 +
   1.428 +
   1.429 +%% end of file `moderncv.cls'.