comsoft/moderncvthemeclassic.sty
author Eugen Sawin <sawine@me73.com>
Sat, 03 Jul 2010 12:15:48 +0200
changeset 0 9784821a1c6f
permissions -rw-r--r--
Moved from SVN.
     1 %% start of file `moderncvthemeclassic.sty'.
     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 \ProvidesPackage{moderncvthemeclassic}[2008/06/17 v0.7 modern curriculum vitae style: classic]
    14 
    15 
    16 %-------------------------------------------------------------------------------
    17 %                required packages
    18 %-------------------------------------------------------------------------------
    19 
    20 
    21 %-------------------------------------------------------------------------------
    22 %                package options
    23 %-------------------------------------------------------------------------------
    24 % color options
    25 % blue (default option)
    26 \DeclareOption{blue}{}
    27 % orange
    28 \newif\if@colororange\@colororangefalse
    29 \DeclareOption{orange}{\@colororangetrue}
    30 % green
    31 \newif\if@colorgreen\@colorgreenfalse
    32 \DeclareOption{green}{\@colorgreentrue}
    33 % red
    34 \newif\if@colorred\@colorredfalse
    35 \DeclareOption{red}{\@colorredtrue}
    36 % grey
    37 \newif\if@colorgrey\@colorgreyfalse
    38 \DeclareOption{grey}{\@colorgreytrue}
    39 
    40 % roman option
    41 \newif\if@roman\@romanfalse
    42 \DeclareOption{roman}{\@romantrue}
    43 
    44 % unused options
    45 \DeclareOption*{
    46   \PackageWarning{moderncvthemeclassic}{Unknown option ‘\CurrentOption’}}
    47 
    48 % execute default options
    49 \ExecuteOptions{color}
    50 
    51 % process given options
    52 \ProcessOptions\relax
    53 
    54 
    55 %-------------------------------------------------------------------------------
    56 %                style definition
    57 %-------------------------------------------------------------------------------
    58 % symbols used
    59 \renewcommand*{\listitemsymbol}{\textbullet}
    60 
    61 % colors
    62 \definecolor{firstnamecolor}{rgb}{0,0,0}
    63 \definecolor{familynamecolor}{rgb}{0,0,0}
    64 \definecolor{titlecolor}{rgb}{0.35,0.35,0.35}
    65 \definecolor{quotecolor}{rgb}{0.35,0.35,0.35}
    66 % default blue color
    67   \definecolor{addresscolor}{rgb}{0.25,0.5,0.75}
    68   \definecolor{sectionrectanglecolor}{rgb}{0.25,0.5,0.75}
    69   \definecolor{sectiontitlecolor}{rgb}{0.2,0.4,0.65}
    70   \definecolor{subsectioncolor}{rgb}{0.2,0.4,0.65}
    71 \if@colororange
    72   \definecolor{addresscolor}{rgb}{0.95,0.55,0.15}
    73   \definecolor{sectionrectanglecolor}{rgb}{1,0.65,0.20}
    74   \definecolor{sectiontitlecolor}{rgb}{0.95,0.55,0.15}
    75   \definecolor{subsectioncolor}{rgb}{0.95,0.55,0.15}\fi
    76 \if@colorgreen
    77   \definecolor{addresscolor}{rgb}{0.30,0.65,0.15}
    78   \definecolor{sectionrectanglecolor}{rgb}{0.55,0.85,0.35}
    79   \definecolor{sectiontitlecolor}{rgb}{0.30,0.65,0.15}
    80   \definecolor{subsectioncolor}{rgb}{0.30,0.65,0.15}\fi
    81 \if@colorred
    82   \definecolor{addresscolor}{rgb}{0.95,0.20,0.20}
    83   \definecolor{sectionrectanglecolor}{rgb}{1.00,0.30,0.30}
    84   \definecolor{sectiontitlecolor}{rgb}{0.95,0.20,0.20}
    85   \definecolor{subsectioncolor}{rgb}{0.95,0.20,0.20}\fi
    86 \if@colorgrey
    87   \definecolor{addresscolor}{rgb}{0.35,0.35,0.35}
    88   \definecolor{sectionrectanglecolor}{rgb}{0.75,0.75,0.75}
    89   \definecolor{sectiontitlecolor}{rgb}{0.35,0.35,0.35}
    90   \definecolor{subsectioncolor}{rgb}{0.35,0.35,0.35}\fi
    91 
    92 % fonts
    93 \if@roman
    94   \AtBeginDocument{\rmfamily}
    95 \else
    96   \AtBeginDocument{\sffamily}\fi
    97 \renewcommand*{\ttdefault}{pcr}
    98 \renewcommand*{\firstnamefont}{\fontsize{34}{36}\sffamily\mdseries\upshape}
    99 \renewcommand*{\titlefont}{\LARGE\sffamily\mdseries\slshape}
   100 \renewcommand*{\addressfont}{\normalsize\rmfamily\mdseries\slshape}
   101 \renewcommand*{\familynamefont}{\firstnamefont}
   102 \renewcommand*{\quotefont}{\large\slshape}
   103 \renewcommand*{\sectionfont}{\Large\sffamily\mdseries\upshape}
   104 \renewcommand*{\subsectionfont}{\large\sffamily\mdseries\upshape}
   105 
   106 % styles
   107 
   108 % maketitle
   109 %   setmaketitlenamemaxwidth to the full name length, capped by \maketitlenamemaxwidth
   110 \newlength{\maketitlenamemaxwidth}
   111 \setlength{\maketitlenamemaxwidth}{.525\textwidth}
   112 \newlength{\maketitlenamefullwidth}
   113 \settowidth{\maketitlenamefullwidth}{\firstnamestyle{\@firstname~}\familynamestyle{\@familyname}}
   114 \newlength{\maketitlenamewidth}
   115 \ifnum\maketitlenamemaxwidth<\maketitlenamefullwidth\setlength{\maketitlenamewidth}{\maketitlenamemaxwidth}\else\setlength{\maketitlenamewidth}{\maketitlenamefullwidth}\fi
   116 %   other lengths
   117 \newlength{\maketitlepicturewidth}
   118 \setlength{\maketitlepicturewidth}{\@photowidth}
   119 \newlength{\maketitledetailswidth}
   120 %   recompute theme-specific lengths, called by class to recompute all lengths
   121 \renewcommand*{\recomputethemelengths}{%
   122   \setlength{\maketitledetailswidth}{\textwidth}%
   123   \addtolength{\maketitledetailswidth}{-\maketitlenamewidth}%
   124   \addtolength{\maketitledetailswidth}{-\separatorcolumnwidth}%
   125   \addtolength{\maketitledetailswidth}{-\maketitlepicturewidth}}
   126 \recomputethemelengths
   127 \newif\if@firstdetailselement\@firstdetailselementtrue
   128 \newcommand*{\maketitledetailsnewline}{
   129   \if@firstdetailselement%
   130     \@firstdetailselementfalse%
   131   \else%
   132     \\[.2em]\fi}
   133 \renewcommand*{\maketitle}{%
   134   % name and title
   135   \begin{minipage}[b]{\maketitlenamewidth}%
   136     \firstnamestyle{\@firstname~}\familynamestyle{\@familyname}%
   137     \ifthenelse{\equal{\@title}{}}{}{\\[1.25em]\titlestyle{\@title}}%
   138   \end{minipage}%
   139   % optional data
   140   \begin{minipage}[b]{\maketitledetailswidth}%
   141     \raggedleft\addressfont\color{addresscolor}%
   142     \ifthenelse{\isundefined{\@addressstreet}}{}{%
   143       \maketitledetailsnewline%
   144       \addresssymbol~\@addressstreet%
   145       \ifthenelse{\isundefined{\@addresscity}}{}{\\\@addresscity}}%
   146     \ifthenelse{\isundefined{\@mobile}}{}{\maketitledetailsnewline\mobilesymbol~\@mobile}%
   147     \ifthenelse{\isundefined{\@phone}}{}{\maketitledetailsnewline\phonesymbol~\@phone}%
   148     \ifthenelse{\isundefined{\@fax}}{}{\maketitledetailsnewline\faxsymbol~\@fax}%
   149     \ifthenelse{\isundefined{\@email}}{}{\maketitledetailsnewline\emailsymbol~\emaillink{\@email}}%
   150     \ifthenelse{\isundefined{\@extrainfo}}{}{\maketitledetailsnewline\@extrainfo}%
   151   \end{minipage}%
   152   % optional photo
   153   \ifthenelse{\isundefined{\@photo}}%
   154     {}%
   155     {\hspace*{\separatorcolumnwidth}\color{firstnamecolor}\framebox{\includegraphics[width=\maketitlepicturewidth]{\@photo}}}\\[3em]%
   156   % optional quote
   157   \ifthenelse{\isundefined{\@quote}}%
   158     {}%
   159     {\centering{\begin{minipage}{\quotewidth}\centering\quotestyle{\@quote}\end{minipage}}\\[2.5em]}%
   160   }
   161 
   162 
   163 \endinput
   164 
   165 
   166 %% end of file `moderncvthemeclassic.sty'.