fortin

LaTeX resume class

Jun 6th, 2023
1,587
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 25.93 KB | Writing | 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 `resume' <26 Sep 89, Dec 07>.}
  6.  
  7. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  8. % resume.sty
  9. %
  10. % \documentstyle{resume}
  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. % 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.  
  180. \NeedsTeXFormat{LaTeX2e}[1995/12/01]
  181. \ProvidesClass{resume}[2000/05/19 v1.4b Resume class]
  182.  
  183. %\DeclareOption{11pt}{\renewcommand\@ptsize{1}}
  184. %\DeclareOption{12pt}{\renewcommand\@ptsize{2}}
  185.  
  186. \PassOptionsToClass{11pt,12pt}{article}
  187. \LoadClassWithOptions{article}
  188.  
  189. \newif\if@line
  190. \newif\if@margin
  191.  
  192. \DeclareOption{line}{\@linetrue}
  193. \DeclareOption{centered}{\@linefalse}
  194.  
  195. \DeclareOption{margin}{\@margintrue}
  196. \DeclareOption{overlapped}{\@marginfalse}
  197.  
  198. \ExecuteOptions{overlapped,centered}
  199. \ProcessOptions\relax
  200.  
  201. \nofiles         % resume's don't need .aux files
  202.  
  203.  
  204. \newtoks\tabular@text           % holds the current list being processed
  205. \newtoks\tabular@head           % holds the head tabular list
  206. \newtoks\tabular@tail           % holds the tail tabular list
  207. \newtoks\@ta                % used by \@append
  208. \newtoks\undefined@token\undefined@token={}
  209.  
  210. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  211. % prints a centered name with the address centered
  212. % or the two address on opposite sides of the page
  213. %
  214. \def\@printcentername{\begingroup
  215.   % print the name centered
  216.   \leavevmode\hbox to \textwidth{\hfil\@tablebox{\namefont\@name}\hfil}\par
  217.  \@ifundefined{@addressone}{%
  218.     % do nothing
  219.   }{%
  220.     \@ifundefined{@addresstwo}{
  221.       % only one address
  222.       \leavevmode\hbox to \textwidth{\hfil\@tablebox{\@addressone}\hfil}\par
  223.    }{
  224.       % two addresses
  225.       \leavevmode\hbox to \textwidth{\@tablebox{\@addressone}\hfil
  226.                      \@tablebox{\@addresstwo}}\par
  227.    }%
  228.   }%
  229. \endgroup}
  230.  
  231. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  232. % this is used to print the name and address at the top of
  233. % the page with a hline in between
  234. %
  235. \def\namefont{\large\bf}
  236. \def\@linename{\begingroup
  237.  \def\\{, }
  238.  {\namefont\@name}
  239.   \vskip 2pt
  240.   \fullline
  241.   \vskip 2pt
  242.   % where do you live?
  243.   \@ifundefined{@addressone}{%
  244.     % do nothing
  245.   }{%
  246.     \leavevmode\hbox to \textwidth
  247.       {\hfill\vbox{\hbox{\@addressone}
  248.            \hbox{\@addresstwo}
  249.           }%
  250.       }\par
  251.   }
  252. \endgroup}
  253.  
  254. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  255. % HEADINGS:
  256. % There are two types of headings:
  257. % 1) one with the name centered and the address centered or
  258. %    in the left and right side if there are two address
  259. % 2) one where the name is in the upper left corner
  260. %    the a line accross the paper
  261. %    then the address all on one line in the right corner
  262. %    the second address will be directly below the first if defined
  263. %
  264. \let\print@name\relax
  265. \def\ds@centered{\ifx\print@name\relax\let\print@name\@printcentername\fi}
  266. \def\ds@line{\ifx\print@name\relax\let\print@name\@linename\fi}
  267.  
  268.  
  269. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  270. % Use this to set the sectionwidth.
  271. % It adjust the width of the text as well as the hoffset
  272. % You probably shouldn't touch any of the size paramaters
  273. % unless you really understand all of this but it is not
  274. % hard.  Either way, it can only be executed once
  275. %
  276. \def\sectionfont{\bf}
  277. \newdimen\sectionwidth
  278. \newskip\sectionskip
  279. \newdimen\resumewidth
  280.  
  281. \resumewidth=6.5in
  282. \sectionskip=3.5ex plus 1ex minus -.2ex % values stolen from LaTeX
  283.  
  284. \def\newsectionwidth#1{%
  285.              \sectionwidth=#1
  286.              \textwidth=\resumewidth
  287.              \advance\textwidth-\sectionwidth
  288.              \hsize=\textwidth
  289.              \hoffset=\sectionwidth
  290. }
  291.  
  292.  
  293. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  294. % This is for sectiontitles that are entirely in the left margin.
  295. % multiline sectiontitles are permited and will be broken by
  296. % \TeX{} to fit into a box \verb|\sectionwidth| wide.  It is advised
  297. % that \verb|\\| be used to break the lines by hand as \TeX{} will
  298. % probably not do what you want.
  299. %
  300. % When using this with {\tt tabbing} and {\tt list} (or anything
  301. % that is made out of {\tt list}) put the \section's inside of
  302. % the \verb|\begin{}|  and the \verb|\item|Eg.
  303. % \begin{verbatim}
  304. % \begin{trivlist}
  305. % \item[]
  306. % \section{foo}
  307. % text
  308. % \end{trivlist}
  309. % \end{verbatim}
  310. %
  311. \def\boxed@sectiontitle#1{%
  312.   % this macro may be called in a tabular.  Special code must be written
  313.   % to accomodate this.  In LaTeX, a tabular is made out of hboxes.
  314.   % TeX never goes into horizontal mode because of this; it only
  315.   % gets into vertical mode and restricted horizontal mode.  Certain
  316.   % indenting problems must be handled because of this.  They
  317.   % are delt with at the end of this routine.
  318.   % It is also necessary to close the hbox that was created before
  319.   % the \section and create a new one when this macro has ended.
  320.   % This macro therefore simulates a \kill, so that any text before
  321.   % the \section not be printed.  The proper use is therefore
  322.   % ...
  323.   % text\\
  324.   % \section{foo}
  325.   % more text\\
  326.   % ...
  327.   \ifx\\\@tabcr    % is this in a tabular? (this *should* work but is a cludge)
  328.     \@stopfield    % the is the first part of a \kill
  329.    \else
  330.      \@@par      % This will end the previous paragraph if needed and
  331.            % go into vertical mode.  If this was already in
  332.            % vertical mode then the \par does nothing.
  333.  
  334.   \fi
  335.   \begingroup
  336.   \everypar={}%
  337.   \def\par{\@@par}%
  338.   \let\\=\@normalcr
  339.   \addpenalty{\@secpenalty} % this would be a good place for a page break
  340.                 % \@secpenalty is what LaTeX uses before its
  341.                 % section's.  It happens to be -300
  342.   \addvspace{\sectionskip}  % put in a bit of glue
  343.   % The following hbox will be contributed to the page list without going
  344.   % into horizontal mode.  Therefore, any \parindent's, \parshape's, \leftskip
  345.   % will be ignored but \hoffset's are not.  The result is that the box will
  346.   % only by \hoffset. This is what I want
  347.   \hbox to 0pt{%
  348.     \hss     % this is an llap.  In other words, this glue
  349.          % will shrink by the width of the stuff in the vbox
  350.          % (\sectionwidth) into the left margin and then
  351.          % insert the contents of the vbox.
  352.     \vtop to 0pt{% make a 0pt height paragraph, with the baseline at the
  353.          % lined up with the baseline of the first box in the list
  354.       \leftskip=0pt
  355.       \hsize=\sectionwidth
  356.       \textwidth=\sectionwidth
  357.       \raggedright     % you don't want this filled out to the right margin
  358.       \sectionfont
  359.       #1\vss           % Go into horizontal mode; do the paragraph;
  360.                % go into vertical mode; add some negative glue
  361.                % to give a box of 0pt height and depth
  362.     }%
  363.   }%
  364.   \addpenalty{-\@secpenalty} % this would be a bad place for a page break
  365.   \vskip-\baselineskip % when the next box is processed, baselineskip glue
  366.                % glue will be added (the box has no depth because of
  367.                % the \vss; therefore, we don't have to worry about
  368.                % \lineskiplimit).  This -\baselineskip glue
  369.                % is to undo this.  \nointerlineskip doesn't
  370.                % work because the baseline of this line would be lined
  371.                % up with the top of the top of the next box.  We
  372.                % want the baselines lined up.
  373.                %
  374.                % It may have been possible to do this by forcing the
  375.                % baseline of this box to be the top of the box but
  376.                % then the interline skip between this box and the
  377.                % previous box would be off as the baselines of the
  378.                % this box (the one that being made above) and the
  379.                % previous line would be separated by \baselineskip
  380.                % (probably, it may be separted by the depth of the
  381.                % previous box + \lineskip) but as the baseline of
  382.                % this box has been moved to the top, the box's would
  383.                % separted by to much glue.  The exact amount being
  384.                % the height of this box.
  385.   \endgroup
  386.   \ifx\\\@tabcr   % is this in a tabular? (this *should* work but is a cludge)
  387.     % this is the second part of the \kill; it starts the next tabbing line
  388.     % Because this routine will never get into paragraph mode when used in
  389.     % tabbing the \parskip that is discussed below will never be inserted.
  390.     % Therefore it should not be negated as done below.
  391.     \@startline
  392.     \ignorespaces
  393.   \else
  394.     \vskip-\parskip    % The next thing to be contributed will be a paragraph.
  395.                % Right before being contributed though a \vskip\parskip
  396.                % will be inserted.  This is to negate it.
  397.                %
  398.                % I do consider this to be a bit of a cludge but
  399.                % I can not find a way to write \unskipfutureskip
  400.                % or a way to make TeX think that nothing has
  401.                % been contributed to the page list.
  402.   \fi
  403. }
  404.  
  405.  
  406. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  407. % This is for sectiontitles that are entirely above the section text
  408. %
  409. \def\unboxed@sectiontitle#1{%
  410.   \ifx\\\@tabcr % see boxed@sectiontitle for explation
  411.     \@stopfield
  412.    \else
  413.      \@@par
  414.   \fi
  415.   \begingroup
  416.   \everypar={}%
  417.   \def\par{\@@par}%
  418.   \def\\{ }
  419.  \addpenalty{\@secpenalty}
  420.  \addvspace{\sectionskip}
  421.  \hbox to 0pt{\hss\hbox to \sectionwidth{\sectionfont#1\hss}}
  422.  \addpenalty{-\@secpenalty} % this would be a bad place for a page break
  423.   \endgroup
  424.   \ifx\\\@tabcr   % see boxed@sectiontitle for explation
  425.     \@startline
  426.   \else
  427.     \vskip-\parskip
  428.   \fi
  429.   \ignorespaces
  430. }
  431.  
  432. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  433. % There are two types of section headings:
  434. % 1) the section heading is all on one line and directly
  435. %    below it, is the body of the text
  436. % 2) the section heading is entirely in the left margin
  437. %    (possibly taking multiple lines) with the body of
  438. %    the text next to it
  439. %
  440. \let\@@section\relax
  441. \def\ds@overlapped{\ifx\@@section\relax\newsectionwidth{0.5in}\let\@@section\unboxed@sectiontitle\fi}
  442. %\def\ds@margin{\ifx\@@section\relax\newsectionwidth{1.3in}\let\@@section\boxed@sectiontitle\fi}
  443. \def\ds@margin{\ifx\@@section\relax\newsectionwidth{1.1in}\let\@@section\boxed@sectiontitle\fi}
  444.  
  445. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  446. % DEFAULTS: (some of them)
  447. %
  448. % centered name
  449. % overlapped section titles
  450. %
  451. % format is:
  452. %    title   employer
  453. %    location    dates
  454. %    body
  455. % with everything in the left of its column
  456.  
  457. %\input article.sty
  458.  
  459. \if@line\ds@line\else\ds@centered\fi
  460. \if@margin\ds@margin\else\ds@overlapped\fi
  461.  
  462.  
  463. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  464. % typeset resume all nice and pretty
  465. %
  466. \def\Resume{{R\'{e}sum\'{e}}}
  467.  
  468. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  469. % makes a line of width \textwidth starting at -\hoffset
  470. %
  471. \def\fullline{      % hrules only listen to \hoffset
  472.   \nointerlineskip  % so I have this code    
  473.   \moveleft\hoffset\vbox{\hrule width\textwidth}
  474.  \nointerlineskip
  475. }
  476.  
  477. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  478. % create a multiline box.
  479. %
  480. \def\@tablebox#1{\begin{tabular}[t]{@{}l@{\extracolsep{\fill}}}#1\end{tabular}}
  481.  
  482. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  483. % use this to define your name
  484. %
  485. \def\name#1{\def\@name{#1}}
  486.  
  487. \def\@name{}
  488.  
  489. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  490. % use this to define your address, this may be called more than once.
  491. %
  492. \let\@addressone\relax
  493. \let\@addresstwo\relax
  494.  
  495. \def\address#1{
  496.  \@ifundefined{@addressone}{\def\@addressone{#1}}{\def\@addresstwo{#1}}}
  497.  
  498. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  499. % if you want to print your name and address is a slightly
  500. % different format than sugessted, then this can be used
  501. % to place it exactly where you want
  502. %
  503. \def\opening{\def\@opening{}
  504.   \begingroup
  505.   \leftskip=-\hoffset        % I use leftskip to move things to the left as
  506.   \advance\textwidth\hoffset % changing hoffset doesn't work. But this
  507.   \hsize=\textwidth      % doesn't really work as hboxes are rules
  508.                  % are unaffeted
  509.   \let\par=\@@par
  510.   \parindent=0pt
  511.   \parskip=0pt
  512.   \print@name
  513.   \endgroup
  514. }
  515.  
  516. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  517. % all of the resume goes in the resume environment
  518. %
  519. \newenvironment{resume}{\begingroup
  520.                \@ifundefined{@opening}{\opening}{}
  521. }{\endgroup}
  522.  
  523. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  524. % gives you a tabular environment with n equally spaced columns
  525. % \begin{ncolumn}{#} ... \end{ncolumn}
  526. %
  527. % The p option of LaTeX is broken in all but the newest verion
  528. % of latex.tex, this is how to fix it
  529. %
  530. \def\@endpbox{\par\egroup\hfil}
  531. \let\@@endpbox=\@endpbox
  532.  
  533. \newdimen\@columnwidth    % the width of each column equal to
  534. \def\ncolumn#1{%
  535.   % \@columnwidth = \textwidth / #1
  536.   \@columnwidth=\textwidth \divide\@columnwidth by #1
  537.   \begin{tabular*}{\textwidth}[t]%
  538.     {*{#1}{@{}p{\@columnwidth}@{\extracolsep{\fill}}}}
  539. }
  540.  
  541. \def\endncolumn{\end{tabular*}}
  542.  
  543.  
  544. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  545. %   \employer{text} defines employer to be text
  546. %   \location{text} defines location to be text
  547. %   \dates{text}    defines dates    to be text
  548. %   \title{text}    defines title    to be text
  549. %   \body
  550. %
  551.  
  552. \def\employer#1{\def\@employer{\print@employer{#1}}}
  553. \def\location#1{\def\@location{\print@location{#1}}}
  554. \def\dates#1{\def\@dates{\print@dates{#1}}}
  555. \def\title#1{\def\@title{\print@title{#1}}}
  556.  
  557. \let\l@justify\raggedright
  558. \let\r@justify\raggedleft
  559. \let\c@justify\centering
  560.  
  561.  
  562. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  563. % \@format{name}{justify}
  564. % will define \print@#1 to print it's one argument
  565. % justified according to #2 which can be
  566. %     l = left
  567. %     r = right
  568. %     c = center
  569. %
  570. % eg.
  571. %    \@format{employer}{c}
  572. %    is the same as \def\print@employer#1{{\centering #1\par}}
  573. %
  574. \def\@format#1#2{%
  575.   \expandafter\gdef\csname print@#1\endcsname##1{%
  576.     {\csname#2@justify\endcsname##1\par}}
  577. }
  578.  
  579. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  580. % this is used to define how the position environment should
  581. % formated.
  582. %
  583. % \begin{format} positioning text \end{format}
  584. % where positioning text may be
  585. %  \employer{pos}
  586. %  \location{pos}
  587. %  \dates{pos}
  588. %  \title{pos}
  589. %  \body        (for the body of the position environment)
  590. %   where pos is
  591. %     l for left
  592. %     r for right
  593. %     c for center
  594. % use \\ to break the line
  595. % you don't have to use all of the options.
  596. % on any one line, you should indicate what you want on that line
  597. % and where it should go within its column.
  598. % eg.
  599. % the following prints the employer in the left with the location
  600. % centered within that its column.  It then prints the date on the
  601. % right.  Then it prints the body of the position environment. Then
  602. % it prints the title centered within its column; as there is only
  603. % one column here it is really just centered.
  604. %
  605. % \begin{format}
  606. % \employer{l}\location{c}\\
  607. % \dates{r}\\
  608. % \body\\
  609. % \title{c}\\
  610. % \end{format}
  611.  
  612. \newcounter{numberofcolumns}
  613. \newenvironment{format}{%
  614.   \def\end@line@head{\append@tabular@head{tabular@text}\tabular@text={}%
  615.     \c@numberofcolumns 0}
  616.   \def\end@line@tail{\append@tabular@tail{tabular@text}\tabular@text={}%
  617.     \c@numberofcolumns 0}
  618.   \tabular@text={}
  619.  \tabular@head={}
  620.  \tabular@tail={}
  621.  \c@numberofcolumns 0
  622.  \let\\=\end@line@head
  623.  \def\employer##1{\advance\c@numberofcolumns 1
  624.            \@format{employer}{##1}
  625.            \append@tabular@text{employer}}
  626.  \def\location##1{\advance\c@numberofcolumns 1
  627.            \@format{location}{##1}
  628.            \append@tabular@text{location}}
  629.  \def\dates##1{\advance\c@numberofcolumns 1
  630.         \@format{dates}{##1}
  631.         \append@tabular@text{dates}}
  632.  \def\title##1{\advance\c@numberofcolumns 1
  633.          \@format{title}{##1}
  634.         \append@tabular@text{title}}
  635.  \def\body{\iftoks\tabular@head\undefined@token\then
  636.         \else
  637.           \@append{\noexpand\\}\to\tabular@head
  638.         \skotfi
  639.         \let\\=\end@line@tail}}{}
  640.  
  641. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  642. %taken from page 378 of TeXbook but freely hacked
  643. %
  644. % appends the expansion of #1 to the token list #2
  645.  
  646. \def\@append#1\to#2{%
  647.   \@ta=\expandafter{#1}%
  648.   \xdef\@append@temp{\the#2\the\@ta}
  649.  \global#2=\expandafter{\@append@temp}%
  650. }
  651.  
  652.  
  653. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  654. % texhax.88.078
  655. % is used to see if two token lists are equal
  656. % there must be a better way
  657. %
  658.  
  659. \let \then = \empty
  660. \def \iftoks #1#2\then #3\else #4\skotfi{
  661.         \edef \1{\the #1}
  662.         \edef \2{\the #2}
  663.         \ifx \1\2\then #3\else #4\fi}
  664.  
  665.  
  666. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  667. % \append@tabular@text{command}
  668. %
  669. % appends command to the end of \tabular@text.
  670. % NOTE: command MUST be a command but without the \
  671. %   Eg. \append@tabular@text{relax}
  672. %
  673. % used to define \tabular@text for the tabular environment
  674. % used by append@tabular@head and append@tabular@tail
  675. %
  676.  
  677. \def\append@tabular@text#1{%
  678. \iftoks\tabular@text\undefined@token\then
  679.   \global\tabular@text=\expandafter{\csname @#1\endcsname}
  680. \else
  681.  \@append{&}\to\tabular@text
  682.  \@append{\csname @#1\endcsname}\to\tabular@text
  683. \skotfi
  684. }
  685.  
  686. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  687. % append@tabular@head
  688. %
  689. % appends command to the end of \tabular@text@head
  690. % NOTE: command MUST be a command but without the \
  691. %   Eg. \append@tabular@head{relax}
  692. %
  693. % used to define \tabular@head for the tabular environment
  694. % used by the position environment
  695. %
  696. \def\append@tabular@head#1{%
  697.   \ifnum\the\c@numberofcolumns=0\relax
  698.   \else
  699.     \iftoks\tabular@head\undefined@token\then
  700.       \relax
  701.     \else
  702.       \@append{\noexpand\\}\to\tabular@head
  703.      \@append{\noexpand\penalty-\@secpenalty}\to\tabular@head
  704.    \skotfi
  705.    \@append{\noexpand\begin{ncolumn}}\to\tabular@head
  706.    \@append{\expandafter{\the\c@numberofcolumns}}\to\tabular@head
  707.    \@append{\the\csname#1\endcsname}\to\tabular@head
  708.    \@append{\noexpand\end{ncolumn}}\to\tabular@head
  709.  \fi
  710. }
  711.  
  712. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  713. % append@tabular@tail
  714. %
  715. % appends command to the end of \tabular@text@htail
  716. % NOTE: command MUST be a command but without the \
  717. %   Eg. \append@tabular@tail{relax}
  718. %
  719. % used to define \tabular@tail for the tabular environment
  720. % used by the position environment
  721. %
  722. \def\append@tabular@tail#1{%
  723.   \ifnum\the\c@numberofcolumns=0\relax
  724.   \else
  725.     \iftoks\tabular@tail\undefined@token\then
  726.     \else
  727.       \@append{\noexpand\\}\to\tabular@tail
  728.      \@append{\noexpand\penalty-\@secpenalty}\to\tabular@tail
  729.    \skotfi
  730.    \@append{\noexpand\begin{ncolumn}}\to\tabular@tail
  731.    \@append{\expandafter{\the\c@numberofcolumns}}\to\tabular@tail
  732.    \@append{\the\csname#1\endcsname}\to\tabular@tail
  733.    \@append{\noexpand\end{ncolumn}}\to\tabular@tail
  734.  \fi
  735. }
  736.  
  737. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  738. % put the actual job descriptions here
  739. % \begin{postion} ... \end{position}
  740. % in the ... describe the position.
  741. % don't put the \dates \location etc in here. define them before hand
  742. \newenvironment{position}%
  743.   {%
  744.    \begingroup
  745.      \par
  746.        \the\tabular@head
  747. %     \addpenalty{-\@secpenalty}% bad place for a page break
  748.      \penalty -\@secpenalty % bad place for a page break
  749.      \penalty 10000
  750.      \ignorespaces
  751.   }{%
  752.        \the\tabular@tail
  753. %     \addpenalty{\@secpenalty}% good place for a page break
  754.      \penalty \@secpenalty % good place for a page break
  755.     \endgroup
  756. }
  757.  
  758. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  759. % DEFAULTS: (the rest of them)
  760. %
  761. % centered name
  762. % overlapped section titles
  763. %
  764. % format is:
  765. %    title   employer
  766. %    location    dates
  767. %    body
  768. % with everything in the left of its column
  769.  
  770. \@secpenalty = -500
  771. \topmargin 0pt
  772. \headheight 0pt
  773. \headsep 0pt
  774. \textheight 9in
  775. \parindent 0pt
  776. \topmargin 0in
  777. \oddsidemargin 0pt
  778. \evensidemargin 0pt
  779. \marginparwidth 0pt
  780. \parindent 0pt
  781. \parskip \baselineskip
  782. \setcounter{secnumdepth}{0}
  783. \def\@listI{\leftmargin\leftmargini
  784. \topsep 0pt
  785. \parskip 0pt
  786. \partopsep 10pt plus 2pt
  787. \parsep 2pt plus 2pt
  788. \itemsep \parsep}
  789.  
  790. \pagestyle{empty}  % don't want page numbers
  791.  
  792. \begin{format}
  793. \title{l}\employer{r}\\
  794. \location{l}\dates{r}\\
  795. \body\\
  796. \end{format}
  797.  
  798. \let\section\@@section
  799.  
  800. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  801.  
  802. % @brief    LaTeX2e Resume Style Config
  803. % @url      http://linux.dsplabs.com.au/?p=54
  804. % @date     Decemebr 2007
  805. % @author   Kamil K Wojcicki
  806. % @info     This a fusion of resume template code by Chris Paciorek
  807. %           (url: http://www.biostat.harvard.edu/~paciorek/computingTips/Latex_template_creating_CV_.html)
  808. %           and res.cls class by Michael DeCorte.
  809. %           I have merged these for educational purposes only.
  810.  
  811. \oddsidemargin -11mm
  812. \evensidemargin -11mm
  813. %\textwidth=150mm
  814. \textwidth=154mm
  815. \itemsep=0cm
  816. \parsep=0cm
  817. \topmargin -12mm
  818. %\textheight 265mm
  819. \textheight 275mm
  820.  
  821. \newenvironment{list1}{
  822.  \begin{list}{\ding{113}}{%
  823.       \setlength{\itemsep}{0in}
  824.      \setlength{\parsep}{0in} \setlength{\parskip}{0in}
  825.      \setlength{\topsep}{0in} \setlength{\partopsep}{0in}
  826.      \setlength{\leftmargin}{0in}}}{\end{list}}
  827.  
  828. \newenvironment{list2}{
  829.  \begin{list}{$\bullet$}{%
  830.       \setlength{\itemsep}{0in}
  831.      \setlength{\parsep}{0in} \setlength{\parskip}{0in}
  832.      \setlength{\topsep}{0in} \setlength{\partopsep}{0in}
  833.      \setlength{\leftmargin}{0.25in}}}{\end{list}}
  834.  
  835. %\newcommand{\mysidestyle}{\footnotesize\sc}
  836. \newcommand{\mysidestyle}{\small\sc}
  837. \newcommand{\myheadingstyle}{\sl}
  838. \newcommand{\mysubheadingstyle}{\sl}
  839.  
  840. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  841.  
  842.  
Advertisement
Add Comment
Please, Sign In to add comment