Guest User

Untitled

a guest
Jul 3rd, 2019
566
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.30 KB | None | 0 0
  1. \ProvidesClass{twentysecondcv}[2017/01/08 CV class]
  2. \LoadClass{article}
  3. \NeedsTeXFormat{LaTeX2e}
  4.  
  5. %----------------------------------------------------------------------------------------
  6. % REQUIRED PACKAGES
  7. %----------------------------------------------------------------------------------------
  8.  
  9. \RequirePackage[sfdefault]{ClearSans}
  10. \RequirePackage[T1]{fontenc}
  11. \RequirePackage{tikz}
  12. \RequirePackage{xcolor}
  13. \RequirePackage[absolute,overlay]{textpos}
  14. \RequirePackage{ragged2e}
  15. \RequirePackage{etoolbox}
  16. \RequirePackage{ifmtarg}
  17. \RequirePackage{ifthen}
  18. \RequirePackage{pgffor}
  19. \RequirePackage{marvosym}
  20. \RequirePackage{parskip}
  21.  
  22. \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
  23. \ProcessOptions\relax
  24.  
  25. %----------------------------------------------------------------------------------------
  26. % COLOURS
  27. %----------------------------------------------------------------------------------------
  28.  
  29. \definecolor{white}{RGB}{255,255,255}
  30. \definecolor{gray}{HTML}{4D4D4D}
  31. \definecolor{sidecolor}{HTML}{E7E7E7}
  32. \definecolor{mainblue}{HTML}{0E5484}
  33. \definecolor{maingray}{HTML}{B9B9B9}
  34.  
  35. %----------------------------------------------------------------------------------------
  36. % MISC CONFIGURATIONS
  37. %----------------------------------------------------------------------------------------
  38.  
  39. \renewcommand{\bfseries}{\color{gray}} % Make \textbf produce coloured text instead
  40.  
  41. \pagestyle{empty} % Disable headers and footers
  42.  
  43. \setlength{\parindent}{0pt} % Disable paragraph indentation
  44.  
  45. %----------------------------------------------------------------------------------------
  46. % SIDEBAR DEFINITIONS
  47. %----------------------------------------------------------------------------------------
  48.  
  49. \setlength{\TPHorizModule}{1cm} % Left margin
  50. \setlength{\TPVertModule}{1cm} % Top margin
  51.  
  52. \newlength\imagewidth
  53. \newlength\imagescale
  54. \pgfmathsetlength{\imagewidth}{5cm}
  55. \pgfmathsetlength{\imagescale}{\imagewidth/600}
  56.  
  57. \newlength{\TotalSectionLength} % Define a new length to hold the remaining line width after the section title is printed
  58. \newlength{\SectionTitleLength} % Define a new length to hold the width of the section title
  59. \newcommand{\profilesection}[1]{%
  60. \setlength\TotalSectionLength{\linewidth}% Set the total line width
  61. \settowidth{\SectionTitleLength}{\huge #1 }% Calculate the width of the section title
  62. \addtolength\TotalSectionLength{-\SectionTitleLength}% Subtract the section title width from the total width
  63. \addtolength\TotalSectionLength{-2.22221pt}% Modifier to remove overfull box warning
  64. \vspace{8pt}% Whitespace before the section title
  65. {\color{black!80} \huge #1 \rule[0.15\baselineskip]{\TotalSectionLength}{1pt}}% Print the title and auto-width rule
  66. }
  67.  
  68. % Define custom commands for CV info
  69. \newcommand{\cvdate}[1]{\renewcommand{\cvdate}{#1}}
  70.  
  71. \newcommand{\cvnumberphone}[1]{\renewcommand{\cvnumberphone}{#1}}
  72. \newcommand{\cvaddress}[1]{\renewcommand{\cvaddress}{#1}}
  73. \newcommand{\cvsite}[1]{\renewcommand{\cvsite}{#1}}
  74. \newcommand{\Education}[1]{\renewcommand{\Education}{#1}}
  75. \newcommand{\skills}[1]{\renewcommand{\skills}{#1}}
  76. \newcommand{\COURSEWORK}[1]{\renewcommand{\COURSEWORK}{#1}}
  77.  
  78.  
  79. \newcommand{\cvname}[1]{\renewcommand{\cvname}{#1}}
  80. \newcommand{\cvjobtitle}[1]{\renewcommand{\cvjobtitle}{#1}}
  81.  
  82. % Command for printing the contact information icons
  83. \newcommand*\icon[1]{\tikz[baseline=(char.base)]{\node[shape=circle,draw,inner sep=1pt, fill=mainblue,mainblue,text=white] (char) {#1};}}
  84.  
  85. % Command for printing skill progress bars
  86.  
  87.  
  88. % Command for printing skills text
  89. \newcommand\skillstext[1]{
  90. \renewcommand{\skillstext}{
  91. \begin{flushleft}
  92. \foreach [count=\i] \x/\y in {#1}{
  93. \x$ \star $\y
  94. }
  95. \end{flushleft}
  96. }
  97. }
  98.  
  99. %----------------------------------------------------------------------------------------
  100. % SIDEBAR LAYOUT
  101. %----------------------------------------------------------------------------------------
  102.  
  103. \newcommand{\makeprofile}{
  104. \begin{tikzpicture}[remember picture,overlay]
  105. \node [rectangle, fill=sidecolor, anchor=north, minimum width=9cm, minimum height=\paperheight+1cm] (box) at (-5cm,0.5cm){};
  106. \end{tikzpicture}
  107.  
  108. %------------------------------------------------
  109.  
  110. \begin{textblock}{6}(0.5, 0.2)
  111.  
  112. %------------------------------------------------
  113.  
  114. \ifthenelse{\equal{\profilepic}{}}{}{
  115. \begin{center}
  116. \begin{tikzpicture}[x=\imagescale,y=-\imagescale]
  117. \clip (600/2, 567/2) circle (567/2);
  118. \node[anchor=north west, inner sep=0pt, outer sep=0pt] at (0,0) {\includegraphics[width=\imagewidth]{\profilepic}};
  119. \end{tikzpicture}
  120. \end{center}
  121. }
  122.  
  123. %------------------------------------------------
  124.  
  125. {\Huge\color{mainblue}\cvname}
  126.  
  127. %------------------------------------------------
  128.  
  129. {\Large\color{black!80}\cvjobtitle}
  130.  
  131. %------------------------------------------------
  132.  
  133. \renewcommand{\arraystretch}{1.6}
  134. \begin{tabular}{p{0.5cm} @{\hskip 0.5cm}p{5cm}}
  135. \ifthenelse{\equal{\cvdate}{}}{}{\textsc{\Large\icon{\Info}} & \cvdate\\}
  136. \ifthenelse{\equal{\cvaddress}{}}{}{\textsc{\Large\icon{\Letter}} & \cvaddress\\}
  137. \ifthenelse{\equal{\cvnumberphone}{}}{}{\textsc{\Large\icon{\Telefon}} & \cvnumberphone\\}
  138. \ifthenelse{\equal{\cvsite}{}}{}{\textsc{\Large\icon{\Mundus}} & \cvsite\\}
  139. \ifthenelse{\equal{\cvmail}{}}{}{\textsc{\large\icon{@}} & \href{mailto:\cvmail}{\cvmail}}
  140. \end{tabular}
  141.  
  142. %------------------------------------------------
  143.  
  144. \ifthenelse{\equal{\Education}{}}{}{
  145. \profilesection{Education}
  146. \begin{flushleft}
  147. \Education
  148. \end{flushleft}
  149. }
  150.  
  151. %------------------------------------------------
  152. \ifthenelse{\equal{\skills}{}}{}{
  153. \profilesection{Skills}
  154. \begin{flushleft}
  155. \skills
  156. \end{flushleft}
  157. }
  158.  
  159. \ifthenelse{\equal{\COURSEWORK}{}}{}{
  160. \profilesection{COURSEWORK}
  161. \begin{flushleft}
  162. \COURSEWORK
  163. \end{flushleft}
  164. }
  165.  
  166.  
  167.  
  168.  
  169. %------------------------------------------------
  170.  
  171. \end{textblock}
  172. }
  173.  
  174. %----------------------------------------------------------------------------------------
  175. % COLOURED SECTION TITLE BOX
  176. %----------------------------------------------------------------------------------------
  177.  
  178. % Command to create the rounded boxes around the first three letters of section titles
  179. \newcommand*\round[2]{%
  180. \tikz[baseline=(char.base)]\node[anchor=north west, draw,rectangle, rounded corners, inner sep=1.6pt, minimum size=5.5mm, text height=3.6mm, fill=#2,#2,text=white](char){#1};%
  181. }
  182.  
  183. \newcounter{colorCounter}
  184. \newcommand{\sectioncolor}[1]{%
  185. {%
  186. \round{#1}{
  187. \ifcase\value{colorCounter}%
  188. maingray\or%
  189. mainblue\or%
  190. maingray\or%
  191. mainblue\or%
  192. maingray\or%
  193. mainblue\or%
  194. maingray\or%
  195. mainblue\or%
  196. maingray\or%
  197. mainblue\else%
  198. maingray\fi%
  199. }%
  200. }%
  201. \stepcounter{colorCounter}%
  202. }
  203.  
  204. \renewcommand{\section}[1]{
  205. {%
  206. \color{gray}%
  207. \Large\sectioncolor{#1}%
  208. }
  209. }
  210.  
  211. \renewcommand{\subsection}[1]{
  212. \par\vspace{.5\parskip}{%
  213. \large\color{gray} #1%
  214. }
  215. \par\vspace{.25\parskip}%
  216. }
  217.  
  218. %----------------------------------------------------------------------------------------
  219. % LONG LIST ENVIRONMENT
  220. %----------------------------------------------------------------------------------------
  221.  
  222. \setlength{\tabcolsep}{0pt}
  223.  
  224. % New environment for the long list
  225. \newenvironment{twenty}{%
  226. \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}ll}
  227. }{%
  228. \end{tabular*}
  229. }
  230.  
  231. \newcommand{\twentyitem}[4]{%
  232. #1&\parbox[t]{0.83\textwidth}{%
  233. \textbf{#2}%
  234. \hfill%
  235. {\footnotesize#3}\\%
  236. #4\vspace{\parsep}%
  237. }\\
  238. }
  239.  
  240. %----------------------------------------------------------------------------------------
  241. % SMALL LIST ENVIRONMENT
  242. %----------------------------------------------------------------------------------------
  243.  
  244. \setlength{\tabcolsep}{0pt}
  245.  
  246. % New environment for the small list
  247. \newenvironment{twentyshort}{%
  248. \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}ll}
  249. }{%
  250. \end{tabular*}
  251. }
  252.  
  253. \newcommand{\twentyitemshort}[2]{%
  254. #1&\parbox[t]{0.83\textwidth}{%
  255. \textbf{#2}%
  256. }\\
  257. }
  258.  
  259. %----------------------------------------------------------------------------------------
  260. % MARGINS AND LINKS
  261. %----------------------------------------------------------------------------------------
  262.  
  263. \RequirePackage[left=7.6cm,top=0.1cm,right=1cm,bottom=0.2cm,nohead,nofoot]{geometry}
  264.  
  265. \RequirePackage{hyperref}
Add Comment
Please, Sign In to add comment