home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / games / zmach101.lha / doc / jeep.sty next >
Encoding:
Text File  |  1992-05-21  |  11.0 KB  |  325 lines

  1. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2.  
  3. % jeep.sty, February  3, 1989
  4. % G. W. Stewart
  5. % Department of Computer Science
  6. % University of Maryland
  7. % College Park, MD 20784
  8. %
  9. % stewart@thales.umd.edu
  10.  
  11. % This is a personal customization of the LaTeX style files
  12. % article (4/16/88) and report (5/26/88).  The changes are
  13. % described more fully in the document jeep.tex.  Briefly
  14. % the style
  15. %
  16. %    1. Changes the default page sizes to reflect the fact
  17. %       that most output will be on 8.5 x 11 inch paper.
  18. %
  19. %    2. Adds commands that allow the casual LaTeX to change
  20. %       the formats of chapter, section, and theorem heads.
  21. %
  22. %    3. Adds commands to number equations and theorems within
  23. %       sections or subsections.
  24. %
  25. %    4. Makes Lance Berc's three part headers and footers the
  26. %       default page style.  Adds a macro to underline the
  27. %       header.
  28. %
  29. %    5. Changes the default numbering of enumerate to arabic.
  30. %       Adds a new enumeration environment in which the items
  31. %       are close together.
  32. %
  33. %    6. Adds a command to produce a compact table of contents.
  34. %
  35. %    7. Adds commands to produce symbolic footnote marks and
  36. %       equation labels.
  37.  
  38.  
  39. % Change the default page sizes.
  40.  
  41. \setlength{\topmargin}{.25in}
  42. \setlength{\textheight}{7.5in}
  43. \setlength{\oddsidemargin}{.375in}
  44. \setlength{\evensidemargin}{.375in}
  45. \setlength{\textwidth}{5.75in}
  46.  
  47. % Define the command \mychapter{<head1>}{<head2>}.  <head1>
  48. % is the text to put in the chapter head if there is a
  49. % chapter number; <head2>, if not.
  50.  
  51. \def\@chapapp{Chapter}
  52. \def\chapapp{\@chapapp}
  53.  
  54. \def\mychapter#1#2{
  55.    \def\@chaphead##1{#1}
  56.    \def\@schaphead##1{#2}
  57. }
  58.  
  59. \def\@makechapterhead#1{ \vspace*{\chaptopsep} { \parindent 0pt \raggedright
  60.  \ifnum \c@secnumdepth >\m@ne \@chaphead{#1} \else \@schaphead{#1} \fi
  61.  \par \nobreak \vskip \chapaftersep } }
  62.  
  63. \def\@makeschapterhead#1{ \vspace*{\chaptopsep} { \parindent 0pt \raggedright
  64.  \@schaphead{#1}\par
  65.  \nobreak \vskip \chapaftersep } }
  66.  
  67. % \chaptopsep is the space between the top of the text page and the
  68. % chapter head.  \chapaftersep is the space between the chapter
  69. % head and the text.
  70.  
  71. \newlength{\chaptopsep}
  72. \setlength{\chaptopsep}{.5in}
  73. \newlength{\chapaftersep}
  74. \setlength{\chapaftersep}{.5in}
  75.  
  76. % Default chapter headings.
  77.  
  78. \mychapter{\LARGE \sc \thechapter. #1}{\LARGE \sc #1}
  79.  
  80.  
  81. % Define the command \mysection{<sec>}{<style>}{<prefix>}.
  82. % <sec> is the section level--section, subsection, etc.  <style>
  83. % is the style in which the section head is to be set; e.g.,
  84. % \large\bf.  <prefix> is what proceeds the head text, usually
  85. % \the<sec> followed by some putctuation.
  86.  
  87.  
  88. \def\@startsection#1#2#3#4#5#6{\if@noskipsec \leavevmode \fi
  89.    \par \@tempskipa #4\relax
  90.    \@afterindenttrue
  91.    \ifdim \@tempskipa <\z@ \@tempskipa -\@tempskipa \@afterindentfalse\fi
  92.    \if@nobreak \everypar{}\else
  93.      \addpenalty{\@secpenalty}\addvspace{\@tempskipa}\fi \@ifstar
  94.      {\@ssect{#3}{#4}{#5}{#1}}{\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}}
  95.  
  96.  
  97. \def\@sect#1#2#3#4#5#6[#7]#8{\ifnum #2>\c@secnumdepth
  98.      \def\@svsec{}\else 
  99.      \refstepcounter{#1}
  100.      \edef\@svsec{\expandafter\relax\csname @pre#1\endcsname}\fi
  101.      \@tempskipa #5\relax
  102.       \ifdim \@tempskipa>\z@ 
  103.         \begingroup \expandafter\relax\csname @#1style\endcsname\relax
  104.           \@hangfrom{\hskip #3\relax\@svsec}{\interlinepenalty \@M #8\par}
  105.         \endgroup
  106.        \csname #1mark\endcsname{#7}\addcontentsline
  107.          {toc}{#1}{\ifnum #2>\c@secnumdepth \else
  108.                       \protect\numberline{\csname the#1\endcsname}\fi
  109.                     #7}\else
  110.         \def\@svsechd{
  111.             \expandafter\relax\csname @#1style\endcsname\relax
  112.             \hskip #3\@svsec #8\csname #1mark\endcsname
  113.                       {#7}\addcontentsline
  114.                            {toc}{#1}{\ifnum #2>\c@secnumdepth \else
  115.                              \protect\numberline{\csname the#1\endcsname}\fi
  116.                        #7}}\fi
  117.      \@xsect{#5}}
  118.  
  119.  
  120. \def\@ssect#1#2#3#4#5{\@tempskipa #3\relax
  121.    \ifdim \@tempskipa>\z@
  122.      \begingroup \expandafter\relax\csname @#4style\endcsname\relax
  123.      \@hangfrom{\hskip #1}{\interlinepenalty \@M #5\par}\endgroup
  124.    \else \def\@svsechd{#4\hskip #1\relax #5}\fi
  125.     \@xsect{#3}}
  126.  
  127. \def\mysection#1#2#3{
  128.      \expandafter\def\csname @#1style\endcsname{#2}
  129.      \expandafter\def\csname @pre#1\endcsname{#3}
  130. }
  131.  
  132. % Default section heads.
  133.  
  134. \mysection{section}{\large\bf}{\thesection.~}
  135. \mysection{subsection}{\normalsize\bf}{\thesubsection.~}
  136. \mysection{subsubsection}{\normalsize\bf}{\thesubsubsection.~}
  137. \mysection{paragraph}{\normalsize\bf}{\theparagraph.}
  138. \mysection{subparagraph}{\normalsize\bf}{\thesubparagraph.}
  139.  
  140. % Redefine theorem environment macros to put \theoremcounterend
  141. % (default ".") after the "theorem" head.
  142.  
  143. \def\@begintheorem#1#2{\sl \trivlist
  144.    \item[\hskip \labelsep{\bf #1\ #2\thmcounterend}]}
  145. \def\@opargbegintheorem#1#2#3{\sl \trivlist
  146.       \item[\hskip \labelsep{\bf #1\ #2\ (#3)\thmcounterend}]}
  147. \def\thmcounterend{.}
  148.  
  149.  
  150. % Define \numberbysection to number figures, table, equations, and
  151. % theorems within sections.  Similarly for \numberbysubsection.  Any
  152. % theorem-like environment numbered with theorem inherits this
  153. % numbering (however, be sure to define the.  theorem environment
  154. % before invoking \numberbysection or \numberbysubsection).
  155.  
  156. \def\numberbysection{\renewcommand{\thesection}{\arabic{section}}
  157.                      \renewcommand{\theequation}{\thesection.\arabic{equation}}
  158.                      \@addtoreset{equation}{section}
  159.                      \renewcommand{\thetheorem}{\thesection.\arabic{theorem}}
  160.                      \@addtoreset{theorem}{section}
  161.                      \renewcommand{\thefigure}{\thesection.\arabic{figure}}
  162.                      \@addtoreset{figure}{section}
  163.                      \renewcommand{\thetable}{\thesection.\arabic{table}}
  164.                      \@addtoreset{table}{section}}
  165.  
  166. \def\numberbysubsection{\renewcommand{\thesection}{\arabic{section}}
  167.               \renewcommand{\thesubsection}{\arabic{subsection}}
  168.               \renewcommand{\theequation}{\thesubsection.\arabic{equation}}
  169.               \@addtoreset{equation}{subsection}
  170.               \renewcommand{\thetheorem}{\thesubsection.\arabic{theorem}}
  171.               \@addtoreset{theorem}{subsection}
  172.               \renewcommand{\thefigure}{\thesubsection.\arabic{figure}}
  173.               \@addtoreset{figure}{subsection}
  174.               \renewcommand{\thetable}{\thesubsection.\arabic{table}}
  175.               \@addtoreset{table}{subsection}}
  176.  
  177. \@definecounter{theorem}
  178.  
  179.  
  180. % Change the labels of enumerate and outline to arabic numbers.
  181.  
  182. \def\labelenumi{\arabic{enumi}.} 
  183. \def\theenumi{\arabic{enumi}} 
  184. \def\labelenumii{\arabic{enumii}.}
  185. \def\theenumii{\arabic{enumii}}
  186. \def\p@enumii{\theenumi.}
  187. \def\labelenumiii{\arabic{enumiii}.}
  188. \def\theenumiii{\arabic{enumiii}}
  189. \def\p@enumiii{\theenumi.\theenumii.}
  190. \def\labelenumiv{\arabic{enumiv}.}
  191. \def\theenumiv{\arabic{enumiv}} 
  192. \def\p@enumiv{\p@enumiii.\theenumiii}
  193.  
  194. % Outline is a new list style--the same as enumerate with
  195. % less space between the items.
  196.  
  197. \def\outline{\ifnum \@enumdepth >3 \@toodeep\else
  198.       \advance\@enumdepth \@ne 
  199.       \edef\@enumctr{enum\romannumeral\the\@enumdepth}\list
  200.       {\csname label\@enumctr\endcsname}{\usecounter
  201.         {\@enumctr}\def\makelabel##1{\hss\llap{##1}}
  202.          \parsep \z@ \itemsep \z@ 
  203.          \ifnum \@enumdepth > 1 \topsep \z@ \fi}\fi}
  204.  
  205. \let\endoutline =\endlist
  206.  
  207. % Three part head and foot macros by
  208. % Lance Berc
  209. % Olivetti Research Center
  210. % 2882 Sand Hill Road
  211. % Menlo Park, California 94025
  212. % (415) 496-6200
  213. % lance@orc.olivetti.com
  214.  
  215. \def\lhead#1{\gdef\@lhead{#1}} \def\lfoot#1{\gdef\@lfoot{#1}}
  216. \def\chead#1{\gdef\@chead{#1}} \def\cfoot#1{\gdef\@cfoot{#1}}
  217. \def\rhead#1{\gdef\@rhead{#1}} \def\rfoot#1{\gdef\@rfoot{#1}}
  218.  
  219. \def\@lhead{} \def\@lfoot{}
  220. \def\@chead{} \def\@cfoot{}
  221. \def\@rhead{} \def\@rfoot{}
  222.  
  223. \def\@threepart#1#2#3{\rlap{#1} \hfil {#2} \hfil \llap{#3}}
  224.  
  225. \def\ps@threepartheadings
  226.     {
  227.     \def\@oddhead{\@threepart{\@lhead}{\@chead}{\@rhead}}
  228.     \def\@oddfoot{\@threepart{\@lfoot}{\@cfoot}{\@rfoot}}
  229.  
  230.     \if@twoside
  231.     \def\@evenhead{\@threepart{\@rhead}{\@chead}{\@lhead}}
  232.     \def\@evenfoot{\@threepart{\@rfoot}{\@cfoot}{\@lfoot}}
  233.     \else
  234.     \def\@evenhead{\@threepart{\@lhead}{\@chead}{\@rhead}}
  235.     \def\@evenfoot{\@threepart{\@lfoot}{\@cfoot}{\@rfoot}}
  236.     \fi
  237.     }
  238.  
  239. \ps@threepartheadings
  240.  
  241. % Define \underhead to put a rule under the headers.  \nounderhead
  242. % suppresses \underhead on the current page.  The space between
  243. % the text and the rule is \underheadsep.
  244.  
  245. \def\underhead{
  246.  \addtolength{\headheight}{\underheadsep}
  247.  \def\@outputpage{\begingroup\catcode`\ =10 \if@specialpage 
  248.      \global\@specialpagefalse\@nameuse{ps@\@specialstyle}\fi
  249.      \if@twoside 
  250.        \ifodd\count\z@ \let\@thehead\@oddhead \let\@thefoot\@oddfoot
  251.             \let\@themargin\oddsidemargin
  252.           \else \let\@thehead\@evenhead
  253.           \let\@thefoot\@evenfoot \let\@themargin\evensidemargin
  254.      \fi\fi
  255.      \shipout
  256.      \vbox{\normalsize \baselineskip\z@ \lineskip\z@
  257.            \vskip \topmargin \moveright\@themargin
  258.            \vbox{\setbox\@tempboxa
  259.                    \vbox to\headheight{\vfil \hbox to\textwidth{\@thehead}
  260.                          \vskip \underheadsep
  261.                           \if@nounderhead\global\@nounderheadfalse
  262.                                  \hbox to\textwidth{}
  263.                           \else  \hbox to\textwidth{\hrulefill}\fi}
  264.                  \dp\@tempboxa\z@
  265.                  \box\@tempboxa
  266.                  \vskip \headsep
  267.                  \box\@outputbox
  268.                  \baselineskip\footskip
  269.                  \hbox to\textwidth{\@thefoot}}}\global\@colht\textheight
  270.            \endgroup\stepcounter{page}\let\firstmark\botmark}
  271.  
  272. }
  273. \def\ps@empty{\@nounderheadtrue
  274.               \let\@mkboth\@gobbletwo\def\@oddhead{}\def\@oddfoot{}%
  275. \def\@evenhead{}\def\@evenfoot{}}
  276.  
  277. \def\ps@plain{\@nounderheadtrue
  278.      \let\@mkboth\@gobbletwo
  279.      \def\@oddhead{}\def\@oddfoot{\rm\hfil\thepage
  280.      \hfil}\def\@evenhead{}\let\@evenfoot\@oddfoot}
  281.  
  282.  
  283. \newif\if@nounderhead \@nounderheadfalse
  284. \def\nounderhead{\@nounderheadtrue}
  285.  
  286. \newlength{\underheadsep}
  287. \setlength{\underheadsep}{.5ex}
  288.  
  289. % Define \tighttoc to alter table of contents entry so that
  290. % sections are treated like subsections, subsubsections, etc.
  291.  
  292. \def\tighttoc{\def\l@section{\@dottedtocline{1}{0em}{1.4em}}}
  293.  
  294. % Define \symbolnote{<num>}{<text>} to produce a note with footnote
  295. % mark <num> (less than 10).  The commands \symbolmark{<num>}
  296. % and \symboltext{<num>}{<text>} are analogues of
  297. % \footnotemark[<num>] and \footnotetext[<num>]{<text>}.
  298.  
  299. \def\symbolnote#1#2{\let\@thefootn=\thefootnote%
  300. \renewcommand{\thefootnote}{\fnsymbol{footnote}}%
  301. \footnotemark[#1]%
  302. \footnotetext[#1]{#2}%
  303. \let\thefootnote=\@thefootn
  304. }
  305.  
  306. \def\symbolmark#1{\let\@thefootn=\thefootnote%
  307. \renewcommand{\thefootnote}{\fnsymbol{footnote}}%
  308. \footnotemark[#1]%
  309. \let\thefootnote=\@thefootn
  310. }
  311.  
  312. \def\symboltext#1#2{\let\@thefootn=\thefootnote%
  313. \renewcommand{\thefootnote}{\fnsymbol{footnote}}%
  314. \footnotetext[#1]{#2}%
  315. \let\thefootnote=\@thefootn
  316. }
  317.  
  318.  
  319. % Define symboleqn environment to make a displayed equation with
  320. % a symbolic equation label.
  321.  
  322. \newenvironment{symboleqn}[1]{
  323.    \def\@savesymbol{#1}$$}{\eqno \@savesymbol $$\global\@ignoretrue}
  324.  
  325.