default/moderncv.cls
author Eugen Sawin <sawine@me73.com>
Tue, 24 Aug 2010 21:54:15 +0200
changeset 9 6370083b2760
permissions -rw-r--r--
Bewerbung bei MediClin
     1 %% start of file `moderncv.cls'.
     2 %% Copyright 2006-2008 Xavier Danaux (xdanaux@gmail.com).
     3 %
     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/.
     7 
     8 
     9 %-------------------------------------------------------------------------------
    10 %                identification
    11 %-------------------------------------------------------------------------------
    12 \NeedsTeXFormat{LaTeX2e}
    13 \ProvidesClass{moderncv}[2008/06/17 v0.7 modern curriculum vitae document class]
    14 
    15 
    16 %-------------------------------------------------------------------------------
    17 %                debugging
    18 %-------------------------------------------------------------------------------
    19 \newif\if@DEBUG\@DEBUGfalse
    20 
    21 
    22 %-------------------------------------------------------------------------------
    23 %                class options
    24 %
    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 %-------------------------------------------------------------------------------
    29 % paper size option
    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}}
    52 
    53 % font size options
    54 \newcommand\@ptsize{}
    55 \DeclareOption{10pt}{\renewcommand\@ptsize{0}}
    56 \DeclareOption{11pt}{\renewcommand\@ptsize{1}}
    57 \DeclareOption{12pt}{\renewcommand\@ptsize{2}}
    58 
    59 % draft/final option
    60 \DeclareOption{draft}{\setlength\overfullrule{5pt}}
    61 \DeclareOption{final}{\setlength\overfullrule{0pt}}
    62 
    63 % nolmodern option
    64 \newif\if@lmodern\@lmoderntrue
    65 \DeclareOption{nolmodern}{\@lmodernfalse}
    66 
    67 % nocolor option
    68 \newif\if@color\@colortrue
    69 \DeclareOption{nocolor}{\@colorfalse}
    70 
    71 % execute default options
    72 \ExecuteOptions{a4paper,11pt,color,final}
    73 
    74 % process given options
    75 \ProcessOptions\relax
    76 \input{size1\@ptsize.clo}
    77 
    78 
    79 %-------------------------------------------------------------------------------
    80 %                required packages
    81 %-------------------------------------------------------------------------------
    82 % ifthen package
    83 \RequirePackage{ifthen}
    84 
    85 % ifpdf package
    86 \RequirePackage{ifpdf}
    87 
    88 % color package
    89 \ifpdf
    90   \RequirePackage[pdftex]{color}
    91 \else
    92   \RequirePackage[dvips]{color}
    93 \fi
    94 
    95 % fontenc package
    96 \RequirePackage[T1]{fontenc}
    97 
    98 % scalable Computer Modern fonts
    99 %\usepackage{type1cm}
   100 
   101 % latin modern fonts
   102 \AtEndOfClass{%
   103   \if@lmodern
   104     \RequirePackage{lmodern}\fi}
   105 
   106 % symbols like \Telefon, \Mobilefone, \Letter and \Email
   107 \RequirePackage{marvosym}
   108 
   109 % extended characters of T1 in .ps + other guillemets
   110 %\RequirePackage{ae,aecompl,aeguill}
   111 
   112 % page geometry
   113 \addtolength{\oddsidemargin}{-54pt}
   114 \addtolength{\textwidth}{109pt}
   115 \addtolength{\topmargin}{-70pt}
   116 \addtolength{\textheight}{122pt}
   117 \addtolength{\marginparsep}{-5pt}
   118 \addtolength{\marginparwidth}{-10pt}
   119 
   120 % hyperrefs
   121 \RequirePackage{url}
   122 \ifpdf
   123   \RequirePackage[pdftex,]{hyperref}
   124 \else
   125   \RequirePackage[dvips]{hyperref}\fi
   126 \hypersetup{%
   127   breaklinks,
   128   baseurl       = http://,%
   129   pdfborder     = 0 0 0,%
   130   pdfpagemode   = UseNone,%
   131 %  pdfstartview  = XYZ,%
   132   pdfstartpage  = 1,%
   133   pdfcreator    = \LaTeX{} with `moderncv' package,%
   134   pdfproducer   = \LaTeX}
   135 \AtEndOfClass{%
   136   \AtBeginDocument{%
   137     \hypersetup{%
   138       pdfauthor     = \@firstname~\@familyname,%
   139       pdftitle      = \@title,%
   140       pdfsubject    = \@firstname~\@familyname,%
   141       pdfkeywords   = \@firstname~\@familyname{} curriculum vit\ae{}}}}
   142 \urlstyle{tt}
   143 
   144 % graphics
   145 \ifpdf
   146   \RequirePackage[pdftex]{graphicx}
   147 \else
   148   \RequirePackage[dvips]{graphicx}\fi
   149 
   150 % headers and footers
   151 \usepackage{fancyhdr}
   152 \fancypagestyle{plain}{%
   153   \renewcommand{\headrulewidth}{0pt}
   154   \renewcommand{\footrulewidth}{0pt}
   155   \fancyhf{}}
   156 \pagestyle{plain}
   157 
   158 % compatibility package with older versions of moderncv
   159 \RequirePackageWithOptions{moderncvcompatibility}
   160 
   161 
   162 %-------------------------------------------------------------------------------
   163 %                class definition
   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@}
   173 \pagestyle{empty}
   174 \pagenumbering{arabic}
   175 \raggedbottom
   176 \onecolumn
   177 
   178 
   179 %-------------------------------------------------------------------------------
   180 %                style commands definitions
   181 %-------------------------------------------------------------------------------
   182 % symbols used 
   183 \providecommand*{\listitemsymbol}{\textbullet}
   184 \providecommand*{\addresssymbol}{}
   185 \providecommand*{\mobilesymbol}{\Mobilefone}
   186 \providecommand*{\phonesymbol}{\Telefon}
   187 \providecommand*{\faxsymbol}{\FAX}
   188 \providecommand*{\emailsymbol}{\Letter}
   189 
   190 % colors
   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}
   200 
   201 % fonts
   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}
   210 
   211 % styles
   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}}
   220 
   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}}
   227 
   228 
   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}}
   244 
   245 % length used by the moderncv layout
   246 % quote length
   247 \newlength{\quotewidth}
   248 % section lengths
   249 \newlength{\hintscolumnwidth}
   250 \newlength{\separatorcolumnwidth}
   251 \setlength{\separatorcolumnwidth}{0.025\textwidth}
   252 \newlength{\maincolumnwidth}
   253 % doubleitem lengths
   254 \newlength{\doubleitemmaincolumnwidth}
   255 % listitem lengths
   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}%
   265   % main lenghts
   266   \setlength{\maincolumnwidth}{\textwidth}%
   267   \addtolength{\maincolumnwidth}{-\separatorcolumnwidth}%
   268   \addtolength{\maincolumnwidth}{-\hintscolumnwidth}%
   269   % listitem lengths
   270   \setlength{\listitemmaincolumnwidth}{\maincolumnwidth}%
   271   \addtolength{\listitemmaincolumnwidth}{-\listitemsymbolwidth}%
   272   % doubleitem lengths
   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}%
   281   % fancyhdr lengths
   282   \renewcommand{\headwidth}{\textwidth}%
   283   \recomputethemelengths}
   284 \setlength{\hintscolumnwidth}{0.15\textwidth}
   285 \recomputelengths
   286 
   287 % makes the cv title
   288 \title{}% to avoid LaTeX complaining that \maketitle is a called without first a call to \title
   289 \renewcommand*{\maketitle}{}%
   290 
   291 % draws a colored rectangle
   292 % usage: \colorrule[optional height]{width}
   293 %\newcommand*{\colorrule}[2][1ex]{{\color{sectionrectanglecolor}{\rule{#2}{#1}}}}
   294 
   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
   304 
   305 % usage: \subsection{title}
   306 \newcommand*{\subsection}[1]{%
   307   \cvline[0.45em]{}{\subsectionstyle{#1}}}
   308 
   309 % usage: \cvline{margintext}{linetext}
   310 \newcommand*{\cvline}[3][.25em]{%
   311   \begin{tabular}{@{}p{\hintscolumnwidth}@{\hspace{\separatorcolumnwidth}}p{\maincolumnwidth}@{}}%
   312  	  \raggedleft\hintfont{#2} &{#3}%
   313   \end{tabular}\\[#1]}
   314 
   315 % usage: \cvdoubleitem{subtitle}{text}{subtitle}{text}
   316 \newcommand*{\cvdoubleitem}[4]{%
   317  \cvline{#1}{\begin{minipage}[t]{\doubleitemmaincolumnwidth}#2\end{minipage}%
   318  \hfill%
   319  \begin{minipage}[t]{\hintscolumnwidth}\raggedleft\hintfont{#3}\end{minipage}\hspace*{\separatorcolumnwidth}\begin{minipage}[t]{\doubleitemmaincolumnwidth}#4\end{minipage}}}
   320 
   321 % usage: \cvlistitem[symbol]{point1}
   322 \newcommand*{\cvlistitem}[2][\listitemsymbol{}]{%
   323   \cvline[0pt]{}{#1~\begin{minipage}[t]{\listitemmaincolumnwidth}#2\end{minipage}}}
   324 
   325 % usage: \cvlistdoubleitem[symbol]{point1}{point2}
   326 \newcommand*{\cvlistdoubleitem}[3][\listitemsymbol{}]{%
   327   \cvline[0pt]{}{#1~\begin{minipage}[t]{\listdoubleitemmaincolumnwidth}#2\end{minipage}%
   328   \hfill%
   329   \ifthenelse{\equal{#3}{}}%
   330     {}%
   331     {#1~\begin{minipage}[t]{\listdoubleitemmaincolumnwidth}#3\end{minipage}}}}
   332 
   333 % usage: \cventry{years}{degree/job title}{institution/employer}{localization}{optionnal: grade/...}{optional: comment/job description}
   334 \newcommand*{\cventry}[6]{%
   335   \cvline{#1}{%
   336     {\bfseries#2}%
   337     \ifx#3\else{, {\slshape#3}}\fi%
   338     \ifx#4\else{, #4}\fi%
   339     \ifx#5\else{, #5}\fi%
   340     .%
   341     \ifx#6\else{\newline{}\begin{minipage}[t]{\linewidth}\small#6\end{minipage}}\fi
   342     }}%
   343 
   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}}}
   347 
   348 % usage (inside 'computer skills' cvsection environment): \cvcomputer{category}{programs}{category}{programs}
   349 \newcommand*{\cvcomputer}[4]{%
   350   \cvdoubleitem{#1}{\small#2}{#3}{\small#4}}
   351 
   352 % usage: \link[optional text]{link}
   353 \newcommand*{\link}[2][]{%
   354   \ifthenelse{\equal{#1}{}}%
   355     {\href{#2}{#2}}%
   356     {\href{#2}{#1}}}
   357 
   358 % usage: \httplink[optional text]{link}
   359 \newcommand*{\httplink}[2][]{%
   360   \ifthenelse{\equal{#1}{}}%
   361     {\href{http://#2}{#2}}%
   362     {\href{http://#2}{#1}}}
   363 
   364 % usage: \emaillink[optional text]{link}
   365 \newcommand*{\emaillink}[2][]{%
   366   \ifthenelse{\equal{#1}{}}%
   367     {\href{mailto:#2}{#2}}%
   368     {\href{mailto:#2}{#1}}}
   369 
   370 % usage: \nopagenumbers{}
   371 \newif\if@displaypagenumbers\@displaypagenumberstrue
   372 \newcommand*{\nopagenumbers}{\@displaypagenumbersfalse}
   373 \AtBeginDocument{%
   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}}%
   381   \fi}
   382 
   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]%
   390   {%
   391     \section{\refname}%
   392 %    \vspace*{-0.65em}%
   393     \small%
   394     \begin{list}{\bibliographyitemlabel}%
   395       {%
   396         \setlength{\topsep}{0pt}%
   397         \setlength{\labelwidth}{\hintscolumnwidth}%
   398         \setlength{\labelsep}{\separatorcolumnwidth}%
   399         \leftmargin\labelwidth%
   400         \advance\leftmargin\labelsep%
   401         \@openbib@code%
   402         \usecounter{enumiv}%
   403         \let\p@enumiv\@empty%
   404         \renewcommand\theenumiv{\@arabic\c@enumiv}}%
   405         \sloppy\clubpenalty4000\widowpenalty4000%
   406 %        \sfcode`\.\@m%
   407 %        \sfcode `\=1000\relax%
   408   }%
   409   {%
   410     \def\@noitemerr{\@latex@warning{Empty `thebibliography' environment}}%
   411     \end{list}%
   412   }
   413 \newcommand\newblock{\hskip .11em\@plus.33em\@minus.07em}
   414 \let\@openbib@code\@empty
   415 
   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}
   421 
   422 
   423 \endinput
   424 
   425 
   426 %% end of file `moderncv.cls'.