1% RESUME DOCUMENT STYLE -- Released 23 Nov 1989
2%    for LaTeX version 2.09
3% Copyright (C) 1988,1989 by Michael DeCorte
4
5\typeout{Document Style `res' <26 Sep 89>.}
6
7%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8% res.sty
9%
10% \documentstyle{res}
11%
12% Copyright (c) 1988 by Michael DeCorte
13% Permission to copy all or part of this work is granted, provided
14% that the copies are not made or distributed for resale, and that
15% the copyright notice and this notice are retained.
16%
17% THIS WORK IS PROVIDED ON AN "AS IS" BASIS.  THE AUTHOR PROVIDES NO
18% WARRANTY WHATSOEVER, EITHER EXPRESS OR IMPLIED, REGARDING THE WORK,
19% INCLUDING WARRANTIES WITH RESPECT TO ITS MERCHANTABILITY OR FITNESS
20% FOR ANY PARTICULAR PURPOSE.
21%
22% If you make any improvements, I'd like to hear about them.
23%
24% Michael DeCorte
25% P.O. Box 652
26% Potsdam NY 13676
27% mrd@sun.soe.clarkson.edu
28% mrd@clutx.bitnet
29%
30% Changes for LaTeX2e -- Venkat Krishnamurthy (Aug 7, 2001)
31%
32%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
33% You can have multiple style options the legal options ones are:
34%
35%   centered	the name and address are centered at the top of the
36%		page (default)
37%
38%   line	the name is the left with a horizontal line then
39%		the address to the right
40%
41%   overlapped	the section titles overlap the body text (default)
42%
43%   margin	the section titles are to the left of the body text
44%
45%   11pt	use 11 point fonts instead of 10 point fonts
46%
47%   12pt	use 12 point fonts instead of 10 point fonts
48%
49%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
50%   Commands
51%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
52%   \Resume	prints the word resume but typeset nicely
53%
54%   \newsectionwidth{dimen}
55%		defines the amount of space the labels extend
56%		into the left margin.
57%		DO NOT TRY to change any of the dimensions
58%		yourself.  You will probably confuse the style file.
59%
60%   \name{text} defines your name
61%
62%   \address{text}
63%		defines your address
64%		this can be called twice if you have two addresses
65%		use \\'s to indicate where either line breaks or
66%		comas should go
67%
68%   \opening	this prints your name and address at that spot
69%		this is not normally needed, as \begin{resume}
70%		does this but is provided just in case you need
71%		to do something odd
72%
73%   \begin{resume} ... \end{resume}
74%		all of the resume should go inside of this
75%		environment
76%
77%   \section{text}
78%		This prints 'text' in the left hand margin.
79%		Its exact placement depends on what the style
80%		options has been set to. (overlapped or margin)
81%		You should use \\ to start a new line.	If the
82%		style option is margin, the \\ is converted
83%		to a space.
84%		To use this in any of the list environments, put
85%		the \section after the \item[] but before the
86%		text.
87%		Eg.
88%		\begin{itemize}
89%		\item\section{text}
90%		text
91%		\end{itemize}
92%
93%   \begin{ncolumn}{n} ... \end{ncolumn}
94%		creates a tabular environment with n equally
95%		spaced columns.  Separate columns by & and
96%		end them with \\
97%
98%   \begin{position} ... \end{position}
99%		this is used to print a job description.  There should
100%		be only one job description in it.  Information
101%		related to the job (such as title, dates...) will
102%		be printed.
103%
104%   \begin{format} ... \end{format}
105%		used to change the default format for the position
106%		environment.  Within it the recognized commands are:
107%		\title{option}
108%		\employer{option}
109%		\location{option}
110%		\dates{option}
111%		\body
112%		\\
113%		where option is one of l,r,c standing for left, right, center.
114%		The format will eventually be used to make several
115%		tabular environments and you are defining the number of columns
116%		and the placement of text within the columns of the tabulars.
117%		Each row is terminated by a \\.  Any number of options can
118%		be on a line, they will each be set in their own columns.
119%		Any of the options except \body may be left out.
120%
121%		Eg.
122%		\begin{format}
123%		\title{l}\employer{r}\\
124%		\dates{r}\\
125%		\body\\
126%		\location{l}\\
127%		\end{format}
128%
129%		In this example the title and employer information
130%		are set in 2 columns left justified and right justified
131%		respectively.  Then the date is set right justified.
132%		Then the body is set.  Then the location is set left
133%		justified.
134%
135% \employer{text}
136% \title{text}
137% \dates{text}
138% \location{text}
139%		declare text for the next invocation of the position
140%		environment
141%
142%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
143% Glue
144%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
145%
146% sectionskip	the amount of horizontal before a section
147%
148%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
149% Dimensions
150%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
151%
152% sectionwidth	the amount that the section titles go in the
153%		left margin
154%
155% resumewidth	the width of the total resume from the left
156%		margin to the right.  Don't use textwidth
157%
158%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
159% Definitions
160%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
161%
162% sectionfont	the font used to print section titles
163%		use \renewcommand to change it
164%
165% namefont	the font used to print your name
166%		use \renewcommand to change it
167%
168%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
169% THINGS TO DO
170%
171% add lm,rm options to format style to allow things to be placed
172% in the left or right margin respectivly
173%
174% add capability so that \body doesn't have to be proceeded (followed)
175% by a \\ allowing part of the description (eg. location) to be the
176% first (last) thing of the body
177%
178% clean up the list building procedures
179%
180% write docs to tell people how to use this
181
182\NeedsTeXFormat{LaTeX2e}[1995/12/01]
183\ProvidesClass{res}[2000/05/19 v1.4b Resume class]
184
185%\DeclareOption{11pt}{\renewcommand\@ptsize{1}}
186%\DeclareOption{12pt}{\renewcommand\@ptsize{2}}
187
188\PassOptionsToClass{11pt,12pt}{article}
189\LoadClassWithOptions{article}
190
191\newif\if@line
192\newif\if@margin
193
194\DeclareOption{line}{\@linetrue}
195\DeclareOption{centered}{\@linefalse}
196
197\DeclareOption{margin}{\@margintrue}
198\DeclareOption{overlapped}{\@marginfalse}
199
200\ExecuteOptions{overlapped,centered}
201\ProcessOptions\relax
202
203\nofiles	     % resume's don't need .aux files
204
205
206\newtoks\tabular@text		    % holds the current list being processed
207\newtoks\tabular@head		    % holds the head tabular list
208\newtoks\tabular@tail		    % holds the tail tabular list
209\newtoks\@ta			    % used by \@append
210\newtoks\undefined@token\undefined@token={}
211
212%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
213% prints a centered name with the address centered
214% or the two address on opposite sides of the page
215%
216\def\@printcentername{\begingroup
217  % print the name centered
218  \leavevmode\hbox to \textwidth{\hfil\@tablebox{\namefont\@name}\hfil}\par
219  \@ifundefined{@addressone}{%
220    % do nothing
221  }{%
222    \@ifundefined{@addresstwo}{
223      % only one address
224      \leavevmode\hbox to \textwidth{\hfil\@tablebox{\@addressone}\hfil}\par
225    }{
226      % two addresses
227      \leavevmode\hbox to \textwidth{\@tablebox{\@addressone}\hfil
228				     \@tablebox{\@addresstwo}}\par
229    }%
230  }%
231\endgroup}
232
233%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
234% this is used to print the name and address at the top of
235% the page with a hline in between
236%
237\def\namefont{\large\bf}
238\def\@linename{\begingroup
239  \def\\{, }
240  {\namefont\@name}
241  \vskip 2pt
242  \fullline
243  \vskip 2pt
244  % where do you live?
245  \@ifundefined{@addressone}{%
246    % do nothing
247  }{%
248    \leavevmode\hbox to \textwidth
249      {\hfill\vbox{\hbox{\@addressone}
250		   \hbox{\@addresstwo}
251		  }%
252      }\par
253  }
254\endgroup}
255
256%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
257% HEADINGS:
258% There are two types of headings:
259% 1) one with the name centered and the address centered or
260%    in the left and right side if there are two address
261% 2) one where the name is in the upper left corner
262%    the a line accross the paper
263%    then the address all on one line in the right corner
264%    the second address will be directly below the first if defined
265%
266\let\print@name\relax
267\def\ds@centered{\ifx\print@name\relax\let\print@name\@printcentername\fi}
268\def\ds@line{\ifx\print@name\relax\let\print@name\@linename\fi}
269
270
271%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
272% Use this to set the sectionwidth.
273% It adjust the width of the text as well as the hoffset
274% You probably shouldn't touch any of the size paramaters
275% unless you really understand all of this but it is not
276% hard.  Either way, it can only be executed once
277%
278\def\sectionfont{\bf}
279\newdimen\sectionwidth
280\newskip\sectionskip
281\newdimen\resumewidth
282
283\resumewidth=6.5in
284\sectionskip=3.5ex plus 1ex minus -.2ex % values stolen from LaTeX
285
286\def\newsectionwidth#1{%
287		     \sectionwidth=#1
288		     \textwidth=\resumewidth
289		     \advance\textwidth-\sectionwidth
290		     \hsize=\textwidth
291		     \hoffset=\sectionwidth
292}
293
294
295%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
296% This is for sectiontitles that are entirely in the left margin.
297% multiline sectiontitles are permited and will be broken by
298% \TeX{} to fit into a box \verb|\sectionwidth| wide.  It is advised
299% that \verb|\\| be used to break the lines by hand as \TeX{} will
300% probably not do what you want.
301%
302% When using this with {\tt tabbing} and {\tt list} (or anything
303% that is made out of {\tt list}) put the \section's inside of
304% the \verb|\begin{}|  and the \verb|\item|Eg.
305% \begin{verbatim}
306% \begin{trivlist}
307% \item[]
308% \section{foo}
309% text
310% \end{trivlist}
311% \end{verbatim}
312%
313\def\boxed@sectiontitle#1{%
314  % this macro may be called in a tabular.  Special code must be written
315  % to accomodate this.  In LaTeX, a tabular is made out of hboxes.
316  % TeX never goes into horizontal mode because of this; it only
317  % gets into vertical mode and restricted horizontal mode.  Certain
318  % indenting problems must be handled because of this.  They
319  % are delt with at the end of this routine.
320  % It is also necessary to close the hbox that was created before
321  % the \section and create a new one when this macro has ended.
322  % This macro therefore simulates a \kill, so that any text before
323  % the \section not be printed.  The proper use is therefore
324  % ...
325  % text\\
326  % \section{foo}
327  % more text\\
328  % ...
329  \ifx\\\@tabcr    % is this in a tabular? (this *should* work but is a cludge)
330    \@stopfield    % the is the first part of a \kill
331   \else
332     \@@par	     % This will end the previous paragraph if needed and
333		   % go into vertical mode.  If this was already in
334		   % vertical mode then the \par does nothing.
335
336  \fi
337  \begingroup
338  \everypar={}%
339  \def\par{\@@par}%
340  \let\\=\@normalcr
341  \addpenalty{\@secpenalty} % this would be a good place for a page break
342			    % \@secpenalty is what LaTeX uses before its
343			    % section's.  It happens to be -300
344  \addvspace{\sectionskip}  % put in a bit of glue
345  % The following hbox will be contributed to the page list without going
346  % into horizontal mode.  Therefore, any \parindent's, \parshape's, \leftskip
347  % will be ignored but \hoffset's are not.  The result is that the box will
348  % only by \hoffset. This is what I want
349  \hbox to 0pt{%
350    \hss	 % this is an llap.  In other words, this glue
351		 % will shrink by the width of the stuff in the vbox
352		 % (\sectionwidth) into the left margin and then
353		 % insert the contents of the vbox.
354    \vtop to 0pt{% make a 0pt height paragraph, with the baseline at the
355		 % lined up with the baseline of the first box in the list
356      \leftskip=0pt
357      \hsize=\sectionwidth
358      \textwidth=\sectionwidth
359      \raggedright     % you don't want this filled out to the right margin
360      \sectionfont
361      #1\vss	       % Go into horizontal mode; do the paragraph;
362		       % go into vertical mode; add some negative glue
363		       % to give a box of 0pt height and depth
364    }%
365  }%
366  \addpenalty{-\@secpenalty} % this would be a bad place for a page break
367  \vskip-\baselineskip % when the next box is processed, baselineskip glue
368		       % glue will be added (the box has no depth because of
369		       % the \vss; therefore, we don't have to worry about
370		       % \lineskiplimit).  This -\baselineskip glue
371		       % is to undo this.  \nointerlineskip doesn't
372		       % work because the baseline of this line would be lined
373		       % up with the top of the top of the next box.  We
374		       % want the baselines lined up.
375		       %
376		       % It may have been possible to do this by forcing the
377		       % baseline of this box to be the top of the box but
378		       % then the interline skip between this box and the
379		       % previous box would be off as the baselines of the
380		       % this box (the one that being made above) and the
381		       % previous line would be separated by \baselineskip
382		       % (probably, it may be separted by the depth of the
383		       % previous box + \lineskip) but as the baseline of
384		       % this box has been moved to the top, the box's would
385		       % separted by to much glue.  The exact amount being
386		       % the height of this box.
387  \endgroup
388  \ifx\\\@tabcr   % is this in a tabular? (this *should* work but is a cludge)
389    % this is the second part of the \kill; it starts the next tabbing line
390    % Because this routine will never get into paragraph mode when used in
391    % tabbing the \parskip that is discussed below will never be inserted.
392    % Therefore it should not be negated as done below.
393    \@startline
394    \ignorespaces
395  \else
396    \vskip-\parskip    % The next thing to be contributed will be a paragraph.
397		       % Right before being contributed though a \vskip\parskip
398		       % will be inserted.  This is to negate it.
399		       %
400		       % I do consider this to be a bit of a cludge but
401		       % I can not find a way to write \unskipfutureskip
402		       % or a way to make TeX think that nothing has
403		       % been contributed to the page list.
404  \fi
405}
406
407
408%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
409% This is for sectiontitles that are entirely above the section text
410%
411\def\unboxed@sectiontitle#1{%
412  \ifx\\\@tabcr % see boxed@sectiontitle for explation
413    \@stopfield
414   \else
415     \@@par
416  \fi
417  \begingroup
418  \everypar={}%
419  \def\par{\@@par}%
420  \def\\{ }
421  \addpenalty{\@secpenalty}
422  \addvspace{\sectionskip}
423  \hbox to 0pt{\hss\hbox to \sectionwidth{\sectionfont#1\hss}}
424  \addpenalty{-\@secpenalty} % this would be a bad place for a page break
425  \endgroup
426  \ifx\\\@tabcr   % see boxed@sectiontitle for explation
427    \@startline
428  \else
429    \vskip-\parskip
430  \fi
431  \ignorespaces
432}
433
434%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
435% There are two types of section headings:
436% 1) the section heading is all on one line and directly
437%    below it, is the body of the text
438% 2) the section heading is entirely in the left margin
439%    (possibly taking multiple lines) with the body of
440%    the text next to it
441%
442\let\@@section\relax
443\def\ds@overlapped{\ifx\@@section\relax\newsectionwidth{0.5in}\let
444  \@@section\unboxed@sectiontitle\fi}
445\def\ds@margin{\ifx\@@section\relax\newsectionwidth{1.3in}\let
446  \@@section\boxed@sectiontitle\fi}
447
448%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
449% DEFAULTS: (some of them)
450%
451% centered name
452% overlapped section titles
453%
454% format is:
455%    title	 employer
456%    location	 dates
457%    body
458% with everything in the left of its column
459
460%\input article.sty
461
462\if@line\ds@line\else\ds@centered\fi
463\if@margin\ds@margin\else\ds@overlapped\fi
464
465
466%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
467% typeset resume all nice and pretty
468%
469\def\Resume{{R\'{e}sum\'{e}}}
470
471%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
472% makes a line of width \textwidth starting at -\hoffset
473%
474\def\fullline{		% hrules only listen to \hoffset
475  \nointerlineskip	% so I have this code
476  \moveleft\hoffset\vbox{\hrule width\textwidth}
477  \nointerlineskip
478}
479
480%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
481% create a multiline box.
482%
483\def\@tablebox#1{\begin{tabular}[t]{@{}l@{\extracolsep{\fill}}}#1\end{tabular}}
484
485%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
486% use this to define your name
487%
488\def\name#1{\def\@name{#1}}
489
490\def\@name{}
491
492%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
493% use this to define your address, this may be called more than once.
494%
495\let\@addressone\relax
496\let\@addresstwo\relax
497
498\def\address#1{
499  \@ifundefined{@addressone}{\def\@addressone{#1}}{\def\@addresstwo{#1}}}
500
501%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
502% if you want to print your name and address is a slightly
503% different format than sugessted, then this can be used
504% to place it exactly where you want
505%
506\def\opening{\def\@opening{}
507  \begingroup
508  \leftskip=-\hoffset	     % I use leftskip to move things to the left as
509  \advance\textwidth\hoffset % changing hoffset doesn't work. But this
510  \hsize=\textwidth	     % doesn't really work as hboxes are rules
511			     % are unaffeted
512  \let\par=\@@par
513  \parindent=0pt
514  \parskip=0pt
515  \print@name
516  \endgroup
517}
518
519%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
520% all of the resume goes in the resume environment
521%
522\newenvironment{resume}{\begingroup
523		       \@ifundefined{@opening}{\opening}{}
524}{\endgroup}
525
526%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
527% gives you a tabular environment with n equally spaced columns
528% \begin{ncolumn}{#} ... \end{ncolumn}
529%
530% The p option of LaTeX is broken in all but the newest verion
531% of latex.tex, this is how to fix it
532%
533\def\@endpbox{\par\egroup\hfil}
534\let\@@endpbox=\@endpbox
535
536\newdimen\@columnwidth	  % the width of each column equal to
537\def\ncolumn#1{%
538  % \@columnwidth = \textwidth / #1
539  \@columnwidth=\textwidth \divide\@columnwidth by #1
540  \begin{tabular*}{\textwidth}[t]%
541	{*{#1}{@{}p{\@columnwidth}@{\extracolsep{\fill}}}}
542}
543
544\def\endncolumn{\end{tabular*}}
545
546
547%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
548%   \employer{text} defines employer to be text
549%   \location{text} defines location to be text
550%   \dates{text}    defines dates    to be text
551%   \title{text}    defines title    to be text
552%   \body
553%
554
555\def\employer#1{\def\@employer{\print@employer{#1}}}
556\def\location#1{\def\@location{\print@location{#1}}}
557\def\dates#1{\def\@dates{\print@dates{#1}}}
558\def\title#1{\def\@title{\print@title{#1}}}
559
560\let\l@justify\raggedright
561\let\r@justify\raggedleft
562\let\c@justify\centering
563
564
565%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
566% \@format{name}{justify}
567% will define \print@#1 to print it's one argument
568% justified according to #2 which can be
569%	  l = left
570%	  r = right
571%	  c = center
572%
573% eg.
574%    \@format{employer}{c}
575%    is the same as \def\print@employer#1{{\centering #1\par}}
576%
577\def\@format#1#2{%
578  \expandafter\gdef\csname print@#1\endcsname##1{%
579    {\csname#2@justify\endcsname##1\par}}
580}
581
582%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
583% this is used to define how the position environment should
584% formated.
585%
586% \begin{format} positioning text \end{format}
587% where positioning text may be
588%  \employer{pos}
589%  \location{pos}
590%  \dates{pos}
591%  \title{pos}
592%  \body	    (for the body of the position environment)
593%   where pos is
594%     l for left
595%     r for right
596%     c for center
597% use \\ to break the line
598% you don't have to use all of the options.
599% on any one line, you should indicate what you want on that line
600% and where it should go within its column.
601% eg.
602% the following prints the employer in the left with the location
603% centered within that its column.  It then prints the date on the
604% right.  Then it prints the body of the position environment. Then
605% it prints the title centered within its column; as there is only
606% one column here it is really just centered.
607%
608% \begin{format}
609% \employer{l}\location{c}\\
610% \dates{r}\\
611% \body\\
612% \title{c}\\
613% \end{format}
614
615\newcounter{numberofcolumns}
616\newenvironment{format}{%
617  \def\end@line@head{\append@tabular@head{tabular@text}\tabular@text={}%
618    \c@numberofcolumns 0}
619  \def\end@line@tail{\append@tabular@tail{tabular@text}\tabular@text={}%
620    \c@numberofcolumns 0}
621  \tabular@text={}
622  \tabular@head={}
623  \tabular@tail={}
624  \c@numberofcolumns 0
625  \let\\=\end@line@head
626  \def\employer##1{\advance\c@numberofcolumns 1
627		   \@format{employer}{##1}
628		   \append@tabular@text{employer}}
629  \def\location##1{\advance\c@numberofcolumns 1
630		   \@format{location}{##1}
631		   \append@tabular@text{location}}
632  \def\dates##1{\advance\c@numberofcolumns 1
633		\@format{dates}{##1}
634		\append@tabular@text{dates}}
635  \def\title##1{\advance\c@numberofcolumns 1
636		 \@format{title}{##1}
637		\append@tabular@text{title}}
638  \def\body{\iftoks\tabular@head\undefined@token\then
639	    \else
640	      \@append{\noexpand\\}\to\tabular@head
641	    \skotfi
642	    \let\\=\end@line@tail}}{}
643
644%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
645%taken from page 378 of TeXbook but freely hacked
646%
647% appends the expansion of #1 to the token list #2
648
649\def\@append#1\to#2{%
650  \@ta=\expandafter{#1}%
651  \xdef\@append@temp{\the#2\the\@ta}
652  \global#2=\expandafter{\@append@temp}%
653}
654
655
656%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
657% CHAA006%vaxb.rhbnc.ac.uk@NSS.Cs.Ucl.AC.UK
658% texhax.88.078
659% is used to see if two token lists are equal
660% there must be a better way
661%
662
663\let \then = \empty
664\def \iftoks #1#2\then #3\else #4\skotfi{
665		\edef \1{\the #1}
666		\edef \2{\the #2}
667		\ifx \1\2\then #3\else #4\fi}
668
669
670%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
671% \append@tabular@text{command}
672%
673% appends command to the end of \tabular@text.
674% NOTE: command MUST be a command but without the \
675%	Eg. \append@tabular@text{relax}
676%
677% used to define \tabular@text for the tabular environment
678% used by append@tabular@head and append@tabular@tail
679%
680
681\def\append@tabular@text#1{%
682\iftoks\tabular@text\undefined@token\then
683  \global\tabular@text=\expandafter{\csname @#1\endcsname}
684\else
685  \@append{&}\to\tabular@text
686  \@append{\csname @#1\endcsname}\to\tabular@text
687\skotfi
688}
689
690%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
691% append@tabular@head
692%
693% appends command to the end of \tabular@text@head
694% NOTE: command MUST be a command but without the \
695%	Eg. \append@tabular@head{relax}
696%
697% used to define \tabular@head for the tabular environment
698% used by the position environment
699%
700\def\append@tabular@head#1{%
701  \ifnum\the\c@numberofcolumns=0\relax
702  \else
703    \iftoks\tabular@head\undefined@token\then
704      \relax
705    \else
706      \@append{\noexpand\\}\to\tabular@head
707      \@append{\noexpand\penalty-\@secpenalty}\to\tabular@head
708    \skotfi
709    \@append{\noexpand\begin{ncolumn}}\to\tabular@head
710    \@append{\expandafter{\the\c@numberofcolumns}}\to\tabular@head
711    \@append{\the\csname#1\endcsname}\to\tabular@head
712    \@append{\noexpand\end{ncolumn}}\to\tabular@head
713  \fi
714}
715
716%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
717% append@tabular@tail
718%
719% appends command to the end of \tabular@text@htail
720% NOTE: command MUST be a command but without the \
721%	Eg. \append@tabular@tail{relax}
722%
723% used to define \tabular@tail for the tabular environment
724% used by the position environment
725%
726\def\append@tabular@tail#1{%
727  \ifnum\the\c@numberofcolumns=0\relax
728  \else
729    \iftoks\tabular@tail\undefined@token\then
730    \else
731      \@append{\noexpand\\}\to\tabular@tail
732      \@append{\noexpand\penalty-\@secpenalty}\to\tabular@tail
733    \skotfi
734    \@append{\noexpand\begin{ncolumn}}\to\tabular@tail
735    \@append{\expandafter{\the\c@numberofcolumns}}\to\tabular@tail
736    \@append{\the\csname#1\endcsname}\to\tabular@tail
737    \@append{\noexpand\end{ncolumn}}\to\tabular@tail
738  \fi
739}
740
741%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
742% put the actual job descriptions here
743% \begin{postion} ... \end{position}
744% in the ... describe the position.
745% don't put the \dates \location etc in here. define them before hand
746\newenvironment{position}%
747  {%
748   \begingroup
749     \par
750       \the\tabular@head
751%     \addpenalty{-\@secpenalty}% bad place for a page break
752     \penalty -\@secpenalty % bad place for a page break
753     \penalty 10000
754     \ignorespaces
755  }{%
756       \the\tabular@tail
757%     \addpenalty{\@secpenalty}% good place for a page break
758     \penalty \@secpenalty % good place for a page break
759    \endgroup
760}
761
762%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
763% DEFAULTS: (the rest of them)
764%
765% centered name
766% overlapped section titles
767%
768% format is:
769%    title	 employer
770%    location	 dates
771%    body
772% with everything in the left of its column
773
774\@secpenalty = -500
775\topmargin 0pt
776\headheight 0pt
777\headsep 0pt
778\textheight 9in
779\parindent 0pt
780\topmargin 0in
781\oddsidemargin 0pt
782\evensidemargin 0pt
783\marginparwidth 0pt
784\parindent 0pt
785\parskip \baselineskip
786\setcounter{secnumdepth}{0}
787\def\@listI{\leftmargin\leftmargini
788\topsep 0pt
789\parskip 0pt
790\partopsep 2pt plus 2pt
791\parsep 2pt plus 2pt
792\itemsep \parsep}
793
794\pagestyle{empty}  % don't want page numbers
795
796\begin{format}
797\title{l}\employer{r}\\
798\location{l}\dates{r}\\
799\body\\
800\end{format}
801
802\let\section\@@section
803
804