-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtwentyonesecondcv.cls
executable file
·383 lines (315 loc) · 12.7 KB
/
twentyonesecondcv.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
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Twenty One Seconds Resume/CV
% LaTeX Template
% Version 1.2 (2024/06/26)
%
% This template has been downloaded from:
% http://www.LaTeXTemplates.com
%
% License
% Original author:
% Carmine Spagnuolo ([email protected]) with major modifications by
% Alessandro Trinca Tornidor (alessandro at trinca dot tornidor dot com)
%% Copyright 2023-now Alessandro Trinca Tornidor (alessandro at trinca dot tornidor dot com)
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is Alessandro Trinca Tornidor
%
% This work consists of the files template.tex and twentyonesecondcv.cls
% and the derived file twentyonesecondcv.pdf
% see https://github.com/trincadev/cv-latex-twentyoneseconds/ for updates
\ProvidesClass{twentyonesecondcv}[2017/01/08 CV class]
\LoadClass{article}
\NeedsTeXFormat{LaTeX2e}
% page layout packages
\usepackage{blindtext}
\usepackage{xcolor}
\usepackage{geometry}
\usepackage{titlesec}
\usepackage[most]{tcolorbox}
\geometry{margin=0pt}
%%
\RequirePackage[sfdefault]{ClearSans}
\RequirePackage[T1]{fontenc}
\RequirePackage{tikz}
\RequirePackage[absolute,overlay]{textpos}
\RequirePackage{ragged2e}
\RequirePackage{etoolbox}
\RequirePackage{ifmtarg}
\RequirePackage{ifthen}
\RequirePackage{pgffor}
\RequirePackage{marvosym}
\RequirePackage{parskip}
\RequirePackage{fontawesome}
\RequirePackage{etoolbox}
\usepackage{hyperref}
\usepackage{lastpage}
\usepackage{setspace}
\usepackage{graphicx}
\graphicspath{ {./} }
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions\relax
%%%%%%%%%% end packages
\pagestyle{empty}
\hypersetup{colorlinks=true,linkcolor=blue,urlcolor=blue}
\definecolor{gray}{HTML}{4D4D4D}
\definecolor{sidecolor}{HTML}{f2f2f2}
\definecolor{mainblue}{HTML}{000F61}
\definecolor{maingray}{HTML}{f2f2f2}
\definecolor{bluecolorurl}{HTML}{142376}
\newcommand{\graytext}[1]{\textcolor{gray}{#1}}
% ------------------ page layout ------------------------- %
% https://tex.stackexchange.com/a/310989/109031
% https://tex.stackexchange.com/questions/220094/vertical-spacing-vfill-inside-tcolorbox
% options, from tcolorbox package docs: https://ctan.mirror.garr.it/mirrors/ctan/macros/latex/contrib/tcolorbox/tcolorbox.pdf
% - nobeforeafter: Abbreviation for clearing the keys before and after. The colored box is not put into a paragraph and there is no space before or after the box.
% - boxrule=0pt: boxrule=⟨length⟩ (style, no default, initially 0.5mm) Sets all rules of the frame to ⟨length⟩
% - enhanced jigsaw: abbreviation for skin=enhanced, while this skin translates the drawing commands of the core package into tikz path commands
% - height=⟨length⟩ Sets the total height of the colored box to ⟨length⟩ independent of the box content. (no default)
% - text fill This style sets /tcb/before upper→ P. 70 and /tcb/after upper→ P. 71 to embed the upper part with a minipage. This allows to use vertical glue macros like \vfill to act like expected. If the box has no fixed height, setting /tcb/text fill has no other effect as making the box unbreakable. (style, no value)
\newtcolorbox{sidebgbox}[1][]{nobeforeafter,boxrule=0pt,enhanced jigsaw,height=\heigthpage,text fill,#1}
\newtcolorbox{bgbox}[1][]{nobeforeafter,boxrule=0pt,enhanced jigsaw,#1}
\newcommand{\sidesection}[1]{%
\noindent
\begin{sidebgbox}[height=\paperheight,colback=sidecolor,width=0.33\textwidth]
#1
\end{sidebgbox}%
}
\newcommand{\mainsection}[1]{%
\noindent
\begin{bgbox}[height=\paperheight,colback=white,width=0.67\textwidth]
#1
\end{bgbox}%
}
%----------------------------------------------------------------------------------------
% SIDEBAR DEFINITIONS
%----------------------------------------------------------------------------------------
\setlength{\TPHorizModule}{1cm} % Left margin
\setlength{\TPVertModule}{1cm} % Top margin
\newlength\imagewidth
\newlength\imagescale
\pgfmathsetlength{\imagewidth}{5cm}
\pgfmathsetlength{\imagescale}{\imagewidth/600}
\newlength{\TotalSectionLength} % Define a new length to hold the remaining line width after the section title is printed
\newlength{\SectionTitleLength} % Define a new length to hold the width of the section title
\newcommand{\profilesection}[1]{%
\setlength\TotalSectionLength{\linewidth}% Set the total line width
\vspace{4pt}% Whitespace before the section title
\settowidth{\SectionTitleLength}{\large #1 }% Calculate the width of the section title
\addtolength\TotalSectionLength{-\SectionTitleLength}% Subtract the section title width from the total width
\addtolength\TotalSectionLength{-2.22221pt}% Modifier to remove overfull box warning
\vspace{8pt}% Whitespace before the section title
{\color{mainblue} \large #1 \rule[0.15\baselineskip]{\TotalSectionLength}{1pt}}% Print the title and auto-width rule
}
% show different url and colorize
\newcommand{\colorhrefcustom}[2]{\href{#1}{\textcolor{bluecolorurl}{{#2}}}}
\newcommand{\colorhref}[1]{
\colorhrefcustom{https://#1}{#1}
}
% Define custom commands for CV info
\newcommand{\cvbirthdate}[1]{\renewcommand{\cvbirthdate}{#1}}
\newcommand{\cvmail}[1]{\renewcommand{\cvmail}{#1}}
\newcommand{\cvaddressurl}[1]{\renewcommand{\cvaddressurl}{#1}}
\newcommand{\cvaddress}[1]{\renewcommand{\cvaddress}{#1}}
\newcommand{\cvnumberphone}[1]{\renewcommand{\cvnumberphone}{#1}}
\newcommand{\cvsitepersonal}[1]{\renewcommand{\cvsitepersonal}{#1}}
\newcommand{\cvstackoverflow}[1]{\renewcommand{\cvstackoverflow}{#1}}
\newcommand{\cvlinkedin}[1]{\renewcommand{\cvlinkedin}{#1}}
\newcommand{\cvskypeurlbase}[1]{\renewcommand{\cvskypeurlbase}{#1}}
\newcommand{\cvskypeurl}[1]{\renewcommand{\cvskypeurl}{#1}}
\newcommand{\cvgithub}[1]{\renewcommand{\cvgithub}{#1}}
\newcommand{\profilepic}[1]{\renewcommand{\profilepic}{#1}}
\newcommand{\cvname}[1]{\renewcommand{\cvname}{#1}}
\newcommand{\cvjobtitle}[1]{\renewcommand{\cvjobtitle}{#1}}
% Command for printing the contact information icons
\newcommand*\icon[2]{\tikz[baseline=(char.base)]{\node[shape=circle, draw, inner sep=1pt, fill=mainblue, mainblue, text=white, minimum size=16pt, font=\fontsize{#2}{12}\selectfont] (char) {#1};}}
%----------------------------------------------------------------------------------------
% SIDEBAR LAYOUT
%----------------------------------------------------------------------------------------
\newcommand{\makenamejobrows}{
%------------------------------------------------
{\Large\color{mainblue}\cvname\medskip}
{\Large\color{black!80}\cvjobtitle\bigskip}
}
\newcommand{\makeheaderprofilenoimg}{
\bigskip
\makenamejobrows
}
\newcommand{\makeheaderprofile}{
% use \centerline to handle image margins
\centerline{\includegraphics[width=\textwidth]{\profilepic}\bigskip}
%------------------------------------------------
\makenamejobrows
}
\newcommand{\makeinfoprofile}{
\begin{tabular}{p{0.5cm} @{\hskip 0.5cm}p{5cm}}
\ifthenelse{\equal{\cvbirthdate}{}}{}{\textsc{\Large\icon{\faCalendar}{10pt}} & \cvbirthdate\\}
\ifthenelse{
\equal{\cvaddress}{}
}{}{
\ifthenelse{
\equal{\cvaddressurl}{}
}{
\textsc{\Large\icon{\faMapMarker}{12pt}} & \cvaddress
}{
\textsc{\Large\icon{\faMapMarker}{12pt}} & \colorhrefcustom{https://\cvaddressurl}{\cvaddress}
}
\\}
\ifthenelse{\equal{\cvnumberphone}{}}{}{\textsc{\Large\icon{\faPhone}{12pt}} & \cvnumberphone\\}
\ifthenelse{\equal{\cvsitepersonal}{}}{}{\textsc{\Large\icon{\faGlobe}{11pt}} & \colorhref{\cvsitepersonal}\\}
\ifthenelse{\equal{\cvgithub}{}}{}{\textsc{\Large\icon{\faGithub}{11pt}} & \colorhrefcustom{https://github.com/\cvgithub}{\cvgithub}\\}
\ifthenelse{\equal{\cvmail}{}}{}{\textsc{\Large\icon{\faAt}{11pt}} & \colorhrefcustom{mailto:\cvmail}{\cvmail}\\}
\ifthenelse{\equal{\cvlinkedin}{}}{}{\textsc{\Large\icon{\faLinkedin}{11pt}} & \colorhrefcustom{https://www.linkedin.com/in/\cvlinkedin/en}{\cvlinkedin}\\}
\ifthenelse{\equal{\cvskypeurl}{}}{}{\textsc{\Large\icon{\faSkype}{11pt}} & \colorhrefcustom{https://\cvskypeurlbase}{\cvskypeurl}\\}
\ifthenelse{\equal{\cvstackoverflow}{}}{}{\textsc{\Large\icon{\faStackOverflow}{10pt}} & \colorhrefcustom{https://stackoverflow.com/users/\cvstackoverflow}{\cvstackoverflow}\\}
\end{tabular}
}
% Command for printing skill progress bars
\newcommand{\customskills}[3]{
\profilesection{#1}
% In case of longer "about me" or "languages" section, move languages to \makeprofileshort command
\begin{tikzpicture}
\foreach [count=\i] \x/\y in {#2}{
% \rawskillrow{\x}{\y}{\i}
\draw[fill=maingray,white] (0,\i) rectangle (6,\i+0.4);
\draw[fill=white,mainblue](0,\i) rectangle (\y,\i+0.4);
\node [above right] at (0,\i+0.4) {\x};
}
\end{tikzpicture}
% Show this description label only if optional third argument is not empty
\ifthenelse{\equal{#3}{}}{}{\scriptsize #3 \normalsize}
\smallskip
}
\newcommand{\aboutme}[1]{
\profilesection{About me}
\begin{flushleft}
#1
\end{flushleft}
}
\newcommand{\customsidesection}[2]{
\profilesection{#1}
\begin{flushleft}
#2
\end{flushleft}
}
\newcommand{\makefooterprofile}[2]{
\vfill
\scriptsize
#1\newline
#2
}
\newcommand{\pagenumber}[2]{
\renewcommand{\pagenumber}{
#1\ \thepage\ #2 \pageref{LastPage}
}
}
\newcommand{\textfootersidenote}[2]{
\renewcommand{\textfootersidenote}{
#1\newline
#2
}
}
\newcommand{\makefootersidenode}{
\smallskip
\scriptsize
% \linespread{0.9}\selectfont
\ifthenelse{
\equal{\textfootersidenote}{}
}{}{\textfootersidenote}
\ifthenelse{
\equal{\pagenumber}{}
}{}{\pagenumber}
\normalsize
}
\newcommand{\makefootersidenodevfill}{
\vfill
\makefootersidenode
}
%----------------------------------------------------------------------------------------
% COLOURED SECTION TITLE BOX
%----------------------------------------------------------------------------------------
\newcommand{\customsection}[1]{%
\colorbox{maingray}{\parbox{\dimexpr\textwidth-2\fboxsep}{\large #1}}
}
\renewcommand{\section}[1]{
{%
\bigskip
\color{mainblue}%
\customsection{#1}%
% \smallskip
}
}
\renewcommand{\subsection}[1]{
\par\vspace{.5\parskip}{%
\large\color{maingray} #1%
}
\par\vspace{.25\parskip}%
}
%----------------------------------------------------------------------------------------
% LONG LIST ENVIRONMENT
%----------------------------------------------------------------------------------------
\setlength{\tabcolsep}{0pt}
% New environment for the long list
\newenvironment{twenty}{%
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}ll}
}{%
\end{tabular*}
}
\newcommand{\twentyitem}[4]{%
#1&\parbox[t]{0.83\textwidth}{%
% \textbf{#2}%
#2 %
\hfill%
{\footnotesize#3}\\%
\graytext{#4}\vspace{\parsep}%
}\\
}
%----------------------------------------------------------------------------------------
% MID LIST ENVIRONMENT
%----------------------------------------------------------------------------------------
\setlength{\tabcolsep}{0pt}
% New environment for the long list
\newenvironment{twentymid}{%
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}ll}
}{%
\end{tabular*}
}
\newcommand{\twentymiditem}[3]{%
#1&\parbox[t]{0.83\textwidth}{%
% \textbf{#2}%
#2 %
\hfill%
{\footnotesize#3}\\%
% \textbf{#4}\vspace{\parsep}%
}\\
}
%----------------------------------------------------------------------------------------
% SMALL LIST ENVIRONMENT
%----------------------------------------------------------------------------------------
\setlength{\tabcolsep}{0pt}
% New environment for the small list
\newenvironment{twentyshort}{%
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}ll}
}{%
\end{tabular*}
}
\newcommand{\twentyitemshort}[2]{%
#1&\parbox[t]{0.83\textwidth}{%
% \textbf{#2}%
\graytext{#2}
}\\
}
%----------------------------------------------------------------------------------------
% MARGINS AND LINKS
%----------------------------------------------------------------------------------------
%\RequirePackage[left=7.6cm,top=0.1cm,right=1cm,bottom=0.2cm,nohead,nofoot]{geometry}
% end