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