Debian Codegraph @

texmf-dist/source/latex/simplecv/simplecv.dtx

raw
1 % \iffalse meta-comment
2 %
3 % Copyright (C) 2007 by Jean-Marc Lasgouttes <[email protected]>
4 % -------------------------------------------------------
5 %
6 % This file may be distributed and/or modified under the
7 % conditions of the LaTeX Project Public License, either version 1.2
8 % of this license or (at your option) any later version.
9 % The latest version of this license is in:
10 %
11 % http://www.latex-project.org/lppl.txt
12 %
13 % and version 1.2 or later is part of all distributions of LaTeX
14 % version 1999/12/01 or later.
15 %
16 % \fi
17 %
18 % \iffalse
19 %<*driver>
20 \ProvidesFile{simplecv.dtx}
21 %</driver>
22 %<class>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
23 %<class>\ProvidesClass{simplecv}
24 %<*class>
25 [2014/11/07 v1.6a simple curriculum vitae]
26 %</class>
27 %
28 %<*driver>
29 \documentclass{ltxdoc}
30 \CodelineIndex
31 \RecordChanges
32 \begin{document}
33 \DocInput{simplecv.dtx}
34 \end{document}
35 %</driver>
36 % \fi
37 %
38 % \CheckSum{0}
39 %
40 % \CharacterTable
41 % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
42 % Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
43 % Digits \0\1\2\3\4\5\6\7\8\9
44 % Exclamation \! Double quote \" Hash (number) \#
45 % Dollar \$ Percent \% Ampersand \&
46 % Acute accent \' Left paren \( Right paren \)
47 % Asterisk \* Plus \+ Comma \,
48 % Minus \- Point \. Solidus \/
49 % Colon \: Semicolon \; Less than \<
50 % Equals \= Greater than \> Question mark \?
51 % Commercial at \@ Left bracket \[ Backslash \\
52 % Right bracket \] Circumflex \^ Underscore \_
53 % Grave accent \` Left brace \{ Vertical bar \|
54 % Right brace \} Tilde \~}
55 %
56 % \makeatletter
57 % \def\SpecialOptionIndex#1{\@bsphack
58 % \index{#1\actualchar{\protect\ttfamily#1}
59 % (option)\encapchar usage}%
60 % \index{options:\levelchar{\protect\ttfamily#1}\encapchar
61 % usage}\@esphack}
62 % \def\DescribeOption{\leavevmode\@bsphack\begingroup\MakePrivateLetters
63 % \Describe@Option}
64 % \def\Describe@Option#1{\endgroup
65 % \marginpar{\raggedleft\PrintDescribeEnv{#1}}%
66 % \SpecialOptionIndex{#1}\@esphack\ignorespaces}
67 % \providecommand{\LyX}{L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
68 % \makeatother
69 %
70 % \GetFileInfo{simplecv.dtx}
71 %
72 % \DoNotIndex{\newcommand,\newenvironment}
73 %
74 % \changes{1.0}{1998/03/23}{First public release}
75 % \changes{1.1}{1998/11/06}{Better documentation, in order to release it for
76 % \LyX}
77 % \changes{1.2}{1998/12/01}{Changed the justification of items labels
78 % (with help from Amir Karger)}
79 % \changes{1.2}{1998/12/01}{Changed the semantics of \cs{topicfont} and
80 % \cs{itemfont}}
81 % \changes{1.3}{1999/02/09}{Added class options sf and plain}
82 % \changes{1.4}{2001/05/04}{Added notopicbreak class option}
83 % \changes{1.5}{2001/06/18}{Added hebrew support (from Dekel Tsur)}
84 % \changes{1.5}{2001/06/18}{Added contbibnum class option}
85 % \changes{1.5}{2001/06/18}{Added titleabove class option}
86 % \changes{1.5}{2001/06/18}{Some variables renaming and cleanups}
87 % \changes{1.6}{2007/04/22}{New option topictitle and associated
88 % \cs{topcilabelfont}}
89 % \changes{1.6}{2007/04/22}{Renamed class to simplecv}
90 % \changes{1.6}{2007/04/22}{Convert to use docstrip}
91 % \changes{1.6a}{2014/11/07}{Fix incompatibility with \texttt{array} package}
92 %
93 % \title{The \textsf{simplecv} class\thanks{This document
94 % corresponds to \textsf{simplecv}~\fileversion, dated \filedate.}}
95 % \author{Jean-Marc Lasgouttes\\ \texttt{[email protected]}}
96 %
97 % \maketitle
98 %
99 % \section{Introduction}
100 %
101 % The |simplecv| document class is intended to provide a simple
102 % yet elegant way to write your curriculum vitae (resume). This is a
103 % repackaging of the |cv| class that has been available with \LyX{} for a
104 % long time. The change of name has been made necessary by the
105 % existence of another |cv| class on CTAN.
106 %
107 % Before I delve into the details, I would like to thank Amir Karger,
108 % Reuben Thomas and Dekel Tsur for their help and tips.
109 %
110 % \section{Basic Usage}
111
112 % \subsection{Class options}
113
114 % The document class accepts some options (along with the usual
115 % |article| class ones). The first set allows to select a style (a set
116 % of fonts):
117 %
118 % \begin{description}
119 % \item[|sf|] \DescribeOption{sf} (default) produce title and
120 % headers in sans serif fonts;
121 % \item[|plain|] \DescribeOption{plain}produce all output with roman fonts.
122 % \end{description}
123 % The rest of the options may be useful according to one's tastes.
124 %
125 % \begin{description}
126 % \item[|notopicbreak|] \DescribeOption{notopicbreak}do not add a
127 % line break after long topic labels;
128 % \item[|contbibnum|] \DescribeOption{contbibnum}let the numbering
129 % of bibliography items be ontinuous when there are several
130 % thebibliography environments;
131 % \item[|titleabove|] \DescribeOption{titleabove}output the title
132 % above the left and right headers, not below;
133 % \item[|topictitle|] \DescribeOption{topictitle}let the first
134 % paragraph after each \cs{item} have font \cs{topictitlefont}, and
135 % therefore act as a kind of title.
136 % \end{description}
137 %
138 % \subsection{The header of the CV}
139 % The macros below can be used to typeset the top of the CV.
140 %
141 % \DescribeMacro\leftheader
142 % \cs{leftheader}\oarg{pos}\marg{text}
143 % defines what should appear in the upper left of the first page.
144 % \meta{text} may contain |\\| to break lines. \meta{pos} can be |l|,
145 % |r| or |c| and specifies the horizontal alignment (default is |l|).
146 %
147 % \DescribeMacro\rightheader
148 % \cs{rightheader}\oarg{pos}\marg{text} is like \cs{leftheader}, but for
149 % the upper right of the first page.
150 %
151 % \DescribeMacro\title
152 % \cs{title}\marg{text} defines a title, that will appear centered below the
153 % headers (or above, if the |titleabove| option is
154 % used).
155 % \DescribeMacro\maketitle
156 % \cs{maketitle} actually typesets the header.
157 %
158 % \subsection{Topics}
159 % The CV is divided in topics (and in some cases subtopics). In order
160 % to introduce these, the \cs{section} and \cs{subsection} macros are
161 % reused.
162 %
163 % \DescribeMacro\section
164 % \DescribeMacro\subsection
165 % \cs{section}\marg{text} gives a title for a new topic of the CV and
166 % \cs{subsection}\marg{text} does the same for a sub-topic. There are no
167 % other sectionning levels.
168 %
169 % \DescribeEnv{topic}
170 % The |topic| environment begins an itemize-like environment where the
171 % argument of \cs{item[]} is typeset in font \cs{topiclabelfont}. A
172 % line break is automatically inserted if the label is too long to
173 % fit in the margin (this can be controlled by option |notopicbreak|).
174 %
175 % \subsection{Miscellaneous}
176 % \DescribeEnv{thebibliography}
177 % The |simplecv| document class also has some support for bibliography.
178 % You can use the |thebibliography| environment as usual, in
179 % particular wih BibTeX . The output is similar to the |topic|
180 % environment. If you separate your bibliography into several
181 % sections, you may want to use the |contbibnum| document class
182 % option.
183 %
184 % Note that this class also has support for right-to-left languages,
185 % such as hebrew (courtesy Dekel Tsur).
186 %
187 % \section{Customization}
188 %
189 % You can modify directly the fonts used in the document by using the
190 % following macros. They take one parameter which is the font changing
191 % command.
192 %
193 % \begin{description}
194 % \item \cs{headerfont} \DescribeMacro\headerfont the font used in
195 % both headers. Defaults to sans serif.
196 % \item \cs{titlefont} \DescribeMacro\titlefont the font used for the title.
197 % Defaults to LARGE sans-serif semi bold condensed.
198 % \item \cs{sectionfont} \DescribeMacro\sectionfont the font used by
199 % \cs{section} when beginning a new topic. Defaults to sans-serif semi
200 % bold condensed.
201 % \item \cs{subsectionfont} \DescribeMacro\subsectionfont the font
202 % used by \cs{subsection} when beginning a new topic.
203 % Defaults to sans-serif semi bold condensed.
204 % \item \cs{topiclabelfont} \DescribeMacro\topiclabelfont the font used for
205 % the items' labels. Defaults to sans-serif slanted.
206 % \item \cs{topictitlefont} \DescribeMacro\topictitlefont the font used for
207 % the items' titles (with option |topictitle|). Defaults to
208 % sans-serif slanted.
209 % \end{description}
210 %
211 % You can modify the following parameter using \cs{renewcommand}
212 % \begin{description}
213 % \item \cs{topicmargin} \DescribeMacro\topicmargin the left margin
214 % inside topics. Defaults to $20\%$ of the column width
215 % (|0.20\columnwidth|).
216 % \end{description}
217 %
218 % \StopEventually{\PrintChanges\PrintIndex}
219 %
220 % \section{The Implementation}
221 %
222 % The fonts used in the layout
223 % \begin{macro}{\sectionfont}
224 % \begin{macro}{\subsectionfont}
225 % \begin{macro}{\topiclabelfont}
226 % \changes{1.6}{2007/04/22}{renamed from \cs{itemfont}; the old name
227 % is kept as an alias for compatibility}
228 % \begin{macro}{\topictitlefont}
229 % \begin{macro}{\headerfont}
230 % \begin{macro}{\titlefont}
231 % \changes{1.2}{1998/12/01}{added, together with \cs{headerfont}}
232 % \begin{macrocode}
233 %<*class>
234 \newcommand{\sectionfont}[1]{\def\cv@sec@fnt{#1}}
235 \newcommand{\subsectionfont}[1]{\def\cv@ssec@fnt{#1}}
236 \newcommand{\topiclabelfont}[1]{\def\cv@tlab@fnt{#1}}
237 \newcommand{\topictitlefont}[1]{\def\cv@ttit@fnt{#1}}
238 \newcommand{\headerfont}[1]{\def\cv@hd@fnt{#1}}
239 \newcommand{\titlefont}[1]{\def\cv@tit@fnt{#1}}
240 % \end{macrocode}
241 % for compatibility
242 % \begin{macrocode}
243 \let\itemfont=\topiclabelfont
244 % \end{macrocode}
245 % \end{macro}
246 % \end{macro}
247 % \end{macro}
248 % \end{macro}
249 % \end{macro}
250 % \end{macro}
251 % Some document class options.
252 % \begin{macrocode}
253 \DeclareOption{sf}{
254 \sectionfont{\sffamily\fontseries{sbc}\selectfont}
255 \subsectionfont{\sffamily\fontseries{sbc}\selectfont}
256 \topiclabelfont{\sffamily\slshape}
257 \topictitlefont{\sffamily\slshape}
258 \headerfont{\sffamily}
259 \titlefont{\sffamily\fontseries{sbc}\selectfont\LARGE}
260 }
261 \DeclareOption{plain}{
262 \sectionfont{\bfseries}
263 \subsectionfont{\bfseries}
264 \topiclabelfont{\itshape}
265 \topictitlefont{\itshape}
266 \headerfont{}
267 \titlefont{\bfseries\LARGE}
268 }
269 \newif\if@cv@topic@title \@cv@topic@titlefalse
270 \DeclareOption{topictitle}{
271 \@cv@topic@titletrue
272 }
273 \newif\if@cv@topic@break \@cv@topic@breaktrue
274 \DeclareOption{notopicbreak}{
275 \@cv@topic@breakfalse
276 }
277 \newif\if@cv@cont@bib@num \@cv@cont@bib@numfalse
278 \DeclareOption{contbibnum}{
279 \@cv@cont@bib@numtrue
280 \newcounter{cv@save@bib@num}
281 }
282 \newif\if@cv@title@above \@cv@title@abovefalse
283 \DeclareOption{titleabove}{
284 \@cv@title@abovetrue
285 }
286 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
287 \ExecuteOptions{sf,letterpaper,10pt,oneside,onecolumn,final}
288 \ProcessOptions
289 \LoadClass{article}
290 % \end{macrocode}
291 % Support for RTL (Hebrew). This will be defined and set by babel for
292 % RtL languages, but we define it here for the benefit of others.
293 % \begin{macrocode}
294 \newif\if@rl
295 % \end{macrocode}
296 % \begin{macro}{\leftheader}
297 % \begin{macro}{\rightheader}
298 % The left and right headers. These are just saved in macros for use
299 % by \cs{maketitle}.
300 % \changes{1.2}{1998/12/01}{remove optional
301 % \meta{width} argument (with help from Amir Karger)}
302 % \changes{1.6}{2007/04/22}{Added optional argument for horizontal alignment}
303 % \begin{macrocode}
304 \newcommand{\leftheader}[2][l]{\def\cv@lh@lr{#1}\def\cv@lh{#2}}
305 \newcommand{\rightheader}[2][l]{\def\cv@rh@lr{#1}\def\cv@rh{#2}}
306 % \end{macrocode}
307 % \end{macro}
308 % \end{macro}
309 % \begin{macro}{\title}
310 % The title (like ``Curriculum Vitae'' or the name of the author).It
311 % is just saved in a macro for use by \cs{maketitle}.
312 % \changes{1.2}{1998/12/01}{new command}
313 % \begin{macrocode}
314 \renewcommand{\title}[1]{\def\cv@tit{#1}}
315 % \end{macrocode}
316 % \end{macro}
317 % Default to empty.
318 % \begin{macrocode}
319 \leftheader{}\rightheader{}\title{}
320 % \end{macrocode}
321 % \begin{macro}{\maketitle}
322 % And now a command to actually show the headers
323 % \changes{1.6a}{2014/11/07}{Fix incompatibility with \texttt{array} package}
324 % \begin{macrocode}
325 \newcommand{\cv@header}[2]{%
326 \if@rl%
327 \begin{tabular}[t]{@{\cv@hd@fnt\beginR}#1@{\endR}}%
328 \else%
329 \begin{tabular}[t]{@{\cv@hd@fnt}#1@{}}%
330 \fi%
331 #2%
332 \end{tabular}}
333 \newcommand{\cv@do@title}{\par\bigskip
334 \begin{center} \cv@tit@fnt\cv@tit\end{center}}
335 \renewcommand{\maketitle}{%
336 \if@cv@title@above\cv@do@title\fi
337 \par\noindent%
338 \begin{tabular*}{\textwidth}{@{}l@{\extracolsep{\fill}}l@{}}
339 \expandafter\cv@header\cv@lh@lr\cv@lh%
340 &\expandafter\cv@header\cv@rh@lr\cv@rh
341 \end{tabular*}
342 \par
343 \if@cv@title@above\else\cv@do@title\fi
344 \bigskip\par}
345 % \end{macrocode}
346 % \end{macro}
347 % \begin{macro}{\section}
348 % Redefine \cs{section} to use \cs{cv@sec@fnt}
349 % \begin{macrocode}
350 \renewcommand{\section}{
351 \@startsection{section}{1}{\z@}
352 {-3.5ex \@plus -1ex \@minus -.2ex}
353 {2.3ex \@plus .2ex}{\cv@sec@fnt}}
354 % \end{macrocode}
355 % \end{macro}
356 % \begin{macro}{\subsection}
357 % Now the subsection
358 % \changes{1.3}{1999/02/09}{added (with
359 % associated font command \cs{subsectionfont})}
360 % \begin{macrocode}
361 \renewcommand{\subsection}{
362 \@startsection{subsection}{1}{3em}
363 {-3.5ex \@plus -1ex \@minus -.2ex}
364 {2.3ex \@plus .2ex}{\cv@ssec@fnt}}
365 % \end{macrocode}
366 % \end{macro}
367 % the other ones do not exist.
368 % \changes{1.1}{1998/11/06}{disable all sectionning commands other that
369 % \cs{section}}
370 % \begin{macrocode}
371 \let\subsubsection=\relax
372 \let\paragraph=\relax \let\subparagraph=\relax
373 % \end{macrocode}
374 % we do not want any numbering
375 % \changes{1.1}{1998/11/06}{disabled numbering of sections}
376 % \begin{macrocode}
377 \setcounter{secnumdepth}{0}
378 % \end{macrocode}
379 % \begin{macro}{\topicmargin}
380 % \changes{1.5}{2001/06/18}{now a macro that defaults to $20\%$ of text width}
381 % \changes{1.6}{2007/04/22}{Change default value to
382 % $0.2$\cs{columnwidth}, to improve layout in two-columns mode}
383 % The left margin for topics
384 % \begin{macrocode}
385 \newcommand{\topicmargin}{0.20\columnwidth}
386 \newlength{\t@picmargin}
387 % \end{macrocode}
388 % \end{macro}
389 % \begin{environment}{topic}
390 % Define the topic environment.
391 %
392 % First the macros that typeset the label.
393 % \begin{macrocode}
394 \newcommand{\@topic@makelabel}[1]{\cv@tlab@fnt #1\hfill}
395 \let\@topic@old@item=\@item
396 \newlength{\topic@label@length}
397 \def\@topic@item[#1]{%
398 \@topic@old@item[#1]%
399 \if@cv@topic@break%
400 \settowidth{\topic@label@length}{#1}%
401 \ifdim\topic@label@length>\labelwidth\mbox{}\\*\fi%
402 \fi%
403 \if@cv@topic@title%
404 \mbox{}\cv@ttit@fnt%
405 \everypar\expandafter{\the\everypar \normalfont}%
406 \fi%
407 }
408 \newcommand{\@topic@setup}{%
409 \setlength{\t@picmargin}{\topicmargin}
410 \if@rl%
411 \setlength{\leftmargin}{0cm}%
412 \setlength{\rightmargin}{\t@picmargin}%
413 \else%
414 \setlength{\leftmargin}{\t@picmargin}%
415 \setlength{\rightmargin}{0cm}%
416 \fi%
417 \setlength{\labelwidth}{0.8\t@picmargin}%
418 \let\makelabel=\@topic@makelabel%
419 }
420 \newenvironment{topic}
421 {\list{}
422 {\@topic@setup%
423 \let\@item=\@topic@item}}
424 {\endlist}
425 % \end{macrocode}
426 % \end{environment}
427 % \begin{environment}{thebibliography}
428 % \changes{1.1}{1998/11/06}{added \cs{refname}}
429 % \changes{1.3}{1999/02/09}{does not add a section by itself anymore;
430 % remove \cs{refname}}
431 % Redefine the thebibliography environment to look like the topic
432 % environment. The argument of thebibliography is ignored.
433 % In older versions, the environment produced its own \cs{section}
434 % command, but this was removed in version 1.3 (following an idea of
435 % Reuben Thomas).
436 % \begin{macrocode}
437 \renewenvironment{thebibliography}[1]
438 {\list{\@biblabel{\theenumiv}}{%
439 \@topic@setup%
440 \@openbib@code%
441 \usecounter{enumiv}%
442 \let\p@enumiv\@empty%
443 \renewcommand\theenumiv{\@arabic\c@enumiv}}%
444 \if@cv@cont@bib@num%
445 \setcounter{enumiv}{\value{cv@save@bib@num}}%
446 \fi%
447 \sloppy \clubpenalty 4000 \widowpenalty 4000 \sfcode`\.=\@m}%
448 {\endlist%
449 \if@cv@cont@bib@num%
450 \setcounter{cv@save@bib@num}{\value{enumiv}}%
451 \fi}
452 %</class>
453 % \end{macrocode}
454 % \end{environment}
455 % \Finale
456
457 \endinput