-
Notifications
You must be signed in to change notification settings - Fork 0
/
resume-openfont.cls
227 lines (195 loc) · 6.15 KB
/
resume-openfont.cls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
% Intro Options
\ProvidesClass{resume-openfont}[2017/03/19 CV class]
\NeedsTeXFormat{LaTeX2e}
\DeclareOption{print}{\def\@cv@print{}}
\DeclareOption*{%
\PassOptionsToClass{\CurrentOption}{article}
}
\ProcessOptions\relax
\LoadClass{article}
\usepackage{scalerel}
\newcommand{\emoji}[1]{
{\setmainfont{Noto Color Emoji}[Renderer=Harfbuzz]{#1}}
}
\usepackage{babel}
% Package Imports
\usepackage[hmargin=1.25cm, vmargin=0.75cm]{geometry}
\usepackage[a-3u]{pdfx}
\hypersetup{%
hidelinks,
}
% Color definitions
\PassOptionsToPackage{usenames,dvipsnames}{xcolor}
% \usepackage[usenames,dvipsnames]{xcolor}
\definecolor{date}{HTML}{666666}
\definecolor{primary}{HTML}{2b2b2b}
\definecolor{headings}{HTML}{444444}
\definecolor{location}{HTML}{888888}
\definecolor{headingsrule}{HTML}{00b6ff}
\definecolor{subheadings}{HTML}{333333}
\definecolor{headingsrulegray}{HTML}{eeeeee}
% Set main fonts
\usepackage{fontspec}
% Disable ligatures to be machine readable
\defaultfontfeatures{Ligatures={NoRequired, NoCommon, NoContextual}}
\setmainfont[
Color=primary,
Path=fonts/lato/,
BoldItalicFont=Lato-Italic,
BoldFont=Lato-Regular,
ItalicFont=Lato-LightItalic
]{Lato-Light}
\setsansfont[Scale=MatchLowercase,Mapping=tex-text, Path = fonts/raleway/]{Raleway-ExtraLight}
% Date command
\usepackage[absolute]{textpos}
\usepackage[UKenglish]{isodate}
\setlength{\TPHorizModule}{1mm}
\setlength{\TPVertModule}{1mm}
\newcommand{\lastupdated}{\begin{textblock}{60}(155,8)
\color{date}\fontspec[Path = fonts/raleway/]{Raleway-ExtraLight}\fontsize{8pt}{10pt}\selectfont
Last Updated on \today
\end{textblock}}
% Name command
\newcommand{\namesection}[3]{
{
\noindent
\kern-0.35em
\fontsize{30pt}{30pt}
\fontspec[Path = fonts/roboto/]{Roboto-Thin}\selectfont #1
\fontspec[Path = fonts/roboto/]{Roboto-Light}\selectfont #2 \hfill \fontspec[Path = fonts/raleway/]{Raleway-Regular}
\fontsize{11pt}{14pt}\selectfont\noindent #3}\\
\color{headings}
%\noindent\makebox[\linewidth]{\color{headingsrule}\rule{\paperwidth}{0.4pt}}
%\vspace{-10pt}
}
% Section seperators
\usepackage[explicit]{titlesec}
\titlespacing{\section}{0pt}{0pt}{2pt}
\titlespacing{\subsection}{0pt}{0pt}{0pt}
\newcommand{\sectionsep}{\vspace{6pt}}
% Headings command
\titleformat
{\section}
{\color{headings}\scshape\fontspec[Path = fonts/lato/]{Lato-Light}\fontsize{15pt}{22pt}\selectfont}
{\kern-0.1ex}
{0em}
{\MakeUppercase{#1}}
[{\vspace{-.30em}\color{headingsrule}\titlerule[0.4pt]\vspace{.30em}}]
% Subeadings command
\titleformat
{\subsection}
{\color{subheadings}\fontspec[Path = fonts/lato/]{Lato-Bold}\fontsize{11pt}{11pt}\selectfont}
{\kern-0.05ex}
{0em}
{\MakeUppercase{#1}}
[]
\newcommand{\runsubsection}[1]{%
{\color{subheadings}\fontspec[Path = fonts/lato/]{Lato-Bold}\fontsize{11pt}{11pt}\selectfont\bfseries {#1} \normalfont}}
% Descriptors command
\newcommand{\descript}[1]{%
{\color{subheadings}\raggedright\scshape\fontspec[Path = fonts/raleway/]{Raleway-Medium}\fontsize{10pt}{12pt}\selectfont {| #1 \\} \normalfont}}
% Descriptors command
\newcommand{\subtitle}[1]{%
{\color{subheadings}\raggedright\scshape\fontspec[Path = fonts/raleway/]{Raleway-Medium}\fontsize{10pt}{12pt}\selectfont {#1 \\} \normalfont}}
% Location command
\newcommand{\location}[1]{%
{\color{location}\raggedright\fontspec[Path = fonts/raleway/,ItalicFont=Raleway-Light]{Raleway-Regular}\fontsize{9pt}{11pt}\selectfont {#1\\} \normalfont}\vspace{2pt}}
% Small heading command
\newcommand{\smallheading}[1]{%
{\color{headings}\raggedright\fontspec[Path = fonts/raleway/,ItalicFont=Raleway-Light]{Raleway-Medium}\fontsize{9pt}{11pt}\selectfont {#1\\} \normalfont}}
% Bullet Lists with fewer gaps command
\usepackage{enumitem}
\newenvironment{tightemize}{%
\vspace{-\topsep}
\begin{itemize}[leftmargin=1.8em]
\setlength
\itemsep{0.2em}
\parskip0pt
\parsep0pt
}
{\end{itemize}}
% Icons
\usepackage{fontawesome}
% Breakable page
\usepackage[skins,breakable]{tcolorbox} % see https://chat.stackexchange.com/transcript/message/36133154#36133154
\newenvironment{sidebar}[1]
{\begin{tcolorbox}[
width=0.66\textwidth,
enlarge left by=0.34\textwidth,
breakable, blanker,arc=0pt,outer arc=0pt,left=0pt,right=0pt,bottom=0pt,boxsep=0pt,top=0pt,
underlay unbroken and first={%
\node[inner sep=0pt, outer sep=0pt, text width=0.31\textwidth,
align=none,
below right]
at ([xshift=-0.34\textwidth]frame.north west)
{\begin{minipage}{\textwidth}#1\end{minipage}};}]}
{\end{tcolorbox}}
\usepackage{accsupp}
\newcommand{\altpdftext}[2]{%
\BeginAccSupp{method=escape,ActualText=#2}%
#1%
\EndAccSupp{}}
\tolerance=1
\emergencystretch=\maxdimen
\hyphenpenalty=7000
\hbadness=7000
\def\MyLaTeX{{\rm L\kern-.04em\lower-.2ex\hbox{\footnotesize A}\kern-.07em%
T\kern-.12em\lower.2ex\hbox{\small E}\kern-.05emX}}
\usepackage{fancyhdr}
% \usepackage{showframe}
\pagestyle{fancy}
\fancyhf{}
\usepackage{letltxmacro,xparse}
% \usepackage{soul}
% \setul{0.35ex}{0.4pt}
% \setulcolor{headingsrule}
%
% I don't use the soul package because for some reason it doesn't work
% with my fonts and xcolor, the whole configuration is not very happy
% Also, I read somewhere that soul is "fragile".
\usepackage[normalem]{ulem}
\newcommand\linkuline{\bgroup\markoverwith
{\textcolor{headingsrule}{\rule[-0.35ex]{2pt}{0.4pt}}}\ULon}
\LetLtxMacro\oldhref\href
\RenewDocumentCommand{\href}{o m m}{%
\IfValueTF{#1}
{\oldhref[#1]{#2}{\linkuline{#3}}}
{\oldhref{#2}{\linkuline{#3}}}%
}
\usepackage{ifthen}
\newcommand{\myage}[3]{
\newcounter{myage}
\setcounter{myage}{\the\year}
\addtocounter{myage}{-#1}
\ifthenelse{\the\month<#2}{\addtocounter{myage}{-1}}{}
\ifthenelse{\the\month=#2}{
\ifthenelse{\the\day < #3}{\addtocounter{myage}{-1}}{}
}{}
\themyage
}
\newenvironment{coursework}{%
\vspace{-0.6\topsep}\small\renewcommand\labelitemi{--}
\begin{itemize}[leftmargin=1.8em]
\setlength
\itemsep{0.08em}
\parskip0pt
\parsep0pt
}
{\normalsize\end{itemize}}
\definecolor{labels}{HTML}{aaaaaa}
% Language tags
\newtcbox{\badge}[1][red]{
grow to right by=-3pt,
enlarge bottom by=8pt,
on line,
arc=2pt,
colback=white,
colframe=labels,
fontupper=\scriptsize\strut,
boxrule=0.4pt,
boxsep=0pt,
left=2pt,
right=2pt,
top=2pt,
bottom=1pt
}