-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtwo-column-resume.cls
156 lines (135 loc) · 5.17 KB
/
two-column-resume.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
%%
% Resume | Jason Yao
%
% References:
% Debarghya Das (http://debarghyadas.com)
% %
% Intro Options
\ProvidesClass{two-column-resume}[]
\NeedsTeXFormat{LaTeX2e}
\DeclareOption{print}{\def\@cv@print{}}
\DeclareOption*{%
\PassOptionsToClass{\CurrentOption}{article}
}
\ProcessOptions\relax
\LoadClass{article}
% Package Imports
\usepackage[hmargin=1.5cm, vmargin=1.5cm]{geometry}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{titlesec}
\usepackage[unicode=true]{hyperref}
\usepackage[absolute]{textpos}
\usepackage[UKenglish]{babel}
\usepackage[UKenglish]{isodate}
\usepackage{fontspec,xltxtra,xunicode}
\usepackage{fontawesome}
\pagenumbering{gobble}
\usepackage{datetime2}
\usepackage{graphicx} % Used to render company logos
\graphicspath{{assets}}
% Color definitions
\definecolor{date}{HTML}{669999}
\definecolor{primary}{HTML}{000000}
\definecolor{headings}{HTML}{0E0E0F}
\definecolor{subheadings}{HTML}{1A1C1E}
% Set main fonts
\defaultfontfeatures{Mapping=tex-text}
\setmainfont[
Color=primary,
Path = fonts/IM_Fell_Great_Primer/,
Scale=1.09,
BoldFont={../Lora/Lora-Bold} % Relative path hack to get bolds to show
]{IMFeGPrm28P}
% Last updated format
\DTMnewdatestyle{mylastupdate}{%
\renewcommand*{\DTMdisplaydate}[4]{\DTMtwodigits{##2}.\DTMtwodigits{##3}.##1}\color{date}\fontspec[Path = fonts/IM_Fell_Great_Primer/]{IMFeGPrm28P}\fontsize{12pt}{12pt}\selectfont%
\renewcommand*{\DTMDisplaydate}{\DTMdisplaydate}%
}
% Name command
\newcommand{\namesection}[2]{
\hspace{-1.7em}\raggedright{\parbox[b]{30em}{\fontspec[Path = fonts/IM_Fell_French_Canon_SC/]{IMFeFCsc28P}\fontsize{58pt}{0cm}\selectfont \MakeUppercase{#1}}}
\hfill
% To increase the amount of space available for the links, increment the below's em value
\raggedleft{\parbox[b]{15em}{\color{headings}\fontspec[Path = fonts/IM_Fell_Great_Primer/]{IMFeGPrm28P}\fontsize{11pt}{14pt}\selectfont #2}}
\vspace{2.2em}
}
% Section formatting
\titleformat{\section}{\color{headings}
\scshape\fontspec[Path = fonts/Arbutus_Slab/]{ArbutusSlab-Regular}\fontsize{18pt}{24pt}\selectfont \raggedright\uppercase}{} {0em}{}[{\titlerule[0.8pt]}]
\titlespacing{\section}{0pt}{0pt}{5pt}
% Subsection formatting
\titleformat{\subsection}{\color{subheadings}
\fontspec[Path = fonts/Lora/]{Lora-Bold}\fontsize{14pt}{14pt}\selectfont\bfseries}{}{0em}{}
\titlespacing{\subsection}{0pt}{\parskip}{-\parskip}
% Subsubsection formatting
\titleformat{\subsubsection}{\color{subheadings}
\fontspec[Path = fonts/Lora/]{Lora-Bold}\fontsize{12pt}{12pt}\selectfont\bfseries}{}{1em}{}
\titlespacing{\subsubsection}{0pt}{\parskip}{-\parskip}
% Grouped logic section formatting
\newcommand{\runsubsection}[1]{\color{subheadings}
\fontspec[Path = fonts/Lora/]{Lora-Bold}\fontsize{12pt}{12pt}\selectfont\bfseries {#1} \normalfont}
% Gives the years & months difference between two dates
% Initial base code from: https://tex.stackexchange.com/questions/14518/difference-between-two-dates/14519#14519
\usepackage{datenumber}
\usepackage{calc}
\newcounter{datetoday}
\newcounter{diffyears}
\newcounter{diffmonths}
\newcounter{diffdays}
\newcommand{\diffdates}[4]{%
\setmydatenumber{datetoday}{#1}{#2}{01}%
\setmydatenumber{diffdays}{#3}{#4}{01}%
\addtocounter{diffdays}{-\thedatetoday}%
\ifnum\value{diffdays}>0
\def\diffbefore{in }%
\def\diffafter{}%
\else
\def\diffbefore{}%
\def\diffafter{ago}%
\setcounter{diffdays}{-\value{diffdays}}%
\fi
\setcounter{diffyears}{\value{diffdays}/365}%
\setcounter{diffdays}{\value{diffdays}-365*\value{diffyears}}%
\setcounter{diffmonths}{\value{diffdays}/30}%
\setcounter{diffdays}{\value{diffdays}-30*\value{diffmonths}}%
%
\ifnum\value{diffyears}=0
\ifnum\value{diffmonths}=0
Current month start\fi
\else
\ifnum\value{diffyears}>1
\thediffyears\space years,
\else
\thediffyears\space year,
\fi
\fi
\ifnum\value{diffmonths}=0
\else
\ifnum\value{diffmonths}>1
\thediffmonths\space months\else\thediffmonths\space month\fi
\fi
}
% Workplace display command
\newcommand{\workplace}[4]{
\subsection{
\texorpdfstring{{\includegraphics[width=1.25em]{#1}}\thickspace{#2}\hfill{\normalfont #3 (#4)}}{#1}
}
}
% New position command
\newcommand{\position}[2]{
\subsubsection{
{#1}\hfill{\normalfont #2}
}
}
% Suppresses the subsubsection numbering while keeping it in the ToC
\renewcommand\thesubsubsection{}
% Descriptors command
\newcommand{\descript}[1]{\color{subheadings}\raggedright\scshape\fontspec[Path = fonts/IM_Fell_Great_Primer/]{IMFeGPrm28P}\fontsize{11pt}{13pt}\selectfont {#1 \\} \normalfont}
% Location command
\newcommand{\location}[1]{\color{primary}\raggedright\fontspec[Path = fonts/IM_Fell_Great_Primer/]{IMFeGPrm28P}\fontsize{11pt}{12pt}\selectfont {#1\\} \normalfont}
% Section seperators command
\newcommand{\sectionsep}[0]{\vspace{8pt}}
% Bullet Lists with fewer gaps command
\newenvironment{tightemize}{\vspace{-\topsep}\begin{itemize}\itemsep1pt \parskip0pt \parsep0pt}{\end{itemize}\vspace{-\topsep}}
% Sets up hyperlink coloring
\hypersetup{colorlinks=true,urlcolor=blue} % Turns the hyperlinks blue