friggeri-cv.cls (4157B)
1 \ProvidesClass{friggeri-cv}[2012/04/30 CV class] 2 \NeedsTeXFormat{LaTeX2e} 3 4 \DeclareOption{print}{\def\@cv@print{}} 5 \DeclareOption*{% 6 \PassOptionsToClass{\CurrentOption}{article}% 7 } 8 \ProcessOptions\relax 9 \LoadClass{article} 10 11 12 %%%%%%%%%% 13 % Colors % 14 %%%%%%%%%% 15 16 \RequirePackage{xcolor} 17 18 \definecolor{white}{RGB}{255,255,255} 19 20 \definecolor{darkgray}{HTML}{333333} 21 \definecolor{gray}{HTML}{4D4D4D} 22 \definecolor{lightgray}{HTML}{999999} 23 24 \definecolor{green}{HTML}{C2E15F} 25 \definecolor{orange}{HTML}{FDA333} 26 \definecolor{purple}{HTML}{D3A4F9} 27 \definecolor{red}{HTML}{FB4485} 28 \definecolor{blue}{HTML}{6CE0F1} 29 30 \ifdefined\@cv@print 31 \colorlet{green}{gray} 32 \colorlet{orange}{gray} 33 \colorlet{purple}{gray} 34 \colorlet{brown}{gray} 35 \colorlet{red}{gray} 36 \colorlet{blue}{gray} 37 \colorlet{fillheader}{white} 38 \colorlet{header}{gray} 39 \else 40 \colorlet{fillheader}{gray} 41 \colorlet{header}{white} 42 \fi 43 \colorlet{textcolor}{gray} 44 \colorlet{headercolor}{gray} 45 46 %%%%%%%%% 47 % Fonts % 48 %%%%%%%%% 49 50 \RequirePackage[quiet]{fontspec} 51 %\RequirePackage[math-style=TeX,vargreek-shape=unicode]{unicode-math} 52 53 \newfontfamily\bodyfont[]{DejaVu Sans} 54 \newfontfamily\thinfont[]{DejaVu Serif} 55 \newfontfamily\headingfont[]{DejaVu Sans Bold} 56 57 \defaultfontfeatures{Mapping=tex-text} 58 \setmainfont[Mapping=tex-text, Color=textcolor]{DejaVu Sans} 59 60 %\setmathfont{XITS Math} 61 62 %%%%%%%%%% 63 % Header % 64 %%%%%%%%%% 65 66 \RequirePackage{tikz} 67 68 \newcommand{\rolefont}{% 69 \fontsize{14pt}{24pt}\selectfont% 70 \thinfont% 71 \color{white}% 72 } 73 74 \newcommand{\header}[3]{% 75 \begin{tikzpicture}[remember picture,overlay] 76 \node [rectangle, fill=fillheader, anchor=north, minimum width=\paperwidth, minimum height=4cm] (box) at (current page.north){}; 77 \node [anchor=center] (name) at (box) {% 78 \fontsize{40pt}{72pt}\color{header}% 79 {\thinfont #1}{\bodyfont #2} 80 }; 81 \node [anchor=north] at (name.south) {% 82 \fontsize{14pt}{24pt}\color{header}% 83 \thinfont #3% 84 }; 85 \end{tikzpicture} 86 \vspace{2.5cm} 87 \vspace{-2\parskip} 88 } 89 90 91 %%%%%%%%%%%%% 92 % Structure % 93 %%%%%%%%%%%%% 94 \RequirePackage{parskip} 95 96 \newcounter{colorCounter} 97 \def\@sectioncolor#1#2#3{% 98 {% 99 \color{% 100 \ifcase\value{colorCounter}% 101 blue\or% 102 red\or% 103 orange\or% 104 green\or% 105 purple\or% 106 brown\else% 107 headercolor\fi% 108 } #1#2#3% 109 }% 110 \stepcounter{colorCounter}% 111 } 112 113 \renewcommand{\section}[1]{ 114 \par\vspace{\parskip} 115 {% 116 \LARGE\headingfont\color{headercolor}% 117 \@sectioncolor #1% 118 } 119 \par\vspace{\parskip} 120 } 121 122 \renewcommand{\subsection}[2]{ 123 \par\vspace{.5\parskip}% 124 \Large\headingfont\color{headercolor} #2% 125 \par\vspace{.25\parskip}% 126 } 127 128 \pagestyle{empty} 129 130 131 %%%%%%%%%%%%%%%%%%%% 132 % List environment % 133 %%%%%%%%%%%%%%%%%%%% 134 135 \setlength{\tabcolsep}{0pt} 136 \newenvironment{entrylist}{% 137 \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}ll} 138 }{% 139 \end{tabular*} 140 } 141 \renewcommand{\bfseries}{\headingfont\color{headercolor}} 142 \newcommand{\entry}[4]{% 143 #1&\parbox[t]{11.8cm}{% 144 \textbf{#2}% 145 \hfill% 146 {\footnotesize\addfontfeature{Color=lightgray} #3}\\% 147 #4\vspace{\parsep}% 148 }\\} 149 150 % Fix long entrylist 151 \usepackage{enumitem} 152 \renewenvironment{entrylist}{% 153 \begin{itemize}[leftmargin=1in]%[leftmargin=*,align=left,itemindent=-\dimexpr\labelwidth+\labelindent+\labelsep\relax] 154 }{% 155 \end{itemize} 156 } 157 \renewcommand{\bfseries}{\headingfont\color{headercolor}} 158 \renewcommand{\entry}[4]{% 159 \item[#1] 160 \textbf{#2}% 161 \hfill% 162 {\footnotesize\addfontfeature{Color=lightgray} #3}\\% 163 #4\vspace{\parsep}% 164 } 165 166 %%%%%%%%%%%%%% 167 % Side block % 168 %%%%%%%%%%%%%% 169 170 \RequirePackage[absolute,overlay]{textpos} 171 \setlength{\TPHorizModule}{1cm} 172 \setlength{\TPVertModule}{1cm} 173 \newenvironment{aside}{% 174 \let\oldsection\section 175 \renewcommand{\section}[1]{ 176 \par\vspace{\baselineskip}{\Large\headingfont\color{headercolor} ##1} 177 } 178 \begin{textblock}{3.6}(1.5, 4.33) 179 \begin{flushright} 180 \obeycr 181 }{% 182 \restorecr 183 \end{flushright} 184 \end{textblock} 185 \let\section\oldsection 186 } 187 188 %%%%%%%%%%%%%%%% 189 % Other tweaks % 190 %%%%%%%%%%%%%%%% 191 192 \RequirePackage[left=6.1cm,top=2cm,right=1.5cm,bottom=2cm,nohead,nofoot]{geometry} 193 \RequirePackage{hyperref}