-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathk-cv.cls
206 lines (175 loc) · 4.61 KB
/
k-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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
\ProvidesClass{k-cv}[2015/11/29 CV class]
\NeedsTeXFormat{LaTeX2e}
\DeclareOption{print}{\def\@cv@print{}}
\DeclareOption*{%
\PassOptionsToClass{\CurrentOption}{article}%
}
\ProcessOptions\relax
\LoadClass{article}
% to avoid warnings, copy only one symbol from stmaryrd
\DeclareSymbolFont{stmry}{U}{stmry}{m}{n}
\DeclareMathSymbol\rightarrowtriangle\mathrel{stmry}{"5F}
\renewcommand{\to}{$\rightarrowtriangle$}
%%%%%%%%%%
% Colors %
%%%%%%%%%%
\RequirePackage{xcolor}
\definecolor{white}{RGB}{255,255,255}
\definecolor{darkgray}{gray}{.2}
\definecolor{gray}{gray}{.35}
\definecolor{lightgray}{gray}{.35}
\definecolor{green}{HTML}{C2E15F}
\definecolor{orange}{HTML}{FDA333}
\definecolor{purple}{HTML}{D3A4F9}
\definecolor{red}{HTML}{FB4485}
\definecolor{blue}{HTML}{6CE0F1}
\ifdefined\@cv@print
\colorlet{green}{gray}
\colorlet{orange}{gray}
\colorlet{purple}{gray}
\colorlet{red}{gray}
\colorlet{blue}{gray}
\colorlet{fillheader}{white}
\colorlet{header}{gray}
\else
\colorlet{fillheader}{gray}
\colorlet{header}{white}
\fi
\colorlet{textcolor}{gray}
\colorlet{headercolor}{gray}
%%%%%%%%%
% Fonts %
%%%%%%%%%
\RequirePackage{microtype}
\RequirePackage[default]{lato}
% \newcommand{\normalfont}{\fontseries{l}\selectfont}
\newcommand{\bodyfont}{\fontseries{l}\selectfont}
\newcommand{\thinfont}{\fontseries{el}\selectfont}
\newcommand{\headingfont}{\fontseries{b}\selectfont}
\RequirePackage[none]{hyphenat} % No hyphenation
%%%%%%%%%%
% Header %
%%%%%%%%%%
\RequirePackage{tikz}
\newcommand{\rolefont}{%
\fontsize{14pt}{24pt}\selectfont%
\thinfont%
\color{white}%
}
\newcommand{\header}[3]{%
\begin{tikzpicture}[remember picture,overlay]
\node [rectangle, fill=fillheader, anchor=north, minimum width=\paperwidth,
minimum height=4cm, yshift=0.5mm] (box) at (current page.north){};
\node [anchor=center] (name) at (box) {%
\fontsize{48pt}{72pt}\color{header}%
{\thinfont #1}{\bodyfont #2}
};
\node [anchor=north] at (name.south) {%
\fontsize{18pt}{24pt}\color{header}%
\thinfont #3%
};
\end{tikzpicture}
\vspace{2.5cm}
\vspace{-2\parskip}
}
\newcommand{\smallheader}[2]{%
\begin{tikzpicture}[remember picture,overlay]
\node [rectangle, fill=fillheader, anchor=north, minimum width=\paperwidth,
minimum height=2cm, yshift=0.5mm] (box) at (current page.north){};
\node [anchor=center] (name) at (box) {%
\fontsize{24pt}{36pt}\color{header}%
{\thinfont #1}{\bodyfont #2}
};
\end{tikzpicture}
\vspace{0.5cm}
\vspace{-2\parskip}
}
%%%%%%%%%%%%%
% Structure %
%%%%%%%%%%%%%
\RequirePackage{parskip}
\newcounter{colorCounter}
\def\@sectioncolor#1#2#3{%
{%
\color{%
\ifcase\value{colorCounter}%
blue\or%
red\or%
orange\or%
green\or%
purple\else%
headercolor\fi%
} #1#2#3%
}%
\stepcounter{colorCounter}%
}
\renewcommand{\section}[1]{
\par\vspace{\parskip}
{%
\LARGE\headingfont\color{headercolor}%
\@sectioncolor #1%
}
\par\vspace{\parskip}
}
\renewcommand{\subsection}[2]{
\par\vspace{.5\parskip}%
\Large\headingfont\color{headercolor} #2%
\par\vspace{.25\parskip}%
}
\pagestyle{empty} % removes page number
%%%%%%%%%%%%%%%%%%%%
% List environment %
%%%%%%%%%%%%%%%%%%%%
\setlength{\tabcolsep}{0pt}
\newenvironment{entrylist}{%
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}p{2cm}l}
}{%
\end{tabular*}
}
\renewcommand{\bfseries}{\headingfont\color{headercolor}}
\newcommand{\entry}[4]{%
\hangindent=3mm \hangafter1%
{\leavevmode\color{gray}\small #1}&\parbox[t]{11.8cm}{%
\textbf{#2}%
\hfill%
{\footnotesize\color{gray} \bodyfont #3}\\%
\bodyfont #4\vspace{\parsep}%
}\\}
%%%%%%%%%%%%%%%%%%%%%%%
% Manual Bibliography %
%%%%%%%%%%%%%%%%%%%%%%%
% each item is a manual entry, since a bibfile is more pain than pleasure
% for most people's CVs.
\newcommand{\bibentry}[3]{%
{\bfseries #1}\\%
\hangindent=5mm \hangafter1%
{\color{black} \bodyfont #2\\%
{\footnotesize \bodyfont #3}}%
}%
%%%%%%%%%%%%%%
% Side block %
%%%%%%%%%%%%%%
\RequirePackage[absolute,overlay]{textpos}
\setlength{\TPHorizModule}{1cm}
\setlength{\TPVertModule}{1cm}
\newenvironment{aside}{%
\let\oldsection\section
\renewcommand{\section}[1]{
\par\vspace{\baselineskip}{\Large\headingfont\color{headercolor} ##1}
}
\begin{textblock}{3.6}(1.5, 4.33)
\begin{flushright}
\obeycr
}{%
\restorecr
\end{flushright}
\end{textblock}
\let\section\oldsection
}
%%%%%%%%%%%%%%%%
% Other tweaks %
%%%%%%%%%%%%%%%%
\RequirePackage[left=6.1cm,top=2cm,right=1.5cm,bottom=2.5cm,nohead,nofoot]{geometry}
\RequirePackage[hidelinks]{hyperref}
\hypersetup{
colorlinks=false}