1 %%%% This is the cv document class, intended to provide a simple way
2 %%%% to write your curriculum vitaes (resume)
3 %%%% Author: Jean-Marc Lasgouttes (Jean-Marc.Lasgouttes@inria.fr)
4 %%%% (with lot of help from Amir Karger <karger@bead.aecom.yu.edu>,
5 %%%% Reuben Thomas <rrt@dcs.gla.ac.uk>
6 %%%% and Dekel Tsur <dekelts@tau.ac.il>)
7 %%%% WARNING: this document class is really simple. Don't expect too much.
8 %%%% You can do what you want with this code.
11 %% \leftheader{text} : defines what should appear in the upper
12 %% left of the first page. `Text' may contain \\ to break lines.
13 %% \rightheader{text} : like \leftheader, but for the upper right of
15 %% \title{text} : defines a title, will will appear centered below the
16 %% headers (or above, if the `titleabove' option is used)
17 %% \maketitle: actually typesets the header.
19 %% \section{text} : gives a title for a new topic of the CV.
21 %% `topic' environment: begins an itemize-like environment where the
22 %% argument of \item[] is typeset in font \itemfont. A line break is
23 %% automatically inserted if the label is too long to fit in the
24 %% margin (this can be controlled by option `notopicbreak').
26 %% The cv document class also has some support for bibliography.
27 %% You can use the `thebibliography' environment as usual, in
28 %% particular wih BibTeX . The output is similar to the `topic'
29 %% environment. If you separate your bibliography into several
30 %% sections, you may want to use the `contbibnum' document class
33 %% Note that this class also has support for right-to-left languages,
34 %% such as hebrew (courtesy Dekel Tsur).
36 %% The document class accepts some options (along with the usual
37 %% article.cls options):
38 %% sf (default) produce title and headers in sans serif fonts
39 %% plain produce all output in roman fonts.
40 %% notopicbreak do not add a line break after longtopic labels.
41 %% contbibnum let the numbering of bibliography items be
42 %% continuous when there are several thebibliography
44 %% titleabove output the title above the left and right headers,
47 %% You can also modify directly the fonts used in the document be
48 %% using the following macros. They take one parameter which is the font
50 %% \headerfont: the font used in both headers.
51 %% Defaults to sans serif.
52 %% \titlefont: the font used for the title.
53 %% Defaults to \LARGE sans-serif semi bold condensed.
54 %% \sectionfont: the font used by \section when beginning a new topic.
55 %% Defaults to sans-serif semi bold condensed.
56 %% \subsectionfont: the font used by \subsection when beginning a new
58 %% Defaults to sans-serif semi bold condensed.
59 %% \itemfont: the font used in descriptions of items.
60 %% Defaults to sans-serif slanted.
62 %% You can modify the following parameters using \renewcommand:
63 %% \topicmargin: the left margin inside topics.
64 %% Defaults to 20% of the text width (0.20\textwidth).
67 %% - 1.0 1998/03/23: First public release.
68 %% - 1.1 1998/11/06: Better documentation, in order to release it for
69 %% LyX ,added \refname, disabled all sectionning commands other that
70 %% \section, disabled numbering of sections.
72 %% * Refined the algorithm to display the headers. In
73 %% particular, \leftheader and \rightheader do not exist
75 %% * Changed the justification of items labels
76 %% [Thanks to Amir Karger <karger@bead.aecom.yu.edu> for the two
78 %% * Added command \title
79 %% * Changed the semantics of \topicfont and \itemfont, and added
80 %% \titlefont and \headerfont
83 %% * The thebibliography environment does not add a section by
84 %% itself anymore. This means that you can/should add your own
85 %% and that \refname does not exist anymore.
86 %% [Thanks to Reuben Thomas for the idea]
87 %% * Added support for subsections (with associated font command
89 %% * Added class options `sf' and `plain'.
91 %% * Added `notopicbreak' class option.
93 %% * Added hebrew support (from Dekel Tsur).
94 %% * \topicmargin is now a macro and defaults to 20% of text width.
95 %% * Added `contbibnum' class option.
96 %% * Added `titleabove' class option.
97 %% * some variables renaming and cleanups.
100 %% Basic definition to have a real LaTeX document class
101 \NeedsTeXFormat{LaTeX2e}
102 \ProvidesClass{cv}[2001/06/18 Curriculum vitae version 1.5]
104 %% The fonts used in the layout
105 \newcommand{\sectionfont}[1]{\def\cv@sec@fnt{#1}}
106 \newcommand{\subsectionfont}[1]{\def\cv@ssec@fnt{#1}}
107 \newcommand{\itemfont}[1]{\def\cv@it@fnt{#1}}
108 \newcommand{\headerfont}[1]{\def\cv@hd@fnt{#1}}
109 \newcommand{\titlefont}[1]{\def\cv@tit@fnt{#1}}
111 % Some document class options.
113 \sectionfont{\sffamily\fontseries{sbc}\selectfont}
114 \subsectionfont{\sffamily\fontseries{sbc}\selectfont}
115 \itemfont{\sffamily\slshape}
116 \headerfont{\sffamily}
117 \titlefont{\sffamily\fontseries{sbc}\selectfont\LARGE}
119 \DeclareOption{plain}{
120 \sectionfont{\bfseries}
121 \subsectionfont{\bfseries}
124 \titlefont{\bfseries\LARGE}
126 \newif\if@cv@topic@break \@cv@topic@breaktrue
127 \DeclareOption{notopicbreak}{
128 \@cv@topic@breakfalse
130 \newif\if@cv@cont@bib@num \@cv@cont@bib@numfalse
131 \DeclareOption{contbibnum}{
132 \@cv@cont@bib@numtrue
133 \newcounter{cv@save@bib@num}
135 \newif\if@cv@title@above \@cv@title@abovefalse
136 \DeclareOption{titleabove}{
139 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
140 \ExecuteOptions{sf,letterpaper,10pt,oneside,onecolumn,final}
144 % Support for RTL (Hebrew). This will be defined and set by babel for
145 % RtL languages, but we define it here for the benefit of others.
148 %% stuff needed for the header
149 \newcommand{\leftheader}[1]{\def\cv@lh{#1}}
150 \newcommand{\rightheader}[1]{\def\cv@rh{#1}}
151 \renewcommand{\title}[1]{\def\cv@tit{#1}}
153 \leftheader{}\rightheader{}\title{}
154 % And now a command to actually show the headers
155 \newcommand{\cv@header}[1]{%
157 \begin{tabular}[t]{@{\cv@hd@fnt\beginR}l@{\endR}}%
159 \begin{tabular}[t]{@{\cv@hd@fnt}l@{}}%
163 \newcommand{\cv@do@title}{\par\bigskip
164 \begin{center} \cv@tit@fnt\cv@tit\end{center}}
165 \renewcommand{\maketitle}{%
166 \if@cv@title@above\cv@do@title\fi
168 \begin{tabular*}{\textwidth}{@{}l@{\extracolsep{\fill}}l@{}}
169 \cv@header{\cv@lh}&\cv@header{\cv@rh}
172 \if@cv@title@above\else\cv@do@title\fi
175 %% Redefine \section to use \cv@sec@fnt
176 \renewcommand{\section}{
177 \@startsection{section}{1}{\z@}
178 {-3.5ex \@plus -1ex \@minus -.2ex}
179 {2.3ex \@plus .2ex}{\cv@sec@fnt}}
180 \renewcommand{\subsection}{
181 \@startsection{subsection}{1}{3em}
182 {-3.5ex \@plus -1ex \@minus -.2ex}
183 {2.3ex \@plus .2ex}{\cv@ssec@fnt}}
184 % the other ones do not exist.
185 \let\subsubsection=\relax
186 \let\paragraph=\relax \let\subparagraph=\relax
187 % we do not want any numbering
188 \setcounter{secnumdepth}{0}
190 %% Define the topic environment
191 % The left margin for topics
192 \newcommand{\topicmargin}{0.20\textwidth}
193 \newlength{\t@picmargin}
195 \newcommand{\@topic@makelabel}[1]{\cv@it@fnt #1\hfill}
196 \let\@topic@old@item=\@item
197 \newlength{\topic@label@length}
198 \def\@topic@item[#1]{%
200 \settowidth{\topic@label@length}{#1}%
201 \@topic@old@item[#1]%
202 \ifdim\topic@label@length>\labelwidth\mbox{}\\*\fi%
204 \@topic@old@item[#1]%
206 \newcommand{\@topic@setup}{%
207 \setlength{\t@picmargin}{\topicmargin}
209 \setlength{\leftmargin}{0cm}%
210 \setlength{\rightmargin}{\t@picmargin}%
212 \setlength{\leftmargin}{\t@picmargin}%
213 \setlength{\rightmargin}{0cm}%
215 \setlength{\labelwidth}{0.8\t@picmargin}%
216 \let\makelabel=\@topic@makelabel}
217 \newenvironment{topic}
220 \let\@item=\@topic@item}}
223 %% Redefine the thebibliography environment to look like the topic
224 %% environment. The argument of thebibliography is ignored
225 \renewenvironment{thebibliography}[1]
226 {\list{\@biblabel{\theenumiv}}{%
230 \let\p@enumiv\@empty%
231 \renewcommand\theenumiv{\@arabic\c@enumiv}}%
233 \setcounter{enumiv}{\value{cv@save@bib@num}}%
235 \sloppy \clubpenalty 4000 \widowpenalty 4000 \sfcode`\.=\@m}%
238 \setcounter{cv@save@bib@num}{\value{enumiv}}%