reduce.sty 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472
  1. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2. % The REDUCE Style option File --- LaTeX version. %
  3. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  4. %
  5. % The document should start with:
  6. % \documentstyle[11pt,reduce,makeidx]{...}
  7. %
  8. % This style adds the following commands:
  9. % \COMPATNOTE{...} For compatibility notes.
  10. % \f{...} Sets function name is \tt.
  11. % \k{...} Sets BNF keyword bold.
  12. % \REDUCE REDUCE when needed as a word.
  13. % \RLISP RLISP when needed as a word.
  14. % \s{...} Sets BNF sentential form \em in <...>
  15. % \meta An alternative for BNF italics in <...>
  16. % \ttindex{...} Puts index entry in \tt font.
  17. %
  18. %
  19. %
  20. % Basic religion about REDUCE documentation. No paragraph indentation,
  21. % bigger skip between lines, ragged bottom, and not as much vertical
  22. % space.
  23. %% RmS: setup of size dependent parameters. 11pt is assumed, so let's force it.
  24. \typeout{Document style option `reduce' -- released 28 Jul 1998.}
  25. % ****************************************
  26. % * FONTS *
  27. % ****************************************
  28. %
  29. \lineskip 1pt % \lineskip is 1pt for all font sizes.
  30. \normallineskip 1pt
  31. \def\baselinestretch{1}
  32. % Each size-changing command \SIZE executes the command
  33. % \@setsize\SIZE{BASELINESKIP}\FONTSIZE\@FONTSIZE
  34. % where:
  35. % BASELINESKIP = Normal value of \baselineskip for that size. (Actual
  36. % value will be \baselinestretch * BASELINESKIP.)
  37. %
  38. % \FONTSIZE = Name of font-size command. The currently available
  39. % (preloaded) font sizes are: \vpt (5pt), \vipt (6pt),
  40. % \viipt (etc.), \viiipt, \ixpt, \xpt, \xipt, \xiipt,
  41. % \xivpt, \xviipt, \xxpt, \xxvpt.
  42. % \@FONTSIZE = The same as the font-size command except with an
  43. % '@' in front---e.g., if \FONTSIZE = \xivpt then
  44. % \@FONTSIZE = \@xivpt.
  45. %
  46. % For reasons of efficiency that needn't concern the designer,
  47. % the document style defines \@normalsize instead of \normalsize. This
  48. % is done only for \normalsize, not for any other size-changing
  49. % commands.
  50. \def\@normalsize{\@setsize\normalsize{13.6pt}\xipt\@xipt
  51. \abovedisplayskip .5\baselineskip
  52. \belowdisplayskip \abovedisplayskip
  53. \abovedisplayshortskip \z@ plus3\p@
  54. \belowdisplayshortskip 6.5\p@ plus3.5\p@ minus3\p@
  55. \let\@listi\@listI} % Setting of \@listi added 9 Jun 87
  56. \def\small{\@setsize\small{12pt}\xpt\@xpt
  57. \abovedisplayskip .5\baselineskip
  58. \belowdisplayskip \abovedisplayskip
  59. \abovedisplayshortskip \z@ plus3\p@
  60. \belowdisplayshortskip 6\p@ plus3\p@ minus3\p@
  61. \def\@listi{\leftmargin\leftmargini %% Added 22 Dec 87
  62. \topsep \z@\parsep 3\p@ plus2\p@ minus\p@
  63. \itemsep .5\baselineskip}}
  64. \def\footnotesize{\@setsize\footnotesize{11pt}\ixpt\@ixpt
  65. \abovedisplayskip .5\baselineskip
  66. \belowdisplayskip \abovedisplayskip
  67. \abovedisplayshortskip \z@ plus\p@
  68. \belowdisplayshortskip 4\p@ plus2\p@ minus2\p@
  69. \def\@listi{\leftmargin\leftmargini %% Added 22 Dec 87
  70. \topsep \z@ \parsep 2\p@ plus\p@ minus\p@
  71. \itemsep .5\baselineskip}}
  72. \def\scriptsize{\@setsize\scriptsize{9.5pt}\viiipt\@viiipt}
  73. \def\tiny{\@setsize\tiny{7pt}\vipt\@vipt}
  74. \def\large{\@setsize\large{14pt}\xiipt\@xiipt}
  75. \def\Large{\@setsize\Large{18pt}\xivpt\@xivpt}
  76. \def\LARGE{\@setsize\LARGE{22pt}\xviipt\@xviipt}
  77. \def\huge{\@setsize\huge{25pt}\xxpt\@xxpt}
  78. \def\Huge{\@setsize\Huge{30pt}\xxvpt\@xxvpt}
  79. \normalsize % Choose the normalsize font.
  80. % ****************************************
  81. % * PAGE LAYOUT *
  82. % ****************************************
  83. %
  84. % All margin dimensions measured from a point one inch from top and side
  85. % of page.
  86. % SIDE MARGINS:
  87. \if@twoside % Values for two-sided printing:
  88. \oddsidemargin 36pt % Left margin on odd-numbered pages.
  89. \evensidemargin 74pt % Left margin on even-numbered pages.
  90. \marginparwidth 100pt % Width of marginal notes.
  91. \else % Values for one-sided printing:
  92. \oddsidemargin 54pt % Note that \oddsidemargin = \evensidemargin
  93. \evensidemargin 54pt
  94. \marginparwidth 83pt
  95. \fi
  96. \marginparsep 10pt % Horizontal space between outer margin and
  97. % marginal note
  98. % VERTICAL SPACING:
  99. % Top of page:
  100. \topmargin 27pt % Nominal distance from top of page to top
  101. % of box containing running head.
  102. \headheight 12pt % Height of box containing running head.
  103. \headsep 25pt % Space between running head and text.
  104. % \topskip = 10pt % '\baselineskip' for first line of page.
  105. % Bottom of page:
  106. \footskip 30pt % Distance from baseline of box containing
  107. % foot to baseline of last line of text.
  108. % DIMENSION OF TEXT:
  109. % 24 Jun 86: changed to explicitly compute \textheight to avoid
  110. % roundoff. The value of the multiplier was calculated as the floor of
  111. % the old \textheight minus \topskip, divided by \baselineskip for
  112. % \normalsize. The old value of \textheight was 530.4pt.
  113. % \textheight is the height of text (including footnotes and figures,
  114. % excluding running head and foot).
  115. \textheight = 38\baselineskip
  116. \advance\textheight by \topskip
  117. \textwidth 360pt % Width of text line.
  118. % For two-column mode:
  119. \columnsep 10pt % Space between columns
  120. \columnseprule 0pt % Width of rule between columns.
  121. % A \raggedbottom command causes 'ragged bottom' pages: pages set to
  122. % natural height instead of being stretched to exactly \textheight.
  123. % FOOTNOTES:
  124. \footnotesep 7.7pt % Height of strut placed at the beginning of every
  125. % footnote = height of normal \footnotesize strut,
  126. % so no extra space between footnotes.
  127. \skip\footins 10pt plus 4pt minus 2pt % Space between last line of text
  128. % and top of first footnote.
  129. % FLOATS: (a float is something like a figure or table)
  130. %
  131. % FOR FLOATS ON A TEXT PAGE:
  132. %
  133. % ONE-COLUMN MODE OR SINGLE-COLUMN FLOATS IN TWO-COLUMN MODE:
  134. \floatsep 12pt plus 2pt minus 2pt % Space between adjacent floats
  135. % moved to top or bottom of
  136. % text page.
  137. \textfloatsep 20pt plus 2pt minus 4pt % Space between main text and
  138. % floats at top or bottom of
  139. % page.
  140. \intextsep 12pt plus 2pt minus 2pt % Space between in-text figures
  141. % and text.
  142. % In LaTeX2e, \@maxsep no longer exists
  143. \@ifundefined{@maxsep}{}%
  144. {\setlength{\@maxsep}{20pt}} % The maximum of \floatsep,
  145. % \textfloatsep and \intextsep
  146. % (minus the stretch and
  147. % shrink).
  148. % TWO-COLUMN FLOATS IN TWO-COLUMN MODE:
  149. \dblfloatsep 12pt plus 2pt minus 2pt % Same as \floatsep for
  150. % double-column figures in
  151. % two-column mode.
  152. \dbltextfloatsep 20pt plus 2pt minus 4pt % \textfloatsep for
  153. % double-column floats.
  154. % In LaTeX2e, \@dblmaxsep no longer exists
  155. \@ifundefined{@dblmaxsep}{}%
  156. {\setlength{\@dblmaxsep}{20pt}} % The maximum of \dblfloatsep
  157. % and \dbltexfloatsep.
  158. % FOR FLOATS ON A SEPARATE FLOAT PAGE OR COLUMN:
  159. % ONE-COLUMN MODE OR SINGLE-COLUMN FLOATS IN TWO-COLUMN MODE:
  160. \@fptop 0pt plus 1fil % Stretch at top of float page/column. (Must
  161. % be 0pt plus ...)
  162. \@fpsep 8pt plus 2fil % Space between floats on float page/column.
  163. \@fpbot 0pt plus 1fil % Stretch at bottom of float page/column. (Must
  164. % be 0pt plus ... )
  165. % DOUBLE-COLUMN FLOATS IN TWO-COLUMN MODE.
  166. \@dblfptop 0pt plus 1fil % Stretch at top of float page. (Must be 0pt
  167. % plus ...)
  168. \@dblfpsep 8pt plus 2fil % Space between floats on float page.
  169. \@dblfpbot 0pt plus 1fil % Stretch at bottom of float page. (Must be
  170. % 0pt plus ... )
  171. % MARGINAL NOTES:
  172. %
  173. \marginparpush 5pt % Minimum vertical separation between two
  174. % marginal notes.
  175. % ****************************************
  176. % * PARAGRAPHING *
  177. % ****************************************
  178. %
  179. \parskip 6pt plus 1pt %% RmS % Extra vertical space between
  180. % paragraphs.
  181. \parindent 0pt %% RmS % Width of paragraph indentation.
  182. \topsep 0pt %% RmS % Extra vertical space, in addition
  183. % to \parskip, added above and below
  184. % list and paragraphing environments.
  185. \partopsep 0pt %% RmS % Extra vertical space, in addition
  186. % to \parskip and \topsep, added when
  187. % user leaves blank line before
  188. % environment.
  189. \itemsep \topsep %% RmS % Extra vertical space, in addition
  190. % to \parskip, added between list
  191. % items.
  192. % See \@listI for values of \topsep and \itemsep
  193. % The following page-breaking penalties are defined
  194. \@lowpenalty 51 % Produced by \nopagebreak[1] or \nolinebreak[1]
  195. \@medpenalty 151 % Produced by \nopagebreak[2] or \nolinebreak[2]
  196. \@highpenalty 301 % Produced by \nopagebreak[3] or \nolinebreak[3]
  197. \@beginparpenalty -\@lowpenalty % Before a list or paragraph
  198. % environment.
  199. \@endparpenalty -\@lowpenalty % After a list or paragraph
  200. % environment.
  201. \@itempenalty -\@lowpenalty % Between list items.
  202. % \clubpenalty % 'Club line' at bottom of page.
  203. % \widowpenalty % 'Widow line' at top of page.
  204. % \displaywidowpenalty % Math display widow line.
  205. % \predisplaypenalty % Breaking before a math display.
  206. % \postdisplaypenalty % Breaking after a math display.
  207. % \interlinepenalty % Breaking at a line within a paragraph.
  208. % \brokenpenalty % Breaking after a hyphenated line.
  209. % ****************************************
  210. % * SECTIONS *
  211. % ****************************************
  212. %
  213. % \@startsection {NAME}{LEVEL}{INDENT}{BEFORESKIP}{AFTERSKIP}{STYLE}
  214. % optional * [ALTHEADING]{HEADING}
  215. % Generic command to start a section.
  216. % NAME : e.g., 'subsection'
  217. % LEVEL : a number, denoting depth of section -- i.e.,
  218. % section=1, subsection = 2, etc. A section number will
  219. % be printed if and only if LEVEL < or = the value of
  220. % the secnumdepth counter.
  221. % INDENT : Indentation of heading from left margin
  222. % BEFORESKIP : Absolute value = skip to leave above the heading.
  223. % If negative, then paragraph indent of text following
  224. % heading is suppressed.
  225. % AFTERSKIP : if positive, then skip to leave below heading,
  226. % else - skip to leave to right of run-in heading.
  227. % STYLE : commands to set style
  228. % If '*' missing, then increments the counter. If it is present, then
  229. % there should be no [ALTHEADING] argument. A sectioning command
  230. % is normally defined to \@startsection + its first six arguments.
  231. \def\section{\@startsection {section}{1}{\z@}{-3.5ex plus-1ex minus
  232. -.2ex}{2.3ex plus.2ex}{\reset@font\Large\bf}}
  233. \def\subsection{\@startsection{subsection}{2}{\z@}{-3.25ex plus-1ex
  234. minus-.2ex}{1.5ex plus.2ex}{\reset@font\large\bf}}
  235. \def\subsubsection{\@startsection{subsubsection}{3}{\z@}{-3.25ex plus
  236. -1ex minus-.2ex}{1.5ex plus.2ex}{\reset@font\normalsize\bf}}
  237. \def\paragraph{\@startsection
  238. {paragraph}{4}{\z@}{3.25ex plus1ex minus.2ex}{-1em}{\reset@font
  239. \normalsize\bf}}
  240. \def\subparagraph{\@startsection
  241. {subparagraph}{4}{\parindent}{3.25ex plus1ex minus
  242. .2ex}{-1em}{\reset@font\normalsize\bf}}
  243. % Default initializations of \...mark commands. (See below for their
  244. % use in defining page styles.
  245. %
  246. % \def\sectionmark#1{} % Preloaded definitions
  247. % \def\subsectionmark#1{}
  248. % \def\subsubsectionmark#1{}
  249. % \def\paragraphmark#1{}
  250. % \def\subparagraphmark#1{}
  251. % The value of the counter secnumdepth gives the depth of the
  252. % highest-level sectioning command that is to produce section numbers.
  253. %
  254. \setcounter{secnumdepth}{3}
  255. % APPENDIX
  256. %
  257. % The \appendix command must do the following:
  258. % -- reset the section and subsection counters to zero
  259. % -- redefine the section counter to produce appendix numbers
  260. % -- redefine the \section command if appendix titles and headings
  261. % are to look different from section titles and headings.
  262. \def\appendix{\par
  263. \setcounter{section}{0}
  264. \setcounter{subsection}{0}
  265. \def\thesection{\Alph{section}}}
  266. % ****************************************
  267. % * LISTS *
  268. % ****************************************
  269. %
  270. % The following commands are used to set the default values for the list
  271. % environment's parameters. See the LaTeX manual for an explanation of
  272. % the meanings of the parameters. Defaults for the list environment are
  273. % set as follows. First, \rightmargin, \listparindent and \itemindent
  274. % are set to 0pt. Then, for a Kth level list, the command \@listK is
  275. % called, where 'K' denotes 'i', 'ii', ... , 'vi'. (I.e., \@listiii is
  276. % called for a third-level list.) By convention, \@listK should set
  277. % \leftmargin to \leftmarginK.
  278. %
  279. \leftmargini 2.5em
  280. \leftmarginii 2.2em % > \labelsep + width of '(m)'
  281. \leftmarginiii 1.87em % > \labelsep + width of 'vii.'
  282. \leftmarginiv 1.7em % > \labelsep + width of 'M.'
  283. \leftmarginv 1em
  284. \leftmarginvi 1em
  285. \leftmargin\leftmargini
  286. \labelsep .5em
  287. \labelwidth\leftmargini\advance\labelwidth-\labelsep
  288. %\parsep 4.5pt plus 2pt minus 1pt %(Removed 9 Jun 87)
  289. % \@listI defines top level and \@listi values of
  290. % \leftmargin, \topsep, \parsep, and \itemsep
  291. % (Added 9 Jun 87)
  292. \def\@listI{\leftmargin\leftmargini \parsep 4.5\p@ plus2\p@ minus\p@
  293. \topsep \z@ \itemsep \topsep}
  294. \let\@listi\@listI
  295. \@listi
  296. \def\@listii{\leftmargin\leftmarginii
  297. \labelwidth\leftmarginii\advance\labelwidth-\labelsep
  298. \topsep \z@ \itemsep \topsep
  299. \parsep 2\p@ plus\p@ minus\p@}
  300. \def\@listiii{\leftmargin\leftmarginiii
  301. \labelwidth\leftmarginiii\advance\labelwidth-\labelsep
  302. \topsep \z@ \itemsep \topsep
  303. \parsep \z@ \partopsep\z@}
  304. \def\@listiv{\leftmargin\leftmarginiv
  305. \labelwidth\leftmarginiv\advance\labelwidth-\labelsep}
  306. %% RmS: which at the same time makes the vertical space in lists (verbatim...)
  307. %% too large if not other precautions are taken.
  308. \setlength{\parindent}{0pt}
  309. \setlength{\parskip}{6pt}
  310. \raggedbottom
  311. % Various boxes.
  312. \newlength{\reduceboxwidth}
  313. \setlength{\reduceboxwidth}{4in}
  314. \newlength{\redboxwidth}
  315. \setlength{\redboxwidth}{3.5in}
  316. \newlength{\rboxwidth}
  317. \setlength{\rboxwidth}{2.6in}
  318. % These are here in case the name changes or we someday want a special
  319. % font.
  320. \newcommand{\REDUCE}{REDUCE}
  321. \newcommand{\RLISP}{RLISP}
  322. % This is useful for putting function names in \tt format in the index.
  323. \newcommand{\ttindex}[1]{\index{#1@{\tt #1}}}
  324. % Use this when you are speaking about problems across systems.
  325. \newcommand{\COMPATNOTE}{{\em Compatibility Note:\ }}
  326. \pagestyle{headings}
  327. %% For BNF notation.
  328. % \s{...} is a sentential form in descriptions. Enclosed \em text in <...>
  329. \newcommand{\s}[1] {$<${\em #1}$>$}
  330. % \meta{...} is an alternative sentential form in descriptions using \it.
  331. \newcommand{\meta}[1]{\mbox{$\langle$\it#1\/$\rangle$}}
  332. % \k{...} is a keyword. Just do in bold for the moment.
  333. \@ifundefined{k}{}{\let\k\relax} % undefine \k (LaTeX2e)
  334. \newcommand{\k}[1] {{\bf #1}}
  335. % \f is a function name. Just do this as tt.
  336. \newcommand{\f}[1] {{\tt #1}}
  337. % An example macro for numbering and indenting examples.
  338. \newcounter{examplectr}
  339. \newcommand{\example}{\refstepcounter{examplectr}
  340. \noindent{\bf Example \theexamplectr}}
  341. % The following are currently only used in the GENTRAN document. However,
  342. % there's no objection to using them elsewhere.
  343. \begingroup
  344. \catcode `|=0
  345. \catcode `[= 1
  346. \catcode`]=2
  347. \catcode `\{=12
  348. \catcode `\}=12
  349. \catcode`\\=12
  350. |gdef|@xframedverbatim#1\end{framedverbatim}[#1|end[framedverbatim]]
  351. |gdef|@sxframedverbatim#1\end{framedverbatim*}[#1|end[framedverbatim*]]
  352. |endgroup
  353. \newdimen\@mcdheight
  354. \def\@sframedverbatim{\obeyspaces\@framedverbatim}
  355. \def\@mcdrule{\@mcdheight=\baselineskip\advance\@mcdheight by-2pt
  356. \setbox0=\hbox{\vrule height\@mcdheight depth 2pt width 1pt}%
  357. \ht0=\@mcdheight\dp0=0pt\wd0=1pt\box0}
  358. \def\@mcdendrule{\@mcdheight=\baselineskip%
  359. \setbox0=\hbox{\vrule height\@mcdheight depth 2pt width 1pt}%
  360. \ht0=\@mcdheight\dp0=0pt\wd0=1pt\box0}
  361. \def\@framedverbatim{\trivlist \item[]
  362. \parskip \z@
  363. \hrule \@height \p@ \@depth \z@ \@width\textwidth
  364. \everypar{\global \@minipagefalse \global \@newlistfalse \if@inlabel
  365. \global \@inlabelfalse \hskip -\parindent \box \@labels \penalty \z@ \fi
  366. \hbox to6\p@{\rlap{\@mcdrule}\hskip\textwidth\llap{\@mcdrule}\hss}}%
  367. \if@minipage\else\vskip\parskip\fi
  368. \leftskip\@totalleftmargin\rightskip\z@
  369. \parindent\z@\parfillskip\@flushglue\parskip\z@
  370. \@tempswafalse \def\par{\if@tempswa\hbox{}\fi\@tempswatrue\@@par
  371. \penalty\interlinepenalty}% % fix \samepage bug
  372. \obeylines \tt \catcode``=13 \@noligs \let\do\@makeother \dospecials}
  373. \def\framedverbatim{\@framedverbatim \frenchspacing\@vobeyspaces
  374. \@xframedverbatim}
  375. \def\endframedverbatim{\nointerlineskip
  376. {\everypar{}\baselineskip 4\p@\vbox to4\p@{\par\noindent\hbox
  377. to6pt{\rlap{\@mcdendrule}\hskip\textwidth\llap{\@mcdendrule}\hss}}%
  378. \vskip\p@\hrule \@height \p@ \@depth \z@ \@width\textwidth}\endtrivlist}
  379. \@namedef{framedverbatim*}{\@framedverbatim\@sxframedverbatim}
  380. \expandafter\let\csname endframedverbatim*\endcsname =\endtrivlist
  381. % Will print out a heading in bold, and then indent the following text.
  382. \def\indented{\list{}{
  383. \itemindent\listparindent
  384. \rightmargin\leftmargin}\item[]}
  385. \let\endindented=\endlist
  386. \newenvironment{describe}[1]{\par{\bf #1}\begin{indented}}{\end{indented}}
  387. \@ifundefined{reset@font}{\let\reset@font\@empty}{}
  388. \endinput