home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / lucid / lemacs-19.6 / man / texinfo.tex < prev    next >
Encoding:
Text File  |  1992-06-29  |  97.0 KB  |  3,080 lines

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