The public sources for my resume. These sources are auto compiled and published upon changes.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

803 lines
24 KiB

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