REDUCE.STY 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467
  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 5 Nov 1991.}
  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. \@maxsep 20pt % The maximum of \floatsep,
  143. % \textfloatsep and \intextsep
  144. % (minus the stretch and
  145. % shrink).
  146. % TWO-COLUMN FLOATS IN TWO-COLUMN MODE:
  147. \dblfloatsep 12pt plus 2pt minus 2pt % Same as \floatsep for
  148. % double-column figures in
  149. % two-column mode.
  150. \dbltextfloatsep 20pt plus 2pt minus 4pt % \textfloatsep for
  151. % double-column floats.
  152. \@dblmaxsep 20pt % The maximum of \dblfloatsep
  153. % and \dbltexfloatsep.
  154. % FOR FLOATS ON A SEPARATE FLOAT PAGE OR COLUMN:
  155. % ONE-COLUMN MODE OR SINGLE-COLUMN FLOATS IN TWO-COLUMN MODE:
  156. \@fptop 0pt plus 1fil % Stretch at top of float page/column. (Must
  157. % be 0pt plus ...)
  158. \@fpsep 8pt plus 2fil % Space between floats on float page/column.
  159. \@fpbot 0pt plus 1fil % Stretch at bottom of float page/column. (Must
  160. % be 0pt plus ... )
  161. % DOUBLE-COLUMN FLOATS IN TWO-COLUMN MODE.
  162. \@dblfptop 0pt plus 1fil % Stretch at top of float page. (Must be 0pt
  163. % plus ...)
  164. \@dblfpsep 8pt plus 2fil % Space between floats on float page.
  165. \@dblfpbot 0pt plus 1fil % Stretch at bottom of float page. (Must be
  166. % 0pt plus ... )
  167. % MARGINAL NOTES:
  168. %
  169. \marginparpush 5pt % Minimum vertical separation between two
  170. % marginal notes.
  171. % ****************************************
  172. % * PARAGRAPHING *
  173. % ****************************************
  174. %
  175. \parskip 6pt plus 1pt %% RmS % Extra vertical space between
  176. % paragraphs.
  177. \parindent 0pt %% RmS % Width of paragraph indentation.
  178. \topsep 0pt %% RmS % Extra vertical space, in addition
  179. % to \parskip, added above and below
  180. % list and paragraphing environments.
  181. \partopsep 0pt %% RmS % Extra vertical space, in addition
  182. % to \parskip and \topsep, added when
  183. % user leaves blank line before
  184. % environment.
  185. \itemsep \topsep %% RmS % Extra vertical space, in addition
  186. % to \parskip, added between list
  187. % items.
  188. % See \@listI for values of \topsep and \itemsep
  189. % The following page-breaking penalties are defined
  190. \@lowpenalty 51 % Produced by \nopagebreak[1] or \nolinebreak[1]
  191. \@medpenalty 151 % Produced by \nopagebreak[2] or \nolinebreak[2]
  192. \@highpenalty 301 % Produced by \nopagebreak[3] or \nolinebreak[3]
  193. \@beginparpenalty -\@lowpenalty % Before a list or paragraph
  194. % environment.
  195. \@endparpenalty -\@lowpenalty % After a list or paragraph
  196. % environment.
  197. \@itempenalty -\@lowpenalty % Between list items.
  198. % \clubpenalty % 'Club line' at bottom of page.
  199. % \widowpenalty % 'Widow line' at top of page.
  200. % \displaywidowpenalty % Math display widow line.
  201. % \predisplaypenalty % Breaking before a math display.
  202. % \postdisplaypenalty % Breaking after a math display.
  203. % \interlinepenalty % Breaking at a line within a paragraph.
  204. % \brokenpenalty % Breaking after a hyphenated line.
  205. % ****************************************
  206. % * SECTIONS *
  207. % ****************************************
  208. %
  209. % \@startsection {NAME}{LEVEL}{INDENT}{BEFORESKIP}{AFTERSKIP}{STYLE}
  210. % optional * [ALTHEADING]{HEADING}
  211. % Generic command to start a section.
  212. % NAME : e.g., 'subsection'
  213. % LEVEL : a number, denoting depth of section -- i.e.,
  214. % section=1, subsection = 2, etc. A section number will
  215. % be printed if and only if LEVEL < or = the value of
  216. % the secnumdepth counter.
  217. % INDENT : Indentation of heading from left margin
  218. % BEFORESKIP : Absolute value = skip to leave above the heading.
  219. % If negative, then paragraph indent of text following
  220. % heading is suppressed.
  221. % AFTERSKIP : if positive, then skip to leave below heading,
  222. % else - skip to leave to right of run-in heading.
  223. % STYLE : commands to set style
  224. % If '*' missing, then increments the counter. If it is present, then
  225. % there should be no [ALTHEADING] argument. A sectioning command
  226. % is normally defined to \@startsection + its first six arguments.
  227. \def\section{\@startsection {section}{1}{\z@}{-3.5ex plus-1ex minus
  228. -.2ex}{2.3ex plus.2ex}{\reset@font\Large\bf}}
  229. \def\subsection{\@startsection{subsection}{2}{\z@}{-3.25ex plus-1ex
  230. minus-.2ex}{1.5ex plus.2ex}{\reset@font\large\bf}}
  231. \def\subsubsection{\@startsection{subsubsection}{3}{\z@}{-3.25ex plus
  232. -1ex minus-.2ex}{1.5ex plus.2ex}{\reset@font\normalsize\bf}}
  233. \def\paragraph{\@startsection
  234. {paragraph}{4}{\z@}{3.25ex plus1ex minus.2ex}{-1em}{\reset@font
  235. \normalsize\bf}}
  236. \def\subparagraph{\@startsection
  237. {subparagraph}{4}{\parindent}{3.25ex plus1ex minus
  238. .2ex}{-1em}{\reset@font\normalsize\bf}}
  239. % Default initializations of \...mark commands. (See below for their
  240. % use in defining page styles.
  241. %
  242. % \def\sectionmark#1{} % Preloaded definitions
  243. % \def\subsectionmark#1{}
  244. % \def\subsubsectionmark#1{}
  245. % \def\paragraphmark#1{}
  246. % \def\subparagraphmark#1{}
  247. % The value of the counter secnumdepth gives the depth of the
  248. % highest-level sectioning command that is to produce section numbers.
  249. %
  250. \setcounter{secnumdepth}{3}
  251. % APPENDIX
  252. %
  253. % The \appendix command must do the following:
  254. % -- reset the section and subsection counters to zero
  255. % -- redefine the section counter to produce appendix numbers
  256. % -- redefine the \section command if appendix titles and headings
  257. % are to look different from section titles and headings.
  258. \def\appendix{\par
  259. \setcounter{section}{0}
  260. \setcounter{subsection}{0}
  261. \def\thesection{\Alph{section}}}
  262. % ****************************************
  263. % * LISTS *
  264. % ****************************************
  265. %
  266. % The following commands are used to set the default values for the list
  267. % environment's parameters. See the LaTeX manual for an explanation of
  268. % the meanings of the parameters. Defaults for the list environment are
  269. % set as follows. First, \rightmargin, \listparindent and \itemindent
  270. % are set to 0pt. Then, for a Kth level list, the command \@listK is
  271. % called, where 'K' denotes 'i', 'ii', ... , 'vi'. (I.e., \@listiii is
  272. % called for a third-level list.) By convention, \@listK should set
  273. % \leftmargin to \leftmarginK.
  274. %
  275. \leftmargini 2.5em
  276. \leftmarginii 2.2em % > \labelsep + width of '(m)'
  277. \leftmarginiii 1.87em % > \labelsep + width of 'vii.'
  278. \leftmarginiv 1.7em % > \labelsep + width of 'M.'
  279. \leftmarginv 1em
  280. \leftmarginvi 1em
  281. \leftmargin\leftmargini
  282. \labelsep .5em
  283. \labelwidth\leftmargini\advance\labelwidth-\labelsep
  284. %\parsep 4.5pt plus 2pt minus 1pt %(Removed 9 Jun 87)
  285. % \@listI defines top level and \@listi values of
  286. % \leftmargin, \topsep, \parsep, and \itemsep
  287. % (Added 9 Jun 87)
  288. \def\@listI{\leftmargin\leftmargini \parsep 4.5\p@ plus2\p@ minus\p@
  289. \topsep \z@ \itemsep \topsep}
  290. \let\@listi\@listI
  291. \@listi
  292. \def\@listii{\leftmargin\leftmarginii
  293. \labelwidth\leftmarginii\advance\labelwidth-\labelsep
  294. \topsep \z@ \itemsep \topsep
  295. \parsep 2\p@ plus\p@ minus\p@}
  296. \def\@listiii{\leftmargin\leftmarginiii
  297. \labelwidth\leftmarginiii\advance\labelwidth-\labelsep
  298. \topsep \z@ \itemsep \topsep
  299. \parsep \z@ \partopsep\z@}
  300. \def\@listiv{\leftmargin\leftmarginiv
  301. \labelwidth\leftmarginiv\advance\labelwidth-\labelsep}
  302. %% RmS: which at the same time makes the vertical space in lists (verbatim...)
  303. %% too large if not other precautions are taken.
  304. \setlength{\parindent}{0pt}
  305. \setlength{\parskip}{6pt}
  306. \raggedbottom
  307. % Various boxes.
  308. \newlength{\reduceboxwidth}
  309. \setlength{\reduceboxwidth}{4in}
  310. \newlength{\redboxwidth}
  311. \setlength{\redboxwidth}{3.5in}
  312. \newlength{\rboxwidth}
  313. \setlength{\rboxwidth}{2.6in}
  314. % These are here in case the name changes or we someday want a special
  315. % font.
  316. \newcommand{\REDUCE}{REDUCE}
  317. \newcommand{\RLISP}{RLISP}
  318. % This is useful for putting function names in \tt format in the index.
  319. \newcommand{\ttindex}[1]{\index{#1@{\tt #1}}}
  320. % Use this when you are speaking about problems across systems.
  321. \newcommand{\COMPATNOTE}{{\em Compatibility Note:\ }}
  322. \pagestyle{headings}
  323. %% For BNF notation.
  324. % \s{...} is a sentential form in descriptions. Enclosed \em text in <...>
  325. \newcommand{\s}[1] {$<${\em #1}$>$}
  326. % \meta{...} is an alternative sentential form in descriptions using \it.
  327. \newcommand{\meta}[1]{\mbox{$\langle$\it#1\/$\rangle$}}
  328. % \k{...} is a keyword. Just do in bold for the moment.
  329. \newcommand{\k}[1] {{\bf #1}}
  330. % \f is a function name. Just do this as tt.
  331. \newcommand{\f}[1] {{\tt #1}}
  332. % An example macro for numbering and indenting examples.
  333. \newcounter{examplectr}
  334. \newcommand{\example}{\refstepcounter{examplectr}
  335. \noindent{\bf Example \theexamplectr}}
  336. % The following are currently only used in the GENTRAN document. However,
  337. % there's no objection to using them elsewhere.
  338. \begingroup
  339. \catcode `|=0
  340. \catcode `[= 1
  341. \catcode`]=2
  342. \catcode `\{=12
  343. \catcode `\}=12
  344. \catcode`\\=12
  345. |gdef|@xframedverbatim#1\end{framedverbatim}[#1|end[framedverbatim]]
  346. |gdef|@sxframedverbatim#1\end{framedverbatim*}[#1|end[framedverbatim*]]
  347. |endgroup
  348. \newdimen\@mcdheight
  349. \def\@sframedverbatim{\obeyspaces\@framedverbatim}
  350. \def\@mcdrule{\@mcdheight=\baselineskip\advance\@mcdheight by-2pt
  351. \setbox0=\hbox{\vrule height\@mcdheight depth 2pt width 1pt}%
  352. \ht0=\@mcdheight\dp0=0pt\wd0=1pt\box0}
  353. \def\@mcdendrule{\@mcdheight=\baselineskip%
  354. \setbox0=\hbox{\vrule height\@mcdheight depth 2pt width 1pt}%
  355. \ht0=\@mcdheight\dp0=0pt\wd0=1pt\box0}
  356. \def\@framedverbatim{\trivlist \item[]
  357. \parskip \z@
  358. \hrule \@height \p@ \@depth \z@ \@width\textwidth
  359. \everypar{\global \@minipagefalse \global \@newlistfalse \if@inlabel
  360. \global \@inlabelfalse \hskip -\parindent \box \@labels \penalty \z@ \fi
  361. \hbox to6\p@{\rlap{\@mcdrule}\hskip\textwidth\llap{\@mcdrule}\hss}}%
  362. \if@minipage\else\vskip\parskip\fi
  363. \leftskip\@totalleftmargin\rightskip\z@
  364. \parindent\z@\parfillskip\@flushglue\parskip\z@
  365. \@tempswafalse \def\par{\if@tempswa\hbox{}\fi\@tempswatrue\@@par
  366. \penalty\interlinepenalty}% % fix \samepage bug
  367. \obeylines \tt \catcode``=13 \@noligs \let\do\@makeother \dospecials}
  368. \def\framedverbatim{\@framedverbatim \frenchspacing\@vobeyspaces
  369. \@xframedverbatim}
  370. \def\endframedverbatim{\nointerlineskip
  371. {\everypar{}\baselineskip 4\p@\vbox to4\p@{\par\noindent\hbox
  372. to6pt{\rlap{\@mcdendrule}\hskip\textwidth\llap{\@mcdendrule}\hss}}%
  373. \vskip\p@\hrule \@height \p@ \@depth \z@ \@width\textwidth}\endtrivlist}
  374. \@namedef{framedverbatim*}{\@framedverbatim\@sxframedverbatim}
  375. \expandafter\let\csname endframedverbatim*\endcsname =\endtrivlist
  376. % Will print out a heading in bold, and then indent the following text.
  377. \def\indented{\list{}{
  378. \itemindent\listparindent
  379. \rightmargin\leftmargin}\item[]}
  380. \let\endindented=\endlist
  381. \newenvironment{describe}[1]{\par{\bf #1}\begin{indented}}{\end{indented}}
  382. \@ifundefined{reset@font}{\let\reset@font\@empty}{}
  383. \endinput