1 % texinfo.tex -- TeX macros to handle Texinfo files.
3 % Load plain if necessary, i.e., if running under initex.
4 \expandafter\ifx\csname fmtname
\endcsname\relax\input plain
\fi
6 \def\texinfoversion{1999-
02-
21.16}%
8 % Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99
9 % Free Software Foundation, Inc.
11 % This texinfo.tex file is free software; you can redistribute it and/or
12 % modify it under the terms of the GNU General Public License as
13 % published by the Free Software Foundation; either version 2, or (at
14 % your option) any later version.
16 % This texinfo.tex file is distributed in the hope that it will be
17 % useful, but WITHOUT ANY WARRANTY; without even the implied warranty
18 % of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 % General Public License for more details.
21 % You should have received a copy of the GNU General Public License
22 % along with this texinfo.tex file; see the file COPYING. If not, write
23 % to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 % Boston, MA 02111-1307, USA.
26 % In other words, you are welcome to use, share and improve this program.
27 % You are forbidden to forbid anyone else to use, share and improve
28 % what you give them. Help stamp out software-hoarding!
30 % Please try the latest version of texinfo.tex before submitting bug
31 % reports; you can get the latest version from:
32 % ftp://ftp.gnu.org/pub/gnu/texinfo.tex
33 % (and all GNU mirrors, see http://www.gnu.org/order/ftp.html)
34 % ftp://tug.org/tex/texinfo.tex
35 % ftp://ctan.org/macros/texinfo/texinfo.tex
36 % (and all CTAN mirrors, finger ctan@ctan.org for a list).
37 % /home/gd/gnu/doc/texinfo.tex on the GNU machines.
38 % The texinfo.tex in any given Texinfo distribution could well be out
39 % of date, so if that's what you're using, please check.
40 % There is a small home page for Texinfo at http://texinfo.org/.
42 % Send bug reports to bug-texinfo@gnu.org. Please include including a
43 % complete document in each bug report with which we can reproduce the
44 % problem. Patches are, of course, greatly appreciated.
46 % To process a Texinfo manual with TeX, it's most reliable to use the
47 % texi2dvi shell script that comes with the distribution. For a simple
48 % manual foo.texi, however, you can get away with this:
53 % dvips foo.dvi -o # or whatever, to process the dvi file; this makes foo.ps.
54 % The extra runs of TeX get the cross-reference information correct.
55 % Sometimes one run after texindex suffices, and sometimes you need more
56 % than two; texi2dvi does it as many times as necessary.
58 % It is possible to adapt texinfo.tex for other languages. You can get
59 % the existing language-specific files from ftp://ftp.gnu.org/gnu/texinfo/.
61 \message{Loading texinfo
[version
\texinfoversion]:
}
63 % If in a .fmt file, print the version number
64 % and turn on active characters that we couldn't do earlier because
65 % they might have appeared in the input file name.
66 \everyjob{\message{[Texinfo version
\texinfoversion]}%
67 \catcode`+=
\active \catcode`
\_=
\active}
69 % Save some parts of plain tex whose names we will redefine.
72 \let\ptexbullet=
\bullet
86 % We never want plain's outer \+ definition in Texinfo.
87 % For @tex, we can use \tabalign.
94 % If this character appears in an error message or help string, it
95 % starts a new line in the output.
98 % Set up fixed words for English if not already set.
99 \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix
}\fi
100 \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter
}\fi
101 \ifx\putwordfile\undefined \gdef\putwordfile{file
}\fi
102 \ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)
}\fi
103 \ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)
}\fi
104 \ifx\putwordInfo\undefined \gdef\putwordInfo{Info
}\fi
105 \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on
}\fi
106 \ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title
}\fi
107 \ifx\putwordof\undefined \gdef\putwordof{of
}\fi
108 \ifx\putwordon\undefined \gdef\putwordon{on
}\fi
109 \ifx\putwordpage\undefined \gdef\putwordpage{page
}\fi
110 \ifx\putwordsection\undefined \gdef\putwordsection{section
}\fi
111 \ifx\putwordSection\undefined \gdef\putwordSection{Section
}\fi
112 \ifx\putwordsee\undefined \gdef\putwordsee{see
}\fi
113 \ifx\putwordSee\undefined \gdef\putwordSee{See
}\fi
114 \ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents
}\fi
115 \ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents
}\fi
117 \ifx\putwordMJan\undefined \gdef\putwordMJan{January
}\fi
118 \ifx\putwordMFeb\undefined \gdef\putwordMFeb{February
}\fi
119 \ifx\putwordMMar\undefined \gdef\putwordMMar{March
}\fi
120 \ifx\putwordMApr\undefined \gdef\putwordMApr{April
}\fi
121 \ifx\putwordMMay\undefined \gdef\putwordMMay{May
}\fi
122 \ifx\putwordMJun\undefined \gdef\putwordMJun{June
}\fi
123 \ifx\putwordMJul\undefined \gdef\putwordMJul{July
}\fi
124 \ifx\putwordMAug\undefined \gdef\putwordMAug{August
}\fi
125 \ifx\putwordMSep\undefined \gdef\putwordMSep{September
}\fi
126 \ifx\putwordMOct\undefined \gdef\putwordMOct{October
}\fi
127 \ifx\putwordMNov\undefined \gdef\putwordMNov{November
}\fi
128 \ifx\putwordMDec\undefined \gdef\putwordMDec{December
}\fi
130 \ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro
}\fi
131 \ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form
}\fi
132 \ifx\putwordDefivar\undefined \gdef\putwordDefivar{Instance Variable
}\fi
133 \ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable
}\fi
134 \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option
}\fi
135 \ifx\putwordDeftypevar\undefined\gdef\putwordDeftypevar{Variable
}\fi
136 \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function
}\fi
137 \ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function
}\fi
143 \hyphenation{ap-pen-dix
}
144 \hyphenation{mini-buf-fer mini-buf-fers
}
146 \hyphenation{white-space
}
148 % Margin to add to right of even pages, to left of odd pages.
149 \newdimen \bindingoffset
150 \newdimen \normaloffset
151 \newdimen\pagewidth \newdimen\pageheight
153 % Sometimes it is convenient to have everything in the transcript file
154 % and nothing on the terminal. We don't just call \tracingall here,
155 % since that produces some useless output on the terminal.
157 \def\gloggingall{\begingroup \globaldefs =
1 \loggingall \endgroup}%
158 \ifx\eTeXversion\undefined
159 \def\loggingall{\tracingcommands2 \tracingstats2
160 \tracingpages1 \tracingoutput1 \tracinglostchars1
161 \tracingmacros2 \tracingparagraphs1 \tracingrestores1
162 \showboxbreadth\maxdimen\showboxdepth\maxdimen
165 \def\loggingall{\tracingcommands3 \tracingstats2
166 \tracingpages1 \tracingoutput1 \tracinglostchars1
167 \tracingmacros2 \tracingparagraphs1 \tracingrestores1
168 \tracingscantokens1 \tracingassigns1 \tracingifs1
169 \tracinggroups1 \tracingnesting2
170 \showboxbreadth\maxdimen\showboxdepth\maxdimen
174 % For @cropmarks command.
175 % Do @cropmarks to get crop marks.
178 \let\cropmarks =
\cropmarkstrue
180 % Dimensions to add cropmarks at corners.
181 % Added by P. A. MacKay, 12 Nov. 1986
183 \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
184 \newdimen\cornerlong \cornerlong=
1pc
185 \newdimen\cornerthick \cornerthick=
.3pt
186 \newdimen\topandbottommargin \topandbottommargin=
.75in
188 % Main output routine.
190 \output =
{\onepageout{\pagecontents\PAGE}}
195 % \onepageout takes a vbox as an argument. Note that \pagecontents
196 % does insertions, but you have to call it yourself.
198 \ifcropmarks \hoffset=
0pt
\else \hoffset=
\normaloffset \fi
200 \ifodd\pageno \advance\hoffset by
\bindingoffset
201 \else \advance\hoffset by -
\bindingoffset\fi
203 % Do this outside of the \shipout so @code etc. will be expanded in
204 % the headline as they should be, not taken literally (outputting ''code).
205 \setbox\headlinebox =
\vbox{\let\hsize=
\pagewidth \makeheadline}%
206 \setbox\footlinebox =
\vbox{\let\hsize=
\pagewidth \makefootline}%
209 % Have to do this stuff outside the \shipout because we want it to
210 % take effect in \write's, yet the group defined by the \vbox ends
211 % before the \shipout runs.
213 \escapechar = `\\
% use backslash in output files.
214 \indexdummies % don't expand commands in the output.
215 \normalturnoffactive % \ in index entries must not stay \, e.g., if
216 % the page break happens to be in the middle of an example.
218 \ifcropmarks \vbox to
\outervsize\bgroup
220 \vskip-
\topandbottommargin
222 \line{\ewtop\hfil\ewtop}%
225 \vbox{\moveleft\cornerthick\nstop}%
227 \vbox{\moveright\cornerthick\nstop}%
230 \vskip\topandbottommargin
232 \hfil % center the page within the outer (page) hsize.
233 \ifodd\pageno\hskip\bindingoffset\fi
239 \ifdim\ht\footlinebox >
0pt
240 % Only leave this space if the footline is nonempty.
241 % (We lessened \vsize for it in \oddfootingxxx.)
242 % The \baselineskip=24pt in plain's \makefootline has no effect.
243 \vskip 2\baselineskip
248 \egroup % end of \vbox\bgroup
249 \hfil\egroup % end of (centering) \line\bgroup
250 \vskip\topandbottommargin plus1fill minus1fill
251 \boxmaxdepth =
\cornerthick
254 \vbox{\moveleft\cornerthick\nsbot}%
256 \vbox{\moveright\cornerthick\nsbot}%
259 \line{\ewbot\hfil\ewbot}%
261 \egroup % \vbox from first cropmarks clause
263 }% end of \shipout\vbox
264 }% end of group with \turnoffactive
266 \ifnum\outputpenalty>-
20000 \else\dosupereject\fi
269 \newinsert\margin \dimen\margin=
\maxdimen
271 \def\pagebody#1{\vbox to
\pageheight{\boxmaxdepth=
\maxdepth #1}}
273 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
274 % marginal hacks, juha@viisa.uucp (Juha Takala)
275 \ifvoid\margin\else % marginal info is present
276 \rlap{\kern\hsize\vbox to
\z@
{\kern1pt\box\margin \vss}}\fi
277 \dimen@=
\dp#1 \unvbox#1
278 \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
279 \ifr@ggedbottom
\kern-
\dimen@
\vfil \fi}
282 % Here are the rules for the cropmarks. Note that they are
283 % offset so that the space between them is truly \outerhsize or \outervsize
284 % (P. A. MacKay, 12 November, 1986)
286 \def\ewtop{\vrule height
\cornerthick depth0pt width
\cornerlong}
288 {\hrule height
\cornerthick depth
\cornerlong width
\cornerthick}}
289 \def\ewbot{\vrule height0pt depth
\cornerthick width
\cornerlong}
291 {\hrule height
\cornerlong depth
\cornerthick width
\cornerthick}}
293 % Parse an argument, then pass it to #1. The argument is the rest of
294 % the input line (except we remove a trailing comment). #1 should be a
295 % macro which expects an ordinary undelimited TeX argument.
301 \futurelet\temp\parseargx
304 % If the next token is an obeyed space (from an @example environment or
305 % the like), remove it and recurse. Otherwise, we're done.
307 % \obeyedspace is defined far below, after the definition of \sepspaces.
308 \ifx\obeyedspace\temp
309 \expandafter\parseargdiscardspace
311 \expandafter\parseargline
315 % Remove a single space (as the delimiter token to the macro call).
317 \gdef\parseargdiscardspace {\futurelet\temp\parseargx}}
320 \gdef\parseargline#1^^M
{%
321 \endgroup % End of the group started in \parsearg.
323 % First remove any @c comment, then any @comment.
324 % Result of each macro is put in \toks0.
325 \argremovec #1\c\relax %
326 \expandafter\argremovecomment \the\toks0 \comment\relax %
328 % Call the caller's macro, saved as \next in \parsearg.
329 \expandafter\next\expandafter{\the\toks0}%
333 % Since all \c{,omment} does is throw away the argument, we can let TeX
334 % do that for us. The \relax here is matched by the \relax in the call
335 % in \parseargline; it could be more or less anything, its purpose is
336 % just to delimit the argument to the \c.
337 \def\argremovec#1\c#2\relax{\toks0 =
{#1}}
338 \def\argremovecomment#1\comment#2\relax{\toks0 =
{#1}}
340 % \argremovec{,omment} might leave us with trailing spaces, though; e.g.,
341 % @end itemize @c foo
342 % will have two active spaces as part of the argument with the
343 % `itemize'. Here we remove all active spaces from #1, and assign the
346 % This loses if there are any *other* active characters besides spaces
347 % in the argument -- _ ^ +, for example -- since they get expanded.
348 % Fortunately, Texinfo does not define any such commands. (If it ever
349 % does, the catcode of the characters in questionwill have to be changed
350 % here.) But this means we cannot call \removeactivespaces as part of
351 % \argremovec{,omment}, since @c uses \parsearg, and thus the argument
352 % that \parsearg gets might well have any character at all in it.
354 \def\removeactivespaces#1{%
358 \global\toks0 =
\expandafter{\temp}%
362 % Change the active space to expand to nothing.
366 \gdef\ignoreactivespaces{\obeyspaces\let =
\empty}
370 \def\flushcr{\ifx\par\lisppar \def\next#
#1{}\else \let\next=
\relax \fi \next}
372 %% These are used to keep @begin/@end levels from running away
373 %% Call \inENV within environments (after a \begingroup)
374 \newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
376 \ifENV\errmessage{Still within an environment; press RETURN to continue
}
377 \endgroup\fi} % This is not perfect, but it should reduce lossage
379 % @begin foo is the same as @foo, for now.
380 \newhelp\EMsimple{Press RETURN to continue.
}
382 \outer\def\begin{\parsearg\beginxxx}
385 \expandafter\ifx\csname #1\endcsname\relax
386 {\errhelp=
\EMsimple \errmessage{Undefined command @begin
#1}}\else
387 \csname #1\endcsname\fi}
389 % @end foo executes the definition of \Efoo.
391 \def\end{\parsearg\endxxx}
393 \removeactivespaces{#1}%
394 \edef\endthing{\the\toks0}%
396 \expandafter\ifx\csname E
\endthing\endcsname\relax
397 \expandafter\ifx\csname \endthing\endcsname\relax
398 % There's no \foo, i.e., no ``environment'' foo.
400 \errmessage{Undefined command `@end
\endthing'
}%
402 \unmatchedenderror\endthing
405 % Everything's ok; the right environment has been started.
406 \csname E
\endthing\endcsname
410 % There is an environment #1, but it hasn't been started. Give an error.
412 \def\unmatchedenderror#1{%
414 \errmessage{This `@end
#1' doesn't have a matching `@
#1'
}%
417 % Define the control sequence \E#1 to give an unmatched @end error.
419 \def\defineunmatchedend#1{%
420 \expandafter\def\csname E
#1\endcsname{\unmatchedenderror{#1}}%
424 % Single-spacing is done by various environments (specifically, in
425 % \nonfillstart and \quotations).
426 \newskip\singlespaceskip \singlespaceskip =
12.5pt
428 % Why was this kern here? It messes up equalizing space above and below
429 % environments. --karl, 6may93
430 %{\advance \baselineskip by -\singlespaceskip
431 %\kern \baselineskip}%
432 \setleading \singlespaceskip
435 %% Simple single-character @ commands
438 % Kludge this until the fonts are right (grr).
441 % This is turned off because it was never documented
442 % and you can use @w{...} around a quote to suppress ligatures.
443 %% Define @` and @' to be the same as ` and '
444 %% but suppressing ligatures.
448 % Used to generate quoted braces.
449 \def\mylbrace {{\tt\char123}}
450 \def\myrbrace {{\tt\char125}}
454 % Definitions to produce actual \{ & \} command in an index.
455 \catcode`\
{ =
12 \catcode`\
} =
12
456 \catcode`\
[ =
1 \catcode`\
] =
2
457 \catcode`\@ =
0 \catcode`\\ =
12
462 % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
463 % Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H.
466 \def\ringaccent#1{{\accent23 #1}}
471 % Other special characters: @questiondown @exclamdown
472 % Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss.
473 \def\questiondown{?`
}
476 % Dotless i and dotless j, used for accents.
481 \ifx\temp\imacro \ptexi
482 \else\ifx\temp\jmacro \j
483 \else \errmessage{@dotless can be used only with i or j
}%
487 % Be sure we're in horizontal mode when doing a tie, since we make space
488 % equivalent to this in @example-like environments. Otherwise, a space
489 % at the beginning of a line will start with \penalty -- and
490 % since \penalty is valid in vertical mode, we'd end up putting the
491 % penalty on the vertical list instead of in the new paragraph.
493 % Avoid using \@M directly, because that causes trouble
494 % if the definition is written into an index file.
495 \global\let\tiepenalty = \@M
496 \gdef\tie{\leavevmode\penalty\tiepenalty\
}
499 % @: forces normal size whitespace following.
500 \def\:
{\spacefactor=
1000 }
502 % @* forces a line break.
503 \def\*
{\hfil\break\hbox{}\ignorespaces}
505 % @. is an end-of-sentence period.
506 \def\.
{.
\spacefactor=
3000 }
508 % @! is an end-of-sentence bang.
509 \def\!
{!
\spacefactor=
3000 }
511 % @? is an end-of-sentence query.
512 \def\?
{?
\spacefactor=
3000 }
514 % @w prevents a word break. Without the \leavevmode, @w at the
515 % beginning of a paragraph, when TeX is still in vertical mode, would
516 % produce a whole line of output instead of starting the paragraph.
517 \def\w#1{\leavevmode\hbox{#1}}
519 % @group ... @end group forces ... to be all on one page, by enclosing
520 % it in a TeX vbox. We use \vtop instead of \vbox to construct the box
521 % to keep its height that of a normal line. According to the rules for
522 % \topskip (p.114 of the TeXbook), the glue inserted is
523 % max (\topskip - \ht (first item), 0). If that height is large,
524 % therefore, no glue is inserted, and the space between the headline and
525 % the text is small, which looks bad.
527 \def\group{\begingroup
528 \ifnum\catcode13=
\active \else
529 \errhelp =
\groupinvalidhelp
530 \errmessage{@group invalid in context where filling is enabled
}%
533 % The \vtop we start below produces a box with normal height and large
534 % depth; thus, TeX puts \baselineskip glue before it, and (when the
535 % next line of text is done) \lineskip glue after it. (See p.82 of
536 % the TeXbook.) Thus, space below is not quite equal to space
537 % above. But it's pretty close.
539 \egroup % End the \vtop.
540 \endgroup % End the \group.
544 % We have to put a strut on the last line in case the @group is in
545 % the midst of an example, rather than completely enclosing it.
546 % Otherwise, the interline space between the last line of the group
547 % and the first line afterwards is too small. But we can't put the
548 % strut in \Egroup, since there it would be on a line by itself.
549 % Hence this just inserts a strut at the beginning of each line.
550 \everypar =
{\strut}%
552 % Since we have a strut on every line, we don't need any of TeX's
553 % normal interline spacing.
556 % OK, but now we have to do something about blank
557 % lines in the input in @example-like environments, which normally
558 % just turn into \lisppar, which will insert no space now that we've
559 % turned off the interline space. Simplest is to make them be an
562 \edef\par{\leavevmode \par}%
564 % Reset ^^M's definition to new definition of \par.
568 % Do @comment since we are called inside an environment such as
569 % @example, where each end-of-line in the input causes an
570 % end-of-line in the output. We don't want the end-of-line after
571 % the `@group' to put extra space in the output. Since @group
572 % should appear on a line by itself (according to the Texinfo
573 % manual), we don't worry about eating any user text.
577 % TeX puts in an \escapechar (i.e., `@') at the beginning of the help
578 % message, so this ends up printing `@group can only ...'.
580 \newhelp\groupinvalidhelp{%
581 group can only be used in environments such as @example,^^J
%
582 where each line of input produces a line of output.
}
584 % @need space-in-mils
585 % forces a page break if there is not space-in-mils remaining.
587 \newdimen\mil \mil=
0.001in
589 \def\need{\parsearg\needx}
591 % Old definition--didn't work.
592 %\def\needx #1{\par %
593 %% This method tries to make TeX break the page naturally
594 %% if the depth of the box does not fit.
596 %\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak
601 % Go into vertical mode, so we don't make a big box in the middle of a
605 % Don't add any leading before our big empty box, but allow a page
606 % break, since the best break might be right here.
609 \vtop to
#1\mil{\vfil}%
611 % TeX does not even consider page breaks if a penalty added to the
612 % main vertical list is 10000 or more. But in order to see if the
613 % empty box we just added fits on the page, we must make it consider
614 % page breaks. On the other hand, we don't want to actually break the
615 % page after the empty box. So we use a penalty of 9999.
617 % There is an extremely small chance that TeX will actually break the
618 % page at this \penalty, if there are no other feasible breakpoints in
619 % sight. (If the user is using lots of big @group commands, which
620 % almost-but-not-quite fill up a page, TeX will have a hard time doing
621 % good page breaking, for example.) However, I could not construct an
622 % example where a page broke at this \penalty; if it happens in a real
623 % document, then we can reconsider our strategy.
626 % Back up by the size of the box, whether we did a page break or not.
629 % Do not allow a page break right after this kern.
633 % @br forces paragraph break
637 % @dots{} output an ellipsis using the current font.
638 % We do .5em per period so that it has the same spacing in a typewriter
639 % font as three actual period characters.
644 \hskip 0pt plus
0.25fil minus
0.25fil
646 \hskip 0pt plus
0.5fil minus
0.5fil
650 % @enddots{} is an end-of-sentence ellipsis.
655 \hskip 0pt plus
0.25fil minus
0.25fil
657 \hskip 0pt plus
0.5fil minus
0.5fil
663 % @page forces the start of a new page
665 \def\page{\par\vfill\supereject}
668 % outputs text on separate line in roman font, starting at standard page margin
670 % This records the amount of indent in the innermost environment.
671 % That's how much \exdent should take out.
672 \newskip\exdentamount
674 % This defn is used inside fill environments such as @defun.
675 \def\exdent{\parsearg\exdentyyy}
676 \def\exdentyyy #1{{\hfil\break\hbox{\kern -
\exdentamount{\rm#1}}\hfil\break}}
678 % This defn is used inside nofill environments such as @example.
679 \def\nofillexdent{\parsearg\nofillexdentyyy}
680 \def\nofillexdentyyy #1{{\advance \leftskip by -
\exdentamount
681 \leftline{\hskip\leftskip{\rm#1}}}}
683 % @inmargin{TEXT} puts TEXT in the margin next to the current paragraph.
686 \strut\vadjust{\nobreak\kern-
\strutdepth
687 \vtop to
\strutdepth{\baselineskip\strutdepth\vss
688 \llap{\rightskip=
\inmarginspacing \vbox{\noindent #1}}\null}}}
689 \newskip\inmarginspacing \inmarginspacing=
1cm
690 \def\strutdepth{\dp\strutbox}
692 %\hbox{{\rm#1}}\hfil\break}}
694 % @include file insert text of that file as input.
695 % Allow normal characters that we make active in the argument (a file name).
696 \def\include{\begingroup
705 \parsearg\includezzz}
706 % Restore active chars for included file.
707 \def\includezzz#1{\endgroup\begingroup
708 % Read the included file in a group so nested @include's work.
715 % @center line outputs that line, centered
717 \def\center{\parsearg\centerzzz}
718 \def\centerzzz #1{{\advance\hsize by -
\leftskip
719 \advance\hsize by -
\rightskip
722 % @sp n outputs n lines of vertical space
724 \def\sp{\parsearg\spxxx}
725 \def\spxxx #1{\vskip #1\baselineskip}
727 % @comment ...line which is ignored...
728 % @c is the same as @comment
729 % @ignore ... @end ignore is another way to write a comment
731 \def\comment{\begingroup \catcode`\^^M=
\other%
732 \catcode`\@=
\other \catcode`\
{=
\other \catcode`\
}=
\other%
734 {\catcode`\^^M=
\other \gdef\commentxxx#1^^M
{\endgroup}}
738 % @paragraphindent NCHARS
739 % We'll use ems for NCHARS, close enough.
740 % We cannot implement @paragraphindent asis, though.
742 \def\asisword{asis
} % no translation, these are keywords
745 \def\paragraphindent{\parsearg\doparagraphindent}
746 \def\doparagraphindent#1{%
751 \defaultparindent =
0pt
753 \defaultparindent =
#1em
756 \parindent =
\defaultparindent
759 % @asis just yields its argument. Used with @table, for example.
763 % @math means output in math mode.
764 % We don't use $'s directly in the definition of \math because control
765 % sequences like \math are expanded when the toc file is written. Then,
766 % we read the toc file back, the $'s will be normal characters (as they
767 % should be, according to the definition of Texinfo). So we must use a
768 % control sequence to switch into and out of math mode.
770 % This isn't quite enough for @math to work properly in indices, but it
771 % seems unlikely it will ever be needed there.
773 \let\implicitmath = $
774 \def\math#1{\implicitmath #1\implicitmath}
776 % @bullet and @minus need the same treatment as @math, just above.
777 \def\bullet{\implicitmath\ptexbullet\implicitmath}
778 \def\minus{\implicitmath-
\implicitmath}
780 % @refill is a no-op.
783 % If working on a large document in chapters, it is convenient to
784 % be able to disable indexing, cross-referencing, and contents, for test runs.
785 % This is done with @novalidate (before @setfilename).
787 \newif\iflinks \linkstrue % by default we want the aux files.
788 \let\novalidate =
\linksfalse
790 % @setfilename is done at the beginning of every texinfo file.
791 % So open here the files we need to have open while reading the input.
792 % This makes it possible to make a .fmt file for texinfo.
796 \fi % \openindices needs to do some work in any case.
798 \fixbackslash % Turn off hack to swallow `\input texinfo'.
799 \global\let\setfilename=
\comment % Ignore extra @setfilename cmds.
801 % If texinfo.cnf is present on the system, read it.
802 % Useful for site-wide @afourpaper, etc.
803 % Just to be on the safe side, close the input stream before the \input.
804 \openin 1 texinfo.cnf
805 \ifeof1 \let\temp=
\relax \else \def\temp{\input texinfo.cnf
}\fi
809 \comment % Ignore the actual filename.
812 % Called from \setfilename.
824 \outer\def\bye{\pagealignmacro\tracingstats=
1\ptexend}
828 % Font-change commands.
830 % Texinfo sort of supports the sans serif font style, which plain TeX does not.
831 % So we set up a \sf analogous to plain's \rm, etc.
833 \def\sf{\fam=
\sffam \tensf}
834 \let\li =
\sf % Sometimes we call it \li, not \sf.
836 % We don't need math for this one.
839 % Use Computer Modern fonts at \magstephalf (11pt).
840 \newcount\mainmagstep
841 \mainmagstep=
\magstephalf
843 % Set the font macro #1 to the font named #2, adding on the
844 % specified font prefix (normally `cm').
845 % #3 is the font's design size, #4 is a scale factor
846 \def\setfont#1#2#3#4{\font#1=
\fontprefix#2#3 scaled
#4}
848 % Use cm as the default font prefix.
849 % To specify the font prefix, you must define \fontprefix
850 % before you read in texinfo.tex.
851 \ifx\fontprefix\undefined
854 % Support font families that don't use the same naming scheme as CM.
856 \def\rmbshape{bx
} %where the normal face is bold
872 \let\mainmagstep=
\magstep1
873 \setfont\textrm\rmshape{12}{1000}
874 \setfont\texttt\ttshape{12}{1000}
876 \setfont\textrm\rmshape{10}{\mainmagstep}
877 \setfont\texttt\ttshape{10}{\mainmagstep}
879 % Instead of cmb10, you many want to use cmbx10.
880 % cmbx10 is a prettier font on its own, but cmb10
881 % looks better when embedded in a line with cmr10.
882 \setfont\textbf\bfshape{10}{\mainmagstep}
883 \setfont\textit\itshape{10}{\mainmagstep}
884 \setfont\textsl\slshape{10}{\mainmagstep}
885 \setfont\textsf\sfshape{10}{\mainmagstep}
886 \setfont\textsc\scshape{10}{\mainmagstep}
887 \setfont\textttsl\ttslshape{10}{\mainmagstep}
888 \font\texti=cmmi10 scaled
\mainmagstep
889 \font\textsy=cmsy10 scaled
\mainmagstep
891 % A few fonts for @defun, etc.
892 \setfont\defbf\bxshape{10}{\magstep1} %was 1314
893 \setfont\deftt\ttshape{10}{\magstep1}
894 \def\df{\let\tentt=
\deftt \let\tenbf =
\defbf \bf}
896 % Fonts for indices and small examples (9pt).
897 % We actually use the slanted font rather than the italic,
898 % because texinfo normally uses the slanted fonts for that.
899 % Do not make many font distinctions in general in the index, since they
900 % aren't very useful.
901 \setfont\ninett\ttshape{9}{1000}
902 \setfont\ninettsl\ttslshape{10}{900}
903 \setfont\indrm\rmshape{9}{1000}
904 \setfont\indit\itshape{9}{1000}
905 \setfont\indsl\slshape{9}{1000}
907 \let\indttsl=
\ninettsl
910 \setfont\indsc\scshape{10}{900}
914 % Fonts for title page:
915 \setfont\titlerm\rmbshape{12}{\magstep3}
916 \setfont\titleit\itbshape{10}{\magstep4}
917 \setfont\titlesl\slbshape{10}{\magstep4}
918 \setfont\titlett\ttbshape{12}{\magstep3}
919 \setfont\titlettsl\ttslshape{10}{\magstep4}
920 \setfont\titlesf\sfbshape{17}{\magstep1}
921 \let\titlebf=
\titlerm
922 \setfont\titlesc\scbshape{10}{\magstep4}
923 \font\titlei=cmmi12 scaled
\magstep3
924 \font\titlesy=cmsy10 scaled
\magstep4
925 \def\authorrm{\secrm}
927 % Chapter (and unnumbered) fonts (17.28pt).
928 \setfont\chaprm\rmbshape{12}{\magstep2}
929 \setfont\chapit\itbshape{10}{\magstep3}
930 \setfont\chapsl\slbshape{10}{\magstep3}
931 \setfont\chaptt\ttbshape{12}{\magstep2}
932 \setfont\chapttsl\ttslshape{10}{\magstep3}
933 \setfont\chapsf\sfbshape{17}{1000}
935 \setfont\chapsc\scbshape{10}{\magstep3}
936 \font\chapi=cmmi12 scaled
\magstep2
937 \font\chapsy=cmsy10 scaled
\magstep3
939 % Section fonts (14.4pt).
940 \setfont\secrm\rmbshape{12}{\magstep1}
941 \setfont\secit\itbshape{10}{\magstep2}
942 \setfont\secsl\slbshape{10}{\magstep2}
943 \setfont\sectt\ttbshape{12}{\magstep1}
944 \setfont\secttsl\ttslshape{10}{\magstep2}
945 \setfont\secsf\sfbshape{12}{\magstep1}
947 \setfont\secsc\scbshape{10}{\magstep2}
948 \font\seci=cmmi12 scaled
\magstep1
949 \font\secsy=cmsy10 scaled
\magstep2
951 % \setfont\ssecrm\bxshape{10}{\magstep1} % This size an font looked bad.
952 % \setfont\ssecit\itshape{10}{\magstep1} % The letters were too crowded.
953 % \setfont\ssecsl\slshape{10}{\magstep1}
954 % \setfont\ssectt\ttshape{10}{\magstep1}
955 % \setfont\ssecsf\sfshape{10}{\magstep1}
957 %\setfont\ssecrm\bfshape{10}{1315} % Note the use of cmb rather than cmbx.
958 %\setfont\ssecit\itshape{10}{1315} % Also, the size is a little larger than
959 %\setfont\ssecsl\slshape{10}{1315} % being scaled magstep1.
960 %\setfont\ssectt\ttshape{10}{1315}
961 %\setfont\ssecsf\sfshape{10}{1315}
965 % Subsection fonts (13.15pt).
966 \setfont\ssecrm\rmbshape{12}{\magstephalf}
967 \setfont\ssecit\itbshape{10}{1315}
968 \setfont\ssecsl\slbshape{10}{1315}
969 \setfont\ssectt\ttbshape{12}{\magstephalf}
970 \setfont\ssecttsl\ttslshape{10}{1315}
971 \setfont\ssecsf\sfbshape{12}{\magstephalf}
973 \setfont\ssecsc\scbshape{10}{\magstep1}
974 \font\sseci=cmmi12 scaled
\magstephalf
975 \font\ssecsy=cmsy10 scaled
1315
976 % The smallcaps and symbol fonts should actually be scaled \magstep1.5,
977 % but that is not a standard magnification.
979 % In order for the font changes to affect most math symbols and letters,
980 % we have to define the \textfont of the standard families. Since
981 % texinfo doesn't allow for producing subscripts and superscripts, we
982 % don't bother to reset \scriptfont and \scriptscriptfont (which would
983 % also require loading a lot more fonts).
985 \def\resetmathfonts{%
986 \textfont0 =
\tenrm \textfont1 =
\teni \textfont2 =
\tensy
987 \textfont\itfam =
\tenit \textfont\slfam =
\tensl \textfont\bffam =
\tenbf
988 \textfont\ttfam =
\tentt \textfont\sffam =
\tensf
992 % The font-changing commands redefine the meanings of \tenSTYLE, instead
993 % of just \STYLE. We do this so that font changes will continue to work
994 % in math mode, where it is the current \fam that is relevant in most
995 % cases, not the current font. Plain TeX does \def\bf{\fam=\bffam
996 % \tenbf}, for example. By redefining \tenbf, we obviate the need to
997 % redefine \bf itself.
999 \let\tenrm=
\textrm \let\tenit=
\textit \let\tensl=
\textsl
1000 \let\tenbf=
\textbf \let\tentt=
\texttt \let\smallcaps=
\textsc
1001 \let\tensf=
\textsf \let\teni=
\texti \let\tensy=
\textsy \let\tenttsl=
\textttsl
1004 \let\tenrm=
\titlerm \let\tenit=
\titleit \let\tensl=
\titlesl
1005 \let\tenbf=
\titlebf \let\tentt=
\titlett \let\smallcaps=
\titlesc
1006 \let\tensf=
\titlesf \let\teni=
\titlei \let\tensy=
\titlesy
1007 \let\tenttsl=
\titlettsl
1008 \resetmathfonts \setleading{25pt
}}
1009 \def\titlefont#1{{\titlefonts\rm #1}}
1011 \let\tenrm=
\chaprm \let\tenit=
\chapit \let\tensl=
\chapsl
1012 \let\tenbf=
\chapbf \let\tentt=
\chaptt \let\smallcaps=
\chapsc
1013 \let\tensf=
\chapsf \let\teni=
\chapi \let\tensy=
\chapsy \let\tenttsl=
\chapttsl
1014 \resetmathfonts \setleading{19pt
}}
1016 \let\tenrm=
\secrm \let\tenit=
\secit \let\tensl=
\secsl
1017 \let\tenbf=
\secbf \let\tentt=
\sectt \let\smallcaps=
\secsc
1018 \let\tensf=
\secsf \let\teni=
\seci \let\tensy=
\secsy \let\tenttsl=
\secttsl
1019 \resetmathfonts \setleading{16pt
}}
1021 \let\tenrm=
\ssecrm \let\tenit=
\ssecit \let\tensl=
\ssecsl
1022 \let\tenbf=
\ssecbf \let\tentt=
\ssectt \let\smallcaps=
\ssecsc
1023 \let\tensf=
\ssecsf \let\teni=
\sseci \let\tensy=
\ssecsy \let\tenttsl=
\ssecttsl
1024 \resetmathfonts \setleading{15pt
}}
1025 \let\subsubsecfonts =
\subsecfonts % Maybe make sssec fonts scaled magstephalf?
1027 \let\tenrm=
\indrm \let\tenit=
\indit \let\tensl=
\indsl
1028 \let\tenbf=
\indbf \let\tentt=
\indtt \let\smallcaps=
\indsc
1029 \let\tensf=
\indsf \let\teni=
\indi \let\tensy=
\indsy \let\tenttsl=
\indttsl
1030 \resetmathfonts \setleading{12pt
}}
1032 % Set up the default fonts, so we can use them for creating boxes.
1036 % Define these so they can be easily changed for other fonts.
1037 \def\angleleft{$
\langle$
}
1038 \def\angleright{$
\rangle$
}
1040 % Count depth in font-changes, for error checks
1041 \newcount\fontdepth \fontdepth=
0
1043 % Fonts for short table of contents.
1044 \setfont\shortcontrm\rmshape{12}{1000}
1045 \setfont\shortcontbf\bxshape{12}{1000}
1046 \setfont\shortcontsl\slshape{12}{1000}
1048 %% Add scribe-like font environments, plus @l for inline lisp (usually sans
1049 %% serif) and @ii for TeX italic
1051 % \smartitalic{ARG} outputs arg in italics, followed by an italic correction
1052 % unless the following character is such as not to need one.
1053 \def\smartitalicx{\ifx\next,
\else\ifx\next-
\else\ifx\next.
\else\/
\fi\fi\fi}
1054 \def\smartslanted#1{{\sl #1}\futurelet\next\smartitalicx}
1055 \def\smartitalic#1{{\it #1}\futurelet\next\smartitalicx}
1058 \let\var=
\smartslanted
1059 \let\dfn=
\smartslanted
1060 \let\emph=
\smartitalic
1061 \let\cite=
\smartslanted
1066 % We can't just use \exhyphenpenalty, because that only has effect at
1067 % the end of a paragraph. Restore normal hyphenation at the end of the
1068 % group within which \nohyphenation is presumably called.
1070 \def\nohyphenation{\hyphenchar\font = -
1 \aftergroup\restorehyphenation}
1071 \def\restorehyphenation{\hyphenchar\font = `-
}
1074 {\tt \rawbackslash \frenchspacing #1}%
1078 \def\samp#1{`
\tclose{#1}'
\null}
1079 \setfont\smallrm\rmshape{8}{1000}
1081 \def\key#1{{\smallrm\textfont2=
\smallsy \leavevmode\hbox{%
1082 \raise0.4pt
\hbox{\angleleft}\kern-
.08em
\vtop{%
1083 \vbox{\hrule\kern-
0.4pt
1084 \hbox{\raise0.4pt
\hbox{\vphantom{\angleleft}}#1}}%
1086 \kern-
.06em
\raise0.4pt
\hbox{\angleright}}}}
1087 % The old definition, with no lozenge:
1088 %\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
1089 \def\ctrl #1{{\tt \rawbackslash \hat}#1}
1091 % @file, @option are the same as @samp.
1095 % @code is a modification of @t,
1096 % which makes spaces the same size as normal in the surrounding text.
1099 % Change normal interword space to be same as for the current font.
1100 \spaceskip =
\fontdimen2\font
1102 % Switch to typewriter.
1105 % But `\ ' produces the large typewriter interword space.
1106 \def\
{{\spaceskip =
0pt
{} }}%
1108 % Turn off hyphenation.
1118 % We *must* turn on hyphenation at `-' and `_' in \code.
1119 % Otherwise, it is too hard to avoid overfull hboxes
1120 % in the Emacs manual, the Library manual, etc.
1122 % Unfortunately, TeX uses one parameter (\hyphenchar) to control
1123 % both hyphenation at - and hyphenation within words.
1124 % We must therefore turn them both off (\tclose does that)
1125 % and arrange explicitly to hyphenate at a dash.
1131 \global\def\code{\begingroup
1132 \catcode`\-=
\active \let-
\codedash
1133 \catcode`
\_=
\active \let_\codeunder
1137 % If we end up with any active - characters when handling the index,
1138 % just treat them as a normal -.
1139 \global\def\indexbreaks{\catcode`\-=
\active \let-
\realdash}
1143 \def\codedash{-
\discretionary{}{}{}}
1144 \def\codeunder{\ifusingtt{\normalunderscore\discretionary{}{}{}}{\_}}
1145 \def\codex #1{\tclose{#1}\endgroup}
1147 %\let\exp=\tclose %Was temporary
1149 % @kbd is like @code, except that if the argument is just one @key command,
1150 % then @kbd has no effect.
1152 % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
1153 % `example' (@kbd uses ttsl only inside of @example and friends),
1154 % or `code' (@kbd uses normal tty font always).
1155 \def\kbdinputstyle{\parsearg\kbdinputstylexxx}
1156 \def\kbdinputstylexxx#1{%
1158 \ifx\arg\worddistinct
1159 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
1160 \else\ifx\arg\wordexample
1161 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
1162 \else\ifx\arg\wordcode
1163 \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
1166 \def\worddistinct{distinct
}
1167 \def\wordexample{example
}
1170 % Default is kbdinputdistinct. (Too much of a hassle to call the macro,
1171 % the catcodes are wrong for parsearg to work.)
1172 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}
1175 \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??
}%
1176 \ifx\one\xkey\ifx\threex\three \key{#2}%
1177 \else{\tclose{\kbdfont\look}}\fi
1178 \else{\tclose{\kbdfont\look}}\fi}
1180 % For @url, @env, @command quotes seem unnecessary, so use \code.
1185 % @uref (abbreviation for `urlref') takes an optional (comma-separated)
1186 % second argument specifying the text to display and an optional third
1187 % arg as text to display instead of (rather than in addition to) the url
1188 % itself. First (mandatory) arg is the url. Perhaps eventually put in
1189 % a hypertex \special here.
1191 \def\uref#1{\douref #1,,,
\finish}
1192 \def\douref#1,
#2,
#3,
#4\finish{%
1193 \setbox0 =
\hbox{\ignorespaces #3}%
1195 \unhbox0 % third arg given, show only that
1197 \setbox0 =
\hbox{\ignorespaces #2}%
1199 \unhbox0\ (
\code{#1})
% second arg given, show both it and url
1201 \code{#1}% only url given, so show it
1206 % rms does not like the angle brackets --karl, 17may97.
1207 % So now @email is just like @uref.
1208 %\def\email#1{\angleleft{\tt #1}\angleright}
1211 % Check if we are currently using a typewriter font. Since all the
1212 % Computer Modern typewriter fonts have zero interword stretch (and
1213 % shrink), and it is reasonable to expect all typewriter fonts to have
1214 % this property, we can check that font parameter.
1216 \def\ifmonospace{\ifdim\fontdimen3\font=
0pt
}
1218 % Typeset a dimension, e.g., `in' or `pt'. The only reason for the
1219 % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
1221 \def\dmn#1{\thinspace #1}
1223 \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??
\par}
1225 % @l was never documented to mean ``switch to the Lisp font'',
1226 % and it is not used as such in any manual I can find. We need it for
1227 % Polish suppressed-l. --karl, 22sep96.
1228 %\def\l#1{{\li #1}\null}
1230 % Explicit font changes: @r, @sc, undocumented @ii.
1231 \def\r#1{{\rm #1}} % roman font
1232 \def\sc#1{{\smallcaps#1}} % smallcaps font
1233 \def\ii#1{{\it #1}} % italic font
1235 % @acronym downcases the argument and prints in smallcaps.
1236 \def\acronym#1{{\smallcaps \lowercase{#1}}}
1238 % @pounds{} is a sterling sign.
1239 \def\pounds{{\it\$
}}
1242 \message{page headings,
}
1244 \newskip\titlepagetopglue \titlepagetopglue =
1.5in
1245 \newskip\titlepagebottomglue \titlepagebottomglue =
2pc
1247 % First the title page. Must do @settitle before @titlepage.
1249 \newif\iffinishedtitlepage
1251 % Do an implicit @contents or @shortcontents after @end titlepage if the
1252 % user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
1254 \newif\ifsetcontentsaftertitlepage
1255 \let\setcontentsaftertitlepage =
\setcontentsaftertitlepagetrue
1256 \newif\ifsetshortcontentsaftertitlepage
1257 \let\setshortcontentsaftertitlepage =
\setshortcontentsaftertitlepagetrue
1259 \def\shorttitlepage{\parsearg\shorttitlepagezzz}
1260 \def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in
\chaprm \centerline{#1}%
1261 \endgroup\page\hbox{}\page}
1263 \def\titlepage{\begingroup \parindent=
0pt
\textfonts
1264 \let\subtitlerm=
\tenrm
1265 \def\subtitlefont{\subtitlerm \normalbaselineskip =
13pt
\normalbaselines}%
1267 \def\authorfont{\authorrm \normalbaselineskip =
16pt
\normalbaselines}%
1269 % Leave some space at the very top of the page.
1270 \vglue\titlepagetopglue
1272 % Now you can print the title using @title.
1273 \def\title{\parsearg\titlezzz}%
1274 \def\titlezzz#
#1{\leftline{\titlefonts\rm #
#1}
1275 % print a rule at the page bottom also.
1276 \finishedtitlepagefalse
1277 \vskip4pt \hrule height
4pt width
\hsize \vskip4pt}%
1278 % No rule at page bottom unless we print one at the top with @title.
1279 \finishedtitlepagetrue
1281 % Now you can put text using @subtitle.
1282 \def\subtitle{\parsearg\subtitlezzz}%
1283 \def\subtitlezzz#
#1{{\subtitlefont \rightline{#
#1}}}%
1285 % @author should come last, but may come many times.
1286 \def\author{\parsearg\authorzzz}%
1287 \def\authorzzz#
#1{\ifseenauthor\else\vskip 0pt plus
1filll
\seenauthortrue\fi
1288 {\authorfont \leftline{#
#1}}}%
1290 % Most title ``pages'' are actually two pages long, with space
1291 % at the top of the second. We don't want the ragged left on the second.
1292 \let\oldpage =
\page
1294 \iffinishedtitlepage\else
1298 \let\page =
\oldpage
1300 % \def\page{\oldpage \hbox{}}
1304 \iffinishedtitlepage\else
1307 % It is important to do the page break before ending the group,
1308 % because the headline and footline are only empty inside the group.
1309 % If we use the new definition of \page, we always get a blank page
1310 % after the title page, which we certainly don't want.
1314 % If they want short, they certainly want long too.
1315 \ifsetshortcontentsaftertitlepage
1318 \global\let\shortcontents =
\relax
1319 \global\let\contents =
\relax
1322 \ifsetcontentsaftertitlepage
1324 \global\let\contents =
\relax
1325 \global\let\shortcontents =
\relax
1331 \def\finishtitlepage{%
1332 \vskip4pt \hrule height
2pt width
\hsize
1333 \vskip\titlepagebottomglue
1334 \finishedtitlepagetrue
1337 %%% Set up page headings and footings.
1339 \let\thispage=
\folio
1341 \newtoks\evenheadline % headline on even pages
1342 \newtoks\oddheadline % headline on odd pages
1343 \newtoks\evenfootline % footline on even pages
1344 \newtoks\oddfootline % footline on odd pages
1346 % Now make Tex use those variables
1347 \headline=
{{\textfonts\rm \ifodd\pageno \the\oddheadline
1348 \else \the\evenheadline \fi}}
1349 \footline=
{{\textfonts\rm \ifodd\pageno \the\oddfootline
1350 \else \the\evenfootline \fi}\HEADINGShook}
1351 \let\HEADINGShook=
\relax
1353 % Commands to set those variables.
1354 % For example, this is what @headings on does
1355 % @evenheading @thistitle|@thispage|@thischapter
1356 % @oddheading @thischapter|@thispage|@thistitle
1357 % @evenfooting @thisfile||
1358 % @oddfooting ||@thisfile
1360 \def\evenheading{\parsearg\evenheadingxxx}
1361 \def\oddheading{\parsearg\oddheadingxxx}
1362 \def\everyheading{\parsearg\everyheadingxxx}
1364 \def\evenfooting{\parsearg\evenfootingxxx}
1365 \def\oddfooting{\parsearg\oddfootingxxx}
1366 \def\everyfooting{\parsearg\everyfootingxxx}
1370 \gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|
\finish}
1371 \gdef\evenheadingyyy #1@|
#2@|
#3@|
#4\finish{%
1372 \global\evenheadline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1374 \gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|
\finish}
1375 \gdef\oddheadingyyy #1@|
#2@|
#3@|
#4\finish{%
1376 \global\oddheadline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1378 \gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
1380 \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|
\finish}
1381 \gdef\evenfootingyyy #1@|
#2@|
#3@|
#4\finish{%
1382 \global\evenfootline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1384 \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|
\finish}
1385 \gdef\oddfootingyyy #1@|
#2@|
#3@|
#4\finish{%
1386 \global\oddfootline =
{\rlap{\centerline{#2}}\line{#1\hfil#3}}%
1388 % Leave some space for the footline. Hopefully ok to assume
1389 % @evenfooting will not be used by itself.
1390 \global\advance\pageheight by -
\baselineskip
1391 \global\advance\vsize by -
\baselineskip
1394 \gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}}
1396 }% unbind the catcode of @.
1398 % @headings double turns headings on for double-sided printing.
1399 % @headings single turns headings on for single-sided printing.
1400 % @headings off turns them off.
1401 % @headings on same as @headings double, retained for compatibility.
1402 % @headings after turns on double-sided headings after this page.
1403 % @headings doubleafter turns on double-sided headings after this page.
1404 % @headings singleafter turns on single-sided headings after this page.
1405 % By default, they are off at the start of a document,
1406 % and turned `on' after @end titlepage.
1408 \def\headings #1 {\csname HEADINGS
#1\endcsname}
1411 \global\evenheadline=
{\hfil} \global\evenfootline=
{\hfil}
1412 \global\oddheadline=
{\hfil} \global\oddfootline=
{\hfil}}
1414 % When we turn headings on, set the page number to 1.
1415 % For double-sided printing, put current file name in lower left corner,
1416 % chapter name on inside top of right hand pages, document
1417 % title on inside top of left hand pages, and page numbers on outside top
1418 % edge of all pages.
1419 \def\HEADINGSdouble{
1421 \global\evenfootline=
{\hfil}
1422 \global\oddfootline=
{\hfil}
1423 \global\evenheadline=
{\line{\folio\hfil\thistitle}}
1424 \global\oddheadline=
{\line{\thischapter\hfil\folio}}
1425 \global\let\contentsalignmacro =
\chapoddpage
1427 \let\contentsalignmacro =
\chappager
1429 % For single-sided printing, chapter title goes across top left of page,
1430 % page number on top right.
1431 \def\HEADINGSsingle{
1433 \global\evenfootline=
{\hfil}
1434 \global\oddfootline=
{\hfil}
1435 \global\evenheadline=
{\line{\thischapter\hfil\folio}}
1436 \global\oddheadline=
{\line{\thischapter\hfil\folio}}
1437 \global\let\contentsalignmacro =
\chappager
1439 \def\HEADINGSon{\HEADINGSdouble}
1441 \def\HEADINGSafter{\let\HEADINGShook=
\HEADINGSdoublex}
1442 \let\HEADINGSdoubleafter=
\HEADINGSafter
1443 \def\HEADINGSdoublex{%
1444 \global\evenfootline=
{\hfil}
1445 \global\oddfootline=
{\hfil}
1446 \global\evenheadline=
{\line{\folio\hfil\thistitle}}
1447 \global\oddheadline=
{\line{\thischapter\hfil\folio}}
1448 \global\let\contentsalignmacro =
\chapoddpage
1451 \def\HEADINGSsingleafter{\let\HEADINGShook=
\HEADINGSsinglex}
1452 \def\HEADINGSsinglex{%
1453 \global\evenfootline=
{\hfil}
1454 \global\oddfootline=
{\hfil}
1455 \global\evenheadline=
{\line{\thischapter\hfil\folio}}
1456 \global\oddheadline=
{\line{\thischapter\hfil\folio}}
1457 \global\let\contentsalignmacro =
\chappager
1460 % Subroutines used in generating headings
1461 % Produces Day Month Year style of output.
1465 \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
1466 \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
1467 \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
1471 % @settitle line... specifies the title of the document, for headings.
1472 % It generates no output of its own.
1473 \def\thistitle{\putwordNoTitle}
1474 \def\settitle{\parsearg\settitlezzz}
1475 \def\settitlezzz #1{\gdef\thistitle{#1}}
1479 % Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
1481 % default indentation of table text
1482 \newdimen\tableindent \tableindent=
.8in
1483 % default indentation of @itemize and @enumerate text
1484 \newdimen\itemindent \itemindent=
.3in
1485 % margin between end of table item and start of table text.
1486 \newdimen\itemmargin \itemmargin=
.1in
1488 % used internally for \itemindent minus \itemmargin
1491 % Note @table, @vtable, and @vtable define @item, @itemx, etc., with
1493 % They also define \itemindex
1494 % to index the item name in whatever manner is desired (perhaps none).
1496 \newif\ifitemxneedsnegativevskip
1498 \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-
\parskip\nobreak\fi}
1500 \def\internalBitem{\smallbreak \parsearg\itemzzz}
1501 \def\internalBitemx{\itemxpar \parsearg\itemzzz}
1503 \def\internalBxitem "
#1"
{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
1504 \def\internalBxitemx "
#1"
{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz}
1506 \def\internalBkitem{\smallbreak \parsearg\kitemzzz}
1507 \def\internalBkitemx{\itemxpar \parsearg\kitemzzz}
1509 \def\kitemzzz #1{\dosubind {kw
}{\code{#1}}{for
{\bf \lastfunction}}%
1512 \def\xitemzzz #1{\dosubind {kw
}{\code{#1}}{for
{\bf \xitemsubtopic}}%
1515 \def\itemzzz #1{\begingroup %
1516 \advance\hsize by -
\rightskip
1517 \advance\hsize by -
\tableindent
1518 \setbox0=
\hbox{\itemfont{#1}}%
1520 \nobreak % This prevents a break before @itemx.
1522 % If the item text does not fit in the space we have, put it on a line
1523 % by itself, and do not allow a page break either before or after that
1524 % line. We do not start a paragraph here because then if the next
1525 % command is, e.g., @kindex, the whatsit would get put into the
1526 % horizontal list on a line by itself, resulting in extra blank space.
1527 \ifdim \wd0>
\itemmax
1529 % Make this a paragraph so we get the \parskip glue and wrapping,
1530 % but leave it ragged-right.
1532 \advance\leftskip by-
\tableindent
1533 \advance\hsize by
\tableindent
1534 \advance\rightskip by0pt plus1fil
1535 \leavevmode\unhbox0\par
1538 % We're going to be starting a paragraph, but we don't want the
1539 % \parskip glue -- logically it's part of the @item we just started.
1540 \nobreak \vskip-
\parskip
1542 % Stop a page break at the \parskip glue coming up. Unfortunately
1543 % we can't prevent a possible page break at the following
1544 % \baselineskip glue.
1547 \itemxneedsnegativevskipfalse
1549 % The item text fits into the space. Start a paragraph, so that the
1550 % following text (if any) will end up on the same line.
1552 % Do this with kerns and \unhbox so that if there is a footnote in
1553 % the item text, it can migrate to the main vertical list and
1554 % eventually be printed.
1555 \nobreak\kern-
\tableindent
1556 \dimen0 =
\itemmax \advance\dimen0 by
\itemmargin \advance\dimen0 by -
\wd0
1558 \nobreak\kern\dimen0
1560 \itemxneedsnegativevskiptrue
1564 \def\item{\errmessage{@item while not in a table
}}
1565 \def\itemx{\errmessage{@itemx while not in a table
}}
1566 \def\kitem{\errmessage{@kitem while not in a table
}}
1567 \def\kitemx{\errmessage{@kitemx while not in a table
}}
1568 \def\xitem{\errmessage{@xitem while not in a table
}}
1569 \def\xitemx{\errmessage{@xitemx while not in a table
}}
1571 % Contains a kludge to get @end[description] to work.
1572 \def\description{\tablez{\dontindex}{1}{}{}{}{}}
1574 % @table, @ftable, @vtable.
1575 \def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
1576 {\obeylines\obeyspaces%
1577 \gdef\tablex #1^^M
{%
1578 \tabley\dontindex#1 \endtabley}}
1580 \def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
1581 {\obeylines\obeyspaces%
1582 \gdef\ftablex #1^^M
{%
1583 \tabley\fnitemindex#1 \endtabley
1584 \def\Eftable{\endgraf\afterenvbreak\endgroup}%
1585 \let\Etable=
\relax}}
1587 \def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex}
1588 {\obeylines\obeyspaces%
1589 \gdef\vtablex #1^^M
{%
1590 \tabley\vritemindex#1 \endtabley
1591 \def\Evtable{\endgraf\afterenvbreak\endgroup}%
1592 \let\Etable=
\relax}}
1595 \def\fnitemindex #1{\doind {fn
}{\code{#1}}}%
1596 \def\vritemindex #1{\doind {vr
}{\code{#1}}}%
1599 \gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
1600 \tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
1602 \def\tablez #1#2#3#4#5#6{%
1605 \def\Edescription{\Etable}% Necessary kludge.
1607 \ifnum 0#3>
0 \advance \leftskip by
#3\mil \fi %
1608 \ifnum 0#4>
0 \tableindent=
#4\mil \fi %
1609 \ifnum 0#5>
0 \advance \rightskip by
#5\mil \fi %
1611 \itemmax=
\tableindent %
1612 \advance \itemmax by -
\itemmargin %
1613 \advance \leftskip by
\tableindent %
1614 \exdentamount=
\tableindent
1616 \parskip =
\smallskipamount
1617 \ifdim \parskip=
0pt
\parskip=
2pt
\fi%
1618 \def\Etable{\endgraf\afterenvbreak\endgroup}%
1619 \let\item =
\internalBitem %
1620 \let\itemx =
\internalBitemx %
1621 \let\kitem =
\internalBkitem %
1622 \let\kitemx =
\internalBkitemx %
1623 \let\xitem =
\internalBxitem %
1624 \let\xitemx =
\internalBxitemx %
1627 % This is the counter used by @enumerate, which is really @itemize
1631 \def\itemize{\parsearg\itemizezzz}
1633 \def\itemizezzz #1{%
1634 \begingroup % ended by the @end itemize
1635 \itemizey {#1}{\Eitemize}
1638 \def\itemizey #1#2{%
1640 \itemmax=
\itemindent %
1641 \advance \itemmax by -
\itemmargin %
1642 \advance \leftskip by
\itemindent %
1643 \exdentamount=
\itemindent
1645 \parskip =
\smallskipamount %
1646 \ifdim \parskip=
0pt
\parskip=
2pt
\fi%
1647 \def#2{\endgraf\afterenvbreak\endgroup}%
1648 \def\itemcontents{#1}%
1649 \let\item=
\itemizeitem}
1651 % Set sfcode to normal for the chars that usually have another value.
1652 % These are `.?!:;,'
1653 \def\frenchspacing{\sfcode46=
1000 \sfcode63=
1000 \sfcode33=
1000
1654 \sfcode58=
1000 \sfcode59=
1000 \sfcode44=
1000 }
1656 % \splitoff TOKENS\endmark defines \first to be the first token in
1657 % TOKENS, and \rest to be the remainder.
1659 \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
1661 % Allow an optional argument of an uppercase letter, lowercase letter,
1662 % or number, to specify the first label in the enumerated list. No
1663 % argument is the same as `1'.
1665 \def\enumerate{\parsearg\enumeratezzz}
1666 \def\enumeratezzz #1{\enumeratey #1 \endenumeratey}
1667 \def\enumeratey #1 #2\endenumeratey{%
1668 \begingroup % ended by the @end enumerate
1670 % If we were given no argument, pretend we were given `1'.
1672 \ifx\thearg\empty \def\thearg{1}\fi
1674 % Detect if the argument is a single token. If so, it might be a
1675 % letter. Otherwise, the only valid thing it can be is a number.
1676 % (We will always have one token, because of the test we just made.
1677 % This is a good thing, since \splitoff doesn't work given nothing at
1678 % all -- the first parameter is undelimited.)
1679 \expandafter\splitoff\thearg\endmark
1681 % Only one token in the argument. It could still be anything.
1682 % A ``lowercase letter'' is one whose \lccode is nonzero.
1683 % An ``uppercase letter'' is one whose \lccode is both nonzero, and
1684 % not equal to itself.
1685 % Otherwise, we assume it's a number.
1687 % We need the \relax at the end of the \ifnum lines to stop TeX from
1688 % continuing to look for a <number>.
1690 \ifnum\lccode\expandafter`
\thearg=
0\relax
1691 \numericenumerate % a number (we hope)
1694 \ifnum\lccode\expandafter`
\thearg=
\expandafter`
\thearg\relax
1695 \lowercaseenumerate % lowercase letter
1697 \uppercaseenumerate % uppercase letter
1701 % Multiple tokens in the argument. We hope it's a number.
1706 % An @enumerate whose labels are integers. The starting integer is
1709 \def\numericenumerate{%
1711 \startenumeration{\the\itemno}%
1714 % The starting (lowercase) letter is in \thearg.
1715 \def\lowercaseenumerate{%
1716 \itemno =
\expandafter`
\thearg
1718 % Be sure we're not beyond the end of the alphabet.
1720 \errmessage{No more lowercase letters in @enumerate; get a bigger
1727 % The starting (uppercase) letter is in \thearg.
1728 \def\uppercaseenumerate{%
1729 \itemno =
\expandafter`
\thearg
1731 % Be sure we're not beyond the end of the alphabet.
1733 \errmessage{No more uppercase letters in @enumerate; get a bigger
1740 % Call itemizey, adding a period to the first argument and supplying the
1741 % common last two arguments. Also subtract one from the initial value in
1742 % \itemno, since @item increments \itemno.
1744 \def\startenumeration#1{%
1745 \advance\itemno by -
1
1746 \itemizey{#1.
}\Eenumerate\flushcr
1749 % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
1752 \def\alphaenumerate{\enumerate{a
}}
1753 \def\capsenumerate{\enumerate{A
}}
1754 \def\Ealphaenumerate{\Eenumerate}
1755 \def\Ecapsenumerate{\Eenumerate}
1757 % Definition of @item while inside @itemize.
1760 \advance\itemno by
1
1761 {\let\par=
\endgraf \smallbreak}%
1762 \ifhmode \errmessage{In hmode at itemizeitem
}\fi
1763 {\parskip=
0in
\hskip 0pt
1764 \hbox to
0pt
{\hss \itemcontents\hskip \itemmargin}%
1765 \vadjust{\penalty 1200}}%
1768 % @multitable macros
1769 % Amy Hendrickson, 8/18/94, 3/6/96
1771 % @multitable ... @end multitable will make as many columns as desired.
1772 % Contents of each column will wrap at width given in preamble. Width
1773 % can be specified either with sample text given in a template line,
1774 % or in percent of \hsize, the current width of text on page.
1776 % Table can continue over pages but will only break between lines.
1780 % Either define widths of columns in terms of percent of \hsize:
1781 % @multitable @columnfractions .25 .3 .45
1784 % Numbers following @columnfractions are the percent of the total
1785 % current hsize to be used for each column. You may use as many
1786 % columns as desired.
1789 % Or use a template:
1790 % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
1792 % using the widest term desired in each column.
1794 % For those who want to use more than one line's worth of words in
1795 % the preamble, break the line within one argument and it
1796 % will parse correctly, i.e.,
1798 % @multitable {Column 1 template} {Column 2 template} {Column 3
1801 % @multitable {Column 1 template} {Column 2 template}
1802 % {Column 3 template}
1804 % Each new table line starts with @item, each subsequent new column
1805 % starts with @tab. Empty columns may be produced by supplying @tab's
1806 % with nothing between them for as many times as empty columns are needed,
1807 % ie, @tab@tab@tab will produce two empty columns.
1809 % @item, @tab, @multitable or @end multitable do not need to be on their
1810 % own lines, but it will not hurt if they are.
1812 % Sample multitable:
1814 % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
1815 % @item first col stuff @tab second col stuff @tab third col
1822 % @item first col stuff @tab second col stuff
1823 % @tab Many paragraphs of text may be used in any column.
1825 % They will wrap at the width determined by the template.
1826 % @item@tab@tab This will be in third column.
1829 % Default dimensions may be reset by user.
1830 % @multitableparskip is vertical space between paragraphs in table.
1831 % @multitableparindent is paragraph indent in table.
1832 % @multitablecolmargin is horizontal space to be left between columns.
1833 % @multitablelinespace is space to leave between table items, baseline
1835 % 0pt means it depends on current normal line spacing.
1837 \newskip\multitableparskip
1838 \newskip\multitableparindent
1839 \newdimen\multitablecolspace
1840 \newskip\multitablelinespace
1841 \multitableparskip=
0pt
1842 \multitableparindent=
6pt
1843 \multitablecolspace=
12pt
1844 \multitablelinespace=
0pt
1846 % Macros used to set up halign preamble:
1848 \let\endsetuptable\relax
1849 \def\xendsetuptable{\endsetuptable}
1850 \let\columnfractions\relax
1851 \def\xcolumnfractions{\columnfractions}
1854 % #1 is the part of the @columnfraction before the decimal point, which
1855 % is presumably either 0 or the empty string (but we don't check, we
1856 % just throw it away). #2 is the decimal part, which we use as the
1857 % percent of \hsize for this column.
1858 \def\pickupwholefraction#1.
#2 {%
1859 \global\advance\colcount by
1
1860 \expandafter\xdef\csname col
\the\colcount\endcsname{.
#2\hsize}%
1867 \ifx\firstarg\xendsetuptable
1870 \ifx\firstarg\xcolumnfractions
1871 \global\setpercenttrue
1874 \let\go\pickupwholefraction
1876 \global\advance\colcount by
1
1877 \setbox0=
\hbox{#1\unskip }% Add a normal word space as a separator;
1878 % typically that is always in the input, anyway.
1879 \expandafter\xdef\csname col
\the\colcount\endcsname{\the\wd0}%
1882 \ifx\go\pickupwholefraction
1883 % Put the argument back for the \pickupwholefraction call, so
1884 % we'll always have a period there to be parsed.
1885 \def\go{\pickupwholefraction#1}%
1887 \let\go =
\setuptable
1894 \def\tab{&
\hskip1sp\relax} % 2/2/96
1895 % tiny skip here makes sure this column space is
1896 % maintained, even if it is never used.
1898 % @multitable ... @end multitable definitions:
1900 \def\multitable{\parsearg\dotable}
1901 \def\dotable#1{\bgroup
1906 \setmultitablespacing
1907 \parskip=
\multitableparskip
1908 \parindent=
\multitableparindent
1911 \def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}%
1913 % To parse everything between @multitable and @item:
1914 \setuptable#1 \endsetuptable
1916 % \everycr will reset column counter, \colcount, at the end of
1917 % each line. Every column entry will cause \colcount to advance by one.
1918 % The table preamble
1919 % looks at the current \colcount to find the correct column width.
1922 % \filbreak%% keeps underfull box messages off when table breaks over pages.
1923 % Maybe so, but it also creates really weird page breaks when the table
1924 % breaks over pages. Wouldn't \vfil be better? Wait until the problem
1925 % manifests itself, so it can be fixed for real --karl.
1926 \global\colcount=
0\relax}}%
1928 % This preamble sets up a generic column definition, which will
1929 % be used as many times as user calls for columns.
1930 % \vtop will set a single line and will also let text wrap and
1931 % continue for many paragraphs if desired.
1932 \halign\bgroup&
\global\advance\colcount by
1\relax
1933 \multistrut\vtop{\hsize=
\expandafter\csname col
\the\colcount\endcsname
1935 % In order to keep entries from bumping into each other
1936 % we will add a \leftskip of \multitablecolspace to all columns after
1939 % If a template has been used, we will add \multitablecolspace
1940 % to the width of each template entry.
1942 % If the user has set preamble in terms of percent of \hsize we will
1943 % use that dimension as the width of the column, and the \leftskip
1944 % will keep entries from bumping into each other. Table will start at
1945 % left margin and final column will justify at right margin.
1947 % Make sure we don't inherit \rightskip from the outer environment.
1950 % The first column will be indented with the surrounding text.
1951 \advance\hsize by
\leftskip
1954 % If user has not set preamble in terms of percent of \hsize
1955 % we will advance \hsize by \multitablecolspace.
1956 \advance\hsize by
\multitablecolspace
1958 % In either case we will make \leftskip=\multitablecolspace:
1959 \leftskip=
\multitablecolspace
1961 % Ignoring space at the beginning and end avoids an occasional spurious
1962 % blank line, when TeX decides to break the line at the space before the
1963 % box from the multistrut, so the strut ends up on a line by itself.
1965 % @multitable @columnfractions .11 .89
1967 % @tab Legal holiday which is valid in major parts of the whole country.
1968 % Is automatically provided with highlighting sequences respectively marking
1970 \noindent\ignorespaces##
\unskip\multistrut}\cr
1973 \def\setmultitablespacing{% test to see if user has set \multitablelinespace.
1974 % If so, do nothing. If not, give it an appropriate dimension based on
1975 % current baselineskip.
1976 \ifdim\multitablelinespace=
0pt
1977 %% strut to put in table in case some entry doesn't have descenders,
1978 %% to keep lines equally spaced
1979 \let\multistrut =
\strut
1980 %% Test to see if parskip is larger than space between lines of
1981 %% table. If not, do nothing.
1982 %% If so, set to same dimension as multitablelinespace.
1984 \gdef\multistrut{\vrule height
\multitablelinespace depth
\dp0
1986 \ifdim\multitableparskip>
\multitablelinespace
1987 \global\multitableparskip=
\multitablelinespace
1988 \global\advance\multitableparskip-
7pt
%% to keep parskip somewhat smaller
1989 %% than skip between lines in the table.
1991 \ifdim\multitableparskip=
0pt
1992 \global\multitableparskip=
\multitablelinespace
1993 \global\advance\multitableparskip-
7pt
%% to keep parskip somewhat smaller
1994 %% than skip between lines in the table.
1998 \message{conditionals,
}
1999 % Prevent errors for section commands.
2000 % Used in @ignore and in failing conditionals.
2001 \def\ignoresections{%
2003 \let\unnumbered=
\relax
2005 \let\unnumberedsec=
\relax
2006 \let\unnumberedsection=
\relax
2007 \let\unnumberedsubsec=
\relax
2008 \let\unnumberedsubsection=
\relax
2009 \let\unnumberedsubsubsec=
\relax
2010 \let\unnumberedsubsubsection=
\relax
2013 \let\subsubsec=
\relax
2014 \let\subsection=
\relax
2015 \let\subsubsection=
\relax
2016 \let\appendix=
\relax
2017 \let\appendixsec=
\relax
2018 \let\appendixsection=
\relax
2019 \let\appendixsubsec=
\relax
2020 \let\appendixsubsection=
\relax
2021 \let\appendixsubsubsec=
\relax
2022 \let\appendixsubsubsection=
\relax
2023 \let\contents=
\relax
2024 \let\smallbook=
\relax
2025 \let\titlepage=
\relax
2028 % Used in nested conditionals, where we have to parse the Texinfo source
2029 % and so want to turn off most commands, in case they are used
2032 \def\ignoremorecommands{%
2033 \let\defcodeindex =
\relax
2036 \let\deffnx =
\relax
2037 \let\defindex =
\relax
2038 \let\defivar =
\relax
2039 \let\defmac =
\relax
2040 \let\defmethod =
\relax
2042 \let\defopt =
\relax
2043 \let\defspec =
\relax
2045 \let\deftypefn =
\relax
2046 \let\deftypefun =
\relax
2047 \let\deftypevar =
\relax
2048 \let\deftypevr =
\relax
2050 \let\defvar =
\relax
2054 \let\printindex =
\relax
2056 \let\settitle =
\relax
2057 \let\setchapternewpage =
\relax
2058 \let\setchapterstyle =
\relax
2059 \let\everyheading =
\relax
2060 \let\evenheading =
\relax
2061 \let\oddheading =
\relax
2062 \let\everyfooting =
\relax
2063 \let\evenfooting =
\relax
2064 \let\oddfooting =
\relax
2065 \let\headings =
\relax
2066 \let\include =
\relax
2067 \let\lowersections =
\relax
2069 \let\raisesections =
\relax
2076 % Ignore @ignore ... @end ignore.
2078 \def\ignore{\doignore{ignore
}}
2080 % Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text.
2082 \def\ifinfo{\doignore{ifinfo
}}
2083 \def\ifhtml{\doignore{ifhtml
}}
2084 \def\ifnottex{\doignore{ifnottex
}}
2085 \def\html{\doignore{html
}}
2086 \def\menu{\doignore{menu
}}
2087 \def\direntry{\doignore{direntry
}}
2089 % @dircategory CATEGORY -- specify a category of the dir file
2090 % which this file should belong to. Ignore this in TeX.
2091 \let\dircategory =
\comment
2093 % Ignore text until a line `@end #1'.
2095 \def\doignore#1{\begingroup
2096 % Don't complain about control sequences we have declared \outer.
2099 % Define a command to swallow text until we reach `@end #1'.
2100 % This @ is a catcode 12 token (that is the normal catcode of @ in
2101 % this texinfo.tex file). We change the catcode of @ below to match.
2102 \long\def\doignoretext#
#1@end
#1{\enddoignore}%
2104 % Make sure that spaces turn into tokens that match what \doignoretext wants.
2107 % Ignore braces, too, so mismatched braces don't cause trouble.
2111 % We must not have @c interpreted as a control sequence.
2114 % Make the letter c a comment character so that the rest of the line
2115 % will be ignored. This way, the document can have (for example)
2117 % and the @end ifinfo will be properly ignored.
2118 % (We've just changed @ to catcode 12.)
2121 % And now expand that command.
2125 % What we do to finish off ignored text.
2127 \def\enddoignore{\endgroup\ignorespaces}%
2129 \newif\ifwarnedobs\warnedobsfalse
2131 \ifwarnedobs\relax\else
2132 % We need to warn folks that they may have trouble with TeX 3.0.
2133 % This uses \immediate\write16 rather than \message to get newlines.
2134 \immediate\write16{}
2135 \immediate\write16{WARNING: for users of Unix TeX
3.0!
}
2136 \immediate\write16{This manual trips a bug in TeX version
3.0 (tex hangs).
}
2137 \immediate\write16{If you are running another version of TeX, relax.
}
2138 \immediate\write16{If you are running Unix TeX
3.0, kill this TeX process.
}
2139 \immediate\write16{ Then upgrade your TeX installation if you can.
}
2140 \immediate\write16{ (See ftp://ftp.gnu.org/pub/gnu/TeX.README.)
}
2141 \immediate\write16{If you are stuck with version
3.0, run the
}
2142 \immediate\write16{ script ``tex3patch'' from the Texinfo distribution
}
2143 \immediate\write16{ to use a workaround.
}
2144 \immediate\write16{}
2145 \global\warnedobstrue
2149 % **In TeX 3.0, setting text in \nullfont hangs tex. For a
2150 % workaround (which requires the file ``dummy.tfm'' to be installed),
2151 % uncomment the following line:
2152 %%%%%\font\nullfont=dummy\let\obstexwarn=\relax
2154 % Ignore text, except that we keep track of conditional commands for
2155 % purposes of nesting, up to an `@end #1' command.
2157 \def\nestedignore#1{%
2159 % We must actually expand the ignored text to look for the @end
2160 % command, so that nested ignore constructs work. Thus, we put the
2161 % text into a \vbox and then do nothing with the result. To minimize
2162 % the change of memory overflow, we follow the approach outlined on
2163 % page 401 of the TeXbook: make the current font be a dummy font.
2165 \setbox0 =
\vbox\bgroup
2166 % Don't complain about control sequences we have declared \outer.
2169 % Define `@end #1' to end the box, which will in turn undefine the
2170 % @end command again.
2171 \expandafter\def\csname E
#1\endcsname{\egroup\ignorespaces}%
2173 % We are going to be parsing Texinfo commands. Most cause no
2174 % trouble when they are used incorrectly, but some commands do
2175 % complicated argument parsing or otherwise get confused, so we
2178 % We can't do anything about stray @-signs, unfortunately;
2179 % they'll produce `undefined control sequence' errors.
2182 % Set the current font to be \nullfont, a TeX primitive, and define
2183 % all the font commands to also use \nullfont. We don't use
2184 % dummy.tfm, as suggested in the TeXbook, because not all sites
2185 % might have that installed. Therefore, math mode will still
2186 % produce output, but that should be an extremely small amount of
2187 % stuff compared to the main input.
2190 \let\tenrm =
\nullfont \let\tenit =
\nullfont \let\tensl =
\nullfont
2191 \let\tenbf =
\nullfont \let\tentt =
\nullfont \let\smallcaps =
\nullfont
2192 \let\tensf =
\nullfont
2193 % Similarly for index fonts (mostly for their use in
2195 \let\indrm =
\nullfont \let\indit =
\nullfont \let\indsl =
\nullfont
2196 \let\indbf =
\nullfont \let\indtt =
\nullfont \let\indsc =
\nullfont
2197 \let\indsf =
\nullfont
2199 % Don't complain when characters are missing from the fonts.
2200 \tracinglostchars =
0
2202 % Don't bother to do space factor calculations.
2205 % Don't report underfull hboxes.
2208 % Do minimal line-breaking.
2209 \pretolerance =
10000
2211 % Do not execute instructions in @tex
2212 \def\tex{\doignore{tex
}}%
2213 % Do not execute macro definitions.
2214 % `c' is a comment character, so the word `macro' will get cut off.
2215 \def\macro{\doignore{ma
}}%
2218 % @set VAR sets the variable VAR to an empty value.
2219 % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
2221 % Since we want to separate VAR from REST-OF-LINE (which might be
2222 % empty), we can't just use \parsearg; we have to insert a space of our
2223 % own to delimit the rest of the line, and then take it out again if we
2224 % didn't need it. Make sure the catcode of space is correct to avoid
2225 % losing inside @example, for instance.
2227 \def\set{\begingroup\catcode` =
10
2228 \catcode`\-=
12 \catcode`
\_=
12 % Allow - and _ in VAR.
2230 \def\setxxx#1{\setyyy#1 \endsetyyy}
2231 \def\setyyy#1 #2\endsetyyy{%
2233 \ifx\temp\empty \global\expandafter\let\csname SET
#1\endcsname =
\empty
2234 \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted.
2238 % Can't use \xdef to pre-expand #2 and save some time, since \temp or
2239 % \next or other control sequences that we've defined might get us into
2240 % an infinite loop. Consider `@set foo @cite{bar}'.
2241 \def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET
#1\endcsname{#2}}
2243 % @clear VAR clears (i.e., unsets) the variable VAR.
2245 \def\clear{\parsearg\clearxxx}
2246 \def\clearxxx#1{\global\expandafter\let\csname SET
#1\endcsname=
\relax}
2248 % @value{foo} gets the text saved in variable foo.
2250 \catcode`
\_ =
\active
2252 % We might end up with active _ or - characters in the argument if
2253 % we're called from @code, as @code{@value{foo-bar_}}. So \let any
2254 % such active characters to their normal equivalents.
2255 \gdef\value{\begingroup
2256 \catcode`\-=
12 \catcode`
\_=
12
2257 \indexbreaks \let_\normalunderscore
2260 \def\valuexxx#1{\expandablevalue{#1}\endgroup}
2262 % We have this subroutine so that we can handle at least some @value's
2263 % properly in indexes (we \let\value to this in \indexdummies). Ones
2264 % whose names contain - or _ still won't work, but we can't do anything
2265 % about that. The command has to be fully expandable, since the result
2266 % winds up in the index file. This means that if the variable's value
2267 % contains other Texinfo commands, it's almost certain it will fail
2268 % (although perhaps we could fix that with sufficient work to do a
2269 % one-level expansion on the result, instead of complete).
2271 \def\expandablevalue#1{%
2272 \expandafter\ifx\csname SET
#1\endcsname\relax
2273 {[No value for ``
#1''
]}%
2275 \csname SET
#1\endcsname
2279 % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
2282 \def\ifset{\parsearg\ifsetxxx}
2284 \expandafter\ifx\csname SET
#1\endcsname\relax
2285 \expandafter\ifsetfail
2287 \expandafter\ifsetsucceed
2290 \def\ifsetsucceed{\conditionalsucceed{ifset
}}
2291 \def\ifsetfail{\nestedignore{ifset
}}
2292 \defineunmatchedend{ifset
}
2294 % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
2295 % defined with @set, or has been undefined with @clear.
2297 \def\ifclear{\parsearg\ifclearxxx}
2298 \def\ifclearxxx #1{%
2299 \expandafter\ifx\csname SET
#1\endcsname\relax
2300 \expandafter\ifclearsucceed
2302 \expandafter\ifclearfail
2305 \def\ifclearsucceed{\conditionalsucceed{ifclear
}}
2306 \def\ifclearfail{\nestedignore{ifclear
}}
2307 \defineunmatchedend{ifclear
}
2309 % @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text
2310 % following, through the first @end iftex (etc.). Make `@end iftex'
2311 % (etc.) valid only after an @iftex.
2313 \def\iftex{\conditionalsucceed{iftex
}}
2314 \def\ifnothtml{\conditionalsucceed{ifnothtml
}}
2315 \def\ifnotinfo{\conditionalsucceed{ifnotinfo
}}
2316 \defineunmatchedend{iftex
}
2317 \defineunmatchedend{ifnothtml
}
2318 \defineunmatchedend{ifnotinfo
}
2320 % We can't just want to start a group at @iftex (for example) and end it
2321 % at @end iftex, since then @set commands inside the conditional have no
2322 % effect (they'd get reverted at the end of the group). So we must
2323 % define \Eiftex to redefine itself to be its previous value. (We can't
2324 % just define it to fail again with an ``unmatched end'' error, since
2325 % the @ifset might be nested.)
2327 \def\conditionalsucceed#1{%
2329 % Remember the current value of \E#1.
2330 \let\nece{prevE
#1} =
\nece{E
#1}%
2332 % At the `@end #1', redefine \E#1 to be its previous value.
2333 \def\nece{E
#1}{\let\nece{E
#1} =
\nece{prevE
#1}}%
2338 % We need to expand lots of \csname's, but we don't want to expand the
2339 % control sequences after we've constructed them.
2341 \def\nece#1{\expandafter\noexpand\csname#1\endcsname}
2343 % @defininfoenclose.
2344 \let\definfoenclose=
\comment
2348 % Index generation facilities
2350 % Define \newwrite to be identical to plain tex's \newwrite
2351 % except not \outer, so it can be used within \newindex.
2353 \gdef\newwrite{\alloc@
7\write\chardef\sixt@@n
}}
2355 % \newindex {foo} defines an index named foo.
2356 % It automatically defines \fooindex such that
2357 % \fooindex ...rest of line... puts an entry in the index foo.
2358 % It also defines \fooindfile to be the number of the output channel for
2359 % the file that accumulates this index. The file's extension is foo.
2360 % The name of an index should be no more than 2 characters long
2361 % for the sake of vms.
2365 \expandafter\newwrite \csname#1indfile
\endcsname
2366 \openout \csname#1indfile
\endcsname \jobname.
#1 % Open the file
2368 \expandafter\xdef\csname#1index
\endcsname{% % Define @#1index
2369 \noexpand\doindex{#1}}
2372 % @defindex foo == \newindex{foo}
2374 \def\defindex{\parsearg\newindex}
2376 % Define @defcodeindex, like @defindex except put all entries in @code.
2378 \def\newcodeindex#1{%
2380 \expandafter\newwrite \csname#1indfile
\endcsname
2381 \openout \csname#1indfile
\endcsname \jobname.
#1
2383 \expandafter\xdef\csname#1index
\endcsname{%
2384 \noexpand\docodeindex{#1}}
2387 \def\defcodeindex{\parsearg\newcodeindex}
2389 % @synindex foo bar makes index foo feed into index bar.
2390 % Do this instead of @defindex foo if you don't want it as a separate index.
2391 % The \closeout helps reduce unnecessary open files; the limit on the
2392 % Acorn RISC OS is a mere 16 files.
2393 \def\synindex#1 #2 {%
2394 \expandafter\let\expandafter\synindexfoo\expandafter=
\csname#2indfile
\endcsname
2395 \expandafter\closeout\csname#1indfile
\endcsname
2396 \expandafter\let\csname#1indfile
\endcsname=
\synindexfoo
2397 \expandafter\xdef\csname#1index
\endcsname{% define \xxxindex
2398 \noexpand\doindex{#2}}%
2401 % @syncodeindex foo bar similar, but put all entries made for index foo
2403 \def\syncodeindex#1 #2 {%
2404 \expandafter\let\expandafter\synindexfoo\expandafter=
\csname#2indfile
\endcsname
2405 \expandafter\closeout\csname#1indfile
\endcsname
2406 \expandafter\let\csname#1indfile
\endcsname=
\synindexfoo
2407 \expandafter\xdef\csname#1index
\endcsname{% define \xxxindex
2408 \noexpand\docodeindex{#2}}%
2411 % Define \doindex, the driver for all \fooindex macros.
2412 % Argument #1 is generated by the calling \fooindex macro,
2413 % and it is "foo", the name of the index.
2415 % \doindex just uses \parsearg; it calls \doind for the actual work.
2416 % This is because \doind is more useful to call from other macros.
2418 % There is also \dosubind {index}{topic}{subtopic}
2419 % which makes an entry in a two-level index such as the operation index.
2421 \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
2422 \def\singleindexer #1{\doind{\indexname}{#1}}
2424 % like the previous two, but they put @code around the argument.
2425 \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
2426 \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
2430 % Take care of the plain tex accent commands.
2431 \def\"
{\realbackslash "
}%
2432 \def\`
{\realbackslash `
}%
2433 \def\'
{\realbackslash '
}%
2434 \def\^
{\realbackslash ^
}%
2435 \def\~
{\realbackslash ~
}%
2436 \def\=
{\realbackslash =
}%
2437 \def\b{\realbackslash b
}%
2438 \def\c{\realbackslash c
}%
2439 \def\d{\realbackslash d
}%
2440 \def\u{\realbackslash u
}%
2441 \def\v{\realbackslash v
}%
2442 \def\H{\realbackslash H
}%
2443 % Take care of the plain tex special European modified letters.
2444 \def\oe{\realbackslash oe
}%
2445 \def\ae{\realbackslash ae
}%
2446 \def\aa{\realbackslash aa
}%
2447 \def\OE{\realbackslash OE
}%
2448 \def\AE{\realbackslash AE
}%
2449 \def\AA{\realbackslash AA
}%
2450 \def\o{\realbackslash o
}%
2451 \def\O{\realbackslash O
}%
2452 \def\l{\realbackslash l
}%
2453 \def\L{\realbackslash L
}%
2454 \def\ss{\realbackslash ss
}%
2455 % Take care of texinfo commands likely to appear in an index entry.
2456 % (Must be a way to avoid doing expansion at all, and thus not have to
2457 % laboriously list every single command here.)
2458 \def\@
{@
}% will be @@ when we switch to @ as escape char.
2459 % Need these in case \tex is in effect and \{ is a \delimiter again.
2460 % But can't use \lbracecmd and \rbracecmd because texindex assumes
2461 % braces and backslashes are used only as delimiters.
2464 \def\_{{\realbackslash _
}}%
2465 \def\w{\realbackslash w
}%
2466 \def\bf{\realbackslash bf
}%
2467 %\def\rm{\realbackslash rm }%
2468 \def\sl{\realbackslash sl
}%
2469 \def\sf{\realbackslash sf
}%
2470 \def\tt{\realbackslash tt
}%
2471 \def\gtr{\realbackslash gtr
}%
2472 \def\less{\realbackslash less
}%
2473 \def\hat{\realbackslash hat
}%
2474 \def\TeX{\realbackslash TeX
}%
2475 \def\dots{\realbackslash dots
}%
2476 \def\result{\realbackslash result
}%
2477 \def\equiv{\realbackslash equiv
}%
2478 \def\expansion{\realbackslash expansion
}%
2479 \def\print{\realbackslash print
}%
2480 \def\error{\realbackslash error
}%
2481 \def\point{\realbackslash point
}%
2482 \def\copyright{\realbackslash copyright
}%
2483 \def\tclose#
#1{\realbackslash tclose
{#
#1}}%
2484 \def\code#
#1{\realbackslash code
{#
#1}}%
2485 \def\uref#
#1{\realbackslash uref
{#
#1}}%
2486 \def\url#
#1{\realbackslash url
{#
#1}}%
2487 \def\env#
#1{\realbackslash env
{#
#1}}%
2488 \def\command#
#1{\realbackslash command
{#
#1}}%
2489 \def\option#
#1{\realbackslash option
{#
#1}}%
2490 \def\dotless#
#1{\realbackslash dotless
{#
#1}}%
2491 \def\samp#
#1{\realbackslash samp
{#
#1}}%
2492 \def\,#
#1{\realbackslash ,
{#
#1}}%
2493 \def\t#
#1{\realbackslash t
{#
#1}}%
2494 \def\r#
#1{\realbackslash r
{#
#1}}%
2495 \def\i#
#1{\realbackslash i
{#
#1}}%
2496 \def\b#
#1{\realbackslash b
{#
#1}}%
2497 \def\sc#
#1{\realbackslash sc
{#
#1}}%
2498 \def\cite#
#1{\realbackslash cite
{#
#1}}%
2499 \def\key#
#1{\realbackslash key
{#
#1}}%
2500 \def\file#
#1{\realbackslash file
{#
#1}}%
2501 \def\var#
#1{\realbackslash var
{#
#1}}%
2502 \def\kbd#
#1{\realbackslash kbd
{#
#1}}%
2503 \def\dfn#
#1{\realbackslash dfn
{#
#1}}%
2504 \def\emph#
#1{\realbackslash emph
{#
#1}}%
2505 \def\acronym#
#1{\realbackslash acronym
{#
#1}}%
2507 % Handle some cases of @value -- where the variable name does not
2508 % contain - or _, and the value does not contain any
2509 % (non-fully-expandable) commands.
2510 \let\value =
\expandablevalue
2513 % Turn off macro expansion
2517 % If an index command is used in an @example environment, any spaces
2518 % therein should become regular spaces in the raw index file, not the
2519 % expansion of \tie (\\leavevmode \penalty \@M \ ).
2521 \gdef\unsepspaces{\obeyspaces\let =
\space}}
2523 % \indexnofonts no-ops all font-change commands.
2524 % This is used when outputting the strings to sort the index by.
2525 \def\indexdummyfont#1{#1}
2526 \def\indexdummytex{TeX
}
2527 \def\indexdummydots{...
}
2530 % Just ignore accents.
2531 \let\,=
\indexdummyfont
2532 \let\"=
\indexdummyfont
2533 \let\`=
\indexdummyfont
2534 \let\'=
\indexdummyfont
2535 \let\^=
\indexdummyfont
2536 \let\~=
\indexdummyfont
2537 \let\==
\indexdummyfont
2538 \let\b=
\indexdummyfont
2539 \let\c=
\indexdummyfont
2540 \let\d=
\indexdummyfont
2541 \let\u=
\indexdummyfont
2542 \let\v=
\indexdummyfont
2543 \let\H=
\indexdummyfont
2544 \let\dotless=
\indexdummyfont
2545 % Take care of the plain tex special European modified letters.
2557 \let\w=
\indexdummyfont
2558 \let\t=
\indexdummyfont
2559 \let\r=
\indexdummyfont
2560 \let\i=
\indexdummyfont
2561 \let\b=
\indexdummyfont
2562 \let\emph=
\indexdummyfont
2563 \let\strong=
\indexdummyfont
2564 \let\cite=
\indexdummyfont
2565 \let\sc=
\indexdummyfont
2566 %Don't no-op \tt, since it isn't a user-level command
2567 % and is used in the definitions of the active chars like <, >, |...
2568 %\let\tt=\indexdummyfont
2569 \let\tclose=
\indexdummyfont
2570 \let\code=
\indexdummyfont
2571 \let\url=
\indexdummyfont
2572 \let\uref=
\indexdummyfont
2573 \let\env=
\indexdummyfont
2574 \let\command=
\indexdummyfont
2575 \let\option=
\indexdummyfont
2576 \let\file=
\indexdummyfont
2577 \let\samp=
\indexdummyfont
2578 \let\kbd=
\indexdummyfont
2579 \let\key=
\indexdummyfont
2580 \let\var=
\indexdummyfont
2581 \let\TeX=
\indexdummytex
2582 \let\dots=
\indexdummydots
2586 % To define \realbackslash, we must make \ not be an escape.
2587 % We must first make another character (@) an escape
2588 % so we do not become unable to do a definition.
2590 {\catcode`\@=
0 \catcode`\\=
\other
2591 @gdef@realbackslash
{\
}}
2593 \let\indexbackslash=
0 %overridden during \printindex.
2594 \let\SETmarginindex=
\relax % put index entries in margin (undocumented)?
2596 % For \ifx comparisons.
2597 \def\emptymacro{\empty}
2599 % Most index entries go through here, but \dosubind is the general case.
2601 \def\doind#1#2{\dosubind{#1}{#2}\empty}
2603 % Workhorse for all \fooindexes.
2604 % #1 is name of index, #2 is stuff to put there, #3 is subentry --
2605 % \empty if called from \doind, as we usually are. The main exception
2606 % is with defuns, which call us directly.
2608 \def\dosubind#1#2#3{%
2609 % Put the index entry in the margin if desired.
2610 \ifx\SETmarginindex\relax\else
2611 \insert\margin{\hbox{\vrule height8pt depth3pt width0pt
#2}}%
2614 \count255=
\lastpenalty
2616 \indexdummies % Must do this here, since \bf, etc expand at this stage
2619 \let\folio =
0% We will expand all macros now EXCEPT \folio.
2620 \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
2621 % so it will be output as is; and it will print as backslash.
2625 % If third arg is present, precede it with space in sort key.
2626 \ifx\thirdarg\emptymacro
2627 \let\subentry =
\empty
2632 % First process the index entry with all font commands turned
2633 % off to get the string to sort by.
2634 {\indexnofonts \xdef\indexsorttmp{#2\subentry}}%
2636 % Now the real index entry with the fonts.
2639 % If third (subentry) arg is present, add it to the index
2640 % string. And include a space.
2641 \ifx\thirdarg\emptymacro \else
2642 \toks0 =
\expandafter{\the\toks0 \space #3}%
2645 % Set up the complete index entry, with both the sort key
2646 % and the original text, including any font commands. We write
2647 % three arguments to \entry to the .?? file, texindex reduces to
2648 % two when writing the .??s sorted result.
2650 \write\csname#1indfile
\endcsname{%
2651 \realbackslash entry
{\indexsorttmp}{\folio}{\the\toks0}}%
2654 % If a skip is the last thing on the list now, preserve it
2655 % by backing up by \lastskip, doing the \write, then inserting
2656 % the skip again. Otherwise, the whatsit generated by the
2657 % \write will make \lastskip zero. The result is that sequences
2662 % will have extra space inserted, because the \medbreak in the
2663 % start of the @defun won't see the skip inserted by the @end of
2664 % the previous defun.
2666 % But don't do any of this if we're not in vertical mode. We
2667 % don't want to do a \vskip and prematurely end a paragraph.
2669 % Avoid page breaks due to these extra skips, too.
2674 \ifdim\lastskip =
0pt
\else \nobreak\vskip-
\lastskip \fi
2677 \temp % do the write
2680 \ifvmode \ifdim\skip0 =
0pt
\else \nobreak\vskip\skip0 \fi \fi
2688 % The index entry written in the file actually looks like
2689 % \entry {sortstring}{page}{topic}
2691 % \entry {sortstring}{page}{topic}{subtopic}
2692 % The texindex program reads in these files and writes files
2693 % containing these kinds of lines:
2695 % before the first topic whose initial is c
2696 % \entry {topic}{pagelist}
2697 % for a topic that is used without subtopics
2699 % for the beginning of a topic that is used with subtopics
2700 % \secondary {subtopic}{pagelist}
2701 % for each subtopic.
2703 % Define the user-accessible indexing commands
2704 % @findex, @vindex, @kindex, @cindex.
2706 \def\findex {\fnindex}
2707 \def\kindex {\kyindex}
2708 \def\cindex {\cpindex}
2709 \def\vindex {\vrindex}
2710 \def\tindex {\tpindex}
2711 \def\pindex {\pgindex}
2713 \def\cindexsub {\begingroup\obeylines\cindexsub}
2715 \gdef\cindexsub "
#1"
#2^^M
{\endgroup %
2716 \dosubind{cp
}{#2}{#1}}}
2718 % Define the macros used in formatting output of the sorted index material.
2720 % @printindex causes a particular index (the ??s file) to get printed.
2721 % It does not print any chapter heading (usually an @unnumbered).
2723 \def\printindex{\parsearg\doprintindex}
2724 \def\doprintindex#1{\begingroup
2725 \dobreak \chapheadingskip{10000}%
2731 % See if the index file exists and is nonempty.
2732 % Change catcode of @ here so that if the index file contains
2734 % as its first line, TeX doesn't complain about mismatched braces
2735 % (because it thinks @} is a control sequence).
2737 \openin 1 \jobname.
#1s
2739 % \enddoublecolumns gets confused if there is no text in the index,
2740 % and it loses the chapter title and the aux file entries for the
2741 % index. The easiest way to prevent this problem is to make sure
2742 % there is some text.
2743 \putwordIndexNonexistent
2746 % If the index file exists but is empty, then \openin leaves \ifeof
2747 % false. We have to make TeX try to read something from the file, so
2748 % it can discover if there is anything in it.
2751 \putwordIndexIsEmpty
2753 % Index files are almost Texinfo source, but we use \ as the escape
2754 % character. It would be better to use @, but that's too big a change
2755 % to make right now.
2756 \def\indexbackslash{\rawbackslashxx}%
2767 % These macros are used by the sorted index file itself.
2768 % Change them to control the appearance of the index.
2771 % Some minor font changes for the special characters.
2772 \let\tentt=
\sectt \let\tt=
\sectt \let\sf=
\sectt
2774 % Remove any glue we may have, we'll be inserting our own.
2777 % We like breaks before the index initials, so insert a bonus.
2780 % Typeset the initial. Making this add up to a whole number of
2781 % baselineskips increases the chance of the dots lining up from column
2782 % to column. It still won't often be perfect, because of the stretch
2783 % we need before each entry, but it's better.
2785 % No shrink because it confuses \balancecolumns.
2786 \vskip 1.67\baselineskip plus
.5\baselineskip
2787 \leftline{\secbf #1}%
2788 \vskip .33\baselineskip plus
.1\baselineskip
2790 % Do our best not to break after the initial.
2794 % This typesets a paragraph consisting of #1, dot leaders, and then #2
2795 % flush to the right margin. It is used for index and table of contents
2796 % entries. The paragraph is indented by \leftskip.
2798 \def\entry#1#2{\begingroup
2800 % Start a new paragraph if necessary, so our assignments below can't
2801 % affect previous text.
2804 % Do not fill out the last line with white space.
2807 % No extra space above this paragraph.
2810 % Do not prefer a separate line ending with a hyphen to fewer lines.
2811 \finalhyphendemerits =
0
2813 % \hangindent is only relevant when the entry text and page number
2814 % don't both fit on one line. In that case, bob suggests starting the
2815 % dots pretty far over on the line. Unfortunately, a large
2816 % indentation looks wrong when the entry text itself is broken across
2817 % lines. So we use a small indentation and put up with long leaders.
2819 % \hangafter is reset to 1 (which is the value we want) at the start
2820 % of each paragraph, so we need not do anything with that.
2823 % When the entry text needs to be broken, just fill out the first line
2825 \rightskip =
0pt plus1fil
2827 % A bit of stretch before each entry for the benefit of balancing columns.
2830 % Start a ``paragraph'' for the index entry so the line breaking
2831 % parameters we've set above will have an effect.
2834 % Insert the text of the index entry. TeX will do line-breaking on it.
2836 % The following is kludged to not output a line of dots in the index if
2837 % there are no page numbers. The next person who breaks this will be
2838 % cursed by a Unix daemon.
2841 \edef\tempc{\tempa}%
2842 \edef\tempd{\tempb}%
2843 \ifx\tempc\tempd\
\else%
2845 % If we must, put the page number on a line of its own, and fill out
2846 % this line with blank space. (The \hfil is overwhelmed with the
2847 % fill leaders glue in \indexdotfill if the page number does fit.)
2849 \null\nobreak\indexdotfill % Have leaders before the page number.
2851 % The `\ ' here is removed by the implicit \unskip that TeX does as
2852 % part of (the primitive) \par. Without it, a spurious underfull
2854 \
#2% The page number ends the paragraph.
2859 % Like \dotfill except takes at least 1 em.
2860 \def\indexdotfill{\cleaders
2861 \hbox{$
\mathsurround=
0pt
\mkern1.5mu $
{\it .
}$
\mkern1.5mu$
}\hskip 1em plus
1fill
}
2863 \def\primary #1{\line{#1\hfil}}
2865 \newskip\secondaryindent \secondaryindent=
0.5cm
2867 \def\secondary #1#2{
2868 {\parfillskip=
0in
\parskip=
0in
2869 \hangindent =
1in
\hangafter=
1
2870 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par
2873 % Define two-column mode, which we use to typeset indexes.
2874 % Adapted from the TeXbook, page 416, which is to say,
2875 % the manmac.tex format used to print the TeXbook itself.
2879 \newdimen\doublecolumnhsize
2881 \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
2882 % Grab any single-column material above us.
2885 % Here is a possibility not foreseen in manmac: if we accumulate a
2886 % whole lot of material, we might end up calling this \output
2887 % routine twice in a row (see the doublecol-lose test, which is
2888 % essentially a couple of indexes with @setchapternewpage off). In
2889 % that case we just ship out what is in \partialpage with the normal
2890 % output routine. Generally, \partialpage will be empty when this
2891 % runs and this will be a no-op. See the indexspread.tex test case.
2892 \ifvoid\partialpage \else
2893 \onepageout{\pagecontents\partialpage}%
2896 \global\setbox\partialpage =
\vbox{%
2897 % Unvbox the main output page.
2899 \kern-
\topskip \kern\baselineskip
2902 \eject % run that output routine to set \partialpage
2904 % Use the double-column output routine for subsequent pages.
2905 \output =
{\doublecolumnout}%
2907 % Change the page size parameters. We could do this once outside this
2908 % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
2909 % format, but then we repeat the same computation. Repeating a couple
2910 % of assignments once per index is clearly meaningless for the
2911 % execution time, so we may as well do it in one place.
2913 % First we halve the line length, less a little for the gutter between
2914 % the columns. We compute the gutter based on the line length, so it
2915 % changes automatically with the paper format. The magic constant
2916 % below is chosen so that the gutter has the same value (well, +-<1pt)
2917 % as it did when we hard-coded it.
2919 % We put the result in a separate register, \doublecolumhsize, so we
2920 % can restore it in \pagesofar, after \hsize itself has (potentially)
2923 \doublecolumnhsize =
\hsize
2924 \advance\doublecolumnhsize by -
.04154\hsize
2925 \divide\doublecolumnhsize by
2
2926 \hsize =
\doublecolumnhsize
2928 % Double the \vsize as well. (We don't need a separate register here,
2929 % since nobody clobbers \vsize.)
2930 \advance\vsize by -
\ht\partialpage
2934 % The double-column output routine for all double-column pages except
2937 \def\doublecolumnout{%
2938 \splittopskip=
\topskip \splitmaxdepth=
\maxdepth
2939 % Get the available space for the double columns -- the normal
2940 % (undoubled) page height minus any material left over from the
2945 % box0 will be the left-hand column, box2 the right.
2946 \setbox0=
\vsplit255 to
\dimen@
\setbox2=
\vsplit255 to
\dimen@
2947 \onepageout\pagesofar
2949 \penalty\outputpenalty
2952 % Re-output the contents of the output page -- any previous material,
2953 % followed by the two boxes we just split, in box0 and box2.
2956 \hsize =
\doublecolumnhsize
2957 \wd0=
\hsize \wd2=
\hsize
2958 \hbox to
\pagewidth{\box0\hfil\box2}%
2960 \def\enddoublecolumns{%
2962 % Split the last of the double-column material. Leave it on the
2963 % current page, no automatic page break.
2966 % If we end up splitting too much material for the current page,
2967 % though, there will be another page break right after this \output
2968 % invocation ends. Having called \balancecolumns once, we do not
2969 % want to call it again. Therefore, reset \output to its normal
2970 % definition right away. (We hope \balancecolumns will never be
2971 % called on to balance too much material, but if it is, this makes
2972 % the output somewhat more palatable.)
2973 \global\output =
{\onepageout{\pagecontents\PAGE}}%
2976 \endgroup % started in \begindoublecolumns
2978 % \pagegoal was set to the doubled \vsize above, since we restarted
2979 % the current page. We're now back to normal single-column
2980 % typesetting, so reset \pagegoal to the normal \vsize (after the
2981 % \endgroup where \vsize got restored).
2984 \def\balancecolumns{%
2985 % Called at the end of the double column material.
2986 \setbox0 =
\vbox{\unvbox255}% like \box255 but more efficient, see p.120.
2988 \advance\dimen@ by
\topskip
2989 \advance\dimen@ by-
\baselineskip
2990 \divide\dimen@ by
2 % target to split to
2991 %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
2992 \splittopskip =
\topskip
2993 % Loop until we get a decent breakpoint.
2997 \global\setbox3 =
\copy0
2998 \global\setbox1 =
\vsplit3 to
\dimen@
3000 \global\advance\dimen@ by
1pt
3003 %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
3004 \setbox0=
\vbox to
\dimen@
{\unvbox1}%
3005 \setbox2=
\vbox to
\dimen@
{\unvbox3}%
3009 \catcode`\@ =
\other
3012 \message{sectioning,
}
3013 % Define chapters, sections, etc.
3016 \newcount\secno \secno=
0
3017 \newcount\subsecno \subsecno=
0
3018 \newcount\subsubsecno \subsubsecno=
0
3020 % This counter is funny since it counts through charcodes of letters A, B, ...
3021 \newcount\appendixno \appendixno = `\@
3022 \def\appendixletter{\char\the\appendixno}
3024 % Each @chapter defines this as the name of the chapter.
3025 % page headings and footings can use it. @section does likewise.
3029 \newcount\absseclevel % used to calculate proper heading level
3030 \newcount\secbase\secbase=
0 % @raise/lowersections modify this count
3032 % @raisesections: treat @section as chapter, @subsection as section, etc.
3033 \def\raisesections{\global\advance\secbase by -
1}
3034 \let\up=
\raisesections % original BFox name
3036 % @lowersections: treat @chapter as section, @section as subsection, etc.
3037 \def\lowersections{\global\advance\secbase by
1}
3038 \let\down=
\lowersections % original BFox name
3040 % Choose a numbered-heading macro
3041 % #1 is heading level if unmodified by @raisesections or @lowersections
3042 % #2 is text for heading
3043 \def\numhead#1#2{\absseclevel=
\secbase\advance\absseclevel by
#1
3049 \numberedsubseczzz{#2}
3051 \numberedsubsubseczzz{#2}
3053 \ifnum \absseclevel<
0
3056 \numberedsubsubseczzz{#2}
3061 % like \numhead, but chooses appendix heading levels
3062 \def\apphead#1#2{\absseclevel=
\secbase\advance\absseclevel by
#1
3066 \appendixsectionzzz{#2}
3068 \appendixsubseczzz{#2}
3070 \appendixsubsubseczzz{#2}
3072 \ifnum \absseclevel<
0
3075 \appendixsubsubseczzz{#2}
3080 % like \numhead, but chooses numberless heading levels
3081 \def\unnmhead#1#2{\absseclevel=
\secbase\advance\absseclevel by
#1
3085 \unnumberedseczzz{#2}
3087 \unnumberedsubseczzz{#2}
3089 \unnumberedsubsubseczzz{#2}
3091 \ifnum \absseclevel<
0
3094 \unnumberedsubsubseczzz{#2}
3099 % @chapter, @appendix, @unnumbered.
3100 \def\thischaptername{No Chapter Title
}
3101 \outer\def\chapter{\parsearg\chapteryyy}
3102 \def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz
3103 \def\chapterzzz #1{%
3104 \secno=
0 \subsecno=
0 \subsubsecno=
0
3105 \global\advance \chapno by
1 \message{\putwordChapter\space \the\chapno}%
3106 \chapmacro {#1}{\the\chapno}%
3107 \gdef\thissection{#1}%
3108 \gdef\thischaptername{#1}%
3109 % We don't substitute the actual chapter name into \thischapter
3110 % because we don't want its macros evaluated now.
3111 \xdef\thischapter{\putwordChapter{} \the\chapno:
\noexpand\thischaptername}%
3113 \edef\temp{\noexpand\writetocentry{\realbackslash chapentry
{\the\toks0}%
3117 \global\let\section =
\numberedsec
3118 \global\let\subsection =
\numberedsubsec
3119 \global\let\subsubsection =
\numberedsubsubsec
3122 \outer\def\appendix{\parsearg\appendixyyy}
3123 \def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz
3124 \def\appendixzzz #1{%
3125 \secno=
0 \subsecno=
0 \subsubsecno=
0
3126 \global\advance \appendixno by
1
3127 \message{\putwordAppendix\space \appendixletter}%
3128 \chapmacro {#1}{\putwordAppendix{} \appendixletter}%
3129 \gdef\thissection{#1}%
3130 \gdef\thischaptername{#1}%
3131 \xdef\thischapter{\putwordAppendix{} \appendixletter:
\noexpand\thischaptername}%
3133 \edef\temp{\noexpand\writetocentry{\realbackslash chapentry
{\the\toks0}%
3134 {\putwordAppendix{} \appendixletter}}}%
3137 \global\let\section =
\appendixsec
3138 \global\let\subsection =
\appendixsubsec
3139 \global\let\subsubsection =
\appendixsubsubsec
3142 % @centerchap is like @unnumbered, but the heading is centered.
3143 \outer\def\centerchap{\parsearg\centerchapyyy}
3144 \def\centerchapyyy #1{{\let\unnumbchapmacro=
\centerchapmacro \unnumberedyyy{#1}}}
3146 % @top is like @unnumbered.
3147 \outer\def\top{\parsearg\unnumberedyyy}
3149 \outer\def\unnumbered{\parsearg\unnumberedyyy}
3150 \def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
3151 \def\unnumberedzzz #1{%
3152 \secno=
0 \subsecno=
0 \subsubsecno=
0
3154 % This used to be simply \message{#1}, but TeX fully expands the
3155 % argument to \message. Therefore, if #1 contained @-commands, TeX
3156 % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
3157 % expanded @cite (which turns out to cause errors because \cite is meant
3158 % to be executed, not expanded).
3160 % Anyway, we don't want the fully-expanded definition of @cite to appear
3161 % as a result of the \message, we just want `@cite' itself. We use
3162 % \the<toks register> to achieve this: TeX expands \the<toks> only once,
3163 % simply yielding the contents of <toks register>. (We also do this for
3165 \toks0 =
{#1}\message{(
\the\toks0)
}%
3167 \unnumbchapmacro {#1}%
3168 \gdef\thischapter{#1}\gdef\thissection{#1}%
3170 \edef\temp{\noexpand\writetocentry{\realbackslash unnumbchapentry
{\the\toks0}}}%
3173 \global\let\section =
\unnumberedsec
3174 \global\let\subsection =
\unnumberedsubsec
3175 \global\let\subsubsection =
\unnumberedsubsubsec
3179 \outer\def\numberedsec{\parsearg\secyyy}
3180 \def\secyyy #1{\numhead1{#1}} % normally calls seczzz
3182 \subsecno=
0 \subsubsecno=
0 \global\advance \secno by
1 %
3183 \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
3185 \edef\temp{\noexpand\writetocentry{\realbackslash secentry
{\the\toks0}%
3186 {\the\chapno}{\the\secno}}}%
3192 \outer\def\appendixsection{\parsearg\appendixsecyyy}
3193 \outer\def\appendixsec{\parsearg\appendixsecyyy}
3194 \def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz
3195 \def\appendixsectionzzz #1{%
3196 \subsecno=
0 \subsubsecno=
0 \global\advance \secno by
1 %
3197 \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
3199 \edef\temp{\noexpand\writetocentry{\realbackslash secentry
{\the\toks0}%
3200 {\appendixletter}{\the\secno}}}%
3206 \outer\def\unnumberedsec{\parsearg\unnumberedsecyyy}
3207 \def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz
3208 \def\unnumberedseczzz #1{%
3209 \plainsecheading {#1}\gdef\thissection{#1}%
3211 \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry
{\the\toks0}}}%
3218 \outer\def\numberedsubsec{\parsearg\numberedsubsecyyy}
3219 \def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz
3220 \def\numberedsubseczzz #1{%
3221 \gdef\thissection{#1}\subsubsecno=
0 \global\advance \subsecno by
1 %
3222 \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
3224 \edef\temp{\noexpand\writetocentry{\realbackslash subsecentry
{\the\toks0}%
3225 {\the\chapno}{\the\secno}{\the\subsecno}}}%
3231 \outer\def\appendixsubsec{\parsearg\appendixsubsecyyy}
3232 \def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz
3233 \def\appendixsubseczzz #1{%
3234 \gdef\thissection{#1}\subsubsecno=
0 \global\advance \subsecno by
1 %
3235 \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
3237 \edef\temp{\noexpand\writetocentry{\realbackslash subsecentry
{\the\toks0}%
3238 {\appendixletter}{\the\secno}{\the\subsecno}}}%
3244 \outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy}
3245 \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
3246 \def\unnumberedsubseczzz #1{%
3247 \plainsubsecheading {#1}\gdef\thissection{#1}%
3249 \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry
%
3257 \outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy}
3258 \def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz
3259 \def\numberedsubsubseczzz #1{%
3260 \gdef\thissection{#1}\global\advance \subsubsecno by
1 %
3261 \subsubsecheading {#1}
3262 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
3264 \edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry
{\the\toks0}%
3265 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
3271 \outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy}
3272 \def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz
3273 \def\appendixsubsubseczzz #1{%
3274 \gdef\thissection{#1}\global\advance \subsubsecno by
1 %
3275 \subsubsecheading {#1}
3276 {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
3278 \edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry
{\the\toks0}%
3279 {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
3285 \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy}
3286 \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
3287 \def\unnumberedsubsubseczzz #1{%
3288 \plainsubsubsecheading {#1}\gdef\thissection{#1}%
3290 \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry
%
3297 % These are variants which are not "outer", so they can appear in @ifinfo.
3298 % Actually, they should now be obsolete; ordinary section commands should work.
3299 \def\infotop{\parsearg\unnumberedzzz}
3300 \def\infounnumbered{\parsearg\unnumberedzzz}
3301 \def\infounnumberedsec{\parsearg\unnumberedseczzz}
3302 \def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz}
3303 \def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
3305 \def\infoappendix{\parsearg\appendixzzz}
3306 \def\infoappendixsec{\parsearg\appendixseczzz}
3307 \def\infoappendixsubsec{\parsearg\appendixsubseczzz}
3308 \def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz}
3310 \def\infochapter{\parsearg\chapterzzz}
3311 \def\infosection{\parsearg\sectionzzz}
3312 \def\infosubsection{\parsearg\subsectionzzz}
3313 \def\infosubsubsection{\parsearg\subsubsectionzzz}
3315 % These macros control what the section commands do, according
3316 % to what kind of chapter we are in (ordinary, appendix, or unnumbered).
3317 % Define them by default for a numbered chapter.
3318 \global\let\section =
\numberedsec
3319 \global\let\subsection =
\numberedsubsec
3320 \global\let\subsubsection =
\numberedsubsubsec
3322 % Define @majorheading, @heading and @subheading
3324 % NOTE on use of \vbox for chapter headings, section headings, and such:
3325 % 1) We use \vbox rather than the earlier \line to permit
3326 % overlong headings to fold.
3327 % 2) \hyphenpenalty is set to 10000 because hyphenation in a
3328 % heading is obnoxious; this forbids it.
3329 % 3) Likewise, headings look best if no \parindent is used, and
3330 % if justification is not attempted. Hence \raggedright.
3333 \def\majorheading{\parsearg\majorheadingzzz}
3334 \def\majorheadingzzz #1{%
3335 {\advance\chapheadingskip by
10pt
\chapbreak }%
3336 {\chapfonts \vbox{\hyphenpenalty=
10000\tolerance=
5000
3337 \parindent=
0pt
\raggedright
3338 \rm #1\hfill}}\bigskip \par\penalty 200}
3340 \def\chapheading{\parsearg\chapheadingzzz}
3341 \def\chapheadingzzz #1{\chapbreak %
3342 {\chapfonts \vbox{\hyphenpenalty=
10000\tolerance=
5000
3343 \parindent=
0pt
\raggedright
3344 \rm #1\hfill}}\bigskip \par\penalty 200}
3346 % @heading, @subheading, @subsubheading.
3347 \def\heading{\parsearg\plainsecheading}
3348 \def\subheading{\parsearg\plainsubsecheading}
3349 \def\subsubheading{\parsearg\plainsubsubsecheading}
3351 % These macros generate a chapter, section, etc. heading only
3352 % (including whitespace, linebreaking, etc. around it),
3353 % given all the information in convenient, parsed form.
3355 %%% Args are the skip and penalty (usually negative)
3356 \def\dobreak#1#2{\par\ifdim\lastskip<
#1\removelastskip\penalty#2\vskip#1\fi}
3358 \def\setchapterstyle #1 {\csname CHAPF
#1\endcsname}
3360 %%% Define plain chapter starts, and page on/off switching for it
3361 % Parameter controlling skip before chapter headings (if needed)
3363 \newskip\chapheadingskip
3365 \def\chapbreak{\dobreak \chapheadingskip {-
4000}}
3366 \def\chappager{\par\vfill\supereject}
3367 \def\chapoddpage{\chappager \ifodd\pageno \else \hbox to
0pt
{} \chappager\fi}
3369 \def\setchapternewpage #1 {\csname CHAPPAG
#1\endcsname}
3372 \global\let\contentsalignmacro =
\chappager
3373 \global\let\pchapsepmacro=
\chapbreak
3374 \global\let\pagealignmacro=
\chappager}
3377 \global\let\contentsalignmacro =
\chappager
3378 \global\let\pchapsepmacro=
\chappager
3379 \global\let\pagealignmacro=
\chappager
3380 \global\def\HEADINGSon{\HEADINGSsingle}}
3383 \global\let\contentsalignmacro =
\chapoddpage
3384 \global\let\pchapsepmacro=
\chapoddpage
3385 \global\let\pagealignmacro=
\chapoddpage
3386 \global\def\HEADINGSon{\HEADINGSdouble}}
3391 \global\let\chapmacro=
\chfplain
3392 \global\let\unnumbchapmacro=
\unnchfplain
3393 \global\let\centerchapmacro=
\centerchfplain}
3395 % Plain chapter opening.
3396 % #1 is the text, #2 the chapter number or empty if unnumbered.
3402 \setbox0 =
\hbox{#2\ifx\chapnum\empty\else\enspace\fi}%
3403 \vbox{\hyphenpenalty=
10000 \tolerance=
5000 \parindent=
0pt
\raggedright
3404 \hangindent =
\wd0 \centerparametersmaybe
3407 \nobreak\bigskip % no page break after a chapter title
3411 % Plain opening for unnumbered.
3412 \def\unnchfplain#1{\chfplain{#1}{}}
3414 % @centerchap -- centered and unnumbered.
3415 \let\centerparametersmaybe =
\relax
3416 \def\centerchfplain#1{{%
3417 \def\centerparametersmaybe{%
3418 \advance\rightskip by
3\rightskip
3419 \leftskip =
\rightskip
3425 \CHAPFplain % The default
3427 \def\unnchfopen #1{%
3428 \chapoddpage {\chapfonts \vbox{\hyphenpenalty=
10000\tolerance=
5000
3429 \parindent=
0pt
\raggedright
3430 \rm #1\hfill}}\bigskip \par\nobreak
3433 \def\chfopen #1#2{\chapoddpage {\chapfonts
3434 \vbox to
3in
{\vfil \hbox to
\hsize{\hfil #2} \hbox to
\hsize{\hfil #1} \vfil}}%
3438 \def\centerchfopen #1{%
3439 \chapoddpage {\chapfonts \vbox{\hyphenpenalty=
10000\tolerance=
5000
3441 \hfill {\rm #1}\hfill}}\bigskip \par\nobreak
3445 \global\let\chapmacro=
\chfopen
3446 \global\let\unnumbchapmacro=
\unnchfopen
3447 \global\let\centerchapmacro=
\centerchfopen}
3451 \newskip\secheadingskip
3452 \def\secheadingbreak{\dobreak \secheadingskip {-
1000}}
3453 \def\secheading#1#2#3{\sectionheading{sec
}{#2.
#3}{#1}}
3454 \def\plainsecheading#1{\sectionheading{sec
}{}{#1}}
3456 % Subsection titles.
3457 \newskip \subsecheadingskip
3458 \def\subsecheadingbreak{\dobreak \subsecheadingskip {-
500}}
3459 \def\subsecheading#1#2#3#4{\sectionheading{subsec
}{#2.
#3.
#4}{#1}}
3460 \def\plainsubsecheading#1{\sectionheading{subsec
}{}{#1}}
3462 % Subsubsection titles.
3463 \let\subsubsecheadingskip =
\subsecheadingskip
3464 \let\subsubsecheadingbreak =
\subsecheadingbreak
3465 \def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec
}{#2.
#3.
#4.
#5}{#1}}
3466 \def\plainsubsubsecheading#1{\sectionheading{subsubsec
}{}{#1}}
3469 % Print any size section title.
3471 % #1 is the section type (sec/subsec/subsubsec), #2 is the section
3472 % number (maybe empty), #3 the text.
3473 \def\sectionheading#1#2#3{%
3475 \expandafter\advance\csname #1headingskip
\endcsname by
\parskip
3476 \csname #1headingbreak
\endcsname
3479 % Switch to the right set of fonts.
3480 \csname #1fonts
\endcsname \rm
3482 % Only insert the separating space if we have a section number.
3484 \setbox0 =
\hbox{#2\ifx\secnum\empty\else\enspace\fi}%
3486 \vbox{\hyphenpenalty=
10000 \tolerance=
5000 \parindent=
0pt
\raggedright
3487 \hangindent =
\wd0 % zero if no section number
3490 \ifdim\parskip<
10pt
\nobreak\kern10pt\nobreak\kern-
\parskip\fi \nobreak
3497 % Write an entry to the toc file, opening it if necessary.
3498 % Called from @chapter, etc. We supply {\folio} at the end of the
3499 % argument, which will end up as the last argument to the \...entry macro.
3501 % We open the .toc file here instead of at @setfilename or any other
3502 % given time so that @contents can be put in the document anywhere.
3504 \newif\iftocfileopened
3505 \def\writetocentry#1{%
3506 \iftocfileopened\else
3507 \immediate\openout\tocfile =
\jobname.toc
3508 \global\tocfileopenedtrue
3510 \iflinks \write\tocfile{#1{\folio}}\fi
3513 \newskip\contentsrightmargin \contentsrightmargin=
1in
3514 \newcount\savepageno
3515 \newcount\lastnegativepageno \lastnegativepageno = -
1
3517 % Finish up the main text and prepare to read what we've written
3520 \def\startcontents#1{%
3521 % If @setchapternewpage on, and @headings double, the contents should
3522 % start on an odd page, unlike chapters. Thus, we maintain
3523 % \contentsalignmacro in parallel with \pagealignmacro.
3524 % From: Torbjorn Granlund <tege@matematik.su.se>
3526 \immediate\closeout\tocfile
3528 % Don't need to put `Contents' or `Short Contents' in the headline.
3529 % It is abundantly clear what they are.
3530 \unnumbchapmacro{#1}\def\thischapter{}%
3531 \savepageno =
\pageno
3532 \begingroup % Set up to handle contents files properly.
3533 \catcode`\\=
0 \catcode`\
{=
1 \catcode`\
}=
2 \catcode`\@=
11
3534 % We can't do this, because then an actual ^ in a section
3535 % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97.
3536 %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
3537 \raggedbottom % Worry more about breakpoints than the bottom.
3538 \advance\hsize by -
\contentsrightmargin % Don't use the full line length.
3540 % Roman numerals for page numbers.
3541 \ifnum \pageno>
0 \pageno =
\lastnegativepageno \fi
3545 % Normal (long) toc.
3547 \startcontents{\putwordTOC}%
3548 \openin 1 \jobname.toc
3554 \contentsalignmacro % in case @setchapternewpage odd is in effect
3556 \lastnegativepageno =
\pageno
3557 \pageno =
\savepageno
3560 % And just the chapters.
3561 \def\summarycontents{%
3562 \startcontents{\putwordShortTOC}%
3564 \let\chapentry =
\shortchapentry
3565 \let\unnumbchapentry =
\shortunnumberedentry
3566 % We want a true roman here for the page numbers.
3568 \let\rm=
\shortcontrm \let\bf=
\shortcontbf \let\sl=
\shortcontsl
3570 \hyphenpenalty =
10000
3571 \advance\baselineskip by
1pt
% Open it up a little.
3572 \def\secentry #
#1#
#2#
#3#
#4{}
3573 \def\unnumbsecentry #
#1#
#2{}
3574 \def\subsecentry #
#1#
#2#
#3#
#4#
#5{}
3575 \def\unnumbsubsecentry #
#1#
#2{}
3576 \def\subsubsecentry #
#1#
#2#
#3#
#4#
#5#
#6{}
3577 \def\unnumbsubsubsecentry #
#1#
#2{}
3578 \openin 1 \jobname.toc
3584 \contentsalignmacro % in case @setchapternewpage odd is in effect
3586 \lastnegativepageno =
\pageno
3587 \pageno =
\savepageno
3589 \let\shortcontents =
\summarycontents
3591 % These macros generate individual entries in the table of contents.
3592 % The first argument is the chapter or section name.
3593 % The last argument is the page number.
3594 % The arguments in between are the chapter number, section number, ...
3596 % Chapter-level things, for both the long and short contents.
3597 \def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}
3599 % See comments in \dochapentry re vbox and related settings
3600 \def\shortchapentry#1#2#3{%
3601 \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno{#3}}%
3604 % Typeset the label for a chapter or appendix for the short contents.
3605 % The arg is, e.g. `Appendix A' for an appendix, or `3' for a chapter.
3606 % We could simplify the code here by writing out an \appendixentry
3607 % command in the toc file for appendices, instead of using \chapentry
3608 % for both, but it doesn't seem worth it.
3609 \setbox0 =
\hbox{\shortcontrm \putwordAppendix }
3610 \newdimen\shortappendixwidth \shortappendixwidth =
\wd0
3612 \def\shortchaplabel#1{%
3613 % We typeset #1 in a box of constant width, regardless of the text of
3614 % #1, so the chapter titles will come out aligned.
3615 \setbox0 =
\hbox{#1}%
3616 \dimen0 =
\ifdim\wd0 >
\shortappendixwidth \shortappendixwidth \else 0pt
\fi
3618 % This space should be plenty, since a single number is .5em, and the
3619 % widest letter (M) is 1em, at least in the Computer Modern fonts.
3620 % (This space doesn't include the extra space that gets added after
3621 % the label; that gets put in by \shortchapentry above.)
3622 \advance\dimen0 by
1.1em
3623 \hbox to
\dimen0{#1\hfil}%
3626 \def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
3627 \def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno{#2}}}
3630 \def\secentry#1#2#3#4{\dosecentry{#2.
#3\labelspace#1}{#4}}
3631 \def\unnumbsecentry#1#2{\dosecentry{#1}{#2}}
3634 \def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.
#3.
#4\labelspace#1}{#5}}
3635 \def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}}
3637 % And subsubsections.
3638 \def\subsubsecentry#1#2#3#4#5#6{%
3639 \dosubsubsecentry{#2.
#3.
#4.
#5\labelspace#1}{#6}}
3640 \def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}}
3642 % This parameter controls the indentation of the various levels.
3643 \newdimen\tocindent \tocindent =
3pc
3645 % Now for the actual typesetting. In all these, #1 is the text and #2 is the
3648 % If the toc has to be broken over pages, we want it to be at chapters
3649 % if at all possible; hence the \penalty.
3650 \def\dochapentry#1#2{%
3651 \penalty-
300 \vskip1\baselineskip plus
.33\baselineskip minus
.25\baselineskip
3654 \tocentry{#1}{\dopageno{#2}}%
3656 \nobreak\vskip .25\baselineskip plus
.1\baselineskip
3659 \def\dosecentry#1#2{\begingroup
3660 \secentryfonts \leftskip=
\tocindent
3661 \tocentry{#1}{\dopageno{#2}}%
3664 \def\dosubsecentry#1#2{\begingroup
3665 \subsecentryfonts \leftskip=
2\tocindent
3666 \tocentry{#1}{\dopageno{#2}}%
3669 \def\dosubsubsecentry#1#2{\begingroup
3670 \subsubsecentryfonts \leftskip=
3\tocindent
3671 \tocentry{#1}{\dopageno{#2}}%
3674 % Final typesetting of a toc entry; we use the same \entry macro as for
3675 % the index entries, but we want to suppress hyphenation here. (We
3676 % can't do that in the \entry macro, since index entries might consist
3677 % of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.)
3678 \def\tocentry#1#2{\begingroup
3679 \vskip 0pt plus1pt
% allow a little stretch for the sake of nice page breaks
3680 % Do not use \turnoffactive in these arguments. Since the toc is
3681 % typeset in cmr, so characters such as _ would come out wrong; we
3682 % have to do the usual translation tricks.
3686 % Space between chapter (or whatever) number and the title.
3687 \def\labelspace{\hskip1em \relax}
3689 \def\dopageno#1{{\rm #1}}
3690 \def\doshortpageno#1{{\rm #1}}
3692 \def\chapentryfonts{\secfonts \rm}
3693 \def\secentryfonts{\textfonts}
3694 \let\subsecentryfonts =
\textfonts
3695 \let\subsubsecentryfonts =
\textfonts
3698 \message{environments,
}
3700 % Since these characters are used in examples, it should be an even number of
3701 % \tt widths. Each \tt character is 1en, so two makes it 1em.
3702 % Furthermore, these definitions must come after we define our fonts.
3703 \newbox\dblarrowbox \newbox\longdblarrowbox
3704 \newbox\pushcharbox \newbox\bullbox
3705 \newbox\equivbox \newbox\errorbox
3708 %\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil}
3709 %\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil}
3710 %\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil}
3711 %\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil}
3712 % Adapted from the manmac format (p.420 of TeXbook)
3713 %\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex
3717 % @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
3719 \def\result{\leavevmode\raise.15ex
\hbox to
1em
{\hfil$
\Rightarrow$
\hfil}}
3720 \def\expansion{\leavevmode\raise.1ex
\hbox to
1em
{\hfil$
\mapsto$
\hfil}}
3721 \def\print{\leavevmode\lower.1ex
\hbox to
1em
{\hfil$
\dashv$
\hfil}}
3722 \def\equiv{\leavevmode\lower.1ex
\hbox to
1em
{\hfil$
\ptexequiv$
\hfil}}
3724 % Adapted from the TeXbook's \boxit.
3725 {\tentt \global\dimen0 =
3em
}% Width of the box.
3726 \dimen2 =
.55pt
% Thickness of rules
3727 % The text. (`r' is open on the right, `e' somewhat less so on the left.)
3728 \setbox0 =
\hbox{\kern-
.75pt
\tensf error
\kern-
1.5pt
}
3730 \global\setbox\errorbox=
\hbox to
\dimen0{\hfil
3731 \hsize =
\dimen0 \advance\hsize by -
5.8pt
% Space to left+right.
3732 \advance\hsize by -
2\dimen2 % Rules.
3734 \hrule height
\dimen2
3735 \hbox{\vrule width
\dimen2 \kern3pt % Space to left of text.
3736 \vtop{\kern2.4pt
\box0 \kern2.4pt
}% Space above/below.
3737 \kern3pt\vrule width
\dimen2}% Space to right.
3738 \hrule height
\dimen2}
3741 % The @error{} command.
3742 \def\error{\leavevmode\lower.7ex
\copy\errorbox}
3744 % @tex ... @end tex escapes into raw Tex temporarily.
3745 % One exception: @ is still an escape character, so that @end tex works.
3746 % But \@ or @@ will get a plain tex @ character.
3748 \def\tex{\begingroup
3749 \catcode `\\=
0 \catcode `\
{=
1 \catcode `\
}=
2
3750 \catcode `\$=
3 \catcode `\&=
4 \catcode `\#=
6
3751 \catcode `\^=
7 \catcode `
\_=
8 \catcode `\~=
13 \let~=
\tie
3753 \catcode 43=
12 % plus
3762 \let\bullet=
\ptexbullet
3767 \let\equiv=
\ptexequiv
3776 \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
3777 \def\enddots{\relax\ifmmode\endldots\else$
\mathsurround=
0pt
\endldots\,$
\fi}%
3779 \let\Etex=
\endgroup}
3781 % Define @lisp ... @endlisp.
3782 % @lisp does a \begingroup so it can rebind things,
3783 % including the definition of @endlisp (which normally is erroneous).
3785 % Amount to narrow the margins by for @lisp.
3786 \newskip\lispnarrowing \lispnarrowing=
0.4in
3788 % This is the definition that ^^M gets inside @lisp, @example, and other
3789 % such environments. \null is better than a space, since it doesn't
3791 \def\lisppar{\null\endgraf}
3793 % Make each space character in the input produce a normal interword
3794 % space in the output. Don't allow a line break at this space, as this
3795 % is used only in environments like @example, where each line of input
3796 % should produce a line of output anyway.
3799 \gdef\sepspaces{\obeyspaces\let =
\tie}}
3801 % Define \obeyedspace to be our active space, whatever it is. This is
3802 % for use in \parsearg.
3804 \global\let\obeyedspace=
}
3806 % This space is always present above and below environments.
3807 \newskip\envskipamount \envskipamount =
0pt
3809 % Make spacing and below environment symmetrical. We use \parskip here
3810 % to help in doing that, since in @example-like environments \parskip
3811 % is reset to zero; thus the \afterenvbreak inserts no space -- but the
3812 % start of the next paragraph will insert \parskip
3814 \def\aboveenvbreak{{\advance\envskipamount by
\parskip
3815 \endgraf \ifdim\lastskip<
\envskipamount
3816 \removelastskip \penalty-
50 \vskip\envskipamount \fi}}
3818 \let\afterenvbreak =
\aboveenvbreak
3820 % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins.
3821 \let\nonarrowing=
\relax
3823 % @cartouche ... @end cartouche: draw rectangle w/rounded corners around
3824 % environment contents.
3825 \font\circle=lcircle10
3827 \newdimen\cartouter\newdimen\cartinner
3828 \newskip\normbskip\newskip\normpskip\newskip\normlskip
3829 \circthick=
\fontdimen8\circle
3831 \def\ctl{{\circle\char'
013\hskip -
6pt
}}% 6pt from pl file: 1/2charwidth
3832 \def\ctr{{\hskip 6pt
\circle\char'
010}}
3833 \def\cbl{{\circle\char'
012\hskip -
6pt
}}
3834 \def\cbr{{\hskip 6pt
\circle\char'
011}}
3835 \def\carttop{\hbox to
\cartouter{\hskip\lskip
3836 \ctl\leaders\hrule height
\circthick\hfil\ctr
3838 \def\cartbot{\hbox to
\cartouter{\hskip\lskip
3839 \cbl\leaders\hrule height
\circthick\hfil\cbr
3842 \newskip\lskip\newskip\rskip
3844 \long\def\cartouche{%
3846 \lskip=
\leftskip \rskip=
\rightskip
3847 \leftskip=
0pt
\rightskip=
0pt
%we want these *outside*.
3848 \cartinner=
\hsize \advance\cartinner by-
\lskip
3849 \advance\cartinner by-
\rskip
3851 \advance\cartouter by
18.4pt
% allow for 3pt kerns on either
3852 % side, and for 6pt waste from
3853 % each corner char, and rule thickness
3854 \normbskip=
\baselineskip \normpskip=
\parskip \normlskip=
\lineskip
3855 % Flag to tell @lisp, etc., not to narrow margin.
3856 \let\nonarrowing=
\comment
3858 \baselineskip=
0pt
\parskip=
0pt
\lineskip=
0pt
3867 \baselineskip=
\normbskip
3868 \lineskip=
\normlskip
3884 % This macro is called at the beginning of all the @example variants,
3888 \inENV % This group ends at the end of the body
3889 \hfuzz =
12pt
% Don't be fussy
3890 \sepspaces % Make spaces be word-separators rather than space tokens.
3892 \let\par =
\lisppar % don't ignore blank lines
3893 \obeylines % each line of input is a line of output
3896 \emergencystretch =
0pt
% don't try to avoid overfull boxes
3897 % @cartouche defines \nonarrowing to inhibit narrowing
3898 % at next level down.
3899 \ifx\nonarrowing\relax
3900 \advance \leftskip by
\lispnarrowing
3901 \exdentamount=
\lispnarrowing
3902 \let\exdent=
\nofillexdent
3903 \let\nonarrowing=
\relax
3907 % Define the \E... control sequence only if we are inside the particular
3908 % environment, so the error checking in \end will work.
3910 % To end an @example-like environment, we first end the paragraph (via
3911 % \afterenvbreak's vertical glue), and then the group. That way we keep
3912 % the zero \parskip that the environments set -- \parskip glue will be
3913 % inserted at the beginning of the next paragraph in the document, after
3916 \def\nonfillfinish{\afterenvbreak\endgroup}
3918 % @lisp: indented, narrowed, typewriter font.
3919 \def\lisp{\begingroup
3921 \let\Elisp =
\nonfillfinish
3923 \let\kbdfont =
\kbdexamplefont % Allow @kbd to do something special.
3924 \gobble % eat return
3927 % @example: Same as @lisp.
3928 \def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp}
3930 % @small... is usually equivalent to the non-small (@smallbook
3931 % redefines). We must call \example (or whatever) last in the
3932 % definition, since it reads the return following the @example (or
3933 % whatever) command.
3935 % This actually allows (for example) @end display inside an
3936 % @smalldisplay. Too bad, but makeinfo will catch the error anyway.
3938 \def\smalldisplay{\begingroup\def\Esmalldisplay{\nonfillfinish\endgroup}\display}
3939 \def\smallexample{\begingroup\def\Esmallexample{\nonfillfinish\endgroup}\lisp}
3940 \def\smallformat{\begingroup\def\Esmallformat{\nonfillfinish\endgroup}\format}
3941 \def\smalllisp{\begingroup\def\Esmalllisp{\nonfillfinish\endgroup}\lisp}
3943 % Real @smallexample and @smalllisp (when @smallbook): use smaller fonts.
3944 % Originally contributed by Pavel@xerox.
3945 \def\smalllispx{\begingroup
3946 \def\Esmalllisp{\nonfillfinish\endgroup}%
3947 \def\Esmallexample{\nonfillfinish\endgroup}%
3952 % @display: same as @lisp except keep current font.
3954 \def\display{\begingroup
3956 \let\Edisplay =
\nonfillfinish
3960 % @smalldisplay (when @smallbook): @display plus smaller fonts.
3962 \def\smalldisplayx{\begingroup
3963 \def\Esmalldisplay{\nonfillfinish\endgroup}%
3968 % @format: same as @display except don't narrow margins.
3970 \def\format{\begingroup
3971 \let\nonarrowing = t
3973 \let\Eformat =
\nonfillfinish
3977 % @smallformat (when @smallbook): @format plus smaller fonts.
3979 \def\smallformatx{\begingroup
3980 \def\Esmallformat{\nonfillfinish\endgroup}%
3985 % @flushleft (same as @format).
3987 \def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format}
3991 \def\flushright{\begingroup
3992 \let\nonarrowing = t
3994 \let\Eflushright =
\nonfillfinish
3995 \advance\leftskip by
0pt plus
1fill
3999 % @quotation does normal linebreaking (hence we can't use \nonfillstart)
4000 % and narrows the margins.
4003 \begingroup\inENV %This group ends at the end of the @quotation body
4004 {\parskip=
0pt
\aboveenvbreak}% because \aboveenvbreak inserts \parskip
4007 % We have retained a nonzero parskip for the environment, since we're
4008 % doing normal filling. So to avoid extra space below the environment...
4009 \def\Equotation{\parskip =
0pt
\nonfillfinish}%
4011 % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
4012 \ifx\nonarrowing\relax
4013 \advance\leftskip by
\lispnarrowing
4014 \advance\rightskip by
\lispnarrowing
4015 \exdentamount =
\lispnarrowing
4016 \let\nonarrowing =
\relax
4022 % Define formatter for defuns
4023 % First, allow user to change definition object font (\df) internally
4024 \def\setdeffont #1 {\csname DEF
#1\endcsname}
4026 \newskip\defbodyindent \defbodyindent=
.4in
4027 \newskip\defargsindent \defargsindent=
50pt
4028 \newskip\deftypemargin \deftypemargin=
12pt
4029 \newskip\deflastargmargin \deflastargmargin=
18pt
4031 \newcount\parencount
4032 % define \functionparens, which makes ( and ) and & do special things.
4033 % \functionparens affects the group it is contained in.
4035 \catcode`\(=
\active \catcode`\)=
\active \catcode`\&=
\active
4036 \catcode`\
[=
\active \catcode`\
]=
\active}
4038 % Make control sequences which act like normal parenthesis chars.
4039 \let\lparen = (
\let\rparen = )
4041 {\activeparens % Now, smart parens don't turn on until &foo (see \amprm)
4043 % Be sure that we always have a definition for `(', etc. For example,
4044 % if the fn name has parens in it, \boldbrax will not be in effect yet,
4045 % so TeX would otherwise complain about undefined control sequence.
4046 \global\let(=
\lparen \global\let)=
\rparen
4047 \global\let[=
\lbrack \global\let]=
\rbrack
4049 \gdef\functionparens{\boldbrax\let&=
\amprm\parencount=
0 }
4050 \gdef\boldbrax{\let(=
\opnr\let)=
\clnr\let[=
\lbrb\let]=
\rbrb}
4051 % This is used to turn on special parens
4052 % but make & act ordinary (given that it's active).
4053 \gdef\boldbraxnoamp{\let(=
\opnr\let)=
\clnr\let[=
\lbrb\let]=
\rbrb\let&=
\ampnr}
4055 % Definitions of (, ) and & used in args for functions.
4056 % This is the definition of ( outside of all parentheses.
4057 \gdef\oprm#1 {{\rm\char`\(
}#1 \bf \let(=
\opnested
4058 \global\advance\parencount by
1
4061 % This is the definition of ( when already inside a level of parens.
4062 \gdef\opnested{\char`\(
\global\advance\parencount by
1 }
4064 \gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
4065 % also in that case restore the outer-level definition of (.
4066 \ifnum \parencount=
1 {\rm \char `\)
}\sl \let(=
\oprm \else \char `\)
\fi
4067 \global\advance \parencount by -
1 }
4068 % If we encounter &foo, then turn on ()-hacking afterwards
4069 \gdef\amprm#1 {{\rm\&
#1}\let(=
\oprm \let)=
\clrm\
}
4071 \gdef\normalparens{\boldbrax\let&=
\ampnr}
4072 } % End of definition inside \activeparens
4073 %% These parens (in \boldbrax) actually are a little bolder than the
4074 %% contained text. This is especially needed for [ and ]
4075 \def\opnr{{\sf\char`\(
}\global\advance\parencount by
1 }
4076 \def\clnr{{\sf\char`\)
}\global\advance\parencount by -
1 }
4078 \def\lbrb{{\bf\char`\
[}}
4079 \def\rbrb{{\bf\char`\
]}}
4081 % First, defname, which formats the header line itself.
4082 % #1 should be the function name.
4083 % #2 should be the type of definition, such as "Function".
4086 % Get the values of \leftskip and \rightskip as they were
4087 % outside the @def...
4089 \advance\dimen2 by -
\defbodyindent
4091 \setbox0=
\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
4092 \dimen0=
\hsize \advance \dimen0 by -
\wd0 % compute size for first line
4093 \dimen1=
\hsize \advance \dimen1 by -
\defargsindent %size for continuations
4094 \parshape 2 0in
\dimen0 \defargsindent \dimen1
4095 % Now output arg 2 ("Function" or some such)
4096 % ending at \deftypemargin from the right margin,
4097 % but stuck inside a box of width 0 so it does not interfere with linebreaking
4098 {% Adjust \hsize to exclude the ambient margins,
4099 % so that \rightline will obey them.
4100 \advance \hsize by -
\dimen2
4101 \rlap{\rightline{{\rm #2}\hskip -
1.25pc
}}}%
4102 % Make all lines underfull and no complaints:
4103 \tolerance=
10000 \hbadness=
10000
4104 \advance\leftskip by -
\defbodyindent
4105 \exdentamount=
\defbodyindent
4106 {\df #1}\enskip % Generate function name
4109 % Actually process the body of a definition
4110 % #1 should be the terminating control sequence, such as \Edefun.
4111 % #2 should be the "another name" control sequence, such as \defunx.
4112 % #3 should be the control sequence that actually processes the header,
4113 % such as \defunheader.
4115 \def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
4117 % Define the end token that this defining construct specifies
4118 % so that it will exit this group.
4119 \def#1{\endgraf\endgroup\medbreak}%
4120 \def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
4122 \advance\leftskip by
\defbodyindent
4123 \exdentamount=
\defbodyindent
4125 \catcode 61=
\active % 61 is `='
4126 \obeylines\activeparens\spacesplit#3}
4128 % #1 is the \E... control sequence to end the definition (which we define).
4129 % #2 is the \...x control sequence for consecutive fns (which we define).
4130 % #3 is the control sequence to call to resume processing.
4131 % #4, delimited by the space, is the class name.
4133 \def\defmethparsebody#1#2#3#4 {\begingroup\inENV %
4135 % Define the end token that this defining construct specifies
4136 % so that it will exit this group.
4137 \def#1{\endgraf\endgroup\medbreak}%
4138 \def#2#
#1 {\begingroup\obeylines\activeparens\spacesplit{#3{#
#1}}}%
4140 \advance\leftskip by
\defbodyindent
4141 \exdentamount=
\defbodyindent
4142 \begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
4144 % @deftypemethod has an extra argument that nothing else does. Sigh.
4145 % #1 is the \E... control sequence to end the definition (which we define).
4146 % #2 is the \...x control sequence for consecutive fns (which we define).
4147 % #3 is the control sequence to call to resume processing.
4148 % #4, delimited by the space, is the class name.
4149 % #5 is the method's return type.
4151 \def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV %
4153 % Define the end token that this defining construct specifies
4154 % so that it will exit this group.
4155 \def#1{\endgraf\endgroup\medbreak}%
4156 \def#2#
#1 #
#2 {\begingroup\obeylines\activeparens\spacesplit{#3{#
#1}{#
#2}}}%
4158 \advance\leftskip by
\defbodyindent
4159 \exdentamount=
\defbodyindent
4160 \begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}}
4162 \def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
4164 % Define the end token that this defining construct specifies
4165 % so that it will exit this group.
4166 \def#1{\endgraf\endgroup\medbreak}%
4167 \def#2#
#1 #
#2 {\def#4{#
#1}%
4168 \begingroup\obeylines\activeparens\spacesplit{#3{#
#2}}}%
4170 \advance\leftskip by
\defbodyindent
4171 \exdentamount=
\defbodyindent
4172 \begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
4174 % These parsing functions are similar to the preceding ones
4175 % except that they do not make parens into active characters.
4176 % These are used for "variables" since they have no arguments.
4178 \def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
4180 % Define the end token that this defining construct specifies
4181 % so that it will exit this group.
4182 \def#1{\endgraf\endgroup\medbreak}%
4183 \def#2{\begingroup\obeylines\spacesplit#3}%
4185 \advance\leftskip by
\defbodyindent
4186 \exdentamount=
\defbodyindent
4188 \catcode 61=
\active %
4189 \obeylines\spacesplit#3}
4191 % This is used for \def{tp,vr}parsebody. It could probably be used for
4192 % some of the others, too, with some judicious conditionals.
4194 \def\parsebodycommon#1#2#3{%
4197 % Define the end token that this defining construct specifies
4198 % so that it will exit this group.
4199 \def#1{\endgraf\endgroup\medbreak}%
4200 \def#2#
#1 {\begingroup\obeylines\spacesplit{#3{#
#1}}}%
4202 \advance\leftskip by
\defbodyindent
4203 \exdentamount=
\defbodyindent
4204 \begingroup\obeylines
4207 \def\defvrparsebody#1#2#3#4 {%
4208 \parsebodycommon{#1}{#2}{#3}%
4209 \spacesplit{#3{#4}}%
4212 % This loses on `@deftp {Data Type} {struct termios}' -- it thinks the
4213 % type is just `struct', because we lose the braces in `{struct
4214 % termios}' when \spacesplit reads its undelimited argument. Sigh.
4215 % \let\deftpparsebody=\defvrparsebody
4217 % So, to get around this, we put \empty in with the type name. That
4218 % way, TeX won't find exactly `{...}' as an undelimited argument, and
4219 % won't strip off the braces.
4221 \def\deftpparsebody #1#2#3#4 {%
4222 \parsebodycommon{#1}{#2}{#3}%
4223 \spacesplit{\parsetpheaderline{#3{#4}}}\empty
4226 % Fine, but then we have to eventually remove the \empty *and* the
4227 % braces (if any). That's what this does.
4229 \def\removeemptybraces\empty#1\relax{#1}
4231 % After \spacesplit has done its work, this is called -- #1 is the final
4232 % thing to call, #2 the type name (which starts with \empty), and #3
4233 % (which might be empty) the arguments.
4235 \def\parsetpheaderline#1#2#3{%
4236 #1{\removeemptybraces#2\relax}{#3}%
4239 \def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV %
4241 % Define the end token that this defining construct specifies
4242 % so that it will exit this group.
4243 \def#1{\endgraf\endgroup\medbreak}%
4244 \def#2#
#1 #
#2 {\def#4{#
#1}%
4245 \begingroup\obeylines\spacesplit{#3{#
#2}}}%
4247 \advance\leftskip by
\defbodyindent
4248 \exdentamount=
\defbodyindent
4249 \begingroup\obeylines\spacesplit{#3{#5}}}
4251 % Split up #2 at the first space token.
4252 % call #1 with two arguments:
4253 % the first is all of #2 before the space token,
4254 % the second is all of #2 after that space token.
4255 % If #2 contains no space token, all of it is passed as the first arg
4256 % and the second is passed as empty.
4259 \gdef\spacesplit#1#2^^M
{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}%
4260 \long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{%
4262 #1{#2}{}\else #1{#2}{#3#4}\fi}}
4264 % So much for the things common to all kinds of definitions.
4268 % First, define the processing that is wanted for arguments of \defun
4269 % Use this to expand the args and terminate the paragraph they make up
4271 \def\defunargs #1{\functionparens \sl
4272 % Expand, preventing hyphenation at `-' chars.
4273 % Note that groups don't affect changes in \hyphenchar.
4276 \hyphenchar\tensl=
45
4277 \ifnum\parencount=
0 \else \errmessage{Unbalanced parentheses in @def
}\fi%
4278 \interlinepenalty=
10000
4279 \advance\rightskip by
0pt plus
1fil
4280 \endgraf\nobreak\vskip -
\parskip\nobreak
4283 \def\deftypefunargs #1{%
4284 % Expand, preventing hyphenation at `-' chars.
4285 % Note that groups don't affect changes in \hyphenchar.
4286 % Use \boldbraxnoamp, not \functionparens, so that & is not special.
4288 \tclose{#1}% avoid \code because of side effects on active chars
4289 \interlinepenalty=
10000
4290 \advance\rightskip by
0pt plus
1fil
4291 \endgraf\nobreak\vskip -
\parskip\nobreak
4294 % Do complete processing of one @defun or @defunx line already parsed.
4296 % @deffn Command forward-char nchars
4298 \def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader}
4300 \def\deffnheader #1#2#3{\doind {fn
}{\code{#2}}%
4301 \begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
4302 \catcode 61=
\other % Turn off change made in \defparsebody
4305 % @defun == @deffn Function
4307 \def\defun{\defparsebody\Edefun\defunx\defunheader}
4309 \def\defunheader #1#2{\doind {fn
}{\code{#1}}% Make entry in function index
4310 \begingroup\defname {#1}{\putwordDeffunc}%
4311 \defunargs {#2}\endgroup %
4312 \catcode 61=
\other % Turn off change made in \defparsebody
4315 % @deftypefun int foobar (int @var{foo}, float @var{bar})
4317 \def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader}
4319 % #1 is the data type. #2 is the name and args.
4320 \def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax}
4321 % #1 is the data type, #2 the name, #3 the args.
4322 \def\deftypefunheaderx #1#2 #3\relax{%
4323 \doind {fn
}{\code{#2}}% Make entry in function index
4324 \begingroup\defname {\defheaderxcond#1\relax$$$
#2}{\putwordDeftypefun}%
4325 \deftypefunargs {#3}\endgroup %
4326 \catcode 61=
\other % Turn off change made in \defparsebody
4329 % @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
4331 \def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
4333 % \defheaderxcond#1\relax$$$
4334 % puts #1 in @code, followed by a space, but does nothing if #1 is null.
4335 \def\defheaderxcond#1#2$$$
{\ifx#1\relax\else\code{#1#2} \fi}
4337 % #1 is the classification. #2 is the data type. #3 is the name and args.
4338 \def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax}
4339 % #1 is the classification, #2 the data type, #3 the name, #4 the args.
4340 \def\deftypefnheaderx #1#2#3 #4\relax{%
4341 \doind {fn
}{\code{#3}}% Make entry in function index
4343 \normalparens % notably, turn off `&' magic, which prevents
4344 % at least some C++ text from working
4345 \defname {\defheaderxcond#2\relax$$$
#3}{#1}%
4346 \deftypefunargs {#4}\endgroup %
4347 \catcode 61=
\other % Turn off change made in \defparsebody
4350 % @defmac == @deffn Macro
4352 \def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
4354 \def\defmacheader #1#2{\doind {fn
}{\code{#1}}% Make entry in function index
4355 \begingroup\defname {#1}{\putwordDefmac}%
4356 \defunargs {#2}\endgroup %
4357 \catcode 61=
\other % Turn off change made in \defparsebody
4360 % @defspec == @deffn Special Form
4362 \def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
4364 \def\defspecheader #1#2{\doind {fn
}{\code{#1}}% Make entry in function index
4365 \begingroup\defname {#1}{\putwordDefspec}%
4366 \defunargs {#2}\endgroup %
4367 \catcode 61=
\other % Turn off change made in \defparsebody
4370 % This definition is run if you use @defunx
4371 % anywhere other than immediately after a @defun or @defunx.
4373 \def\deffnx #1 {\errmessage{@deffnx in invalid context
}}
4374 \def\defunx #1 {\errmessage{@defunx in invalid context
}}
4375 \def\defmacx #1 {\errmessage{@defmacx in invalid context
}}
4376 \def\defspecx #1 {\errmessage{@defspecx in invalid context
}}
4377 \def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context
}}
4378 \def\deftypemethodx #1 {\errmessage{@deftypemethodx in invalid context
}}
4379 \def\deftypefunx #1 {\errmessage{@deftypefunx in invalid context
}}
4381 % @defmethod, and so on
4383 % @defop CATEGORY CLASS OPERATION ARG...
4385 \def\defop #1 {\def\defoptype{#1}%
4386 \defopparsebody\Edefop\defopx\defopheader\defoptype}
4388 \def\defopheader #1#2#3{%
4389 \dosubind {fn
}{\code{#2}}{\putwordon\
#1}% Make entry in function index
4390 \begingroup\defname {#2}{\defoptype{}\putwordon\
#1}%
4391 \defunargs {#3}\endgroup %
4394 % @deftypemethod CLASS RETURN-TYPE METHOD ARG...
4396 \def\deftypemethod{%
4397 \deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader}
4399 % #1 is the class name, #2 the data type, #3 the method name, #4 the args.
4400 \def\deftypemethodheader#1#2#3#4{%
4401 \dosubind{fn
}{\code{#3}}{\putwordon\
\code{#1}}% entry in function index
4403 \defname{\defheaderxcond#2\relax$$$
#3}{\putwordMethodon\
\code{#1}}%
4404 \deftypefunargs{#4}%
4408 % @defmethod == @defop Method
4410 \def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
4412 % #1 is the class name, #2 the method name, #3 the args.
4413 \def\defmethodheader#1#2#3{%
4414 \dosubind{fn
}{\code{#2}}{\putwordon\
\code{#1}}% entry in function index
4416 \defname{#2}{\putwordMethodon\
\code{#1}}%
4421 % @defcv {Class Option} foo-class foo-flag
4423 \def\defcv #1 {\def\defcvtype{#1}%
4424 \defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
4426 \def\defcvarheader #1#2#3{%
4427 \dosubind {vr
}{\code{#2}}{\putwordof\
#1}% Make entry in var index
4428 \begingroup\defname {#2}{\defcvtype\
\putwordof\
#1}%
4429 \defvarargs {#3}\endgroup %
4432 % @defivar == @defcv {Instance Variable}
4434 \def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
4436 \def\defivarheader #1#2#3{%
4437 \dosubind {vr
}{\code{#2}}{\putwordof\
#1}% Make entry in var index
4438 \begingroup\defname {#2}{\putwordDefivar\
\putwordof\
#1}%
4439 \defvarargs {#3}\endgroup %
4442 % These definitions are run if you use @defmethodx, etc.,
4443 % anywhere other than immediately after a @defmethod, etc.
4445 \def\defopx #1 {\errmessage{@defopx in invalid context
}}
4446 \def\defmethodx #1 {\errmessage{@defmethodx in invalid context
}}
4447 \def\defcvx #1 {\errmessage{@defcvx in invalid context
}}
4448 \def\defivarx #1 {\errmessage{@defivarx in invalid context
}}
4452 % First, define the processing that is wanted for arguments of @defvar.
4453 % This is actually simple: just print them in roman.
4454 % This must expand the args and terminate the paragraph they make up
4455 \def\defvarargs #1{\normalparens #1%
4456 \interlinepenalty=
10000
4457 \endgraf\nobreak\vskip -
\parskip\nobreak}
4459 % @defvr Counter foo-count
4461 \def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader}
4463 \def\defvrheader #1#2#3{\doind {vr
}{\code{#2}}%
4464 \begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup}
4466 % @defvar == @defvr Variable
4468 \def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader}
4470 \def\defvarheader #1#2{\doind {vr
}{\code{#1}}% Make entry in var index
4471 \begingroup\defname {#1}{\putwordDefvar}%
4472 \defvarargs {#2}\endgroup %
4475 % @defopt == @defvr {User Option}
4477 \def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader}
4479 \def\defoptheader #1#2{\doind {vr
}{\code{#1}}% Make entry in var index
4480 \begingroup\defname {#1}{\putwordDefopt}%
4481 \defvarargs {#2}\endgroup %
4484 % @deftypevar int foobar
4486 \def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader}
4488 % #1 is the data type. #2 is the name, perhaps followed by text that
4489 % is actually part of the data type, which should not be put into the index.
4490 \def\deftypevarheader #1#2{%
4491 \dovarind#2 \relax% Make entry in variables index
4492 \begingroup\defname {\defheaderxcond#1\relax$$$
#2}{\putwordDeftypevar}%
4493 \interlinepenalty=
10000
4494 \endgraf\nobreak\vskip -
\parskip\nobreak
4496 \def\dovarind#1 #2\relax{\doind{vr
}{\code{#1}}}
4498 % @deftypevr {Global Flag} int enable
4500 \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
4502 \def\deftypevrheader #1#2#3{\dovarind#3 \relax%
4503 \begingroup\defname {\defheaderxcond#2\relax$$$
#3}{#1}
4504 \interlinepenalty=
10000
4505 \endgraf\nobreak\vskip -
\parskip\nobreak
4508 % This definition is run if you use @defvarx
4509 % anywhere other than immediately after a @defvar or @defvarx.
4511 \def\defvrx #1 {\errmessage{@defvrx in invalid context
}}
4512 \def\defvarx #1 {\errmessage{@defvarx in invalid context
}}
4513 \def\defoptx #1 {\errmessage{@defoptx in invalid context
}}
4514 \def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context
}}
4515 \def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context
}}
4518 % Args are printed in bold, a slight difference from @defvar.
4520 \def\deftpargs #1{\bf \defvarargs{#1}}
4522 % @deftp Class window height width ...
4524 \def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader}
4526 \def\deftpheader #1#2#3{\doind {tp
}{\code{#2}}%
4527 \begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
4529 % This definition is run if you use @deftpx, etc
4530 % anywhere other than immediately after a @deftp, etc.
4532 \def\deftpx #1 {\errmessage{@deftpx in invalid context
}}
4538 % To do this right we need a feature of e-TeX, \scantokens,
4539 % which we arrange to emulate with a temporary file in ordinary TeX.
4540 \ifx\eTeXversion\undefined
4541 \newwrite\macscribble
4543 \begingroup \newlinechar`\^^M
4544 % Undo catcode changes of \startcontents and \doprintindex
4545 \catcode`\@=
0 \catcode`\\=
12 \escapechar=`\@
4546 % Append \endinput to make sure that TeX does not see the ending newline.
4547 \toks0=
{#1\endinput}%
4548 \immediate\openout\macscribble=
\jobname.tmp
4549 \immediate\write\macscribble{\the\toks0}%
4550 \immediate\closeout\macscribble
4551 \let\xeatspaces\eatspaces
4557 \begingroup \newlinechar`\^^M
4558 % Undo catcode changes of \startcontents and \doprintindex
4559 \catcode`\@=
0 \catcode`\\=
12 \escapechar=`\@
4560 \let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup}
4563 \newcount\paramno % Count of parameters
4564 \newtoks\macname % Macro name
4565 \newif\ifrecursive % Is it recursive?
4566 \def\macrolist{} % List of all defined macros in the form
4567 % \do\macro1\do\macro2...
4570 % Thisdoes \let #1 = #2, except with \csnames.
4572 \expandafter\expandafter
4574 \expandafter\expandafter
4576 \csname#2\endcsname}
4578 % Trim leading and trailing spaces off a string.
4579 % Concepts from aro-bend problem 15 (see CTAN).
4581 \gdef\eatspaces #1{\expandafter\trim@
\expandafter{#1 }}
4582 \gdef\trim@
#1{\trim@@ @
#1 @
#1 @ @@
}
4583 \gdef\trim@@
#1@
#2@
#3@@
{\trim@@@
\empty #2 @
}
4585 \unbrace{\gdef\trim@@@
#1 } #2@
{#1}
4588 % Trim a single trailing ^^M off a string.
4589 {\catcode`\^^M=
12\catcode`
\Q=
3%
4590 \gdef\eatcr #1{\eatcra #1Q^^MQ
}%
4591 \gdef\eatcra#1^^MQ
{\eatcrb#1Q
}%
4592 \gdef\eatcrb#1Q
#2Q
{#1}%
4595 % Macro bodies are absorbed as an argument in a context where
4596 % all characters are catcode 10, 11 or 12, except \ which is active
4597 % (as in normal texinfo). It is necessary to change the definition of \.
4599 % It's necessary to have hard CRs when the macro is executed. This is
4600 % done by making ^^M (\endlinechar) catcode 12 when reading the macro
4601 % body, and then making it the \newlinechar in \scanmacro.
4603 \def\macrobodyctxt{%
4628 % \mbodybackslash is the definition of \ in @macro bodies.
4629 % It maps \foo\ => \csname macarg.foo\endcsname => #N
4630 % where N is the macro parameter number.
4631 % We define \csname macarg.\endcsname to be \realbackslash, so
4632 % \\ in macro replacement text gets you a backslash.
4634 {\catcode`@=
0 @catcode`@\=@active
4635 @gdef@usembodybackslash
{@let\=@mbodybackslash
}
4636 @gdef@mbodybackslash
#1\
{@csname macarg.
#1@endcsname
}
4638 \expandafter\def\csname macarg.
\endcsname{\realbackslash}
4640 \def\macro{\recursivefalse\parsearg\macroxxx}
4641 \def\rmacro{\recursivetrue\parsearg\macroxxx}
4644 \getargs{#1}% now \macname is the macname and \argl the arglist
4645 \ifx\argl\empty % no arguments
4648 \expandafter\parsemargdef \argl;
%
4650 \if1\csname ismacro.
\the\macname\endcsname
4651 \message{Warning: redefining
\the\macname}%
4653 \expandafter\ifx\csname \the\macname\endcsname \relax
4654 \else \errmessage{The name
\the\macname\space is reserved
}\fi
4655 \global\cslet{macsave.
\the\macname}{\the\macname}%
4656 \global\expandafter\let\csname ismacro.
\the\macname\endcsname=
1%
4657 % Add the macroname to \macrolist
4658 \toks0 =
\expandafter{\macrolist\do}%
4659 \xdef\macrolist{\the\toks0
4660 \expandafter\noexpand\csname\the\macname\endcsname}%
4662 \begingroup \macrobodyctxt
4663 \ifrecursive \expandafter\parsermacbody
4664 \else \expandafter\parsemacbody
4667 \def\unmacro{\parsearg\unmacroxxx}
4669 \if1\csname ismacro.
#1\endcsname
4670 \global\cslet{#1}{macsave.
#1}%
4671 \global\expandafter\let \csname ismacro.
#1\endcsname=
0%
4672 % Remove the macro name from \macrolist
4674 \edef\tempa{\expandafter\noexpand\csname#1\endcsname}%
4680 \toks0 =
\expandafter{\newmacrolist\do}%
4681 \edef\newmacrolist{\the\toks0\expandafter\noexpand\tempa}%
4683 \def\newmacrolist{}%
4684 % Execute macro list to define \newmacrolist
4686 \global\let\macrolist\newmacrolist
4689 \errmessage{Macro
#1 not defined
}%
4693 % This makes use of the obscure feature that if the last token of a
4694 % <parameter list> is #, then the preceding argument is delimited by
4695 % an opening brace, and that opening brace is not consumed.
4696 \def\getargs#1{\getargsxxx#1{}}
4697 \def\getargsxxx#1#
{\getmacname #1 \relax\getmacargs}
4698 \def\getmacname #1 #2\relax{\macname=
{#1}}
4699 \def\getmacargs#1{\def\argl{#1}}
4701 % Parse the optional {params} list. Set up \paramno and \paramlist
4702 % so \defmacro knows what to do. Define \macarg.blah for each blah
4703 % in the params list, to be ##N where N is the position in that list.
4704 % That gets used by \mbodybackslash (above).
4706 % We need to get `macro parameter char #' into several definitions.
4707 % The technique used is stolen from LaTeX: let \hash be something
4708 % unexpandable, insert that wherever you need a #, and then redefine
4709 % it to # just before using the token list produced.
4711 % The same technique is used to protect \eatspaces till just before
4712 % the macro is used.
4714 \def\parsemargdef#1;
{\paramno=
0\def\paramlist{}%
4715 \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,
}
4716 \def\parsemargdefxxx#1,
{%
4717 \if#1;
\let\next=
\relax
4718 \else \let\next=
\parsemargdefxxx
4719 \advance\paramno by
1%
4720 \expandafter\edef\csname macarg.
\eatspaces{#1}\endcsname
4721 {\xeatspaces{\hash\the\paramno}}%
4722 \edef\paramlist{\paramlist\hash\the\paramno,
}%
4725 % These two commands read recursive and nonrecursive macro bodies.
4726 % (They're different since rec and nonrec macros end differently.)
4728 \long\def\parsemacbody#1@end macro
%
4729 {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
4730 \long\def\parsermacbody#1@end rmacro
%
4731 {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
4733 % This defines the macro itself. There are six cases: recursive and
4734 % nonrecursive macros of zero, one, and many arguments.
4735 % Much magic with \expandafter here.
4736 % \xdef is used so that macro definitions will survive the file
4737 % they're defined in; @include reads the file inside a group.
4739 \let\hash=##
% convert placeholders to macro parameter chars
4743 \expandafter\xdef\csname\the\macname\endcsname{%
4744 \noexpand\scanmacro{\temp}}%
4746 \expandafter\xdef\csname\the\macname\endcsname{%
4747 \bgroup\noexpand\macroargctxt
4748 \noexpand\braceorline
4749 \expandafter\noexpand\csname\the\macname xxx
\endcsname}%
4750 \expandafter\xdef\csname\the\macname xxx
\endcsname#
#1{%
4751 \egroup\noexpand\scanmacro{\temp}}%
4753 \expandafter\xdef\csname\the\macname\endcsname{%
4754 \bgroup\noexpand\macroargctxt
4755 \noexpand\csname\the\macname xx
\endcsname}%
4756 \expandafter\xdef\csname\the\macname xx
\endcsname#
#1{%
4757 \expandafter\noexpand\csname\the\macname xxx
\endcsname #
#1,
}%
4758 \expandafter\expandafter
4760 \expandafter\expandafter
4761 \csname\the\macname xxx
\endcsname
4762 \paramlist{\egroup\noexpand\scanmacro{\temp}}%
4767 \expandafter\xdef\csname\the\macname\endcsname{%
4768 \noexpand\norecurse{\the\macname}%
4769 \noexpand\scanmacro{\temp}\egroup}%
4771 \expandafter\xdef\csname\the\macname\endcsname{%
4772 \bgroup\noexpand\macroargctxt
4773 \noexpand\braceorline
4774 \expandafter\noexpand\csname\the\macname xxx
\endcsname}%
4775 \expandafter\xdef\csname\the\macname xxx
\endcsname#
#1{%
4777 \noexpand\norecurse{\the\macname}%
4778 \noexpand\scanmacro{\temp}\egroup}%
4780 \expandafter\xdef\csname\the\macname\endcsname{%
4781 \bgroup\noexpand\macroargctxt
4782 \expandafter\noexpand\csname\the\macname xx
\endcsname}%
4783 \expandafter\xdef\csname\the\macname xx
\endcsname#
#1{%
4784 \expandafter\noexpand\csname\the\macname xxx
\endcsname #
#1,
}%
4785 \expandafter\expandafter
4787 \expandafter\expandafter
4788 \csname\the\macname xxx
\endcsname
4791 \noexpand\norecurse{\the\macname}%
4792 \noexpand\scanmacro{\temp}\egroup}%
4796 \def\norecurse#1{\bgroup\cslet{#1}{macsave.
#1}}
4798 % \braceorline decides whether the next nonwhitespace character is a
4799 % {. If so it reads up to the closing }, if not, it reads the whole
4800 % line. Whatever was read is then fed to the next control sequence
4801 % as an argument (by \parsebrace or \parsearg)
4802 \def\braceorline#1{\let\next=
#1\futurelet\nchar\braceorlinexxx}
4803 \def\braceorlinexxx{%
4804 \ifx\nchar\bgroup\else
4805 \expandafter\parsearg
4808 % We mant to disable all macros during \shipout so that they are not
4809 % expanded by \write.
4810 \def\turnoffmacros{\begingroup \def\do#
#1{\let\noexpand#
#1=
\relax}%
4811 \edef\next{\macrolist}\expandafter\endgroup\next}
4815 \def\alias#1=
#2{\gdef#1{#2}}
4818 \message{cross references,
}
4821 \newif\ifhavexrefs % True if xref values are known.
4822 \newif\ifwarnedxrefs % True if we warned once that they aren't known.
4824 % @inforef is relatively simple.
4825 \def\inforef #1{\inforefzzz #1,,,,**
}
4826 \def\inforefzzz #1,
#2,
#3,
#4**
{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
4827 node
\samp{\ignorespaces#1{}}}
4829 % @node's job is to define \lastnode.
4830 \def\node{\ENVcheck\parsearg\nodezzz}
4831 \def\nodezzz#1{\nodexxx [#1,
]}
4832 \def\nodexxx[#1,
#2]{\gdef\lastnode{#1}}
4834 \let\lastnode=
\relax
4836 % The sectioning commands (@chapter, etc.) call these.
4838 \ifx\lastnode\relax\else
4839 \expandafter\expandafter\expandafter\setref{\lastnode}%
4840 {Ysectionnumberandtype
}%
4841 \global\let\lastnode=
\relax
4844 \def\unnumbnoderef{%
4845 \ifx\lastnode\relax\else
4846 \expandafter\expandafter\expandafter\setref{\lastnode}{Ynothing
}%
4847 \global\let\lastnode=
\relax
4850 \def\appendixnoderef{%
4851 \ifx\lastnode\relax\else
4852 \expandafter\expandafter\expandafter\setref{\lastnode}%
4853 {Yappendixletterandtype
}%
4854 \global\let\lastnode=
\relax
4859 % @anchor{NAME} -- define xref target at arbitrary point.
4861 \def\anchor#1{\setref{#1}{Ynothing
}}
4864 % \setref{NAME}{SNT} defines a cross-reference point NAME, namely
4865 % NAME-title, NAME-pg, and NAME-SNT. Called from \foonoderef. We have
4866 % to set \indexdummies so commands such as @code in a section title
4867 % aren't expanded. It would be nicer not to expand the titles in the
4868 % first place, but there's so many layers that that is hard to do.
4872 \dosetq{#1-title
}{Ytitle
}%
4873 \dosetq{#1-pg
}{Ypagenumber
}%
4874 \dosetq{#1-snt
}{#2}%
4877 % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
4878 % the node name, #2 the name of the Info cross-reference, #3 the printed
4879 % node name, #4 the name of the Info file, #5 the name of the printed
4880 % manual. All but the node name can be omitted.
4882 \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,
]}
4883 \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,
]}
4884 \def\ref#1{\xrefX[#1,,,,,,,
]}
4885 \def\xrefX[#1,
#2,
#3,
#4,
#5,
#6]{\begingroup
4886 \def\printedmanual{\ignorespaces #5}%
4887 \def\printednodename{\ignorespaces #3}%
4888 \setbox1=
\hbox{\printedmanual}%
4889 \setbox0=
\hbox{\printednodename}%
4891 % No printed node name was explicitly given.
4892 \expandafter\ifx\csname SETxref-automatic-section-title
\endcsname\relax
4893 % Use the node name inside the square brackets.
4894 \def\printednodename{\ignorespaces #1}%
4896 % Use the actual chapter/section title appear inside
4897 % the square brackets. Use the real section title if we have it.
4899 % It is in another manual, so we don't have it.
4900 \def\printednodename{\ignorespaces #1}%
4903 % We know the real title if we have the xref values.
4904 \def\printednodename{\refx{#1-title
}{}}%
4906 % Otherwise just copy the Info node name.
4907 \def\printednodename{\ignorespaces #1}%
4913 % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
4914 % insert empty discretionaries after hyphens, which means that it will
4915 % not find a line break at a hyphen in a node names. Since some manuals
4916 % are best written with fairly long node names, containing hyphens, this
4917 % is a loss. Therefore, we give the text of the node name again, so it
4918 % is as if TeX is seeing it for the first time.
4920 \putwordsection{} ``
\printednodename'' in
\cite{\printedmanual}%
4922 % _ (for example) has to be the character _ for the purposes of the
4923 % control sequence corresponding to the node, but it has to expand
4924 % into the usual \leavevmode...\vrule stuff for purposes of
4925 % printing. So we \turnoffactive for the \refx-snt, back on for the
4926 % printing, back off for the \refx-pg.
4927 {\normalturnoffactive
4928 % Only output a following space if the -snt ref is nonempty; for
4929 % @unnumbered and @anchor, it won't be.
4930 \setbox2 =
\hbox{\ignorespaces \refx{#1-snt
}{}}%
4931 \ifdim \wd2 >
0pt
\refx{#1-snt
}\space\fi
4934 [\printednodename],
\space
4936 \turnoffactive \putwordpage\tie\refx{#1-pg
}{}%
4940 % \dosetq is the interface for calls from other macros
4942 % Use \normalturnoffactive so that punctuation chars such as underscore
4943 % and backslash work in node names. (\turnoffactive doesn't do \.)
4946 \normalturnoffactive
4947 \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}%
4954 % \internalsetq {foo}{page} expands into
4955 % CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
4956 % When the aux file is read, ' is the escape character
4958 \def\internalsetq #1#2{'xrdef
{#1}{\csname #2\endcsname}}
4960 % Things to be expanded by \internalsetq
4962 \def\Ypagenumber{\folio}
4964 \def\Ytitle{\thissection}
4968 \def\Ysectionnumberandtype{%
4969 \ifnum\secno=
0 \putwordChapter\xreftie\the\chapno %
4970 \else \ifnum \subsecno=
0 \putwordSection\xreftie\the\chapno.
\the\secno %
4971 \else \ifnum \subsubsecno=
0 %
4972 \putwordSection\xreftie\the\chapno.
\the\secno.
\the\subsecno %
4974 \putwordSection\xreftie\the\chapno.
\the\secno.
\the\subsecno.
\the\subsubsecno %
4977 \def\Yappendixletterandtype{%
4978 \ifnum\secno=
0 \putwordAppendix\xreftie'char
\the\appendixno{}%
4979 \else \ifnum \subsecno=
0 \putwordSection\xreftie'char
\the\appendixno.
\the\secno %
4980 \else \ifnum \subsubsecno=
0 %
4981 \putwordSection\xreftie'char
\the\appendixno.
\the\secno.
\the\subsecno %
4983 \putwordSection\xreftie'char
\the\appendixno.
\the\secno.
\the\subsecno.
\the\subsubsecno %
4988 % Use TeX 3.0's \inputlineno to get the line number, for better error
4989 % messages, but if we're using an old version of TeX, don't do anything.
4991 \ifx\inputlineno\thisisundefined
4992 \let\linenumber =
\empty % Non-3.0.
4994 \def\linenumber{\the\inputlineno:
\space}
4997 % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
4998 % If its value is nonempty, SUFFIX is output afterward.
5001 \expandafter\ifx\csname X
#1\endcsname\relax
5002 % If not defined, say something at least.
5003 \angleleft un\-de\-fined
\angleright
5006 \message{\linenumber Undefined cross reference `
#1'.
}%
5009 \global\warnedxrefstrue
5010 \message{Cross reference values unknown; you must run TeX again.
}%
5015 % It's defined, so just use it.
5016 \csname X
#1\endcsname
5018 #2% Output the suffix in any case.
5021 % This is the macro invoked by entries in the aux file.
5023 \def\xrdef#1{\begingroup
5024 % Reenable \ as an escape while reading the second argument.
5026 \afterassignment\endgroup
5027 \expandafter\gdef\csname X
#1\endcsname
5030 % Read the last existing aux file, if any. No error if none exists.
5031 \def\readauxfile{\begingroup
5032 \catcode`\^^@=
\other
5033 \catcode`\^^A=
\other
5034 \catcode`\^^B=
\other
5035 \catcode`\^^C=
\other
5036 \catcode`\^^D=
\other
5037 \catcode`\^^E=
\other
5038 \catcode`\^^F=
\other
5039 \catcode`\^^G=
\other
5040 \catcode`\^^H=
\other
5041 \catcode`\^^K=
\other
5042 \catcode`\^^L=
\other
5043 \catcode`\^^N=
\other
5044 \catcode`\^^P=
\other
5045 \catcode`\^^Q=
\other
5046 \catcode`\^^R=
\other
5047 \catcode`\^^S=
\other
5048 \catcode`\^^T=
\other
5049 \catcode`\^^U=
\other
5050 \catcode`\^^V=
\other
5051 \catcode`\^^W=
\other
5052 \catcode`\^^X=
\other
5053 \catcode`\^^Z=
\other
5054 \catcode`\^^
[=
\other
5055 \catcode`\^^\=
\other
5056 \catcode`\^^
]=
\other
5057 \catcode`\^^^=
\other
5058 \catcode`\^^_=
\other
5061 % It was suggested to define this as 7, which would allow ^^e4 etc.
5062 % in xref tags, i.e., node names. But since ^^e4 notation isn't
5063 % supported in the main text, it doesn't seem desirable. Furthermore,
5064 % that is not enough: for node names that actually contain a ^
5065 % character, we would end up writing a line like this: 'xrdef {'hat
5066 % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
5067 % argument, and \hat is not an expandable control sequence. It could
5068 % all be worked out, but why? Either we support ^^ or we don't.
5070 % The other change necessary for this was to define \auxhat:
5071 % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
5072 % and then to call \auxhat in \setq.
5085 \catcode`+=
\other % avoid \+ for paranoia even though we've turned it off
5086 % Make the characters 128-255 be printing characters
5090 \catcode\count 1=
\other
5091 \advance\count 1 by
1
5092 \ifnum \count 1<
256 \loop \fi
5095 % The aux file uses ' as the escape (for now).
5096 % Turn off \ as an escape so we do not lose on
5097 % entries which were dumped with control sequences in their names.
5098 % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
5099 % Reference to such entries still does not work the way one would wish,
5100 % but at least they do not bomb out when the aux file is read in.
5107 \openin 1 \jobname.aux
5111 \global\havexrefstrue
5112 \global\warnedobstrue
5114 % Open the new aux file. TeX will close it automatically at exit.
5115 \openout\auxfile=
\jobname.aux
5121 \newcount \footnoteno
5123 % The trailing space in the following definition for supereject is
5124 % vital for proper filling; pages come out unaligned when you do a
5125 % pagealignmacro call if that space before the closing brace is
5126 % removed. (Generally, numeric constants should always be followed by a
5127 % space to prevent strange expansion errors.)
5128 \def\supereject{\par\penalty -
20000\footnoteno =
0 }
5130 % @footnotestyle is meaningful for info output only.
5131 \let\footnotestyle=
\comment
5133 \let\ptexfootnote=
\footnote
5137 % Auto-number footnotes. Otherwise like plain.
5139 \global\advance\footnoteno by \@ne
5140 \edef\thisfootno{$^
{\the\footnoteno}$
}%
5142 % In case the footnote comes at the end of a sentence, preserve the
5143 % extra spacing after we do the footnote number.
5145 \ifhmode\edef\@sf
{\spacefactor\the\spacefactor}\/
\fi
5147 % Remove inadvertent blank space before typesetting the footnote number.
5153 % Don't bother with the trickery in plain.tex to not require the
5154 % footnote text as a parameter. Our footnotes don't need to be so general.
5156 % Oh yes, they do; otherwise, @ifset and anything else that uses
5157 % \parseargline fail inside footnotes because the tokens are fixed when
5158 % the footnote is read. --karl, 16nov96.
5160 \long\gdef\footnotezzz{\insert\footins\bgroup
5161 % We want to typeset this text as a normal paragraph, even if the
5162 % footnote reference occurs in (for example) a display environment.
5163 % So reset some parameters.
5164 \interlinepenalty\interfootnotelinepenalty
5165 \splittopskip\ht\strutbox % top baseline for broken footnotes
5166 \splitmaxdepth\dp\strutbox
5167 \floatingpenalty\@MM
5172 \parindent\defaultparindent
5174 % Hang the footnote text off the number.
5176 \textindent{\thisfootno}%
5178 % Don't crash into the line above the footnote text. Since this
5179 % expands into a box, it must come within the paragraph, lest it
5180 % provide a place where TeX can split the footnote.
5182 \futurelet\next\fo@t
5184 \def\fo@t
{\ifcat\bgroup\noexpand\next \let\next\f@@t
5185 \else\let\next\f@t
\fi \next}
5186 \def\f@@t
{\bgroup\aftergroup\@foot
\let\next}
5187 \def\f@t
#1{#1\@foot
}
5188 \def\@foot
{\strut\egroup}
5190 }%end \catcode `\@=11
5192 % Set the baselineskip to #1, and the lineskip and strut size
5193 % correspondingly. There is no deep meaning behind these magic numbers
5194 % used as factors; they just match (closely enough) what Knuth defined.
5196 \def\lineskipfactor{.08333}
5197 \def\strutheightpercent{.70833}
5198 \def\strutdepthpercent {.29167}
5201 \normalbaselineskip =
#1\relax
5202 \normallineskip =
\lineskipfactor\normalbaselineskip
5204 \setbox\strutbox =
\hbox{%
5205 \vrule width0pt height
\strutheightpercent\baselineskip
5206 depth
\strutdepthpercent \baselineskip
5210 % @| inserts a changebar to the left of the current line. It should
5211 % surround any changed text. This approach does *not* work if the
5212 % change spans more than two lines of output. To handle that, we would
5213 % have adopt a much more difficult approach (putting marks into the main
5214 % vertical list for the beginning and end of each change).
5217 % \vadjust can only be used in horizontal mode.
5220 % Append this vertical mode material after the current line in the output.
5222 % We want to insert a rule with the height and depth of the current
5223 % leading; that is exactly what \strutbox is supposed to record.
5224 \vskip-
\baselineskip
5226 % \vadjust-items are inserted at the left edge of the type. So
5227 % the \llap here moves out into the left-hand margin.
5230 % For a thicker or thinner bar, change the `1pt'.
5231 \vrule height
\baselineskip width1pt
5233 % This is the space between the bar and the text.
5239 % For a final copy, take out the rectangles
5240 % that mark overfull boxes (in case you have decided
5241 % that the text looks ok even though it passes the margin).
5243 \def\finalout{\overfullrule=
0pt
}
5245 % @image. We use the macros from epsf.tex to support this.
5246 % If epsf.tex is not installed and @image is used, we complain.
5248 % Check for and read epsf.tex up front. If we read it only at @image
5249 % time, we might be inside a group, and then its definitions would get
5250 % undone and the next image would fail.
5251 \openin 1 = epsf.tex
5254 % Do not bother showing banner with post-v2.7 epsf.tex (available in
5255 % doc/epsf.tex until it shows up on ctan).
5256 \def\epsfannounce{\toks0 =
}%
5260 \newif\ifwarnednoepsf
5261 \newhelp\noepsfhelp{epsf.tex must be installed for images to
5262 work. It is also included in the Texinfo distribution, or you can get
5263 it from ftp://tug.org/tex/epsf.tex.
}
5265 % Only complain once about lack of epsf.tex.
5267 \ifx\pdfoutput\undefined
5268 \ifx\epsfbox\undefined
5269 \ifwarnednoepsf \else
5270 \errhelp =
\noepsfhelp
5271 \errmessage{epsf.tex not found, images will be ignored
}%
5272 \global\warnednoepsftrue
5275 \imagexxx #1,,,
\finish
5278 \centerline{\pdfimage #1.pdf
}%
5282 % Arguments to @image:
5283 % #1 is (mandatory) image filename; we tack on .eps extension.
5284 % #2 is (optional) width, #3 is (optional) height.
5285 % #4 is just the usual extra ignored arg for parsing this stuff.
5286 \def\imagexxx#1,
#2,
#3,
#4\finish{%
5287 % \epsfbox itself resets \epsf?size at each figure.
5288 \setbox0 =
\hbox{\ignorespaces #2}\ifdim\wd0 >
0pt
\epsfxsize=
#2\relax \fi
5289 \setbox0 =
\hbox{\ignorespaces #3}\ifdim\wd0 >
0pt
\epsfysize=
#3\relax \fi
5290 % If the image is by itself, center it.
5294 \centerline{\epsfbox{#1.eps
}}%
5297 % In the middle of a paragraph, no extra space.
5303 \message{localization,
}
5305 % @documentlanguage is usually given very early, just after
5306 % @setfilename. If done too late, it may not override everything
5307 % properly. Single argument is the language abbreviation.
5308 % It would be nice if we could set up a hyphenation file here.
5310 \def\documentlanguage{\parsearg\dodocumentlanguage}
5311 \def\dodocumentlanguage#1{%
5312 \tex % read txi-??.tex file in plain TeX.
5313 % Read the file if it exists.
5314 \openin 1 txi-
#1.tex
5316 \errhelp =
\nolanghelp
5317 \errmessage{Cannot read language file txi-
#1.tex
}%
5320 \def\temp{\input txi-
#1.tex
}%
5325 \newhelp\nolanghelp{The given language definition file cannot be found or
5326 is empty. Maybe you need to install it? In the current directory
5327 should work if nowhere else does.
}
5330 % @documentencoding should change something in TeX eventually, most
5331 % likely, but for now just recognize it.
5332 \let\documentencoding =
\comment
5335 % Page size parameters.
5337 \newdimen\defaultparindent \defaultparindent =
15pt
5339 \chapheadingskip =
15pt plus
4pt minus
2pt
5340 \secheadingskip =
12pt plus
3pt minus
2pt
5341 \subsecheadingskip =
9pt plus
2pt minus
2pt
5343 % Prevent underfull vbox error messages.
5346 % Don't be so finicky about underfull hboxes, either.
5349 % Following George Bush, just get rid of widows and orphans.
5353 % Use TeX 3.0's \emergencystretch to help line breaking, but if we're
5354 % using an old version of TeX, don't do anything. We want the amount of
5355 % stretch added to depend on the line length, hence the dependence on
5356 % \hsize. We call this whenever the paper size is set.
5358 \def\setemergencystretch{%
5359 \ifx\emergencystretch\thisisundefined
5360 % Allow us to assign to \emergencystretch anyway.
5361 \def\emergencystretch{\dimen0}%
5363 \emergencystretch =
\hsize
5364 \divide\emergencystretch by
40
5368 % Parameters in order: 1) textheight; 2) textwidth; 3) voffset;
5369 % 4) hoffset; 5) binding offset; 6) topskip. Then whoever calls us can
5370 % set \parskip and call \setleading for \baselineskip.
5372 \def\internalpagesizes#1#2#3#4#5#6{%
5375 \splittopskip =
\topskip
5378 \advance\vsize by
\topskip
5379 \outervsize =
\vsize
5380 \advance\outervsize by
2\topandbottommargin
5381 \pageheight =
\vsize
5384 \outerhsize =
\hsize
5385 \advance\outerhsize by
0.5in
5388 \normaloffset =
#4\relax
5389 \bindingoffset =
#5\relax
5391 \parindent =
\defaultparindent
5392 \setemergencystretch
5395 % @letterpaper (the default).
5396 \def\letterpaper{{\globaldefs =
1
5397 \parskip =
3pt plus
2pt minus
1pt
5398 \setleading{13.2pt
}%
5400 % If page is nothing but text, make it come out even.
5401 \internalpagesizes{46\baselineskip}{6in
}{\voffset}{.25in
}{\bindingoffset}{36pt
}%
5404 % Use @smallbook to reset parameters for 7x9.5 (or so) format.
5405 \def\smallbook{{\globaldefs =
1
5406 \parskip =
2pt plus
1pt
5409 \internalpagesizes{7.5in
}{5.in
}{\voffset}{.25in
}{\bindingoffset}{16pt
}%
5411 \lispnarrowing =
0.3in
5414 \contentsrightmargin =
0pt
5415 \deftypemargin =
0pt
5416 \defbodyindent =
.5cm
5418 \let\smalldisplay =
\smalldisplayx
5419 \let\smallexample =
\smalllispx
5420 \let\smallformat =
\smallformatx
5421 \let\smalllisp =
\smalllispx
5424 % Use @afourpaper to print on European A4 paper.
5425 \def\afourpaper{{\globaldefs =
1
5427 \parskip =
3pt plus
2pt minus
1pt
5429 \internalpagesizes{53\baselineskip}{160mm
}{\voffset}{4mm
}{\bindingoffset}{44pt
}%
5435 % A specific text layout, 24x15cm overall, intended for A4 paper. Top margin
5436 % 29mm, hence bottom margin 28mm, nominal side margin 3cm.
5437 \def\afourlatex{{\globaldefs =
1
5438 \setleading{13.6pt
}%
5441 \internalpagesizes{237mm
}{150mm
}{3.6mm
}{3.6mm
}{3mm
}{7mm
}%
5446 % Use @afourwide to print on European A4 paper in wide format.
5449 \internalpagesizes{9.5in
}{6.5in
}{\hoffset}{\normaloffset}{\bindingoffset}{7mm
}%
5454 % @pagesizes TEXTHEIGHT[,TEXTWIDTH]
5455 % Perhaps we should allow setting the margins, \topskip, \parskip,
5456 % and/or leading, also. Or perhaps we should compute them somehow.
5458 \def\pagesizes{\parsearg\pagesizesxxx}
5459 \def\pagesizesxxx#1{\pagesizesyyy #1,,
\finish}
5460 \def\pagesizesyyy#1,
#2,
#3\finish{{%
5461 \setbox0 =
\hbox{\ignorespaces #2}\ifdim\wd0 >
0pt
\hsize=
#2\relax \fi
5464 \parskip =
3pt plus
2pt minus
1pt
5465 \setleading{13.2pt
}%
5467 \internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt
}%
5470 % Set default to letter.
5474 \message{and turning on texinfo input format.
}
5476 % Define macros to output various characters with catcode for normal text.
5485 \def\normaldoublequote{"
}
5488 \def\normalunderscore{_
}
5489 \def\normalverticalbar{|
}
5491 \def\normalgreater{>
}
5494 % This macro is used to make a character print one way in ttfont
5495 % where it can probably just be output, and another way in other fonts,
5496 % where something hairier probably needs to be done.
5498 % #1 is what to print if we are indeed using \tt; #2 is what to print
5499 % otherwise. Since all the Computer Modern typewriter fonts have zero
5500 % interword stretch (and shrink), and it is reasonable to expect all
5501 % typewriter fonts to have this, we can check that font parameter.
5503 \def\ifusingtt#1#2{\ifdim \fontdimen3\the\font=
0pt
#1\else #2\fi}
5505 % Turn off all special characters except @
5506 % (and those which the user can use as if they were ordinary).
5507 % Most of these we simply print from the \tt font, but for some, we can
5508 % use math or other variants that look better in normal text.
5511 \def\activedoublequote{{\tt\char34}}
5512 \let"=
\activedoublequote
5514 \def~
{{\tt\char126}}
5520 \def_{\ifusingtt\normalunderscore\_}
5521 % Subroutine for the previous macro.
5522 \def\_{\leavevmode \kern.06em
\vbox{\hrule width
.3em height
.1ex
}}
5525 \def|
{{\tt\char124}}
5533 \def+
{{\tt \char 43}}
5534 %\catcode 27=\active
5535 %\def^^[{$\diamondsuit$}
5537 % Set up an active definition for =, but don't enable it most of the time.
5538 {\catcode`\==
\active
5539 \global\def=
{{\tt \char 61}}}
5544 % If a .fmt file is being used, characters that might appear in a file
5545 % name cannot be active until we have parsed the command line.
5546 % So turn them off again, and have \everyjob (or @setfilename) turn them on.
5547 % \otherifyactive is called near the end of this file.
5548 \def\otherifyactive{\catcode`+=
\other \catcode`
\_=
\other}
5552 % \rawbackslashxx output one backslash character in current font
5553 \global\chardef\rawbackslashxx=`\\
5554 %{\catcode`\\=\other
5555 %@gdef@rawbackslashxx{\}}
5557 % \rawbackslash redefines \ as input to do \rawbackslashxx.
5558 {\catcode`\\=
\active
5559 @gdef@rawbackslash
{@let\=@rawbackslashxx
}}
5561 % \normalbackslash outputs one backslash in fixed width font.
5562 \def\normalbackslash{{\tt\rawbackslashxx}}
5564 % Say @foo, not \foo, in error messages.
5567 % \catcode 17=0 % Define control-q
5570 % Used sometimes to turn off (effectively) the active characters
5571 % even after parsing them.
5572 @def@turnoffactive
{@let"=@normaldoublequote
5573 @let\=@realbackslash
5576 @let_=@normalunderscore
5577 @let|=@normalverticalbar
5579 @let>=@normalgreater
5582 @def@normalturnoffactive
{@let"=@normaldoublequote
5583 @let\=@normalbackslash
5586 @let_=@normalunderscore
5587 @let|=@normalverticalbar
5589 @let>=@normalgreater
5592 % Make _ and + \other characters, temporarily.
5593 % This is canceled by @fixbackslash.
5596 % If a .fmt file is being used, we don't want the `\input texinfo' to show up.
5597 % That is what \eatinput is for; after that, the `\' should revert to printing
5600 @gdef@eatinput input texinfo
{@fixbackslash
}
5601 @global@let\ = @eatinput
5603 % On the other hand, perhaps the file did not have a `\input texinfo'. Then
5604 % the first `\{ in the file would cause an error. This macro tries to fix
5605 % that, assuming it is called before the first `\' could plausibly occur.
5606 % Also back turn on active characters that might appear in the input
5607 % file name, in case not using a pre-dumped format.
5609 @gdef@fixbackslash
{@ifx\@eatinput @let\ = @normalbackslash @fi
5610 @catcode`+=@active @catcode`@_=@active
}
5612 % These look ok in all fonts, so just make them not special. The @rm below
5613 % makes sure that the current font starts out as the newly loaded cmr10
5614 @catcode`@$=@other @catcode`@
%=@other @catcode`@&=@other @catcode`@#=@other
5620 @c eval: (add-hook 'write-file-hooks 'time-stamp)
5621 @c page-delimiter: "^\\\
\message"
5622 @c time-stamp-start: "def\\\
\texinfoversion{"
5623 @c time-stamp-format: "
%:y-%02m-%02d.%H"
5624 @c time-stamp-end: "
}"