Advertisement
konstantK

friggeri-cv.cls

Jun 28th, 2019
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.30 KB | None | 0 0
  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[Path = Fonts/]{Helvetica Neue}
  54. \newfontfamily\thinfont[Path = Fonts/]{Helvetica Neue UltraLight}
  55. \newfontfamily\headingfont[Path = Fonts/]{Helvetica Neue Condensed Bold}
  56.  
  57. \defaultfontfeatures{Mapping=tex-text}
  58. \setmainfont[Mapping=tex-text, Color=textcolor]{Helvetica Neue Light}
  59. %\setmathfont{XITS Math}
  60.  
  61. %%%%%%%%%%
  62. % Header %
  63. %%%%%%%%%%
  64.  
  65. \RequirePackage{tikz}
  66.  
  67. \newcommand{\rolefont}{%
  68. \fontsize{14pt}{24pt}\selectfont%
  69. \thinfont%
  70. \color{white}%
  71. }
  72.  
  73. \newcommand{\header}[3]{%
  74. \begin{tikzpicture}[remember picture,overlay]
  75. \node [rectangle, fill=fillheader, anchor=north, minimum width=\paperwidth, minimum height=4cm] (box) at (current page.north){};
  76. \node [anchor=center] (name) at (box) {%
  77. \fontsize{40pt}{72pt}\color{header}%
  78. {\thinfont #1}{\bodyfont #2}
  79. };
  80. \node [anchor=north] at (name.south) {%
  81. \fontsize{14pt}{24pt}\color{header}%
  82. \thinfont #3%
  83. };
  84. \end{tikzpicture}
  85. \vspace{2.5cm}
  86. \vspace{-2\parskip}
  87. }
  88.  
  89.  
  90. %%%%%%%%%%%%%
  91. % Structure %
  92. %%%%%%%%%%%%%
  93. \RequirePackage{parskip}
  94.  
  95. \newcounter{colorCounter}
  96. \def\@sectioncolor#1#2#3{%
  97. {%
  98. \color{%
  99. \ifcase\value{colorCounter}%
  100. blue\or%
  101. red\or%
  102. orange\or%
  103. green\or%
  104. purple\or%
  105. brown\else%
  106. headercolor\fi%
  107. } #1#2#3%
  108. }%
  109. \stepcounter{colorCounter}%
  110. }
  111.  
  112. \renewcommand{\section}[1]{
  113. \par\vspace{\parskip}
  114. {%
  115. \LARGE\headingfont\color{headercolor}%
  116. \@sectioncolor #1%
  117. }
  118. \par\vspace{\parskip}
  119. }
  120.  
  121. \renewcommand{\subsection}[1]{
  122. \par\vspace{.5\parskip}%
  123. {\Large\headingfont\color{headercolor} #1}
  124. \par\vspace{.25\parskip}%
  125. }
  126.  
  127. \renewcommand{\subsubsection}[2]{
  128. \par\vspace{.5\parskip}%
  129. {\Large\headingfont\color{headercolor} #2}
  130. \par\vspace{.25\parskip}%
  131. }
  132.  
  133. \pagestyle{empty}
  134.  
  135.  
  136. %%%%%%%%%%%%%%%%%%%%
  137. % List environment %
  138. %%%%%%%%%%%%%%%%%%%%
  139.  
  140. \setlength{\tabcolsep}{0pt}
  141. \newenvironment{entrylist}{%
  142. \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}ll}
  143. }{%
  144. \end{tabular*}
  145. }
  146. \renewcommand{\bfseries}{\headingfont\color{headercolor}}
  147. \newcommand{\entry}[4]{%
  148. #1&\parbox[t]{11.8cm}{%
  149. \textbf{#2}%
  150. \hfill%
  151. {\footnotesize\addfontfeature{Color=lightgray} #3}\\%
  152. #4\vspace{\parsep}%
  153. }\\}
  154.  
  155.  
  156. %%%%%%%%%%%%%%
  157. % Side block %
  158. %%%%%%%%%%%%%%
  159.  
  160. \RequirePackage[absolute,overlay]{textpos}
  161. \setlength{\TPHorizModule}{1cm}
  162. \setlength{\TPVertModule}{1cm}
  163. \newenvironment{aside}{%
  164. \let\oldsection\section
  165. \renewcommand{\section}[1]{
  166. \par\vspace{\baselineskip}{\Large\headingfont\color{headercolor} ##1}
  167. }
  168. \begin{textblock}{3.6}(1.5, 4.33)
  169. \begin{flushright}
  170. \obeycr
  171. }{%
  172. \restorecr
  173. \end{flushright}
  174. \end{textblock}
  175. \let\section\oldsection
  176. }
  177.  
  178. %%%%%%%%%%%%%%%%
  179. % Bibliography %
  180. %%%%%%%%%%%%%%%%
  181.  
  182. \RequirePackage[style=verbose, maxnames=99, sorting=ydnt]{biblatex}
  183.  
  184. \DeclareFieldFormat[article]{title}{#1\par}
  185. \DeclareFieldFormat[book]{title}{#1\par}
  186. \DeclareFieldFormat[inproceedings]{title}{#1\par}
  187. \DeclareFieldFormat[misc]{title}{#1\par}
  188. \DeclareFieldFormat[report]{title}{#1\par}
  189.  
  190. \DeclareBibliographyDriver{article}{%
  191. \printfield{title}%
  192. \newblock%
  193. \printnames{author}%
  194. \par%
  195. \newblock%
  196. {%
  197. \footnotesize\addfontfeature{Color=lightgray}\itshape%
  198. \usebibmacro{journal+issuetitle}%
  199. \setunit{\space}%
  200. \printfield{pages}%
  201. \newunit%
  202. \printlist{publisher}%
  203. \setunit*{\addcomma\space}%
  204. \printfield{year}%
  205. \newunit%
  206. }
  207. \par\vspace{0.3\baselineskip}
  208. }
  209.  
  210. \DeclareBibliographyDriver{book}{%
  211. \printfield{title}%
  212. \newblock%
  213. \printnames{author}%
  214. \par%
  215. \newblock%
  216. {%
  217. \footnotesize\addfontfeature{Color=lightgray}\itshape%
  218. \printlist{publisher}%
  219. \setunit*{\addcomma\space}%
  220. \printfield{note}%
  221. \setunit*{\addcomma\space}%
  222. \printfield{year}%
  223. \setunit{\addcomma\space}%
  224. \printlist{location}%
  225. \newunit%
  226. }
  227. \par\vspace{0.3\baselineskip}
  228. }
  229.  
  230.  
  231. \DeclareBibliographyDriver{inproceedings}{%
  232. \printfield{title}%
  233. \newblock%
  234. \printnames{author}%
  235. \par%
  236. \newblock%
  237. {%
  238. \footnotesize\addfontfeature{Color=lightgray}%
  239. \printfield{booktitle}%
  240. \setunit{\addcomma\space}%
  241. \printfield{year}%
  242. \setunit{\addcomma\space}%
  243. \printlist{location}%
  244. \newunit%
  245. }
  246. \par\vspace{0.3\baselineskip}
  247. }
  248.  
  249. \DeclareBibliographyDriver{misc}{%
  250. \printfield{title}%
  251. \newblock%
  252. \printnames{author}%
  253. \par%
  254. \newblock%
  255. {%
  256. \footnotesize\addfontfeature{Color=lightgray}\itshape%
  257. \printfield{booktitle}%
  258. \setunit*{\addcomma\space}%
  259. \printfield{note}%
  260. \setunit*{\addcomma\space}%
  261. \printfield{year}%
  262. \setunit{\addcomma\space}%
  263. \printlist{location}%
  264. \newunit%
  265. }
  266. \par\vspace{0.3\baselineskip}
  267. }
  268.  
  269. \DeclareBibliographyDriver{report}{%
  270. \printfield{title}%
  271. \newblock%
  272. \printnames{author}%
  273. \par%
  274. \newblock%
  275. {%
  276. \footnotesize\addfontfeature{Color=lightgray}\itshape%
  277. \printfield{type}%
  278. \setunit{\space}%
  279. \printfield{number}%
  280. \setunit{\addcomma\space}%
  281. \printfield{year}%
  282. \newunit%
  283. }
  284. \par\vspace{0.3\baselineskip}
  285. }
  286.  
  287. \DeclareNameFormat{author}{%
  288. \small\addfontfeature{Color=lightgray}%
  289. \ifblank{#3}{}{#3\space}#1%
  290. \ifthenelse{\value{listcount}<\value{liststop}}
  291. {\addcomma\space}
  292. {}%
  293. }
  294.  
  295. \defbibheading{bibheading}[\bibname]{%
  296. \subsubsection*{#1}
  297. \markboth{#1}{#1}
  298. }
  299.  
  300. \newcommand{\printbibsection}[2]{
  301. \begin{refsection}
  302. \nocite{*}
  303. \printbibliography[sorting=chronological, type={#1}, title={#2}, heading=bibheading]
  304. \end{refsection}
  305. }
  306.  
  307. \DeclareSortingScheme{chronological}{
  308. \sort[direction=descending]{\field{year}}
  309. \sort[direction=descending]{\field{month}}
  310. }
  311.  
  312.  
  313.  
  314. %%%%%%%%%%%%%%%%
  315. % Other tweaks %
  316. %%%%%%%%%%%%%%%%
  317.  
  318. \RequirePackage[left=6.1cm,top=2cm,right=1.5cm,bottom=2.5cm,nohead,nofoot]{geometry}
  319. \RequirePackage{hyperref}
  320. \hypersetup{
  321. colorlinks=false,
  322. linkcolor=red,
  323. citecolor=red,
  324. filecolor=red,
  325. urlcolor = red}
  326.  
  327. % A fix for \href{}{} colors not working with fontspec
  328. \makeatletter
  329. \def\HyColor@@@@UseColor#1\@nil{\addfontfeatures{Color=#1}}
  330. \makeatother
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement