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.

805 lines
25 KiB

9 years ago
9 years ago
7 years ago
7 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. \resumewidth=6.75in
  268. \sectionskip=3.0ex plus 1ex minus -.2ex % values stolen from LaTeX
  269. \def\newsectionwidth#1{%
  270. \sectionwidth=#1
  271. \textwidth=\resumewidth
  272. \advance\textwidth-\sectionwidth
  273. \hsize=\textwidth
  274. \hoffset=\sectionwidth
  275. }
  276. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  277. % This is for sectiontitles that are entirely in the left margin.
  278. % multiline sectiontitles are permited and will be broken by
  279. % \TeX{} to fit into a box \verb|\sectionwidth| wide. It is advised
  280. % that \verb|\\| be used to break the lines by hand as \TeX{} will
  281. % probably not do what you want.
  282. %
  283. % When using this with {\tt tabbing} and {\tt list} (or anything
  284. % that is made out of {\tt list}) put the \section's inside of
  285. % the \verb|\begin{}| and the \verb|\item|Eg.
  286. % \begin{verbatim}
  287. % \begin{trivlist}
  288. % \item[]
  289. % \section{foo}
  290. % text
  291. % \end{trivlist}
  292. % \end{verbatim}
  293. %
  294. \def\boxed@sectiontitle#1{%
  295. % this macro may be called in a tabular. Special code must be written
  296. % to accomodate this. In LaTeX, a tabular is made out of hboxes.
  297. % TeX never goes into horizontal mode because of this; it only
  298. % gets into vertical mode and restricted horizontal mode. Certain
  299. % indenting problems must be handled because of this. They
  300. % are delt with at the end of this routine.
  301. % It is also necessary to close the hbox that was created before
  302. % the \section and create a new one when this macro has ended.
  303. % This macro therefore simulates a \kill, so that any text before
  304. % the \section not be printed. The proper use is therefore
  305. % ...
  306. % text\\
  307. % \section{foo}
  308. % more text\\
  309. % ...
  310. \ifx\\\@tabcr % is this in a tabular? (this *should* work but is a cludge)
  311. \@stopfield % the is the first part of a \kill
  312. \else
  313. \@@par % This will end the previous paragraph if needed and
  314. % go into vertical mode. If this was already in
  315. % vertical mode then the \par does nothing.
  316. \fi
  317. \begingroup
  318. \everypar={}%
  319. \def\par{\@@par}%
  320. \let\\=\@normalcr
  321. \addpenalty{\@secpenalty} % this would be a good place for a page break
  322. % \@secpenalty is what LaTeX uses before its
  323. % section's. It happens to be -300
  324. \addvspace{\sectionskip} % put in a bit of glue
  325. % The following hbox will be contributed to the page list without going
  326. % into horizontal mode. Therefore, any \parindent's, \parshape's, \leftskip
  327. % will be ignored but \hoffset's are not. The result is that the box will
  328. % only by \hoffset. This is what I want
  329. \hbox to 0pt{%
  330. \hss % this is an llap. In other words, this glue
  331. % will shrink by the width of the stuff in the vbox
  332. % (\sectionwidth) into the left margin and then
  333. % insert the contents of the vbox.
  334. \vtop to 0pt{% make a 0pt height paragraph, with the baseline at the
  335. % lined up with the baseline of the first box in the list
  336. \leftskip=0pt
  337. \hsize=\sectionwidth
  338. \textwidth=\sectionwidth
  339. \raggedright % you don't want this filled out to the right margin
  340. \sectionfont
  341. #1\vss % Go into horizontal mode; do the paragraph;
  342. % go into vertical mode; add some negative glue
  343. % to give a box of 0pt height and depth
  344. }%
  345. }%
  346. \addpenalty{-\@secpenalty} % this would be a bad place for a page break
  347. \vskip-\baselineskip % when the next box is processed, baselineskip glue
  348. % glue will be added (the box has no depth because of
  349. % the \vss; therefore, we don't have to worry about
  350. % \lineskiplimit). This -\baselineskip glue
  351. % is to undo this. \nointerlineskip doesn't
  352. % work because the baseline of this line would be lined
  353. % up with the top of the top of the next box. We
  354. % want the baselines lined up.
  355. %
  356. % It may have been possible to do this by forcing the
  357. % baseline of this box to be the top of the box but
  358. % then the interline skip between this box and the
  359. % previous box would be off as the baselines of the
  360. % this box (the one that being made above) and the
  361. % previous line would be separated by \baselineskip
  362. % (probably, it may be separted by the depth of the
  363. % previous box + \lineskip) but as the baseline of
  364. % this box has been moved to the top, the box's would
  365. % separted by to much glue. The exact amount being
  366. % the height of this box.
  367. \endgroup
  368. \ifx\\\@tabcr % is this in a tabular? (this *should* work but is a cludge)
  369. % this is the second part of the \kill; it starts the next tabbing line
  370. % Because this routine will never get into paragraph mode when used in
  371. % tabbing the \parskip that is discussed below will never be inserted.
  372. % Therefore it should not be negated as done below.
  373. \@startline
  374. \ignorespaces
  375. \else
  376. \vskip-\parskip % The next thing to be contributed will be a paragraph.
  377. % Right before being contributed though a \vskip\parskip
  378. % will be inserted. This is to negate it.
  379. %
  380. % I do consider this to be a bit of a cludge but
  381. % I can not find a way to write \unskipfutureskip
  382. % or a way to make TeX think that nothing has
  383. % been contributed to the page list.
  384. \fi
  385. }
  386. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  387. % This is for sectiontitles that are entirely above the section text
  388. %
  389. \def\unboxed@sectiontitle#1{%
  390. \ifx\\\@tabcr % see boxed@sectiontitle for explation
  391. \@stopfield
  392. \else
  393. \@@par
  394. \fi
  395. \begingroup
  396. \everypar={}%
  397. \def\par{\@@par}%
  398. \def\\{ }
  399. \addpenalty{\@secpenalty}
  400. \addvspace{\sectionskip}
  401. \hbox to 0pt{\hss\hbox to \sectionwidth{\sectionfont#1\hss}}
  402. \addpenalty{-\@secpenalty} % this would be a bad place for a page break
  403. \endgroup
  404. \ifx\\\@tabcr % see boxed@sectiontitle for explation
  405. \@startline
  406. \else
  407. \vskip-\parskip
  408. \fi
  409. \ignorespaces
  410. }
  411. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  412. % There are two types of section headings:
  413. % 1) the section heading is all on one line and directly
  414. % below it, is the body of the text
  415. % 2) the section heading is entirely in the left margin
  416. % (possibly taking multiple lines) with the body of
  417. % the text next to it
  418. %
  419. \let\@@section\relax
  420. \def\ds@overlapped{\ifx\@@section\relax\newsectionwidth{0.5in}\let
  421. \@@section\unboxed@sectiontitle\fi}
  422. \def\ds@margin{\ifx\@@section\relax\newsectionwidth{1.3in}\let
  423. \@@section\boxed@sectiontitle\fi}
  424. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  425. % DEFAULTS: (some of them)
  426. %
  427. % centered name
  428. % overlapped section titles
  429. %
  430. % format is:
  431. % title employer
  432. % location dates
  433. % body
  434. % with everything in the left of its column
  435. %\input article.sty
  436. \if@line\ds@line\else\ds@centered\fi
  437. \if@margin\ds@margin\else\ds@overlapped\fi
  438. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  439. % typeset resume all nice and pretty
  440. %
  441. \def\Resume{{R\'{e}sum\'{e}}}
  442. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  443. % makes a line of width \textwidth starting at -\hoffset
  444. %
  445. \def\fullline{ % hrules only listen to \hoffset
  446. \nointerlineskip % so I have this code
  447. \moveleft\hoffset\vbox{\hrule width\textwidth}
  448. \nointerlineskip
  449. }
  450. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  451. % create a multiline box.
  452. %
  453. \def\@tablebox#1{\begin{tabular}[t]{@{}l@{\extracolsep{\fill}}}#1\end{tabular}}
  454. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  455. % use this to define your name
  456. %
  457. \def\name#1{\def\@name{#1}}
  458. \def\@name{}
  459. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  460. % use this to define your address, this may be called more than once.
  461. %
  462. \let\@addressone\relax
  463. \let\@addresstwo\relax
  464. \def\address#1{
  465. \@ifundefined{@addressone}{\def\@addressone{#1}}{\def\@addresstwo{#1}}}
  466. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  467. % if you want to print your name and address is a slightly
  468. % different format than sugessted, then this can be used
  469. % to place it exactly where you want
  470. %
  471. \def\opening{\def\@opening{}
  472. \begingroup
  473. \leftskip=-\hoffset % I use leftskip to move things to the left as
  474. \advance\textwidth\hoffset % changing hoffset doesn't work. But this
  475. \hsize=\textwidth % doesn't really work as hboxes are rules
  476. % are unaffeted
  477. \let\par=\@@par
  478. \parindent=0pt
  479. \parskip=0pt
  480. \print@name
  481. \endgroup
  482. }
  483. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  484. % all of the resume goes in the resume environment
  485. %
  486. \newenvironment{resume}{\begingroup
  487. \@ifundefined{@opening}{\opening}{}
  488. }{\endgroup}
  489. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  490. % gives you a tabular environment with n equally spaced columns
  491. % \begin{ncolumn}{#} ... \end{ncolumn}
  492. %
  493. % The p option of LaTeX is broken in all but the newest verion
  494. % of latex.tex, this is how to fix it
  495. %
  496. \def\@endpbox{\par\egroup\hfil}
  497. \let\@@endpbox=\@endpbox
  498. \newdimen\@columnwidth % the width of each column equal to
  499. \def\ncolumn#1{%
  500. % \@columnwidth = \textwidth / #1
  501. \@columnwidth=\textwidth \divide\@columnwidth by #1
  502. \begin{tabular*}{\textwidth}[t]%
  503. {*{#1}{@{}p{\@columnwidth}@{\extracolsep{\fill}}}}
  504. }
  505. \def\endncolumn{\end{tabular*}}
  506. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  507. % \employer{text} defines employer to be text
  508. % \location{text} defines location to be text
  509. % \dates{text} defines dates to be text
  510. % \title{text} defines title to be text
  511. % \body
  512. %
  513. \def\employer#1{\def\@employer{\print@employer{#1}}}
  514. \def\location#1{\def\@location{\print@location{#1}}}
  515. \def\dates#1{\def\@dates{\print@dates{#1}}}
  516. \def\title#1{\def\@title{\print@title{#1}}}
  517. \let\l@justify\raggedright
  518. \let\r@justify\raggedleft
  519. \let\c@justify\centering
  520. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  521. % \@format{name}{justify}
  522. % will define \print@#1 to print it's one argument
  523. % justified according to #2 which can be
  524. % l = left
  525. % r = right
  526. % c = center
  527. %
  528. % eg.
  529. % \@format{employer}{c}
  530. % is the same as \def\print@employer#1{{\centering #1\par}}
  531. %
  532. \def\@format#1#2{%
  533. \expandafter\gdef\csname print@#1\endcsname##1{%
  534. {\csname#2@justify\endcsname##1\par}}
  535. }
  536. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  537. % this is used to define how the position environment should
  538. % formated.
  539. %
  540. % \begin{format} positioning text \end{format}
  541. % where positioning text may be
  542. % \employer{pos}
  543. % \location{pos}
  544. % \dates{pos}
  545. % \title{pos}
  546. % \body (for the body of the position environment)
  547. % where pos is
  548. % l for left
  549. % r for right
  550. % c for center
  551. % use \\ to break the line
  552. % you don't have to use all of the options.
  553. % on any one line, you should indicate what you want on that line
  554. % and where it should go within its column.
  555. % eg.
  556. % the following prints the employer in the left with the location
  557. % centered within that its column. It then prints the date on the
  558. % right. Then it prints the body of the position environment. Then
  559. % it prints the title centered within its column; as there is only
  560. % one column here it is really just centered.
  561. %
  562. % \begin{format}
  563. % \employer{l}\location{c}\\
  564. % \dates{r}\\
  565. % \body\\
  566. % \title{c}\\
  567. % \end{format}
  568. \newcounter{numberofcolumns}
  569. \newenvironment{format}{%
  570. \def\end@line@head{\append@tabular@head{tabular@text}\tabular@text={}%
  571. \c@numberofcolumns 0}
  572. \def\end@line@tail{\append@tabular@tail{tabular@text}\tabular@text={}%
  573. \c@numberofcolumns 0}
  574. \tabular@text={}
  575. \tabular@head={}
  576. \tabular@tail={}
  577. \c@numberofcolumns 0
  578. \let\\=\end@line@head
  579. \def\employer##1{\advance\c@numberofcolumns 1
  580. \@format{employer}{##1}
  581. \append@tabular@text{employer}}
  582. \def\location##1{\advance\c@numberofcolumns 1
  583. \@format{location}{##1}
  584. \append@tabular@text{location}}
  585. \def\dates##1{\advance\c@numberofcolumns 1
  586. \@format{dates}{##1}
  587. \append@tabular@text{dates}}
  588. \def\title##1{\advance\c@numberofcolumns 1
  589. \@format{title}{##1}
  590. \append@tabular@text{title}}
  591. \def\body{\iftoks\tabular@head\undefined@token\then
  592. \else
  593. \@append{\noexpand\\}\to\tabular@head
  594. \skotfi
  595. \let\\=\end@line@tail}}{}
  596. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  597. %taken from page 378 of TeXbook but freely hacked
  598. %
  599. % appends the expansion of #1 to the token list #2
  600. \def\@append#1\to#2{%
  601. \@ta=\expandafter{#1}%
  602. \xdef\@append@temp{\the#2\the\@ta}
  603. \global#2=\expandafter{\@append@temp}%
  604. }
  605. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  606. % CHAA006%vaxb.rhbnc.ac.uk@NSS.Cs.Ucl.AC.UK
  607. % texhax.88.078
  608. % is used to see if two token lists are equal
  609. % there must be a better way
  610. %
  611. \let \then = \empty
  612. \def \iftoks #1#2\then #3\else #4\skotfi{
  613. \edef \1{\the #1}
  614. \edef \2{\the #2}
  615. \ifx \1\2\then #3\else #4\fi}
  616. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  617. % \append@tabular@text{command}
  618. %
  619. % appends command to the end of \tabular@text.
  620. % NOTE: command MUST be a command but without the \
  621. % Eg. \append@tabular@text{relax}
  622. %
  623. % used to define \tabular@text for the tabular environment
  624. % used by append@tabular@head and append@tabular@tail
  625. %
  626. \def\append@tabular@text#1{%
  627. \iftoks\tabular@text\undefined@token\then
  628. \global\tabular@text=\expandafter{\csname @#1\endcsname}
  629. \else
  630. \@append{&}\to\tabular@text
  631. \@append{\csname @#1\endcsname}\to\tabular@text
  632. \skotfi
  633. }
  634. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  635. % append@tabular@head
  636. %
  637. % appends command to the end of \tabular@text@head
  638. % NOTE: command MUST be a command but without the \
  639. % Eg. \append@tabular@head{relax}
  640. %
  641. % used to define \tabular@head for the tabular environment
  642. % used by the position environment
  643. %
  644. \def\append@tabular@head#1{%
  645. \ifnum\the\c@numberofcolumns=0\relax
  646. \else
  647. \iftoks\tabular@head\undefined@token\then
  648. \relax
  649. \else
  650. \@append{\noexpand\\}\to\tabular@head
  651. \@append{\noexpand\penalty-\@secpenalty}\to\tabular@head
  652. \skotfi
  653. \@append{\noexpand\begin{ncolumn}}\to\tabular@head
  654. \@append{\expandafter{\the\c@numberofcolumns}}\to\tabular@head
  655. \@append{\the\csname#1\endcsname}\to\tabular@head
  656. \@append{\noexpand\end{ncolumn}}\to\tabular@head
  657. \fi
  658. }
  659. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  660. % append@tabular@tail
  661. %
  662. % appends command to the end of \tabular@text@htail
  663. % NOTE: command MUST be a command but without the \
  664. % Eg. \append@tabular@tail{relax}
  665. %
  666. % used to define \tabular@tail for the tabular environment
  667. % used by the position environment
  668. %
  669. \def\append@tabular@tail#1{%
  670. \ifnum\the\c@numberofcolumns=0\relax
  671. \else
  672. \iftoks\tabular@tail\undefined@token\then
  673. \else
  674. \@append{\noexpand\\}\to\tabular@tail
  675. \@append{\noexpand\penalty-\@secpenalty}\to\tabular@tail
  676. \skotfi
  677. \@append{\noexpand\begin{ncolumn}}\to\tabular@tail
  678. \@append{\expandafter{\the\c@numberofcolumns}}\to\tabular@tail
  679. \@append{\the\csname#1\endcsname}\to\tabular@tail
  680. \@append{\noexpand\end{ncolumn}}\to\tabular@tail
  681. \fi
  682. }
  683. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  684. % put the actual job descriptions here
  685. % \begin{postion} ... \end{position}
  686. % in the ... describe the position.
  687. % don't put the \dates \location etc in here. define them before hand
  688. \newenvironment{position}%
  689. {%
  690. \begingroup
  691. \par
  692. \the\tabular@head
  693. % \addpenalty{-\@secpenalty}% bad place for a page break
  694. \penalty -\@secpenalty % bad place for a page break
  695. \penalty 10000
  696. \ignorespaces
  697. }{%
  698. \the\tabular@tail
  699. % \addpenalty{\@secpenalty}% good place for a page break
  700. \penalty \@secpenalty % good place for a page break
  701. \endgroup
  702. }
  703. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  704. % DEFAULTS: (the rest of them)
  705. %
  706. % centered name
  707. % overlapped section titles
  708. %
  709. % format is:
  710. % title employer
  711. % location dates
  712. % body
  713. % with everything in the left of its column
  714. \@secpenalty = -500
  715. \topmargin 0pt
  716. \headheight 12pt
  717. \headsep 0pt
  718. \textheight 9in
  719. \parindent 0pt
  720. \topmargin 0in
  721. \oddsidemargin -10pt
  722. \evensidemargin -10pt
  723. \marginparwidth -10pt
  724. \parindent 0pt
  725. \parskip \baselineskip
  726. \setcounter{secnumdepth}{0}
  727. \def\@listI{\leftmargin\leftmargini
  728. \topsep 0pt
  729. \parskip 0pt
  730. \partopsep 2pt plus 2pt
  731. \parsep 2pt plus 2pt
  732. \itemsep \parsep}
  733. \pagestyle{empty} % don't want page numbers
  734. \begin{format}
  735. \title{l}\employer{r}\\
  736. \location{l}\dates{r}\\
  737. \body\\
  738. \end{format}
  739. \let\section\@@section