Initial Commit
[packages] / mule-packages / lookup / texi / texinfo.tex
1 % texinfo.tex -- TeX macros to handle Texinfo files.
2 \def\texinfoversion{1998-09-30}%
3 %
4 % Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98
5 % Free Software Foundation, Inc.
6 %
7 % This texinfo.tex file is free software; you can redistribute it and/or
8 % modify it under the terms of the GNU General Public License as
9 % published by the Free Software Foundation; either version 2, or (at
10 % your option) any later version.
11 %
12 % This texinfo.tex file is distributed in the hope that it will be
13 % useful, but WITHOUT ANY WARRANTY; without even the implied warranty
14 % of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 % General Public License for more details.
16 %
17 % You should have received a copy of the GNU General Public License
18 % along with this texinfo.tex file; see the file COPYING.  If not, write
19 % to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 % Boston, MA 02111-1307, USA.
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 % Please try the latest version of texinfo.tex before submitting bug
27 % reports; you can get the latest version from:
28 %   ftp://ftp.gnu.org/pub/gnu/texinfo.tex
29 %   /home/gd/gnu/doc/texinfo.tex on the GNU machines.
30 %   (and all GNU mirrors, see http://www.gnu.org/order/ftp.html)
31 %   ftp://tug.org/tex/texinfo.tex
32 %   ftp://ctan.org/macros/texinfo/texinfo.tex
33 %   (and all CTAN mirrors, finger ctan@ctan.org for a list).
34 % The texinfo.tex in the texinfo distribution itself could well be out
35 % of date, so if that's what you're using, please check.
36
37 % Send bug reports to bug-texinfo@gnu.org.
38 % Please include a precise test case in each bug report,
39 % including a complete document with which we can reproduce the problem.
40
41 % To process a Texinfo manual with TeX, it's most reliable to use the
42 % texi2dvi shell script that comes with the distribution.  For simple
43 % manuals, however, you can get away with:
44 %   tex foo.texi
45 %   texindex foo.??
46 %   tex foo.texi
47 %   tex foo.texi
48 %   dvips foo.dvi -o # or whatever, to process the dvi file.
49 % The extra runs of TeX get the cross-reference information correct.
50 % Sometimes one run after texindex suffices, and sometimes you need more
51 % than two; texi2dvi does it as many times as necessary.
52
53 %************************************************
54 % Patch for ASCII/NTT Jtexinfo by ntp@isl.mei.co.jp, kusumi@isl.mei.co.jp
55 % Original patch for NTT Jtexinfo by S. Tomura
56 %************************************************
57
58 \newif\ifisJTeX
59 \newif\ifisASCII
60
61 \expandafter\ifx\csname gtfam\endcsname\relax
62   % not ASCIITeX
63   \expandafter\ifx\csname jfont\endcsname\relax
64     % nor NTTTeX
65     \isJTeXfalse
66   \else
67     \isJTeXtrue
68     \isASCIIfalse
69   \fi
70 \else
71   \isJTeXtrue
72   \isASCIItrue
73 \fi
74
75 \ifisJTeX
76   \def\ASCJtexinfoversion{j1.05}
77   \message{  with ASCII/NTT jtexinfo extension [Version \ASCJtexinfoversion]:}
78   \ifisASCII
79     \message{Hmm, Your Japanese-TeX seems to be an ASCII version. Loading.}
80   \else
81     \message{Hmm, Your Japanese-TeX seems to be an NTT version. Loading.}
82   \fi
83 \fi
84
85
86 % Make it possible to create a .fmt file just by loading this file:
87 % if the underlying format is not loaded, start by loading it now.
88 % Added by gildea November 1993.
89 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
90
91 \message{Loading texinfo [version \texinfoversion]:}
92
93 % If in a .fmt file, print the version number
94 % and turn on active characters that we couldn't do earlier because
95 % they might have appeared in the input file name.
96 \everyjob{\message{[Texinfo version \texinfoversion]}%
97   \catcode`+=\active \catcode`\_=\active}
98
99 % Save some parts of plain tex whose names we will redefine.
100
101 \let\ptexb=\b
102 \let\ptexbullet=\bullet
103 \let\ptexc=\c
104 \let\ptexcomma=\,
105 \let\ptexdot=\.
106 \let\ptexdots=\dots
107 \let\ptexend=\end
108 \let\ptexequiv=\equiv
109 \let\ptexexclam=\!
110 \let\ptexi=\i
111 \let\ptexlbrace=\{
112 \let\ptexrbrace=\}
113 \let\ptexstar=\*
114 \let\ptext=\t
115
116 % We never want plain's outer \+ definition in Texinfo.
117 % For @tex, we can use \tabalign.
118 \let\+ = \relax
119
120
121 \message{Basics,}
122 \chardef\other=12
123
124 % If this character appears in an error message or help string, it
125 % starts a new line in the output.
126 \newlinechar = `^^J
127
128 % Set up fixed words for English if not already set.
129 \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
130 \ifx\putwordChapter\undefined  \gdef\putwordChapter{Chapter}\fi
131 \ifx\putwordfile\undefined     \gdef\putwordfile{file}\fi
132 \ifx\putwordInfo\undefined     \gdef\putwordInfo{Info}\fi
133 \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
134 \ifx\putwordon\undefined       \gdef\putwordon{on}\fi
135 \ifx\putwordpage\undefined     \gdef\putwordpage{page}\fi
136 \ifx\putwordsection\undefined  \gdef\putwordsection{section}\fi
137 \ifx\putwordSection\undefined  \gdef\putwordSection{Section}\fi
138 \ifx\putwordsee\undefined      \gdef\putwordsee{see}\fi
139 \ifx\putwordSee\undefined      \gdef\putwordSee{See}\fi
140 \ifx\putwordShortContents\undefined  \gdef\putwordShortContents{Short Contents}\fi
141 \ifx\putwordTableofContents\undefined\gdef\putwordTableofContents{Table of Contents}\fi
142
143 % Ignore a token.
144 %
145 \def\gobble#1{}
146
147 \hyphenation{ap-pen-dix}
148 \hyphenation{mini-buf-fer mini-buf-fers}
149 \hyphenation{eshell}
150 \hyphenation{white-space}
151
152 % Margin to add to right of even pages, to left of odd pages.
153 \newdimen \bindingoffset
154 \newdimen \normaloffset
155 \newdimen\pagewidth \newdimen\pageheight
156
157 % Sometimes it is convenient to have everything in the transcript file
158 % and nothing on the terminal.  We don't just call \tracingall here,
159 % since that produces some useless output on the terminal.
160 %
161 \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
162 \ifx\eTeXversion\undefined
163 \def\loggingall{\tracingcommands2 \tracingstats2
164    \tracingpages1 \tracingoutput1 \tracinglostchars1
165    \tracingmacros2 \tracingparagraphs1 \tracingrestores1
166    \showboxbreadth\maxdimen\showboxdepth\maxdimen
167 }%
168 \else
169 \def\loggingall{\tracingcommands3 \tracingstats2
170    \tracingpages1 \tracingoutput1 \tracinglostchars1
171    \tracingmacros2 \tracingparagraphs1 \tracingrestores1
172    \tracingscantokens1 \tracingassigns1 \tracingifs1
173    \tracinggroups1 \tracingnesting2
174    \showboxbreadth\maxdimen\showboxdepth\maxdimen
175 }%
176 \fi
177
178 % For @cropmarks command.
179 % Do @cropmarks to get crop marks.
180
181 \newif\ifcropmarks
182 \let\cropmarks = \cropmarkstrue
183 %
184 % Dimensions to add cropmarks at corners.
185 % Added by P. A. MacKay, 12 Nov. 1986
186 %
187 \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
188 \newdimen\cornerlong  \cornerlong=1pc
189 \newdimen\cornerthick \cornerthick=.3pt
190 \newdimen\topandbottommargin \topandbottommargin=.75in
191
192 % Main output routine.
193 \chardef\PAGE = 255
194 \output = {\onepageout{\pagecontents\PAGE}}
195
196 \newbox\headlinebox
197 \newbox\footlinebox
198
199 % \onepageout takes a vbox as an argument.  Note that \pagecontents
200 % does insertions, but you have to call it yourself.
201 \def\onepageout#1{%
202   \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
203   %
204   \ifodd\pageno  \advance\hoffset by \bindingoffset
205   \else \advance\hoffset by -\bindingoffset\fi
206   %
207   % Do this outside of the \shipout so @code etc. will be expanded in
208   % the headline as they should be, not taken literally (outputting ''code).
209   \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
210   \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
211   %
212   {%
213     % Have to do this stuff outside the \shipout because we want it to
214     % take effect in \write's, yet the group defined by the \vbox ends
215     % before the \shipout runs.
216     %
217     \escapechar = `\\     % use backslash in output files.
218     \indexdummies         % don't expand commands in the output.
219     \normalturnoffactive  % \ in index entries must not stay \, e.g., if
220                    % the page break happens to be in the middle of an example.
221     \shipout\vbox{%
222       \ifcropmarks \vbox to \outervsize\bgroup
223         \hsize = \outerhsize
224         \line{\ewtop\hfil\ewtop}%
225         \nointerlineskip
226         \line{%
227           \vbox{\moveleft\cornerthick\nstop}%
228           \hfill
229           \vbox{\moveright\cornerthick\nstop}%
230         }%
231         \vskip\topandbottommargin
232         \line\bgroup
233           \hfil % center the page within the outer (page) hsize.
234           \ifodd\pageno\hskip\bindingoffset\fi
235           \vbox\bgroup
236       \fi
237       %
238       \unvbox\headlinebox
239       \pagebody{#1}%
240       \ifdim\ht\footlinebox > 0pt
241         % Only leave this space if the footline is nonempty.
242         % (We lessened \vsize for it in \oddfootingxxx.)
243         % The \baselineskip=24pt in plain's \makefootline has no effect.
244         \vskip 2\baselineskip
245         \unvbox\footlinebox
246       \fi
247       %
248       \ifcropmarks
249           \egroup % end of \vbox\bgroup
250         \hfil\egroup % end of (centering) \line\bgroup
251         \vskip\topandbottommargin plus1fill minus1fill
252         \boxmaxdepth = \cornerthick
253         \line{%
254           \vbox{\moveleft\cornerthick\nsbot}%
255           \hfill
256           \vbox{\moveright\cornerthick\nsbot}%
257         }%
258         \nointerlineskip
259         \line{\ewbot\hfil\ewbot}%
260       \egroup % \vbox from first cropmarks clause
261       \fi
262     }% end of \shipout\vbox
263   }% end of group with \turnoffactive
264   \advancepageno
265   \ifnum\outputpenalty>-20000 \else\dosupereject\fi
266 }
267
268 \newinsert\margin \dimen\margin=\maxdimen
269
270 \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
271 {\catcode`\@ =11
272 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
273 % marginal hacks, juha@viisa.uucp (Juha Takala)
274 \ifvoid\margin\else % marginal info is present
275   \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
276 \dimen@=\dp#1 \unvbox#1
277 \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
278 \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
279 }
280
281 % Here are the rules for the cropmarks.  Note that they are
282 % offset so that the space between them is truly \outerhsize or \outervsize
283 % (P. A. MacKay, 12 November, 1986)
284 %
285 \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
286 \def\nstop{\vbox
287   {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
288 \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
289 \def\nsbot{\vbox
290   {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
291
292 % Parse an argument, then pass it to #1.  The argument is the rest of
293 % the input line (except we remove a trailing comment).  #1 should be a
294 % macro which expects an ordinary undelimited TeX argument.
295 %
296 \def\parsearg#1{%
297   \let\next = #1%
298   \begingroup
299     \obeylines
300     \futurelet\temp\parseargx
301 }
302
303 % If the next token is an obeyed space (from an @example environment or
304 % the like), remove it and recurse.  Otherwise, we're done.
305 \def\parseargx{%
306   % \obeyedspace is defined far below, after the definition of \sepspaces.
307   \ifx\obeyedspace\temp
308     \expandafter\parseargdiscardspace
309   \else
310     \expandafter\parseargline
311   \fi
312 }
313
314 % Remove a single space (as the delimiter token to the macro call).
315 {\obeyspaces %
316  \gdef\parseargdiscardspace {\futurelet\temp\parseargx}}
317
318 {\obeylines %
319   \gdef\parseargline#1^^M{%
320     \endgroup % End of the group started in \parsearg.
321     %
322     % First remove any @c comment, then any @comment.
323     % Result of each macro is put in \toks0.
324     \argremovec #1\c\relax %
325     \expandafter\argremovecomment \the\toks0 \comment\relax %
326     %
327     % Call the caller's macro, saved as \next in \parsearg.
328     \expandafter\next\expandafter{\the\toks0}%
329   }%
330 }
331
332 % Since all \c{,omment} does is throw away the argument, we can let TeX
333 % do that for us.  The \relax here is matched by the \relax in the call
334 % in \parseargline; it could be more or less anything, its purpose is
335 % just to delimit the argument to the \c.
336 \def\argremovec#1\c#2\relax{\toks0 = {#1}}
337 \def\argremovecomment#1\comment#2\relax{\toks0 = {#1}}
338
339 % \argremovec{,omment} might leave us with trailing spaces, though; e.g.,
340 %    @end itemize  @c foo
341 % will have two active spaces as part of the argument with the
342 % `itemize'.  Here we remove all active spaces from #1, and assign the
343 % result to \toks0.
344 %
345 % This loses if there are any *other* active characters besides spaces
346 % in the argument -- _ ^ +, for example -- since they get expanded.
347 % Fortunately, Texinfo does not define any such commands.  (If it ever
348 % does, the catcode of the characters in questionwill have to be changed
349 % here.)  But this means we cannot call \removeactivespaces as part of
350 % \argremovec{,omment}, since @c uses \parsearg, and thus the argument
351 % that \parsearg gets might well have any character at all in it.
352 %
353 \def\removeactivespaces#1{%
354   \begingroup
355     \ignoreactivespaces
356     \edef\temp{#1}%
357     \global\toks0 = \expandafter{\temp}%
358   \endgroup
359 }
360
361 % Change the active space to expand to nothing.
362 %
363 \begingroup
364   \obeyspaces
365   \gdef\ignoreactivespaces{\obeyspaces\let =\empty}
366 \endgroup
367
368
369 \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
370
371 %% These are used to keep @begin/@end levels from running away
372 %% Call \inENV within environments (after a \begingroup)
373 \newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
374 \def\ENVcheck{%
375 \ifENV\errmessage{Still within an environment; press RETURN to continue}
376 \endgroup\fi} % This is not perfect, but it should reduce lossage
377
378 % @begin foo  is the same as @foo, for now.
379 \newhelp\EMsimple{Press RETURN to continue.}
380
381 \outer\def\begin{\parsearg\beginxxx}
382
383 \def\beginxxx #1{%
384 \expandafter\ifx\csname #1\endcsname\relax
385 {\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else
386 \csname #1\endcsname\fi}
387
388 % @end foo executes the definition of \Efoo.
389 %
390 \def\end{\parsearg\endxxx}
391 \def\endxxx #1{%
392   \removeactivespaces{#1}%
393   \edef\endthing{\the\toks0}%
394   %
395   \expandafter\ifx\csname E\endthing\endcsname\relax
396     \expandafter\ifx\csname \endthing\endcsname\relax
397       % There's no \foo, i.e., no ``environment'' foo.
398       \errhelp = \EMsimple
399       \errmessage{Undefined command `@end \endthing'}%
400     \else
401       \unmatchedenderror\endthing
402     \fi
403   \else
404     % Everything's ok; the right environment has been started.
405     \csname E\endthing\endcsname
406   \fi
407 }
408
409 % There is an environment #1, but it hasn't been started.  Give an error.
410 %
411 \def\unmatchedenderror#1{%
412   \errhelp = \EMsimple
413   \errmessage{This `@end #1' doesn't have a matching `@#1'}%
414 }
415
416 % Define the control sequence \E#1 to give an unmatched @end error.
417 %
418 \def\defineunmatchedend#1{%
419   \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}%
420 }
421
422
423 % Single-spacing is done by various environments (specifically, in
424 % \nonfillstart and \quotations).
425 \newskip\singlespaceskip \singlespaceskip = 12.5pt
426 \def\singlespace{%
427   % Why was this kern here?  It messes up equalizing space above and below
428   % environments.  --karl, 6may93
429   %{\advance \baselineskip by -\singlespaceskip
430   %\kern \baselineskip}%
431   \setleading \singlespaceskip
432 }
433
434 %% Simple single-character @ commands
435
436 % @@ prints an @
437 % Kludge this until the fonts are right (grr).
438 \def\@{{\tt\char64}}
439
440 % This is turned off because it was never documented
441 % and you can use @w{...} around a quote to suppress ligatures.
442 %% Define @` and @' to be the same as ` and '
443 %% but suppressing ligatures.
444 %\def\`{{`}}
445 %\def\'{{'}}
446
447 % Used to generate quoted braces.
448 \def\mylbrace {{\tt\char123}}
449 \def\myrbrace {{\tt\char125}}
450 \let\{=\mylbrace
451 \let\}=\myrbrace
452 \begingroup
453   % Definitions to produce actual \{ & \} command in an index.
454   \catcode`\{ = 12 \catcode`\} = 12
455   \catcode`\[ = 1 \catcode`\] = 2
456   \catcode`\@ = 0 \catcode`\\ = 12
457   @gdef@lbracecmd[\{]%
458   @gdef@rbracecmd[\}]%
459 @endgroup
460
461 % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
462 % Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H.
463 \let\, = \c
464 \let\dotaccent = \.
465 \def\ringaccent#1{{\accent23 #1}}
466 \let\tieaccent = \t
467 \let\ubaraccent = \b
468 \let\udotaccent = \d
469
470 % Other special characters: @questiondown @exclamdown
471 % Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss.
472 \def\questiondown{?`}
473 \def\exclamdown{!`}
474
475 % Dotless i and dotless j, used for accents.
476 \def\imacro{i}
477 \def\jmacro{j}
478 \def\dotless#1{%
479   \def\temp{#1}%
480   \ifx\temp\imacro \ptexi
481   \else\ifx\temp\jmacro \j
482   \else \errmessage{@dotless can be used only with i or j}%
483   \fi\fi
484 }
485
486 % Be sure we're in horizontal mode when doing a tie, since we make space
487 % equivalent to this in @example-like environments. Otherwise, a space
488 % at the beginning of a line will start with \penalty -- and
489 % since \penalty is valid in vertical mode, we'd end up putting the
490 % penalty on the vertical list instead of in the new paragraph.
491 {\catcode`@ = 11
492  % Avoid using \@M directly, because that causes trouble
493  % if the definition is written into an index file.
494  \global\let\tiepenalty = \@M
495  \gdef\tie{\leavevmode\penalty\tiepenalty\ }
496 }
497
498 % @: forces normal size whitespace following.
499 \def\:{\spacefactor=1000 }
500
501 % @* forces a line break.
502 \def\*{\hfil\break\hbox{}\ignorespaces}
503
504 % @. is an end-of-sentence period.
505 \def\.{.\spacefactor=3000 }
506
507 % @! is an end-of-sentence bang.
508 \def\!{!\spacefactor=3000 }
509
510 % @? is an end-of-sentence query.
511 \def\?{?\spacefactor=3000 }
512
513 % @w prevents a word break.  Without the \leavevmode, @w at the
514 % beginning of a paragraph, when TeX is still in vertical mode, would
515 % produce a whole line of output instead of starting the paragraph.
516 \def\w#1{\leavevmode\hbox{#1}}
517
518 % @group ... @end group forces ... to be all on one page, by enclosing
519 % it in a TeX vbox.  We use \vtop instead of \vbox to construct the box
520 % to keep its height that of a normal line.  According to the rules for
521 % \topskip (p.114 of the TeXbook), the glue inserted is
522 % max (\topskip - \ht (first item), 0).  If that height is large,
523 % therefore, no glue is inserted, and the space between the headline and
524 % the text is small, which looks bad.
525 %
526 \def\group{\begingroup
527   \ifnum\catcode13=\active \else
528     \errhelp = \groupinvalidhelp
529     \errmessage{@group invalid in context where filling is enabled}%
530   \fi
531   %
532   % The \vtop we start below produces a box with normal height and large
533   % depth; thus, TeX puts \baselineskip glue before it, and (when the
534   % next line of text is done) \lineskip glue after it.  (See p.82 of
535   % the TeXbook.)  Thus, space below is not quite equal to space
536   % above.  But it's pretty close.
537   \def\Egroup{%
538     \egroup           % End the \vtop.
539     \endgroup         % End the \group.
540   }%
541   %
542   \vtop\bgroup
543     % We have to put a strut on the last line in case the @group is in
544     % the midst of an example, rather than completely enclosing it.
545     % Otherwise, the interline space between the last line of the group
546     % and the first line afterwards is too small.  But we can't put the
547     % strut in \Egroup, since there it would be on a line by itself.
548     % Hence this just inserts a strut at the beginning of each line.
549     \everypar = {\strut}%
550     %
551     % Since we have a strut on every line, we don't need any of TeX's
552     % normal interline spacing.
553     \offinterlineskip
554     %
555     % OK, but now we have to do something about blank
556     % lines in the input in @example-like environments, which normally
557     % just turn into \lisppar, which will insert no space now that we've
558     % turned off the interline space.  Simplest is to make them be an
559     % empty paragraph.
560     \ifx\par\lisppar
561       \edef\par{\leavevmode \par}%
562       %
563       % Reset ^^M's definition to new definition of \par.
564       \obeylines
565     \fi
566     %
567     % Do @comment since we are called inside an environment such as
568     % @example, where each end-of-line in the input causes an
569     % end-of-line in the output.  We don't want the end-of-line after
570     % the `@group' to put extra space in the output.  Since @group
571     % should appear on a line by itself (according to the Texinfo
572     % manual), we don't worry about eating any user text.
573     \comment
574 }
575 %
576 % TeX puts in an \escapechar (i.e., `@') at the beginning of the help
577 % message, so this ends up printing `@group can only ...'.
578 %
579 \newhelp\groupinvalidhelp{%
580 group can only be used in environments such as @example,^^J%
581 where each line of input produces a line of output.}
582
583 % @need space-in-mils
584 % forces a page break if there is not space-in-mils remaining.
585
586 \newdimen\mil  \mil=0.001in
587
588 \def\need{\parsearg\needx}
589
590 % Old definition--didn't work.
591 %\def\needx #1{\par %
592 %% This method tries to make TeX break the page naturally
593 %% if the depth of the box does not fit.
594 %{\baselineskip=0pt%
595 %\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak
596 %\prevdepth=-1000pt
597 %}}
598
599 \def\needx#1{%
600   % Go into vertical mode, so we don't make a big box in the middle of a
601   % paragraph.
602   \par
603   %
604   % Don't add any leading before our big empty box, but allow a page
605   % break, since the best break might be right here.
606   \allowbreak
607   \nointerlineskip
608   \vtop to #1\mil{\vfil}%
609   %
610   % TeX does not even consider page breaks if a penalty added to the
611   % main vertical list is 10000 or more.  But in order to see if the
612   % empty box we just added fits on the page, we must make it consider
613   % page breaks.  On the other hand, we don't want to actually break the
614   % page after the empty box.  So we use a penalty of 9999.
615   %
616   % There is an extremely small chance that TeX will actually break the
617   % page at this \penalty, if there are no other feasible breakpoints in
618   % sight.  (If the user is using lots of big @group commands, which
619   % almost-but-not-quite fill up a page, TeX will have a hard time doing
620   % good page breaking, for example.)  However, I could not construct an
621   % example where a page broke at this \penalty; if it happens in a real
622   % document, then we can reconsider our strategy.
623   \penalty9999
624   %
625   % Back up by the size of the box, whether we did a page break or not.
626   \kern -#1\mil
627   %
628   % Do not allow a page break right after this kern.
629   \nobreak
630 }
631
632 % @br   forces paragraph break
633
634 \let\br = \par
635
636 % @dots{} output an ellipsis using the current font.
637 % We do .5em per period so that it has the same spacing in a typewriter
638 % font as three actual period characters.
639 %
640 \def\dots{%
641   \leavevmode
642   \hbox to 1.5em{%
643     \hskip 0pt plus 0.25fil minus 0.25fil
644     .\hss.\hss.%
645     \hskip 0pt plus 0.5fil minus 0.5fil
646   }%
647 }
648
649 % @enddots{} is an end-of-sentence ellipsis.
650
651 \def\enddots{%
652   \leavevmode
653   \hbox to 2em{%
654     \hskip 0pt plus 0.25fil minus 0.25fil
655     .\hss.\hss.\hss.%
656     \hskip 0pt plus 0.5fil minus 0.5fil
657   }%
658   \spacefactor=3000
659 }
660
661
662 % @page    forces the start of a new page
663 %
664 \def\page{\par\vfill\supereject}
665
666 % @exdent text....
667 % outputs text on separate line in roman font, starting at standard page margin
668
669 % This records the amount of indent in the innermost environment.
670 % That's how much \exdent should take out.
671 \newskip\exdentamount
672
673 % This defn is used inside fill environments such as @defun.
674 \def\exdent{\parsearg\exdentyyy}
675 \def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}}
676
677 % This defn is used inside nofill environments such as @example.
678 \def\nofillexdent{\parsearg\nofillexdentyyy}
679 \def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount
680 \leftline{\hskip\leftskip{\rm#1}}}}
681
682 % @inmargin{TEXT} puts TEXT in the margin next to the current paragraph.
683
684 \def\inmargin#1{%
685 \strut\vadjust{\nobreak\kern-\strutdepth
686   \vtop to \strutdepth{\baselineskip\strutdepth\vss
687   \llap{\rightskip=\inmarginspacing \vbox{\noindent #1}}\null}}}
688 \newskip\inmarginspacing \inmarginspacing=1cm
689 \def\strutdepth{\dp\strutbox}
690
691 %\hbox{{\rm#1}}\hfil\break}}
692
693 % @include file    insert text of that file as input.
694 % Allow normal characters that  we make active in the argument (a file name).
695 \def\include{\begingroup
696   \catcode`\\=12
697   \catcode`~=12
698   \catcode`^=12
699   \catcode`_=12
700   \catcode`|=12
701   \catcode`<=12
702   \catcode`>=12
703   \catcode`+=12
704   \parsearg\includezzz}
705 % Restore active chars for included file.
706 \def\includezzz#1{\endgroup\begingroup
707   % Read the included file in a group so nested @include's work.
708   \def\thisfile{#1}%
709   \input\thisfile
710 \endgroup}
711
712 \def\thisfile{}
713
714 % @center line   outputs that line, centered
715
716 \def\center{\parsearg\centerzzz}
717 \def\centerzzz #1{{\advance\hsize by -\leftskip
718 \advance\hsize by -\rightskip
719 \centerline{#1}}}
720
721 % @sp n   outputs n lines of vertical space
722
723 \def\sp{\parsearg\spxxx}
724 \def\spxxx #1{\vskip #1\baselineskip}
725
726 % @comment ...line which is ignored...
727 % @c is the same as @comment
728 % @ignore ... @end ignore  is another way to write a comment
729
730 \def\comment{\begingroup \catcode`\^^M=\other%
731 \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
732 \commentxxx}
733 {\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
734
735 \let\c=\comment
736
737 % @paragraphindent  is defined for the Info formatting commands only.
738 \let\paragraphindent=\comment
739
740 % Prevent errors for section commands.
741 % Used in @ignore and in failing conditionals.
742 \def\ignoresections{%
743 \let\chapter=\relax
744 \let\unnumbered=\relax
745 \let\top=\relax
746 \let\unnumberedsec=\relax
747 \let\unnumberedsection=\relax
748 \let\unnumberedsubsec=\relax
749 \let\unnumberedsubsection=\relax
750 \let\unnumberedsubsubsec=\relax
751 \let\unnumberedsubsubsection=\relax
752 \let\section=\relax
753 \let\subsec=\relax
754 \let\subsubsec=\relax
755 \let\subsection=\relax
756 \let\subsubsection=\relax
757 \let\appendix=\relax
758 \let\appendixsec=\relax
759 \let\appendixsection=\relax
760 \let\appendixsubsec=\relax
761 \let\appendixsubsection=\relax
762 \let\appendixsubsubsec=\relax
763 \let\appendixsubsubsection=\relax
764 \let\contents=\relax
765 \let\smallbook=\relax
766 \let\titlepage=\relax
767 }
768
769 % Used in nested conditionals, where we have to parse the Texinfo source
770 % and so want to turn off most commands, in case they are used
771 % incorrectly.
772 %
773 \def\ignoremorecommands{%
774   \let\defcodeindex = \relax
775   \let\defcv = \relax
776   \let\deffn = \relax
777   \let\deffnx = \relax
778   \let\defindex = \relax
779   \let\defivar = \relax
780   \let\defmac = \relax
781   \let\defmethod = \relax
782   \let\defop = \relax
783   \let\defopt = \relax
784   \let\defspec = \relax
785   \let\deftp = \relax
786   \let\deftypefn = \relax
787   \let\deftypefun = \relax
788   \let\deftypevar = \relax
789   \let\deftypevr = \relax
790   \let\defun = \relax
791   \let\defvar = \relax
792   \let\defvr = \relax
793   \let\ref = \relax
794   \let\xref = \relax
795   \let\printindex = \relax
796   \let\pxref = \relax
797   \let\settitle = \relax
798   \let\setchapternewpage = \relax
799   \let\setchapterstyle = \relax
800   \let\everyheading = \relax
801   \let\evenheading = \relax
802   \let\oddheading = \relax
803   \let\everyfooting = \relax
804   \let\evenfooting = \relax
805   \let\oddfooting = \relax
806   \let\headings = \relax
807   \let\include = \relax
808   \let\lowersections = \relax
809   \let\down = \relax
810   \let\raisesections = \relax
811   \let\up = \relax
812   \let\set = \relax
813   \let\clear = \relax
814   \let\item = \relax
815 }
816
817 % Ignore @ignore ... @end ignore.
818 %
819 \def\ignore{\doignore{ignore}}
820
821 % Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text.
822 %
823 \def\ifinfo{\doignore{ifinfo}}
824 \def\ifhtml{\doignore{ifhtml}}
825 \def\ifnottex{\doignore{ifnottex}}
826 \def\html{\doignore{html}}
827 \def\menu{\doignore{menu}}
828 \def\direntry{\doignore{direntry}}
829
830 % @dircategory CATEGORY  -- specify a category of the dir file
831 % which this file should belong to.  Ignore this in TeX.
832 \let\dircategory = \comment
833
834 % Ignore text until a line `@end #1'.
835 %
836 \def\doignore#1{\begingroup
837   % Don't complain about control sequences we have declared \outer.
838   \ignoresections
839   %
840   % Define a command to swallow text until we reach `@end #1'.
841   % This @ is a catcode 12 token (that is the normal catcode of @ in
842   % this texinfo.tex file).  We change the catcode of @ below to match.
843   \long\def\doignoretext##1@end #1{\enddoignore}%
844   %
845   % Make sure that spaces turn into tokens that match what \doignoretext wants.
846   \catcode32 = 10
847   %
848   % Ignore braces, too, so mismatched braces don't cause trouble.
849   \catcode`\{ = 9
850   \catcode`\} = 9
851   %
852   % We must not have @c interpreted as a control sequence.
853   \catcode`\@ = 12
854   %
855   % Make the letter c a comment character so that the rest of the line
856   % will be ignored. This way, the document can have (for example)
857   %   @c @end ifinfo
858   % and the @end ifinfo will be properly ignored.
859   % (We've just changed @ to catcode 12.)
860   \catcode`\c = 14
861   %
862   % And now expand that command.
863   \doignoretext
864 }
865
866 % What we do to finish off ignored text.
867 %
868 \def\enddoignore{\endgroup\ignorespaces}%
869
870 \newif\ifwarnedobs\warnedobsfalse
871 \def\obstexwarn{%
872   \ifwarnedobs\relax\else
873   % We need to warn folks that they may have trouble with TeX 3.0.
874   % This uses \immediate\write16 rather than \message to get newlines.
875     \immediate\write16{}
876     \immediate\write16{***WARNING*** for users of Unix TeX 3.0!}
877     \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).}
878     \immediate\write16{If you are running another version of TeX, relax.}
879     \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.}
880     \immediate\write16{  Then upgrade your TeX installation if you can.}
881     \immediate\write16{  (See ftp://ftp.gnu.ai.mit.edu/pub/gnu/TeX.README.)}
882     \immediate\write16{If you are stuck with version 3.0, run the}
883     \immediate\write16{  script ``tex3patch'' from the Texinfo distribution}
884     \immediate\write16{  to use a workaround.}
885     \immediate\write16{}
886     \global\warnedobstrue
887     \fi
888 }
889
890 % **In TeX 3.0, setting text in \nullfont hangs tex.  For a
891 % workaround (which requires the file ``dummy.tfm'' to be installed),
892 % uncomment the following line:
893 %%%%%\font\nullfont=dummy\let\obstexwarn=\relax
894
895 % Ignore text, except that we keep track of conditional commands for
896 % purposes of nesting, up to an `@end #1' command.
897 %
898 \def\nestedignore#1{%
899   \obstexwarn
900   % We must actually expand the ignored text to look for the @end
901   % command, so that nested ignore constructs work.  Thus, we put the
902   % text into a \vbox and then do nothing with the result.  To minimize
903   % the change of memory overflow, we follow the approach outlined on
904   % page 401 of the TeXbook: make the current font be a dummy font.
905   %
906   \setbox0 = \vbox\bgroup
907     % Don't complain about control sequences we have declared \outer.
908     \ignoresections
909     %
910     % Define `@end #1' to end the box, which will in turn undefine the
911     % @end command again.
912     \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}%
913     %
914     % We are going to be parsing Texinfo commands.  Most cause no
915     % trouble when they are used incorrectly, but some commands do
916     % complicated argument parsing or otherwise get confused, so we
917     % undefine them.
918     %
919     % We can't do anything about stray @-signs, unfortunately;
920     % they'll produce `undefined control sequence' errors.
921     \ignoremorecommands
922     %
923     % Set the current font to be \nullfont, a TeX primitive, and define
924     % all the font commands to also use \nullfont.  We don't use
925     % dummy.tfm, as suggested in the TeXbook, because not all sites
926     % might have that installed.  Therefore, math mode will still
927     % produce output, but that should be an extremely small amount of
928     % stuff compared to the main input.
929     %
930     \nullfont
931     \let\tenrm = \nullfont  \let\tenit = \nullfont  \let\tensl = \nullfont
932     \let\tenbf = \nullfont  \let\tentt = \nullfont  \let\smallcaps = \nullfont
933     \let\tensf = \nullfont
934     % Similarly for index fonts (mostly for their use in
935     % smallexample)
936     \let\indrm = \nullfont  \let\indit = \nullfont  \let\indsl = \nullfont
937     \let\indbf = \nullfont  \let\indtt = \nullfont  \let\indsc = \nullfont
938     \let\indsf = \nullfont
939     %
940     % Don't complain when characters are missing from the fonts.
941     \tracinglostchars = 0
942     %
943     % Don't bother to do space factor calculations.
944     \frenchspacing
945     %
946     % Don't report underfull hboxes.
947     \hbadness = 10000
948     %
949     % Do minimal line-breaking.
950     \pretolerance = 10000
951     %
952     % Do not execute instructions in @tex
953     \def\tex{\doignore{tex}}%
954     % Do not execute macro definitions.
955     % `c' is a comment character, so the word `macro' will get cut off.
956     \def\macro{\doignore{ma}}%
957 }
958
959 % @set VAR sets the variable VAR to an empty value.
960 % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
961 %
962 % Since we want to separate VAR from REST-OF-LINE (which might be
963 % empty), we can't just use \parsearg; we have to insert a space of our
964 % own to delimit the rest of the line, and then take it out again if we
965 % didn't need it.  Make sure the catcode of space is correct to avoid
966 % losing inside @example, for instance.
967 %
968 \def\set{\begingroup\catcode` =10
969   \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR.
970   \parsearg\setxxx}
971 \def\setxxx#1{\setyyy#1 \endsetyyy}
972 \def\setyyy#1 #2\endsetyyy{%
973   \def\temp{#2}%
974   \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty
975   \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted.
976   \fi
977   \endgroup
978 }
979 % Can't use \xdef to pre-expand #2 and save some time, since \temp or
980 % \next or other control sequences that we've defined might get us into
981 % an infinite loop. Consider `@set foo @cite{bar}'.
982 \def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}}
983
984 % @clear VAR clears (i.e., unsets) the variable VAR.
985 %
986 \def\clear{\parsearg\clearxxx}
987 \def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax}
988
989 % @value{foo} gets the text saved in variable foo.
990 %
991 {
992   \catcode`\_ = \active
993   %
994   % We might end up with active _ or - characters in the argument if
995   % we're called from @code, as @code{@value{foo-bar_}}.  So \let any
996   % such active characters to their normal equivalents.
997   \gdef\value{\begingroup
998     \catcode`\-=12 \catcode`\_=12
999     \indexbreaks \let_\normalunderscore
1000     \valuexxx}
1001 }
1002 \def\valuexxx#1{\expandablevalue{#1}\endgroup}
1003
1004 % We have this subroutine so that we can handle at least some @value's
1005 % properly in indexes (we \let\value to this in \indexdummies).  Ones
1006 % whose names contain - or _ still won't work, but we can't do anything
1007 % about that.  The command has to be fully expandable, since the result
1008 % winds up in the index file.  This means that if the variable's value
1009 % contains other Texinfo commands, it's almost certain it will fail
1010 % (although perhaps we could fix that with sufficient work to do a
1011 % one-level expansion on the result, instead of complete).
1012
1013 \def\expandablevalue#1{%
1014   \expandafter\ifx\csname SET#1\endcsname\relax
1015     {[No value for ``#1'']v}%
1016   \else
1017     \csname SET#1\endcsname
1018   \fi
1019 }
1020
1021 % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
1022 % with @set.
1023 %
1024 \def\ifset{\parsearg\ifsetxxx}
1025 \def\ifsetxxx #1{%
1026   \expandafter\ifx\csname SET#1\endcsname\relax
1027     \expandafter\ifsetfail
1028   \else
1029     \expandafter\ifsetsucceed
1030   \fi
1031 }
1032 \def\ifsetsucceed{\conditionalsucceed{ifset}}
1033 \def\ifsetfail{\nestedignore{ifset}}
1034 \defineunmatchedend{ifset}
1035
1036 % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
1037 % defined with @set, or has been undefined with @clear.
1038 %
1039 \def\ifclear{\parsearg\ifclearxxx}
1040 \def\ifclearxxx #1{%
1041   \expandafter\ifx\csname SET#1\endcsname\relax
1042     \expandafter\ifclearsucceed
1043   \else
1044     \expandafter\ifclearfail
1045   \fi
1046 }
1047 \def\ifclearsucceed{\conditionalsucceed{ifclear}}
1048 \def\ifclearfail{\nestedignore{ifclear}}
1049 \defineunmatchedend{ifclear}
1050
1051 % @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text
1052 % following, through the first @end iftex (etc.).  Make `@end iftex'
1053 % (etc.) valid only after an @iftex.
1054 %
1055 \def\iftex{\conditionalsucceed{iftex}}
1056 \def\ifnothtml{\conditionalsucceed{ifnothtml}}
1057 \def\ifnotinfo{\conditionalsucceed{ifnotinfo}}
1058 \defineunmatchedend{iftex}
1059 \defineunmatchedend{ifnothtml}
1060 \defineunmatchedend{ifnotinfo}
1061
1062 % We can't just want to start a group at @iftex (for example) and end it
1063 % at @end iftex, since then @set commands inside the conditional have no
1064 % effect (they'd get reverted at the end of the group).  So we must
1065 % define \Eiftex to redefine itself to be its previous value.  (We can't
1066 % just define it to fail again with an ``unmatched end'' error, since
1067 % the @ifset might be nested.)
1068 %
1069 \def\conditionalsucceed#1{%
1070   \edef\temp{%
1071     % Remember the current value of \E#1.
1072     \let\nece{prevE#1} = \nece{E#1}%
1073     %
1074     % At the `@end #1', redefine \E#1 to be its previous value.
1075     \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}%
1076   }%
1077   \temp
1078 }
1079
1080 % We need to expand lots of \csname's, but we don't want to expand the
1081 % control sequences after we've constructed them.
1082 %
1083 \def\nece#1{\expandafter\noexpand\csname#1\endcsname}
1084
1085 % @asis just yields its argument.  Used with @table, for example.
1086 %
1087 \def\asis#1{#1}
1088
1089 % @math means output in math mode.
1090 % We don't use $'s directly in the definition of \math because control
1091 % sequences like \math are expanded when the toc file is written.  Then,
1092 % we read the toc file back, the $'s will be normal characters (as they
1093 % should be, according to the definition of Texinfo).  So we must use a
1094 % control sequence to switch into and out of math mode.
1095 %
1096 % This isn't quite enough for @math to work properly in indices, but it
1097 % seems unlikely it will ever be needed there.
1098 %
1099 \let\implicitmath = $
1100 \def\math#1{\implicitmath #1\implicitmath}
1101
1102 % @bullet and @minus need the same treatment as @math, just above.
1103 \def\bullet{\implicitmath\ptexbullet\implicitmath}
1104 \def\minus{\implicitmath-\implicitmath}
1105
1106 % @refill is a no-op.
1107 \let\refill=\relax
1108
1109 % If working on a large document in chapters, it is convenient to
1110 % be able to disable indexing, cross-referencing, and contents, for test runs.
1111 % This is done with @novalidate (before @setfilename).
1112 %
1113 \newif\iflinks \linkstrue % by default we want the aux files.
1114 \let\novalidate = \linksfalse
1115
1116 % @setfilename is done at the beginning of every texinfo file.
1117 % So open here the files we need to have open while reading the input.
1118 % This makes it possible to make a .fmt file for texinfo.
1119 \def\setfilename{%
1120    \iflinks 
1121      \readauxfile
1122    \fi % \openindices needs to do some work in any case.
1123    \openindices
1124    \fixbackslash  % Turn off hack to swallow `\input texinfo'.
1125    \global\let\setfilename=\comment % Ignore extra @setfilename cmds.
1126    %
1127    % If texinfo.cnf is present on the system, read it.
1128    % Useful for site-wide @afourpaper, etc.
1129    % Just to be on the safe side, close the input stream before the \input.
1130    \openin 1 texinfo.cnf
1131    \ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi
1132    \closein1
1133    \temp
1134    %
1135    \comment % Ignore the actual filename.
1136 }
1137
1138 % Called from \setfilename.
1139
1140 \def\openindices{%
1141   \newindex{cp}%
1142   \newcodeindex{fn}%
1143   \newcodeindex{vr}%
1144   \newcodeindex{tp}%
1145   \newcodeindex{ky}%
1146   \newcodeindex{pg}%
1147 }
1148
1149 % @bye.
1150 \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
1151
1152
1153 \message{fonts,}
1154 % Font-change commands.
1155
1156 % Texinfo sort of supports the sans serif font style, which plain TeX does not.
1157 % So we set up a \sf analogous to plain's \rm, etc.
1158 \newfam\sffam
1159 \def\sf{\fam=\sffam \tensf}
1160 \let\li = \sf % Sometimes we call it \li, not \sf.
1161
1162 % We don't need math for this one.
1163 \def\ttsl{\tenttsl}
1164
1165 %**
1166 % For NTT TeX, define dummy font families compatible with ASCII.
1167 % Unfortunately, \newfam in the \if..\fi raise an error, so we should
1168 % redefine \newfam even with ASCII Japanese TeX.
1169 %
1170 \newfam\minfam \def\mc{\fam\minfam\tenmin}%
1171 \newfam\gtfam \def\gt{\fam\gtfam\tengt}%
1172 \ifisJTeX\else
1173 \let\mc=\relax
1174 \let\gt=\relax
1175 \fi
1176 %** by ntp@isl.mei
1177
1178 % Use Computer Modern fonts at \magstephalf (11pt).
1179 \newcount\mainmagstep
1180 \mainmagstep=\magstephalf
1181
1182 % Set the font macro #1 to the font named #2, adding on the
1183 % specified font prefix (normally `cm').
1184 % #3 is the font's design size, #4 is a scale factor
1185 \def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4}
1186
1187 % Use cm as the default font prefix.
1188 % To specify the font prefix, you must define \fontprefix
1189 % before you read in texinfo.tex.
1190 \ifx\fontprefix\undefined
1191 \def\fontprefix{cm}
1192 \fi
1193 % Support font families that don't use the same naming scheme as CM.
1194 \def\rmshape{r}
1195 \def\rmbshape{bx}               %where the normal face is bold
1196 \def\bfshape{b}
1197 \def\bxshape{bx}
1198 \def\ttshape{tt}
1199 \def\ttbshape{tt}
1200 %\def\ttslshape{sltt}
1201 \def\ttslshape{ti}
1202 \def\itshape{ti}
1203 \def\itbshape{ti}
1204 \def\slshape{sl}
1205 \def\slbshape{bx}
1206 \def\sfshape{ss}
1207 \def\sfbshape{ss}
1208 \def\scshape{csc}
1209 \def\scbshape{csc}
1210
1211 \ifx\bigger\relax
1212 \let\mainmagstep=\magstep1
1213 \setfont\textrm\rmshape{12}{1000}
1214 \setfont\texttt\ttshape{12}{1000}
1215 \else
1216 \setfont\textrm\rmshape{10}{\mainmagstep}
1217 \setfont\texttt\ttshape{10}{\mainmagstep}
1218 \fi
1219 % Instead of cmb10, you many want to use cmbx10.
1220 % cmbx10 is a prettier font on its own, but cmb10
1221 % looks better when embedded in a line with cmr10.
1222 \setfont\textbf\bfshape{10}{\mainmagstep}
1223 \setfont\textit\itshape{10}{\mainmagstep}
1224 \setfont\textsl\slshape{10}{\mainmagstep}
1225 \setfont\textsf\sfshape{10}{\mainmagstep}
1226 \setfont\textsc\scshape{10}{\mainmagstep}
1227 \setfont\textttsl\ttslshape{10}{\mainmagstep}
1228 \font\texti=cmmi10 scaled \mainmagstep
1229 \font\textsy=cmsy10 scaled \mainmagstep
1230 %**
1231 \ifisJTeX
1232 \ifisASCII
1233   \font\textmin=min10 scaled \mainmagstep
1234   \font\textgt=goth10 scaled \mainmagstep
1235 \else
1236   \jfont\textmin=dm10 scaled \mainmagstep
1237   \jfont\textgt=dg10 scaled \mainmagstep
1238 \fi
1239 \else
1240   \let\textmin=\relax
1241   \let\textgt=\relax
1242 \fi
1243 % ntp@isl.mei.co.jp
1244 %**
1245
1246 % A few fonts for @defun, etc.
1247 \setfont\defbf\bxshape{10}{\magstep1} %was 1314
1248 \setfont\deftt\ttshape{10}{\magstep1}
1249 %\def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf}
1250 %**
1251 \ifisJTeX
1252 \ifisASCII
1253   \font\defgt=min10 scaled \magstep1
1254 \else
1255   \jfont\defgt=dg10 scaled \magstep1 
1256 \fi
1257 \else
1258   \let\defgt=\relax
1259 \fi
1260 \def\df{\let\tentt=\deftt\let\tenbf=\defbf
1261         \let\tengt=\defgt \bf\gt} % ntp
1262
1263 % Fonts for indices and small examples (9pt).
1264 % We actually use the slanted font rather than the italic,
1265 % because texinfo normally uses the slanted fonts for that.
1266 % Do not make many font distinctions in general in the index, since they
1267 % aren't very useful.
1268 \setfont\ninett\ttshape{9}{1000}
1269 \setfont\ninettsl\ttslshape{10}{900}
1270 \setfont\indrm\rmshape{9}{1000}
1271 \setfont\indit\itshape{9}{1000}
1272 \setfont\indsl\slshape{9}{1000}
1273 \let\indtt=\ninett
1274 \let\indttsl=\ninettsl
1275 \let\indsf=\indrm
1276 \let\indbf=\indrm
1277 \setfont\indsc\scshape{10}{900}
1278 \font\indi=cmmi9
1279 \font\indsy=cmsy9
1280 \ifisJTeX
1281 \ifisASCII
1282   \font\indmin=min9
1283   \font\indgt=goth9
1284 \else
1285   \jfont\indmin=dm9
1286   \jfont\indgt=dg9
1287 \fi
1288 \else
1289   \let\indmin=\relax
1290   \let\indgt=\relax
1291 \fi
1292 \let\indmc=\indmin % ntp
1293
1294
1295 % Fonts for title page:
1296 \setfont\titlerm\rmbshape{12}{\magstep3}
1297 \setfont\titleit\itbshape{10}{\magstep4}
1298 \setfont\titlesl\slbshape{10}{\magstep4}
1299 \setfont\titlett\ttbshape{12}{\magstep3}
1300 \setfont\titlettsl\ttslshape{10}{\magstep4}
1301 \setfont\titlesf\sfbshape{17}{\magstep1}
1302 \let\titlebf=\titlerm
1303 \setfont\titlesc\scbshape{10}{\magstep4}
1304 \font\titlei=cmmi12 scaled \magstep3
1305 \font\titlesy=cmsy10 scaled \magstep4
1306 \ifisJTeX
1307 \ifisASCII
1308   \font\titlemc=goth10 scaled \magstep4
1309 \else
1310   \jfont\titlemc=dg10 scaled \magstep4
1311 \fi
1312 \else
1313 \let\titlemc=\relax
1314 \fi
1315 \def\authorrm{\secrm}
1316 % Chapter (and unnumbered) fonts (17.28pt).
1317 \setfont\chaprm\rmbshape{12}{\magstep2}
1318 \setfont\chapit\itbshape{10}{\magstep3}
1319 \setfont\chapsl\slbshape{10}{\magstep3}
1320 \setfont\chaptt\ttbshape{12}{\magstep2}
1321 \setfont\chapttsl\ttslshape{10}{\magstep3}
1322 \setfont\chapsf\sfbshape{17}{1000}
1323 \let\chapbf=\chaprm
1324 \setfont\chapsc\scbshape{10}{\magstep3}
1325 %\font\chapi=cmmi12 scaled \magstep2
1326 \font\chapi=cmmi10 scaled \magstep3 % ntp
1327 \font\chapsy=cmsy10 scaled \magstep3
1328 %**
1329 \ifisJTeX
1330 \ifisASCII
1331   \font\chapmin=goth10 scaled \magstep3
1332 \else
1333   \jfont\chapmin=dg10 scaled \magstep3
1334 \fi
1335 \else
1336   \let\chapmin=\relax
1337 \fi
1338 \let\chapgt=\chapmin
1339
1340 %**
1341
1342 % Section fonts (14.4pt).
1343 \setfont\secrm\rmbshape{12}{\magstep1}
1344 \setfont\secit\itbshape{10}{\magstep2}
1345 \setfont\secsl\slbshape{10}{\magstep2}
1346 \setfont\sectt\ttbshape{12}{\magstep1}
1347 \setfont\secttsl\ttslshape{10}{\magstep2}
1348 \setfont\secsf\sfbshape{12}{\magstep1}
1349 \let\secbf\secrm
1350 %**
1351 \ifisJTeX
1352 \ifisASCII
1353   \font\secmin=goth10 scaled \magstep2
1354 \else
1355   \jfont\secmin=dg10 scaled \magstep2
1356 \fi
1357 \else
1358   \let\secmin=\relax
1359 \fi
1360 \let\secgt=\secmin
1361 \ifisJTeX
1362   \let\authormc=\secmin
1363 \else
1364   \let\authormc=\relax
1365 \fi
1366 %**
1367 \setfont\secsc\scbshape{10}{\magstep2}
1368 %\font\seci=cmmi12 scaled \magstep1
1369 \font\seci=cmmi10 scaled \magstep2
1370 \font\secsy=cmsy10 scaled \magstep2
1371
1372 % \setfont\ssecrm\bxshape{10}{\magstep1}    % This size an font looked bad.
1373 % \setfont\ssecit\itshape{10}{\magstep1}    % The letters were too crowded.
1374 % \setfont\ssecsl\slshape{10}{\magstep1}
1375 % \setfont\ssectt\ttshape{10}{\magstep1}
1376 % \setfont\ssecsf\sfshape{10}{\magstep1}
1377
1378 %\setfont\ssecrm\bfshape{10}{1315}      % Note the use of cmb rather than cmbx.
1379 %\setfont\ssecit\itshape{10}{1315}      % Also, the size is a little larger than
1380 %\setfont\ssecsl\slshape{10}{1315}      % being scaled magstep1.
1381 %\setfont\ssectt\ttshape{10}{1315}
1382 %\setfont\ssecsf\sfshape{10}{1315}
1383
1384 %\let\ssecbf=\ssecrm
1385
1386 % Subsection fonts (13.15pt).
1387 \setfont\ssecrm\rmbshape{12}{\magstephalf}
1388 \setfont\ssecit\itbshape{10}{1315}
1389 \setfont\ssecsl\slbshape{10}{1315}
1390 \setfont\ssectt\ttbshape{12}{\magstephalf}
1391 \setfont\ssecttsl\ttslshape{10}{1315}
1392 \setfont\ssecsf\sfbshape{12}{\magstephalf}
1393 \let\ssecbf\ssecrm
1394 \setfont\ssecsc\scbshape{10}{\magstep1}
1395 \font\sseci=cmmi12 scaled \magstephalf
1396 \font\ssecsy=cmsy10 scaled 1315
1397 %**
1398 \ifisJTeX
1399 \ifisASCII
1400   \font\ssecmin=goth10 scaled \magstep1
1401 \else
1402   \jfont\ssecmin=dg10 scaled \magstep1
1403 \fi
1404 \else
1405   \let\ssecmin=\relax
1406 \fi
1407 \let\ssecgt=\ssecmin
1408 %**
1409 % The smallcaps and symbol fonts should actually be scaled \magstep1.5,
1410 % but that is not a standard magnification.
1411
1412 % In order for the font changes to affect most math symbols and letters,
1413 % we have to define the \textfont of the standard families.  Since
1414 % texinfo doesn't allow for producing subscripts and superscripts, we
1415 % don't bother to reset \scriptfont and \scriptscriptfont (which would
1416 % also require loading a lot more fonts).
1417 %
1418 \def\resetmathfonts{%
1419   \textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy
1420   \textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf
1421   \textfont\ttfam = \tentt \textfont\sffam = \tensf
1422   \ifisJTeX
1423   \ifisASCII
1424   \textfont\minfam = \tenmin \textfont\gtfam = \tengt % ntp
1425   \fi
1426   \fi
1427 }
1428
1429
1430 % The font-changing commands redefine the meanings of \tenSTYLE, instead
1431 % of just \STYLE.  We do this so that font changes will continue to work
1432 % in math mode, where it is the current \fam that is relevant in most
1433 % cases, not the current font.  Plain TeX does \def\bf{\fam=\bffam
1434 % \tenbf}, for example.  By redefining \tenbf, we obviate the need to
1435 % redefine \bf itself.
1436 \def\textfonts{%
1437   \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
1438   \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
1439   \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl
1440   \let\tenmin=\textmin \let\tengt=\textgt % ntp@isl.mei.co.jp
1441   \resetmathfonts}
1442 \def\titlefonts{%
1443   \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
1444   \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
1445   \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
1446   \let\tenttsl=\titlettsl
1447   \resetmathfonts \setleading{25pt}}
1448 \def\titlefont#1{{\titlefonts\rm\titlemc #1}}
1449 \def\chapfonts{%
1450   \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
1451   \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
1452   \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl
1453   \let\tenmin=\chapmin \let\tengt=\chapgt % ntp@isl.mei.co.jp
1454   \resetmathfonts \setleading{19pt}}
1455 \def\secfonts{%
1456   \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
1457   \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
1458   \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl
1459   \let\tenmin=\secmin \let\tengt=\secgt % ntp@isl.mei.co.jp
1460   \resetmathfonts \setleading{16pt}}
1461 \def\subsecfonts{%
1462   \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
1463   \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
1464   \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl
1465   \let\tenmin=\ssecmin \let\tengt=\ssecgt % ntp@isl.mei.co.jp
1466   \resetmathfonts \setleading{15pt}}
1467 \let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf?
1468 \def\indexfonts{%
1469   \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl
1470   \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc
1471   \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy \let\tenttsl=\indttsl
1472   \let\tenmin=\indmin \let\tengt=\indgt % ntp@isl.mei.co.jp
1473   \resetmathfonts \setleading{12pt}}
1474
1475 % Set up the default fonts, so we can use them for creating boxes.
1476 %
1477 \textfonts
1478
1479 % Define these so they can be easily changed for other fonts.
1480 \def\angleleft{$\langle$}
1481 \def\angleright{$\rangle$}
1482
1483 % Count depth in font-changes, for error checks
1484 \newcount\fontdepth \fontdepth=0
1485
1486 % Fonts for short table of contents.
1487 \setfont\shortcontrm\rmshape{12}{1000}
1488 \setfont\shortcontbf\bxshape{12}{1000}
1489 \setfont\shortcontsl\slshape{12}{1000}
1490 %**
1491 \ifisJTeX
1492 \ifisASCII
1493   \font\shortcontmc=min10
1494   \font\shortcontgt=goth10
1495 \else
1496   \jfont\shortcontmc=dm10
1497   \jfont\shortcontgt=dg10
1498 \fi
1499 \else
1500   \let\shortcontmc=\relax
1501   \let\shortcontgt=\relax
1502 \fi
1503 %**
1504
1505 %% Add scribe-like font environments, plus @l for inline lisp (usually sans
1506 %% serif) and @ii for TeX italic
1507
1508 % \smartitalic{ARG} outputs arg in italics, followed by an italic correction
1509 % unless the following character is such as not to need one.
1510 \def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
1511 \def\smartslanted#1{{\sl #1}\futurelet\next\smartitalicx}
1512 \def\smartitalic#1{{\it #1}\futurelet\next\smartitalicx}
1513
1514 \let\i=\smartitalic
1515 \let\var=\smartslanted
1516 \let\dfn=\smartslanted
1517 \let\emph=\smartitalic
1518 \let\cite=\smartslanted
1519
1520 \def\b#1{{\bf #1}}
1521 \let\strong=\b
1522
1523 % We can't just use \exhyphenpenalty, because that only has effect at
1524 % the end of a paragraph.  Restore normal hyphenation at the end of the
1525 % group within which \nohyphenation is presumably called.
1526 %
1527 \def\nohyphenation{\hyphenchar\font = -1  \aftergroup\restorehyphenation}
1528 \def\restorehyphenation{\hyphenchar\font = `- }
1529
1530 \def\t#1{%
1531   {\tt \rawbackslash \frenchspacing #1}%
1532   \null
1533 }
1534 \let\ttfont=\t
1535 \def\samp#1{`\tclose{#1}'\null}
1536 \setfont\smallrm\rmshape{8}{1000}
1537 \font\smallsy=cmsy9
1538 \def\key#1{{\smallrm\textfont2=\smallsy \leavevmode\hbox{%
1539   \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
1540     \vbox{\hrule\kern-0.4pt
1541      \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
1542     \kern-0.4pt\hrule}%
1543   \kern-.06em\raise0.4pt\hbox{\angleright}}}}
1544 % The old definition, with no lozenge:
1545 %\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
1546 \def\ctrl #1{{\tt \rawbackslash \hat}#1}
1547
1548 % @file, @option are the same as @samp.
1549 \let\file=\samp
1550 \let\option=\samp
1551
1552 % @code is a modification of @t,
1553 % which makes spaces the same size as normal in the surrounding text.
1554 \def\tclose#1{%
1555   {%
1556     % Change normal interword space to be same as for the current font.
1557     \spaceskip = \fontdimen2\font
1558     %
1559     % Switch to typewriter.
1560     \tt
1561     %
1562     % But `\ ' produces the large typewriter interword space.
1563     \def\ {{\spaceskip = 0pt{} }}%
1564     %
1565     % Turn off hyphenation.
1566     \nohyphenation
1567     %
1568     \rawbackslash
1569     \frenchspacing
1570     #1%
1571   }%
1572   \null
1573 }
1574
1575 % We *must* turn on hyphenation at `-' and `_' in \code.
1576 % Otherwise, it is too hard to avoid overfull hboxes
1577 % in the Emacs manual, the Library manual, etc.
1578
1579 % Unfortunately, TeX uses one parameter (\hyphenchar) to control
1580 % both hyphenation at - and hyphenation within words.
1581 % We must therefore turn them both off (\tclose does that)
1582 % and arrange explicitly to hyphenate at a dash.
1583 %  -- rms.
1584 {
1585   \catcode`\-=\active
1586   \catcode`\_=\active
1587   %
1588   \global\def\code{\begingroup
1589     \catcode`\-=\active \let-\codedash
1590     \catcode`\_=\active \let_\codeunder
1591     \codex
1592   }
1593   %
1594   % If we end up with any active - characters when handling the index,
1595   % just treat them as a normal -.
1596   \global\def\indexbreaks{\catcode`\-=\active \let-\realdash}
1597 }
1598
1599 \def\realdash{-}
1600 \def\codedash{-\discretionary{}{}{}}
1601 \def\codeunder{\ifusingtt{\normalunderscore\discretionary{}{}{}}{\_}}
1602 \def\codex #1{\tclose{#1}\endgroup}
1603
1604 %\let\exp=\tclose  %Was temporary
1605
1606 % @kbd is like @code, except that if the argument is just one @key command,
1607 % then @kbd has no effect.
1608
1609 % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
1610 %   `example' (@kbd uses ttsl only inside of @example and friends),
1611 %   or `code' (@kbd uses normal tty font always).
1612 \def\kbdinputstyle{\parsearg\kbdinputstylexxx}
1613 \def\kbdinputstylexxx#1{%
1614   \def\arg{#1}%
1615   \ifx\arg\worddistinct
1616     \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
1617   \else\ifx\arg\wordexample
1618     \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
1619   \else\ifx\arg\wordcode
1620     \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
1621   \fi\fi\fi
1622 }
1623 \def\worddistinct{distinct}
1624 \def\wordexample{example}
1625 \def\wordcode{code}
1626
1627 % Default is kbdinputdistinct.  (Too much of a hassle to call the macro,
1628 % the catcodes are wrong for parsearg to work.)
1629 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}
1630
1631 \def\xkey{\key}
1632 \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
1633 \ifx\one\xkey\ifx\threex\three \key{#2}%
1634 \else{\tclose{\kbdfont\look}}\fi
1635 \else{\tclose{\kbdfont\look}}\fi}
1636
1637 % For @url, @env, @command quotes seem unnecessary, so use \code.
1638 \let\url=\code
1639 \let\env=\code
1640 \let\command=\code
1641
1642 % @uref (abbreviation for `urlref') takes an optional second argument
1643 % specifying the text to display.  First (mandatory) arg is the url.
1644 % Perhaps eventually put in a hypertex \special here.
1645
1646 \def\uref#1{\urefxxx #1,,\finish}
1647 \def\urefxxx#1,#2,#3\finish{%
1648   \setbox0 = \hbox{\ignorespaces #2}%
1649   \ifdim\wd0 > 0pt
1650     \unhbox0\ (\code{#1})%
1651   \else
1652     \code{#1}%
1653   \fi
1654 }
1655
1656 % rms does not like the angle brackets --karl, 17may97.
1657 % So now @email is just like @uref.
1658 %\def\email#1{\angleleft{\tt #1}\angleright}
1659 \let\email=\uref
1660
1661 % Check if we are currently using a typewriter font.  Since all the
1662 % Computer Modern typewriter fonts have zero interword stretch (and
1663 % shrink), and it is reasonable to expect all typewriter fonts to have
1664 % this property, we can check that font parameter.
1665 %
1666 \def\ifmonospace{\ifdim\fontdimen3\font=0pt }
1667
1668 % Typeset a dimension, e.g., `in' or `pt'.  The only reason for the
1669 % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
1670 %
1671 \def\dmn#1{\thinspace #1}
1672
1673 \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}
1674
1675 % @l was never documented to mean ``switch to the Lisp font'',
1676 % and it is not used as such in any manual I can find.  We need it for
1677 % Polish suppressed-l.  --karl, 22sep96.
1678 %\def\l#1{{\li #1}\null}
1679
1680 % Explicit font changes: @r, @sc, undocumented @ii.
1681 %\def\r#1{{\rm #1}}              % roman font
1682 \def\r#1{{\rm\mc #1}}              % roman font
1683 \def\sc#1{{\smallcaps#1}}       % smallcaps font
1684 \def\ii#1{{\it #1}}             % italic font
1685
1686 % @acronym downcases the argument and prints in smallcaps.
1687 \def\acronym#1{{\smallcaps \lowercase{#1}}}
1688
1689 % @pounds{} is a sterling sign.
1690 \def\pounds{{\it\$}}
1691
1692
1693 \message{page headings,}
1694
1695 \newskip\titlepagetopglue \titlepagetopglue = 1.5in
1696 \newskip\titlepagebottomglue \titlepagebottomglue = 2pc
1697
1698 % First the title page.  Must do @settitle before @titlepage.
1699 \newif\ifseenauthor
1700 \newif\iffinishedtitlepage
1701
1702 % Do an implicit @contents or @shortcontents after @end titlepage if the
1703 % user says @contentsaftertitlepage or @shortcontentsaftertitlepage.
1704
1705 \newif\ifsetcontentsaftertitlepage
1706  \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
1707 \newif\ifsetshortcontentsaftertitlepage
1708  \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
1709
1710 \def\shorttitlepage{\parsearg\shorttitlepagezzz}
1711 \def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
1712         \endgroup\page\hbox{}\page}
1713
1714 \def\titlepage{\begingroup \parindent=0pt \textfonts
1715    \let\subtitlerm=\tenrm
1716 %**
1717    \let\subtitlemc=\tenmin
1718 %**
1719 %   \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
1720 %**
1721    \def\subtitlefont{\subtitlerm \subtitlemc
1722                      \normalbaselineskip = 13pt \normalbaselines}%
1723 %**
1724    %
1725 %   \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}%
1726 %**
1727    \def\authorfont{\authorrm\authormc
1728                    \normalbaselineskip = 16pt \normalbaselines}%
1729 %**
1730    %
1731    % Leave some space at the very top of the page.
1732    \vglue\titlepagetopglue
1733    %
1734    % Now you can print the title using @title.
1735    \def\title{\parsearg\titlezzz}%
1736    \def\titlezzz##1{\leftline{\titlefonts\rm ##1}
1737                     % print a rule at the page bottom also.
1738                     \finishedtitlepagefalse
1739                     \vskip4pt \hrule height 4pt width \hsize \vskip4pt}%
1740    % No rule at page bottom unless we print one at the top with @title.
1741    \finishedtitlepagetrue
1742    %
1743    % Now you can put text using @subtitle.
1744    \def\subtitle{\parsearg\subtitlezzz}%
1745    \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}%
1746    %
1747    % @author should come last, but may come many times.
1748    \def\author{\parsearg\authorzzz}%
1749    \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi
1750       {\authorfont \leftline{##1}}}%
1751    %
1752    % Most title ``pages'' are actually two pages long, with space
1753    % at the top of the second.  We don't want the ragged left on the second.
1754    \let\oldpage = \page
1755    \def\page{%
1756       \iffinishedtitlepage\else
1757          \finishtitlepage
1758       \fi
1759       \oldpage
1760       \let\page = \oldpage
1761       \hbox{}}%
1762 %   \def\page{\oldpage \hbox{}}
1763 }
1764
1765 \def\Etitlepage{%
1766    \iffinishedtitlepage\else
1767       \finishtitlepage
1768    \fi
1769    % It is important to do the page break before ending the group,
1770    % because the headline and footline are only empty inside the group.
1771    % If we use the new definition of \page, we always get a blank page
1772    % after the title page, which we certainly don't want.
1773    \oldpage
1774    \endgroup
1775    %
1776    % If they want short, they certainly want long too.
1777    \ifsetshortcontentsaftertitlepage
1778      \shortcontents
1779      \contents
1780      \global\let\shortcontents = \relax
1781      \global\let\contents = \relax
1782    \fi
1783    %
1784    \ifsetcontentsaftertitlepage
1785      \contents
1786      \global\let\contents = \relax
1787      \global\let\shortcontents = \relax
1788    \fi
1789    %
1790    \HEADINGSon
1791 }
1792
1793 \def\finishtitlepage{%
1794    \vskip4pt \hrule height 2pt width \hsize
1795    \vskip\titlepagebottomglue
1796    \finishedtitlepagetrue
1797 }
1798
1799 %%% Set up page headings and footings.
1800
1801 \let\thispage=\folio
1802
1803 \newtoks\evenheadline    % headline on even pages
1804 \newtoks\oddheadline     % headline on odd pages
1805 \newtoks\evenfootline    % footline on even pages
1806 \newtoks\oddfootline     % footline on odd pages
1807
1808 % Now make Tex use those variables
1809 \headline={{\textfonts\rm \mc \ifodd\pageno \the\oddheadline
1810                             \else \the\evenheadline \fi}}
1811 \footline={{\textfonts\rm \mc \ifodd\pageno \the\oddfootline
1812                             \else \the\evenfootline \fi}\HEADINGShook}
1813 \let\HEADINGShook=\relax
1814
1815 % Commands to set those variables.
1816 % For example, this is what  @headings on  does
1817 % @evenheading @thistitle|@thispage|@thischapter
1818 % @oddheading @thischapter|@thispage|@thistitle
1819 % @evenfooting @thisfile||
1820 % @oddfooting ||@thisfile
1821
1822 \def\evenheading{\parsearg\evenheadingxxx}
1823 \def\oddheading{\parsearg\oddheadingxxx}
1824 \def\everyheading{\parsearg\everyheadingxxx}
1825
1826 \def\evenfooting{\parsearg\evenfootingxxx}
1827 \def\oddfooting{\parsearg\oddfootingxxx}
1828 \def\everyfooting{\parsearg\everyfootingxxx}
1829
1830 {\catcode`\@=0 %
1831
1832 \gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish}
1833 \gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{%
1834 \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1835
1836 \gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish}
1837 \gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{%
1838 \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1839
1840 \gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
1841
1842 \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish}
1843 \gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{%
1844 \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1845
1846 \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish}
1847 \gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{%
1848   \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
1849   %
1850   % Leave some space for the footline.  Hopefully ok to assume
1851   % @evenfooting will not be used by itself.
1852   \global\advance\pageheight by -\baselineskip
1853   \global\advance\vsize by -\baselineskip
1854 }
1855
1856 \gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}}
1857 %
1858 }% unbind the catcode of @.
1859
1860 % @headings double      turns headings on for double-sided printing.
1861 % @headings single      turns headings on for single-sided printing.
1862 % @headings off         turns them off.
1863 % @headings on          same as @headings double, retained for compatibility.
1864 % @headings after       turns on double-sided headings after this page.
1865 % @headings doubleafter turns on double-sided headings after this page.
1866 % @headings singleafter turns on single-sided headings after this page.
1867 % By default, they are off at the start of a document,
1868 % and turned `on' after @end titlepage.
1869
1870 \def\headings #1 {\csname HEADINGS#1\endcsname}
1871
1872 \def\HEADINGSoff{
1873 \global\evenheadline={\hfil} \global\evenfootline={\hfil}
1874 \global\oddheadline={\hfil} \global\oddfootline={\hfil}}
1875 \HEADINGSoff
1876 % When we turn headings on, set the page number to 1.
1877 % For double-sided printing, put current file name in lower left corner,
1878 % chapter name on inside top of right hand pages, document
1879 % title on inside top of left hand pages, and page numbers on outside top
1880 % edge of all pages.
1881 \def\HEADINGSdouble{
1882 \global\pageno=1
1883 \global\evenfootline={\hfil}
1884 \global\oddfootline={\hfil}
1885 \global\evenheadline={\line{\folio\hfil\thistitle}}
1886 \global\oddheadline={\line{\thischapter\hfil\folio}}
1887 \global\let\contentsalignmacro = \chapoddpage
1888 }
1889 \let\contentsalignmacro = \chappager
1890
1891 % For single-sided printing, chapter title goes across top left of page,
1892 % page number on top right.
1893 \def\HEADINGSsingle{
1894 \global\pageno=1
1895 \global\evenfootline={\hfil}
1896 \global\oddfootline={\hfil}
1897 \global\evenheadline={\line{\thischapter\hfil\folio}}
1898 \global\oddheadline={\line{\thischapter\hfil\folio}}
1899 \global\let\contentsalignmacro = \chappager
1900 }
1901 \def\HEADINGSon{\HEADINGSdouble}
1902
1903 \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
1904 \let\HEADINGSdoubleafter=\HEADINGSafter
1905 \def\HEADINGSdoublex{%
1906 \global\evenfootline={\hfil}
1907 \global\oddfootline={\hfil}
1908 \global\evenheadline={\line{\folio\hfil\thistitle}}
1909 \global\oddheadline={\line{\thischapter\hfil\folio}}
1910 \global\let\contentsalignmacro = \chapoddpage
1911 }
1912
1913 \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
1914 \def\HEADINGSsinglex{%
1915 \global\evenfootline={\hfil}
1916 \global\oddfootline={\hfil}
1917 \global\evenheadline={\line{\thischapter\hfil\folio}}
1918 \global\oddheadline={\line{\thischapter\hfil\folio}}
1919 \global\let\contentsalignmacro = \chappager
1920 }
1921
1922 % Subroutines used in generating headings
1923 % Produces Day Month Year style of output.
1924 \def\today{\number\day\space
1925 \ifcase\month\or
1926 January\or February\or March\or April\or May\or June\or
1927 July\or August\or September\or October\or November\or December\fi
1928 \space\number\year}
1929
1930 % Use this if you want the Month Day, Year style of output.
1931 %\def\today{\ifcase\month\or
1932 %January\or February\or March\or April\or May\or June\or
1933 %July\or August\or September\or October\or November\or December\fi
1934 %\space\number\day, \number\year}
1935
1936 % @settitle line...  specifies the title of the document, for headings
1937 % It generates no output of its own
1938
1939 \def\thistitle{No Title}
1940 \def\settitle{\parsearg\settitlezzz}
1941 \def\settitlezzz #1{\gdef\thistitle{#1}}
1942
1943
1944 \message{tables,}
1945 % Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
1946
1947 % default indentation of table text
1948 \newdimen\tableindent \tableindent=.8in
1949 % default indentation of @itemize and @enumerate text
1950 \newdimen\itemindent  \itemindent=.3in
1951 % margin between end of table item and start of table text.
1952 \newdimen\itemmargin  \itemmargin=.1in
1953
1954 % used internally for \itemindent minus \itemmargin
1955 \newdimen\itemmax
1956
1957 % Note @table, @vtable, and @vtable define @item, @itemx, etc., with
1958 % these defs.
1959 % They also define \itemindex
1960 % to index the item name in whatever manner is desired (perhaps none).
1961
1962 \newif\ifitemxneedsnegativevskip
1963
1964 \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
1965
1966 \def\internalBitem{\smallbreak \parsearg\itemzzz}
1967 \def\internalBitemx{\itemxpar \parsearg\itemzzz}
1968
1969 \def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
1970 \def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz}
1971
1972 \def\internalBkitem{\smallbreak \parsearg\kitemzzz}
1973 \def\internalBkitemx{\itemxpar \parsearg\kitemzzz}
1974
1975 \def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}%
1976                  \itemzzz {#1}}
1977
1978 \def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}%
1979                  \itemzzz {#1}}
1980
1981 \def\itemzzz #1{\begingroup %
1982   \advance\hsize by -\rightskip
1983   \advance\hsize by -\tableindent
1984   \setbox0=\hbox{\itemfont{#1}}%
1985   \itemindex{#1}%
1986   \nobreak % This prevents a break before @itemx.
1987   %
1988   % If the item text does not fit in the space we have, put it on a line
1989   % by itself, and do not allow a page break either before or after that
1990   % line.  We do not start a paragraph here because then if the next
1991   % command is, e.g., @kindex, the whatsit would get put into the
1992   % horizontal list on a line by itself, resulting in extra blank space.
1993   \ifdim \wd0>\itemmax
1994     %
1995     % Make this a paragraph so we get the \parskip glue and wrapping,
1996     % but leave it ragged-right.
1997     \begingroup
1998       \advance\leftskip by-\tableindent
1999       \advance\hsize by\tableindent
2000       \advance\rightskip by0pt plus1fil
2001       \leavevmode\unhbox0\par
2002     \endgroup
2003     %
2004     % We're going to be starting a paragraph, but we don't want the
2005     % \parskip glue -- logically it's part of the @item we just started.
2006     \nobreak \vskip-\parskip
2007     %
2008     % Stop a page break at the \parskip glue coming up.  Unfortunately
2009     % we can't prevent a possible page break at the following
2010     % \baselineskip glue.
2011     \nobreak
2012     \endgroup
2013     \itemxneedsnegativevskipfalse
2014   \else
2015     % The item text fits into the space.  Start a paragraph, so that the
2016     % following text (if any) will end up on the same line.  
2017     \noindent
2018     % Do this with kerns and \unhbox so that if there is a footnote in
2019     % the item text, it can migrate to the main vertical list and
2020     % eventually be printed.
2021     \nobreak\kern-\tableindent
2022     \dimen0 = \itemmax  \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
2023     \unhbox0
2024     \nobreak\kern\dimen0
2025     \endgroup
2026     \itemxneedsnegativevskiptrue
2027   \fi
2028 }
2029
2030 \def\item{\errmessage{@item while not in a table}}
2031 \def\itemx{\errmessage{@itemx while not in a table}}
2032 \def\kitem{\errmessage{@kitem while not in a table}}
2033 \def\kitemx{\errmessage{@kitemx while not in a table}}
2034 \def\xitem{\errmessage{@xitem while not in a table}}
2035 \def\xitemx{\errmessage{@xitemx while not in a table}}
2036
2037 % Contains a kludge to get @end[description] to work.
2038 \def\description{\tablez{\dontindex}{1}{}{}{}{}}
2039
2040 % @table, @ftable, @vtable.
2041 \def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
2042 {\obeylines\obeyspaces%
2043 \gdef\tablex #1^^M{%
2044 \tabley\dontindex#1        \endtabley}}
2045
2046 \def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
2047 {\obeylines\obeyspaces%
2048 \gdef\ftablex #1^^M{%
2049 \tabley\fnitemindex#1        \endtabley
2050 \def\Eftable{\endgraf\afterenvbreak\endgroup}%
2051 \let\Etable=\relax}}
2052
2053 \def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex}
2054 {\obeylines\obeyspaces%
2055 \gdef\vtablex #1^^M{%
2056 \tabley\vritemindex#1        \endtabley
2057 \def\Evtable{\endgraf\afterenvbreak\endgroup}%
2058 \let\Etable=\relax}}
2059
2060 \def\dontindex #1{}
2061 \def\fnitemindex #1{\doind {fn}{\code{#1}}}%
2062 \def\vritemindex #1{\doind {vr}{\code{#1}}}%
2063
2064 {\obeyspaces %
2065 \gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
2066 \tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
2067
2068 \def\tablez #1#2#3#4#5#6{%
2069 \aboveenvbreak %
2070 \begingroup %
2071 \def\Edescription{\Etable}% Necessary kludge.
2072 \let\itemindex=#1%
2073 \ifnum 0#3>0 \advance \leftskip by #3\mil \fi %
2074 \ifnum 0#4>0 \tableindent=#4\mil \fi %
2075 \ifnum 0#5>0 \advance \rightskip by #5\mil \fi %
2076 \def\itemfont{#2}%
2077 \itemmax=\tableindent %
2078 \advance \itemmax by -\itemmargin %
2079 \advance \leftskip by \tableindent %
2080 \exdentamount=\tableindent
2081 \parindent = 0pt
2082 \parskip = \smallskipamount
2083 \ifdim \parskip=0pt \parskip=2pt \fi%
2084 \def\Etable{\endgraf\afterenvbreak\endgroup}%
2085 \let\item = \internalBitem %
2086 \let\itemx = \internalBitemx %
2087 \let\kitem = \internalBkitem %
2088 \let\kitemx = \internalBkitemx %
2089 \let\xitem = \internalBxitem %
2090 \let\xitemx = \internalBxitemx %
2091 }
2092
2093 % This is the counter used by @enumerate, which is really @itemize
2094
2095 \newcount \itemno
2096
2097 \def\itemize{\parsearg\itemizezzz}
2098
2099 \def\itemizezzz #1{%
2100   \begingroup % ended by the @end itemize
2101   \itemizey {#1}{\Eitemize}
2102 }
2103
2104 \def\itemizey #1#2{%
2105 \aboveenvbreak %
2106 \itemmax=\itemindent %
2107 \advance \itemmax by -\itemmargin %
2108 \advance \leftskip by \itemindent %
2109 \exdentamount=\itemindent
2110 \parindent = 0pt %
2111 \parskip = \smallskipamount %
2112 \ifdim \parskip=0pt \parskip=2pt \fi%
2113 \def#2{\endgraf\afterenvbreak\endgroup}%
2114 \def\itemcontents{#1}%
2115 \let\item=\itemizeitem}
2116
2117 % Set sfcode to normal for the chars that usually have another value.
2118 % These are `.?!:;,'
2119 \def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000
2120   \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 }
2121
2122 % \splitoff TOKENS\endmark defines \first to be the first token in
2123 % TOKENS, and \rest to be the remainder.
2124 %
2125 \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
2126
2127 % Allow an optional argument of an uppercase letter, lowercase letter,
2128 % or number, to specify the first label in the enumerated list.  No
2129 % argument is the same as `1'.
2130 %
2131 \def\enumerate{\parsearg\enumeratezzz}
2132 \def\enumeratezzz #1{\enumeratey #1  \endenumeratey}
2133 \def\enumeratey #1 #2\endenumeratey{%
2134   \begingroup % ended by the @end enumerate
2135   %
2136   % If we were given no argument, pretend we were given `1'.
2137   \def\thearg{#1}%
2138   \ifx\thearg\empty \def\thearg{1}\fi
2139   %
2140   % Detect if the argument is a single token.  If so, it might be a
2141   % letter.  Otherwise, the only valid thing it can be is a number.
2142   % (We will always have one token, because of the test we just made.
2143   % This is a good thing, since \splitoff doesn't work given nothing at
2144   % all -- the first parameter is undelimited.)
2145   \expandafter\splitoff\thearg\endmark
2146   \ifx\rest\empty
2147     % Only one token in the argument.  It could still be anything.
2148     % A ``lowercase letter'' is one whose \lccode is nonzero.
2149     % An ``uppercase letter'' is one whose \lccode is both nonzero, and
2150     %   not equal to itself.
2151     % Otherwise, we assume it's a number.
2152     %
2153     % We need the \relax at the end of the \ifnum lines to stop TeX from
2154     % continuing to look for a <number>.
2155     %
2156     \ifnum\lccode\expandafter`\thearg=0\relax
2157       \numericenumerate % a number (we hope)
2158     \else
2159       % It's a letter.
2160       \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
2161         \lowercaseenumerate % lowercase letter
2162       \else
2163         \uppercaseenumerate % uppercase letter
2164       \fi
2165     \fi
2166   \else
2167     % Multiple tokens in the argument.  We hope it's a number.
2168     \numericenumerate
2169   \fi
2170 }
2171
2172 % An @enumerate whose labels are integers.  The starting integer is
2173 % given in \thearg.
2174 %
2175 \def\numericenumerate{%
2176   \itemno = \thearg
2177   \startenumeration{\the\itemno}%
2178 }
2179
2180 % The starting (lowercase) letter is in \thearg.
2181 \def\lowercaseenumerate{%
2182   \itemno = \expandafter`\thearg
2183   \startenumeration{%
2184     % Be sure we're not beyond the end of the alphabet.
2185     \ifnum\itemno=0
2186       \errmessage{No more lowercase letters in @enumerate; get a bigger
2187                   alphabet}%
2188     \fi
2189     \char\lccode\itemno
2190   }%
2191 }
2192
2193 % The starting (uppercase) letter is in \thearg.
2194 \def\uppercaseenumerate{%
2195   \itemno = \expandafter`\thearg
2196   \startenumeration{%
2197     % Be sure we're not beyond the end of the alphabet.
2198     \ifnum\itemno=0
2199       \errmessage{No more uppercase letters in @enumerate; get a bigger
2200                   alphabet}
2201     \fi
2202     \char\uccode\itemno
2203   }%
2204 }
2205
2206 % Call itemizey, adding a period to the first argument and supplying the
2207 % common last two arguments.  Also subtract one from the initial value in
2208 % \itemno, since @item increments \itemno.
2209 %
2210 \def\startenumeration#1{%
2211   \advance\itemno by -1
2212   \itemizey{#1.}\Eenumerate\flushcr
2213 }
2214
2215 % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
2216 % to @enumerate.
2217 %
2218 \def\alphaenumerate{\enumerate{a}}
2219 \def\capsenumerate{\enumerate{A}}
2220 \def\Ealphaenumerate{\Eenumerate}
2221 \def\Ecapsenumerate{\Eenumerate}
2222
2223 % Definition of @item while inside @itemize.
2224
2225 \def\itemizeitem{%
2226 \advance\itemno by 1
2227 {\let\par=\endgraf \smallbreak}%
2228 \ifhmode \errmessage{In hmode at itemizeitem}\fi
2229 {\parskip=0in \hskip 0pt
2230 \hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
2231 \vadjust{\penalty 1200}}%
2232 \flushcr}
2233
2234 % @multitable macros
2235 % Amy Hendrickson, 8/18/94, 3/6/96
2236 %
2237 % @multitable ... @end multitable will make as many columns as desired.
2238 % Contents of each column will wrap at width given in preamble.  Width
2239 % can be specified either with sample text given in a template line,
2240 % or in percent of \hsize, the current width of text on page.
2241
2242 % Table can continue over pages but will only break between lines.
2243
2244 % To make preamble:
2245 %
2246 % Either define widths of columns in terms of percent of \hsize:
2247 %   @multitable @columnfractions .25 .3 .45
2248 %   @item ...
2249 %
2250 %   Numbers following @columnfractions are the percent of the total
2251 %   current hsize to be used for each column. You may use as many
2252 %   columns as desired.
2253
2254
2255 % Or use a template:
2256 %   @multitable {Column 1 template} {Column 2 template} {Column 3 template}
2257 %   @item ...
2258 %   using the widest term desired in each column.
2259 %
2260 % For those who want to use more than one line's worth of words in
2261 % the preamble, break the line within one argument and it
2262 % will parse correctly, i.e.,
2263 %
2264 %     @multitable {Column 1 template} {Column 2 template} {Column 3
2265 %      template}
2266 % Not:
2267 %     @multitable {Column 1 template} {Column 2 template}
2268 %      {Column 3 template}
2269
2270 % Each new table line starts with @item, each subsequent new column
2271 % starts with @tab. Empty columns may be produced by supplying @tab's
2272 % with nothing between them for as many times as empty columns are needed,
2273 % ie, @tab@tab@tab will produce two empty columns.
2274
2275 % @item, @tab, @multitable or @end multitable do not need to be on their
2276 % own lines, but it will not hurt if they are.
2277
2278 % Sample multitable:
2279
2280 %   @multitable {Column 1 template} {Column 2 template} {Column 3 template}
2281 %   @item first col stuff @tab second col stuff @tab third col
2282 %   @item
2283 %   first col stuff
2284 %   @tab
2285 %   second col stuff
2286 %   @tab
2287 %   third col
2288 %   @item first col stuff @tab second col stuff
2289 %   @tab Many paragraphs of text may be used in any column.
2290 %
2291 %         They will wrap at the width determined by the template.
2292 %   @item@tab@tab This will be in third column.
2293 %   @end multitable
2294
2295 % Default dimensions may be reset by user.
2296 % @multitableparskip is vertical space between paragraphs in table.
2297 % @multitableparindent is paragraph indent in table.
2298 % @multitablecolmargin is horizontal space to be left between columns.
2299 % @multitablelinespace is space to leave between table items, baseline
2300 %                                                            to baseline.
2301 %   0pt means it depends on current normal line spacing.
2302 %
2303 \newskip\multitableparskip
2304 \newskip\multitableparindent
2305 \newdimen\multitablecolspace
2306 \newskip\multitablelinespace
2307 \multitableparskip=0pt
2308 \multitableparindent=6pt
2309 \multitablecolspace=12pt
2310 \multitablelinespace=0pt
2311
2312 % Macros used to set up halign preamble:
2313
2314 \let\endsetuptable\relax
2315 \def\xendsetuptable{\endsetuptable}
2316 \let\columnfractions\relax
2317 \def\xcolumnfractions{\columnfractions}
2318 \newif\ifsetpercent
2319
2320 % 2/1/96, to allow fractions to be given with more than one digit.
2321 \def\pickupwholefraction#1 {\global\advance\colcount by1 %
2322 \expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}%
2323 \setuptable}
2324
2325 \newcount\colcount
2326 \def\setuptable#1{\def\firstarg{#1}%
2327 \ifx\firstarg\xendsetuptable\let\go\relax%
2328 \else
2329   \ifx\firstarg\xcolumnfractions\global\setpercenttrue%
2330   \else
2331     \ifsetpercent
2332        \let\go\pickupwholefraction   % In this case arg of setuptable
2333                                      % is the decimal point before the
2334                                      % number given in percent of hsize.
2335                                      % We don't need this so we don't use it.
2336     \else
2337        \global\advance\colcount by1
2338        \setbox0=\hbox{#1 }% Add a normal word space as a separator;
2339                           % typically that is always in the input, anyway.
2340        \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
2341     \fi%
2342   \fi%
2343 \ifx\go\pickupwholefraction\else\let\go\setuptable\fi%
2344 \fi\go}
2345
2346 % multitable syntax
2347 \def\tab{&\hskip1sp\relax} % 2/2/96
2348                            % tiny skip here makes sure this column space is
2349                            % maintained, even if it is never used.
2350
2351 % @multitable ... @end multitable definitions:
2352
2353 \def\multitable{\parsearg\dotable}
2354 \def\dotable#1{\bgroup
2355   \vskip\parskip
2356   \let\item\crcr
2357   \tolerance=9500
2358   \hbadness=9500
2359   \setmultitablespacing
2360   \parskip=\multitableparskip
2361   \parindent=\multitableparindent
2362   \overfullrule=0pt
2363   \global\colcount=0
2364   \def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}%
2365   %
2366   % To parse everything between @multitable and @item:
2367   \setuptable#1 \endsetuptable
2368   %
2369   % \everycr will reset column counter, \colcount, at the end of
2370   % each line. Every column entry will cause \colcount to advance by one.
2371   % The table preamble
2372   % looks at the current \colcount to find the correct column width.
2373   \everycr{\noalign{%
2374   %
2375   % \filbreak%% keeps underfull box messages off when table breaks over pages.
2376   % Maybe so, but it also creates really weird page breaks when the table
2377   % breaks over pages. Wouldn't \vfil be better?  Wait until the problem
2378   % manifests itself, so it can be fixed for real --karl.
2379     \global\colcount=0\relax}}%
2380   %
2381   % This preamble sets up a generic column definition, which will
2382   % be used as many times as user calls for columns.
2383   % \vtop will set a single line and will also let text wrap and
2384   % continue for many paragraphs if desired.
2385   \halign\bgroup&\global\advance\colcount by 1\relax
2386     \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
2387   %
2388   % In order to keep entries from bumping into each other
2389   % we will add a \leftskip of \multitablecolspace to all columns after
2390   % the first one.
2391   % 
2392   % If a template has been used, we will add \multitablecolspace
2393   % to the width of each template entry.
2394   % 
2395   % If the user has set preamble in terms of percent of \hsize we will
2396   % use that dimension as the width of the column, and the \leftskip
2397   % will keep entries from bumping into each other.  Table will start at
2398   % left margin and final column will justify at right margin.
2399   % 
2400   % Make sure we don't inherit \rightskip from the outer environment.
2401   \rightskip=0pt
2402   \ifnum\colcount=1
2403     % The first column will be indented with the surrounding text.
2404     \advance\hsize by\leftskip
2405   \else
2406     \ifsetpercent \else
2407       % If user has not set preamble in terms of percent of \hsize
2408       % we will advance \hsize by \multitablecolspace.
2409       \advance\hsize by \multitablecolspace
2410     \fi
2411    % In either case we will make \leftskip=\multitablecolspace:
2412   \leftskip=\multitablecolspace
2413   \fi
2414   % Ignoring space at the beginning and end avoids an occasional spurious
2415   % blank line, when TeX decides to break the line at the space before the
2416   % box from the multistrut, so the strut ends up on a line by itself.
2417   % For example:
2418   % @multitable @columnfractions .11 .89
2419   % @item @code{#}
2420   % @tab Legal holiday which is valid in major parts of the whole country.
2421   % Is automatically provided with highlighting sequences respectively marking
2422   % characters.
2423   \noindent\ignorespaces##\unskip\multistrut}\cr
2424 }
2425
2426 \def\setmultitablespacing{% test to see if user has set \multitablelinespace.
2427 % If so, do nothing. If not, give it an appropriate dimension based on
2428 % current baselineskip.
2429 \ifdim\multitablelinespace=0pt
2430 %% strut to put in table in case some entry doesn't have descenders,
2431 %% to keep lines equally spaced
2432 \let\multistrut = \strut
2433 %% Test to see if parskip is larger than space between lines of
2434 %% table. If not, do nothing.
2435 %%        If so, set to same dimension as multitablelinespace.
2436 \else
2437 \gdef\multistrut{\vrule height\multitablelinespace depth\dp0
2438 width0pt\relax} \fi
2439 \ifdim\multitableparskip>\multitablelinespace
2440 \global\multitableparskip=\multitablelinespace
2441 \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
2442                                       %% than skip between lines in the table.
2443 \fi%
2444 \ifdim\multitableparskip=0pt
2445 \global\multitableparskip=\multitablelinespace
2446 \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
2447                                       %% than skip between lines in the table.
2448 \fi}
2449
2450
2451 \message{indexing,}
2452 % Index generation facilities
2453
2454 % Define \newwrite to be identical to plain tex's \newwrite
2455 % except not \outer, so it can be used within \newindex.
2456 {\catcode`\@=11
2457 \gdef\newwrite{\alloc@7\write\chardef\sixt@@n}}
2458
2459 % \newindex {foo} defines an index named foo.
2460 % It automatically defines \fooindex such that
2461 % \fooindex ...rest of line... puts an entry in the index foo.
2462 % It also defines \fooindfile to be the number of the output channel for
2463 % the file that accumulates this index.  The file's extension is foo.
2464 % The name of an index should be no more than 2 characters long
2465 % for the sake of vms.
2466 %
2467 \def\newindex#1{%
2468   \iflinks
2469     \expandafter\newwrite \csname#1indfile\endcsname
2470     \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
2471   \fi
2472   \expandafter\xdef\csname#1index\endcsname{%     % Define @#1index
2473     \noexpand\doindex{#1}}
2474 }
2475
2476 % @defindex foo  ==  \newindex{foo}
2477
2478 \def\defindex{\parsearg\newindex}
2479
2480 % Define @defcodeindex, like @defindex except put all entries in @code.
2481
2482 \def\newcodeindex#1{%
2483   \iflinks
2484     \expandafter\newwrite \csname#1indfile\endcsname
2485     \openout \csname#1indfile\endcsname \jobname.#1
2486   \fi
2487   \expandafter\xdef\csname#1index\endcsname{%
2488     \noexpand\docodeindex{#1}}
2489 }
2490
2491 \def\defcodeindex{\parsearg\newcodeindex}
2492
2493 % @synindex foo bar    makes index foo feed into index bar.
2494 % Do this instead of @defindex foo if you don't want it as a separate index.
2495 % The \closeout helps reduce unnecessary open files; the limit on the
2496 % Acorn RISC OS is a mere 16 files.
2497 \def\synindex#1 #2 {%
2498   \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
2499   \expandafter\closeout\csname#1indfile\endcsname
2500   \expandafter\let\csname#1indfile\endcsname=\synindexfoo
2501   \expandafter\xdef\csname#1index\endcsname{% define \xxxindex
2502     \noexpand\doindex{#2}}%
2503 }
2504
2505 % @syncodeindex foo bar   similar, but put all entries made for index foo
2506 % inside @code.
2507 \def\syncodeindex#1 #2 {%
2508   \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
2509   \expandafter\closeout\csname#1indfile\endcsname
2510   \expandafter\let\csname#1indfile\endcsname=\synindexfoo
2511   \expandafter\xdef\csname#1index\endcsname{% define \xxxindex
2512     \noexpand\docodeindex{#2}}%
2513 }
2514
2515 % Define \doindex, the driver for all \fooindex macros.
2516 % Argument #1 is generated by the calling \fooindex macro,
2517 %  and it is "foo", the name of the index.
2518
2519 % \doindex just uses \parsearg; it calls \doind for the actual work.
2520 % This is because \doind is more useful to call from other macros.
2521
2522 % There is also \dosubind {index}{topic}{subtopic}
2523 % which makes an entry in a two-level index such as the operation index.
2524
2525 \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
2526 \def\singleindexer #1{\doind{\indexname}{#1}}
2527
2528 %*********************************************
2529 %*** For the compat'y with texinfo.tex.ntt
2530 %*** jtexinfo patch by S.Tomura 89-Dec-7
2531 \def\Jempty{}
2532 \def\singleindexer #1{\singleindexerB#1[]\singleindexerA}
2533 \def\singleindexerB#1[#2]{\edef\Jone{#1}\edef\Jtwo{#2}%
2534 \ifx\Jempty\Jtwo\let\Jnext=\relax\let\singleindexerA=\singleindexerD%
2535 \else\let\Jnext=\singleindexerC\let\singleindexerA=\singleindexerE\fi%
2536 \Jnext}
2537 \def\singleindexerC#1[]{}
2538 \def\singleindexerD{\doind{\indexname}{\Jone}}
2539 \def\singleindexerE{\Jdoind{\indexname}{\Jone}{\Jtwo}}
2540 %**** end of patch
2541 %*********************************************
2542
2543 % like the previous two, but they put @code around the argument.
2544 \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
2545 \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
2546
2547 \def\indexdummies{%
2548 \def\ { }%
2549 % Take care of the plain tex accent commands.
2550 \def\"{\realbackslash "}%
2551 \def\`{\realbackslash `}%
2552 \def\'{\realbackslash '}%
2553 \def\^{\realbackslash ^}%
2554 \def\~{\realbackslash ~}%
2555 \def\={\realbackslash =}%
2556 \def\b{\realbackslash b}%
2557 \def\c{\realbackslash c}%
2558 \def\d{\realbackslash d}%
2559 \def\u{\realbackslash u}%
2560 \def\v{\realbackslash v}%
2561 \def\H{\realbackslash H}%
2562 % Take care of the plain tex special European modified letters.
2563 \def\oe{\realbackslash oe}%
2564 \def\ae{\realbackslash ae}%
2565 \def\aa{\realbackslash aa}%
2566 \def\OE{\realbackslash OE}%
2567 \def\AE{\realbackslash AE}%
2568 \def\AA{\realbackslash AA}%
2569 \def\o{\realbackslash o}%
2570 \def\O{\realbackslash O}%
2571 \def\l{\realbackslash l}%
2572 \def\L{\realbackslash L}%
2573 \def\ss{\realbackslash ss}%
2574 % Take care of texinfo commands likely to appear in an index entry.
2575 % (Must be a way to avoid doing expansion at all, and thus not have to
2576 % laboriously list every single command here.)
2577 \def\@{@}% will be @@ when we switch to @ as escape char.
2578 %\let\{ = \lbracecmd
2579 %\let\} = \rbracecmd
2580 \def\_{{\realbackslash _}}%
2581 \def\w{\realbackslash w }%
2582 \def\bf{\realbackslash bf }%
2583 %\def\rm{\realbackslash rm }%
2584 \def\sl{\realbackslash sl }%
2585 \def\sf{\realbackslash sf}%
2586 \def\tt{\realbackslash tt}%
2587 \def\gtr{\realbackslash gtr}%
2588 \def\less{\realbackslash less}%
2589 \def\hat{\realbackslash hat}%
2590 \def\TeX{\realbackslash TeX}%
2591 \def\dots{\realbackslash dots }%
2592 \def\result{\realbackslash result}%
2593 \def\equiv{\realbackslash equiv}%
2594 \def\expansion{\realbackslash expansion}%
2595 \def\print{\realbackslash print}%
2596 \def\error{\realbackslash error}%
2597 \def\point{\realbackslash point}%
2598 \def\copyright{\realbackslash copyright}%
2599 \def\tclose##1{\realbackslash tclose {##1}}%
2600 \def\code##1{\realbackslash code {##1}}%
2601 \def\dotless##1{\realbackslash dotless {##1}}%
2602 \def\samp##1{\realbackslash samp {##1}}%
2603 \def\,##1{\realbackslash ,{##1}}%
2604 \def\t##1{\realbackslash t {##1}}%
2605 \def\r##1{\realbackslash r {##1}}%
2606 \def\i##1{\realbackslash i {##1}}%
2607 \def\b##1{\realbackslash b {##1}}%
2608 \def\sc##1{\realbackslash sc {##1}}%
2609 \def\cite##1{\realbackslash cite {##1}}%
2610 \def\key##1{\realbackslash key {##1}}%
2611 \def\file##1{\realbackslash file {##1}}%
2612 \def\var##1{\realbackslash var {##1}}%
2613 \def\kbd##1{\realbackslash kbd {##1}}%
2614 \def\dfn##1{\realbackslash dfn {##1}}%
2615 \def\emph##1{\realbackslash emph {##1}}%
2616 %
2617 % Handle some cases of @value -- where the variable name does not
2618 % contain - or _, and the value does not contain any
2619 % (non-fully-expandable) commands.
2620 \let\value = \expandablevalue
2621 %
2622 \unsepspaces
2623 }
2624
2625 % If an index command is used in an @example environment, any spaces
2626 % therein should become regular spaces in the raw index file, not the
2627 % expansion of \tie (\\leavevmode \penalty \@M \ ).
2628 {\obeyspaces
2629  \gdef\unsepspaces{\obeyspaces\let =\space}}
2630
2631 % \indexnofonts no-ops all font-change commands.
2632 % This is used when outputting the strings to sort the index by.
2633 \def\indexdummyfont#1{#1}
2634 \def\indexdummytex{TeX}
2635 \def\indexdummydots{...}
2636
2637 \def\indexnofonts{%
2638 % Just ignore accents.
2639 \let\,=\indexdummyfont
2640 \let\"=\indexdummyfont
2641 \let\`=\indexdummyfont
2642 \let\'=\indexdummyfont
2643 \let\^=\indexdummyfont
2644 \let\~=\indexdummyfont
2645 \let\==\indexdummyfont
2646 \let\b=\indexdummyfont
2647 \let\c=\indexdummyfont
2648 \let\d=\indexdummyfont
2649 \let\u=\indexdummyfont
2650 \let\v=\indexdummyfont
2651 \let\H=\indexdummyfont
2652 \let\dotless=\indexdummyfont
2653 % Take care of the plain tex special European modified letters.
2654 \def\oe{oe}%
2655 \def\ae{ae}%
2656 \def\aa{aa}%
2657 \def\OE{OE}%
2658 \def\AE{AE}%
2659 \def\AA{AA}%
2660 \def\o{o}%
2661 \def\O{O}%
2662 \def\l{l}%
2663 \def\L{L}%
2664 \def\ss{ss}%
2665 \let\w=\indexdummyfont
2666 \let\t=\indexdummyfont
2667 \let\r=\indexdummyfont
2668 \let\i=\indexdummyfont
2669 \let\b=\indexdummyfont
2670 \let\emph=\indexdummyfont
2671 \let\strong=\indexdummyfont
2672 \let\cite=\indexdummyfont
2673 \let\sc=\indexdummyfont
2674 %Don't no-op \tt, since it isn't a user-level command
2675 % and is used in the definitions of the active chars like <, >, |...
2676 %\let\tt=\indexdummyfont
2677 \let\tclose=\indexdummyfont
2678 \let\code=\indexdummyfont
2679 \let\file=\indexdummyfont
2680 \let\samp=\indexdummyfont
2681 \let\kbd=\indexdummyfont
2682 \let\key=\indexdummyfont
2683 \let\var=\indexdummyfont
2684 \let\TeX=\indexdummytex
2685 \let\dots=\indexdummydots
2686 \def\@{@}%
2687 }
2688
2689 % To define \realbackslash, we must make \ not be an escape.
2690 % We must first make another character (@) an escape
2691 % so we do not become unable to do a definition.
2692
2693 {\catcode`\@=0 \catcode`\\=\other
2694  @gdef@realbackslash{\}}
2695
2696 \let\indexbackslash=0  %overridden during \printindex.
2697 \let\SETmarginindex=\relax % put index entries in margin (undocumented)?
2698
2699 % For \ifx comparisons.
2700 \def\emptymacro{\empty}
2701
2702 % Most index entries go through here, but \dosubind is the general case.
2703
2704 \def\doind#1#2{\dosubind{#1}{#2}\empty}
2705
2706 % Workhorse for all \fooindexes.
2707 % #1 is name of index, #2 is stuff to put there, #3 is subentry --
2708 % \empty if called from \doind, as we usually are.  The main exception
2709 % is with defuns, which call us directly.
2710
2711 \def\dosubind#1#2#3{%
2712   % Put the index entry in the margin if desired.
2713   \ifx\SETmarginindex\relax\else
2714     \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}%
2715   \fi
2716   {%
2717     \count255=\lastpenalty
2718     {%
2719       \indexdummies % Must do this here, since \bf, etc expand at this stage
2720       \escapechar=`\\
2721       {%
2722         \let\folio = 0% We will expand all macros now EXCEPT \folio.
2723         \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
2724         % so it will be output as is; and it will print as backslash.
2725         %
2726         \def\thirdarg{#3}%
2727         %
2728         % If third arg is present, precede it with space in sort key.
2729         \ifx\thirdarg\emptymacro
2730           \let\subentry = \empty
2731         \else
2732           \def\subentry{ #3}%
2733         \fi
2734         %
2735         % First process the index-string with all font commands turned off
2736         % to get the string to sort by.
2737         {\indexnofonts \xdef\indexsorttmp{#2\subentry}}%
2738         %
2739         % Now produce the complete index entry, with both the sort key and the
2740         % original text, including any font commands.
2741         \toks0 = {#2}%
2742         \edef\temp{%
2743           \write\csname#1indfile\endcsname{%
2744             \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}%
2745         }%
2746         %
2747         % If third (subentry) arg is present, add it to the index string.
2748         \ifx\thirdarg\emptymacro \else
2749           \toks0 = {#3}%
2750           \edef\temp{\temp{\the\toks0}}%
2751         \fi
2752         %
2753         % If a skip is the last thing on the list now, preserve it
2754         % by backing up by \lastskip, doing the \write, then inserting
2755         % the skip again.  Otherwise, the whatsit generated by the
2756         % \write will make \lastskip zero.  The result is that sequences
2757         % like this:
2758         % @end defun
2759         % @tindex whatever
2760         % @defun ...
2761         % will have extra space inserted, because the \medbreak in the
2762         % start of the @defun won't see the skip inserted by the @end of
2763         % the previous defun.
2764         % 
2765         % But don't do any of this if we're not in vertical mode.  We
2766         % don't want to do a \vskip and prematurely end a paragraph.
2767         % 
2768         % Avoid page breaks due to these extra skips, too.
2769         % 
2770         \iflinks
2771           \ifvmode
2772             \skip0 = \lastskip
2773             \ifdim\lastskip = 0pt \else \nobreak\vskip-\lastskip \fi
2774           \fi
2775           %
2776           \temp % do the write
2777           %
2778           % 
2779           \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi
2780         \fi
2781       }%
2782     }%
2783     \penalty\count255
2784   }%
2785 }
2786
2787 % The index entry written in the file actually looks like
2788 %  \entry {sortstring}{page}{topic}
2789 % or
2790 %  \entry {sortstring}{page}{topic}{subtopic}
2791 % The texindex program reads in these files and writes files
2792 % containing these kinds of lines:
2793 %  \initial {c}
2794 %     before the first topic whose initial is c
2795 %  \entry {topic}{pagelist}
2796 %     for a topic that is used without subtopics
2797 %  \primary {topic}
2798 %     for the beginning of a topic that is used with subtopics
2799 %  \secondary {subtopic}{pagelist}
2800 %     for each subtopic.
2801
2802 % Define the user-accessible indexing commands
2803 % @findex, @vindex, @kindex, @cindex.
2804
2805 \def\findex {\fnindex}
2806 \def\kindex {\kyindex}
2807 \def\cindex {\cpindex}
2808 \def\vindex {\vrindex}
2809 \def\tindex {\tpindex}
2810 \def\pindex {\pgindex}
2811
2812 \def\cindexsub {\begingroup\obeylines\cindexsub}
2813 {\obeylines %
2814 \gdef\cindexsub "#1" #2^^M{\endgroup %
2815 \dosubind{cp}{#2}{#1}}}
2816
2817 %*********************************************
2818 %*** jtexinfo patch  by S.Tomura 89-Nov-23
2819 %***
2820 \def\Jdoind #1#2#3{%
2821 {\indexdummies % Must do this here, since \bf, etc expand at this stage
2822 \count10=\lastpenalty %
2823 \escapechar=`\\%
2824 {\let\folio=0% Expand all macros now EXCEPT \folio
2825 \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
2826 % so it will be output as is; and it will print as backslash in the indx.
2827 %
2828 % Now process the index-string once, with all font commands turned off,
2829 % to get the string to sort the index by.
2830 {\indexnofonts
2831 \xdef\temp1{#3}%
2832 }%
2833 % Now produce the complete index entry.  We process the index-string again,
2834 % this time with font commands expanded, to get what to print in the index.
2835 \edef\temp{%
2836 \write \csname#1indfile\endcsname{%
2837 \realbackslash entry {\temp1}{\folio}{#2}}}%
2838 \temp }%
2839 \penalty\count10}}
2840 %*** end of patch
2841 %*********************************************
2842
2843 % Define the macros used in formatting output of the sorted index material.
2844
2845 % @printindex causes a particular index (the ??s file) to get printed.
2846 % It does not print any chapter heading (usually an @unnumbered).
2847 %
2848 \def\printindex{\parsearg\doprintindex}
2849 \def\doprintindex#1{\begingroup
2850   \dobreak \chapheadingskip{10000}%
2851   %
2852   \indexfonts \rm \mc
2853   \tolerance = 9500
2854   \indexbreaks
2855   %
2856   % See if the index file exists and is nonempty.
2857   % Change catcode of @ here so that if the index file contains
2858   % \initial {@}
2859   % as its first line, TeX doesn't complain about mismatched braces
2860   % (because it thinks @} is a control sequence).
2861   \catcode`\@ = 11
2862   \openin 1 \jobname.#1s
2863   \ifeof 1
2864     % \enddoublecolumns gets confused if there is no text in the index,
2865     % and it loses the chapter title and the aux file entries for the
2866     % index.  The easiest way to prevent this problem is to make sure
2867     % there is some text.
2868     (Index is nonexistent)
2869   \else
2870     %
2871     % If the index file exists but is empty, then \openin leaves \ifeof
2872     % false.  We have to make TeX try to read something from the file, so
2873     % it can discover if there is anything in it.
2874     \read 1 to \temp
2875     \ifeof 1
2876       (Index is empty)
2877     \else
2878       % Index files are almost Texinfo source, but we use \ as the escape
2879       % character.  It would be better to use @, but that's too big a change
2880       % to make right now.
2881       \def\indexbackslash{\rawbackslashxx}%
2882       \catcode`\\ = 0
2883       \escapechar = `\\
2884       \begindoublecolumns
2885       \input \jobname.#1s
2886       \enddoublecolumns
2887     \fi
2888   \fi
2889   \closein 1
2890 \endgroup}
2891
2892 % These macros are used by the sorted index file itself.
2893 % Change them to control the appearance of the index.
2894
2895 \def\initial#1{{%
2896   % Some minor font changes for the special characters.
2897   \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
2898   %
2899   % Remove any glue we may have, we'll be inserting our own.
2900   \removelastskip
2901   % 
2902   % We like breaks before the index initials, so insert a bonus.
2903   \penalty -300
2904   %
2905   % Typeset the initial.  Making this add up to a whole number of
2906   % baselineskips increases the chance of the dots lining up from column
2907   % to column.  It still won't often be perfect, because of the stretch
2908   % we need before each entry, but it's better.
2909   % 
2910   % No shrink because it confuses \balancecolumns.
2911   \vskip 1.67\baselineskip plus .5\baselineskip
2912   \leftline{\secbf\secgt #1}%
2913   \vskip .33\baselineskip plus .1\baselineskip
2914   %
2915   % Do our best not to break after the initial.
2916   \nobreak
2917 }}
2918
2919 % This typesets a paragraph consisting of #1, dot leaders, and then #2
2920 % flush to the right margin.  It is used for index and table of contents
2921 % entries.  The paragraph is indented by \leftskip.
2922 %
2923 \def\entry#1#2{\begingroup
2924   %
2925   % Start a new paragraph if necessary, so our assignments below can't
2926   % affect previous text.
2927   \par
2928   %
2929   % Do not fill out the last line with white space.
2930   \parfillskip = 0in
2931   %
2932   % No extra space above this paragraph.
2933   \parskip = 0in
2934   %
2935   % Do not prefer a separate line ending with a hyphen to fewer lines.
2936   \finalhyphendemerits = 0
2937   %
2938   % \hangindent is only relevant when the entry text and page number
2939   % don't both fit on one line.  In that case, bob suggests starting the
2940   % dots pretty far over on the line.  Unfortunately, a large
2941   % indentation looks wrong when the entry text itself is broken across
2942   % lines.  So we use a small indentation and put up with long leaders.
2943   %
2944   % \hangafter is reset to 1 (which is the value we want) at the start
2945   % of each paragraph, so we need not do anything with that.
2946   \hangindent = 2em
2947   %
2948   % When the entry text needs to be broken, just fill out the first line
2949   % with blank space.
2950   \rightskip = 0pt plus1fil
2951   %
2952   % A bit of stretch before each entry for the benefit of balancing columns.
2953   \vskip 0pt plus1pt
2954   %
2955   % Start a ``paragraph'' for the index entry so the line breaking
2956   % parameters we've set above will have an effect.
2957   \noindent
2958   %
2959   % Insert the text of the index entry.  TeX will do line-breaking on it.
2960   #1%
2961   % The following is kludged to not output a line of dots in the index if
2962   % there are no page numbers.  The next person who breaks this will be
2963   % cursed by a Unix daemon.
2964   \def\tempa{{\rm }}%
2965   \def\tempb{#2}%
2966   \edef\tempc{\tempa}%
2967   \edef\tempd{\tempb}%
2968   \ifx\tempc\tempd\ \else%
2969     %
2970     % If we must, put the page number on a line of its own, and fill out
2971     % this line with blank space.  (The \hfil is overwhelmed with the
2972     % fill leaders glue in \indexdotfill if the page number does fit.)
2973     \hfil\penalty50
2974     \null\nobreak\indexdotfill % Have leaders before the page number.
2975     %
2976     % The `\ ' here is removed by the implicit \unskip that TeX does as
2977     % part of (the primitive) \par.  Without it, a spurious underfull
2978     % \hbox ensues.
2979     \ #2% The page number ends the paragraph.
2980   \fi%
2981   \par
2982 \endgroup}
2983
2984 % Like \dotfill except takes at least 1 em.
2985 \def\indexdotfill{\cleaders
2986   \hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \mkern1.5mu$}\hskip 1em plus 1fill}
2987
2988 \def\primary #1{\line{#1\hfil}}
2989
2990 \newskip\secondaryindent \secondaryindent=0.5cm
2991
2992 \def\secondary #1#2{
2993 {\parfillskip=0in \parskip=0in
2994 \hangindent =1in \hangafter=1
2995 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par
2996 }}
2997
2998 % Define two-column mode, which we use to typeset indexes.
2999 % Adapted from the TeXbook, page 416, which is to say,
3000 % the manmac.tex format used to print the TeXbook itself.
3001 \catcode`\@=11
3002
3003 \newbox\partialpage
3004 \newdimen\doublecolumnhsize
3005
3006 \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
3007   % Grab any single-column material above us.
3008   \output = {\global\setbox\partialpage = \vbox{%
3009     % 
3010     % Here is a possibility not foreseen in manmac: if we accumulate a
3011     % whole lot of material, we might end up calling this \output
3012     % routine twice in a row (see the doublecol-lose test, which is
3013     % essentially a couple of indexes with @setchapternewpage off).  In
3014     % that case, we must prevent the second \partialpage from
3015     % simply overwriting the first, causing us to lose the page.
3016     % This will preserve it until a real output routine can ship it
3017     % out.  Generally, \partialpage will be empty when this runs and
3018     % this will be a no-op.
3019     \unvbox\partialpage
3020     %
3021     % Unvbox the main output page.
3022     \unvbox255
3023     \kern-\topskip \kern\baselineskip
3024   }}%
3025   \eject
3026   %
3027   % Use the double-column output routine for subsequent pages.
3028   \output = {\doublecolumnout}%
3029   %
3030   % Change the page size parameters.  We could do this once outside this
3031   % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
3032   % format, but then we repeat the same computation.  Repeating a couple
3033   % of assignments once per index is clearly meaningless for the
3034   % execution time, so we may as well do it in one place.
3035   %
3036   % First we halve the line length, less a little for the gutter between
3037   % the columns.  We compute the gutter based on the line length, so it
3038   % changes automatically with the paper format.  The magic constant
3039   % below is chosen so that the gutter has the same value (well, +-<1pt)
3040   % as it did when we hard-coded it.
3041   %
3042   % We put the result in a separate register, \doublecolumhsize, so we
3043   % can restore it in \pagesofar, after \hsize itself has (potentially)
3044   % been clobbered.
3045   %
3046   \doublecolumnhsize = \hsize
3047     \advance\doublecolumnhsize by -.04154\hsize
3048     \divide\doublecolumnhsize by 2
3049   \hsize = \doublecolumnhsize
3050   %
3051   % Double the \vsize as well.  (We don't need a separate register here,
3052   % since nobody clobbers \vsize.)
3053   \advance\vsize by -\ht\partialpage
3054   \vsize = 2\vsize
3055 }
3056
3057 % The double-column output routine for all double-column pages except
3058 % the last.
3059
3060 \def\doublecolumnout{%
3061   \splittopskip=\topskip \splitmaxdepth=\maxdepth
3062   % Get the available space for the double columns -- the normal
3063   % (undoubled) page height minus any material left over from the
3064   % previous page.
3065   \dimen@ = \vsize
3066   \divide\dimen@ by 2
3067   %
3068   % box0 will be the left-hand column, box2 the right.
3069   \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
3070   \onepageout\pagesofar
3071   \unvbox255
3072   \penalty\outputpenalty
3073 }
3074 \def\pagesofar{%
3075   % Re-output the contents of the output page -- any previous material,
3076   % followed by the two boxes we just split, in box0 and box2.
3077   \advance\vsize by \ht\partialpage
3078   \unvbox\partialpage
3079   %
3080   \hsize = \doublecolumnhsize
3081   \wd0=\hsize \wd2=\hsize
3082   \hbox to\pagewidth{\box0\hfil\box2}%
3083 }
3084 \def\enddoublecolumns{%
3085   \output = {%
3086     % Split the last of the double-column material.  Leave on the
3087     % current page, no automatic page break.
3088     \balancecolumns
3089     %
3090     % If we end up splitting too much material for the current page,
3091     % though, there will be another page break right after this \output
3092     % invocation ends.  Having called \balancecolumns once, we do not
3093     % want to call it again.  Therefore, reset \output to its normal
3094     % definition right away.  (We hope \balancecolumns will never be
3095     % called on to balance too much material, but if it is, this makes
3096     % the output somewhat more palatable.)
3097     \global\output = {\onepageout{\pagecontents\PAGE}}%
3098     %
3099     % \pagegoal was set to the doubled \vsize above, since we restarted
3100     % the current page.  We're now back to normal single-column
3101     % typesetting, so reset \pagegoal to the normal \vsize.
3102     \pagegoal = \vsize
3103   }%
3104   \eject
3105   \endgroup % started in \begindoublecolumns
3106 }
3107 \def\balancecolumns{%
3108   % Called at the end of the double column material.
3109   \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
3110   \dimen@ = \ht0
3111   \advance\dimen@ by \topskip
3112   \advance\dimen@ by-\baselineskip
3113   \divide\dimen@ by 2 % target to split to
3114   %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
3115   \splittopskip = \topskip
3116   % Loop until we get a decent breakpoint.
3117   {%
3118     \vbadness = 10000
3119     \loop
3120       \global\setbox3 = \copy0
3121       \global\setbox1 = \vsplit3 to \dimen@
3122     \ifdim\ht3>\dimen@
3123       \global\advance\dimen@ by 1pt
3124     \repeat
3125   }%
3126   %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
3127   \setbox0=\vbox to\dimen@{\unvbox1}%
3128   \setbox2=\vbox to\dimen@{\unvbox3}%
3129   %
3130   \pagesofar
3131 }
3132 \catcode`\@ = \other
3133
3134
3135 \message{sectioning,}
3136 % Define chapters, sections, etc.
3137
3138 \newcount\chapno
3139 \newcount\secno        \secno=0
3140 \newcount\subsecno     \subsecno=0
3141 \newcount\subsubsecno  \subsubsecno=0
3142
3143 % This counter is funny since it counts through charcodes of letters A, B, ...
3144 \newcount\appendixno  \appendixno = `\@
3145 \def\appendixletter{\char\the\appendixno}
3146
3147 % Each @chapter defines this as the name of the chapter.
3148 % page headings and footings can use it.  @section does likewise.
3149 \def\thischapter{}
3150 \def\thissection{}
3151
3152 \newcount\absseclevel % used to calculate proper heading level
3153 \newcount\secbase\secbase=0 % @raise/lowersections modify this count
3154
3155 % @raisesections: treat @section as chapter, @subsection as section, etc.
3156 \def\raisesections{\global\advance\secbase by -1}
3157 \let\up=\raisesections % original BFox name
3158
3159 % @lowersections: treat @chapter as section, @section as subsection, etc.
3160 \def\lowersections{\global\advance\secbase by 1}
3161 \let\down=\lowersections % original BFox name
3162
3163 % Choose a numbered-heading macro
3164 % #1 is heading level if unmodified by @raisesections or @lowersections
3165 % #2 is text for heading
3166 \def\numhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
3167 \ifcase\absseclevel
3168   \chapterzzz{#2}
3169 \or
3170   \seczzz{#2}
3171 \or
3172   \numberedsubseczzz{#2}
3173 \or
3174   \numberedsubsubseczzz{#2}
3175 \else
3176   \ifnum \absseclevel<0
3177     \chapterzzz{#2}
3178   \else
3179     \numberedsubsubseczzz{#2}
3180   \fi
3181 \fi
3182 }
3183
3184 % like \numhead, but chooses appendix heading levels
3185 \def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
3186 \ifcase\absseclevel
3187   \appendixzzz{#2}
3188 \or
3189   \appendixsectionzzz{#2}
3190 \or
3191   \appendixsubseczzz{#2}
3192 \or
3193   \appendixsubsubseczzz{#2}
3194 \else
3195   \ifnum \absseclevel<0
3196     \appendixzzz{#2}
3197   \else
3198     \appendixsubsubseczzz{#2}
3199   \fi
3200 \fi
3201 }
3202
3203 % like \numhead, but chooses numberless heading levels
3204 \def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
3205 \ifcase\absseclevel
3206   \unnumberedzzz{#2}
3207 \or
3208   \unnumberedseczzz{#2}
3209 \or
3210   \unnumberedsubseczzz{#2}
3211 \or
3212   \unnumberedsubsubseczzz{#2}
3213 \else
3214   \ifnum \absseclevel<0
3215     \unnumberedzzz{#2}
3216   \else
3217     \unnumberedsubsubseczzz{#2}
3218   \fi
3219 \fi
3220 }
3221
3222 % @chapter, @appendix, @unnumbered.
3223 \def\thischaptername{No Chapter Title}
3224 \outer\def\chapter{\parsearg\chapteryyy}
3225 \def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz
3226 \def\chapterzzz #1{%
3227 \secno=0 \subsecno=0 \subsubsecno=0
3228 \global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}%
3229 \chapmacro {#1}{\the\chapno}%
3230 \gdef\thissection{#1}%
3231 \gdef\thischaptername{#1}%
3232 % We don't substitute the actual chapter name into \thischapter
3233 % because we don't want its macros evaluated now.
3234 \xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}%
3235 \toks0 = {#1}%
3236 \edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}%
3237                                   {\the\chapno}}}%
3238 \temp
3239 \donoderef
3240 \global\let\section = \numberedsec
3241 \global\let\subsection = \numberedsubsec
3242 \global\let\subsubsection = \numberedsubsubsec
3243 }
3244
3245 \outer\def\appendix{\parsearg\appendixyyy}
3246 \def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz
3247 \def\appendixzzz #1{%
3248 \secno=0 \subsecno=0 \subsubsecno=0
3249 \global\advance \appendixno by 1
3250 \message{\putwordAppendix\space \appendixletter}%
3251 \chapmacro {#1}{\putwordAppendix{} \appendixletter}%
3252 \gdef\thissection{#1}%
3253 \gdef\thischaptername{#1}%
3254 \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
3255 \toks0 = {#1}%
3256 \edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}%
3257                        {\putwordAppendix{} \appendixletter}}}%
3258 \temp
3259 \appendixnoderef
3260 \global\let\section = \appendixsec
3261 \global\let\subsection = \appendixsubsec
3262 \global\let\subsubsection = \appendixsubsubsec
3263 }
3264
3265 % @centerchap is like @unnumbered, but the heading is centered.
3266 \outer\def\centerchap{\parsearg\centerchapyyy}
3267 \def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}}
3268
3269 % @top is like @unnumbered.
3270 \outer\def\top{\parsearg\unnumberedyyy}
3271
3272 \outer\def\unnumbered{\parsearg\unnumberedyyy}
3273 \def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
3274 \def\unnumberedzzz #1{%
3275 \secno=0 \subsecno=0 \subsubsecno=0
3276 %
3277 % This used to be simply \message{#1}, but TeX fully expands the
3278 % argument to \message.  Therefore, if #1 contained @-commands, TeX
3279 % expanded them.  For example, in `@unnumbered The @cite{Book}', TeX
3280 % expanded @cite (which turns out to cause errors because \cite is meant
3281 % to be executed, not expanded).
3282 %
3283 % Anyway, we don't want the fully-expanded definition of @cite to appear
3284 % as a result of the \message, we just want `@cite' itself.  We use
3285 % \the<toks register> to achieve this: TeX expands \the<toks> only once,
3286 % simply yielding the contents of <toks register>.  (We also do this for
3287 % the toc entries.)
3288 \toks0 = {#1}\message{(\the\toks0)}%
3289 %
3290 \unnumbchapmacro {#1}%
3291 \gdef\thischapter{#1}\gdef\thissection{#1}%
3292 \toks0 = {#1}%
3293 \edef\temp{\noexpand\writetocentry{\realbackslash unnumbchapentry{\the\toks0}}}%
3294 \temp
3295 \unnumbnoderef
3296 \global\let\section = \unnumberedsec
3297 \global\let\subsection = \unnumberedsubsec
3298 \global\let\subsubsection = \unnumberedsubsubsec
3299 }
3300
3301 % Sections.
3302 \outer\def\numberedsec{\parsearg\secyyy}
3303 \def\secyyy #1{\numhead1{#1}} % normally calls seczzz
3304 \def\seczzz #1{%
3305 \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
3306 \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
3307 \toks0 = {#1}%
3308 \edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}%
3309                                   {\the\chapno}{\the\secno}}}%
3310 \temp
3311 \donoderef
3312 \nobreak
3313 }
3314
3315 \outer\def\appendixsection{\parsearg\appendixsecyyy}
3316 \outer\def\appendixsec{\parsearg\appendixsecyyy}
3317 \def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz
3318 \def\appendixsectionzzz #1{%
3319 \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
3320 \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
3321 \toks0 = {#1}%
3322 \edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}%
3323                                   {\appendixletter}{\the\secno}}}%
3324 \temp
3325 \appendixnoderef
3326 \nobreak
3327 }
3328
3329 \outer\def\unnumberedsec{\parsearg\unnumberedsecyyy}
3330 \def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz
3331 \def\unnumberedseczzz #1{%
3332 \plainsecheading {#1}\gdef\thissection{#1}%
3333 \toks0 = {#1}%
3334 \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry{\the\toks0}}}%
3335 \temp
3336 \unnumbnoderef
3337 \nobreak
3338 }
3339
3340 % Subsections.
3341 \outer\def\numberedsubsec{\parsearg\numberedsubsecyyy}
3342 \def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz
3343 \def\numberedsubseczzz #1{%
3344 \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
3345 \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
3346 \toks0 = {#1}%
3347 \edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}%
3348                                     {\the\chapno}{\the\secno}{\the\subsecno}}}%
3349 \temp
3350 \donoderef
3351 \nobreak
3352 }
3353
3354 \outer\def\appendixsubsec{\parsearg\appendixsubsecyyy}
3355 \def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz
3356 \def\appendixsubseczzz #1{%
3357 \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
3358 \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
3359 \toks0 = {#1}%
3360 \edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}%
3361                                 {\appendixletter}{\the\secno}{\the\subsecno}}}%
3362 \temp
3363 \appendixnoderef
3364 \nobreak
3365 }
3366
3367 \outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy}
3368 \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
3369 \def\unnumberedsubseczzz #1{%
3370 \plainsubsecheading {#1}\gdef\thissection{#1}%
3371 \toks0 = {#1}%
3372 \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry%
3373                                     {\the\toks0}}}%
3374 \temp
3375 \unnumbnoderef
3376 \nobreak
3377 }
3378
3379 % Subsubsections.
3380 \outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy}
3381 \def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz
3382 \def\numberedsubsubseczzz #1{%
3383 \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
3384 \subsubsecheading {#1}
3385   {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
3386 \toks0 = {#1}%
3387 \edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}%
3388   {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
3389 \temp
3390 \donoderef
3391 \nobreak
3392 }
3393
3394 \outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy}
3395 \def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz
3396 \def\appendixsubsubseczzz #1{%
3397 \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
3398 \subsubsecheading {#1}
3399   {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
3400 \toks0 = {#1}%
3401 \edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}%
3402   {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
3403 \temp
3404 \appendixnoderef
3405 \nobreak
3406 }
3407
3408 \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy}
3409 \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
3410 \def\unnumberedsubsubseczzz #1{%
3411 \plainsubsubsecheading {#1}\gdef\thissection{#1}%
3412 \toks0 = {#1}%
3413 \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry%
3414                                     {\the\toks0}}}%
3415 \temp
3416 \unnumbnoderef
3417 \nobreak
3418 }
3419
3420 % These are variants which are not "outer", so they can appear in @ifinfo.
3421 % Actually, they should now be obsolete; ordinary section commands should work.
3422 \def\infotop{\parsearg\unnumberedzzz}
3423 \def\infounnumbered{\parsearg\unnumberedzzz}
3424 \def\infounnumberedsec{\parsearg\unnumberedseczzz}
3425 \def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz}
3426 \def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
3427
3428 \def\infoappendix{\parsearg\appendixzzz}
3429 \def\infoappendixsec{\parsearg\appendixseczzz}
3430 \def\infoappendixsubsec{\parsearg\appendixsubseczzz}
3431 \def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz}
3432
3433 \def\infochapter{\parsearg\chapterzzz}
3434 \def\infosection{\parsearg\sectionzzz}
3435 \def\infosubsection{\parsearg\subsectionzzz}
3436 \def\infosubsubsection{\parsearg\subsubsectionzzz}
3437
3438 % These macros control what the section commands do, according
3439 % to what kind of chapter we are in (ordinary, appendix, or unnumbered).
3440 % Define them by default for a numbered chapter.
3441 \global\let\section = \numberedsec
3442 \global\let\subsection = \numberedsubsec
3443 \global\let\subsubsection = \numberedsubsubsec
3444
3445 % Define @majorheading, @heading and @subheading
3446
3447 % NOTE on use of \vbox for chapter headings, section headings, and such:
3448 %       1) We use \vbox rather than the earlier \line to permit
3449 %          overlong headings to fold.
3450 %       2) \hyphenpenalty is set to 10000 because hyphenation in a
3451 %          heading is obnoxious; this forbids it.
3452 %       3) Likewise, headings look best if no \parindent is used, and
3453 %          if justification is not attempted.  Hence \raggedright.
3454
3455
3456 \def\majorheading{\parsearg\majorheadingzzz}
3457 \def\majorheadingzzz #1{%
3458 {\advance\chapheadingskip by 10pt \chapbreak }%
3459 {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
3460                   \parindent=0pt\raggedright
3461                   \rm\mc #1\hfill}}\bigskip \par\penalty 200}
3462
3463 \def\chapheading{\parsearg\chapheadingzzz}
3464 \def\chapheadingzzz #1{\chapbreak %
3465 {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
3466                   \parindent=0pt\raggedright
3467                   \rm\mc #1\hfill}}\bigskip \par\penalty 200}
3468
3469 % @heading, @subheading, @subsubheading.
3470 \def\heading{\parsearg\plainsecheading}
3471 \def\subheading{\parsearg\plainsubsecheading}
3472 \def\subsubheading{\parsearg\plainsubsubsecheading}
3473
3474 % These macros generate a chapter, section, etc. heading only
3475 % (including whitespace, linebreaking, etc. around it),
3476 % given all the information in convenient, parsed form.
3477
3478 %%% Args are the skip and penalty (usually negative)
3479 \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
3480
3481 \def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
3482
3483 %%% Define plain chapter starts, and page on/off switching for it
3484 % Parameter controlling skip before chapter headings (if needed)
3485
3486 \newskip\chapheadingskip
3487
3488 \def\chapbreak{\dobreak \chapheadingskip {-4000}}
3489 \def\chappager{\par\vfill\supereject}
3490 \def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi}
3491
3492 \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
3493
3494 \def\CHAPPAGoff{%
3495 \global\let\contentsalignmacro = \chappager
3496 \global\let\pchapsepmacro=\chapbreak
3497 \global\let\pagealignmacro=\chappager}
3498
3499 \def\CHAPPAGon{%
3500 \global\let\contentsalignmacro = \chappager
3501 \global\let\pchapsepmacro=\chappager
3502 \global\let\pagealignmacro=\chappager
3503 \global\def\HEADINGSon{\HEADINGSsingle}}
3504
3505 \def\CHAPPAGodd{
3506 \global\let\contentsalignmacro = \chapoddpage
3507 \global\let\pchapsepmacro=\chapoddpage
3508 \global\let\pagealignmacro=\chapoddpage
3509 \global\def\HEADINGSon{\HEADINGSdouble}}
3510
3511 \CHAPPAGon
3512
3513 \def\CHAPFplain{
3514 \global\let\chapmacro=\chfplain
3515 \global\let\unnumbchapmacro=\unnchfplain
3516 \global\let\centerchapmacro=\centerchfplain}
3517
3518 % Plain chapter opening.
3519 % #1 is the text, #2 the chapter number or empty if unnumbered.
3520 \def\chfplain#1#2{%
3521   \pchapsepmacro
3522   {%
3523     \chapfonts \rm\mc
3524     \def\chapnum{#2}%
3525     \setbox0 = \hbox{#2\ifx\chapnum\empty\else\enspace\fi}%
3526     \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
3527           \hangindent = \wd0 \centerparametersmaybe
3528           \unhbox0 #1\par}%
3529   }%
3530   \nobreak\bigskip % no page break after a chapter title
3531   \nobreak
3532 }
3533
3534 % Plain opening for unnumbered.
3535 \def\unnchfplain#1{\chfplain{#1}{}}
3536
3537 % @centerchap -- centered and unnumbered.
3538 \let\centerparametersmaybe = \relax
3539 \def\centerchfplain#1{{%
3540   \def\centerparametersmaybe{%
3541     \advance\rightskip by 3\rightskip
3542     \leftskip = \rightskip
3543     \parfillskip = 0pt
3544   }%
3545   \chfplain{#1}{}%
3546 }}
3547
3548 \CHAPFplain % The default
3549
3550 \def\unnchfopen #1{%
3551 \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
3552                        \parindent=0pt\raggedright
3553                        \rm\mc #1\hfill}}\bigskip \par\nobreak
3554 }
3555
3556 \def\chfopen #1#2{\chapoddpage {\chapfonts
3557 \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
3558 \par\penalty 5000 %
3559 }
3560
3561 \def\centerchfopen #1{%
3562 \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
3563                        \parindent=0pt
3564                        \hfill {\rm\mc #1}\hfill}}\bigskip \par\nobreak
3565 }
3566
3567 \def\CHAPFopen{
3568 \global\let\chapmacro=\chfopen
3569 \global\let\unnumbchapmacro=\unnchfopen
3570 \global\let\centerchapmacro=\centerchfopen}
3571
3572
3573 % Section titles.
3574 \newskip\secheadingskip
3575 \def\secheadingbreak{\dobreak \secheadingskip {-1000}}
3576 \def\secheading#1#2#3{\sectionheading{sec}{#2.#3}{#1}}
3577 \def\plainsecheading#1{\sectionheading{sec}{}{#1}}
3578
3579 % Subsection titles.
3580 \newskip \subsecheadingskip
3581 \def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}}
3582 \def\subsecheading#1#2#3#4{\sectionheading{subsec}{#2.#3.#4}{#1}}
3583 \def\plainsubsecheading#1{\sectionheading{subsec}{}{#1}}
3584
3585 % Subsubsection titles.
3586 \let\subsubsecheadingskip = \subsecheadingskip
3587 \let\subsubsecheadingbreak = \subsecheadingbreak
3588 \def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}}
3589 \def\plainsubsubsecheading#1{\sectionheading{subsubsec}{}{#1}}
3590
3591
3592 % Print any size section title.
3593 %
3594 % #1 is the section type (sec/subsec/subsubsec), #2 is the section
3595 % number (maybe empty), #3 the text.
3596 \def\sectionheading#1#2#3{%
3597   {%
3598     \expandafter\advance\csname #1headingskip\endcsname by \parskip
3599     \csname #1headingbreak\endcsname
3600   }%
3601   {%
3602     % Switch to the right set of fonts.
3603     \csname #1fonts\endcsname \rm\mc
3604     %
3605     % Only insert the separating space if we have a section number.
3606     \def\secnum{#2}%
3607     \setbox0 = \hbox{#2\ifx\secnum\empty\else\enspace\fi}%
3608     %
3609     \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
3610           \hangindent = \wd0 % zero if no section number
3611           \unhbox0 #3}%
3612   }%
3613   \ifdim\parskip<10pt \nobreak\kern10pt\nobreak\kern-\parskip\fi \nobreak
3614 }
3615
3616
3617 \message{toc,}
3618 \newwrite\tocfile
3619
3620 % Write an entry to the toc file, opening it if necessary.
3621 % Called from @chapter, etc.  We supply {\folio} at the end of the
3622 % argument, which will end up as the last argument to the \...entry macro.
3623
3624 % We open the .toc file here instead of at @setfilename or any other
3625 % given time so that @contents can be put in the document anywhere.
3626
3627 \newif\iftocfileopened
3628 \def\writetocentry#1{%
3629   \iftocfileopened\else
3630     \immediate\openout\tocfile = \jobname.toc
3631     \global\tocfileopenedtrue
3632   \fi
3633   \iflinks \write\tocfile{#1{\folio}}\fi
3634 }
3635
3636 \newskip\contentsrightmargin \contentsrightmargin=1in
3637 \newcount\savepageno
3638 \newcount\lastnegativepageno \lastnegativepageno = -1
3639
3640 % Finish up the main text and prepare to read what we've written
3641 % to \tocfile.
3642
3643 \def\startcontents#1{%
3644    % If @setchapternewpage on, and @headings double, the contents should
3645    % start on an odd page, unlike chapters.  Thus, we maintain
3646    % \contentsalignmacro in parallel with \pagealignmacro.
3647    % From: Torbjorn Granlund <tege@matematik.su.se>
3648    \contentsalignmacro
3649    \immediate\closeout\tocfile
3650    %
3651    % Don't need to put `Contents' or `Short Contents' in the headline.
3652    % It is abundantly clear what they are.
3653    \unnumbchapmacro{#1}\def\thischapter{}%
3654    \savepageno = \pageno
3655    \begingroup                  % Set up to handle contents files properly.
3656       \catcode`\\=0  \catcode`\{=1  \catcode`\}=2  \catcode`\@=11
3657       % We can't do this, because then an actual ^ in a section
3658       % title fails, e.g., @chapter ^ -- exponentiation.  --karl, 9jul97.
3659       %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
3660       \raggedbottom             % Worry more about breakpoints than the bottom.
3661       \advance\hsize by -\contentsrightmargin % Don't use the full line length.
3662       %
3663       % Roman numerals for page numbers.
3664       \ifnum \pageno>0 \pageno = \lastnegativepageno \fi
3665 }
3666
3667
3668 % Normal (long) toc.
3669 \def\contents{%
3670    \startcontents{\putwordTableofContents}%
3671      \openin 1 \jobname.toc
3672      \ifeof 1 \else
3673        \closein 1
3674        \input \jobname.toc
3675      \fi
3676      \vfill \eject
3677    \endgroup
3678    \lastnegativepageno = \pageno
3679    \pageno = \savepageno
3680 }
3681
3682 % And just the chapters.
3683 \def\summarycontents{%
3684    \startcontents{\putwordShortContents}%
3685       %
3686       \let\chapentry = \shortchapentry
3687       \let\unnumbchapentry = \shortunnumberedentry
3688       % We want a true roman here for the page numbers.
3689       \secfonts
3690       \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl
3691       \let\mc=\shortcontmc \let\gt=\shortcontgt
3692       \rm\mc
3693       \hyphenpenalty = 10000
3694       \advance\baselineskip by 1pt % Open it up a little.
3695       \def\secentry ##1##2##3##4{}
3696       \def\unnumbsecentry ##1##2{}
3697       \def\subsecentry ##1##2##3##4##5{}
3698       \def\unnumbsubsecentry ##1##2{}
3699       \def\subsubsecentry ##1##2##3##4##5##6{}
3700       \def\unnumbsubsubsecentry ##1##2{}
3701       \openin 1 \jobname.toc
3702       \ifeof 1 \else
3703         \closein 1
3704         \input \jobname.toc
3705       \fi
3706      \vfill \eject
3707    \endgroup
3708    \lastnegativepageno = \pageno
3709    \pageno = \savepageno
3710 }
3711 \let\shortcontents = \summarycontents
3712
3713 % These macros generate individual entries in the table of contents.
3714 % The first argument is the chapter or section name.
3715 % The last argument is the page number.
3716 % The arguments in between are the chapter number, section number, ...
3717
3718 % Chapter-level things, for both the long and short contents.
3719 \def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}
3720
3721 % See comments in \dochapentry re vbox and related settings
3722 \def\shortchapentry#1#2#3{%
3723   \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno{#3}}%
3724 }
3725
3726 % Typeset the label for a chapter or appendix for the short contents.
3727 % The arg is, e.g. `Appendix A' for an appendix, or `3' for a chapter.
3728 % We could simplify the code here by writing out an \appendixentry
3729 % command in the toc file for appendices, instead of using \chapentry
3730 % for both, but it doesn't seem worth it.
3731 \setbox0 = \hbox{\shortcontrm \putwordAppendix }
3732 \newdimen\shortappendixwidth \shortappendixwidth = \wd0
3733
3734 \def\shortchaplabel#1{%
3735   % We typeset #1 in a box of constant width, regardless of the text of
3736   % #1, so the chapter titles will come out aligned.
3737   \setbox0 = \hbox{#1}%
3738   \dimen0 = \ifdim\wd0 > \shortappendixwidth \shortappendixwidth \else 0pt \fi
3739   %
3740   % This space should be plenty, since a single number is .5em, and the
3741   % widest letter (M) is 1em, at least in the Computer Modern fonts.
3742   % (This space doesn't include the extra space that gets added after
3743   % the label; that gets put in by \shortchapentry above.)
3744   \advance\dimen0 by 1.1em
3745   \hbox to \dimen0{#1\hfil}%
3746 }
3747
3748 \def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
3749 \def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno{#2}}}
3750
3751 % Sections.
3752 \def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}}
3753 \def\unnumbsecentry#1#2{\dosecentry{#1}{#2}}
3754
3755 % Subsections.
3756 \def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}}
3757 \def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}}
3758
3759 % And subsubsections.
3760 \def\subsubsecentry#1#2#3#4#5#6{%
3761   \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}}
3762 \def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}}
3763
3764 % This parameter controls the indentation of the various levels.
3765 \newdimen\tocindent \tocindent = 3pc
3766
3767 % Now for the actual typesetting. In all these, #1 is the text and #2 is the
3768 % page number.
3769 %
3770 % If the toc has to be broken over pages, we want it to be at chapters
3771 % if at all possible; hence the \penalty.
3772 \def\dochapentry#1#2{%
3773    \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
3774    \begingroup
3775      \chapentryfonts
3776      \tocentry{#1}{\dopageno{#2}}%
3777    \endgroup
3778    \nobreak\vskip .25\baselineskip plus.1\baselineskip
3779 }
3780
3781 \def\dosecentry#1#2{\begingroup
3782   \secentryfonts \leftskip=\tocindent
3783   \tocentry{#1}{\dopageno{#2}}%
3784 \endgroup}
3785
3786 \def\dosubsecentry#1#2{\begingroup
3787   \subsecentryfonts \leftskip=2\tocindent
3788   \tocentry{#1}{\dopageno{#2}}%
3789 \endgroup}
3790
3791 \def\dosubsubsecentry#1#2{\begingroup
3792   \subsubsecentryfonts \leftskip=3\tocindent
3793   \tocentry{#1}{\dopageno{#2}}%
3794 \endgroup}
3795
3796 % Final typesetting of a toc entry; we use the same \entry macro as for
3797 % the index entries, but we want to suppress hyphenation here.  (We
3798 % can't do that in the \entry macro, since index entries might consist
3799 % of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.)
3800 \def\tocentry#1#2{\begingroup
3801   \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks
3802   % Do not use \turnoffactive in these arguments.  Since the toc is
3803   % typeset in cmr, so characters such as _ would come out wrong; we
3804   % have to do the usual translation tricks.
3805   \entry{#1}{#2}%
3806 \endgroup}
3807
3808 % Space between chapter (or whatever) number and the title.
3809 \def\labelspace{\hskip1em \relax}
3810
3811 \def\dopageno#1{{\rm\mc #1}}
3812 \def\doshortpageno#1{{\rm\mc #1}}
3813
3814 \def\chapentryfonts{\secfonts \rm\mc}
3815 \def\secentryfonts{\textfonts}
3816 \let\subsecentryfonts = \textfonts
3817 \let\subsubsecentryfonts = \textfonts
3818
3819
3820 \message{environments,}
3821
3822 % Since these characters are used in examples, it should be an even number of
3823 % \tt widths. Each \tt character is 1en, so two makes it 1em.
3824 % Furthermore, these definitions must come after we define our fonts.
3825 \newbox\dblarrowbox    \newbox\longdblarrowbox
3826 \newbox\pushcharbox    \newbox\bullbox
3827 \newbox\equivbox       \newbox\errorbox
3828
3829 %{\tentt
3830 %\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil}
3831 %\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil}
3832 %\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil}
3833 %\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil}
3834 % Adapted from the manmac format (p.420 of TeXbook)
3835 %\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex
3836 %                                      depth .1ex\hfil}
3837 %}
3838
3839 % @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
3840 \def\point{$\star$}
3841 \def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
3842 \def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}}
3843 \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
3844 \def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}}
3845
3846 % Adapted from the TeXbook's \boxit.
3847 {\tentt \global\dimen0 = 3em}% Width of the box.
3848 \dimen2 = .55pt % Thickness of rules
3849 % The text. (`r' is open on the right, `e' somewhat less so on the left.)
3850 \setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt}
3851
3852 \global\setbox\errorbox=\hbox to \dimen0{\hfil
3853    \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
3854    \advance\hsize by -2\dimen2 % Rules.
3855    \vbox{
3856       \hrule height\dimen2
3857       \hbox{\vrule width\dimen2 \kern3pt          % Space to left of text.
3858          \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
3859          \kern3pt\vrule width\dimen2}% Space to right.
3860       \hrule height\dimen2}
3861     \hfil}
3862
3863 % The @error{} command.
3864 \def\error{\leavevmode\lower.7ex\copy\errorbox}
3865
3866 % @tex ... @end tex    escapes into raw Tex temporarily.
3867 % One exception: @ is still an escape character, so that @end tex works.
3868 % But \@ or @@ will get a plain tex @ character.
3869
3870 \def\tex{\begingroup
3871   \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
3872   \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
3873   \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
3874   \catcode `\%=14
3875   \catcode 43=12 % plus
3876   \catcode`\"=12
3877   \catcode`\==12
3878   \catcode`\|=12
3879   \catcode`\<=12
3880   \catcode`\>=12
3881   \escapechar=`\\
3882   %
3883   \let\b=\ptexb
3884   \let\bullet=\ptexbullet
3885   \let\c=\ptexc
3886   \let\,=\ptexcomma
3887   \let\.=\ptexdot
3888   \let\dots=\ptexdots
3889   \let\equiv=\ptexequiv
3890   \let\!=\ptexexclam
3891   \let\i=\ptexi
3892   \let\{=\ptexlbrace
3893   \let\+=\tabalign
3894   \let\}=\ptexrbrace
3895   \let\*=\ptexstar
3896   \let\t=\ptext
3897   %
3898   \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
3899   \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
3900   \def\@{@}%
3901 \let\Etex=\endgroup}
3902
3903 % Define @lisp ... @endlisp.
3904 % @lisp does a \begingroup so it can rebind things,
3905 % including the definition of @endlisp (which normally is erroneous).
3906
3907 % Amount to narrow the margins by for @lisp.
3908 \newskip\lispnarrowing \lispnarrowing=0.4in
3909
3910 % This is the definition that ^^M gets inside @lisp, @example, and other
3911 % such environments.  \null is better than a space, since it doesn't
3912 % have any width.
3913 \def\lisppar{\null\endgraf}
3914
3915 % Make each space character in the input produce a normal interword
3916 % space in the output.  Don't allow a line break at this space, as this
3917 % is used only in environments like @example, where each line of input
3918 % should produce a line of output anyway.
3919 %
3920 {\obeyspaces %
3921 \gdef\sepspaces{\obeyspaces\let =\tie}}
3922
3923 % Define \obeyedspace to be our active space, whatever it is.  This is
3924 % for use in \parsearg.
3925 {\sepspaces%
3926 \global\let\obeyedspace= }
3927
3928 % This space is always present above and below environments.
3929 \newskip\envskipamount \envskipamount = 0pt
3930
3931 % Make spacing and below environment symmetrical.  We use \parskip here
3932 % to help in doing that, since in @example-like environments \parskip
3933 % is reset to zero; thus the \afterenvbreak inserts no space -- but the
3934 % start of the next paragraph will insert \parskip
3935 %
3936 \def\aboveenvbreak{{\advance\envskipamount by \parskip
3937 \endgraf \ifdim\lastskip<\envskipamount
3938 \removelastskip \penalty-50 \vskip\envskipamount \fi}}
3939
3940 \let\afterenvbreak = \aboveenvbreak
3941
3942 % \nonarrowing is a flag.  If "set", @lisp etc don't narrow margins.
3943 \let\nonarrowing=\relax
3944
3945 % @cartouche ... @end cartouche: draw rectangle w/rounded corners around
3946 % environment contents.
3947 \font\circle=lcircle10
3948 \newdimen\circthick
3949 \newdimen\cartouter\newdimen\cartinner
3950 \newskip\normbskip\newskip\normpskip\newskip\normlskip
3951 \circthick=\fontdimen8\circle
3952 %
3953 \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
3954 \def\ctr{{\hskip 6pt\circle\char'010}}
3955 \def\cbl{{\circle\char'012\hskip -6pt}}
3956 \def\cbr{{\hskip 6pt\circle\char'011}}
3957 \def\carttop{\hbox to \cartouter{\hskip\lskip
3958         \ctl\leaders\hrule height\circthick\hfil\ctr
3959         \hskip\rskip}}
3960 \def\cartbot{\hbox to \cartouter{\hskip\lskip
3961         \cbl\leaders\hrule height\circthick\hfil\cbr
3962         \hskip\rskip}}
3963 %
3964 \newskip\lskip\newskip\rskip
3965
3966 \long\def\cartouche{%
3967 \begingroup
3968         \lskip=\leftskip \rskip=\rightskip
3969         \leftskip=0pt\rightskip=0pt %we want these *outside*.
3970         \cartinner=\hsize \advance\cartinner by-\lskip
3971                           \advance\cartinner by-\rskip
3972         \cartouter=\hsize
3973         \advance\cartouter by 18.4pt % allow for 3pt kerns on either
3974 %                                    side, and for 6pt waste from
3975 %                                    each corner char, and rule thickness
3976         \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
3977         % Flag to tell @lisp, etc., not to narrow margin.
3978         \let\nonarrowing=\comment
3979         \vbox\bgroup
3980                 \baselineskip=0pt\parskip=0pt\lineskip=0pt
3981                 \carttop
3982                 \hbox\bgroup
3983                         \hskip\lskip
3984                         \vrule\kern3pt
3985                         \vbox\bgroup
3986                                 \hsize=\cartinner
3987                                 \kern3pt
3988                                 \begingroup
3989                                         \baselineskip=\normbskip
3990                                         \lineskip=\normlskip
3991                                         \parskip=\normpskip
3992                                         \vskip -\parskip
3993 \def\Ecartouche{%
3994                                 \endgroup
3995                                 \kern3pt
3996                         \egroup
3997                         \kern3pt\vrule
3998                         \hskip\rskip
3999                 \egroup
4000                 \cartbot
4001         \egroup
4002 \endgroup
4003 }}
4004
4005
4006 % This macro is called at the beginning of all the @example variants,
4007 % inside a group.
4008 \def\nonfillstart{%
4009   \aboveenvbreak
4010   \inENV % This group ends at the end of the body
4011   \hfuzz = 12pt % Don't be fussy
4012   \sepspaces % Make spaces be word-separators rather than space tokens.
4013   \singlespace
4014   \let\par = \lisppar % don't ignore blank lines
4015   \obeylines % each line of input is a line of output
4016   \parskip = 0pt
4017   \parindent = 0pt
4018   \emergencystretch = 0pt % don't try to avoid overfull boxes
4019   % @cartouche defines \nonarrowing to inhibit narrowing
4020   % at next level down.
4021   \ifx\nonarrowing\relax
4022     \advance \leftskip by \lispnarrowing
4023     \exdentamount=\lispnarrowing
4024     \let\exdent=\nofillexdent
4025     \let\nonarrowing=\relax
4026   \fi
4027 }
4028
4029 % Define the \E... control sequence only if we are inside the particular
4030 % environment, so the error checking in \end will work.
4031
4032 % To end an @example-like environment, we first end the paragraph (via
4033 % \afterenvbreak's vertical glue), and then the group.  That way we keep
4034 % the zero \parskip that the environments set -- \parskip glue will be
4035 % inserted at the beginning of the next paragraph in the document, after
4036 % the environment.
4037 %
4038 \def\nonfillfinish{\afterenvbreak\endgroup}
4039
4040 % @lisp: indented, narrowed, typewriter font.
4041 \def\lisp{\begingroup
4042   \nonfillstart
4043   \let\Elisp = \nonfillfinish
4044   \tt
4045   \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
4046   \gobble       % eat return
4047 }
4048
4049 % @example: Same as @lisp.
4050 \def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp}
4051
4052 % @small... is usually equivalent to the non-small (@smallbook
4053 % redefines).  We must call \example (or whatever) last in the
4054 % definition, since it reads the return following the @example (or
4055 % whatever) command.
4056
4057 % This actually allows (for example) @end display inside an
4058 % @smalldisplay.  Too bad, but makeinfo will catch the error anyway.
4059 %
4060 \def\smalldisplay{\begingroup\def\Esmalldisplay{\nonfillfinish\endgroup}\display}
4061 \def\smallexample{\begingroup\def\Esmallexample{\nonfillfinish\endgroup}\lisp}
4062 \def\smallformat{\begingroup\def\Esmallformat{\nonfillfinish\endgroup}\format}
4063 \def\smalllisp{\begingroup\def\Esmalllisp{\nonfillfinish\endgroup}\lisp}
4064
4065 % Real @smallexample and @smalllisp (when @smallbook): use smaller fonts.
4066 % Originally contributed by Pavel@xerox.
4067 \def\smalllispx{\begingroup
4068   \def\Esmalllisp{\nonfillfinish\endgroup}%
4069   \def\Esmallexample{\nonfillfinish\endgroup}%
4070   \indexfonts
4071   \lisp
4072 }
4073
4074 % @display: same as @lisp except keep current font.
4075 %
4076 \def\display{\begingroup
4077   \nonfillstart
4078   \let\Edisplay = \nonfillfinish
4079   \gobble
4080 }
4081
4082 % @smalldisplay (when @smallbook): @display plus smaller fonts.
4083 %
4084 \def\smalldisplayx{\begingroup
4085   \def\Esmalldisplay{\nonfillfinish\endgroup}%
4086   \indexfonts \rm \mc
4087   \display
4088 }
4089
4090 % @format: same as @display except don't narrow margins.
4091 %
4092 \def\format{\begingroup
4093   \let\nonarrowing = t
4094   \nonfillstart
4095   \let\Eformat = \nonfillfinish
4096   \gobble
4097 }
4098
4099 % @smallformat (when @smallbook): @format plus smaller fonts.
4100 %
4101 \def\smallformatx{\begingroup
4102   \def\Esmallformat{\nonfillfinish\endgroup}%
4103   \indexfonts \rm \mc
4104   \format
4105 }
4106
4107 % @flushleft (same as @format).
4108 %
4109 \def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format}
4110
4111 % @flushright.
4112
4113 \def\flushright{\begingroup
4114   \let\nonarrowing = t
4115   \nonfillstart
4116   \let\Eflushright = \nonfillfinish
4117   \advance\leftskip by 0pt plus 1fill
4118   \gobble
4119 }
4120
4121 % @quotation does normal linebreaking (hence we can't use \nonfillstart)
4122 % and narrows the margins.
4123 %
4124 \def\quotation{%
4125   \begingroup\inENV %This group ends at the end of the @quotation body
4126   {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
4127   \singlespace
4128   \parindent=0pt
4129   % We have retained a nonzero parskip for the environment, since we're
4130   % doing normal filling. So to avoid extra space below the environment...
4131   \def\Equotation{\parskip = 0pt \nonfillfinish}%
4132   %
4133   % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
4134   \ifx\nonarrowing\relax
4135     \advance\leftskip by \lispnarrowing
4136     \advance\rightskip by \lispnarrowing
4137     \exdentamount = \lispnarrowing
4138     \let\nonarrowing = \relax
4139   \fi
4140 }
4141
4142
4143 \message{defuns,}
4144 % Define formatter for defuns
4145 % First, allow user to change definition object font (\df) internally
4146 \def\setdeffont #1 {\csname DEF#1\endcsname}
4147
4148 \newskip\defbodyindent \defbodyindent=.4in
4149 \newskip\defargsindent \defargsindent=50pt
4150 \newskip\deftypemargin \deftypemargin=12pt
4151 \newskip\deflastargmargin \deflastargmargin=18pt
4152
4153 \newcount\parencount
4154 % define \functionparens, which makes ( and ) and & do special things.
4155 % \functionparens affects the group it is contained in.
4156 \def\activeparens{%
4157 \catcode`\(=\active \catcode`\)=\active \catcode`\&=\active
4158 \catcode`\[=\active \catcode`\]=\active}
4159
4160 % Make control sequences which act like normal parenthesis chars.
4161 \let\lparen = ( \let\rparen = )
4162
4163 {\activeparens % Now, smart parens don't turn on until &foo (see \amprm)
4164
4165 % Be sure that we always have a definition for `(', etc.  For example,
4166 % if the fn name has parens in it, \boldbrax will not be in effect yet,
4167 % so TeX would otherwise complain about undefined control sequence.
4168 \global\let(=\lparen \global\let)=\rparen
4169 \global\let[=\lbrack \global\let]=\rbrack
4170
4171 \gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 }
4172 \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
4173 % This is used to turn on special parens
4174 % but make & act ordinary (given that it's active).
4175 \gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr}
4176
4177 % Definitions of (, ) and & used in args for functions.
4178 % This is the definition of ( outside of all parentheses.
4179 \gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested
4180   \global\advance\parencount by 1
4181 }
4182 %
4183 % This is the definition of ( when already inside a level of parens.
4184 \gdef\opnested{\char`\(\global\advance\parencount by 1 }
4185 %
4186 \gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
4187   % also in that case restore the outer-level definition of (.
4188   \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi
4189   \global\advance \parencount by -1 }
4190 % If we encounter &foo, then turn on ()-hacking afterwards
4191 \gdef\amprm#1 {{\rm\&#1}\let(=\oprm \let)=\clrm\ }
4192 %
4193 \gdef\normalparens{\boldbrax\let&=\ampnr}
4194 } % End of definition inside \activeparens
4195 %% These parens (in \boldbrax) actually are a little bolder than the
4196 %% contained text.  This is especially needed for [ and ]
4197 \def\opnr{{\sf\char`\(}\global\advance\parencount by 1 }
4198 \def\clnr{{\sf\char`\)}\global\advance\parencount by -1 }
4199 \def\ampnr{\&}
4200 \def\lbrb{{\bf\char`\[}}
4201 \def\rbrb{{\bf\char`\]}}
4202
4203 % First, defname, which formats the header line itself.
4204 % #1 should be the function name.
4205 % #2 should be the type of definition, such as "Function".
4206
4207 \def\defname #1#2{%
4208 % Get the values of \leftskip and \rightskip as they were
4209 % outside the @def...
4210 \dimen2=\leftskip
4211 \advance\dimen2 by -\defbodyindent
4212 \noindent
4213 \setbox0=\hbox{\hskip \deflastargmargin{\rm\mc #2}\hskip \deftypemargin}%
4214 \dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line
4215 \dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations
4216 \parshape 2 0in \dimen0 \defargsindent \dimen1
4217 % Now output arg 2 ("Function" or some such)
4218 % ending at \deftypemargin from the right margin,
4219 % but stuck inside a box of width 0 so it does not interfere with linebreaking
4220 {% Adjust \hsize to exclude the ambient margins,
4221 % so that \rightline will obey them.
4222 \advance \hsize by -\dimen2
4223 \rlap{\rightline{{\rm\mc #2}\hskip -1.25pc }}}%
4224 % Make all lines underfull and no complaints:
4225 \tolerance=10000 \hbadness=10000
4226 \advance\leftskip by -\defbodyindent
4227 \exdentamount=\defbodyindent
4228 {\df #1}\enskip        % Generate function name
4229 }
4230
4231 % Actually process the body of a definition
4232 % #1 should be the terminating control sequence, such as \Edefun.
4233 % #2 should be the "another name" control sequence, such as \defunx.
4234 % #3 should be the control sequence that actually processes the header,
4235 %    such as \defunheader.
4236
4237 \def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
4238 \medbreak %
4239 % Define the end token that this defining construct specifies
4240 % so that it will exit this group.
4241 \def#1{\endgraf\endgroup\medbreak}%
4242 \def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
4243 \parindent=0in
4244 \advance\leftskip by \defbodyindent
4245 \exdentamount=\defbodyindent
4246 \begingroup %
4247 \catcode 61=\active % 61 is `='
4248 \obeylines\activeparens\spacesplit#3}
4249
4250 % #1 is the \E... control sequence to end the definition (which we define).
4251 % #2 is the \...x control sequence for consecutive fns (which we define).
4252 % #3 is the control sequence to call to resume processing.
4253 % #4, delimited by the space, is the class name.
4254
4255 \def\defmethparsebody#1#2#3#4 {\begingroup\inENV %
4256 \medbreak %
4257 % Define the end token that this defining construct specifies
4258 % so that it will exit this group.
4259 \def#1{\endgraf\endgroup\medbreak}%
4260 \def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}%
4261 \parindent=0in
4262 \advance\leftskip by \defbodyindent
4263 \exdentamount=\defbodyindent
4264 \begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
4265
4266 % @deftypemethod has an extra argument that nothing else does.  Sigh.
4267 % #1 is the \E... control sequence to end the definition (which we define).
4268 % #2 is the \...x control sequence for consecutive fns (which we define).
4269 % #3 is the control sequence to call to resume processing.
4270 % #4, delimited by the space, is the class name.
4271 % #5 is the method's return type.
4272
4273 \def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV %
4274 \medbreak %
4275 % Define the end token that this defining construct specifies
4276 % so that it will exit this group.
4277 \def#1{\endgraf\endgroup\medbreak}%
4278 \def#2##1 ##2 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}{##2}}}%
4279 \parindent=0in
4280 \advance\leftskip by \defbodyindent
4281 \exdentamount=\defbodyindent
4282 \begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}}
4283
4284 \def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
4285 \medbreak %
4286 % Define the end token that this defining construct specifies
4287 % so that it will exit this group.
4288 \def#1{\endgraf\endgroup\medbreak}%
4289 \def#2##1 ##2 {\def#4{##1}%
4290 \begingroup\obeylines\activeparens\spacesplit{#3{##2}}}%
4291 \parindent=0in
4292 \advance\leftskip by \defbodyindent
4293 \exdentamount=\defbodyindent
4294 \begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
4295
4296 % These parsing functions are similar to the preceding ones
4297 % except that they do not make parens into active characters.
4298 % These are used for "variables" since they have no arguments.
4299
4300 \def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
4301 \medbreak %
4302 % Define the end token that this defining construct specifies
4303 % so that it will exit this group.
4304 \def#1{\endgraf\endgroup\medbreak}%
4305 \def#2{\begingroup\obeylines\spacesplit#3}%
4306 \parindent=0in
4307 \advance\leftskip by \defbodyindent
4308 \exdentamount=\defbodyindent
4309 \begingroup %
4310 \catcode 61=\active %
4311 \obeylines\spacesplit#3}
4312
4313 % This is used for \def{tp,vr}parsebody.  It could probably be used for
4314 % some of the others, too, with some judicious conditionals.
4315 %
4316 \def\parsebodycommon#1#2#3{%
4317   \begingroup\inENV %
4318   \medbreak %
4319   % Define the end token that this defining construct specifies
4320   % so that it will exit this group.
4321   \def#1{\endgraf\endgroup\medbreak}%
4322   \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}%
4323   \parindent=0in
4324   \advance\leftskip by \defbodyindent
4325   \exdentamount=\defbodyindent
4326   \begingroup\obeylines
4327 }
4328
4329 \def\defvrparsebody#1#2#3#4 {%
4330   \parsebodycommon{#1}{#2}{#3}%
4331   \spacesplit{#3{#4}}%
4332 }
4333
4334 % This loses on `@deftp {Data Type} {struct termios}' -- it thinks the
4335 % type is just `struct', because we lose the braces in `{struct
4336 % termios}' when \spacesplit reads its undelimited argument.  Sigh.
4337 % \let\deftpparsebody=\defvrparsebody
4338 %
4339 % So, to get around this, we put \empty in with the type name.  That
4340 % way, TeX won't find exactly `{...}' as an undelimited argument, and
4341 % won't strip off the braces.
4342 %
4343 \def\deftpparsebody #1#2#3#4 {%
4344   \parsebodycommon{#1}{#2}{#3}%
4345   \spacesplit{\parsetpheaderline{#3{#4}}}\empty
4346 }
4347
4348 % Fine, but then we have to eventually remove the \empty *and* the
4349 % braces (if any).  That's what this does.
4350 %
4351 \def\removeemptybraces\empty#1\relax{#1}
4352
4353 % After \spacesplit has done its work, this is called -- #1 is the final
4354 % thing to call, #2 the type name (which starts with \empty), and #3
4355 % (which might be empty) the arguments.
4356 %
4357 \def\parsetpheaderline#1#2#3{%
4358   #1{\removeemptybraces#2\relax}{#3}%
4359 }%
4360
4361 \def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV %
4362 \medbreak %
4363 % Define the end token that this defining construct specifies
4364 % so that it will exit this group.
4365 \def#1{\endgraf\endgroup\medbreak}%
4366 \def#2##1 ##2 {\def#4{##1}%
4367 \begingroup\obeylines\spacesplit{#3{##2}}}%
4368 \parindent=0in
4369 \advance\leftskip by \defbodyindent
4370 \exdentamount=\defbodyindent
4371 \begingroup\obeylines\spacesplit{#3{#5}}}
4372
4373 % Split up #2 at the first space token.
4374 % call #1 with two arguments:
4375 %  the first is all of #2 before the space token,
4376 %  the second is all of #2 after that space token.
4377 % If #2 contains no space token, all of it is passed as the first arg
4378 % and the second is passed as empty.
4379
4380 {\obeylines
4381 \gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}%
4382 \long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{%
4383 \ifx\relax #3%
4384 #1{#2}{}\else #1{#2}{#3#4}\fi}}
4385
4386 % So much for the things common to all kinds of definitions.
4387
4388 % Define @defun.
4389
4390 % First, define the processing that is wanted for arguments of \defun
4391 % Use this to expand the args and terminate the paragraph they make up
4392
4393 \def\defunargs #1{\functionparens \sl
4394 % Expand, preventing hyphenation at `-' chars.
4395 % Note that groups don't affect changes in \hyphenchar.
4396 \hyphenchar\tensl=0
4397 #1%
4398 \hyphenchar\tensl=45
4399 \ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi%
4400 \interlinepenalty=10000
4401 \advance\rightskip by 0pt plus 1fil
4402 \endgraf\nobreak\vskip -\parskip\nobreak
4403 }
4404
4405 \def\deftypefunargs #1{%
4406 % Expand, preventing hyphenation at `-' chars.
4407 % Note that groups don't affect changes in \hyphenchar.
4408 % Use \boldbraxnoamp, not \functionparens, so that & is not special.
4409 \boldbraxnoamp
4410 \tclose{#1}% avoid \code because of side effects on active chars
4411 \interlinepenalty=10000
4412 \advance\rightskip by 0pt plus 1fil
4413 \endgraf\nobreak\vskip -\parskip\nobreak
4414 }
4415
4416 % Do complete processing of one @defun or @defunx line already parsed.
4417
4418 % @deffn Command forward-char nchars
4419
4420 \def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader}
4421
4422 \def\deffnheader #1#2#3{\doind {fn}{\code{#2}}%
4423 \begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
4424 \catcode 61=\other % Turn off change made in \defparsebody
4425 }
4426
4427 % @defun == @deffn Function
4428
4429 \def\defun{\defparsebody\Edefun\defunx\defunheader}
4430
4431 \def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
4432 \begingroup\defname {#1}{Function}%
4433 \defunargs {#2}\endgroup %
4434 \catcode 61=\other % Turn off change made in \defparsebody
4435 }
4436
4437 % @deftypefun int foobar (int @var{foo}, float @var{bar})
4438
4439 \def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader}
4440
4441 % #1 is the data type.  #2 is the name and args.
4442 \def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax}
4443 % #1 is the data type, #2 the name, #3 the args.
4444 \def\deftypefunheaderx #1#2 #3\relax{%
4445 \doind {fn}{\code{#2}}% Make entry in function index
4446 \begingroup\defname {\defheaderxcond#1\relax$$$#2}{Function}%
4447 \deftypefunargs {#3}\endgroup %
4448 \catcode 61=\other % Turn off change made in \defparsebody
4449 }
4450
4451 % @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
4452
4453 \def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
4454
4455 % \defheaderxcond#1\relax$$$
4456 % puts #1 in @code, followed by a space, but does nothing if #1 is null.
4457 \def\defheaderxcond#1#2$$${\ifx#1\relax\else\code{#1#2} \fi}
4458
4459 % #1 is the classification.  #2 is the data type.  #3 is the name and args.
4460 \def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax}
4461 % #1 is the classification, #2 the data type, #3 the name, #4 the args.
4462 \def\deftypefnheaderx #1#2#3 #4\relax{%
4463 \doind {fn}{\code{#3}}% Make entry in function index
4464 \begingroup
4465 \normalparens % notably, turn off `&' magic, which prevents
4466 %               at least some C++ text from working
4467 \defname {\defheaderxcond#2\relax$$$#3}{#1}%
4468 \deftypefunargs {#4}\endgroup %
4469 \catcode 61=\other % Turn off change made in \defparsebody
4470 }
4471
4472 % @defmac == @deffn Macro
4473
4474 \def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
4475
4476 \def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
4477 \begingroup\defname {#1}{Macro}%
4478 \defunargs {#2}\endgroup %
4479 \catcode 61=\other % Turn off change made in \defparsebody
4480 }
4481
4482 % @defspec == @deffn Special Form
4483
4484 \def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
4485
4486 \def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
4487 \begingroup\defname {#1}{Special Form}%
4488 \defunargs {#2}\endgroup %
4489 \catcode 61=\other % Turn off change made in \defparsebody
4490 }
4491
4492 % This definition is run if you use @defunx
4493 % anywhere other than immediately after a @defun or @defunx.
4494
4495 \def\deffnx #1 {\errmessage{@deffnx in invalid context}}
4496 \def\defunx #1 {\errmessage{@defunx in invalid context}}
4497 \def\defmacx #1 {\errmessage{@defmacx in invalid context}}
4498 \def\defspecx #1 {\errmessage{@defspecx in invalid context}}
4499 \def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}}
4500 \def\deftypemethodx #1 {\errmessage{@deftypemethodx in invalid context}}
4501 \def\deftypefunx #1 {\errmessage{@deftypefunx in invalid context}}
4502
4503 % @defmethod, and so on
4504
4505 % @defop CATEGORY CLASS OPERATION ARG...
4506
4507 \def\defop #1 {\def\defoptype{#1}%
4508 \defopparsebody\Edefop\defopx\defopheader\defoptype}
4509
4510 \def\defopheader #1#2#3{%
4511 \dosubind {fn}{\code{#2}}{\putwordon\ #1}% Make entry in function index
4512 \begingroup\defname {#2}{\defoptype{} on #1}%
4513 \defunargs {#3}\endgroup %
4514 }
4515
4516 % @deftypemethod CLASS RETURN-TYPE METHOD ARG...
4517 %
4518 \def\deftypemethod{%
4519   \deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader}
4520 %
4521 % #1 is the class name, #2 the data type, #3 the method name, #4 the args.
4522 \def\deftypemethodheader#1#2#3#4{%
4523   \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
4524   \begingroup
4525     \defname{\defheaderxcond#2\relax$$$#3}{\putwordMethodon\ \code{#1}}%
4526     \deftypefunargs{#4}%
4527   \endgroup
4528 }
4529
4530 % @defmethod == @defop Method
4531 %
4532 \def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
4533 %
4534 % #1 is the class name, #2 the method name, #3 the args.
4535 \def\defmethodheader#1#2#3{%
4536   \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% entry in function index
4537   \begingroup
4538     \defname{#2}{\putwordMethodon\ \code{#1}}%
4539     \defunargs{#3}%
4540   \endgroup
4541 }
4542
4543 % @defcv {Class Option} foo-class foo-flag
4544
4545 \def\defcv #1 {\def\defcvtype{#1}%
4546 \defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
4547
4548 \def\defcvarheader #1#2#3{%
4549 \dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
4550 \begingroup\defname {#2}{\defcvtype{} of #1}%
4551 \defvarargs {#3}\endgroup %
4552 }
4553
4554 % @defivar == @defcv {Instance Variable}
4555
4556 \def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
4557
4558 \def\defivarheader #1#2#3{%
4559 \dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
4560 \begingroup\defname {#2}{Instance Variable of #1}%
4561 \defvarargs {#3}\endgroup %
4562 }
4563
4564 % These definitions are run if you use @defmethodx, etc.,
4565 % anywhere other than immediately after a @defmethod, etc.
4566
4567 \def\defopx #1 {\errmessage{@defopx in invalid context}}
4568 \def\defmethodx #1 {\errmessage{@defmethodx in invalid context}}
4569 \def\defcvx #1 {\errmessage{@defcvx in invalid context}}
4570 \def\defivarx #1 {\errmessage{@defivarx in invalid context}}
4571
4572 % Now @defvar
4573
4574 % First, define the processing that is wanted for arguments of @defvar.
4575 % This is actually simple: just print them in roman.
4576 % This must expand the args and terminate the paragraph they make up
4577 \def\defvarargs #1{\normalparens #1%
4578 \interlinepenalty=10000
4579 \endgraf\nobreak\vskip -\parskip\nobreak}
4580
4581 % @defvr Counter foo-count
4582
4583 \def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader}
4584
4585 \def\defvrheader #1#2#3{\doind {vr}{\code{#2}}%
4586 \begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup}
4587
4588 % @defvar == @defvr Variable
4589
4590 \def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader}
4591
4592 \def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
4593 \begingroup\defname {#1}{Variable}%
4594 \defvarargs {#2}\endgroup %
4595 }
4596
4597 % @defopt == @defvr {User Option}
4598
4599 \def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader}
4600
4601 \def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
4602 \begingroup\defname {#1}{User Option}%
4603 \defvarargs {#2}\endgroup %
4604 }
4605
4606 % @deftypevar int foobar
4607
4608 \def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader}
4609
4610 % #1 is the data type.  #2 is the name, perhaps followed by text that
4611 % is actually part of the data type, which should not be put into the index.
4612 \def\deftypevarheader #1#2{%
4613 \dovarind#2 \relax% Make entry in variables index
4614 \begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}%
4615 \interlinepenalty=10000
4616 \endgraf\nobreak\vskip -\parskip\nobreak
4617 \endgroup}
4618 \def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}}
4619
4620 % @deftypevr {Global Flag} int enable
4621
4622 \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
4623
4624 \def\deftypevrheader #1#2#3{\dovarind#3 \relax%
4625 \begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1}
4626 \interlinepenalty=10000
4627 \endgraf\nobreak\vskip -\parskip\nobreak
4628 \endgroup}
4629
4630 % This definition is run if you use @defvarx
4631 % anywhere other than immediately after a @defvar or @defvarx.
4632
4633 \def\defvrx #1 {\errmessage{@defvrx in invalid context}}
4634 \def\defvarx #1 {\errmessage{@defvarx in invalid context}}
4635 \def\defoptx #1 {\errmessage{@defoptx in invalid context}}
4636 \def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context}}
4637 \def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context}}
4638
4639 % Now define @deftp
4640 % Args are printed in bold, a slight difference from @defvar.
4641
4642 \def\deftpargs #1{\bf \defvarargs{#1}}
4643
4644 % @deftp Class window height width ...
4645
4646 \def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader}
4647
4648 \def\deftpheader #1#2#3{\doind {tp}{\code{#2}}%
4649 \begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
4650
4651 % This definition is run if you use @deftpx, etc
4652 % anywhere other than immediately after a @deftp, etc.
4653
4654 \def\deftpx #1 {\errmessage{@deftpx in invalid context}}
4655
4656
4657 \message{macros,}
4658 % @macro.
4659
4660 % To do this right we need a feature of e-TeX, \scantokens, 
4661 % which we arrange to emulate with a temporary file in ordinary TeX.
4662 \ifx\eTeXversion\undefined
4663  \newwrite\macscribble
4664  \def\scanmacro#1{%
4665    \begingroup \newlinechar`\^^M
4666    \immediate\openout\macscribble=\jobname.tmp
4667    \immediate\write\macscribble{#1}%
4668    \immediate\closeout\macscribble
4669    \let\xeatspaces\eatspaces
4670    \input \jobname.tmp
4671    \endgroup
4672 }
4673 \else
4674 \def\scanmacro#1{%
4675 \begingroup \newlinechar`\^^M
4676 \let\xeatspaces\eatspaces\scantokens{#1}\endgroup}
4677 \fi
4678
4679 \newcount\paramno   % Count of parameters
4680 \newtoks\macname    % Macro name
4681 \newif\ifrecursive  % Is it recursive?
4682
4683 % Utility routines.
4684 % Thisdoes \let #1 = #2, except with \csnames.
4685 \def\cslet#1#2{%
4686 \expandafter\expandafter
4687 \expandafter\let
4688 \expandafter\expandafter
4689 \csname#1\endcsname
4690 \csname#2\endcsname}
4691
4692 % Trim leading and trailing spaces off a string.
4693 % Concepts from aro-bend problem 15 (see CTAN).
4694 {\catcode`\@=11
4695 \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
4696 \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
4697 \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
4698 \def\unbrace#1{#1}
4699 \unbrace{\gdef\trim@@@ #1 } #2@{#1}
4700 }
4701
4702 % Trim a single trailing ^^M off a string.
4703 {\catcode`\^^M=12\catcode`\Q=3%
4704 \gdef\eatcr #1{\eatcra #1Q^^MQ}%
4705 \gdef\eatcra#1^^MQ{\eatcrb#1Q}%
4706 \gdef\eatcrb#1Q#2Q{#1}%
4707 }
4708
4709 % Macro bodies are absorbed as an argument in a context where
4710 % all characters are catcode 10, 11 or 12, except \ which is active
4711 % (as in normal texinfo). It is necessary to change the definition of \.
4712
4713 % It's necessary to have hard CRs when the macro is executed. This is 
4714 % done by  making ^^M (\endlinechar) catcode 12 when reading the macro 
4715 % body, and then making it the \newlinechar in \scanmacro.
4716
4717 \def\macrobodyctxt{%
4718   \catcode`\~=12
4719   \catcode`\^=12
4720   \catcode`\_=12
4721   \catcode`\|=12
4722   \catcode`\<=12
4723   \catcode`\>=12
4724   \catcode`\+=12
4725   \catcode`\{=12
4726   \catcode`\}=12
4727   \catcode`\@=12
4728   \catcode`\^^M=12
4729   \usembodybackslash}
4730
4731 \def\macroargctxt{%
4732   \catcode`\~=12
4733   \catcode`\^=12
4734   \catcode`\_=12
4735   \catcode`\|=12
4736   \catcode`\<=12
4737   \catcode`\>=12
4738   \catcode`\+=12
4739   \catcode`\@=12
4740   \catcode`\\=12}
4741
4742 % \mbodybackslash is the definition of \ in @macro bodies.
4743 % It maps \foo\ => \csname macarg.foo\endcsname => #N 
4744 % where N is the macro parameter number.
4745 % We define \csname macarg.\endcsname to be \realbackslash, so
4746 % \\ in macro replacement text gets you a backslash.
4747
4748 {\catcode`@=0 @catcode`@\=@active
4749  @gdef@usembodybackslash{@let\=@mbodybackslash}
4750  @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
4751 }
4752 \expandafter\def\csname macarg.\endcsname{\realbackslash}
4753
4754 \def\macro{\recursivefalse\parsearg\macroxxx}
4755 \def\rmacro{\recursivetrue\parsearg\macroxxx}
4756
4757 \def\macroxxx#1{%
4758   \getargs{#1}%           now \macname is the macname and \argl the arglist
4759   \ifx\argl\empty       % no arguments
4760      \paramno=0%
4761   \else
4762      \expandafter\parsemargdef \argl;% 
4763   \fi
4764   \expandafter\ifx \csname macsave.\the\macname\endcsname \relax
4765      \cslet{macsave.\the\macname}{\the\macname}%
4766   \else
4767      \message{Warning: redefining \the\macname}%
4768   \fi
4769   \begingroup \macrobodyctxt
4770   \ifrecursive \expandafter\parsermacbody
4771   \else \expandafter\parsemacbody 
4772   \fi}
4773
4774 \def\unmacro{\parsearg\unmacroxxx}
4775 \def\unmacroxxx#1{%
4776   \expandafter\ifx \csname macsave.\the\macname\endcsname \relax
4777     \errmessage{Macro \the\macname\ not defined.}%
4778   \else
4779     \cslet{#1}{macsave.#1}%
4780     \expandafter\let \csname macsave.\the\macname\endcsname \undefined
4781   \fi
4782 }
4783
4784 % This makes use of the obscure feature that if the last token of a
4785 % <parameter list> is #, then the preceding argument is delimited by
4786 % an opening brace, and that opening brace is not consumed.
4787 \def\getargs#1{\getargsxxx#1{}}
4788 \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
4789 \def\getmacname #1 #2\relax{\macname={#1}}
4790 \def\getmacargs#1{\def\argl{#1}}
4791
4792 % Parse the optional {params} list.  Set up \paramno and \paramlist
4793 % so \defmacro knows what to do.  Define \macarg.blah for each blah
4794 % in the params list, to be ##N where N is the position in that list.
4795 % That gets used by \mbodybackslash (above).
4796
4797 % We need to get `macro parameter char #' into several definitions.
4798 % The technique used is stolen from LaTeX:  let \hash be something
4799 % unexpandable, insert that wherever you need a #, and then redefine
4800 % it to # just before using the token list produced.
4801 %
4802 % The same technique is used to protect \eatspaces till just before
4803 % the macro is used.
4804
4805 \def\parsemargdef#1;{\paramno=0\def\paramlist{}%
4806         \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,}
4807 \def\parsemargdefxxx#1,{%
4808   \if#1;\let\next=\relax
4809   \else \let\next=\parsemargdefxxx
4810     \advance\paramno by 1%
4811     \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
4812         {\xeatspaces{\hash\the\paramno}}%
4813     \edef\paramlist{\paramlist\hash\the\paramno,}%
4814   \fi\next}
4815
4816 % These two commands read recursive and nonrecursive macro bodies.
4817 % (They're different since rec and nonrec macros end differently.)
4818
4819 \long\def\parsemacbody#1@end macro%
4820 {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
4821 \long\def\parsermacbody#1@end rmacro%
4822 {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
4823
4824 % This defines the macro itself. There are six cases: recursive and
4825 % nonrecursive macros of zero, one, and many arguments.
4826 % Much magic with \expandafter here.
4827 % \xdef is used so that macro definitions will survive the file
4828 % they're defined in; @include reads the file inside a group.
4829 \def\defmacro{%
4830   \let\hash=##% convert placeholders to macro parameter chars
4831   \ifrecursive
4832     \ifcase\paramno
4833     % 0
4834       \expandafter\xdef\csname\the\macname\endcsname{%
4835         \noexpand\scanmacro{\temp}}%
4836     \or % 1
4837       \expandafter\xdef\csname\the\macname\endcsname{%
4838          \bgroup\noexpand\macroargctxt
4839          \noexpand\braceorline\csname\the\macname xxx\endcsname}%
4840       \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
4841          \egroup\noexpand\scanmacro{\temp}}%
4842     \else % many
4843       \expandafter\xdef\csname\the\macname\endcsname{%
4844          \bgroup\noexpand\macroargctxt
4845          \noexpand\csname\the\macname xx\endcsname}
4846       \expandafter\xdef\csname\the\macname xx\endcsname##1{%
4847           \csname\the\macname xxx\endcsname ##1,}%
4848       \expandafter\expandafter
4849       \expandafter\xdef
4850       \expandafter\expandafter
4851         \csname\the\macname xxx\endcsname 
4852           \paramlist{\egroup\noexpand\scanmacro{\temp}}%
4853     \fi
4854   \else
4855     \ifcase\paramno
4856     % 0
4857       \expandafter\xdef\csname\the\macname\endcsname{%
4858         \noexpand\norecurse{\the\macname}%
4859         \noexpand\scanmacro{\temp}\egroup}%
4860     \or % 1
4861       \expandafter\xdef\csname\the\macname\endcsname{%
4862          \bgroup\noexpand\macroargctxt
4863          \noexpand\braceorline\csname\the\macname xxx\endcsname}%
4864       \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
4865         \egroup
4866         \noexpand\norecurse{\the\macname}%
4867         \noexpand\scanmacro{\temp}\egroup}%
4868     \else % many
4869       \expandafter\xdef\csname\the\macname\endcsname{%
4870          \bgroup\noexpand\macroargctxt
4871          \noexpand\csname\the\macname xx\endcsname}
4872       \expandafter\xdef\csname\the\macname xx\endcsname##1{%
4873           \csname\the\macname xxx\endcsname ##1,}%
4874       \expandafter\expandafter
4875       \expandafter\xdef
4876       \expandafter\expandafter
4877       \csname\the\macname xxx\endcsname
4878       \paramlist{%
4879           \egroup
4880           \noexpand\norecurse{\the\macname}%
4881           \noexpand\scanmacro{\temp}\egroup}%
4882     \fi
4883   \fi}
4884
4885 \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
4886
4887 % \braceorline decides whether the next nonwhitespace character is a
4888 % {.  If so it reads up to the closing }, if not, it reads the whole
4889 % line.  Whatever was read is then fed to the next control sequence
4890 % as an argument (by \parsebrace or \parsearg)
4891 \def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx}
4892 \def\braceorlinexxx{%
4893   \ifx\nchar\bgroup\else
4894     \expandafter\parsearg 
4895   \fi \next}
4896
4897
4898 \message{cross references,}
4899 \newwrite\auxfile
4900
4901 \newif\ifhavexrefs    % True if xref values are known.
4902 \newif\ifwarnedxrefs  % True if we warned once that they aren't known.
4903
4904 % @inforef is relatively simple.
4905 \def\inforef #1{\inforefzzz #1,,,,**}
4906 \def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
4907   node \samp{\ignorespaces#1{}}}
4908
4909 % @node's job is to define \lastnode.
4910 \def\node{\ENVcheck\parsearg\nodezzz}
4911 \def\nodezzz#1{\nodexxx [#1,]}
4912 \def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
4913 \let\nwnode=\node
4914 \let\lastnode=\relax
4915
4916 % The sectioning commands (@chapter, etc.) call these.
4917 \def\donoderef{%
4918   \ifx\lastnode\relax\else
4919     \expandafter\expandafter\expandafter\setref{\lastnode}%
4920       {Ysectionnumberandtype}%
4921     \global\let\lastnode=\relax
4922   \fi
4923 }
4924 \def\unnumbnoderef{%
4925   \ifx\lastnode\relax\else
4926     \expandafter\expandafter\expandafter\setref{\lastnode}{Ynothing}%
4927     \global\let\lastnode=\relax
4928   \fi
4929 }
4930 \def\appendixnoderef{%
4931   \ifx\lastnode\relax\else
4932     \expandafter\expandafter\expandafter\setref{\lastnode}%
4933       {Yappendixletterandtype}%
4934     \global\let\lastnode=\relax
4935   \fi
4936 }
4937
4938
4939 % @anchor{NAME} -- define xref target at arbitrary point.
4940
4941 \def\anchor#1{\setref{#1}{Ynothing}}
4942
4943
4944 % \setref{NAME}{SNT} defines a cross-reference point NAME, namely
4945 % NAME-title, NAME-pg, and NAME-SNT.  Called from \foonoderef.  We have
4946 % to set \indexdummies so commands such as @code in a section title
4947 % aren't expanded.  It would be nicer not to expand the titles in the
4948 % first place, but there's so many layers that that is hard to do.
4949
4950 \def\setref#1#2{{%
4951   \indexdummies
4952   \dosetq{#1-title}{Ytitle}%
4953   \dosetq{#1-pg}{Ypagenumber}%
4954   \dosetq{#1-snt}{#2}
4955 }}
4956
4957 % @xref, @pxref, and @ref generate cross-references.  For \xrefX, #1 is
4958 % the node name, #2 the name of the Info cross-reference, #3 the printed
4959 % node name, #4 the name of the Info file, #5 the name of the printed
4960 % manual.  All but the node name can be omitted.
4961 %
4962 \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
4963 \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
4964 \def\ref#1{\xrefX[#1,,,,,,,]}
4965 \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
4966   \def\printedmanual{\ignorespaces #5}%
4967   \def\printednodename{\ignorespaces #3}%
4968   \setbox1=\hbox{\printedmanual}%
4969   \setbox0=\hbox{\printednodename}%
4970   \ifdim \wd0 = 0pt
4971     % No printed node name was explicitly given.
4972     \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax
4973       % Use the node name inside the square brackets.
4974       \def\printednodename{\ignorespaces #1}%
4975     \else
4976       % Use the actual chapter/section title appear inside
4977       % the square brackets.  Use the real section title if we have it.
4978       \ifdim \wd1 > 0pt
4979         % It is in another manual, so we don't have it.
4980         \def\printednodename{\ignorespaces #1}%
4981       \else
4982         \ifhavexrefs
4983           % We know the real title if we have the xref values.
4984           \def\printednodename{\refx{#1-title}{}}%
4985         \else
4986           % Otherwise just copy the Info node name.
4987           \def\printednodename{\ignorespaces #1}%
4988         \fi%
4989       \fi
4990     \fi
4991   \fi
4992   %
4993   % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
4994   % insert empty discretionaries after hyphens, which means that it will
4995   % not find a line break at a hyphen in a node names.  Since some manuals
4996   % are best written with fairly long node names, containing hyphens, this
4997   % is a loss.  Therefore, we give the text of the node name again, so it
4998   % is as if TeX is seeing it for the first time.
4999   \ifdim \wd1 > 0pt
5000     \putwordsection{} ``\printednodename'' in \cite{\printedmanual}%
5001   \else
5002     % _ (for example) has to be the character _ for the purposes of the
5003     % control sequence corresponding to the node, but it has to expand
5004     % into the usual \leavevmode...\vrule stuff for purposes of
5005     % printing. So we \turnoffactive for the \refx-snt, back on for the
5006     % printing, back off for the \refx-pg.
5007     {\normalturnoffactive
5008      % Only output a following space if the -snt ref is nonempty; for
5009      % @unnumbered and @anchor, it won't be.
5010      \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
5011      \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
5012     }%
5013     % [mynode], 
5014     [\printednodename],\space
5015     % page 3
5016     \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
5017   \fi
5018 \endgroup}
5019
5020 % \dosetq is the interface for calls from other macros
5021
5022 % Use \normalturnoffactive so that punctuation chars such as underscore
5023 % and backslash work in node names.  (\turnoffactive doesn't do \.)
5024 \def\dosetq#1#2{%
5025   {\let\folio=0
5026    \normalturnoffactive
5027    \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}%
5028    \iflinks
5029      \next
5030    \fi
5031   }%
5032 }
5033
5034 % \internalsetq {foo}{page} expands into
5035 % CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
5036 % When the aux file is read, ' is the escape character
5037
5038 \def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}}
5039
5040 % Things to be expanded by \internalsetq
5041
5042 \def\Ypagenumber{\folio}
5043
5044 \def\Ytitle{\thissection}
5045
5046 \def\Ynothing{}
5047
5048 \def\Ysectionnumberandtype{%
5049 \ifnum\secno=0 \putwordChapter\xreftie\the\chapno %
5050 \else \ifnum \subsecno=0 \putwordSection\xreftie\the\chapno.\the\secno %
5051 \else \ifnum \subsubsecno=0 %
5052 \putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno %
5053 \else %
5054 \putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno %
5055 \fi \fi \fi }
5056
5057 \def\Yappendixletterandtype{%
5058 \ifnum\secno=0 \putwordAppendix\xreftie'char\the\appendixno{}%
5059 \else \ifnum \subsecno=0 \putwordSection\xreftie'char\the\appendixno.\the\secno %
5060 \else \ifnum \subsubsecno=0 %
5061 \putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno %
5062 \else %
5063 \putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %
5064 \fi \fi \fi }
5065
5066 \gdef\xreftie{'tie}
5067
5068 % Use TeX 3.0's \inputlineno to get the line number, for better error
5069 % messages, but if we're using an old version of TeX, don't do anything.
5070 %
5071 \ifx\inputlineno\thisisundefined
5072   \let\linenumber = \empty % Non-3.0.
5073 \else
5074   \def\linenumber{\the\inputlineno:\space}
5075 \fi
5076
5077 % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
5078 % If its value is nonempty, SUFFIX is output afterward.
5079
5080 \def\refx#1#2{%
5081   \expandafter\ifx\csname X#1\endcsname\relax
5082     % If not defined, say something at least.
5083     \angleleft un\-de\-fined\angleright
5084     \iflinks
5085       \ifhavexrefs
5086         \message{\linenumber Undefined cross reference `#1'.}%
5087       \else
5088         \ifwarnedxrefs\else
5089           \global\warnedxrefstrue
5090           \message{Cross reference values unknown; you must run TeX again.}%
5091         \fi
5092       \fi
5093     \fi
5094   \else
5095     % It's defined, so just use it.
5096     \csname X#1\endcsname
5097   \fi
5098   #2% Output the suffix in any case.
5099 }
5100
5101 % This is the macro invoked by entries in the aux file.
5102
5103 \def\xrdef#1{\begingroup
5104   % Reenable \ as an escape while reading the second argument.
5105   \catcode`\\ = 0
5106   \afterassignment\endgroup
5107   \expandafter\gdef\csname X#1\endcsname
5108 }
5109
5110 % Read the last existing aux file, if any.  No error if none exists.
5111 \def\readauxfile{\begingroup
5112   \catcode`\^^@=\other
5113   \catcode`\^^A=\other
5114   \catcode`\^^B=\other
5115   \catcode`\^^C=\other
5116   \catcode`\^^D=\other
5117   \catcode`\^^E=\other
5118   \catcode`\^^F=\other
5119   \catcode`\^^G=\other
5120   \catcode`\^^H=\other
5121   \catcode`\^^K=\other
5122   \catcode`\^^L=\other
5123   \catcode`\^^N=\other
5124   \catcode`\^^P=\other
5125   \catcode`\^^Q=\other
5126   \catcode`\^^R=\other
5127   \catcode`\^^S=\other
5128   \catcode`\^^T=\other
5129   \catcode`\^^U=\other
5130   \catcode`\^^V=\other
5131   \catcode`\^^W=\other
5132   \catcode`\^^X=\other
5133   \catcode`\^^Z=\other
5134   \catcode`\^^[=\other
5135   \catcode`\^^\=\other
5136   \catcode`\^^]=\other
5137   \catcode`\^^^=\other
5138   \catcode`\^^_=\other
5139   \catcode`\@=\other
5140   \catcode`\^=\other
5141   % It was suggested to define this as 7, which would allow ^^e4 etc.
5142   % in xref tags, i.e., node names.  But since ^^e4 notation isn't
5143   % supported in the main text, it doesn't seem desirable.  Furthermore,
5144   % that is not enough: for node names that actually contain a ^
5145   % character, we would end up writing a line like this: 'xrdef {'hat
5146   % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
5147   % argument, and \hat is not an expandable control sequence.  It could
5148   % all be worked out, but why?  Either we support ^^ or we don't.
5149   %
5150   % The other change necessary for this was to define \auxhat:
5151   % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
5152   % and then to call \auxhat in \setq.
5153   %
5154   \catcode`\~=\other
5155   \catcode`\[=\other
5156   \catcode`\]=\other
5157   \catcode`\"=\other
5158   \catcode`\_=\other
5159   \catcode`\|=\other
5160   \catcode`\<=\other
5161   \catcode`\>=\other
5162   \catcode`\$=\other
5163   \catcode`\#=\other
5164   \catcode`\&=\other
5165   \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
5166   % Make the characters 128-255 be printing characters
5167   {%
5168     \count 1=128
5169     \def\loop{%
5170       \catcode\count 1=\other
5171       \advance\count 1 by 1
5172       \ifnum \count 1<256 \loop \fi
5173     }%
5174   }%
5175   % The aux file uses ' as the escape (for now).
5176   % Turn off \ as an escape so we do not lose on
5177   % entries which were dumped with control sequences in their names.
5178   % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
5179   % Reference to such entries still does not work the way one would wish,
5180   % but at least they do not bomb out when the aux file is read in.
5181   \catcode`\{=1
5182   \catcode`\}=2
5183   \catcode`\%=\other
5184   \catcode`\'=0
5185   \catcode`\\=\other
5186   %
5187   \openin 1 \jobname.aux
5188   \ifeof 1 \else
5189     \closein 1
5190     \input \jobname.aux
5191     \global\havexrefstrue
5192     \global\warnedobstrue
5193   \fi
5194   % Open the new aux file.  TeX will close it automatically at exit.
5195   \openout\auxfile=\jobname.aux
5196 \endgroup}
5197
5198
5199 % Footnotes.
5200
5201 \newcount \footnoteno
5202
5203 % The trailing space in the following definition for supereject is
5204 % vital for proper filling; pages come out unaligned when you do a
5205 % pagealignmacro call if that space before the closing brace is
5206 % removed. (Generally, numeric constants should always be followed by a
5207 % space to prevent strange expansion errors.)
5208 \def\supereject{\par\penalty -20000\footnoteno =0 }
5209
5210 % @footnotestyle is meaningful for info output only.
5211 \let\footnotestyle=\comment
5212
5213 \let\ptexfootnote=\footnote
5214
5215 {\catcode `\@=11
5216 %
5217 % Auto-number footnotes.  Otherwise like plain.
5218 \gdef\footnote{%
5219   \global\advance\footnoteno by \@ne
5220   \edef\thisfootno{$^{\the\footnoteno}$}%
5221   %
5222   % In case the footnote comes at the end of a sentence, preserve the
5223   % extra spacing after we do the footnote number.
5224   \let\@sf\empty
5225   \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
5226   %
5227   % Remove inadvertent blank space before typesetting the footnote number.
5228   \unskip
5229   \thisfootno\@sf
5230   \footnotezzz
5231 }%
5232
5233 % Don't bother with the trickery in plain.tex to not require the
5234 % footnote text as a parameter.  Our footnotes don't need to be so general.
5235 %
5236 % Oh yes, they do; otherwise, @ifset and anything else that uses
5237 % \parseargline fail inside footnotes because the tokens are fixed when
5238 % the footnote is read.  --karl, 16nov96.
5239 %
5240 \long\gdef\footnotezzz{\insert\footins\bgroup
5241   % We want to typeset this text as a normal paragraph, even if the
5242   % footnote reference occurs in (for example) a display environment.
5243   % So reset some parameters.
5244   \interlinepenalty\interfootnotelinepenalty
5245   \splittopskip\ht\strutbox % top baseline for broken footnotes
5246   \splitmaxdepth\dp\strutbox
5247   \floatingpenalty\@MM
5248   \leftskip\z@skip
5249   \rightskip\z@skip
5250   \spaceskip\z@skip
5251   \xspaceskip\z@skip
5252   \parindent\defaultparindent
5253   %
5254   % Hang the footnote text off the number.
5255   \hang
5256   \textindent{\thisfootno}%
5257   %
5258   % Don't crash into the line above the footnote text.  Since this
5259   % expands into a box, it must come within the paragraph, lest it
5260   % provide a place where TeX can split the footnote.
5261   \footstrut
5262   \futurelet\next\fo@t
5263 }
5264 \def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t
5265   \else\let\next\f@t\fi \next}
5266 \def\f@@t{\bgroup\aftergroup\@foot\let\next}
5267 \def\f@t#1{#1\@foot}
5268 \def\@foot{\strut\egroup}
5269
5270 }%end \catcode `\@=11
5271
5272 % Set the baselineskip to #1, and the lineskip and strut size
5273 % correspondingly.  There is no deep meaning behind these magic numbers
5274 % used as factors; they just match (closely enough) what Knuth defined.
5275 %
5276 \def\lineskipfactor{.08333}
5277 \def\strutheightpercent{.70833}
5278 \def\strutdepthpercent {.29167}
5279 %
5280 \def\setleading#1{%
5281   \normalbaselineskip = #1\relax
5282   \normallineskip = \lineskipfactor\normalbaselineskip
5283   \normalbaselines
5284   \setbox\strutbox =\hbox{%
5285     \vrule width0pt height\strutheightpercent\baselineskip
5286                     depth \strutdepthpercent \baselineskip
5287   }%
5288 }
5289
5290 % @| inserts a changebar to the left of the current line.  It should
5291 % surround any changed text.  This approach does *not* work if the
5292 % change spans more than two lines of output.  To handle that, we would
5293 % have adopt a much more difficult approach (putting marks into the main
5294 % vertical list for the beginning and end of each change).
5295 %
5296 \def\|{%
5297   % \vadjust can only be used in horizontal mode.
5298   \leavevmode
5299   %
5300   % Append this vertical mode material after the current line in the output.
5301   \vadjust{%
5302     % We want to insert a rule with the height and depth of the current
5303     % leading; that is exactly what \strutbox is supposed to record.
5304     \vskip-\baselineskip
5305     %
5306     % \vadjust-items are inserted at the left edge of the type.  So
5307     % the \llap here moves out into the left-hand margin.
5308     \llap{%
5309       %
5310       % For a thicker or thinner bar, change the `1pt'.
5311       \vrule height\baselineskip width1pt
5312       %
5313       % This is the space between the bar and the text.
5314       \hskip 12pt
5315     }%
5316   }%
5317 }
5318
5319 % For a final copy, take out the rectangles
5320 % that mark overfull boxes (in case you have decided
5321 % that the text looks ok even though it passes the margin).
5322 %
5323 \def\finalout{\overfullrule=0pt}
5324
5325 % @image.  We use the macros from epsf.tex to support this.
5326 % If epsf.tex is not installed and @image is used, we complain.
5327
5328 % Check for and read epsf.tex up front.  If we read it only at @image
5329 % time, we might be inside a group, and then its definitions would get
5330 % undone and the next image would fail.
5331 \openin 1 = epsf.tex
5332 \ifeof 1 \else
5333   \closein 1
5334   % Do not bother showing banner with post-v2.7 epsf.tex (available in
5335   % doc/epsf.tex until it shows up on ctan).
5336   \def\epsfannounce{\toks0 = }%
5337   \input epsf.tex
5338 \fi
5339 %
5340 \newif\ifwarnednoepsf
5341 \newhelp\noepsfhelp{epsf.tex must be installed for images to
5342   work.  It is also included in the Texinfo distribution, or you can get
5343   it from ftp://ftp.tug.org/tex/epsf.tex.}
5344 %
5345 % Only complain once about lack of epsf.tex.
5346 \def\image#1{%
5347   \ifx\epsfbox\undefined
5348     \ifwarnednoepsf \else
5349       \errhelp = \noepsfhelp
5350       \errmessage{epsf.tex not found, images will be ignored}%
5351       \global\warnednoepsftrue
5352     \fi
5353   \else
5354     \imagexxx #1,,,\finish
5355   \fi
5356 }
5357 %
5358 % Arguments to @image:
5359 % #1 is (mandatory) image filename; we tack on .eps extension.
5360 % #2 is (optional) width, #3 is (optional) height.
5361 % #4 is just the usual extra ignored arg for parsing this stuff.
5362 \def\imagexxx#1,#2,#3,#4\finish{%
5363   % \epsfbox itself resets \epsf?size at each figure.
5364   \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
5365   \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
5366   % If the image is by itself, center it.
5367   \ifvmode
5368     \nobreak\medskip
5369     \nobreak
5370     \centerline{\epsfbox{#1.eps}}%
5371     \bigbreak
5372   \else
5373     \epsfbox{#1.eps}%
5374   \fi
5375 }
5376
5377
5378 \message{paper sizes,}
5379 % And other related parameters.
5380
5381 \newdimen\defaultparindent \defaultparindent = 15pt
5382
5383 \chapheadingskip = 15pt plus 4pt minus 2pt
5384 \secheadingskip = 12pt plus 3pt minus 2pt
5385 \subsecheadingskip = 9pt plus 2pt minus 2pt
5386
5387 % Prevent underfull vbox error messages.
5388 \vbadness = 10000
5389
5390 % Don't be so finicky about underfull hboxes, either.
5391 \hbadness = 2000
5392
5393 % Following George Bush, just get rid of widows and orphans.
5394 \widowpenalty=10000
5395 \clubpenalty=10000
5396
5397 % Use TeX 3.0's \emergencystretch to help line breaking, but if we're
5398 % using an old version of TeX, don't do anything.  We want the amount of
5399 % stretch added to depend on the line length, hence the dependence on
5400 % \hsize.  This makes it come to about 9pt for the 8.5x11 format.  We
5401 % call this whenever the paper size is set.
5402 %
5403 \def\setemergencystretch{%
5404   \ifx\emergencystretch\thisisundefined
5405     % Allow us to assign to \emergencystretch anyway.
5406     \def\emergencystretch{\dimen0}%
5407   \else
5408     \emergencystretch = \hsize
5409     \divide\emergencystretch by 45
5410   \fi
5411 }
5412
5413 % Parameters in order: 1) textheight; 2) textwidth; 3) voffset;
5414 % 4) hoffset; 5) binding offset; 6) topskip.  Then whoever calls us can
5415 % set \parskip and call \setleading for \baselineskip.
5416 %
5417 \def\internalpagesizes#1#2#3#4#5#6{%
5418   \voffset = #3\relax
5419   \topskip = #6\relax
5420   \splittopskip = \topskip
5421   %
5422   \vsize = #1\relax
5423   \advance\vsize by \topskip
5424   \outervsize = \vsize
5425   \advance\outervsize by 0.6in
5426   \pageheight = \vsize
5427   %
5428   \hsize = #2\relax
5429   \outerhsize = \hsize
5430   \advance\outerhsize by 0.5in
5431   \pagewidth = \hsize
5432   %
5433   \normaloffset = #4\relax
5434   \bindingoffset = #5\relax
5435   %
5436   \parindent = \defaultparindent
5437   \setemergencystretch
5438 }
5439
5440 % @letterpaper (the default).
5441 \def\letterpaper{{\globaldefs = 1
5442   \parskip = 3pt plus 2pt minus 1pt
5443   \setleading{13.2pt}%
5444   %
5445   % If page is nothing but text, make it come out even.
5446   \internalpagesizes{46\baselineskip}{6in}{\voffset}{.25in}{\bindingoffset}{36pt}%
5447 }}
5448
5449 % Use @smallbook to reset parameters for 7x9.5 (or so) format.
5450 \def\smallbook{{\globaldefs = 1
5451   \parskip = 2pt plus 1pt
5452   \setleading{12pt}%
5453   %
5454   \internalpagesizes{7.5in}{5.in}{\voffset}{.25in}{\bindingoffset}{16pt}%
5455   %
5456   \lispnarrowing = 0.3in
5457   \tolerance = 700
5458   \hfuzz = 1pt
5459   \contentsrightmargin = 0pt
5460   \deftypemargin = 0pt
5461   \defbodyindent = .5cm
5462   %
5463   \let\smalldisplay = \smalldisplayx
5464   \let\smallexample = \smalllispx
5465   \let\smallformat = \smallformatx
5466   \let\smalllisp = \smalllispx
5467 }}
5468
5469 % Use @afourpaper to print on European A4 paper.
5470 \def\afourpaper{{\globaldefs = 1
5471   \setleading{12pt}%
5472   \parskip = 3pt plus 2pt minus 1pt
5473   %
5474   \internalpagesizes{53\baselineskip}{160mm}{\voffset}{4mm}{\bindingoffset}{44pt}%
5475   %
5476   \tolerance = 700
5477   \hfuzz = 1pt
5478 }}
5479
5480 % A specific text layout, 24x15cm overall, intended for A4 paper.  Top margin
5481 % 29mm, hence bottom margin 28mm, nominal side margin 3cm.
5482 \def\afourlatex{{\globaldefs = 1
5483   \setleading{13.6pt}%
5484   %
5485   \afourpaper
5486   \internalpagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}%
5487   %
5488   \globaldefs = 0
5489 }}
5490
5491 % Use @afourwide to print on European A4 paper in wide format.
5492 \def\afourwide{%
5493   \afourpaper
5494   \internalpagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}%
5495   %
5496   \globaldefs = 0
5497 }
5498
5499 % @pagesizes TEXTHEIGHT[,TEXTWIDTH]
5500 % Perhaps we should allow setting the margins, \topskip, \parskip,
5501 % and/or leading, also. Or perhaps we should compute them somehow.
5502
5503 \def\pagesizes{\parsearg\pagesizesxxx}
5504 \def\pagesizesxxx#1{\pagesizesyyy #1,,\finish}
5505 \def\pagesizesyyy#1,#2,#3\finish{{%
5506   \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
5507   \globaldefs = 1
5508   %
5509   \parskip = 3pt plus 2pt minus 1pt
5510   \setleading{13.2pt}%
5511   %
5512   \internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt}%
5513 }}
5514
5515 % Set default to letter.
5516
5517 \letterpaper
5518
5519 \ifisJTeX % a4 is common alson in Japan
5520  \afourpaper
5521  \def\smallbook{\message{@smallbook is disabled in jtexinfo mode}}
5522  \input texinfo-js.tex
5523 \else
5524   \def\strappendix{Appendix }
5525   \def\strchapapp{Chapter }
5526   \def\strchaptail{}
5527   \def\strsecapp{Section}
5528   \def\strsectail{}
5529   \def\strsecref{section ``\printednodename'' in \cite{\printedmanual}}
5530   \def\strseeapp{see }
5531   \def\strseetail{}
5532   \def\strSeeapp{See }
5533   \def\strSeetail{}
5534   \def\strpageapp{page}
5535   \def\strpagetail{}
5536   \def\strtoc{Table Of Contents}
5537   \def\strstoc{Short Contents}
5538 \fi
5539
5540 \message{and turning on texinfo input format.}
5541
5542 % Define macros to output various characters with catcode for normal text.
5543 \catcode`\"=\other
5544 \catcode`\~=\other
5545 \catcode`\^=\other
5546 \catcode`\_=\other
5547 \catcode`\|=\other
5548 \catcode`\<=\other
5549 \catcode`\>=\other
5550 \catcode`\+=\other
5551 \def\normaldoublequote{"}
5552 \def\normaltilde{~}
5553 \def\normalcaret{^}
5554 \def\normalunderscore{_}
5555 \def\normalverticalbar{|}
5556 \def\normalless{<}
5557 \def\normalgreater{>}
5558 \def\normalplus{+}
5559
5560 % This macro is used to make a character print one way in ttfont
5561 % where it can probably just be output, and another way in other fonts,
5562 % where something hairier probably needs to be done.
5563 %
5564 % #1 is what to print if we are indeed using \tt; #2 is what to print
5565 % otherwise.  Since all the Computer Modern typewriter fonts have zero
5566 % interword stretch (and shrink), and it is reasonable to expect all
5567 % typewriter fonts to have this, we can check that font parameter.
5568 %
5569 \def\ifusingtt#1#2{\ifdim \fontdimen3\the\font=0pt #1\else #2\fi}
5570
5571 % Turn off all special characters except @
5572 % (and those which the user can use as if they were ordinary).
5573 % Most of these we simply print from the \tt font, but for some, we can
5574 % use math or other variants that look better in normal text.
5575
5576 \catcode`\"=\active
5577 \def\activedoublequote{{\tt\char34}}
5578 \let"=\activedoublequote
5579 \catcode`\~=\active
5580 \def~{{\tt\char126}}
5581 \chardef\hat=`\^
5582 \catcode`\^=\active
5583 \def^{{\tt \hat}}
5584
5585 \catcode`\_=\active
5586 \def_{\ifusingtt\normalunderscore\_}
5587 % Subroutine for the previous macro.
5588 \def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}}
5589
5590 \catcode`\|=\active
5591 \def|{{\tt\char124}}
5592 \chardef \less=`\<
5593 \catcode`\<=\active
5594 \def<{{\tt \less}}
5595 \chardef \gtr=`\>
5596 \catcode`\>=\active
5597 \def>{{\tt \gtr}}
5598 \catcode`\+=\active
5599 \def+{{\tt \char 43}}
5600 %\catcode 27=\active
5601 %\def^^[{$\diamondsuit$}
5602
5603 % Set up an active definition for =, but don't enable it most of the time.
5604 {\catcode`\==\active
5605 \global\def={{\tt \char 61}}}
5606
5607 \catcode`+=\active
5608 \catcode`\_=\active
5609
5610 % If a .fmt file is being used, characters that might appear in a file
5611 % name cannot be active until we have parsed the command line.
5612 % So turn them off again, and have \everyjob (or @setfilename) turn them on.
5613 % \otherifyactive is called near the end of this file.
5614 \def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
5615
5616 \catcode`\@=0
5617
5618 % \rawbackslashxx output one backslash character in current font
5619 \global\chardef\rawbackslashxx=`\\
5620 %{\catcode`\\=\other
5621 %@gdef@rawbackslashxx{\}}
5622
5623 % \rawbackslash redefines \ as input to do \rawbackslashxx.
5624 {\catcode`\\=\active
5625 @gdef@rawbackslash{@let\=@rawbackslashxx }}
5626
5627 % \normalbackslash outputs one backslash in fixed width font.
5628 \def\normalbackslash{{\tt\rawbackslashxx}}
5629
5630 % Say @foo, not \foo, in error messages.
5631 \escapechar=`\@
5632
5633 % \catcode 17=0   % Define control-q
5634 \catcode`\\=\active
5635
5636 % Used sometimes to turn off (effectively) the active characters
5637 % even after parsing them.
5638 @def@turnoffactive{@let"=@normaldoublequote
5639 @let\=@realbackslash
5640 @let~=@normaltilde
5641 @let^=@normalcaret
5642 @let_=@normalunderscore
5643 @let|=@normalverticalbar
5644 @let<=@normalless
5645 @let>=@normalgreater
5646 @let+=@normalplus}
5647
5648 @def@normalturnoffactive{@let"=@normaldoublequote
5649 @let\=@normalbackslash
5650 @let~=@normaltilde
5651 @let^=@normalcaret
5652 @let_=@normalunderscore
5653 @let|=@normalverticalbar
5654 @let<=@normalless
5655 @let>=@normalgreater
5656 @let+=@normalplus}
5657
5658 % Make _ and + \other characters, temporarily.
5659 % This is canceled by @fixbackslash.
5660 @otherifyactive
5661
5662 % If a .fmt file is being used, we don't want the `\input texinfo' to show up.
5663 % That is what \eatinput is for; after that, the `\' should revert to printing
5664 % a backslash.
5665 %
5666 @gdef@eatinput input texinfo{@fixbackslash}
5667 @global@let\ = @eatinput
5668
5669 % On the other hand, perhaps the file did not have a `\input texinfo'. Then
5670 % the first `\{ in the file would cause an error. This macro tries to fix
5671 % that, assuming it is called before the first `\' could plausibly occur.
5672 % Also back turn on active characters that might appear in the input
5673 % file name, in case not using a pre-dumped format.
5674 %
5675 @gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi
5676   @catcode`+=@active @catcode`@_=@active}
5677
5678 % These look ok in all fonts, so just make them not special.  The @rm below
5679 % makes sure that the current font starts out as the newly loaded cmr10
5680 @catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other
5681
5682 @textfonts
5683 @rm
5684
5685 @c Local variables:
5686 @c page-delimiter: "^\\\\message"
5687 @c update-date-leading-regexp: "def\\texinfoversion{"
5688 @c update-date-date-regexp: "[-0-9.]+"
5689 @c update-date-format-string: "%Y-%m-%d"
5690 @c update-date-trailing-regexp: "}"
5691 @c eval: (and(load "update-date" t t)(add-hook 'write-file-hooks 'update-date))
5692 @c End: