|
| 1 | +% cvone class - The one page curriculum |
| 2 | + |
| 3 | +\NeedsTeXFormat{LaTeX2e} % Latex version |
| 4 | +\ProvidesClass{cv0ne}[2021/03/20] |
| 5 | + |
| 6 | +% --------------------------------------------------------------------------- |
| 7 | +% Loading the article class as a base. |
| 8 | +% --------------------------------------------------------------------------- |
| 9 | +\LoadClass{article} |
| 10 | + |
| 11 | +% --------------------------------------------------------------------------- |
| 12 | +% The T1 font encoding is an 8-bit encoding for fonts. |
| 13 | +% --------------------------------------------------------------------------- |
| 14 | +\RequirePackage[T1]{fontenc} |
| 15 | + |
| 16 | +% --------------------------------------------------------------------------- |
| 17 | +% Use Gyre Heros font as default font typeface. |
| 18 | +% --------------------------------------------------------------------------- |
| 19 | +\RequirePackage{tgheros} |
| 20 | + |
| 21 | +% --------------------------------------------------------------------------- |
| 22 | +% Use sans-serify font family as default to the whole document |
| 23 | +% --------------------------------------------------------------------------- |
| 24 | +\renewcommand{\familydefault}{\sfdefault} |
| 25 | + |
| 26 | +% --------------------------------------------------------------------------- |
| 27 | +% The geometry package offers a simple way to change the length and layout |
| 28 | +% of different elements such as the paper size, margins, footnote, |
| 29 | +% header, orientation, etc. |
| 30 | +% --------------------------------------------------------------------------- |
| 31 | +\RequirePackage[a4paper, top=30pt, right=20pt, bottom=30pt, left=20pt]{geometry} |
| 32 | + |
| 33 | +% --------------------------------------------------------------------------- |
| 34 | +% Alternative section titles |
| 35 | +% --------------------------------------------------------------------------- |
| 36 | +\RequirePackage{titlesec} |
| 37 | + |
| 38 | +% --------------------------------------------------------------------------- |
| 39 | +% Fontawesome package |
| 40 | +% --------------------------------------------------------------------------- |
| 41 | +\RequirePackage{fontawesome} |
| 42 | + |
| 43 | +% --------------------------------------------------------------------------- |
| 44 | +% To define some custom color |
| 45 | +% --------------------------------------------------------------------------- |
| 46 | +\RequirePackage{xcolor} |
| 47 | +\definecolor{customblue}{RGB}{0,120,150} |
| 48 | +\definecolor{customgrey}{HTML}{808080} |
| 49 | +\definecolor{customlightgrey}{HTML}{F5F5F5} |
| 50 | +\definecolor{customorange}{RGB}{250,150,10} |
| 51 | + |
| 52 | +% --------------------------------------------------------------------------- |
| 53 | +% Easy way to create colored text boxes. |
| 54 | +% Used in this class into header and footer. |
| 55 | +% --------------------------------------------------------------------------- |
| 56 | +\RequirePackage[most]{tcolorbox} |
| 57 | + |
| 58 | +% --------------------------------------------------------------------------- |
| 59 | +% Add some programming capability like loops. |
| 60 | +% --------------------------------------------------------------------------- |
| 61 | +\RequirePackage{pgffor} % for loop usage |
| 62 | + |
| 63 | +% --------------------------------------------------------------------------- |
| 64 | +% The \pagestyle command changes the style from the current page |
| 65 | +% on throughout the remainder of the document. |
| 66 | +% |
| 67 | +% empty - Both the header and footer are cleared. |
| 68 | +% --------------------------------------------------------------------------- |
| 69 | +\pagestyle{empty} |
| 70 | + |
| 71 | +% --------------------------------------------------------------------------- |
| 72 | + |
| 73 | +\titleformat{\section} % Customise the \section command. |
| 74 | + {\Large\scshape\raggedright} % Make the \section headers large (\Large), |
| 75 | + % small capitals (\scshape) and left aligned (\raggedright). |
| 76 | + % |
| 77 | + {}{0em} % Parameter used as the section title and |
| 78 | + % the margin size - (0em). |
| 79 | + % Note: em is roughly the width of an 'M' (uppercase) |
| 80 | + % in the current font (it depends on the font used). |
| 81 | + % |
| 82 | + {} % Can be used to enter text after the section |
| 83 | + % |
| 84 | + [\titlerule] % Inserts a horizontal line after the heading |
| 85 | + |
| 86 | +% --------------------------------------------------------------------------- |
| 87 | + |
| 88 | +\titleformat{\subsection} % Customise the \subsection command. |
| 89 | + {\normalsize\scshape\raggedright} % Same thing above |
| 90 | + {}{0em} |
| 91 | + {} |
| 92 | + |
| 93 | +% --------------------------------------------------------------------------- |
| 94 | + |
| 95 | +\newcommand{\sectiontext}[1]{ |
| 96 | + \begin{changemargin}{0.25cm}{0.25cm} |
| 97 | + {\fontfamily{cmss}\selectfont |
| 98 | + {#1} |
| 99 | + } |
| 100 | + \end{changemargin} |
| 101 | +} |
| 102 | + |
| 103 | +% --------------------------------------------------------------------------- |
| 104 | + |
| 105 | +\def\changemargin#1#2{\list{}{\rightmargin#2\leftmargin#1}\item[]} |
| 106 | +\let\endchangemargin=\endlist |
| 107 | + |
| 108 | +% --------------------------------------------------------------------------- |
| 109 | + |
| 110 | +\newcommand{\sixtypercent}[1]{ |
| 111 | + \begin{changemargin}{0.25cm}{0.0cm}{\fontfamily{cmss}\selectfont\textcolor{customblue}{#1}\\} |
| 112 | + \textcolor{customorange}{ |
| 113 | + \foreach \n in {1,...,6}{ |
| 114 | + \colorbox{customorange}{.} |
| 115 | + } |
| 116 | + \foreach \n in {1,...,4}{ |
| 117 | + \colorbox{customblue!8}{.} |
| 118 | + } |
| 119 | + } |
| 120 | + \end{changemargin} |
| 121 | +} |
| 122 | + |
| 123 | +% --------------------------------------------------------------------------- |
| 124 | + |
| 125 | +\newcommand{\seventypercent}[1]{ |
| 126 | + \begin{changemargin}{0.25cm}{0.0cm}{\fontfamily{cmss}\selectfont\textcolor{customblue}{#1}\\} |
| 127 | + \textcolor{customorange}{ |
| 128 | + \foreach \n in {1,...,7}{ |
| 129 | + \colorbox{customorange}{.} |
| 130 | + } |
| 131 | + \foreach \n in {1,...,3}{ |
| 132 | + \colorbox{customblue!8}{.} |
| 133 | + } |
| 134 | + } |
| 135 | + \end{changemargin} |
| 136 | +} |
| 137 | + |
| 138 | +% --------------------------------------------------------------------------- |
| 139 | + |
| 140 | +\newcommand{\eightypercent}[1]{ |
| 141 | + \begin{changemargin}{0.25cm}{0.0cm}{\fontfamily{cmss}\selectfont\textcolor{customblue}{#1}\\} |
| 142 | + \textcolor{customorange}{ |
| 143 | + \foreach \n in {1,...,8}{ |
| 144 | + \colorbox{customorange}{.} |
| 145 | + } |
| 146 | + \foreach \n in {1,...,2}{ |
| 147 | + \colorbox{customblue!8}{.} |
| 148 | + } |
| 149 | + } |
| 150 | + \end{changemargin} |
| 151 | +} |
| 152 | + |
| 153 | +% --------------------------------------------------------------------------- |
| 154 | + |
| 155 | +\newcommand{\ninetypercent}[1]{ |
| 156 | + \begin{changemargin}{0.25cm}{0.0cm}{\fontfamily{cmss}\selectfont\textcolor{customblue}{#1}\\} |
| 157 | + \textcolor{customorange}{ |
| 158 | + \foreach \n in {1,...,9}{ |
| 159 | + \colorbox{customorange}{.} |
| 160 | + } |
| 161 | + \colorbox{customblue!8}{.} |
| 162 | + } |
| 163 | + \end{changemargin} |
| 164 | +} |
| 165 | + |
| 166 | +% --------------------------------------------------------------------------- |
| 167 | + |
| 168 | +\newcommand{\employmentitem}[5]{ |
| 169 | + \begin{changemargin}{0.25cm}{0.25cm} |
| 170 | + {\fontfamily{cmss}\selectfont |
| 171 | + \textcolor{customblue}{#3}\hfill\textcolor{customblue}{#4}\\ |
| 172 | + \begin{minipage}[t]{0.1\linewidth} |
| 173 | + \small{#1}\\{#2} |
| 174 | + \end{minipage} |
| 175 | + \begin{minipage}[t]{0.9\linewidth} |
| 176 | + \textcolor{customgrey}{#5} |
| 177 | + \end{minipage} |
| 178 | + } |
| 179 | + \end{changemargin} |
| 180 | +} |
| 181 | + |
| 182 | +% --------------------------------------------------------------------------- |
| 183 | + |
| 184 | +\newcommand{\makeheader}[3]{ |
| 185 | + \begin{tcolorbox}[colback=customblue!5,colframe=customblue!5,coltext=customblue] |
| 186 | + \Huge\textbf{{#1}} {#2} |
| 187 | + \tcblower |
| 188 | + \Large{#3} |
| 189 | + \end{tcolorbox} |
| 190 | +} |
| 191 | + |
| 192 | +% --------------------------------------------------------------------------- |
| 193 | + |
| 194 | +\newcommand{\makefooter}[3]{ |
| 195 | + \vfill |
| 196 | + \begin{tcolorbox}[colback=customblue!5,colframe=customblue!5,coltext=customblue] |
| 197 | + \fontfamily{cmss}\selectfont |
| 198 | + \faPhone\,{#1}\hfill\faMapMarker\,{#2}\hfill\faEnvelope\,{#3} |
| 199 | + \end{tcolorbox} |
| 200 | +} |
0 commit comments