home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / modelers / geomview / source.lha / Geomview / doc / texinfo.tex < prev   
Encoding:
Text File  |  1993-09-07  |  116.6 KB  |  3,656 lines

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