-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresunate.cls
executable file
·255 lines (220 loc) · 8.73 KB
/
resunate.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
%-----------------------------------------------------------
% summary : resunate - an enchanting resume document class
% author : naasir ramji (naasir.ramji@gmail.com)
%
% TODO : [ ] add class options
% : [ ] add profile picture
%-----------------------------------------------------------
%-----------------------------------------------------------
% identification
%-----------------------------------------------------------
\ProvidesClass{resunate}[2012/06/05 - An enchanting resume document class]
\LoadClass[10pt, oneside, final]{scrartcl}
%-----------------------------------------------------------
% packages
%-----------------------------------------------------------
\RequirePackage[hmargin=0.5in,top=0.7in,bottom=0.6in]
{geometry} % set page margins
\RequirePackage{soul} % space out
\RequirePackage{scrpage2} % control page headers and footers
\RequirePackage{titlesec}
\RequirePackage{marvosym} % email/phone symbols
\RequirePackage{color} % text color
\RequirePackage{tabularx,colortbl} % table support w/ color
\RequirePackage{multirow} % multirow (merged) rows
\RequirePackage{fontspec} % specify fonts
\RequirePackage{xifthen} % if...then...else construct
\RequirePackage{pbox} % auto-width paragraph boxes
\RequirePackage{tikz} % rounded corners
\RequirePackage{hyperref} % hyperlinks
\RequirePackage{enumitem} % list environments
\usetikzlibrary{shapes,decorations}
%-----------------------------------------------------------
% options
%-----------------------------------------------------------
% margins? row colors? hyperlinks? column widths?
%-----------------------------------------------------------
% style
%-----------------------------------------------------------
% remove page numbers
\thispagestyle{empty}
% enable customized headers and footers
\pagestyle{scrheadings}
% interpret dashes (-, --, ---) correctly
% NOTE: in order for this to work, this line has to be above any font definitions
\defaultfontfeatures{Mapping=tex-text}
% setup fonts
\setromanfont{Day Roman}
\setsansfont{Myriad Pro}
\newfontfamily{\icon}{FontAwesome}
% increase the size of the largest font
\renewcommand{\Huge}{\fontsize{32}{40}\selectfont}
% make sans serif the default
\renewcommand*\familydefault{\sfdefault}
% change header font
\renewcommand{\headfont}{\normalfont\rmfamily\scshape}
% TODO: what does this do?
\titleformat{\section}{\large\scshape\raggedleft}{}{0em}{}[\titlerule]
% customize hyperlinks
\hypersetup{
colorlinks=false,
pdfborder={0 0 0}
}
% list options
\setlist{nolistsep}
%-----------------------------------------------------------
% constants
%-----------------------------------------------------------
% primary columns
\newlength{\titleColumnWidth}
\setlength{\titleColumnWidth}{0.25\textwidth}
\newlength{\contentColumnWidth}
\setlength{\contentColumnWidth}{0.65\textwidth}
\newlength{\columnPadding}
\setlength{\columnPadding}{0.05\textwidth}
% colors
\definecolor{iconcolor}{HTML}{000000}
\definecolor{subtletextcolor}{HTML}{7A7A7A}
\definecolor{highlightcolor}{HTML}{490778}
\definecolor{accentboxcolor}{HTML}{EFEFEF}
% tikzstyle : roundedrectangle
\tikzstyle{roundedrectangle} = [
fill=accentboxcolor,
rectangle,
rounded corners,
inner sep=0.5em,
]
% table row height
\renewcommand{\arraystretch}{2.0}
%-----------------------------------------------------------
% icons
%-----------------------------------------------------------
\def\rightarrow{{\icon \symbol{"F061}}}
\def\wrench{{\icon \symbol{"F0AD}}}
%-----------------------------------------------------------
% variables
%-----------------------------------------------------------
\newcommand*{\name}[1]{\def\@name{#1}}
\newcommand*{\phone}[1]{\def\@phone{#1}}
\newcommand*{\email}[1]{\def\@email{#1}}
\newcommand*{\website}[1]{\def\@website{#1}}
\newcommand*{\blurb}[1]{\def\@blurb{#1}}
%-----------------------------------------------------------
% overrides
%-----------------------------------------------------------
%-----------------------------------------------------------
% summary : generates the header for the page
% usage : \maketitle
%-----------------------------------------------------------
\renewcommand*{\maketitle}{%
\textrm{\bfseries{\Huge{\@name\\[12pt]}}}
\ifthenelse{\isundefined{\@phone}}{}{{\textcolor{iconcolor}{{ \Telefon} \@phone\\}}}
\ifthenelse{\isundefined{\@email}}{}{{\textcolor{iconcolor}{{\Letter} \@email\\}}}
\ifthenelse{\isundefined{\@website}}{}{{\textcolor{iconcolor}{{\Pointinghand} \@website\\[12pt]}}}
\ifthenelse{\isundefined{\@blurb}}{}{{\@accentbox{\@blurb}}}
}
%-----------------------------------------------------------
% usage : \begin{document} ... \end{document}
%-----------------------------------------------------------
\newenvironment{resume}%
{\begin{@layouttable}}
{\end{@layouttable}}
%-----------------------------------------------------------
% summary : the resume abstract (or profile)
% usage : \begin{abstract} ... \end{abstract}
%-----------------------------------------------------------
\renewenvironment{abstract}%
{\begin{minipage}[t]{\titleColumnWidth}}
{\end{minipage}}
%-----------------------------------------------------------
% summary : the resume body
% usage : \begin{body} ... \end{body}
%-----------------------------------------------------------
\newenvironment{body}%
{\begin{minipage}[t]{\contentColumnWidth}}
{\end{minipage}}
%-----------------------------------------------------------
% summary : a typical section of the resume (education, experience, etc...)
% usage : \begin{section}{title}...\end{section}
%-----------------------------------------------------------
\renewenvironment{section}[1]%
{\@sectiontitle{#1}}
{\vspace{12pt}}
%-----------------------------------------------------------
% public methods
%-----------------------------------------------------------
%-----------------------------------------------------------
% summary : makes the specified text appear subtle (de-emphasizes it)
% usage : \subtle
%-----------------------------------------------------------
\newcommand{\subtle}[1]{%
\textcolor{subtletextcolor}{#1}
}
%-----------------------------------------------------------
% summary : a general entry
% usage : \entry{title}{subtitle}{body}
%-----------------------------------------------------------
\newcommand{\entry}[3]{%
\textit{#1} \hfill \subtle{#2}\\#3
\vspace{5pt}
}
%-----------------------------------------------------------
% summary : a work related entry
% usage : \workentry{start-date}{end-date}{position}{organization}{location}{content}
%-----------------------------------------------------------
\newcommand{\workentry}[6]{%
{\vspace{7pt}}
{\large\textbf{#3}}\\
#4 -- #5 \hfill \textcolor{highlightcolor}{#1 {\footnotesize \rightarrow} #2}\\[5pt]
{#6}
\vspace{5pt}
}
%-----------------------------------------------------------
% private methods
%-----------------------------------------------------------
%-----------------------------------------------------------
% summary : a row in the layout table
% usage : \@layoutrow{title}{body}
%-----------------------------------------------------------
\newcommand{\@layoutrow}[2]{%
\begin{minipage}[t]{\titleColumnWidth}
#2
\end{minipage}
&
\begin{minipage}[t]{\contentColumnWidth}
#1
\end{minipage}\\
}
%-----------------------------------------------------------
% summary : a two column table layout
% usage : \begin{@layouttable} ... \end{@layouttable}
%-----------------------------------------------------------
\newenvironment{@layouttable}%
{\begin{tabular*}{\linewidth}%
{>{\raggedleft}p{\titleColumnWidth}X %
@{\hspace{\columnPadding}} %
p{\contentColumnWidth} %
}
}
{\end{tabular*}}
%-----------------------------------------------------------
% summary : a section title (listed in the title column)
% usage : \@sectiontitle{name}
%-----------------------------------------------------------
\newcommand{\@sectiontitle}[1]{%
{\LARGE\textrm{\textbf{#1}}}\\[-5pt]
{\color{subtletextcolor}\line(1,0){340}}\\[-10pt]
}
%-----------------------------------------------------------
% summary : an accented box of text
% usage : \@accentbox{text}
%-----------------------------------------------------------
\newcommand{\@accentbox}[1]{%
\begin{tikzpicture}[baseline=0.5em]
\node[roundedrectangle](box){%
\begin{minipage}{0.97\linewidth}
#1
\end{minipage}
};
\end{tikzpicture}
}