-
Notifications
You must be signed in to change notification settings - Fork 10
/
cv-template.tex
256 lines (199 loc) · 9.72 KB
/
cv-template.tex
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
% vim: set textwidth=120:
% Edit this file to create a CV based on the 1.5-column-cv template. Places where you will probably want to make changes
% are marked with TODO comments, and there are also a few NOTE comments with some additional hints that might be useful.
\documentclass[a4paper,10pt]{article}
% package imports
% ---------------
\usepackage[british]{babel} % for correct language and hyphenation and stuff TODO set language
\usepackage{calc} % for easier length calculations (infix notation)
\usepackage{enumitem} % for configuring list environments
\usepackage{fancyhdr} % for setting header and footer
\usepackage{fontspec} % for fonts
\usepackage{geometry} % for setting margins (\newgeometry)
\usepackage{graphicx} % for pictures
\usepackage{lastpage} % for getting total number of pages (LastPage)
\usepackage{microtype} % for microtypography stuff
\usepackage{xcolor} % for colours
% margin and column widths
% ------------------------
% margins
% NOTE with non-empty header/footer, try the includehead/includefoot parameters
% NOTE if content is too short/long, try larger/smaller margins
\newgeometry{left=15mm,right=15mm,top=15mm,bottom=15mm} % TODO set margins
% width of the gap between left and right column
\newlength{\cvcolumngapwidth}
\setlength{\cvcolumngapwidth}{3.5mm}
% left column width
% NOTE for optimal space utilization, set this as small as possible (to still fit everything in the column)
\newlength{\cvleftcolumnwidth}
\setlength{\cvleftcolumnwidth}{47mm} % TODO set left column width
% right column width
\newlength{\cvrightcolumnwidth}
\setlength{\cvrightcolumnwidth}{\textwidth-\cvleftcolumnwidth-\cvcolumngapwidth}
% set paragraph indentation to 0, because it screws up the whole layout otherwise
\setlength{\parindent}{0mm}
% style definitions
% -----------------
% style categories explanation:
% * \cvnameXXX is used for the name;
% * \cvsectionXXX is used for section names (left column, accompanied by a horizontal rule);
% * \cvtitleXXX is used for job/education titles (right column);
% * \cvdurationXXX is used for job/education durations (left column);
% * \cvheadingXXX is used for headings (left column);
% * \cvmainXXX (and \setmainfont) is used for main text;
% * \cvmarginXXX is used for text in margins;
% * \cvruleXXX is used for the horizontal rules denoting sections.
% font families
\defaultfontfeatures{Ligatures=TeX} % reportedly a good idea, see https://tex.stackexchange.com/a/37251
\newfontfamily{\cvnamefont}{Latin Modern Sans} % TODO set name font
\newfontfamily{\cvsectionfont}{Latin Modern Sans} % TODO set section font
\newfontfamily{\cvtitlefont}{Latin Modern Sans} % TODO set title font
\newfontfamily{\cvdurationfont}{Latin Modern Sans} % TODO set duration font
\newfontfamily{\cvheadingfont}{Latin Modern Sans} % TODO set heading font
\setmainfont{Latin Modern Sans} % TODO set main font
% colours
\definecolor{cvnamecolor}{HTML}{000000} % TODO set name text colour
\definecolor{cvsectioncolor}{HTML}{000000} % TODO set section text colour
\definecolor{cvtitlecolor}{HTML}{000000} % TODO set title text colour
\definecolor{cvdurationcolor}{HTML}{000000} % TODO set duration text colour
\definecolor{cvheadingcolor}{HTML}{000000} % TODO set heading text colour
\definecolor{cvmaincolor}{HTML}{000000} % TODO set main text colour
\definecolor{cvrulecolor}{HTML}{000000} % TODO set section rule colour
\color{cvmaincolor}
% styles
\newcommand{\cvnamestyle}[1]{{\Large\cvnamefont\textcolor{cvnamecolor}{#1}}}
\newcommand{\cvsectionstyle}[1]{{\normalsize\cvsectionfont\textcolor{cvsectioncolor}{#1}}}
\newcommand{\cvtitlestyle}[1]{{\large\cvtitlefont\textcolor{cvtitlecolor}{#1}}}
\newcommand{\cvdurationstyle}[1]{{\small\cvdurationfont\textcolor{cvdurationcolor}{#1}}}
\newcommand{\cvheadingstyle}[1]{{\normalsize\cvheadingfont\textcolor{cvheadingcolor}{#1}}}
% inter-item spacing
% ------------------
% vertical space after personal info and standard CV items
\newlength{\cvafteritemskipamount}
\setlength{\cvafteritemskipamount}{5mm plus 1.25mm minus 1.25mm}
% vertical space after sections
\newlength{\cvaftersectionskipamount}
\setlength{\cvaftersectionskipamount}{2mm plus 0.5mm minus 0.5mm}
% extra vertical space to be used when a section starts with an item with a heading (e.g. in the skills section),
% so that the heading does not follow the section name too closely
\newlength{\cvbetweensectionandheadingextraskipamount}
\setlength{\cvbetweensectionandheadingextraskipamount}{1mm plus 0.25mm minus 0.25mm}
% intra-item spacing
% ------------------
% vertical space after name
\newlength{\cvafternameskipamount}
\setlength{\cvafternameskipamount}{3mm plus 0.75mm minus 0.75mm}
% vertical space after personal info lines
\newlength{\cvafterpersonalinfolineskipamount}
\setlength{\cvafterpersonalinfolineskipamount}{2mm plus 0.5mm minus 0.5mm}
% vertical space after titles
\newlength{\cvaftertitleskipamount}
\setlength{\cvaftertitleskipamount}{1mm plus 0.25mm minus 0.25mm}
% value to be used as parskip in right column of CV items and itemsep in lists (same for both, for consistency)
\newlength{\cvparskip}
\setlength{\cvparskip}{0.5mm plus 0.125mm minus 0.125mm}
% set global list configuration (use parskip as itemsep, and no separation otherwise)
\setlist{parsep=0mm,topsep=0mm,partopsep=0mm,itemsep=\cvparskip}
% CV commands
% -----------
% creates a "personal info" CV item with the given left and right column contents, with appropriate vertical space after
% @param #1 left column content (should be the CV photo)
% @param #2 right column content (should be the name and personal info)
\newcommand{\cvpersonalinfo}[2]{
% left and right column
\begin{minipage}[t]{\cvleftcolumnwidth}
\vspace{0mm} % XXX hack to align to top, see https://tex.stackexchange.com/a/11632
\raggedleft #1
\end{minipage}% XXX necessary comment to avoid unwanted space
\hspace{\cvcolumngapwidth}% XXX necessary comment to avoid unwanted space
\begin{minipage}[t]{\cvrightcolumnwidth}
\vspace{0mm} % XXX hack to align to top, see https://tex.stackexchange.com/a/11632
#2
\end{minipage}
% space after
\vspace{\cvafteritemskipamount}
}
% typesets a name, with appropriate vertical space after
% @param #1 name text
\newcommand{\cvname}[1]{
% name
\cvnamestyle{#1}
% space after
\vspace{\cvafternameskipamount}
}
% typesets a line of personal info beginning with an icon, with appropriate vertical space after
% @param #1 parameters for the \includegraphics command used to include the icon
% @param #2 icon filename
% @param #3 line text
\newcommand{\cvpersonalinfolinewithicon}[3]{
% icon, vertically aligned with text (see https://tex.stackexchange.com/a/129463)
\raisebox{.5\fontcharht\font`E-.5\height}{\includegraphics[#1]{#2}}
% text
#3
% space after
\vspace{\cvafterpersonalinfolineskipamount}
}
% creates a "section" CV item with the given left column content, a horizontal rule in the right column, and with
% appropriate vertical space after
% @param #1 left column content (should be the section name)
\newcommand{\cvsection}[1]{
% left and right column
\begin{minipage}[t]{\cvleftcolumnwidth}
\raggedleft\cvsectionstyle{#1}
\end{minipage}% XXX necessary comment to avoid unwanted space
\hspace{\cvcolumngapwidth}% XXX necessary comment to avoid unwanted space
\begin{minipage}[t]{\cvrightcolumnwidth}
\textcolor{cvrulecolor}{\rule{\cvrightcolumnwidth}{0.3mm}}
\end{minipage}
% space after
\vspace{\cvaftersectionskipamount}
}
% creates a standard, multi-purpose CV item with the given left and right column contents, parskip set to cvparskip
% in the right column, and with appropriate vertical space after
% @param #1 left column content
% @param #2 right column content
\newcommand{\cvitem}[2]{
% left and right column
\begin{minipage}[t]{\cvleftcolumnwidth}
\raggedleft #1
\end{minipage}% XXX necessary comment to avoid unwanted space
\hspace{\cvcolumngapwidth}% XXX necessary comment to avoid unwanted space
\begin{minipage}[t]{\cvrightcolumnwidth}
\setlength{\parskip}{\cvparskip} #2
\end{minipage}
% space after
\vspace{\cvafteritemskipamount}
}
% typesets a title, with appropriate vertical space after
% @param #1 title text
\newcommand{\cvtitle}[1]{
% title
\cvtitlestyle{#1}
% space after
\vspace{\cvaftertitleskipamount}
% XXX need to subtract cvparskip here, because it is automatically inserted after the title "paragraph"
\vspace{-\cvparskip}
}
% header and footer
% -----------------
% set empty header and footer
% NOTE see cv-example-2.tex for an example of a non-empty header and footer
\pagestyle{empty} % TODO set header and footer
% preamble end/document start
% ===========================
\begin{document}
% personal info
% -------------
\cvpersonalinfo{
% TODO ideally put a photo here (see cv-example-1.tex for an example)
}{
% TODO put personal info here, maybe with some icons (see the example CVs)
% NOTE if the \cvpersonalinfolinewithicon command is used for the last line (in the example CVs it isn't, there is
% always the "plain" line with date of birth), there will be extra unnecessary space added by the command
% after the line; try \vspace{-\cvafterpersonalinfolineskipamount} to remove it
}
% TODO put some more sections here, containing some items (see the example CVs): use \cvsection to typeset a section
% header (ideally use caps for section names), and \cvitem to create a two-column environment where you can put
% anything you like in the left and right columns (ideally, the left column should only contain job/education
% durations and headings, and the right column the actual content)
\end{document}