-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsoft-cv.cls
185 lines (168 loc) · 5.58 KB
/
soft-cv.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
% Identification
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{soft-cv}[2021/03/03 SoftCV]
% Class options
\LoadClass{article}
\ProcessOptions\relax
% Package definitions
\RequirePackage{xcolor}
\RequirePackage{ragged2e}
\RequirePackage{geometry}
\RequirePackage{ifthen}
\RequirePackage[hidelinks,unicode]{hyperref}
\RequirePackage{fontawesome}
\RequirePackage{enumitem}
\RequirePackage{tikz}
\RequirePackage[default,opentype]{sourcesanspro}
% Layout setup
\geometry{left=2.0cm, top=1.5cm, right=2.0cm, bottom=2.0cm, footskip=.5cm}
\thispagestyle{empty}
\setlength{\parindent}{0pt}
% Font setup
\newfontfamily\nameFont[Path=fonts/, LetterSpace=10]{ModerneSans}
\newfontfamily\sectionTitleFont[Path=fonts/, LetterSpace=10]{ModerneSans}
\newfontfamily\monoFont[Path=fonts/]{SpaceMono}
\newcommand*{\bodyfont}{\sourcesanspro}
\newcommand*{\bodyfontlight}{\sourcesansprolight}
% Colour definitions
\definecolor{cvBlue}{RGB}{7,82,242}
\definecolor{cvRed}{RGB}{214, 4, 4}
\definecolor{cvGreen}{RGB}{88,171,5}
\colorlet{cvDarkBlue}{cvBlue!70!black}
\colorlet{cvDarkRed}{cvRed!70!black}
\colorlet{cvDarkGreen}{cvGreen!70!black}
% Configuration commands
\def\cvThemeColor{blue}
\newcommand*{\themeColor}[1]{\def\cvThemeColor{#1}}
\newcommand*{\name}[1]{\def\cvName{#1}}
\newcommand*{\tagline}[1]{\def\cvTagline{#1}}
\newcommand*{\email}[1]{\def\cvEmail{#1}}
\newcommand*{\web}[1]{\def\cvWeb{#1}}
\newcommand*{\linkedin}[1]{\def\cvLinkedin{#1}}
\newcommand*{\github}[1]{\def\cvGithub{#1}}
\newcommand*{\skills}[1]{\def\cvSkills{#1\vspace{8pt}}}
\newcommand*{\projects}[1]{\def\cvProjects{#1}}
\newcommand*{\contact}[1]{\def\cvContact{#1}}
\newcommand{\about}[1]{\def\cvAbout{#1\vspace{8pt}\\}}
\newcommand*{\experience}[1]{\def\cvExperience{#1}}
\newcommand*{\education}[1]{\def\cvEducation{#1}}
% Style commands
\newcommand*{\headerNameStyle}[1]{{\color{darkgray}\fontsize{28pt}{1em}\MakeUppercase{\nameFont{#1}}}}
\newcommand*{\taglineStyle}[1]{{\color{\cvThemeColor!75}\fontsize{8pt}{1em}\MakeUppercase{\bodyfont{#1}}}}
\newcommand*{\sectionTitleStyle}[1]{{\color{\cvThemeColor}\fontsize{10pt}{1em}\MakeUppercase{\sectionTitleFont{#1}}}}
\newcommand*{\subsectionTitleStyle}[1]{{\color{darkgray}\fontsize{9pt}{1em}{\textbf{\MakeUppercase{\bodyfont{#1}}}}}}
\newcommand*{\subsubsectionTitleStyle}[1]{{\fontsize{8pt}{1em}\bodyfont\textbf{\scshape\color{gray} #1}}}
\newcommand*{\locationStyle}[1]{{\color{\cvThemeColor}\fontsize{8pt}{1em}\bodyfontlight\textit{#1}}}
\newcommand*{\datesStyle}[1]{{\color{darkgray}\fontsize{8pt}{1em}\bodyfontlight\textit{#1}}}
\newcommand*{\contactStyle}[1]{{\fontsize{8pt}{1em}\color{darkgray}\monoFont{#1}}}
\newcommand*{\bodyStyle}[1]{{\small\color{darkgray}{#1}}}
% a section within the cv (skills/education/experience/etc)
% args:
% #1: section title [skills]
% #2: section content
\newcommand*{\mkSection}[2]{
\RaggedRight{
\sectionTitleStyle{#1}
\vspace{-5pt}\\
{\hrulefill}
\vspace{7pt}\\
{#2}
\vspace{7pt}
}
}
% an entry within the contact section
% args:
% #1: URL to hyperlink to
% #2: value to display
% #3: icon (font awesome) to include
\newcommand*{\contactItem}[3]{
\hspace{-11pt}
\contactStyle{
\href{#1}{\raisebox{-3.5pt}{
\begin{tikzpicture}
\node at (0,0) [draw,fill=\cvThemeColor!30] {\fontsize{9pt}{1em}{#3}};
\end{tikzpicture}
} \hspace{-10pt} #2}
\vspace{6pt}
}\\
}
% an entry within the skills section
% args:
% #1: skill to list [scala]
\newcommand*{\skillsItem}[1]{
\bodyStyle{#1}\vspace{5pt}\\
}
% an entry within a section
% args:
% #1: title [company A]
% #2: location [vancouver]
% #3: cvSubEntries
\newcommand{\cvEntry}[3]{
\subsectionTitleStyle{#1} \hfill \locationStyle{#2}\\
{#3}
\vspace{8pt}
}
% an subentry within a section
% args:
% #1: subtitle [software engineer]
% #2: date(s) of entry [Jan. 2019 - PRESENT]
% #3: body
\newcommand{\cvSubEntry}[3]{
\vspace{3pt}
\subsubsectionTitleStyle{#1} \hfill \datesStyle{#2}\\
{#3}
}
% a list residing within a cvEntry
% args:
% #1: the set of \item entries for listing [\item A \\ \item B]
\newcommand{\entryItems}[1]{
\bodyStyle{
\begin{itemize}[leftmargin=*]
{#1}
\end{itemize}
}
}
% constructs the contact section based on the defined contact items
\newcommand{\mkContact}{
\ifthenelse{\equal{\cvEmail}{}}{}{\contactItem{mailto:\cvEmail}{\cvEmail}{\faEnvelope}}
\ifthenelse{\equal{\cvWeb}{}}{}{\contactItem{https://\cvWeb}{\cvWeb}{\faHome}}
\ifthenelse{\equal{\cvLinkedin}{}}{}{\contactItem{https://www.linkedin.com/in/\cvLinkedin}{\cvLinkedin}{\faLinkedin}}
\ifthenelse{\equal{\cvGithub}{}}{}{\contactItem{https://github.com/\cvGithub}{\cvGithub}{\faGithub}}
}
% mkHeader will construct the header of the document
% this includes the name and the tagline
\newcommand*{\mkHeader}{
\begin{minipage}[t]{\linewidth}
\RaggedLeft{
\headerNameStyle{\cvName}\\
\taglineStyle{\cvTagline}
}
\end{minipage}
\vspace{20pt}
}
% mkBody constructs the body of the cv
% this includes the left side, split, and right side
\newcommand{\mkBody}{
\newcommand{\mkLeft}{
\begin{minipage}[t]{0.25\linewidth}
\mkSection{Skills}{{\cvSkills}}
\mkSection{Projects}{{\cvProjects}}
\mkSection{Contact}{{\mkContact}}
\end{minipage}
}
\newcommand{\mkSplit}{
\hspace{5pt}
\color{\cvThemeColor!80!black}\vrule width 1pt
\hspace{5pt}
}
\newcommand{\mkRight}{
\begin{minipage}[t]{0.75\linewidth}
\ifthenelse{\equal{\cvAbout}{}}{}{\mkSection{About}{{\bodyStyle{\cvAbout}}}}
\mkSection{Experience}{{\cvExperience}}
\mkSection{Education}{{\cvEducation}}
\end{minipage}
}
{\mkLeft}
{\mkSplit}
{\mkRight}
}