tccv

tccv Git Source Tree

Root/tccv.cls

1% Copyright (C) 2012,2014 Nicola Fontana <ntd at entidi.it>
2%
3% This program can be redistributed and/or modified under
4% the terms of the LaTeX Project Public License, either
5% version 1.3 of this license or (at your option) any later
6% version. The latest version of this license is in
7% http://www.latex-project.org/lppl.txt
8% and version 1.3 or later is part of all LaTeX distributions
9% version 2005/12/01 or later.
10%
11% Based on the original idea by Alessandro Plasmati found at
12% http://www.latextemplates.com/template/two-column-one-page-cv
13%
14% The most relevant changes from his work are:
15%
16% * this is a class, not a template document;
17% * tccv is based on scrartcl (from Koma-script), not on article;
18% * the fonts are selected from the PSNFSS collection, so no
19% custom font installation should be required;
20% * heavily based the implementation on custom environments and
21% macros, so the document is much easier to read (and customize);
22% * it is plain LaTeX/Koma-script, so the CV can be compiled
23% with the usual tools, latex and pdflatex included.
24
25\NeedsTeXFormat{LaTeX2e}
26\ProvidesClass{tccv}
27 [2015/04/16 v1.2.2
28 Two Column Curriculum Vitae]
29
30\LoadClassWithOptions{scrartcl}
31
32\setcounter{secnumdepth}{-1}
33\RequirePackage[hmargin=1.25cm,vmargin=1.25cm,twocolumn,columnsep=1.25cm]{geometry}
34\RequirePackage{bookman,etoolbox,needspace,pifont,tabularx,xcolor}
35\RequirePackage{hyperref}
36
37% Capitalize words of at least a minimum length (default to 3 chars).
38% The text is capitalized before being expanded.
39%
40% This macro uses Lua to do the job but fails gracefully (that is,
41% return the text as is) if \directlua is not available.
42%
43% \ucwords
44% [optional: miminum length]{text}
45\newcommand\ucwords[2][3]{%
46 % Fails gracefully if not in LuaLaTeX
47 \providecommand\directlua[1]{#2}%
48 \directlua{%
49local minlen = tonumber("#1")
50local src = "\luaescapestring{\unexpanded{#2}}"
51local dst = {}
52% Put a % inside \directlua is tricky as hell. Use char(37)
53% instead: still no plans for supporting non-ASCII platforms.
54for w in src:gmatch(string.char(37) .. "S+") do
55 if w:len() >= minlen then
56table.insert(dst, w:sub(1,1):upper() .. w:sub(2))
57 else
58table.insert(dst, w)
59 end
60end
61tex.print(dst)}}
62
63\pagestyle{empty}
64\setlength\parindent{0pt}
65\color[HTML]{303030} % Default foreground color
66\definecolor{link}{HTML}{506060} % Hyperlinks
67\hypersetup{colorlinks,breaklinks,urlcolor=link,linkcolor=link}
68\setkomafont{disposition}{\color[HTML]{801010}}
69\setkomafont{section}{\scshape\Large\mdseries}
70
71% In tccv \part must contain the subject of the curriculum vitae.
72% The command will start a new page and output in onecolumn the
73% subject (first and last name) with the text from the optional
74% argument underneath it
75\renewcommand\part[2][Curriculum Vitae]{%
76 \twocolumn[%
77 \begin{center}
78\vskip-\lastskip%
79{\usekomafont{part} #2} \medskip\\
80{\fontfamily{pzc}\selectfont\Huge {#1}}
81\bigskip
82 \end{center}]}
83
84% Overrides the \section command to capitalize every
85% word for cosmetic purposes and draws a rule under it.
86\let\old@section\section
87\renewcommand\section[2][]{%
88 \old@section[#1]{\ucwords{#2}}%
89 \newdimen\raising%
90 \raising=\dimexpr-0.7\baselineskip\relax%
91 \vskip\raising\hrule height 0.4pt\vskip-\raising}
92
93% Allow conditionals based on the job name. This can usually be set
94% from a command-line argument: check fausto.en.tex for an example.
95%
96% \ifjob
97% {jobname}
98% {content if matches}
99% {content if does not match}
100\newcommand\ifjob[3]{%
101 \edef\JOBNAME{\jobname}%
102 \edef\PIVOT{\detokenize{#1}}%
103 \ifdefstrequal{\JOBNAME}{\PIVOT}{#2}{#3}%
104}
105
106% Renders a personal data box:
107%
108% \personal
109% [url without scheme, i.e. no http:// prefix]
110% {address}
111% {phone number}
112% {email}
113\newcommand\personal[4][]{%
114 \newcommand\SYMBOL[1]{\raisebox{-2pt}{\Large\ding{##1}}}%
115 \needspace{0.5\textheight}%
116 \newdimen\boxwidth%
117 \boxwidth=\dimexpr\linewidth-2\fboxsep\relax%
118 \colorbox[HTML]{F5DD9D}{%
119 \begin{tabularx}{\boxwidth}{c|X}
120 \SYMBOL{45} & {#2}\smallskip\\
121 \SYMBOL{37} & {#3}\smallskip\\
122 \SYMBOL{41} & \href{mailto:#4}{#4}
123 \ifstrempty{#1}{}{\smallskip\\ \SYMBOL{218} & \href{http://#1}{#1}}
124 \end{tabularx}}}
125
126% Every \item can be followed by one or more paragraphs
127% of description:
128%
129% \item
130% {date range}
131% {company}
132% {role}
133% One or more paragraphs describing what achieved during this application.
134\newenvironment{eventlist}{%
135 \newcommand*\inskip{}
136 \renewcommand\item[3]{%
137\inskip%
138{\raggedleft\textsc{##1}\\[1pt]}
139\ifstrempty{##2}{}{##2\\[2pt]}
140{\Large\textit{##3}}
141\medskip
142\renewcommand\inskip{\bigskip}}}
143 {\bigskip}
144
145% Use only \item inside this environment, no other macros
146% are allowed:
147%
148% \item
149% [what has been achieved]
150% {years}
151% {subject}
152% {notes}
153\newenvironment{yearlist}{%
154 \renewcommand\item[4][]{%
155\textsc{##2} & \textbf{##3} \\
156\ifstrempty{##1}{}{& \textsc{##1} \\}
157& \textit{##4}\medskip\\}
158 \tabularx{\linewidth}{rX}}
159 {\endtabularx}
160
161
162% Use only \item inside this environment: no other macros
163% are allowed:
164%
165% \item
166% {fact}
167% {description}
168\newenvironment{factlist}{%
169 \newdimen\unbaseline
170 \unbaseline=\dimexpr-\baselinestretch\baselineskip\relax
171 \renewcommand\item[2]{%
172\textsc{##1} & {\raggedright ##2\medskip\\}\\[\unbaseline]}
173 \tabularx{\linewidth}{rX}}
174 {\endtabularx}
175
176% Avoid dealing with starred sections
177% See the following question for further details:
178% http://tex.stackexchange.com/questions/223607/does-the-bibliography-command-specify-a-section-anywhere
179\KOMAoption{bibliography}{totocnumbered}
180
181\AtEndPreamble{%
182\@ifpackageloaded{biblatex}{%
183\defbibheading{bibliography}[\refname]{%
184\section{#1}%
185}%
186}{}%
187}
188%%
189%% End of file `tccv.cls'.

Archive Download this file

Branches