Advertisement
Guest User

Resume

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