-
Notifications
You must be signed in to change notification settings - Fork 2
/
resume.cls
266 lines (223 loc) · 8.58 KB
/
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
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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% LaTeX Resume Template - Class File
% https://github.com/rohit-gohri/resume-template
%
% This class file defines the structure and design of the template. For content see the `resume.tex` file.
%
% Version: v1.1.0 (2023/06/24)
% By Rohit Gohri (https://rohit.page)
%
% Copyright (C) 2023 by Rohit Gohri
%
%%%%%%%%%%%% Based On: %%%%%%%%%%%%
% Medium Length Professional CV
%
% This template has been downloaded from:
% http://www.LaTeXTemplates.com
%
% Trey Hunner (http://www.treyhunner.com/)
% Version 2.0 (8/5/13)
%
% Copyright (C) 2010 by Trey Hunner
%
% Copying and distribution of this file, with or without modification,
% are permitted in any medium without royalty provided the copyright
% notice and this notice are preserved. This file is offered as-is,
% without any warranty.
%
% Created by Trey Hunner and modified by www.LaTeXTemplates.com
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ProvidesClass{resume}[2020/05/03 v1.0.0 Resume Class]
\LoadClass[10pt,letterpaper]{article} % Font size and paper type
\usepackage[parfill]{parskip} % Remove paragraph indentation
\usepackage{array} % Required for boldface (\bf and \bfseries) tabular columns
\usepackage{ifthen} % Required for ifthenelse statements
\usepackage{babel}
\usepackage[stretch=10]{microtype}
\usepackage[sc]{mathpazo} % Required for `Palatino` font
\usepackage{hyperref} % Required for creating links (\href)
\usepackage{xcolor}
\usepackage{trimspaces} % Required for triming variable values (https://tex.stackexchange.com/a/484290)
\usepackage{fontawesome} % Required for icons. List of available icons at http://ctan.imsc.res.in/fonts/fontawesome/doc/fontawesome.pdf
\usepackage{datetime} % Required for custom date formatting
\usepackage[left=0.6in,top=0.2in,right=0.6in,bottom=0.2in]{geometry} % Required for setting Document margins
\pagestyle{empty} % Suppress page numbers
\hypersetup{
colorlinks={true}, %Colours links instead of ugly boxes
linkcolor={red!50!black}, %Colour of internal links
citecolor={blue!50!black}, %Colour of citations
% urlcolor={blue!40!black}, %Colour for external hyperlinks
urlcolor={black}, %Colour for external hyperlinks
pdftitle={Resume}
}
\newdateformat{monthyeardate}{
\shortmonthname[\THEMONTH]. \THEYEAR
}
\newdateformat{yeardate}{
\THEYEAR
}
\newcommand{\fmtdate}[3][1]{%
\unskip{% group start to scope date name
\ifthenelse{\equal{#2}{}}{% If the 2nd arg is not provided only print the year
\newdate{anon}{#1}{1}{#3}%
\yeardate\displaydate{anon}%
}{%
\newdate{anon}{#1}{#2}{#3}%
\monthyeardate\displaydate{anon}%
}}}
\newcommand{\draft}[2][false]{%
{% group start to scope date name
% From: https://tex.stackexchange.com/a/243879
\newbox\anonvhbox
\newboolean{IncludeAnonItem}
\setboolean{IncludeAnonItem}{#1}
\setbox\anonvhbox\vbox{%
#2
\unskip\unpenalty\unpenalty}
\ifthenelse{\boolean{IncludeAnonItem}}{
\unvbox\anonvhbox
}{ }
}}
% NOTE: Deprecated
\newcommand{\showif}[2][false]{\draft[#1]{#2}}
% Normalized italics
\newcommand{\nem}[1]{\normalfont \em #1}
\newcommand{\tab}[1]{\hspace{.2667\textwidth}\rlap{#1}}
\newcommand{\itab}[1]{\hspace{0em}\rlap{#1}}
\newcommand*{\trim}[1]{%
\trim@spaces@noexp{#1}%
}
%----------------------------------------------------------------------------------------
% HEADINGS COMMANDS: Commands for printing name and links
%
% Defines the commands to set variables and sets empty defaults
%----------------------------------------------------------------------------------------
\def \name#1{\def\@name{#1}}
\def \@name {}
\def \setCity#1{\def\@getCity{#1}}
\def \@getCity {}
\def \setEmail#1{\def\@getEmail{\trim{#1}}}
\def \@getEmail {}
\def \setPhoneNum#1{\def\@getPhoneNum{#1}}
\def \@getPhoneNum {}
\def \setLinkedIn#1{\def\@getLinkedIn{\trim{#1}}}
\def \@getLinkedIn {}
\def \setLinkedInLink#1{\def\@getLinkedInLink{\trim{#1}}}
\def \@getLinkedInLink {https://linkedin.com/in/\@getLinkedIn}
\def \setGithub#1{\def\@getGithub{\trim{#1}}}
\def \@getGithub {}
\def \setGithubLink#1{\def\@getGithubLink{\trim{#1}}}
\def \@getGithubLink {https://github.com/\@getGithub}
\def \setWebsite#1{\def\@getWebsite{\trim{#1}}}
\def \@getWebsite {}
\def \setWebsiteLink#1{\def\@getWebsiteLink{\trim{#1}}}
\def \@getWebsiteLink {https://\@getWebsite}
% NOTE: Deprecated
\def \setCustomLink#1{\def\@getWebsite{\trim{#1}}}
\def \setPdfKeywords#1{\def\@getPdfKeywords{#1}}
\def \@getPdfKeywords {}
\def \setPdfSubject#1{\def\@getPdfSubject{#1}}
\def \@getPdfSubject {}
\def \linkSeparator {$\diamond$} % Set default separator to a diamond
\def \printLinks {
\begingroup
\def \\ {\linkSeparator\ }
\centerline{%
\ifthenelse{\equal{@getCity}{}}{}{%
\faMapMarker \hspace{0.2mm} \@getCity}
\ifthenelse{\equal{@getEmail}{}}{}{%
\href {mailto:\@getEmail}
{\faEnvelope \hspace{0.2mm} \@getEmail}}
\ifthenelse{\equal{@getLinkedIn}{}}{}{%
\href {\@getLinkedInLink}
{\faLinkedin \hspace{0.2mm} \@getLinkedIn}}
\ifthenelse{\equal{@getGithub}{}}{}{%
\href {\@getGithubLink}
{\faGithub \hspace{0.2mm} \@getGithub}}
\ifthenelse{\equal{@getWebsite}{}}{}{%
\href {\@getWebsiteLink}
{\faLink \hspace{0.2mm} \@getWebsite}}
% \ifthenelse{\equal{@getPhoneNum}{}}{}{%
% \faPhone \hspace{0.2mm} \@getPhoneNum}
}
\endgroup
\par
\smallskip
}
% \printname is used to print the name as a page header
\def \printname {
\begingroup
\hfil{\MakeUppercase{\namesize\bf \@name}}\hfil
\nameskip\break
\endgroup
}
%----------------------------------------------------------------------------------------
% PRINT THE HEADING LINES
%----------------------------------------------------------------------------------------
\let\ori@document=\document
\renewcommand{\document}{
\ori@document % Begin document
\hypersetup{
pdftitle={ \@name's Resume },
pdfauthor={ \@name <\@getEmail> },
pdfsubject={ \@getPdfSubject },
pdfkeywords={ \@getPdfKeywords }
}
\printname % Print the name specified with \name
\printLinks
}
%----------------------------------------------------------------------------------------
% SECTION FORMATTING
%----------------------------------------------------------------------------------------
% Defines the rSection environment for the large sections within the CV
\newenvironment{rSection}[1]{ % 1 input argument - section name
\sectionskip
\MakeUppercase{\bf #1} % Section title
\sectionlineskip
\hrule % Horizontal line
\begin{list}{}{ % List for each individual item in the section
\setlength{\leftmargin}{1.5em} % Margin within the section
}
\item[]
}{
\end{list}
}
%----------------------------------------------------------------------------------------
% WORK EXPERIENCE FORMATTING
%----------------------------------------------------------------------------------------
\newcommand{\rSubsectionHeading}[4]{ % 4 input arguments - title, date range, job title and location
\ifthenelse{\equal{#4}{} \AND \NOT \equal{#3}{}}{ % If 3 args are provided
{\ifthenelse{\equal{#1}{}}{}{\bf #1,} {\normalfont \em #3}} \hfill {\em #2}
}{
\ifthenelse{\equal{#3}{}}{% If 2 args are provided
{\bf #1} \hfill {\normalfont \em #2} % Bold title and italics date on the right
}{ % If 4 args are provided
{\bf #1} \hfill {\normalfont #4} % Bold title and normal font location
\\ \normalfont {\em #3} \hfill {\em #2} % Italic job title and italics date on the right
}\unskip
}\unskip
}{}
\newenvironment{rSubsection}[4]{ % 4 input arguments - company name, date range, job title and location
\rSubsectionHeading{#1}{#2}{#3}{#4}
\smallskip
\begin{list}{$\cdot$}{\leftmargin=0em\normalfont} % \cdot used for bullets, no indentation
\itemsep -0.5em \vspace{-0.5em} % Compress items in list together for aesthetics
}{
\end{list}
\vspace{0.5em} % Some space after the list of bullet points
}
\newenvironment{rSubsectionSimple}{
\smallskip
\smallskip
\begin{list}{$\cdot$}{\leftmargin=0em\normalfont} % \cdot used for bullets, no indentation
\itemsep -0.5em \vspace{-0.5em} % Compress items in list together for aesthetics
}{
\end{list}
\vspace{0.5em} % Some space after the list of bullet points
}
% The below commands define the whitespace after certain things in the document - they can be \smallskip, \medskip or \bigskip
\def\namesize{\huge} % Size of the name at the top of the document
\def\sectionlineskip{\medskip} % The space above the horizontal line for each section
\def\nameskip{\bigskip} % The space after your name at the top
\def\sectionskip{\medskip} % The space after the heading section