home *** CD-ROM | disk | FTP | other *** search
/ Current Shareware 1994 January / SHAR194.ISO / compress / gnuzip_.zip / TEXINFO.TEX (.txt) < prev    next >
LaTeX Document  |  1993-03-28  |  109KB  |  2,688 lines

  1. %% TeX macros to handle texinfo files
  2. %   Copyright (C) 1985, 1986, 1988, 1990, 1991 Free Software Foundation, Inc.
  3. %This texinfo.tex file is free software; you can redistribute it and/or
  4. %modify it under the terms of the GNU General Public License as
  5. %published by the Free Software Foundation; either version 2, or (at
  6. %your option) any later version.
  7. %This texinfo.tex file is distributed in the hope that it will be
  8. %useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  9. %of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  10. %General Public License for more details.
  11. %You should have received a copy of the GNU General Public License
  12. %along with this texinfo.tex file; see the file COPYING.  If not, write
  13. %to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139,
  14. %USA.
  15. %In other words, you are welcome to use, share and improve this program.
  16. %You are forbidden to forbid anyone else to use, share and improve
  17. %what you give them.   Help stamp out software-hoarding!
  18. \def\texinfoversion{2.73}
  19. \message{Loading texinfo package [Version \texinfoversion]:}
  20. \message{}
  21. % Print the version number if in a .fmt file.
  22. \everyjob{\message{[Texinfo version \texinfoversion]}\message{}}
  23. % Save some parts of plain tex whose names we will redefine.
  24. \let\ptexlbrace=\{
  25. \let\ptexrbrace=\}
  26. \let\ptexdots=\dots
  27. \let\ptexdot=\.
  28. \let\ptexstar=\*
  29. \let\ptexend=\end
  30. \let\ptexbullet=\bullet
  31. \let\ptexb=\b
  32. \let\ptexc=\c
  33. \let\ptexi=\i
  34. \let\ptext=\t
  35. \let\ptexl=\l
  36. \let\ptexL=\L
  37. \def\tie{\penalty 10000\ }     % Save plain tex definition of ~.
  38. \message{Basics,}
  39. \chardef\other=12
  40. % If this character appears in an error message or help string, it
  41. % starts a new line in the output.
  42. \newlinechar = `^^J
  43. \hyphenation{ap-pen-dix}
  44. \hyphenation{mini-buf-fer mini-buf-fers}
  45. \hyphenation{eshell}
  46. % Margin to add to right of even pages, to left of odd pages.
  47. \newdimen \bindingoffset  \bindingoffset=0pt
  48. \newdimen \normaloffset   \normaloffset=\hoffset
  49. \newdimen\pagewidth \newdimen\pageheight
  50. \pagewidth=\hsize \pageheight=\vsize
  51. % Sometimes it is convenient to have everything in the transcript file
  52. % and nothing on the terminal.  We don't just call \tracingall here,
  53. % since that produces some useless output on the terminal.
  54. \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
  55. \def\loggingall{\tracingcommands2 \tracingstats2 
  56.    \tracingpages1 \tracingoutput1 \tracinglostchars1 
  57.    \tracingmacros2 \tracingparagraphs1 \tracingrestores1 
  58.    \showboxbreadth\maxdimen\showboxdepth\maxdimen
  59. %---------------------Begin change-----------------------
  60. %%%% For @cropmarks command.
  61. % Dimensions to add cropmarks at corners Added by P. A. MacKay, 12 Nov. 1986
  62. \newdimen\cornerlong \newdimen\cornerthick
  63. \newdimen \topandbottommargin
  64. \newdimen \outerhsize \newdimen \outervsize
  65. \cornerlong=1pc\cornerthick=.3pt    % These set size of cropmarks
  66. \outerhsize=7in
  67. %\outervsize=9.5in
  68. % Alternative @smallbook page size is 9.25in
  69. \outervsize=9.25in
  70. \topandbottommargin=.75in
  71. %---------------------End change-----------------------
  72. % \onepageout takes a vbox as an argument.  Note that \pagecontents
  73. % does insertions itself, but you have to call it yourself.
  74. \chardef\PAGE=255  \output={\onepageout{\pagecontents\PAGE}}
  75. \def\onepageout#1{\hoffset=\normaloffset
  76. \ifodd\pageno  \advance\hoffset by \bindingoffset
  77. \else \advance\hoffset by -\bindingoffset\fi
  78. {\escapechar=`\\\relax % makes sure backslash is used in output files.
  79. \shipout\vbox{{\let\hsize=\pagewidth \makeheadline} \pagebody{#1}%
  80. {\let\hsize=\pagewidth \makefootline}}}%
  81. \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi}
  82. %%%% For @cropmarks command %%%%
  83. % Here is a modification of the main output routine for Near East Publications
  84. % This provides right-angle cropmarks at all four corners.
  85. % The contents of the page are centerlined into the cropmarks,
  86. % and any desired binding offset is added as an \hskip on either
  87. % site of the centerlined box.  (P. A. MacKay, 12 November, 1986)
  88. \def\croppageout#1{\hoffset=0pt % make sure this doesn't mess things up
  89.          \shipout
  90.          \vbox to \outervsize{\hsize=\outerhsize
  91.                  \vbox{\line{\ewtop\hfill\ewtop}}
  92.                  \nointerlineskip
  93.                  \line{\vbox{\moveleft\cornerthick\nstop}
  94.                        \hfill
  95.                        \vbox{\moveright\cornerthick\nstop}}
  96.                  \vskip \topandbottommargin
  97.                  \centerline{\ifodd\pageno\hskip\bindingoffset\fi
  98.             \vbox{
  99.             {\let\hsize=\pagewidth \makeheadline}
  100.             \pagebody{#1}
  101.             {\let\hsize=\pagewidth \makefootline}}
  102.             \ifodd\pageno\else\hskip\bindingoffset\fi}
  103.          \vskip \topandbottommargin plus1fill minus1fill
  104.                  \boxmaxdepth\cornerthick
  105.                  \line{\vbox{\moveleft\cornerthick\nsbot}
  106.                        \hfill
  107.                        \vbox{\moveright\cornerthick\nsbot}}
  108.                  \nointerlineskip
  109.                  \vbox{\line{\ewbot\hfill\ewbot}}
  110.   \advancepageno 
  111.   \ifnum\outputpenalty>-20000 \else\dosupereject\fi}
  112. % Do @cropmarks to get crop marks
  113. \def\cropmarks{\let\onepageout=\croppageout }
  114. \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
  115. {\catcode`\@ =11
  116. \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
  117. \dimen@=\dp#1 \unvbox#1
  118. \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
  119. \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
  120. % Here are the rules for the cropmarks.  Note that they are
  121. % offset so that the space between them is truly \outerhsize or \outervsize
  122. % (P. A. MacKay, 12 November, 1986)
  123. \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
  124. \def\nstop{\vbox
  125.   {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
  126. \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
  127. \def\nsbot{\vbox
  128.   {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
  129. % Parse an argument, then pass it to #1.
  130. % The argument can be delimited with [...] or with "..." or braces
  131. % or it can be a whole line.
  132. % #1 should be a macro which expects
  133. % an ordinary undelimited TeX argument.
  134. \def\parsearg #1{\let\next=#1\begingroup\obeylines\futurelet\temp\parseargx}
  135. \def\parseargx{%
  136. \ifx \obeyedspace\temp \aftergroup\parseargdiscardspace \else%
  137. \aftergroup \parseargline %
  138. \fi \endgroup}
  139. {\obeyspaces %
  140. \gdef\parseargdiscardspace {\begingroup\obeylines\futurelet\temp\parseargx}}
  141. \gdef\obeyedspace{\ }
  142. \def\parseargline{\begingroup \obeylines \parsearglinex}
  143. {\obeylines %
  144. \gdef\parsearglinex #1^^M{\endgroup \next {#1}}}
  145. \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
  146. %% These are used to keep @begin/@end levels from running away
  147. %% Call \inENV within environments (after a \begingroup)
  148. \newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
  149. \def\ENVcheck{%
  150. \ifENV\errmessage{Still within an environment.  Type Return to continue.}
  151. \endgroup\fi} % This is not perfect, but it should reduce lossage
  152. % @begin foo  is the same as @foo, for now.
  153. \newhelp\EMsimple{Type <Return> to continue}
  154. \outer\def\begin{\parsearg\beginxxx}
  155. \def\beginxxx #1{%
  156. \expandafter\ifx\csname #1\endcsname\relax
  157. {\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else
  158. \csname #1\endcsname\fi}
  159. %% @end foo executes the definition of \Efoo.
  160. %% foo can be delimited by doublequotes or brackets.
  161. \def\end{\parsearg\endxxx}
  162. \def\endxxx #1{%
  163. \expandafter\ifx\csname E#1\endcsname\relax
  164. \expandafter\ifx\csname #1\endcsname\relax
  165. \errmessage{Undefined command @end #1}\else
  166. \errorE{#1}\fi\fi
  167. \csname E#1\endcsname}
  168. \def\errorE#1{
  169. {\errhelp=\EMsimple \errmessage{@end #1 not within #1 environment}}}
  170. % Single-spacing is done by various environments.
  171. \newskip\singlespaceskip \singlespaceskip = \baselineskip
  172. \def\singlespace{%
  173. {\advance \baselineskip by -\singlespaceskip
  174. \kern \baselineskip}%
  175. \baselineskip=\singlespaceskip
  176. %% Simple single-character @ commands
  177. % @@ prints an @
  178. % Kludge this until the fonts are right (grr).
  179. \def\@{{\tt \char '100}}
  180. % Define @` and @' to be the same as ` and '
  181. % but suppressing ligatures.
  182. \def\`{{`}}
  183. \def\'{{'}}
  184. % Used to generate quoted braces.
  185. \def\mylbrace {{\tt \char '173}}
  186. \def\myrbrace {{\tt \char '175}}
  187. \let\{=\mylbrace
  188. \let\}=\myrbrace
  189. % @: forces normal size whitespace following.
  190. \def\:{\spacefactor=1000 }
  191. % @* forces a line break.
  192. \def\*{\hfil\break\hbox{}\ignorespaces}
  193. % @. is an end-of-sentence period.
  194. \def\.{.\spacefactor=3000 }
  195. % @w prevents a word break.  Without the \leavevmode, @w at the
  196. % beginning of a paragraph, when TeX is still in vertical mode, would
  197. % produce a whole line of output instead of starting the paragraph.
  198. \def\w#1{\leavevmode\hbox{#1}}
  199. % @group ... @end group forces ... to be all on one page, by enclosing
  200. % it in a TeX vbox.  We use \vtop instead of \vbox to construct the box
  201. % to keep its height that of a normal line.  According to the rules for
  202. % \topskip (p.114 of the TeXbook), the glue inserted is
  203. % max (\topskip - \ht (first item), 0).  If that height is large,
  204. % therefore, no glue is inserted, and the space between the headline and
  205. % the text is small, which looks bad.
  206. \def\group{\begingroup
  207.   \ifnum\catcode13=\active \else
  208.     \errhelp = \groupinvalidhelp
  209.     \errmessage{@group invalid in context where filling is enabled}%
  210.   \fi
  211.   \def\Egroup{\egroup\endgroup}%
  212.   \vtop\bgroup
  213. % TeX puts in an \escapechar (i.e., `@') at the beginning of the help
  214. % message, so this ends up printing `@group can only ...'.
  215. \newhelp\groupinvalidhelp{%
  216. group can only be used in environments such as @example,^^J%
  217. where each line of input produces a line of output.}
  218. % @need space-in-mils
  219. % forces a page break if there is not space-in-mils remaining.
  220. \newdimen\mil  \mil=0.001in
  221. \def\need{\parsearg\needx}
  222. % Old definition--didn't work.
  223. %\def\needx #1{\par %
  224. %% This method tries to make TeX break the page naturally
  225. %% if the depth of the box does not fit.
  226. %{\baselineskip=0pt%
  227. %\vtop to #1\mil{\vfil}\kern -#1\mil\penalty 10000
  228. %\prevdepth=-1000pt
  229. \def\needx#1{%
  230.   % Go into vertical mode, so we don't make a big box in the middle of a
  231.   % paragraph.
  232.   \par
  233.   % Don't add any leading before our big empty box, but allow a page
  234.   % break, since the best break might be right here.
  235.   \allowbreak
  236.   \nointerlineskip
  237.   \vtop to #1\mil{\vfil}%
  238.   % TeX does not even consider page breaks if a penalty added to the
  239.   % main vertical list is 10000 or more.  But in order to see if the
  240.   % empty box we just added fits on the page, we must make it consider
  241.   % page breaks.  On the other hand, we don't want to actually break the
  242.   % page after the empty box.  So we use a penalty of 9999.
  243.   % There is an extremely small chance that TeX will actually break the
  244.   % page at this \penalty, if there are no other feasible breakpoints in
  245.   % sight.  (If the user is using lots of big @group commands, which
  246.   % almost-but-not-quite fill up a page, TeX will have a hard time doing
  247.   % good page breaking, for example.)  However, I could not construct an
  248.   % example where a page broke at this \penalty; if it happens in a real
  249.   % document, then we can reconsider our strategy.
  250.   \penalty9999
  251.   % Back up by the size of the box, whether we did a page break or not.
  252.   \kern -#1\mil
  253.   % Do not allow a page break right after this kern.
  254.   \nobreak
  255. % @br   forces paragraph break
  256. \let\br = \par
  257. % @dots{}  output some dots
  258. \def\dots{$\ldots$}
  259. % @page    forces the start of a new page
  260. \def\page{\par\vfill\supereject}
  261. % @exdent text....
  262. % outputs text on separate line in roman font, starting at standard page margin
  263. % This records the amount of indent in the innermost environment.
  264. % That's how much \exdent should take out.
  265. \newskip\exdentamount
  266. % This defn is used inside fill environments such as @defun.
  267. \def\exdent{\parsearg\exdentyyy}
  268. \def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}}
  269. % This defn is used inside nofill environments such as @example.
  270. \def\nofillexdent{\parsearg\nofillexdentyyy}
  271. \def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount
  272. \leftline{\hskip\leftskip{\rm#1}}}}
  273. %\hbox{{\rm#1}}\hfil\break}}
  274. % @include file    insert text of that file as input.
  275. \def\include{\parsearg\includezzz}
  276. \def\includezzz #1{{\def\thisfile{#1}\input #1
  277. \def\thisfile{}
  278. % @center line   outputs that line, centered
  279. \def\center{\parsearg\centerzzz}
  280. \def\centerzzz #1{{\advance\hsize by -\leftskip
  281. \advance\hsize by -\rightskip
  282. \centerline{#1}}}
  283. % @sp n   outputs n lines of vertical space
  284. \def\sp{\parsearg\spxxx}
  285. \def\spxxx #1{\par \vskip #1\baselineskip}
  286. % @comment ...line which is ignored...
  287. % @c is the same as @comment
  288. % @ignore ... @end ignore  is another way to write a comment
  289. \def\comment{\catcode 64=\other \catcode 123=\other \catcode 125=\other%
  290. \parsearg \commentxxx}
  291. \def\commentxxx #1{\catcode 64=0 \catcode 123=1 \catcode 125=2 }
  292. \let\c=\comment
  293. % Prevent errors for section commands.
  294. % Used in @ignore and in failing conditionals.
  295. \def\ignoresections{%
  296. \let\chapter=\relax
  297. \let\unnumbered=\relax
  298. \let\top=\relax
  299. \let\unnumberedsec=\relax
  300. \let\unnumberedsection=\relax
  301. \let\unnumberedsubsec=\relax
  302. \let\unnumberedsubsection=\relax
  303. \let\unnumberedsubsubsec=\relax
  304. \let\unnumberedsubsubsection=\relax
  305. \let\section=\relax
  306. \let\subsec=\relax
  307. \let\subsubsec=\relax
  308. \let\subsection=\relax
  309. \let\subsubsection=\relax
  310. \let\appendix=\relax
  311. \let\appendixsec=\relax
  312. \let\appendixsection=\relax
  313. \let\appendixsubsec=\relax
  314. \let\appendixsubsection=\relax
  315. \let\appendixsubsubsec=\relax
  316. \let\appendixsubsubsection=\relax
  317. \let\contents=\relax
  318. \let\smallbook=\relax
  319. \let\titlepage=\relax
  320. \def\ignore{\begingroup\ignoresections
  321. % Make sure that spaces turn into tokens that match what \ignorexxx wants.
  322. \catcode32=10
  323. \ignorexxx}
  324. \long\def\ignorexxx #1\end ignore{\endgroup\ignorespaces}
  325. \def\direntry{\begingroup\direntryxxx}
  326. \long\def\direntryxxx #1\end direntry{\endgroup\ignorespaces}
  327. % Conditionals to test whether a flag is set.
  328. \def\ifset{\begingroup\ignoresections\parsearg\ifsetxxx}
  329. \def\ifsetxxx #1{\endgroup
  330. \expandafter\ifx\csname IF#1\endcsname\relax \let\temp=\ifsetfail
  331. \else \let\temp=\relax \fi
  332. \temp}
  333. \def\Eifset{}
  334. \def\ifsetfail{\begingroup\ignoresections\ifsetfailxxx}
  335. \long\def\ifsetfailxxx #1\end ifset{\endgroup\ignorespaces}
  336. \def\ifclear{\begingroup\ignoresections\parsearg\ifclearxxx}
  337. \def\ifclearxxx #1{\endgroup
  338. \expandafter\ifx\csname IF#1\endcsname\relax \let\temp=\relax
  339. \else \let\temp=\ifclearfail \fi
  340. \temp}
  341. \def\Eifclear{}
  342. \def\ifclearfail{\begingroup\ignoresections\ifclearfailxxx}
  343. \long\def\ifclearfailxxx #1\end ifclear{\endgroup\ignorespaces}
  344. % @set foo     to set the flag named foo.
  345. % @clear foo   to clear the flag named foo.
  346. \def\set{\parsearg\setxxx}
  347. \def\setxxx #1{
  348. \expandafter\let\csname IF#1\endcsname=\set}
  349. \def\clear{\parsearg\clearxxx}
  350. \def\clearxxx #1{
  351. \expandafter\let\csname IF#1\endcsname=\relax}
  352. % Some texinfo constructs that are trivial in tex
  353. \def\iftex{}
  354. \def\Eiftex{}
  355. \def\ifinfo{\begingroup\ignoresections\ifinfoxxx}
  356. \long\def\ifinfoxxx #1\end ifinfo{\endgroup\ignorespaces}
  357. \long\def\menu #1\end menu{}
  358. \def\asis#1{#1}
  359. % @math means output in math mode.
  360. % We don't use $'s directly in the definition of \math because control
  361. % sequences like \math are expanded when the toc file is written.  Then,
  362. % we read the toc file back, the $'s will be normal characters (as they
  363. % should be, according to the definition of Texinfo).  So we must use a
  364. % control sequence to switch into and out of math mode.
  365. % This isn't quite enough for @math to work properly in indices, but it
  366. % seems unlikely it will ever be needed there.
  367. \let\implicitmath = $
  368. \def\math#1{\implicitmath #1\implicitmath}
  369. \def\node{\ENVcheck\parsearg\nodezzz}
  370. \def\nodezzz#1{\nodexxx [#1,]}
  371. \def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
  372. \let\lastnode=\relax
  373. \def\donoderef{\ifx\lastnode\relax\else
  374. \expandafter\expandafter\expandafter\setref{\lastnode}\fi
  375. \let\lastnode=\relax}
  376. \def\unnumbnoderef{\ifx\lastnode\relax\else
  377. \expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi
  378. \let\lastnode=\relax}
  379. \def\appendixnoderef{\ifx\lastnode\relax\else
  380. \expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi
  381. \let\lastnode=\relax}
  382. \let\refill=\relax
  383. % @setfilename is done at the beginning of every texinfo file.
  384. % So open here the files we need to have open while reading the input.
  385. % This makes it possible to make a .fmt file for texinfo.
  386. \def\setfilename{%
  387.    \readauxfile
  388.    \opencontents
  389.    \openindices
  390.    \fixbackslash  % Turn off hack to swallow `\input texinfo'.
  391.    \global\let\setfilename=\comment % Ignore extra @setfilename cmds.
  392.    \comment % Ignore the actual filename.
  393. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
  394. \def\inforef #1{\inforefzzz #1,,,,**}
  395. \def\inforefzzz #1,#2,#3,#4**{See Info file \file{\losespace#3{}},
  396.   node \samp{\losespace#1{}}}
  397. \def\losespace #1{#1}
  398. \message{fonts,}
  399. % Font-change commands.
  400. % Texinfo supports the sans serif font style, which plain TeX does not.
  401. % So we set up a \sf analogous to plain's \rm, etc.
  402. \newfam\sffam
  403. \def\sf{\fam=\sffam \tensf}
  404. \let\li = \sf % Sometimes we call it \li, not \sf.
  405. %% Try out Computer Modern fonts at \magstephalf
  406. \let\mainmagstep=\magstephalf
  407. \ifx\bigger\relax
  408. \let\mainmagstep=\magstep1
  409. \font\textrm=cmr12
  410. \font\texttt=cmtt12
  411. \else
  412. \font\textrm=cmr10 scaled \mainmagstep
  413. \font\texttt=cmtt10 scaled \mainmagstep
  414. % Instead of cmb10, you many want to use cmbx10.
  415. % cmbx10 is a prettier font on its own, but cmb10
  416. % looks better when embedded in a line with cmr10.
  417. \font\textbf=cmb10 scaled \mainmagstep 
  418. \font\textit=cmti10 scaled \mainmagstep
  419. \font\textsl=cmsl10 scaled \mainmagstep
  420. \font\textsf=cmss10 scaled \mainmagstep
  421. \font\textsc=cmcsc10 scaled \mainmagstep
  422. \font\texti=cmmi10 scaled \mainmagstep
  423. \font\textsy=cmsy10 scaled \mainmagstep
  424. % A few fonts for @defun, etc.
  425. \font\defbf=cmbx10 scaled \magstep1 %was 1314
  426. \font\deftt=cmtt10 scaled \magstep1
  427. \def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf}
  428. % Fonts for indices and small examples.
  429. % We actually use the slanted font rather than the italic, 
  430. % because texinfo normally uses the slanted fonts for that.
  431. % Do not make many font distinctions in general in the index, since they
  432. % aren't very useful.
  433. \font\ninett=cmtt9
  434. \font\indrm=cmr9
  435. \font\indit=cmsl9
  436. \let\indsl=\indit
  437. \let\indtt=\ninett
  438. \let\indsf=\indrm
  439. \let\indbf=\indrm
  440. \let\indsc=\indrm
  441. \font\indi=cmmi9
  442. \font\indsy=cmsy9
  443. % Fonts for headings
  444. \font\chaprm=cmbx12 scaled \magstep2
  445. \font\chapit=cmti12 scaled \magstep2
  446. \font\chapsl=cmsl12 scaled \magstep2
  447. \font\chaptt=cmtt12 scaled \magstep2
  448. \font\chapsf=cmss12 scaled \magstep2
  449. \let\chapbf=\chaprm
  450. \font\chapsc=cmcsc10 scaled\magstep3
  451. \font\chapi=cmmi12 scaled \magstep2
  452. \font\chapsy=cmsy10 scaled \magstep3
  453. \font\secrm=cmbx12 scaled \magstep1
  454. \font\secit=cmti12 scaled \magstep1
  455. \font\secsl=cmsl12 scaled \magstep1
  456. \font\sectt=cmtt12 scaled \magstep1
  457. \font\secsf=cmss12 scaled \magstep1
  458. \font\secbf=cmbx12 scaled \magstep1
  459. \font\secsc=cmcsc10 scaled\magstep2
  460. \font\seci=cmmi12 scaled \magstep1
  461. \font\secsy=cmsy10 scaled \magstep2
  462. % \font\ssecrm=cmbx10 scaled \magstep1    % This size an font looked bad.
  463. % \font\ssecit=cmti10 scaled \magstep1    % The letters were too crowded.
  464. % \font\ssecsl=cmsl10 scaled \magstep1
  465. % \font\ssectt=cmtt10 scaled \magstep1
  466. % \font\ssecsf=cmss10 scaled \magstep1
  467. %\font\ssecrm=cmb10 scaled 1315    % Note the use of cmb rather than cmbx.
  468. %\font\ssecit=cmti10 scaled 1315    % Also, the size is a little larger than
  469. %\font\ssecsl=cmsl10 scaled 1315    % being scaled magstep1.
  470. %\font\ssectt=cmtt10 scaled 1315
  471. %\font\ssecsf=cmss10 scaled 1315
  472. %\let\ssecbf=\ssecrm
  473. \font\ssecrm=cmbx12 scaled \magstephalf
  474. \font\ssecit=cmti12 scaled \magstephalf
  475. \font\ssecsl=cmsl12 scaled \magstephalf
  476. \font\ssectt=cmtt12 scaled \magstephalf
  477. \font\ssecsf=cmss12 scaled \magstephalf
  478. \font\ssecbf=cmbx12 scaled \magstephalf
  479. \font\ssecsc=cmcsc10 scaled \magstep1 
  480. \font\sseci=cmmi12 scaled \magstephalf
  481. \font\ssecsy=cmsy10 scaled \magstep1
  482. % The smallcaps and symbol fonts should actually be scaled \magstep1.5,
  483. % but that is not a standard magnification.
  484. % Fonts for title page:
  485. \font\titlerm = cmbx12 scaled \magstep3
  486. \let\authorrm = \secrm
  487. % In order for the font changes to affect most math symbols and letters,
  488. % we have to define the \textfont of the standard families.  Since
  489. % texinfo doesn't allow for producing subscripts and superscripts, we
  490. % don't bother to reset \scriptfont and \scriptscriptfont (which would
  491. % also require loading a lot more fonts).
  492. \def\resetmathfonts{%
  493.   \textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy
  494.   \textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf
  495.   \textfont\ttfam = \tentt \textfont\sffam = \tensf
  496. % The font-changing commands redefine the meanings of \tenSTYLE, instead
  497. % of just \STYLE.  We do this so that font changes will continue to work
  498. % in math mode, where it is the current \fam that is relevant in most
  499. % cases, not the current.  Plain TeX does, for example,
  500. % \def\bf{\fam=\bffam \tenbf}  By redefining \tenbf, we obviate the need
  501. % to redefine \bf itself.  
  502. \def\textfonts{%
  503.   \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
  504.   \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
  505.   \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
  506.   \resetmathfonts}
  507. \def\chapfonts{%
  508.   \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl 
  509.   \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
  510.   \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
  511.   \resetmathfonts}
  512. \def\secfonts{%
  513.   \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
  514.   \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
  515.   \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
  516.   \resetmathfonts}
  517. \def\subsecfonts{%
  518.   \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
  519.   \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
  520.   \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
  521.   \resetmathfonts}
  522. \def\indexfonts{%
  523.   \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl
  524.   \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc
  525.   \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy
  526.   \resetmathfonts}
  527. % Set up the default fonts, so we can use them for creating boxes.
  528. \textfonts
  529. % Count depth in font-changes, for error checks
  530. \newcount\fontdepth \fontdepth=0
  531. % Fonts for short table of contents.
  532. \font\shortcontrm=cmr12
  533. \font\shortcontbf=cmbx12
  534. \font\shortcontsl=cmsl12
  535. %% Add scribe-like font environments, plus @l for inline lisp (usually sans
  536. %% serif) and @ii for TeX italic
  537. % \smartitalic{ARG} outputs arg in italics, followed by an italic correction
  538. % unless the following character is such as not to need one.
  539. \def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
  540. \def\smartitalic#1{{\sl #1}\futurelet\next\smartitalicx}
  541. \let\i=\smartitalic
  542. \let\var=\smartitalic
  543. \let\dfn=\smartitalic
  544. \let\emph=\smartitalic
  545. \let\cite=\smartitalic
  546. \def\b#1{{\bf #1}}
  547. \let\strong=\b
  548. \def\t#1{{\tt \exhyphenpenalty=10000\rawbackslash \frenchspacing #1}\null}
  549. \let\ttfont = \t
  550. %\def\samp #1{`{\tt \rawbackslash \frenchspacing #1}'\null}
  551. \def\samp #1{`\tclose{#1}'\null}
  552. \def\key #1{{\tt \exhyphenpenalty=10000\uppercase{#1}}\null}
  553. \def\ctrl #1{{\tt \rawbackslash \hat}#1}
  554. \let\file=\samp
  555. % @code is a modification of @t,
  556. % which makes spaces the same size as normal in the surrounding text.
  557. \newdimen\tclosesave
  558. \newdimen\tcloserm
  559. \def\tclose#1{{\rm \tcloserm=\fontdimen2\font \tt \tclosesave=\fontdimen2\font
  560. \fontdimen2\font=\tcloserm
  561. % prevent breaking lines at hyphens.
  562. \exhyphenpenalty=10000
  563. \def\ {{\fontdimen2\font=\tclosesave{} }}%
  564.  \rawbackslash \frenchspacing #1\fontdimen2\font=\tclosesave}\null}
  565. \let\code=\tclose
  566. %\let\exp=\tclose  %Was temporary
  567. % @kbd is like @code, except that if the argument is just one @key command, 
  568. % then @kbd has no effect.
  569. \def\xkey{\key}
  570. \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
  571. \ifx\one\xkey\ifx\threex\three \key{#2}%
  572. \else\tclose{\look}\fi
  573. \else\tclose{\look}\fi}
  574. % Typeset a dimension, e.g., `in' or `pt'.  The only reason for the
  575. % argument is to make the input look right: @dmn{pt} instead of
  576. % @dmn{}pt.
  577. \def\dmn#1{\thinspace #1}
  578. \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}
  579. \def\l#1{{\li #1}\null}        % 
  580. \def\r#1{{\rm #1}}        % roman font
  581. % Use of \lowercase was suggested.
  582. \def\sc#1{{\smallcaps#1}}    % smallcaps font
  583. \def\ii#1{{\it #1}}        % italic font
  584. \message{page headings,}
  585. \newskip\titlepagetopglue \titlepagetopglue = 1.5in
  586. \newskip\titlepagebottomglue \titlepagebottomglue = 2pc
  587. % First the title page.  Must do @settitle before @titlepage.
  588. \def\titlefont#1{{\titlerm #1}}
  589. \newtoks\realeverypar
  590. \newif\ifseenauthor
  591. \newif\iffinishedtitlepage
  592. \def\titlepage{\begingroup \parindent=0pt \textfonts
  593.    \let\subtitlerm=\tenrm
  594. % I deinstalled the following change because \cmr12 is undefined.
  595. % This change was not in the ChangeLog anyway.  --rms.
  596. %   \let\subtitlerm=\cmr12
  597.    \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
  598.    \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}%
  599.    % Leave some space at the very top of the page.
  600.    \vglue\titlepagetopglue
  601.    % Now you can print the title using @title.
  602.    \def\title{\parsearg\titlezzz}%
  603.    \def\titlezzz##1{\leftline{\titlefont{##1}}
  604.             % print a rule at the page bottom also.
  605.             \finishedtitlepagefalse
  606.             \vskip4pt \hrule height 4pt \vskip4pt}%
  607.    % No rule at page bottom unless we print one at the top with @title.
  608.    \finishedtitlepagetrue
  609.    % Now you can put text using @subtitle.
  610.    \def\subtitle{\parsearg\subtitlezzz}%
  611.    \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}%
  612.    % @author should come last, but may come many times.
  613.    \def\author{\parsearg\authorzzz}%
  614.    \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi
  615.       {\authorfont \leftline{##1}}}%
  616.    %  
  617.    % Most title ``pages'' are actually two pages long, with space
  618.    % at the top of the second.  We don't want the ragged left on the second.
  619.    \let\oldpage = \page
  620.    \def\page{%
  621.       \iffinishedtitlepage\else
  622.      \finishtitlepage
  623.       \fi
  624.       \oldpage
  625.       \let\page = \oldpage
  626.       \hbox{}}%
  627. %   \def\page{\oldpage \hbox{}}
  628. \def\Etitlepage{%
  629.    \iffinishedtitlepage\else
  630.       \finishtitlepage
  631.    \fi
  632.    % It is important to do the page break before ending the group,
  633.    % because the headline and footline are only empty inside the group.
  634.    % If we use the new definition of \page, we always get a blank page
  635.    % after the title page, which we certainly don't want.
  636.    \oldpage
  637.    \endgroup
  638.    \HEADINGSon
  639. \def\finishtitlepage{%
  640.    \vskip4pt \hrule height 2pt
  641.    \vskip\titlepagebottomglue
  642.    \finishedtitlepagetrue
  643. %%% Set up page headings and footings.
  644. \let\thispage=\folio
  645. \newtoks \evenheadline    % Token sequence for heading line of even pages
  646. \newtoks \oddheadline     % Token sequence for heading line of odd pages
  647. \newtoks \evenfootline    % Token sequence for footing line of even pages
  648. \newtoks \oddfootline     % Token sequence for footing line of odd pages
  649. % Now make Tex use those variables
  650. \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
  651.                             \else \the\evenheadline \fi}}
  652. \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
  653.                             \else \the\evenfootline \fi}\HEADINGShook}
  654. \let\HEADINGShook=\relax
  655. % Commands to set those variables.
  656. % For example, this is what  @headings on  does
  657. % @evenheading @thistitle|@thispage|@thischapter
  658. % @oddheading @thischapter|@thispage|@thistitle
  659. % @evenfooting @thisfile||
  660. % @oddfooting ||@thisfile
  661. \def\evenheading{\parsearg\evenheadingxxx}
  662. \def\oddheading{\parsearg\oddheadingxxx}
  663. \def\everyheading{\parsearg\everyheadingxxx}
  664. \def\evenfooting{\parsearg\evenfootingxxx}
  665. \def\oddfooting{\parsearg\oddfootingxxx}
  666. \def\everyfooting{\parsearg\everyfootingxxx}
  667. {\catcode`\@=0 %
  668. \gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish}
  669. \gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{%
  670. \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  671. \gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish}
  672. \gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{%
  673. \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  674. \gdef\everyheadingxxx #1{\everyheadingyyy #1@|@|@|@|\finish}
  675. \gdef\everyheadingyyy #1@|#2@|#3@|#4\finish{%
  676. \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
  677. \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  678. \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish}
  679. \gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{%
  680. \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  681. \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish}
  682. \gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{%
  683. \global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  684. \gdef\everyfootingxxx #1{\everyfootingyyy #1@|@|@|@|\finish}
  685. \gdef\everyfootingyyy #1@|#2@|#3@|#4\finish{%
  686. \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
  687. \global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  688. }% unbind the catcode of @.
  689. % @headings double    turns headings on for double-sided printing.
  690. % @headings single    turns headings on for single-sided printing.
  691. % @headings off        turns them off.
  692. % @headings on        same as @headings double, retained for compatibility.
  693. % @headings after    turns on double-sided headings after this page.
  694. % @headings doubleafter    turns on double-sided headings after this page.
  695. % @headings singleafter turns on single-sided headings after this page.
  696. % By default, they are off.
  697. \def\headings #1 {\csname HEADINGS#1\endcsname}
  698. \def\HEADINGSoff{
  699. \global\evenheadline={\hfil} \global\evenfootline={\hfil}
  700. \global\oddheadline={\hfil} \global\oddfootline={\hfil}}
  701. \HEADINGSoff
  702. % When we turn headings on, set the page number to 1.
  703. % For double-sided printing, put current file name in lower left corner,
  704. % chapter name on inside top of right hand pages, document
  705. % title on inside top of left hand pages, and page numbers on outside top
  706. % edge of all pages.
  707. \def\HEADINGSdouble{
  708. %\pagealignmacro
  709. \global\pageno=1
  710. \global\evenfootline={\hfil}
  711. \global\oddfootline={\hfil}
  712. \global\evenheadline={\line{\folio\hfil\thistitle}}
  713. \global\oddheadline={\line{\thischapter\hfil\folio}}
  714. % For single-sided printing, chapter title goes across top left of page,
  715. % page number on top right.
  716. \def\HEADINGSsingle{
  717. %\pagealignmacro
  718. \global\pageno=1
  719. \global\evenfootline={\hfil}
  720. \global\oddfootline={\hfil}
  721. \global\evenheadline={\line{\thischapter\hfil\folio}}
  722. \global\oddheadline={\line{\thischapter\hfil\folio}}
  723. \def\HEADINGSon{\HEADINGSdouble}
  724. \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
  725. \let\HEADINGSdoubleafter=\HEADINGSafter
  726. \def\HEADINGSdoublex{%
  727. \global\evenfootline={\hfil}
  728. \global\oddfootline={\hfil}
  729. \global\evenheadline={\line{\folio\hfil\thistitle}}
  730. \global\oddheadline={\line{\thischapter\hfil\folio}}
  731. \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
  732. \def\HEADINGSsinglex{%
  733. \global\evenfootline={\hfil}
  734. \global\oddfootline={\hfil}
  735. \global\evenheadline={\line{\thischapter\hfil\folio}}
  736. \global\oddheadline={\line{\thischapter\hfil\folio}}
  737. % Subroutines used in generating headings
  738. % Produces Day Month Year style of output.
  739. \def\today{\number\day\space
  740. \ifcase\month\or
  741. January\or February\or March\or April\or May\or June\or
  742. July\or August\or September\or October\or November\or December\fi
  743. \space\number\year}
  744. % Use this if you want the Month Day, Year style of output.
  745. %\def\today{\ifcase\month\or
  746. %January\or February\or March\or April\or May\or June\or
  747. %July\or August\or September\or October\or November\or December\fi
  748. %\space\number\day, \number\year}
  749. % @settitle line...  specifies the title of the document, for headings
  750. % It generates no output of its own
  751. \def\thistitle{No Title}
  752. \def\settitle{\parsearg\settitlezzz}
  753. \def\settitlezzz #1{\gdef\thistitle{#1}}
  754. \message{tables,}
  755. % @tabs -- simple alignment
  756. % These don't work.  For one thing, \+ is defined as outer.
  757. % So these macros cannot even be defined.
  758. %\def\tabs{\parsearg\tabszzz}
  759. %\def\tabszzz #1{\settabs\+#1\cr}
  760. %\def\tabline{\parsearg\tablinezzz}
  761. %\def\tablinezzz #1{\+#1\cr}
  762. %\def\&{&}
  763. % Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
  764. % default indentation of table text
  765. \newdimen\tableindent \tableindent=.8in
  766. % default indentation of @itemize and @enumerate text
  767. \newdimen\itemindent  \itemindent=.3in
  768. % margin between end of table item and start of table text.
  769. \newdimen\itemmargin  \itemmargin=.1in
  770. % used internally for \itemindent minus \itemmargin
  771. \newdimen\itemmax
  772. % Note @table, @vtable, and @vtable define @item, @itemx, etc., with
  773. % these defs.
  774. % They also define \itemindex
  775. % to index the item name in whatever manner is desired (perhaps none).
  776. \def\internalBitem{\smallbreak \parsearg\itemzzz}
  777. \def\internalBitemx{\par \parsearg\itemzzz}
  778. \def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
  779. \def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \par \parsearg\xitemzzz}
  780. \def\internalBkitem{\smallbreak \parsearg\kitemzzz}
  781. \def\internalBkitemx{\par \parsearg\kitemzzz}
  782. \def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}%
  783.                  \itemzzz {#1}}
  784. \def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}%
  785.                  \itemzzz {#1}}
  786. \def\itemzzz #1{\begingroup %
  787.   \advance\hsize by -\rightskip
  788.   \advance\hsize by -\tableindent
  789.   \setbox0=\hbox{\itemfont{#1}}%
  790.   \itemindex{#1}%
  791.   \nobreak % This prevents a break before @itemx.
  792.   % Be sure we are not still in the middle of a paragraph.
  793.   \parskip=0in
  794.   \par
  795.   % If the item text does not fit in the space we have, put it on a line
  796.   % by itself, and do not allow a page break either before or after that
  797.   % line.  We do not start a paragraph here because then if the next
  798.   % command is, e.g., @kindex, the whatsit would get put into the
  799.   % horizontal list on a line by itself, resulting in extra blank space.
  800.   \ifdim \wd0>\itemmax
  801.     \setbox0=\hbox{\hskip \leftskip \hskip -\tableindent \unhbox0}\box0
  802.     \nobreak
  803.   \else
  804.     % The item text fits into the space.  Start a paragraph, so that the
  805.     % following text (if any) will end up on the same line.  Since that
  806.     % text will be indented by \tableindent, we make the item text be in
  807.     % a zero-width box.
  808.     \noindent
  809.     \rlap{\hskip -\tableindent\box0}%
  810.   \fi
  811.   \endgroup
  812. \def\item{\errmessage{@item while not in a table}}
  813. \def\itemx{\errmessage{@itemx while not in a table}}
  814. \def\kitem{\errmessage{@kitem while not in a table}}
  815. \def\kitemx{\errmessage{@kitemx while not in a table}}
  816. \def\xitem{\errmessage{@xitem while not in a table}}
  817. \def\xitemx{\errmessage{@xitemx while not in a table}}
  818. %% Contains a kludge to get @end[description] to work
  819. \def\description{\tablez{\dontindex}{1}{}{}{}{}}
  820. \def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
  821. {\obeylines\obeyspaces%
  822. \gdef\tablex #1^^M{%
  823. \tabley\dontindex#1        \endtabley}}
  824. \def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
  825. {\obeylines\obeyspaces%
  826. \gdef\ftablex #1^^M{%
  827. \tabley\fnitemindex#1        \endtabley
  828. \def\Eftable{\endgraf\endgroup\afterenvbreak}%
  829. \let\Etable=\relax}}
  830. \def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex}
  831. {\obeylines\obeyspaces%
  832. \gdef\vtablex #1^^M{%
  833. \tabley\vritemindex#1        \endtabley
  834. \def\Evtable{\endgraf\endgroup\afterenvbreak}%
  835. \let\Etable=\relax}}
  836. \def\dontindex #1{}
  837. \def\fnitemindex #1{\doind {fn}{\code{#1}}}%
  838. \def\vritemindex #1{\doind {vr}{\code{#1}}}%
  839. {\obeyspaces %
  840. \gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
  841. \tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
  842. \def\tablez #1#2#3#4#5#6{%
  843. \aboveenvbreak %
  844. \begingroup %
  845. \def\Edescription{\Etable}% Neccessary kludge.
  846. \let\itemindex=#1%
  847. \ifnum 0#3>0 \advance \leftskip by #3\mil \fi %
  848. \ifnum 0#4>0 \tableindent=#4\mil \fi %
  849. \ifnum 0#5>0 \advance \rightskip by #5\mil \fi %
  850. \def\itemfont{#2}%
  851. \itemmax=\tableindent %
  852. \advance \itemmax by -\itemmargin %
  853. \advance \leftskip by \tableindent %
  854. \exdentamount=\tableindent
  855. \parindent = 0pt
  856. \parskip = \smallskipamount
  857. \ifdim \parskip=0pt \parskip=2pt \fi%
  858. \def\Etable{\endgraf\endgroup\afterenvbreak}%
  859. \let\item = \internalBitem %
  860. \let\itemx = \internalBitemx %
  861. \let\kitem = \internalBkitem %
  862. \let\kitemx = \internalBkitemx %
  863. \let\xitem = \internalBxitem %
  864. \let\xitemx = \internalBxitemx %
  865. % This is the counter used by @enumerate, which is really @itemize
  866. \newcount \itemno
  867. \def\itemize{\parsearg\itemizezzz}
  868. \def\itemizezzz #1{%
  869.   \begingroup % ended by the @end itemsize
  870.   \itemizey {#1}{\Eitemize}
  871. \def\itemizey #1#2{%
  872. \aboveenvbreak %
  873. \itemmax=\itemindent %
  874. \advance \itemmax by -\itemmargin %
  875. \advance \leftskip by \itemindent %
  876. \exdentamount=\itemindent
  877. \parindent = 0pt %
  878. \parskip = \smallskipamount %
  879. \ifdim \parskip=0pt \parskip=2pt \fi%
  880. \def#2{\endgraf\endgroup\afterenvbreak}%
  881. \def\itemcontents{#1}%
  882. \let\item=\itemizeitem}
  883. \def\bullet{$\ptexbullet$}
  884. \def\minus{$-$}
  885. % Set sfcode to normal for the chars that usually have another value.
  886. % These are `.?!:;,'
  887. \def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000
  888.   \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 }
  889. % \splitoff TOKENS\endmark defines \first to be the first token in
  890. % TOKENS, and \rest to be the remainder.
  891. \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
  892. % Allow an optional argument of an uppercase letter, lowercase letter,
  893. % or number, to specify the first label in the enumerated list.  No
  894. % argument is the same as `1'.
  895. \def\enumerate{\parsearg\enumeratezzz}
  896. \def\enumeratezzz #1{\enumeratey #1  \endenumeratey}
  897. \def\enumeratey #1 #2\endenumeratey{%
  898.   \begingroup % ended by the @end enumerate
  899.   % If we were given no argument, pretend we were given `1'.
  900.   \def\thearg{#1}%
  901.   \ifx\thearg\empty \def\thearg{1}\fi
  902.   % Detect if the argument is a single token.  If so, it might be a
  903.   % letter.  Otherwise, the only valid thing it can be is a number.
  904.   % (We will always have one token, because of the test we just made.
  905.   % This is a good thing, since \splitoff doesn't work given nothing at
  906.   % all -- the first parameter is undelimited.)
  907.   \expandafter\splitoff\thearg\endmark
  908.   \ifx\rest\empty
  909.     % Only one token in the argument.  It could still be anything.
  910.     % A ``lowercase letter'' is one whose \lccode is nonzero.
  911.     % An ``uppercase letter'' is one whose \lccode is both nonzero, and
  912.     %   not equal to itself.
  913.     % Otherwise, we assume it's a number.
  914.     % 
  915.     % We need the \relax at the end of the \ifnum lines to stop TeX from
  916.     % continuing to look for a <number>.
  917.     % 
  918.     \ifnum\lccode\expandafter`\thearg=0\relax 
  919.       \numericenumerate % a number (we hope)
  920.     \else
  921.       % It's a letter.
  922.       \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
  923.         \lowercaseenumerate % lowercase letter
  924.       \else
  925.         \uppercaseenumerate % uppercase letter
  926.       \fi
  927.     \fi
  928.   \else
  929.     % Multiple tokens in the argument.  We hope it's a number.
  930.     \numericenumerate
  931.   \fi
  932. % An @enumerate whose labels are integers.  The starting integer is
  933. % given in \thearg.
  934. \def\numericenumerate{%
  935.   \itemno = \thearg
  936.   \startenumeration{\the\itemno}%
  937. % The starting (lowercase) letter is in \thearg.
  938. \def\lowercaseenumerate{%
  939.   \itemno = \expandafter`\thearg
  940.   \startenumeration{%
  941.     % Be sure we're not beyond the end of the alphabet.
  942.     \ifnum\itemno=0
  943.       \errmessage{No more lowercase letters in @enumerate; get a bigger
  944.                   alphabet}%
  945.     \fi
  946.     \char\lccode\itemno
  947. % The starting (uppercase) letter is in \thearg.
  948. \def\uppercaseenumerate{%
  949.   \itemno = \expandafter`\thearg
  950.   \startenumeration{%
  951.     % Be sure we're not beyond the end of the alphabet.
  952.     \ifnum\itemno=0
  953.       \errmessage{No more uppercase letters in @enumerate; get a bigger
  954.                   alphabet}
  955.     \fi
  956.     \char\uccode\itemno
  957. % Call itemizey, adding a period to the first argument and supplying the
  958. % common last two arguments.  Also subtract one from the initial value in
  959. % \itemno, since @item increments \itemno.
  960. \def\startenumeration#1{%
  961.   \advance\itemno by -1
  962.   \itemizey{#1.}\Eenumerate\flushcr
  963. % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
  964. % to @enumerate.
  965. \def\alphaenumerate{\enumerate{a}}
  966. \def\capsenumerate{\enumerate{A}}
  967. \def\Ealphaenumerate{\Eenumerate}
  968. \def\Ecapsenumerate{\Eenumerate}
  969. % Definition of @item while inside @itemize.
  970. \def\itemizeitem{%
  971. \advance\itemno by 1
  972. {\let\par=\endgraf \smallbreak}%
  973. \ifhmode \errmessage{\in hmode at itemizeitem}\fi
  974. {\parskip=0in \hskip 0pt
  975. \hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
  976. \vadjust{\penalty 1200}}%
  977. \flushcr}
  978. \message{indexing,}
  979. % Index generation facilities
  980. % Define \newwrite to be identical to plain tex's \newwrite
  981. % except not \outer, so it can be used within \newindex.
  982. {\catcode`\@=11
  983. \gdef\newwrite{\alloc@7\write\chardef\sixt@@n}}
  984. % \newindex {foo} defines an index named foo.
  985. % It automatically defines \fooindex such that
  986. % \fooindex ...rest of line... puts an entry in the index foo.
  987. % It also defines \fooindfile to be the number of the output channel for
  988. % the file that    accumulates this index.  The file's extension is foo.
  989. % The name of an index should be no more than 2 characters long
  990. % for the sake of vms.
  991. \def\newindex #1{
  992. \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
  993. \openout \csname#1indfile\endcsname \jobname.#1    % Open the file
  994. \expandafter\xdef\csname#1index\endcsname{%    % Define \xxxindex
  995. \noexpand\doindex {#1}}
  996. % @defindex foo  ==  \newindex{foo}
  997. \def\defindex{\parsearg\newindex}
  998. % Define @defcodeindex, like @defindex except put all entries in @code.
  999. \def\newcodeindex #1{
  1000. \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
  1001. \openout \csname#1indfile\endcsname \jobname.#1    % Open the file
  1002. \expandafter\xdef\csname#1index\endcsname{%    % Define \xxxindex
  1003. \noexpand\docodeindex {#1}}
  1004. \def\defcodeindex{\parsearg\newcodeindex}
  1005. % @synindex foo bar    makes index foo feed into index bar.
  1006. % Do this instead of @defindex foo if you don't want it as a separate index.
  1007. \def\synindex #1 #2 {%
  1008. \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
  1009. \expandafter\let\csname#1indfile\endcsname=\synindexfoo
  1010. \expandafter\xdef\csname#1index\endcsname{%    % Define \xxxindex
  1011. \noexpand\doindex {#2}}%
  1012. % @syncodeindex foo bar   similar, but put all entries made for index foo
  1013. % inside @code.
  1014. \def\syncodeindex #1 #2 {%
  1015. \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
  1016. \expandafter\let\csname#1indfile\endcsname=\synindexfoo
  1017. \expandafter\xdef\csname#1index\endcsname{%    % Define \xxxindex
  1018. \noexpand\docodeindex {#2}}%
  1019. % Define \doindex, the driver for all \fooindex macros.
  1020. % Argument #1 is generated by the calling \fooindex macro,
  1021. %  and it is "foo", the name of the index.
  1022. % \doindex just uses \parsearg; it calls \doind for the actual work.
  1023. % This is because \doind is more useful to call from other macros.
  1024. % There is also \dosubind {index}{topic}{subtopic}
  1025. % which makes an entry in a two-level index such as the operation index.
  1026. \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
  1027. \def\singleindexer #1{\doind{\indexname}{#1}}
  1028. % like the previous two, but they put @code around the argument.
  1029. \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
  1030. \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
  1031. \def\indexdummies{%
  1032. \def\_{{\realbackslash _}}%
  1033. \def\w{\realbackslash w }%
  1034. \def\bf{\realbackslash bf }%
  1035. \def\rm{\realbackslash rm }%
  1036. \def\sl{\realbackslash sl }%
  1037. \def\sf{\realbackslash sf}%
  1038. \def\tt{\realbackslash tt}%
  1039. \def\gtr{\realbackslash gtr}%
  1040. \def\less{\realbackslash less}%
  1041. \def\hat{\realbackslash hat}%
  1042. \def\char{\realbackslash char}%
  1043. \def\TeX{\realbackslash TeX}%
  1044. \def\dots{\realbackslash dots }%
  1045. \def\copyright{\realbackslash copyright }%
  1046. \def\tclose##1{\realbackslash tclose {##1}}%
  1047. \def\code##1{\realbackslash code {##1}}%
  1048. \def\samp##1{\realbackslash samp {##1}}%
  1049. \def\t##1{\realbackslash r {##1}}%
  1050. \def\r##1{\realbackslash r {##1}}%
  1051. \def\i##1{\realbackslash i {##1}}%
  1052. \def\b##1{\realbackslash b {##1}}%
  1053. \def\cite##1{\realbackslash cite {##1}}%
  1054. \def\key##1{\realbackslash key {##1}}%
  1055. \def\file##1{\realbackslash file {##1}}%
  1056. \def\var##1{\realbackslash var {##1}}%
  1057. \def\kbd##1{\realbackslash kbd {##1}}%
  1058. % \indexnofonts no-ops all font-change commands.
  1059. % This is used when outputting the strings to sort the index by.
  1060. \def\indexdummyfont#1{#1}
  1061. \def\indexdummytex{TeX}
  1062. \def\indexdummydots{...}
  1063. \def\indexnofonts{%
  1064. \let\w=\indexdummyfont
  1065. \let\t=\indexdummyfont
  1066. \let\r=\indexdummyfont
  1067. \let\i=\indexdummyfont
  1068. \let\b=\indexdummyfont
  1069. \let\emph=\indexdummyfont
  1070. \let\strong=\indexdummyfont
  1071. \let\cite=\indexdummyfont
  1072. \let\sc=\indexdummyfont
  1073. %Don't no-op \tt, since it isn't a user-level command
  1074. % and is used in the definitions of the active chars like <, >, |...
  1075. %\let\tt=\indexdummyfont
  1076. \let\tclose=\indexdummyfont
  1077. \let\code=\indexdummyfont
  1078. \let\file=\indexdummyfont
  1079. \let\samp=\indexdummyfont
  1080. \let\kbd=\indexdummyfont
  1081. \let\key=\indexdummyfont
  1082. \let\var=\indexdummyfont
  1083. \let\TeX=\indexdummytex
  1084. \let\dots=\indexdummydots
  1085. % To define \realbackslash, we must make \ not be an escape.
  1086. % We must first make another character (@) an escape
  1087. % so we do not become unable to do a definition.
  1088. {\catcode`\@=0 \catcode`\\=\other
  1089. @gdef@realbackslash{\}}
  1090. \let\indexbackslash=0  %overridden during \printindex.
  1091. \def\doind #1#2{%
  1092. {\count10=\lastpenalty %
  1093. {\indexdummies % Must do this here, since \bf, etc expand at this stage
  1094. \escapechar=`\\%
  1095. {\let\folio=0% Expand all macros now EXCEPT \folio
  1096. \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
  1097. % so it will be output as is; and it will print as backslash in the indx.
  1098. % Now process the index-string once, with all font commands turned off,
  1099. % to get the string to sort the index by.
  1100. {\indexnofonts
  1101. \xdef\temp1{#2}%
  1102. % Now produce the complete index entry.  We process the index-string again,
  1103. % this time with font commands expanded, to get what to print in the index.
  1104. \edef\temp{%
  1105. \write \csname#1indfile\endcsname{%
  1106. \realbackslash entry {\temp1}{\folio}{#2}}}%
  1107. \temp }%
  1108. }\penalty\count10}}
  1109. \def\dosubind #1#2#3{%
  1110. {\count10=\lastpenalty %
  1111. {\indexdummies % Must do this here, since \bf, etc expand at this stage
  1112. \escapechar=`\\%
  1113. {\let\folio=0%
  1114. \def\rawbackslashxx{\indexbackslash}%
  1115. % Now process the index-string once, with all font commands turned off,
  1116. % to get the string to sort the index by.
  1117. {\indexnofonts
  1118. \xdef\temp1{#2 #3}%
  1119. % Now produce the complete index entry.  We process the index-string again,
  1120. % this time with font commands expanded, to get what to print in the index.
  1121. \edef\temp{%
  1122. \write \csname#1indfile\endcsname{%
  1123. \realbackslash entry {\temp1}{\folio}{#2}{#3}}}%
  1124. \temp }%
  1125. }\penalty\count10}}
  1126. % The index entry written in the file actually looks like
  1127. %  \entry {sortstring}{page}{topic}
  1128. %  \entry {sortstring}{page}{topic}{subtopic}
  1129. % The texindex program reads in these files and writes files
  1130. % containing these kinds of lines:
  1131. %  \initial {c}
  1132. %     before the first topic whose initial is c
  1133. %  \entry {topic}{pagelist}
  1134. %     for a topic that is used without subtopics
  1135. %  \primary {topic}
  1136. %     for the beginning of a topic that is used with subtopics
  1137. %  \secondary {subtopic}{pagelist}
  1138. %     for each subtopic.
  1139. % Define the user-accessible indexing commands 
  1140. % @findex, @vindex, @kindex, @cindex.
  1141. \def\findex {\fnindex}
  1142. \def\kindex {\kyindex}
  1143. \def\cindex {\cpindex}
  1144. \def\vindex {\vrindex}
  1145. \def\tindex {\tpindex}
  1146. \def\pindex {\pgindex}
  1147. \def\cindexsub {\begingroup\obeylines\cindexsub}
  1148. {\obeylines %
  1149. \gdef\cindexsub "#1" #2^^M{\endgroup %
  1150. \dosubind{cp}{#2}{#1}}}
  1151. % Define the macros used in formatting output of the sorted index material.
  1152. % This is what you call to cause a particular index to get printed.
  1153. % Write
  1154. % @unnumbered Function Index
  1155. % @printindex fn
  1156. \def\printindex{\parsearg\doprintindex}
  1157. \def\doprintindex#1{%
  1158.   \tex
  1159.   \dobreak \chapheadingskip {10000}
  1160.   \catcode`\%=\other\catcode`\&=\other\catcode`\#=\other
  1161.   \catcode`\$=\other\catcode`\_=\other
  1162.   \catcode`\~=\other
  1163.   % The following don't help, since the chars were translated
  1164.   % when the raw index was written, and their fonts were discarded
  1165.   % due to \indexnofonts.
  1166.   %\catcode`\"=\active
  1167.   %\catcode`\^=\active
  1168.   %\catcode`\_=\active
  1169.   %\catcode`\|=\active
  1170.   %\catcode`\<=\active
  1171.   %\catcode`\>=\active
  1172.   % %
  1173.   \def\indexbackslash{\rawbackslashxx}
  1174.   \indexfonts\rm \tolerance=9500 \advance\baselineskip -1pt
  1175.   \begindoublecolumns
  1176.   % See if the index file exists and is nonempty.
  1177.   \openin 1 \jobname.#1s
  1178.   \ifeof 1 
  1179.     % \enddoublecolumns gets confused if there is no text in the index,
  1180.     % and it loses the chapter title and the aux file entries for the
  1181.     % index.  The easiest way to prevent this problem is to make sure
  1182.     % there is some text.
  1183.     (Index is nonexistent)
  1184.     \else
  1185.     %
  1186.     % If the index file exists but is empty, then \openin leaves \ifeof
  1187.     % false.  We have to make TeX try to read something from the file, so
  1188.     % it can discover if there is anything in it.
  1189.     \read 1 to \temp
  1190.     \ifeof 1
  1191.       (Index is empty)
  1192.     \else
  1193.       \input \jobname.#1s
  1194.     \fi
  1195.   \fi
  1196.   \closein 1
  1197.   \enddoublecolumns
  1198.   \Etex
  1199. % These macros are used by the sorted index file itself.
  1200. % Change them to control the appearance of the index.
  1201. % Same as \bigskipamount except no shrink.
  1202. % \balancecolumns gets confused if there is any shrink.
  1203. \newskip\initialskipamount \initialskipamount 12pt plus4pt
  1204. \def\initial #1{%
  1205. {\let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
  1206. \ifdim\lastskip<\initialskipamount
  1207. \removelastskip \penalty-200 \vskip \initialskipamount\fi
  1208. \line{\secbf#1\hfill}\kern 2pt\penalty10000}}
  1209. \def\entry #1#2{\begingroup
  1210.   \parfillskip=0in \parskip=0in \parindent=0in
  1211.   % \hangindent is only relevant when the page number and the entry text
  1212.   % don't fit on one line.  In that case, bob suggests starting the dots
  1213.   % pretty far over on the line.
  1214.   % \hangafter is reset to 1 at the start of each paragraph.
  1215.   \hangindent=.75\hsize
  1216.   \noindent
  1217.   % Don't break the text of the index entry.
  1218.   \hbox{#1}%
  1219.   % If we must, put the page number on a line of its own, and fill out
  1220.   % this line with blank space.  (The \hfil is overwhelmed with the
  1221.   % fill leaders glue in \indexdotfill if the page number does fit.)
  1222.   \hfil\penalty50
  1223.   \null\nobreak\indexdotfill % Have leaders before the page number.
  1224.   % The `\ ' here is removed by the implicit \unskip that TeX does as
  1225.   % part of (the primitive) \par.  Without, a spurious underfull \hbox ensues.
  1226.   \ #2% The page number ends the paragraph.
  1227.   \par
  1228. \endgroup}
  1229. % Like \dotfill except takes at least 1 em.
  1230. \def\indexdotfill{\cleaders
  1231.   \hbox{$\mathsurround=0pt \mkern1.5mu . \mkern1.5mu$}\hskip 1em plus 1fill}
  1232. \def\primary #1{\line{#1\hfil}}
  1233. \newskip\secondaryindent \secondaryindent=0.5cm
  1234. \def\secondary #1#2{
  1235. {\parfillskip=0in \parskip=0in
  1236. \hangindent =1in \hangafter=1
  1237. \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par
  1238. %% Define two-column mode, which is used in indexes.
  1239. %% Adapted from the TeXBook, page 416
  1240. \catcode `\@=11
  1241. \newbox\partialpage
  1242. \newdimen\doublecolumnhsize  \doublecolumnhsize = 3.11in
  1243. \newdimen\doublecolumnvsize  \doublecolumnvsize = 19.1in
  1244. \newdimen\availdimen@
  1245. \def\begindoublecolumns{\begingroup
  1246.   \output={\global\setbox\partialpage=
  1247.     \vbox{\unvbox255\kern -\topskip \kern \baselineskip}}\eject
  1248.   \output={\doublecolumnout}%
  1249.   \hsize=\doublecolumnhsize \vsize=\doublecolumnvsize}
  1250. \def\enddoublecolumns{\output={\balancecolumns}\eject
  1251.   \endgroup \pagegoal=\vsize}
  1252. \def\doublecolumnout{\splittopskip=\topskip \splitmaxdepth=\maxdepth
  1253.   \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage
  1254.   \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
  1255.   \onepageout\pagesofar \unvbox255 \penalty\outputpenalty}
  1256. \def\pagesofar{\unvbox\partialpage %
  1257.   \hsize=\doublecolumnhsize % have to restore this since output routine
  1258. %          changes it to set cropmarks (P. A. MacKay, 12 Nov. 1986)
  1259.   \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}}
  1260. \def\balancecolumns{%
  1261. % Unset the glue.
  1262.   \setbox255=\vbox{\unvbox255}
  1263.   \dimen@=\ht255
  1264.   \advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip
  1265.   \divide\dimen@ by2
  1266.   \availdimen@=\pageheight \advance\availdimen@ by-\ht\partialpage
  1267. % If the remaining data is too big for one page,
  1268. % output one page normally, then work with what remains.
  1269.   \ifdim \dimen@>\availdimen@
  1270.      \splittopskip=\topskip \splitmaxdepth=\maxdepth
  1271.      \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage
  1272.      \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
  1273.      \onepageout\pagesofar
  1274. % Recompute size of what remains, in case we just output some of it.
  1275.   \dimen@=\ht255
  1276.   \advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip
  1277.   \divide\dimen@ by2
  1278.   \fi
  1279.   \setbox0=\vbox{\unvbox255}
  1280.   \splittopskip=\topskip
  1281.   {\vbadness=10000 \loop \global\setbox3=\copy0
  1282.     \global\setbox1=\vsplit3 to\dimen@
  1283.     \ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt \repeat}
  1284.   \setbox0=\vbox to\dimen@{\unvbox1}  \setbox2=\vbox to\dimen@{\unvbox3}
  1285.   \pagesofar}
  1286. \catcode `\@=\other
  1287. \message{sectioning,}
  1288. % Define chapters, sections, etc.
  1289. \newcount \chapno
  1290. \newcount \secno        \secno=0
  1291. \newcount \subsecno     \subsecno=0
  1292. \newcount \subsubsecno  \subsubsecno=0
  1293. % This counter is funny since it counts through charcodes of letters A, B, ...
  1294. \newcount \appendixno  \appendixno = `\@
  1295. \def\appendixletter{\char\the\appendixno}
  1296. \newwrite \contentsfile
  1297. % This is called from \setfilename.
  1298. \def\opencontents{\openout \contentsfile = \jobname.toc}
  1299. % Each @chapter defines this as the name of the chapter.
  1300. % page headings and footings can use it.  @section does likewise
  1301. \def\thischapter{} \def\thissection{}
  1302. \def\seccheck#1{\if \pageno<0 %
  1303. \errmessage{@#1 not allowed after generating table of contents}\fi
  1304. \def\chapternofonts{%
  1305. \let\rawbackslash=\relax%
  1306. \let\frenchspacing=\relax%
  1307. \def\result{\realbackslash result}
  1308. \def\equiv{\realbackslash equiv}
  1309. \def\expansion{\realbackslash expansion}
  1310. \def\print{\realbackslash print}
  1311. \def\TeX{\realbackslash TeX}
  1312. \def\dots{\realbackslash dots}
  1313. \def\copyright{\realbackslash copyright}
  1314. \def\tt{\realbackslash tt}
  1315. \def\bf{\realbackslash bf }
  1316. \def\w{\realbackslash w}
  1317. \def\less{\realbackslash less}
  1318. \def\gtr{\realbackslash gtr}
  1319. \def\hat{\realbackslash hat}
  1320. \def\char{\realbackslash char}
  1321. \def\tclose##1{\realbackslash tclose {##1}}
  1322. \def\code##1{\realbackslash code {##1}}
  1323. \def\samp##1{\realbackslash samp {##1}}
  1324. \def\r##1{\realbackslash r {##1}}
  1325. \def\b##1{\realbackslash b {##1}}
  1326. \def\key##1{\realbackslash key {##1}}
  1327. \def\file##1{\realbackslash file {##1}}
  1328. \def\kbd##1{\realbackslash kbd {##1}}
  1329. % These are redefined because @smartitalic wouldn't work inside xdef.
  1330. \def\i##1{\realbackslash i {##1}}
  1331. \def\cite##1{\realbackslash cite {##1}}
  1332. \def\var##1{\realbackslash var {##1}}
  1333. \def\emph##1{\realbackslash emph {##1}}
  1334. \def\dfn##1{\realbackslash dfn {##1}}
  1335. \def\thischaptername{No Chapter Title}
  1336. \outer\def\chapter{\parsearg\chapterzzz}
  1337. \def\chapterzzz #1{\seccheck{chapter}%
  1338. \secno=0 \subsecno=0 \subsubsecno=0
  1339. \global\advance \chapno by 1 \message{Chapter \the\chapno}%
  1340. \chapmacro {#1}{\the\chapno}%
  1341. \gdef\thissection{#1}%
  1342. \gdef\thischaptername{#1}%
  1343. % We don't substitute the actual chapter name into \thischapter
  1344. % because we don't want its macros evaluated now.
  1345. \xdef\thischapter{Chapter \the\chapno: \noexpand\thischaptername}%
  1346. {\chapternofonts%
  1347. \edef\temp{{\realbackslash chapentry {#1}{\the\chapno}{\noexpand\folio}}}%
  1348. \escapechar=`\\%
  1349. \write \contentsfile \temp  %
  1350. \donoderef %
  1351. \global\let\section = \numberedsec
  1352. \global\let\subsection = \numberedsubsec
  1353. \global\let\subsubsection = \numberedsubsubsec
  1354. \outer\def\appendix{\parsearg\appendixzzz}
  1355. \def\appendixzzz #1{\seccheck{appendix}%
  1356. \secno=0 \subsecno=0 \subsubsecno=0
  1357. \global\advance \appendixno by 1 \message{Appendix \appendixletter}%
  1358. \chapmacro {#1}{Appendix \appendixletter}%
  1359. \gdef\thissection{#1}%
  1360. \gdef\thischaptername{#1}%
  1361. \xdef\thischapter{Appendix \appendixletter: \noexpand\thischaptername}%
  1362. {\chapternofonts%
  1363. \edef\temp{{\realbackslash chapentry 
  1364.   {#1}{Appendix \appendixletter}{\noexpand\folio}}}%
  1365. \escapechar=`\\%
  1366. \write \contentsfile \temp  %
  1367. \appendixnoderef %
  1368. \global\let\section = \appendixsec
  1369. \global\let\subsection = \appendixsubsec
  1370. \global\let\subsubsection = \appendixsubsubsec
  1371. \outer\def\top{\parsearg\unnumberedzzz}
  1372. \outer\def\unnumbered{\parsearg\unnumberedzzz}
  1373. \def\unnumberedzzz #1{\seccheck{unnumbered}%
  1374. \secno=0 \subsecno=0 \subsubsecno=0 \message{(#1)}
  1375. \unnumbchapmacro {#1}%
  1376. \gdef\thischapter{#1}\gdef\thissection{#1}%
  1377. {\chapternofonts%
  1378. \edef\temp{{\realbackslash unnumbchapentry {#1}{\noexpand\folio}}}%
  1379. \escapechar=`\\%
  1380. \write \contentsfile \temp  %
  1381. \unnumbnoderef %
  1382. \global\let\section = \unnumberedsec
  1383. \global\let\subsection = \unnumberedsubsec
  1384. \global\let\subsubsection = \unnumberedsubsubsec
  1385. \outer\def\numberedsec{\parsearg\seczzz}
  1386. \def\seczzz #1{\seccheck{section}%
  1387. \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
  1388. \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
  1389. {\chapternofonts%
  1390. \edef\temp{{\realbackslash secentry %
  1391. {#1}{\the\chapno}{\the\secno}{\noexpand\folio}}}%
  1392. \escapechar=`\\%
  1393. \write \contentsfile \temp %
  1394. \donoderef %
  1395. \penalty 10000 %
  1396. \outer\def\appendixsection{\parsearg\appendixsectionzzz}
  1397. \outer\def\appendixsec{\parsearg\appendixsectionzzz}
  1398. \def\appendixsectionzzz #1{\seccheck{appendixsection}%
  1399. \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
  1400. \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
  1401. {\chapternofonts%
  1402. \edef\temp{{\realbackslash secentry %
  1403. {#1}{\appendixletter}{\the\secno}{\noexpand\folio}}}%
  1404. \escapechar=`\\%
  1405. \write \contentsfile \temp %
  1406. \appendixnoderef %
  1407. \penalty 10000 %
  1408. \outer\def\unnumberedsec{\parsearg\unnumberedseczzz}
  1409. \def\unnumberedseczzz #1{\seccheck{unnumberedsec}%
  1410. \plainsecheading {#1}\gdef\thissection{#1}%
  1411. {\chapternofonts%
  1412. \edef\temp{{\realbackslash unnumbsecentry{#1}{\noexpand\folio}}}%
  1413. \escapechar=`\\%
  1414. \write \contentsfile \temp %
  1415. \unnumbnoderef %
  1416. \penalty 10000 %
  1417. \outer\def\numberedsubsec{\parsearg\numberedsubseczzz}
  1418. \def\numberedsubseczzz #1{\seccheck{subsection}%
  1419. \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
  1420. \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
  1421. {\chapternofonts%
  1422. \edef\temp{{\realbackslash subsecentry %
  1423. {#1}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
  1424. \escapechar=`\\%
  1425. \write \contentsfile \temp %
  1426. \donoderef %
  1427. \penalty 10000 %
  1428. \outer\def\appendixsubsec{\parsearg\appendixsubseczzz}
  1429. \def\appendixsubseczzz #1{\seccheck{appendixsubsec}%
  1430. \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
  1431. \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
  1432. {\chapternofonts%
  1433. \edef\temp{{\realbackslash subsecentry %
  1434. {#1}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
  1435. \escapechar=`\\%
  1436. \write \contentsfile \temp %
  1437. \appendixnoderef %
  1438. \penalty 10000 %
  1439. \outer\def\unnumberedsubsec{\parsearg\unnumberedsubseczzz}
  1440. \def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}%
  1441. \plainsecheading {#1}\gdef\thissection{#1}%
  1442. {\chapternofonts%
  1443. \edef\temp{{\realbackslash unnumbsubsecentry{#1}{\noexpand\folio}}}%
  1444. \escapechar=`\\%
  1445. \write \contentsfile \temp %
  1446. \unnumbnoderef %
  1447. \penalty 10000 %
  1448. \outer\def\numberedsubsubsec{\parsearg\numberedsubsubseczzz}
  1449. \def\numberedsubsubseczzz #1{\seccheck{subsubsection}%
  1450. \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
  1451. \subsubsecheading {#1}
  1452.   {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
  1453. {\chapternofonts%
  1454. \edef\temp{{\realbackslash subsubsecentry %
  1455.   {#1}
  1456.   {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}
  1457.   {\noexpand\folio}}}%
  1458. \escapechar=`\\%
  1459. \write \contentsfile \temp %
  1460. \donoderef %
  1461. \penalty 10000 %
  1462. \outer\def\appendixsubsubsec{\parsearg\appendixsubsubseczzz}
  1463. \def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec}%
  1464. \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
  1465. \subsubsecheading {#1}
  1466.   {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
  1467. {\chapternofonts%
  1468. \edef\temp{{\realbackslash subsubsecentry{#1}%
  1469.   {\appendixletter}
  1470.   {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}%
  1471. \escapechar=`\\%
  1472. \write \contentsfile \temp %
  1473. \appendixnoderef %
  1474. \penalty 10000 %
  1475. \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
  1476. \def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}%
  1477. \plainsecheading {#1}\gdef\thissection{#1}%
  1478. {\chapternofonts%
  1479. \edef\temp{{\realbackslash unnumbsubsubsecentry{#1}{\noexpand\folio}}}%
  1480. \escapechar=`\\%
  1481. \write \contentsfile \temp %
  1482. \unnumbnoderef %
  1483. \penalty 10000 %
  1484. % These are variants which are not "outer", so they can appear in @ifinfo.
  1485. % Actually, they should now be obsolete; ordinary section commands should work.
  1486. \def\infotop{\parsearg\unnumberedzzz}
  1487. \def\infounnumbered{\parsearg\unnumberedzzz}
  1488. \def\infounnumberedsec{\parsearg\unnumberedseczzz}
  1489. \def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz}
  1490. \def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
  1491. \def\infoappendix{\parsearg\appendixzzz}
  1492. \def\infoappendixsec{\parsearg\appendixseczzz}
  1493. \def\infoappendixsubsec{\parsearg\appendixsubseczzz}
  1494. \def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz}
  1495. \def\infochapter{\parsearg\chapterzzz}
  1496. \def\infosection{\parsearg\sectionzzz}
  1497. \def\infosubsection{\parsearg\subsectionzzz}
  1498. \def\infosubsubsection{\parsearg\subsubsectionzzz}
  1499. % These macros control what the section commands do, according
  1500. % to what kind of chapter we are in (ordinary, appendix, or unnumbered).
  1501. % Define them by default for a numbered chapter.
  1502. \global\let\section = \numberedsec
  1503. \global\let\subsection = \numberedsubsec
  1504. \global\let\subsubsection = \numberedsubsubsec
  1505. % Define @majorheading, @heading and @subheading
  1506. % NOTE on use of \vbox for chapter headings, section headings, and
  1507. % such:
  1508. %    1) We use \vbox rather than the earlier \line to permit
  1509. %       overlong headings to fold.
  1510. %    2) \hyphenpenalty is set to 10000 because hyphenation in a
  1511. %       heading is obnoxious; this forbids it.
  1512. %       3) Likewise, headings look best if no \parindent is used, and
  1513. %          if justification is not attempted.  Hence \raggedright.
  1514. \def\majorheading{\parsearg\majorheadingzzz}
  1515. \def\majorheadingzzz #1{%
  1516. {\advance\chapheadingskip by 10pt \chapbreak }%
  1517. {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  1518.                   \parindent=0pt\raggedright
  1519.                   \rm #1\hfill}}\bigskip \par\penalty 200}
  1520. \def\chapheading{\parsearg\chapheadingzzz}
  1521. \def\chapheadingzzz #1{\chapbreak %
  1522. {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  1523.                   \parindent=0pt\raggedright
  1524.                   \rm #1\hfill}}\bigskip \par\penalty 200}
  1525. \def\heading{\parsearg\secheadingi}
  1526. \def\subheading{\parsearg\subsecheadingi}
  1527. \def\subsubheading{\parsearg\subsubsecheadingi}
  1528. % These macros generate a chapter, section, etc. heading only
  1529. % (including whitespace, linebreaking, etc. around it),
  1530. % given all the information in convenient, parsed form.
  1531. %%% Args are the skip and penalty (usually negative)
  1532. \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
  1533. \def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
  1534. %%% Define plain chapter starts, and page on/off switching for it
  1535. % Parameter controlling skip before chapter headings (if needed)
  1536. \newskip \chapheadingskip \chapheadingskip = 30pt plus 8pt minus 4pt
  1537. \def\chapbreak{\dobreak \chapheadingskip {-4000}}
  1538. \def\chappager{\par\vfill\supereject}
  1539. \def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi}
  1540. \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
  1541. \def\CHAPPAGoff{
  1542. \global\let\pchapsepmacro=\chapbreak
  1543. \global\let\pagealignmacro=\chappager}
  1544. \def\CHAPPAGon{
  1545. \global\let\pchapsepmacro=\chappager
  1546. \global\let\pagealignmacro=\chappager
  1547. \global\def\HEADINGSon{\HEADINGSsingle}}
  1548. \def\CHAPPAGodd{
  1549. \global\let\pchapsepmacro=\chapoddpage
  1550. \global\let\pagealignmacro=\chapoddpage
  1551. \global\def\HEADINGSon{\HEADINGSdouble}}
  1552. \CHAPPAGon
  1553. \def\CHAPFplain{
  1554. \global\let\chapmacro=\chfplain
  1555. \global\let\unnumbchapmacro=\unnchfplain}
  1556. \def\chfplain #1#2{%
  1557.   \pchapsepmacro
  1558.     \chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  1559.                      \parindent=0pt\raggedright
  1560.                      \rm #2\enspace #1}%
  1561.   \bigskip
  1562.   \penalty5000
  1563. \def\unnchfplain #1{%
  1564. \pchapsepmacro %
  1565. {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  1566.                   \parindent=0pt\raggedright
  1567.                   \rm #1\hfill}}\bigskip \par\penalty 10000 %
  1568. \CHAPFplain % The default
  1569. \def\unnchfopen #1{%
  1570. \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  1571.                        \parindent=0pt\raggedright
  1572.                        \rm #1\hfill}}\bigskip \par\penalty 10000 %
  1573. \def\chfopen #1#2{\chapoddpage {\chapfonts
  1574. \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
  1575. \par\penalty 5000 %
  1576. \def\CHAPFopen{
  1577. \global\let\chapmacro=\chfopen
  1578. \global\let\unnumbchapmacro=\unnchfopen}
  1579. % Parameter controlling skip before section headings.
  1580. \newskip \subsecheadingskip  \subsecheadingskip = 17pt plus 8pt minus 4pt
  1581. \def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}}
  1582. \newskip \secheadingskip  \secheadingskip = 21pt plus 8pt minus 4pt
  1583. \def\secheadingbreak{\dobreak \secheadingskip {-1000}}
  1584. % @paragraphindent  is defined for the Info formatting commands only.
  1585. \let\paragraphindent=\comment
  1586. % Section fonts are the base font at magstep2, which produces
  1587. % a size a bit more than 14 points in the default situation.    
  1588. \def\secheading #1#2#3{\secheadingi {#2.#3\enspace #1}}
  1589. \def\plainsecheading #1{\secheadingi {#1}}
  1590. \def\secheadingi #1{{\advance \secheadingskip by \parskip %
  1591. \secheadingbreak}%
  1592. {\secfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  1593.                  \parindent=0pt\raggedright
  1594.                  \rm #1\hfill}}%
  1595. \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 }
  1596. % Subsection fonts are the base font at magstep1, 
  1597. % which produces a size of 12 points.
  1598. \def\subsecheading #1#2#3#4{\subsecheadingi {#2.#3.#4\enspace #1}}
  1599. \def\subsecheadingi #1{{\advance \subsecheadingskip by \parskip %
  1600. \subsecheadingbreak}%
  1601. {\subsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  1602.                      \parindent=0pt\raggedright
  1603.                      \rm #1\hfill}}%
  1604. \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 }
  1605. \def\subsubsecfonts{\subsecfonts} % Maybe this should change:
  1606.                   % Perhaps make sssec fonts scaled
  1607.                   % magstep half
  1608. \def\subsubsecheading #1#2#3#4#5{\subsubsecheadingi {#2.#3.#4.#5\enspace #1}}
  1609. \def\subsubsecheadingi #1{{\advance \subsecheadingskip by \parskip %
  1610. \subsecheadingbreak}%
  1611. {\subsubsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  1612.                        \parindent=0pt\raggedright
  1613.                        \rm #1\hfill}}%
  1614. \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000}
  1615. \message{toc printing,}
  1616. % Finish up the main text and prepare to read what we've written
  1617. % to \contentsfile.
  1618. \newskip\contentsrightmargin \contentsrightmargin=1in
  1619. \def\startcontents#1{%
  1620.    \pagealignmacro
  1621.    \immediate\closeout \contentsfile
  1622.    \ifnum \pageno>0
  1623.       \pageno = -1        % Request roman numbered pages.
  1624.    \fi
  1625.    % Don't need to put `Contents' or `Short Contents' in the headline. 
  1626.    % It is abundantly clear what they are.
  1627.    \unnumbchapmacro{#1}\def\thischapter{}%
  1628.    \begingroup           % Set up to handle contents files properly.
  1629.       \catcode`\\=0  \catcode`\{=1  \catcode`\}=2  \catcode`\@=11
  1630.       \raggedbottom             % Worry more about breakpoints than the bottom.
  1631.       \advance\hsize by -\contentsrightmargin % Don't use the full line length.
  1632. % Normal (long) toc.
  1633. \outer\def\contents{%
  1634.    \startcontents{Table of Contents}%
  1635.       \input \jobname.toc
  1636.    \endgroup
  1637.    \vfill \eject
  1638. % And just the chapters.
  1639. \outer\def\summarycontents{%
  1640.    \startcontents{Short Contents}%
  1641.       %
  1642.       \let\chapentry = \shortchapentry
  1643.       \let\unnumbchapentry = \shortunnumberedentry
  1644.       % We want a true roman here for the page numbers.
  1645.       \secfonts
  1646.       \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl
  1647.       \rm
  1648.       \advance\baselineskip by 1pt % Open it up a little.
  1649.       \def\secentry ##1##2##3##4{}
  1650.       \def\unnumbsecentry ##1##2{}
  1651.       \def\subsecentry ##1##2##3##4##5{}
  1652.       \def\unnumbsubsecentry ##1##2{}
  1653.       \def\subsubsecentry ##1##2##3##4##5##6{}
  1654.       \def\unnumbsubsubsecentry ##1##2{}
  1655.       \input \jobname.toc
  1656.    \endgroup
  1657.    \vfill \eject
  1658. \let\shortcontents = \summarycontents
  1659. % These macros generate individual entries in the table of contents.
  1660. % The first argument is the chapter or section name.
  1661. % The last argument is the page number.
  1662. % The arguments in between are the chapter number, section number, ...
  1663. % Chapter-level things, for both the long and short contents.
  1664. \def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}
  1665. % See comments in \dochapentry re vbox and related settings
  1666. \def\shortchapentry#1#2#3{%
  1667.    \vbox{\hyphenpenalty=10000\tolerance=5000
  1668.     \parindent=0pt\strut\raggedright
  1669.     {#2\labelspace #1}\dotfill\doshortpageno{#3}}%
  1670. \def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
  1671. \def\shortunnumberedentry#1#2{%
  1672.    \vbox{\hyphenpenalty=10000\tolerance=5000
  1673.     \parindent=0pt\strut\raggedright
  1674.     #1\dotfill\doshortpageno{#2}}%
  1675. % Sections.
  1676. \def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}}
  1677. \def\unnumbsecentry#1#2{\dosecentry{#1}{#2}}
  1678. % Subsections.
  1679. \def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}}
  1680. \def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}}
  1681. % And subsubsections.
  1682. \def\subsubsecentry#1#2#3#4#5#6{%
  1683.   \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}}
  1684. \def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}}
  1685. % This parameter controls the indentation of the various levels.
  1686. \newdimen\tocindent \tocindent = 3pc
  1687. % Now for the actual typesetting. In all these, #1 is the text and #2 is the 
  1688. % page number.
  1689. % If the toc has to be broken over pages, we would want to be at chapters 
  1690. % if at all possible; hence the \penalty.
  1691. \def\dochapentry#1#2{%
  1692.    \penalty-300 \vskip\baselineskip
  1693.    % This \vbox (and similar ones in dosecentry etc.) used to be a
  1694.    % \line; changed to permit linebreaks for long headings.  See
  1695.    % comments above \majorheading.  Here we also use \strut to
  1696.    % keep the top end of the vbox from jamming up against the previous
  1697.    % entry in the table of contents.
  1698.    \vbox{\chapentryfonts
  1699.      \hyphenpenalty=10000\tolerance=5000 % this line and next introduced
  1700.      \parindent=0pt\strut\raggedright    % with \line -> \vbox change
  1701.      #1\dotfill
  1702.      \dopageno{#2}}%
  1703.    \nobreak\vskip .25\baselineskip
  1704. \def\dosecentry#1#2{%
  1705.    \vbox{\secentryfonts \leftskip=\tocindent
  1706.     \hyphenpenalty=10000\tolerance=5000
  1707.     \parindent=0pt\strut\raggedright #1\dotfill
  1708.     \dopageno{#2}}%
  1709. \def\dosubsecentry#1#2{%
  1710.    \vbox{\subsecentryfonts \leftskip=2\tocindent
  1711.     \hyphenpenalty=10000\tolerance=5000
  1712.     \parindent=0pt\strut\raggedright #1\dotfill
  1713.     \dopageno{#2}}%
  1714. \def\dosubsubsecentry#1#2{%
  1715.    \vbox{\subsubsecentryfonts \leftskip=3\tocindent
  1716.     \hyphenpenalty=10000\tolerance=5000
  1717.     \parindent=0pt\strut\raggedright #1\dotfill
  1718.     \dopageno{#2}}%
  1719. % Space between chapter (or whatever) number and the title.
  1720. \def\labelspace{\hskip1em \relax}
  1721. \def\dopageno#1{{\rm #1}}
  1722. \def\doshortpageno#1{{\rm #1}}
  1723. \def\chapentryfonts{\secfonts \rm}
  1724. \def\secentryfonts{\textfonts}
  1725. \let\subsecentryfonts = \textfonts
  1726. \let\subsubsecentryfonts = \textfonts
  1727. \message{environments,}
  1728. % Since these characters are used in examples, it should be an even number of 
  1729. % \tt widths. Each \tt character is 1en, so two makes it 1em.
  1730. % Furthermore, these definitions must come after we define our fonts.
  1731. \newbox\dblarrowbox    \newbox\longdblarrowbox
  1732. \newbox\pushcharbox    \newbox\bullbox
  1733. \newbox\equivbox       \newbox\errorbox
  1734. \let\ptexequiv = \equiv
  1735. %{\tentt
  1736. %\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil}
  1737. %\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil}
  1738. %\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil}
  1739. %\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil}
  1740. % Adapted from the manmac format (p.420 of TeXbook)
  1741. %\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex
  1742. %                                      depth .1ex\hfil}
  1743. \def\point{$\star$}
  1744. \def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
  1745. \def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}}
  1746. \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
  1747. \def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}}
  1748. % Adapted from the TeXbook's \boxit.
  1749. {\tentt \global\dimen0 = 3em}% Width of the box.
  1750. \dimen2 = .55pt % Thickness of rules
  1751. % The text. (`r' is open on the right, `e' somewhat less so on the left.)
  1752. \setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt}
  1753. \global\setbox\errorbox=\hbox to \dimen0{\hfil
  1754.    \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
  1755.    \advance\hsize by -2\dimen2 % Rules.
  1756.    \vbox{
  1757.       \hrule height\dimen2
  1758.       \hbox{\vrule width\dimen2 \kern3pt          % Space to left of text.
  1759.          \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
  1760.          \kern3pt\vrule width\dimen2}% Space to right.
  1761.       \hrule height\dimen2}
  1762.     \hfil}
  1763. % The @error{} command.
  1764. \def\error{\leavevmode\lower.7ex\copy\errorbox}
  1765. % @tex ... @end tex    escapes into raw Tex temporarily.
  1766. % One exception: @ is still an escape character, so that @end tex works.
  1767. % But \@ or @@ will get a plain tex @ character.
  1768. \def\tex{\begingroup
  1769. \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
  1770. \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
  1771. \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
  1772. \catcode `\%=14
  1773. \catcode 43=12
  1774. \catcode`\"=12
  1775. \catcode`\==12
  1776. \catcode`\|=12
  1777. \catcode`\<=12
  1778. \catcode`\>=12
  1779. \escapechar=`\\
  1780. \let\{=\ptexlbrace
  1781. \let\}=\ptexrbrace
  1782. \let\.=\ptexdot
  1783. \let\*=\ptexstar
  1784. \let\dots=\ptexdots
  1785. \def\@{@}%
  1786. \let\bullet=\ptexbullet
  1787. \let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext \let\l=\ptexl
  1788. \let\L=\ptexL
  1789. \let\Etex=\endgroup}
  1790. % Define @lisp ... @endlisp.
  1791. % @lisp does a \begingroup so it can rebind things,
  1792. % including the definition of @endlisp (which normally is erroneous).
  1793. % Amount to narrow the margins by for @lisp.
  1794. \newskip\lispnarrowing \lispnarrowing=0.4in
  1795. % This is the definition that ^M gets inside @lisp
  1796. % phr: changed space to \null, to avoid overfull hbox problems.
  1797. {\obeyspaces%
  1798. \gdef\lisppar{\null\endgraf}}
  1799. % Cause \obeyspaces to make each Space cause a word-separation
  1800. % rather than the default which is that it acts punctuation.
  1801. % This is because space in tt font looks funny.
  1802. {\obeyspaces %
  1803. \gdef\sepspaces{\def {\ }}}
  1804. \newskip\aboveenvskipamount \aboveenvskipamount= 0pt
  1805. \def\aboveenvbreak{{\advance\aboveenvskipamount by \parskip
  1806. \endgraf \ifdim\lastskip<\aboveenvskipamount
  1807. \removelastskip \penalty-50 \vskip\aboveenvskipamount \fi}}
  1808. \def\afterenvbreak{\endgraf \ifdim\lastskip<\aboveenvskipamount
  1809. \removelastskip \penalty-50 \vskip\aboveenvskipamount \fi}
  1810. % \nonarrowing is a flag.  If "set", @lisp etc don't narrow margins.
  1811. \let\nonarrowing=\relax
  1812. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1813. % \cartouche: draw rectangle w/rounded corners around argument
  1814. \font\circle=lcircle10
  1815. \newdimen\circthick
  1816. \newdimen\cartouter\newdimen\cartinner
  1817. \newskip\normbskip\newskip\normpskip\newskip\normlskip
  1818. \circthick=\fontdimen8\circle
  1819. \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
  1820. \def\ctr{{\hskip 6pt\circle\char'010}}
  1821. \def\cbl{{\circle\char'012\hskip -6pt}}
  1822. \def\cbr{{\hskip 6pt\circle\char'011}}
  1823. \def\carttop{\hbox to \cartouter{\hskip\lskip
  1824.     \ctl\leaders\hrule height\circthick\hfil\ctr
  1825.     \hskip\rskip}}
  1826. \def\cartbot{\hbox to \cartouter{\hskip\lskip
  1827.     \cbl\leaders\hrule height\circthick\hfil\cbr
  1828.     \hskip\rskip}}
  1829. \newskip\lskip\newskip\rskip
  1830. \long\def\cartouche{%
  1831. \begingroup
  1832.     \lskip=\leftskip \rskip=\rightskip
  1833.     \leftskip=0pt\rightskip=0pt %we want these *outside*.
  1834.     \cartinner=\hsize \advance\cartinner by-\lskip 
  1835.                \advance\cartinner by-\rskip
  1836.     \cartouter=\hsize
  1837.     \advance\cartouter by 18pt % allow for 3pt kerns on either
  1838. %                     side, and for 6pt waste from
  1839. %                     each corner char
  1840.     \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
  1841.     % Flag to tell @lisp, etc., not to narrow margin.
  1842.     \let\nonarrowing=\comment
  1843.     \vbox\bgroup
  1844.         \baselineskip=0pt\parskip=0pt\lineskip=0pt
  1845.         \carttop
  1846.         \hbox\bgroup
  1847.             \hskip\lskip
  1848.             \vrule\kern3pt
  1849.             \vbox\bgroup
  1850.                 \hsize=\cartinner
  1851.                 \kern3pt
  1852.                 \begingroup
  1853.                     \baselineskip=\normbskip
  1854.                     \lineskip=\normlskip
  1855.                     \parskip=\normpskip
  1856.                     \vskip -\parskip
  1857. \def\Ecartouche{%
  1858.                 \endgroup
  1859.                 \kern3pt
  1860.             \egroup
  1861.             \kern3pt\vrule
  1862.             \hskip\rskip
  1863.         \egroup
  1864.         \cartbot
  1865.     \egroup
  1866. \endgroup
  1867. \def\lisp{\aboveenvbreak
  1868. \begingroup\inENV % This group ends at the end of the @lisp body
  1869. \hfuzz=12truept % Don't be fussy
  1870. % Make spaces be word-separators rather than space tokens.
  1871. \sepspaces %
  1872. % Single space lines
  1873. \singlespace %
  1874. % The following causes blank lines not to be ignored
  1875. % by adding a space to the end of each line.
  1876. \let\par=\lisppar
  1877. \def\Elisp{\endgroup\afterenvbreak}%
  1878. \parskip=0pt
  1879. % @cartouche defines \nonarrowing to inhibit narrowing
  1880. % at next level down.
  1881. \ifx\nonarrowing\relax
  1882. \advance \leftskip by \lispnarrowing
  1883. \exdentamount=\lispnarrowing
  1884. \let\exdent=\nofillexdent
  1885. \let\nonarrowing=\relax
  1886. \parindent=0pt
  1887. \obeyspaces \obeylines \tt \rawbackslash
  1888. \def\next##1{}\next}
  1889. \let\example=\lisp
  1890. \def\Eexample{\Elisp}
  1891. \let\smallexample=\lisp
  1892. \def\Esmallexample{\Elisp}
  1893. % Macro for 9 pt. examples, necessary to print with 5" lines.
  1894. % From Pavel@xerox.  This is not really used unless the
  1895. % @smallbook command is given.
  1896. \def\smalllispx{\aboveenvbreak\begingroup\inENV
  1897. %            This group ends at the end of the @lisp body
  1898. \hfuzz=12truept % Don't be fussy
  1899. % Make spaces be word-separators rather than space tokens.
  1900. \sepspaces %
  1901. % Single space lines
  1902. \singlespace %
  1903. % The following causes blank lines not to be ignored
  1904. % by adding a space to the end of each line.
  1905. \let\par=\lisppar
  1906. \def\Esmalllisp{\endgroup\afterenvbreak}%
  1907. %%%% Smaller baseline skip for small examples.
  1908. \baselineskip 10pt
  1909. \parskip=0pt
  1910. % @cartouche defines \nonarrowing to inhibit narrowing
  1911. % at next level down.
  1912. \ifx\nonarrowing\relax
  1913. \advance \leftskip by \lispnarrowing
  1914. \exdentamount=\lispnarrowing
  1915. \let\exdent=\nofillexdent
  1916. \let\nonarrowing=\relax
  1917. \parindent=0pt
  1918. \obeyspaces \obeylines \ninett \indexfonts \rawbackslash
  1919. \def\next##1{}\next}
  1920. % This is @display; same as @lisp except use roman font.
  1921. \def\display{\begingroup\inENV %This group ends at the end of the @display body
  1922. \aboveenvbreak
  1923. % Make spaces be word-separators rather than space tokens.
  1924. \sepspaces %
  1925. % Single space lines
  1926. \singlespace %
  1927. % The following causes blank lines not to be ignored
  1928. % by adding a space to the end of each line.
  1929. \let\par=\lisppar
  1930. \def\Edisplay{\endgroup\afterenvbreak}%
  1931. \parskip=0pt
  1932. % @cartouche defines \nonarrowing to inhibit narrowing
  1933. % at next level down.
  1934. \ifx\nonarrowing\relax
  1935. \advance \leftskip by \lispnarrowing
  1936. \exdentamount=\lispnarrowing
  1937. \let\exdent=\nofillexdent
  1938. \let\nonarrowing=\relax
  1939. \parindent=0pt
  1940. \obeyspaces \obeylines
  1941. \def\next##1{}\next}
  1942. % This is @format; same as @lisp except use roman font and don't narrow margins
  1943. \def\format{\begingroup\inENV %This group ends at the end of the @format body
  1944. \aboveenvbreak
  1945. % Make spaces be word-separators rather than space tokens.
  1946. \sepspaces %
  1947. \singlespace %
  1948. % The following causes blank lines not to be ignored
  1949. % by adding a space to the end of each line.
  1950. \let\par=\lisppar
  1951. \def\Eformat{\endgroup\afterenvbreak}
  1952. \parskip=0pt \parindent=0pt
  1953. \obeyspaces \obeylines
  1954. \def\next##1{}\next}
  1955. % @flushleft and @flushright
  1956. \def\flushleft{%
  1957. \begingroup\inENV %This group ends at the end of the @format body
  1958. \aboveenvbreak
  1959. % Make spaces be word-separators rather than space tokens.
  1960. \sepspaces %
  1961. % The following causes blank lines not to be ignored
  1962. % by adding a space to the end of each line.
  1963. % This also causes @ to work when the directive name
  1964. % is terminated by end of line.
  1965. \let\par=\lisppar
  1966. \def\Eflushleft{\endgroup\afterenvbreak}%
  1967. \parskip=0pt \parindent=0pt
  1968. \obeyspaces \obeylines
  1969. \def\next##1{}\next}
  1970. \def\flushright{%
  1971. \begingroup\inENV %This group ends at the end of the @format body
  1972. \aboveenvbreak
  1973. % Make spaces be word-separators rather than space tokens.
  1974. \sepspaces %
  1975. % The following causes blank lines not to be ignored
  1976. % by adding a space to the end of each line.
  1977. % This also causes @ to work when the directive name
  1978. % is terminated by end of line.
  1979. \let\par=\lisppar
  1980. \def\Eflushright{\endgroup\afterenvbreak}%
  1981. \parskip=0pt \parindent=0pt
  1982. \advance \leftskip by 0pt plus 1fill
  1983. \obeyspaces \obeylines
  1984. \def\next##1{}\next}
  1985. % @quotation - narrow the margins.
  1986. \def\quotation{%
  1987. \begingroup\inENV %This group ends at the end of the @quotation body
  1988. {\parskip=0pt  % because we will skip by \parskip too, later
  1989. \aboveenvbreak}%
  1990. \singlespace
  1991. \parindent=0pt
  1992. \def\Equotation{\par\endgroup\afterenvbreak}%
  1993. % @cartouche defines \nonarrowing to inhibit narrowing
  1994. % at next level down.
  1995. \ifx\nonarrowing\relax
  1996. \advance \leftskip by \lispnarrowing
  1997. \advance \rightskip by \lispnarrowing
  1998. \exdentamount=\lispnarrowing
  1999. \let\nonarrowing=\relax
  2000. \message{defuns,}
  2001. % Define formatter for defuns
  2002. % First, allow user to change definition object font (\df) internally
  2003. \def\setdeffont #1 {\csname DEF#1\endcsname}
  2004. \newskip\defbodyindent \defbodyindent=.4in
  2005. \newskip\defargsindent \defargsindent=50pt
  2006. \newskip\deftypemargin \deftypemargin=12pt
  2007. \newskip\deflastargmargin \deflastargmargin=18pt
  2008. \newcount\parencount
  2009. % define \functionparens, which makes ( and ) and & do special things.
  2010. % \functionparens affects the group it is contained in.
  2011. \def\activeparens{%
  2012. \catcode`\(=\active \catcode`\)=\active \catcode`\&=\active
  2013. \catcode`\[=\active \catcode`\]=\active}
  2014. {\activeparens % Now, smart parens don't turn on until &foo (see \amprm)
  2015. \gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 }
  2016. \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
  2017. % Definitions of (, ) and & used in args for functions.
  2018. % This is the definition of ( outside of all parentheses.
  2019. \gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested %
  2020. \global\advance\parencount by 1 }
  2021. % This is the definition of ( when already inside a level of parens.
  2022. \gdef\opnested{\char`\(\global\advance\parencount by 1 }
  2023. \gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
  2024. % also in that case restore the outer-level definition of (.
  2025. \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi
  2026. \global\advance \parencount by -1 }
  2027. % If we encounter &foo, then turn on ()-hacking afterwards
  2028. \gdef\amprm#1 {{\rm\}\let(=\oprm \let)=\clrm\ }
  2029. \gdef\normalparens{\boldbrax\let&=\ampnr}
  2030. } % End of definition inside \activeparens
  2031. %% These parens (in \boldbrax) actually are a little bolder than the
  2032. %% contained text.  This is especially needed for [ and ]
  2033. \def\opnr{{\sf\char`\(}} \def\clnr{{\sf\char`\)}} \def\ampnr{\&}
  2034. \def\lbrb{{\bf\char`\[}} \def\rbrb{{\bf\char`\]}}
  2035. % First, defname, which formats the header line itself.
  2036. % #1 should be the function name.
  2037. % #2 should be the type of definition, such as "Function".
  2038. \def\defname #1#2{%
  2039. % Get the values of \leftskip and \rightskip as they were
  2040. % outside the @def...
  2041. \dimen2=\leftskip
  2042. \advance\dimen2 by -\defbodyindent
  2043. \dimen3=\rightskip
  2044. \advance\dimen3 by -\defbodyindent
  2045. \noindent        %
  2046. \setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
  2047. \dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line
  2048. \dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations
  2049. \parshape 2 0in \dimen0 \defargsindent \dimen1     %
  2050. % Now output arg 2 ("Function" or some such)
  2051. % ending at \deftypemargin from the right margin,
  2052. % but stuck inside a box of width 0 so it does not interfere with linebreaking
  2053. {% Adjust \hsize to exclude the ambient margins,
  2054. % so that \rightline will obey them.
  2055. \advance \hsize by -\dimen2 \advance \hsize by -\dimen3
  2056. \rlap{\rightline{{\rm #2}\hskip \deftypemargin}}}%
  2057. % Make all lines underfull and no complaints:
  2058. \tolerance=10000 \hbadness=10000    
  2059. \advance\leftskip by -\defbodyindent
  2060. \exdentamount=\defbodyindent
  2061. {\df #1}\enskip        % Generate function name
  2062. % Actually process the body of a definition
  2063. % #1 should be the terminating control sequence, such as \Edefun.
  2064. % #2 should be the "another name" control sequence, such as \defunx.
  2065. % #3 should be the control sequence that actually processes the header,
  2066. %    such as \defunheader.
  2067. \def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
  2068. \medbreak %
  2069. % Define the end token that this defining construct specifies
  2070. % so that it will exit this group.
  2071. \def#1{\endgraf\endgroup\medbreak}%
  2072. \def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
  2073. \parindent=0in
  2074. \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
  2075. \exdentamount=\defbodyindent
  2076. \begingroup %
  2077. \catcode 61=\active %
  2078. \obeylines\activeparens\spacesplit#3}
  2079. \def\defmethparsebody #1#2#3#4 {\begingroup\inENV %
  2080. \medbreak %
  2081. % Define the end token that this defining construct specifies
  2082. % so that it will exit this group.
  2083. \def#1{\endgraf\endgroup\medbreak}%
  2084. \def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}%
  2085. \parindent=0in
  2086. \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
  2087. \exdentamount=\defbodyindent
  2088. \begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
  2089. \def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
  2090. \medbreak %
  2091. % Define the end token that this defining construct specifies
  2092. % so that it will exit this group.
  2093. \def#1{\endgraf\endgroup\medbreak}%
  2094. \def#2##1 ##2 {\def#4{##1}%
  2095. \begingroup\obeylines\activeparens\spacesplit{#3{##2}}}%
  2096. \parindent=0in
  2097. \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
  2098. \exdentamount=\defbodyindent
  2099. \begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
  2100. % These parsing functions are similar to the preceding ones
  2101. % except that they do not make parens into active characters.
  2102. % These are used for "variables" since they have no arguments.
  2103. \def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
  2104. \medbreak %
  2105. % Define the end token that this defining construct specifies
  2106. % so that it will exit this group.
  2107. \def#1{\endgraf\endgroup\medbreak}%
  2108. \def#2{\begingroup\obeylines\spacesplit#3}%
  2109. \parindent=0in
  2110. \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
  2111. \exdentamount=\defbodyindent
  2112. \begingroup %
  2113. \catcode 61=\active %
  2114. \obeylines\spacesplit#3}
  2115. \def\defvrparsebody #1#2#3#4 {\begingroup\inENV %
  2116. \medbreak %
  2117. % Define the end token that this defining construct specifies
  2118. % so that it will exit this group.
  2119. \def#1{\endgraf\endgroup\medbreak}%
  2120. \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}%
  2121. \parindent=0in
  2122. \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
  2123. \exdentamount=\defbodyindent
  2124. \begingroup\obeylines\spacesplit{#3{#4}}}
  2125. \def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV %
  2126. \medbreak %
  2127. % Define the end token that this defining construct specifies
  2128. % so that it will exit this group.
  2129. \def#1{\endgraf\endgroup\medbreak}%
  2130. \def#2##1 ##2 {\def#4{##1}%
  2131. \begingroup\obeylines\spacesplit{#3{##2}}}%
  2132. \parindent=0in
  2133. \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
  2134. \exdentamount=\defbodyindent
  2135. \begingroup\obeylines\spacesplit{#3{#5}}}
  2136. % Split up #2 at the first space token.
  2137. % call #1 with two arguments:
  2138. %  the first is all of #2 before the space token,
  2139. %  the second is all of #2 after that space token.
  2140. % If #2 contains no space token, all of it is passed as the first arg
  2141. % and the second is passed as empty.
  2142. {\obeylines
  2143. \gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}%
  2144. \long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{%
  2145. \ifx\relax #3%
  2146. #1{#2}{}\else #1{#2}{#3#4}\fi}}
  2147. % So much for the things common to all kinds of definitions.
  2148. % Define @defun.
  2149. % First, define the processing that is wanted for arguments of \defun
  2150. % Use this to expand the args and terminate the paragraph they make up
  2151. \def\defunargs #1{\functionparens \sl
  2152. % Expand, preventing hyphenation at `-' chars.
  2153. % Note that groups don't affect changes in \hyphenchar.
  2154. \hyphenchar\tensl=0
  2155. \hyphenchar\tensl=45
  2156. \ifnum\parencount=0 \else \errmessage{unbalanced parens in @def arguments}\fi%
  2157. \interlinepenalty=10000
  2158. \advance\rightskip by 0pt plus 1fil
  2159. \endgraf\penalty 10000\vskip -\parskip\penalty 10000%
  2160. \def\deftypefunargs #1{%
  2161. % Expand, preventing hyphenation at `-' chars.
  2162. % Note that groups don't affect changes in \hyphenchar.
  2163. \functionparens
  2164. \code{#1}%
  2165. \interlinepenalty=10000
  2166. \advance\rightskip by 0pt plus 1fil
  2167. \endgraf\penalty 10000\vskip -\parskip\penalty 10000%
  2168. % Do complete processing of one @defun or @defunx line already parsed.
  2169. % @deffn Command forward-char nchars
  2170. \def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader}
  2171. \def\deffnheader #1#2#3{\doind {fn}{\code{#2}}%
  2172. \begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
  2173. \catcode 61=\other % Turn off change made in \defparsebody
  2174. % @defun == @deffn Function
  2175. \def\defun{\defparsebody\Edefun\defunx\defunheader}
  2176. \def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
  2177. \begingroup\defname {#1}{Function}%
  2178. \defunargs {#2}\endgroup %
  2179. \catcode 61=\other % Turn off change made in \defparsebody
  2180. % @deftypefun int foobar (int @var{foo}, float @var{bar})
  2181. \def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader}
  2182. % #1 is the data type.  #2 is the name and args.
  2183. \def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax}
  2184. % #1 is the data type, #2 the name, #3 the args.
  2185. \def\deftypefunheaderx #1#2 #3\relax{%
  2186. \doind {fn}{\code{#2}}% Make entry in function index
  2187. \begingroup\defname {\code{#1} #2}{Function}%
  2188. \deftypefunargs {#3}\endgroup %
  2189. \catcode 61=\other % Turn off change made in \defparsebody
  2190. % @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
  2191. \def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
  2192. % #1 is the classification.  #2 is the data type.  #3 is the name and args.
  2193. \def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax}
  2194. % #1 is the classification, #2 the data type, #3 the name, #4 the args.
  2195. \def\deftypefnheaderx #1#2#3 #4\relax{%
  2196. \doind {fn}{\code{#3}}% Make entry in function index
  2197. \begingroup\defname {\code{#2} #3}{#1}%
  2198. \deftypefunargs {#4}\endgroup %
  2199. \catcode 61=\other % Turn off change made in \defparsebody
  2200. % @defmac == @deffn Macro
  2201. \def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
  2202. \def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
  2203. \begingroup\defname {#1}{Macro}%
  2204. \defunargs {#2}\endgroup %
  2205. \catcode 61=\other % Turn off change made in \defparsebody
  2206. % @defspec == @deffn Special Form
  2207. \def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
  2208. \def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
  2209. \begingroup\defname {#1}{Special Form}%
  2210. \defunargs {#2}\endgroup %
  2211. \catcode 61=\other % Turn off change made in \defparsebody
  2212. % This definition is run if you use @defunx
  2213. % anywhere other than immediately after a @defun or @defunx.
  2214. \def\deffnx #1 {\errmessage{@deffnx in invalid context}}
  2215. \def\defunx #1 {\errmessage{@defunx in invalid context}}
  2216. \def\defmacx #1 {\errmessage{@defmacx in invalid context}}
  2217. \def\defspecx #1 {\errmessage{@defspecx in invalid context}}
  2218. \def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}}
  2219. \def\deftypeunx #1 {\errmessage{@deftypeunx in invalid context}}
  2220. % @defmethod, and so on
  2221. % @defop {Funny Method} foo-class frobnicate argument
  2222. \def\defop #1 {\def\defoptype{#1}%
  2223. \defopparsebody\Edefop\defopx\defopheader\defoptype}
  2224. \def\defopheader #1#2#3{%
  2225. \dosubind {fn}{\code{#2}}{on #1}% Make entry in function index
  2226. \begingroup\defname {#2}{\defoptype{} on #1}%
  2227. \defunargs {#3}\endgroup %
  2228. % @defmethod == @defop Method
  2229. \def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
  2230. \def\defmethodheader #1#2#3{%
  2231. \dosubind {fn}{\code{#2}}{on #1}% entry in function index
  2232. \begingroup\defname {#2}{Method on #1}%
  2233. \defunargs {#3}\endgroup %
  2234. % @defcv {Class Option} foo-class foo-flag
  2235. \def\defcv #1 {\def\defcvtype{#1}%
  2236. \defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
  2237. \def\defcvarheader #1#2#3{%
  2238. \dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
  2239. \begingroup\defname {#2}{\defcvtype{} of #1}%
  2240. \defvarargs {#3}\endgroup %
  2241. % @defivar == @defcv {Instance Variable}
  2242. \def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
  2243. \def\defivarheader #1#2#3{%
  2244. \dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
  2245. \begingroup\defname {#2}{Instance Variable of #1}%
  2246. \defvarargs {#3}\endgroup %
  2247. % These definitions are run if you use @defmethodx, etc.,
  2248. % anywhere other than immediately after a @defmethod, etc.
  2249. \def\defopx #1 {\errmessage{@defopx in invalid context}}
  2250. \def\defmethodx #1 {\errmessage{@defmethodx in invalid context}}
  2251. \def\defcvx #1 {\errmessage{@defcvx in invalid context}}
  2252. \def\defivarx #1 {\errmessage{@defivarx in invalid context}}
  2253. % Now @defvar
  2254. % First, define the processing that is wanted for arguments of @defvar.
  2255. % This is actually simple: just print them in roman.
  2256. % This must expand the args and terminate the paragraph they make up
  2257. \def\defvarargs #1{\normalparens #1%
  2258. \interlinepenalty=10000
  2259. \endgraf\penalty 10000\vskip -\parskip\penalty 10000}
  2260. % @defvr Counter foo-count
  2261. \def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader}
  2262. \def\defvrheader #1#2#3{\doind {vr}{\code{#2}}%
  2263. \begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup}
  2264. % @defvar == @defvr Variable
  2265. \def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader}
  2266. \def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
  2267. \begingroup\defname {#1}{Variable}%
  2268. \defvarargs {#2}\endgroup %
  2269. % @defopt == @defvr {User Option}
  2270. \def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader}
  2271. \def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
  2272. \begingroup\defname {#1}{User Option}%
  2273. \defvarargs {#2}\endgroup %
  2274. % @deftypevar int foobar
  2275. \def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader}
  2276. % #1 is the data type.  #2 is the name.
  2277. \def\deftypevarheader #1#2{%
  2278. \doind {vr}{\code{#2}}% Make entry in variables index
  2279. \begingroup\defname {\code{#1} #2}{Variable}%
  2280. \interlinepenalty=10000
  2281. \endgraf\penalty 10000\vskip -\parskip\penalty 10000
  2282. \endgroup}
  2283. % @deftypevr {Global Flag} int enable
  2284. \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
  2285. \def\deftypevrheader #1#2#3{\doind {vr}{\code{#3}}%
  2286. \begingroup\defname {\code{#2} #3}{#1}
  2287. \interlinepenalty=10000
  2288. \endgraf\penalty 10000\vskip -\parskip\penalty 10000
  2289. \endgroup}
  2290. % This definition is run if you use @defvarx
  2291. % anywhere other than immediately after a @defvar or @defvarx.
  2292. \def\defvrx #1 {\errmessage{@defvrx in invalid context}}
  2293. \def\defvarx #1 {\errmessage{@defvarx in invalid context}}
  2294. \def\defoptx #1 {\errmessage{@defoptx in invalid context}}
  2295. \def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context}}
  2296. \def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context}}
  2297. % Now define @deftp
  2298. % Args are printed in bold, a slight difference from @defvar.
  2299. \def\deftpargs #1{\bf \defvarargs{#1}}
  2300. % @deftp Class window height width ...
  2301. \def\deftp{\defvrparsebody\Edeftp\deftpx\deftpheader}
  2302. \def\deftpheader #1#2#3{\doind {tp}{\code{#2}}%
  2303. \begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
  2304. % This definition is run if you use @deftpx, etc
  2305. % anywhere other than immediately after a @deftp, etc.
  2306. \def\deftpx #1 {\errmessage{@deftpx in invalid context}}
  2307. \message{cross reference,}
  2308. % Define cross-reference macros
  2309. \newwrite \auxfile
  2310. \newif\ifhavexrefs  % True if xref values are known.
  2311. \newif\ifwarnedxrefs  % True if we warned once that they aren't known.
  2312. % \setref{foo} defines a cross-reference point named foo.
  2313. \def\setref#1{%
  2314. %\dosetq{#1-title}{Ytitle}%
  2315. \dosetq{#1-pg}{Ypagenumber}%
  2316. \dosetq{#1-snt}{Ysectionnumberandtype}}
  2317. \def\unnumbsetref#1{%
  2318. %\dosetq{#1-title}{Ytitle}%
  2319. \dosetq{#1-pg}{Ypagenumber}%
  2320. \dosetq{#1-snt}{Ynothing}}
  2321. \def\appendixsetref#1{%
  2322. %\dosetq{#1-title}{Ytitle}%
  2323. \dosetq{#1-pg}{Ypagenumber}%
  2324. \dosetq{#1-snt}{Yappendixletterandtype}}
  2325. % \xref, \pxref, and \ref generate cross-references to specified points.
  2326. % For \xrefX, #1 is the node name, #2 the name of the Info
  2327. % cross-reference, #3 the printed node name, #4 the name of the Info
  2328. % file, #5 the name of the printed manual.  All but the node name can be
  2329. % omitted.
  2330. \def\pxref#1{see \xrefX[#1,,,,,,,]}
  2331. \def\xref#1{See \xrefX[#1,,,,,,,]}
  2332. \def\ref#1{\xrefX[#1,,,,,,,]}
  2333. \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup%
  2334. \def\printedmanual{\ignorespaces #5}%
  2335. \def\printednodename{\ignorespaces #3}%
  2336. \setbox1=\hbox{\printedmanual}%
  2337. \setbox0=\hbox{\printednodename}%
  2338. \ifdim \wd0=0pt%
  2339. \def\printednodename{\ignorespaces #1}%
  2340. %%% Uncommment the following line to make the actual chapter or section title
  2341. %%% appear inside the square brackets.
  2342. %\def\printednodename{#1-title}%
  2343. % If we use \unhbox0 and \unhbox1 to print the node names, TeX does
  2344. % not insert empty discretionaries after hyphens, which means that it
  2345. % will not find a line break at a hyphen in a node names.  Since some
  2346. % manuals are best written with fairly long node names, containing
  2347. % hyphens, this is a loss.  Therefore, we simply give the text of
  2348. % the node name again, so it is as if TeX is seeing it for the first
  2349. % time.
  2350. \ifdim \wd1>0pt
  2351. section ``\printednodename'' in \cite{\printedmanual}%
  2352. \else%
  2353. \turnoffactive%
  2354. \refx{#1-snt}{} [\printednodename], page\tie\refx{#1-pg}{}%
  2355. \endgroup}
  2356. % \dosetq is the interface for calls from other macros
  2357. % Use \turnoffactive so that punctuation chars such as underscore
  2358. % work in node names.
  2359. \def\dosetq #1#2{{\let\folio=0 \turnoffactive%
  2360. \edef\next{\write\auxfile{\internalsetq {#1}{#2}}}%
  2361. \next}}
  2362. % \internalsetq {foo}{page} expands into
  2363. % CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
  2364. % When the aux file is read, ' is the escape character
  2365. \def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}}
  2366. % Things to be expanded by \internalsetq
  2367. \def\Ypagenumber{\folio}
  2368. \def\Ytitle{\thischapter}
  2369. \def\Ynothing{}
  2370. \def\Ysectionnumberandtype{%
  2371. \ifnum\secno=0 Chapter\xreftie\the\chapno %
  2372. \else \ifnum \subsecno=0 Section\xreftie\the\chapno.\the\secno %
  2373. \else \ifnum \subsubsecno=0 %
  2374. Section\xreftie\the\chapno.\the\secno.\the\subsecno %
  2375. \else %
  2376. Section\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno %
  2377. \fi \fi \fi }
  2378. \def\Yappendixletterandtype{%
  2379. \ifnum\secno=0 Appendix\xreftie'char\the\appendixno{}%
  2380. \else \ifnum \subsecno=0 Section\xreftie'char\the\appendixno.\the\secno %
  2381. \else \ifnum \subsubsecno=0 %
  2382. Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno %
  2383. \else %
  2384. Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %
  2385. \fi \fi \fi }
  2386. \gdef\xreftie{'tie}
  2387. % Use TeX 3.0's \inputlineno to get the line number, for better error
  2388. % messages, but if we're using an old version of TeX, don't do anything.
  2389. \ifx\inputlineno\thisisundefined
  2390.   \let\linenumber = \empty % Non-3.0.
  2391. \else
  2392.   \def\linenumber{\the\inputlineno:\space}
  2393. % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
  2394. % If its value is nonempty, SUFFIX is output afterward.
  2395. \def\refx#1#2{%
  2396.   \expandafter\ifx\csname X#1\endcsname\relax
  2397.     % If not defined, say something at least.
  2398.     $\langle$un\-de\-fined$\rangle$%
  2399.     \ifhavexrefs
  2400.       \message{\linenumber Undefined cross reference `#1'.}%
  2401.     \else
  2402.       \ifwarnedxrefs\else
  2403.         \global\warnedxrefstrue
  2404.         \message{Cross reference values unknown; you must run TeX again.}%
  2405.       \fi
  2406.     \fi
  2407.   \else
  2408.     % It's defined, so just use it.
  2409.     \csname X#1\endcsname
  2410.   \fi
  2411.   #2% Output the suffix in any case.
  2412. % Read the last existing aux file, if any.  No error if none exists.
  2413. % This is the macro invoked by entries in the aux file.
  2414. \def\xrdef #1#2{
  2415. {\catcode`\'=\other\expandafter \gdef \csname X#1\endcsname {#2}}}
  2416. \def\readauxfile{%
  2417. \begingroup
  2418. \catcode `\^^@=\other
  2419. \catcode `\
  2420. =\other
  2421. \catcode `\
  2422. =\other
  2423. \catcode `\^^C=\other
  2424. \catcode `\^^D=\other
  2425. \catcode `\^^E=\other
  2426. \catcode `\^^F=\other
  2427. \catcode `\^^G=\other
  2428. \catcode `\^^H=\other
  2429. \catcode `\
  2430. =\other
  2431. \catcode `\^^L=\other
  2432. \catcode `\
  2433. =\other
  2434. \catcode `\
  2435. =\other
  2436. \catcode `\
  2437. =\other
  2438. \catcode `\
  2439. =\other
  2440. \catcode `\
  2441. =\other
  2442. \catcode `\
  2443. =\other
  2444. \catcode `\
  2445. =\other
  2446. \catcode `\
  2447. =\other
  2448. \catcode `\
  2449. =\other
  2450. \catcode `\
  2451. =\other
  2452. \catcode `\
  2453. =\other
  2454. \catcode `\
  2455. =\other
  2456. \catcode 26=\other
  2457. \catcode `\^^[=\other
  2458. \catcode `\^^\=\other
  2459. \catcode `\^^]=\other
  2460. \catcode `\^^^=\other
  2461. \catcode `\^^_=\other
  2462. \catcode `\@=\other
  2463. \catcode `\^=\other
  2464. \catcode `\~=\other
  2465. \catcode `\[=\other
  2466. \catcode `\]=\other
  2467. \catcode`\"=\other
  2468. \catcode`\_=\other
  2469. \catcode`\|=\other
  2470. \catcode`\<=\other
  2471. \catcode`\>=\other
  2472. \catcode `\$=\other
  2473. \catcode `\#=\other
  2474. \catcode `\&=\other
  2475. % the aux file uses ' as the escape.
  2476. % Turn off \ as an escape so we do not lose on
  2477. % entries which were dumped with control sequences in their names.
  2478. % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
  2479. % Reference to such entries still does not work the way one would wish,
  2480. % but at least they do not bomb out when the aux file is read in.
  2481. \catcode `\{=1 \catcode `\}=2
  2482. \catcode `\%=\other
  2483. \catcode `\'=0
  2484. \catcode `\\=\other
  2485. \openin 1 \jobname.aux
  2486. \ifeof 1 \else \closein 1 \input \jobname.aux \global\havexrefstrue
  2487. % Open the new aux file.  Tex will close it automatically at exit.
  2488. \openout \auxfile=\jobname.aux
  2489. \endgroup}
  2490. % Footnotes.
  2491. \newcount \footnoteno
  2492. % The trailing space in the following definition for supereject is
  2493. % vital for proper filling; pages come out unaligned when you do a
  2494. % pagealignmacro call if that space before the closing brace is
  2495. % removed.
  2496. \def\supereject{\par\penalty -20000\footnoteno =0 }
  2497. % @footnotestyle is meaningful for info output only..
  2498. \let\footnotestyle=\comment
  2499. \let\ptexfootnote=\footnote
  2500. {\catcode `\@=11
  2501. \long\gdef\footnote #1{\global\advance \footnoteno by \@ne
  2502. \unskip
  2503. \edef\thisfootno{$^{\the\footnoteno}$}%
  2504. \let\@sf\empty
  2505. \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
  2506. \thisfootno\@sf \footnotezzz{#1}}
  2507. % \parsearg\footnotezzz}
  2508. \long\gdef\footnotezzz #1{\insert\footins{
  2509. \interlinepenalty\interfootnotelinepenalty
  2510. \splittopskip\ht\strutbox % top baseline for broken footnotes
  2511. \splitmaxdepth\dp\strutbox \floatingpenalty\@MM
  2512. \leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip
  2513. \footstrut\parindent=\defaultparindent\hang\textindent{\thisfootno}#1\strut}}
  2514. }%end \catcode `\@=11
  2515. % End of control word definitions.
  2516. \message{and turning on texinfo input format.}
  2517. \def\openindices{%
  2518.    \newindex{cp}%
  2519.    \newcodeindex{fn}%
  2520.    \newcodeindex{vr}%
  2521.    \newcodeindex{tp}%
  2522.    \newcodeindex{ky}%
  2523.    \newcodeindex{pg}%
  2524. % Set some numeric style parameters, for 8.5 x 11 format.
  2525. %\hsize = 6.5in
  2526. \newdimen\defaultparindent \defaultparindent = 15pt
  2527. \parindent = \defaultparindent
  2528. \parskip 18pt plus 1pt
  2529. \baselineskip 15pt
  2530. \advance\topskip by 1.2cm
  2531. % Prevent underfull vbox error messages.
  2532. \vbadness=10000
  2533. % Following George Bush, just get rid of widows and orphans.
  2534. \widowpenalty=10000
  2535. \clubpenalty=10000
  2536. % Use TeX 3.0's \emergencystretch to help line breaking, but if we're
  2537. % using an old version of TeX, don't do anything.  We want the amount of
  2538. % stretch added to depend on the line length, hence the dependence on
  2539. % \hsize.  This makes it come to about 9pt for the 8.5x11 format.
  2540. \ifx\emergencystretch\thisisundefined \else
  2541.   \emergencystretch = \hsize
  2542.   \divide\emergencystretch by 45
  2543. % Use @smallbook to reset parameters for 7x9.5 format  (or else 7x9.25)
  2544. \def\smallbook{
  2545. \global\lispnarrowing = 0.3in
  2546. \global\baselineskip 12pt
  2547. \advance\topskip by -1cm
  2548. \global\parskip 3pt plus 1pt
  2549. \global\hsize = 5in
  2550. \global\doublecolumnhsize=2.4in \global\doublecolumnvsize=15.0in
  2551. \global\vsize=7.5in
  2552. \global\tolerance=700
  2553. \global\hfuzz=1pt
  2554. \global\contentsrightmargin=0pt
  2555. \global\pagewidth=\hsize
  2556. \global\pageheight=\vsize
  2557. \global\let\smalllisp=\smalllispx
  2558. \global\let\smallexample=\smalllispx
  2559. \global\def\Esmallexample{\Esmalllisp}
  2560. % Use @afourpaper to print on European A4 paper.
  2561. \def\afourpaper{
  2562. \global\tolerance=700
  2563. \global\hfuzz=1pt
  2564. \global\baselineskip=12pt
  2565. \global\parskip 15pt plus 1pt
  2566. \global\vsize= 53\baselineskip
  2567. \advance\vsize by \topskip
  2568. %\global\hsize=   5.85in     % A4 wide 10pt
  2569. \global\hsize=  6.5in
  2570. \global\outerhsize=\hsize
  2571. \global\advance\outerhsize by 0.5in
  2572. \global\outervsize=\vsize
  2573. \global\advance\outervsize by 0.6in
  2574. \global\doublecolumnhsize=\hsize
  2575. \global\divide\doublecolumnhsize by 2
  2576. \global\advance\doublecolumnhsize by -0.1in
  2577. \global\doublecolumnvsize=\vsize
  2578. \global\multiply\doublecolumnvsize by 2
  2579. \global\advance\doublecolumnvsize by 0.1in
  2580. \global\pagewidth=\hsize
  2581. \global\pageheight=\vsize
  2582. %% For a final copy, take out the rectangles
  2583. %% that mark overfull boxes (in case you have decided
  2584. %% that the text looks ok even though it passes the margin).
  2585. \def\finalout{\overfullrule=0pt}
  2586. % Define macros to output various characters with catcode for normal text.
  2587. \catcode`\"=\other
  2588. \catcode`\~=\other
  2589. \catcode`\^=\other
  2590. \catcode`\_=\other
  2591. \catcode`\|=\other
  2592. \catcode`\<=\other
  2593. \catcode`\>=\other
  2594. \catcode`\+=\other
  2595. \def\normaldoublequote{"}
  2596. \def\normaltilde{~}
  2597. \def\normalcaret{^}
  2598. \def\normalunderscore{_}
  2599. \def\normalverticalbar{|}
  2600. \def\normalless{<}
  2601. \def\normalgreater{>}
  2602. \def\normalplus{+}
  2603. % This macro is used to make a character print one way in ttfont
  2604. % where it can probably just be output, and another way in other fonts,
  2605. % where something hairier probably needs to be done.
  2606. % #1 is what to print if we are indeed using \tt; #2 is what to print
  2607. % otherwise.  Since all the Computer Modern typewriter fonts have zero
  2608. % interword stretch (and shrink), and it is reasonable to expect all
  2609. % typewriter fonts to have this, we can check that font parameter.
  2610. \def\ifusingtt#1#2{\ifdim \fontdimen3\the\font=0pt #1\else #2\fi}
  2611. % Turn off all special characters except @
  2612. % (and those which the user can use as if they were ordinary).
  2613. % Most of these we simply print from the \tt font, but for some, we can
  2614. % use math or other variants that look better in normal text.
  2615. \catcode`\"=\active
  2616. \def\activedoublequote{{\tt \char '042}}
  2617. \let"=\activedoublequote
  2618. \catcode`\~=\active
  2619. \def~{{\tt \char '176}}
  2620. \chardef\hat=`\^
  2621. \catcode`\^=\active
  2622. \def^{{\tt \hat}}
  2623. \catcode`\_=\active
  2624. \def_{\ifusingtt\normalunderscore\_}
  2625. % Subroutine for the previous macro.
  2626. \def\_{\lvvmode \kern.06em \vbox{\hrule width.3em height.1ex}}
  2627. % \lvvmode is equivalent in function to \leavevmode.
  2628. % Using \leavevmode runs into trouble when written out to
  2629. % an index file due to the expansion of \leavevmode into ``\unhbox
  2630. % \voidb@x'' ---which looks to TeX like ``\unhbox \voidb\x'' due to our
  2631. % magic tricks with @.
  2632. \def\lvvmode{\vbox to 0pt{}}
  2633. \catcode`\|=\active
  2634. \def|{{\tt \char '174}}
  2635. \chardef \less=`\<
  2636. \catcode`\<=\active
  2637. \def<{{\tt \less}}
  2638. \chardef \gtr=`\>
  2639. \catcode`\>=\active
  2640. \def>{{\tt \gtr}}
  2641. \catcode`\+=\active
  2642. \def+{{\tt \char 43}}
  2643. %\catcode 27=\active
  2644. %\def^^[{$\diamondsuit$}
  2645. % Used sometimes to turn off (effectively) the active characters
  2646. % even after parsing them.
  2647. \def\turnoffactive{\let"=\normaldoublequote
  2648. \let~=\normaltilde
  2649. \let^=\normalcaret
  2650. \let_=\normalunderscore
  2651. \let|=\normalverticalbar
  2652. \let<=\normalless
  2653. \let>=\normalgreater
  2654. \let+=\normalplus}
  2655. % Set up an active definition for =, but don't enable it most of the time.
  2656. {\catcode`\==\active
  2657. \global\def={{\tt \char 61}}}
  2658. \catcode`\@=0
  2659. % \rawbackslashxx output one backslash character in current font
  2660. \global\chardef\rawbackslashxx=`\\
  2661. %{\catcode`\\=\other
  2662. %@gdef@rawbackslashxx{\}}
  2663. % \rawbackslash redefines \ as input to do \rawbackslashxx.
  2664. {\catcode`\\=\active
  2665. @gdef@rawbackslash{@let\=@rawbackslashxx }}
  2666. % \normalbackslash outputs one backslash in fixed width font.
  2667. \def\normalbackslash{{\tt\rawbackslashxx}}
  2668. % Say @foo, not \foo, in error messages.
  2669. \escapechar=`\@
  2670. % \catcode 17=0   % Define control-q
  2671. \catcode`\\=\active
  2672. % If a .fmt file is being used, we don't want the `\input texinfo' to show up.
  2673. % That is what \eatinput is for; after that, the `\' should revert to printing 
  2674. % a backslash.
  2675. @gdef@eatinput input texinfo{@fixbackslash}
  2676. @global@let\ = @eatinput
  2677. % On the other hand, perhaps the file did not have a `\input texinfo'. Then
  2678. % the first `\{ in the file would cause an error. This macro tries to fix 
  2679. % that, assuming it is called before the first `\' could plausibly occur.
  2680. @gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi}
  2681. %% These look ok in all fonts, so just make them not special.  The @rm below
  2682. %% makes sure that the current font starts out as the newly loaded cmr10
  2683. @catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other
  2684. @textfonts
  2685. @c Local variables:
  2686. @c page-delimiter: "^\\\\message"
  2687. @c End:
  2688.