Guest User

Resume

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