-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcvone.cls
200 lines (166 loc) · 7.14 KB
/
cvone.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
% cvone class - The one page curriculum
\NeedsTeXFormat{LaTeX2e} % Latex version
\ProvidesClass{cv0ne}[2021/03/20]
% ---------------------------------------------------------------------------
% Loading the article class as a base.
% ---------------------------------------------------------------------------
\LoadClass{article}
% ---------------------------------------------------------------------------
% The T1 font encoding is an 8-bit encoding for fonts.
% ---------------------------------------------------------------------------
\RequirePackage[T1]{fontenc}
% ---------------------------------------------------------------------------
% Use Gyre Heros font as default font typeface.
% ---------------------------------------------------------------------------
\RequirePackage{tgheros}
% ---------------------------------------------------------------------------
% Use sans-serify font family as default to the whole document
% ---------------------------------------------------------------------------
\renewcommand{\familydefault}{\sfdefault}
% ---------------------------------------------------------------------------
% The geometry package offers a simple way to change the length and layout
% of different elements such as the paper size, margins, footnote,
% header, orientation, etc.
% ---------------------------------------------------------------------------
\RequirePackage[a4paper, top=30pt, right=20pt, bottom=30pt, left=20pt]{geometry}
% ---------------------------------------------------------------------------
% Alternative section titles
% ---------------------------------------------------------------------------
\RequirePackage{titlesec}
% ---------------------------------------------------------------------------
% Fontawesome package
% ---------------------------------------------------------------------------
\RequirePackage{fontawesome}
% ---------------------------------------------------------------------------
% To define some custom color
% ---------------------------------------------------------------------------
\RequirePackage{xcolor}
\definecolor{customblue}{RGB}{0,120,150}
\definecolor{customgrey}{HTML}{808080}
\definecolor{customlightgrey}{HTML}{F5F5F5}
\definecolor{customorange}{RGB}{250,150,10}
% ---------------------------------------------------------------------------
% Easy way to create colored text boxes.
% Used in this class into header and footer.
% ---------------------------------------------------------------------------
\RequirePackage[most]{tcolorbox}
% ---------------------------------------------------------------------------
% Add some programming capability like loops.
% ---------------------------------------------------------------------------
\RequirePackage{pgffor} % for loop usage
% ---------------------------------------------------------------------------
% The \pagestyle command changes the style from the current page
% on throughout the remainder of the document.
%
% empty - Both the header and footer are cleared.
% ---------------------------------------------------------------------------
\pagestyle{empty}
% ---------------------------------------------------------------------------
\titleformat{\section} % Customise the \section command.
{\Large\scshape\raggedright} % Make the \section headers large (\Large),
% small capitals (\scshape) and left aligned (\raggedright).
%
{}{0em} % Parameter used as the section title and
% the margin size - (0em).
% Note: em is roughly the width of an 'M' (uppercase)
% in the current font (it depends on the font used).
%
{} % Can be used to enter text after the section
%
[\titlerule] % Inserts a horizontal line after the heading
% ---------------------------------------------------------------------------
\titleformat{\subsection} % Customise the \subsection command.
{\normalsize\scshape\raggedright} % Same thing above
{}{0em}
{}
% ---------------------------------------------------------------------------
\newcommand{\sectiontext}[1]{
\begin{changemargin}{0.25cm}{0.25cm}
{\fontfamily{cmss}\selectfont
{#1}
}
\end{changemargin}
}
% ---------------------------------------------------------------------------
\def\changemargin#1#2{\list{}{\rightmargin#2\leftmargin#1}\item[]}
\let\endchangemargin=\endlist
% ---------------------------------------------------------------------------
\newcommand{\sixtypercent}[1]{
\begin{changemargin}{0.25cm}{0.0cm}{\fontfamily{cmss}\selectfont\textcolor{customblue}{#1}\\}
\textcolor{customorange}{
\foreach \n in {1,...,6}{
\colorbox{customorange}{.}
}
\foreach \n in {1,...,4}{
\colorbox{customblue!8}{.}
}
}
\end{changemargin}
}
% ---------------------------------------------------------------------------
\newcommand{\seventypercent}[1]{
\begin{changemargin}{0.25cm}{0.0cm}{\fontfamily{cmss}\selectfont\textcolor{customblue}{#1}\\}
\textcolor{customorange}{
\foreach \n in {1,...,7}{
\colorbox{customorange}{.}
}
\foreach \n in {1,...,3}{
\colorbox{customblue!8}{.}
}
}
\end{changemargin}
}
% ---------------------------------------------------------------------------
\newcommand{\eightypercent}[1]{
\begin{changemargin}{0.25cm}{0.0cm}{\fontfamily{cmss}\selectfont\textcolor{customblue}{#1}\\}
\textcolor{customorange}{
\foreach \n in {1,...,8}{
\colorbox{customorange}{.}
}
\foreach \n in {1,...,2}{
\colorbox{customblue!8}{.}
}
}
\end{changemargin}
}
% ---------------------------------------------------------------------------
\newcommand{\ninetypercent}[1]{
\begin{changemargin}{0.25cm}{0.0cm}{\fontfamily{cmss}\selectfont\textcolor{customblue}{#1}\\}
\textcolor{customorange}{
\foreach \n in {1,...,9}{
\colorbox{customorange}{.}
}
\colorbox{customblue!8}{.}
}
\end{changemargin}
}
% ---------------------------------------------------------------------------
\newcommand{\employmentitem}[5]{
\begin{changemargin}{0.25cm}{0.25cm}
{\fontfamily{cmss}\selectfont
\textcolor{customblue}{#3}\hfill\textcolor{customblue}{#4}\\
\begin{minipage}[t]{0.1\linewidth}
\small{#1}\\{#2}
\end{minipage}
\begin{minipage}[t]{0.9\linewidth}
\textcolor{customgrey}{#5}
\end{minipage}
}
\end{changemargin}
}
% ---------------------------------------------------------------------------
\newcommand{\makeheader}[3]{
\begin{tcolorbox}[colback=customblue!5,colframe=customblue!5,coltext=customblue]
\Huge\textbf{{#1}} {#2}
\tcblower
\Large{#3}
\end{tcolorbox}
}
% ---------------------------------------------------------------------------
\newcommand{\makefooter}[3]{
\vfill
\begin{tcolorbox}[colback=customblue!5,colframe=customblue!5,coltext=customblue]
\fontfamily{cmss}\selectfont
\faPhone\,{#1}\hfill\faMapMarker\,{#2}\hfill\faEnvelope\,{#3}
\end{tcolorbox}
}