-
Notifications
You must be signed in to change notification settings - Fork 0
/
cv.cls
432 lines (405 loc) · 13.6 KB
/
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
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
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
% CURRICULUM VITAE CUSTOM CLASS
% This class is a slightly-altered version of the res.cls class.
% Original copyright information is contained below.
% for LaTeX version 2.09
\typeout{Document Style `cv'.}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% cv.cls
%
% \documentstyle{res}
%
% Copyright (c) 1988 by Michael DeCorte
% Permission to copy all or part of this work is granted, provided
% that the copies are not made or distributed for resale, and that
% the copyright notice and this notice are retained.
%
% THIS WORK IS PROVIDED ON AN "AS IS" BASIS. THE AUTHOR PROVIDES NO
% WARRANTY WHATSOEVER, EITHER EXPRESS OR IMPLIED, REGARDING THE WORK,
% INCLUDING WARRANTIES WITH RESPECT TO ITS MERCHANTABILITY OR FITNESS
% FOR ANY PARTICULAR PURPOSE.
%
% If you make any improvements, I'd like to hear about them.
%
% Michael DeCorte
% P.O. Box 652
% Potsdam NY 13676
%
% Changes for LaTeX2e -- Venkat Krishnamurthy (Aug 7, 2001)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% You can have multiple style options the legal options ones are:
%
% centered the name and address are centered at the top of the
% page (default)
%
% line the name is the left with a horizontal line then
% the address to the right
%
% overlapped the section titles overlap the body text (default)
%
% margin the section titles are to the left of the body text
%
% 11pt use 11 point fonts instead of 10 point fonts
%
% 12pt use 12 point fonts instead of 10 point fonts
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Commands
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \cv prints the word cv but typeset nicely
%
% \newsectionwidth{dimen}
% defines the amount of space the labels extend
% into the left margin.
% DO NOT TRY to change any of the dimensions
% yourself. You will probably confuse the style file.
%
% \name{text} defines your name
%
% \address{text}
% defines your address
% this can be called twice if you have two addresses
% use \\'s to indicate where either line breaks or
% comas should go
%
% \opening this prints your name and address at that spot
% this is not normally needed, as \begin{cv}
% does this but is provided just in case you need
% to do something odd
%
% \begin{cv} ... \end{cv}
% all of the cv should go inside of this
% environment
%
% \section{text}
% This prints 'text' in the left hand margin.
% Its exact placement depends on what the style
% options has been set to. (overlapped or margin)
% You should use \\ to start a new line. If the
% style option is margin, the \\ is converted
% to a space.
% To use this in any of the list environments, put
% the \section after the \item[] but before the
% text.
% Eg.
% \begin{itemize}
% \item\section{text}
% text
% \end{itemize}
%
% \begin{ncolumn}{n} ... \end{ncolumn}
% creates a tabular environment with n equally
% spaced columns. Separate columns by & and
% end them with \\
%
% \begin{position} ... \end{position}
% this is used to print a job description. There should
% be only one job description in it. Information
% related to the job (such as title, dates...) will
% be printed.
%
% \begin{format} ... \end{format}
% used to change the default format for the position
% environment. Within it the recognized commands are:
% \title{option}
% \employer{option}
% \location{option}
% \dates{option}
% \body
% \\
% where option is one of l,r,c standing for left, right, center.
% The format will eventually be used to make several
% tabular environments and you are defining the number of columns
% and the placement of text within the columns of the tabulars.
% Each row is terminated by a \\. Any number of options can
% be on a line, they will each be set in their own columns.
% Any of the options except \body may be left out.
%
% Eg.
% \begin{format}
% \title{l}\employer{r}\\
% \dates{r}\\
% \body\\
% \location{l}\\
% \end{format}
%
% In this example the title and employer information
% are set in 2 columns left justified and right justified
% respectively. Then the date is set right justified.
% Then the body is set. Then the location is set left
% justified.
%
% \employer{text}
% \title{text}
% \dates{text}
% \location{text}
% declare text for the next invocation of the position
% environment
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Glue
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% sectionskip the amount of horizontal before a section
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Dimensions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% sectionwidth the amount that the section titles go in the
% left margin
%
% resumewidth the width of the total cv from the left
% margin to the right. Don't use textwidth
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Definitions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% sectionfont the font used to print section titles
% use \renewcommand to change it
%
% namefont the font used to print your name
% use \renewcommand to change it
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% THINGS TO DO
%
% add lm,rm options to format style to allow things to be placed
% in the left or right margin respectively
%
% add capability so that \body doesn't have to be proceeded (followed)
% by a \\ allowing part of the description (eg. location) to be the
% first (last) thing of the body
%
% clean up the list building procedures
%
% write docs to tell people how to use this
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{cv}
\PassOptionsToClass{12pt}{article}
\LoadClassWithOptions{article}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% this is used to print the name and address at the top of
% the page with a hline in between
%
\def\namefont{}
\def\namesize{\Large}
\def\@linename{\begingroup
\def\\{, }
{\namesize\namefont\textsc{\@name}}
\vskip 12pt
\fullline
\vskip 2pt
% where do you live?
\@ifundefined{@addressone}{%
% do nothing
}{%
% PUT CODE HERE
}
\endgroup}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% HEADINGS:
%
\let\print@name\@linename
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Use this to set the sectionwidth.
% It adjust the width of the text as well as the hoffset
% You probably shouldn't touch any of the size parameters
% unless you really understand all of this but it is not
% hard. Either way, it can only be executed once
%
\def\sectionfont{\sc}
\newdimen\sectionwidth
\newskip\sectionskip
\newdimen\resumewidth
\resumewidth=7.5in
\sectionskip=3.5ex plus 1ex minus -.2ex % values stolen from LaTeX
\def\newsectionwidth#1{%
\sectionwidth=#1
\textwidth=\resumewidth
\advance\textwidth-\sectionwidth
\hsize=\textwidth
\hoffset=\sectionwidth
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This is for sectiontitles that are entirely in the left margin.
% multiline sectiontitles are permitted and will be broken by
% \TeX{} to fit into a box \verb|\sectionwidth| wide. It is advised
% that \verb|\\| be used to break the lines by hand as \TeX{} will
% probably not do what you want.
%
% When using this with {\tt tabbing} and {\tt list} (or anything
% that is made out of {\tt list}) put the \section's inside of
% the \verb|\begin{}| and the \verb|\item|Eg.
% \begin{verbatim}
% \begin{trivlist}
% \item[]
% \section{foo}
% text
% \end{trivlist}
% \end{verbatim}
%
\def\boxed@sectiontitle#1{%
% this macro may be called in a tabular. Special code must be written
% to accommodate this. In LaTeX, a tabular is made out of hboxes.
% TeX never goes into horizontal mode because of this; it only
% gets into vertical mode and restricted horizontal mode. Certain
% indenting problems must be handled because of this. They
% are dealt with at the end of this routine.
% It is also necessary to close the hbox that was created before
% the \section and create a new one when this macro has ended.
% This macro therefore simulates a \kill, so that any text before
% the \section not be printed. The proper use is therefore
% ...
% text\\
% \section{foo}
% more text\\
% ...
\ifx\\\@tabcr % is this in a tabular? (this *should* work but is a kludge)
\@stopfield % the is the first part of a \kill
\else
\@@par % This will end the previous paragraph if needed and
% go into vertical mode. If this was already in
% vertical mode then the \par does nothing.
\fi
\begingroup
\everypar={}%
\def\par{\@@par}%
\let\\=\@normalcr
\addpenalty{\@secpenalty} % this would be a good place for a page break
% \@secpenalty is what LaTeX uses before its
% section's. It happens to be -300
\addvspace{\sectionskip} % put in a bit of glue
% The following hbox will be contributed to the page list without going
% into horizontal mode. Therefore, any \parindent's, \parshape's, \leftskip
% will be ignored but \hoffset's are not. The result is that the box will
% only by \hoffset. This is what I want
\hbox to 0pt{%
\hss % this is an llap. In other words, this glue
% will shrink by the width of the stuff in the vbox
% (\sectionwidth) into the left margin and then
% insert the contents of the vbox.
\vtop to 0pt{% make a 0pt height paragraph, with the baseline at the
% lined up with the baseline of the first box in the list
\leftskip=0pt
\hsize=\sectionwidth
\textwidth=\sectionwidth
\raggedright % you don't want this filled out to the right margin
\sectionfont
#1\vss % Go into horizontal mode; do the paragraph;
% go into vertical mode; add some negative glue
% to give a box of 0pt height and depth
}%
}%
\addpenalty{-\@secpenalty} % this would be a bad place for a page break
\vskip-\baselineskip % when the next box is processed, baselineskip glue
% glue will be added (the box has no depth because of
% the \vss; therefore, we don't have to worry about
% \lineskiplimit). This -\baselineskip glue
% is to undo this. \nointerlineskip doesn't
% work because the baseline of this line would be lined
% up with the top of the top of the next box. We
% want the baselines lined up.
%
% It may have been possible to do this by forcing the
% baseline of this box to be the top of the box but
% then the interline skip between this box and the
% previous box would be off as the baselines of the
% this box (the one that being made above) and the
% previous line would be separated by \baselineskip
% (probably, it may be separated by the depth of the
% previous box + \lineskip) but as the baseline of
% this box has been moved to the top, the box's would
% separated by to much glue. The exact amount being
% the height of this box.
\endgroup
\ifx\\\@tabcr % is this in a tabular? (this *should* work but is a kludge)
% this is the second part of the \kill; it starts the next tabbing line
% Because this routine will never get into paragraph mode when used in
% tabbing the \parskip that is discussed below will never be inserted.
% Therefore it should not be negated as done below.
\@startline
\ignorespaces
\else
\vskip-\parskip % The next thing to be contributed will be a paragraph.
% Right before being contributed though a \vskip\parskip
% will be inserted. This is to negate it.
%
% I do consider this to be a bit of a kludge but
% I can not find a way to write \unskipfutureskip
% or a way to make TeX think that nothing has
% been contributed to the page list.
\fi
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Section headings
\newsectionwidth{1.3in}\let\@@section\boxed@sectiontitle
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% makes a line of width \textwidth starting at -\hoffset
%
\def\fullline{ % hrules only listen to \hoffset
\nointerlineskip % so I have this code
\moveleft\hoffset\vbox{\hrule width\textwidth}
\nointerlineskip
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% use this to define your name
%
\def\name#1{\def\@name{#1}}
\def\@name{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% use this to define your address, this may be called more than once.
%
\let\@addressone\relax
\let\@addresstwo\relax
\def\address#1{
\@ifundefined{@addressone}{\def\@addressone{#1}}{\def\@addresstwo{#1}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% if you want to print your name and address is a slightly
% different format than suggested, then this can be used
% to place it exactly where you want
%
\def\opening{
\begingroup
\leftskip=12em
\advance\textwidth\hoffset
\hsize=\textwidth
\let\par=\@@par
\parindent=0pt
\parskip=0pt
\print@name
\endgroup
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% all of the cv goes in the cv environment
%
\newenvironment{cv}{\begingroup
\opening
}{\endgroup}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% DEFAULTS
%
\@secpenalty = -500
\topmargin 0pt
\headheight 0pt
\headsep 0pt
\textheight 9in
\parindent 0pt
\topmargin 0in
\oddsidemargin -0.5in
\evensidemargin -0.5in
\marginparwidth 0pt
\parindent 0pt
\parskip \baselineskip
\setcounter{secnumdepth}{0}
\def\@listI{\leftmargin\leftmargini
\topsep 0pt
\parskip 0pt
\partopsep 2pt plus 2pt
\parsep 2pt plus 2pt
\itemsep \parsep}
\pagestyle{empty} % don't want page numbers
\let\section\@@section