-
Notifications
You must be signed in to change notification settings - Fork 0
/
bscv.cls
200 lines (178 loc) · 5.73 KB
/
bscv.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
% Copyright (C) 2012 Nicola Fontana <ntd at entidi.it>
%
% This program can be redistributed and/or modified under
% the terms 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 LaTeX distributions
% version 2005/12/01 or later.
%
% Based on the original idea by Alessandro Plasmati found at
% http://www.latextemplates.com/template/two-column-one-page-cv
%
% The most relevant changes from his work are:
%
% * this is a class, not a template document;
% * tccv is based on scrartcl (from Koma-script), not on article;
% * the fonts are selected from the PSNFSS collection, so no
% custom font installation should be required;
% * heavily based the implementation on custom environments and
% macros, so the document is much easier to read (and customize);
% * it is plain LaTeX/Koma-script, so the CV can be compiled
% with the usual tools, latex and pdflatex included.
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{bscv}
[2012/11/09 v1.0
Two Column Curriculum Vitae]
\LoadClass[10pt]{scrartcl}
\setcounter{secnumdepth}{-1}
\RequirePackage[hmargin=1.25cm,vmargin=1.25cm,twocolumn,columnsep=1.25cm]{geometry}
\RequirePackage{bookman,etoolbox,hyperref,marvosym,needspace,tabularx,xcolor}
% Capitalize words of at least a minimum length (default to 3 chars).
% The text is capitalized before being expanded.
%
% This macro uses Lua to do the job but fails gracefully (that is,
% return the text as is) if \directlua is not available.
%
% |[
% \ucwords[optional: miminum length]{text}
% ]|
\newcommand\ucwords[2][3]{%
% Fails gracefully if not in LuaLaTeX
\providecommand\directlua[1]{#2}%
\directlua{%
local minlen=tonumber("#1")
local src="\luaescapestring{\unexpanded{#2}}"
local dst={}
for w in src:gmatch('[^\string\%s]+') do
if w:len() >= minlen then w = w:sub(1,1):upper()..w:sub(2) end
table.insert(dst, w)
end
tex.print(dst)}}
\pagestyle{empty}
\setlength\parindent{0pt}
\color[HTML]{303030} % Default foreground color
\definecolor{link}{HTML}{506060} % Hyperlinks
\hypersetup{colorlinks,breaklinks,urlcolor=link,linkcolor=link}
\setkomafont{disposition}{\color[HTML]{801010}}
\setkomafont{section}{\scshape\Large\mdseries}
% Renders a personal data box:
%
% |[
% \personal[optional: web site without scheme (no http:// prefix)]
% {address}{phone number}{email}
% ]|
\newcommand\personal[4]{%
\needspace{0.5\textheight}%
\newdimen\boxwidth%
\boxwidth=\dimexpr\linewidth-2\fboxsep\relax%
\colorbox[HTML]{F5DD9D} {%
\begin{tabularx}{\boxwidth}{c|X}
\Writinghand & {#2}\smallskip\\
\Telefon & {#3}\smallskip\\
\Letter & \href{mailto:#4}{#4}
\smallskip\\
\Lightning & \href{http://#1}{#1}
\end{tabularx}}}
\newcommand\personalwide[4]{%
\needspace{0.5\textheight}%
\newdimen\boxwidth%
\boxwidth=\dimexpr\linewidth/2-15\fboxsep\relax%
\colorbox[HTML]{F5DD9D} {%
\begin{tabularx}{\boxwidth}{c|X}
\Writinghand & {#2}\smallskip\\
\Telefon & {#3}\smallskip\\
\Letter & \href{mailto:#4}{#4}
\smallskip\\
\Lightning & \href{http://#1}{#1}
\end{tabularx}}}
% In tccv \part must contain the subject of the curriculum vitae and the title of the document
% The command will start a new page and output in onecolumn the
% subject (first and last name) with the title under it.
\newcommand\headerbox[6]{%
\twocolumn[%
\begin{center}
\vskip-\lastskip%
{\usekomafont{part} #1} \medskip\\
{\fontfamily{pzc}\selectfont\Huge{#2}}
\bigskip
\personalwide{#3}{#4}{#5}{#6}
\end{center}]}
% phv -helvetica
% pzc -cursive like
\newcommand\headeronly[2]{%
\twocolumn[%
\begin{center}
\vskip-\lastskip%
{\usekomafont{part} #1} \medskip\\
{\fontfamily{pzc}\selectfont\Huge{#2}}
\bigskip
\end{center}]}
% Overrides the \section command to capitalize every
% word for cosmetic purposes and draws a rule under it.
\makeatletter
\let\old@section\section
\renewcommand\section[2][]{%
\old@section[#1]{\ucwords{#2}}%
\newdimen\raising%
\raising=\dimexpr-0.7\baselineskip\relax%
\vskip\raising\hrule height 0.4pt\vskip-\raising}
\makeatother
% Allow conditionals based on the job name. This can usually be set
% from a command-line argument: check fausto.en.tex for an example.
%
% |[
% \ifjob{jobname}{content if matches}{content if does not match}
% ]|
\newcommand\ifjob[3]{%
\edef\JOBNAME{\jobname}%
\edef\PIVOT{\detokenize{#1}}%
\ifdefstrequal{\JOBNAME}{\PIVOT}{#2}{#3}%
}
% Every \item can be followed by one or more paragraphs
% of description:
%
% |[
% \item{date range}{company}{role}
%
% Description of what achieved during this application.
% ]|
\newenvironment{eventlist}{%
\newcommand*\inskip{}
\renewcommand\item[3]{%
\inskip%
{\raggedleft\textsc{##1}\\[1pt]}
{##2}\\[2pt]
{\large\textit{##3}}
\medskip
\renewcommand\inskip{\bigskip}}}
{\bigskip}
% Use only \item inside this environment: no other macros
% are allowed:
%
% |[
% \item[optional: what has been achieved]{years}{subject}{notes}
% ]|
\newenvironment{yearlist}{%
\renewcommand\item[4][]{%
{\textsc{##2}} & {\bfseries ##3} \\
\ifstrempty{##1}{}{& {\textsc{##1}} \\}
& {\textit{##4}}\medskip\\}
\tabularx{\linewidth}{rX}}
{\endtabularx}
% Use only \item inside this environment: no other macros
% are allowed:
%
% |[
% \item{fact}{description}
% ]|
\newenvironment{factlist}{%
\newdimen\unbaseline
\unbaseline=\dimexpr-\baselinestretch\baselineskip\relax
\renewcommand\item[2]{%
\textsc{##1} & {\raggedright ##2\medskip\\}\\[\unbaseline]}
\tabularx{\linewidth}{rX}}
{\endtabularx}
%%
%% End of file `tccv.cls'.