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-
03-
23.17}%
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\putwordin\undefined \gdef\putwordin{in
}\fi
103 \ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)
}\fi
104 \ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)
}\fi
105 \ifx\putwordInfo\undefined \gdef\putwordInfo{Info
}\fi
106 \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on
}\fi
107 \ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title
}\fi
108 \ifx\putwordof\undefined \gdef\putwordof{of
}\fi
109 \ifx\putwordon\undefined \gdef\putwordon{on
}\fi
110 \ifx\putwordpage\undefined \gdef\putwordpage{page
}\fi
111 \ifx\putwordsection\undefined \gdef\putwordsection{section
}\fi
112 \ifx\putwordSection\undefined \gdef\putwordSection{Section
}\fi
113 \ifx\putwordsee\undefined \gdef\putwordsee{see
}\fi
114 \ifx\putwordSee\undefined \gdef\putwordSee{See
}\fi
115 \ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents
}\fi
116 \ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents
}\fi
118 \ifx\putwordMJan\undefined \gdef\putwordMJan{January
}\fi
119 \ifx\putwordMFeb\undefined \gdef\putwordMFeb{February
}\fi
120 \ifx\putwordMMar\undefined \gdef\putwordMMar{March
}\fi
121 \ifx\putwordMApr\undefined \gdef\putwordMApr{April
}\fi
122 \ifx\putwordMMay\undefined \gdef\putwordMMay{May
}\fi
123 \ifx\putwordMJun\undefined \gdef\putwordMJun{June
}\fi
124 \ifx\putwordMJul\undefined \gdef\putwordMJul{July
}\fi
125 \ifx\putwordMAug\undefined \gdef\putwordMAug{August
}\fi
126 \ifx\putwordMSep\undefined \gdef\putwordMSep{September
}\fi
127 \ifx\putwordMOct\undefined \gdef\putwordMOct{October
}\fi
128 \ifx\putwordMNov\undefined \gdef\putwordMNov{November
}\fi
129 \ifx\putwordMDec\undefined \gdef\putwordMDec{December
}\fi
131 \ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro
}\fi
132 \ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form
}\fi
133 \ifx\putwordDefivar\undefined \gdef\putwordDefivar{Instance Variable
}\fi
134 \ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable
}\fi
135 \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option
}\fi
136 \ifx\putwordDeftypevar\undefined\gdef\putwordDeftypevar{Variable
}\fi
137 \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function
}\fi
138 \ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function
}\fi
144 \hyphenation{ap-pen-dix
}
145 \hyphenation{mini-buf-fer mini-buf-fers
}
147 \hyphenation{white-space
}
149 % Margin to add to right of even pages, to left of odd pages.
150 \newdimen \bindingoffset
151 \newdimen \normaloffset
152 \newdimen\pagewidth \newdimen\pageheight
154 % Sometimes it is convenient to have everything in the transcript file
155 % and nothing on the terminal. We don't just call \tracingall here,
156 % since that produces some useless output on the terminal.
158 \def\gloggingall{\begingroup \globaldefs =
1 \loggingall \endgroup}%
159 \ifx\eTeXversion\undefined
160 \def\loggingall{\tracingcommands2 \tracingstats2
161 \tracingpages1 \tracingoutput1 \tracinglostchars1
162 \tracingmacros2 \tracingparagraphs1 \tracingrestores1
163 \showboxbreadth\maxdimen\showboxdepth\maxdimen
166 \def\loggingall{\tracingcommands3 \tracingstats2
167 \tracingpages1 \tracingoutput1 \tracinglostchars1
168 \tracingmacros2 \tracingparagraphs1 \tracingrestores1
169 \tracingscantokens1 \tracingassigns1 \tracingifs1
170 \tracinggroups1 \tracingnesting2
171 \showboxbreadth\maxdimen\showboxdepth\maxdimen
175 % For @cropmarks command.
176 % Do @cropmarks to get crop marks.
179 \let\cropmarks =
\cropmarkstrue
181 % Dimensions to add cropmarks at corners.
182 % Added by P. A. MacKay, 12 Nov. 1986
184 \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
185 \newdimen\cornerlong \cornerlong=
1pc
186 \newdimen\cornerthick \cornerthick=
.3pt
187 \newdimen\topandbottommargin \topandbottommargin=
.75in
189 % Main output routine.
191 \output =
{\onepageout{\pagecontents\PAGE}}
196 % \onepageout takes a vbox as an argument. Note that \pagecontents
197 % does insertions, but you have to call it yourself.
199 \ifcropmarks \hoffset=
0pt
\else \hoffset=
\normaloffset \fi
201 \ifodd\pageno \advance\hoffset by
\bindingoffset
202 \else \advance\hoffset by -
\bindingoffset\fi
204 % Do this outside of the \shipout so @code etc. will be expanded in
205 % the headline as they should be, not taken literally (outputting ''code).
206 \setbox\headlinebox =
\vbox{\let\hsize=
\pagewidth \makeheadline}%
207 \setbox\footlinebox =
\vbox{\let\hsize=
\pagewidth \makefootline}%
210 % Have to do this stuff outside the \shipout because we want it to
211 % take effect in \write's, yet the group defined by the \vbox ends
212 % before the \shipout runs.
214 \escapechar = `\\
% use backslash in output files.
215 \indexdummies % don't expand commands in the output.
216 \normalturnoffactive % \ in index entries must not stay \, e.g., if
217 % the page break happens to be in the middle of an example.
219 \ifcropmarks \vbox to
\outervsize\bgroup
221 \vskip-
\topandbottommargin
223 \line{\ewtop\hfil\ewtop}%
226 \vbox{\moveleft\cornerthick\nstop}%
228 \vbox{\moveright\cornerthick\nstop}%
231 \vskip\topandbottommargin
233 \hfil % center the page within the outer (page) hsize.
234 \ifodd\pageno\hskip\bindingoffset\fi
240 \ifdim\ht\footlinebox >
0pt
241 % Only leave this space if the footline is nonempty.
242 % (We lessened \vsize for it in \oddfootingxxx.)
243 % The \baselineskip=24pt in plain's \makefootline has no effect.
244 \vskip 2\baselineskip
249 \egroup % end of \vbox\bgroup
250 \hfil\egroup % end of (centering) \line\bgroup
251 \vskip\topandbottommargin plus1fill minus1fill
252 \boxmaxdepth =
\cornerthick
255 \vbox{\moveleft\cornerthick\nsbot}%
257 \vbox{\moveright\cornerthick\nsbot}%
260 \line{\ewbot\hfil\ewbot}%
262 \egroup % \vbox from first cropmarks clause
264 }% end of \shipout\vbox
265 }% end of group with \turnoffactive
267 \ifnum\outputpenalty>-
20000 \else\dosupereject\fi
270 \newinsert\margin \dimen\margin=
\maxdimen
272 \def\pagebody#1{\vbox to
\pageheight{\boxmaxdepth=
\maxdepth #1}}
274 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
275 % marginal hacks, juha@viisa.uucp (Juha Takala)
276 \ifvoid\margin\else % marginal info is present
277 \rlap{\kern\hsize\vbox to
\z@
{\kern1pt\box\margin \vss}}\fi
278 \dimen@=
\dp#1 \unvbox#1
279 \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
280 \ifr@ggedbottom
\kern-
\dimen@
\vfil \fi}
283 % Here are the rules for the cropmarks. Note that they are
284 % offset so that the space between them is truly \outerhsize or \outervsize
285 % (P. A. MacKay, 12 November, 1986)
287 \def\ewtop{\vrule height
\cornerthick depth0pt width
\cornerlong}
289 {\hrule height
\cornerthick depth
\cornerlong width
\cornerthick}}
290 \def\ewbot{\vrule height0pt depth
\cornerthick width
\cornerlong}
292 {\hrule height
\cornerlong depth
\cornerthick width
\cornerthick}}
294 % Parse an argument, then pass it to #1. The argument is the rest of
295 % the input line (except we remove a trailing comment). #1 should be a
296 % macro which expects an ordinary undelimited TeX argument.
302 \futurelet\temp\parseargx
305 % If the next token is an obeyed space (from an @example environment or
306 % the like), remove it and recurse. Otherwise, we're done.
308 % \obeyedspace is defined far below, after the definition of \sepspaces.
309 \ifx\obeyedspace\temp
310 \expandafter\parseargdiscardspace
312 \expandafter\parseargline
316 % Remove a single space (as the delimiter token to the macro call).
318 \gdef\parseargdiscardspace {\futurelet\temp\parseargx}}
321 \gdef\parseargline#1^^M
{%
322 \endgroup % End of the group started in \parsearg.
324 % First remove any @c comment, then any @comment.
325 % Result of each macro is put in \toks0.
326 \argremovec #1\c\relax %
327 \expandafter\argremovecomment \the\toks0 \comment\relax %
329 % Call the caller's macro, saved as \next in \parsearg.
330 \expandafter\next\expandafter{\the\toks0}%
334 % Since all \c{,omment} does is throw away the argument, we can let TeX
335 % do that for us. The \relax here is matched by the \relax in the call
336 % in \parseargline; it could be more or less anything, its purpose is
337 % just to delimit the argument to the \c.
338 \def\argremovec#1\c#2\relax{\toks0 =
{#1}}
339 \def\argremovecomment#1\comment#2\relax{\toks0 =
{#1}}
341 % \argremovec{,omment} might leave us with trailing spaces, though; e.g.,
342 % @end itemize @c foo
343 % will have two active spaces as part of the argument with the
344 % `itemize'. Here we remove all active spaces from #1, and assign the
347 % This loses if there are any *other* active characters besides spaces
348 % in the argument -- _ ^ +, for example -- since they get expanded.
349 % Fortunately, Texinfo does not define any such commands. (If it ever
350 % does, the catcode of the characters in questionwill have to be changed
351 % here.) But this means we cannot call \removeactivespaces as part of
352 % \argremovec{,omment}, since @c uses \parsearg, and thus the argument
353 % that \parsearg gets might well have any character at all in it.
355 \def\removeactivespaces#1{%
359 \global\toks0 =
\expandafter{\temp}%
363 % Change the active space to expand to nothing.
367 \gdef\ignoreactivespaces{\obeyspaces\let =
\empty}
371 \def\flushcr{\ifx\par\lisppar \def\next#
#1{}\else \let\next=
\relax \fi \next}
373 %% These are used to keep @begin/@end levels from running away
374 %% Call \inENV within environments (after a \begingroup)
375 \newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
377 \ifENV\errmessage{Still within an environment; press RETURN to continue
}
378 \endgroup\fi} % This is not perfect, but it should reduce lossage
380 % @begin foo is the same as @foo, for now.
381 \newhelp\EMsimple{Press RETURN to continue.
}
383 \outer\def\begin{\parsearg\beginxxx}
386 \expandafter\ifx\csname #1\endcsname\relax
387 {\errhelp=
\EMsimple \errmessage{Undefined command @begin
#1}}\else
388 \csname #1\endcsname\fi}
390 % @end foo executes the definition of \Efoo.
392 \def\end{\parsearg\endxxx}
394 \removeactivespaces{#1}%
395 \edef\endthing{\the\toks0}%
397 \expandafter\ifx\csname E
\endthing\endcsname\relax
398 \expandafter\ifx\csname \endthing\endcsname\relax
399 % There's no \foo, i.e., no ``environment'' foo.
401 \errmessage{Undefined command `@end
\endthing'
}%
403 \unmatchedenderror\endthing
406 % Everything's ok; the right environment has been started.
407 \csname E
\endthing\endcsname
411 % There is an environment #1, but it hasn't been started. Give an error.
413 \def\unmatchedenderror#1{%
415 \errmessage{This `@end
#1' doesn't have a matching `@
#1'
}%
418 % Define the control sequence \E#1 to give an unmatched @end error.
420 \def\defineunmatchedend#1{%
421 \expandafter\def\csname E
#1\endcsname{\unmatchedenderror{#1}}%
425 % Single-spacing is done by various environments (specifically, in
426 % \nonfillstart and \quotations).
427 \newskip\singlespaceskip \singlespaceskip =
12.5pt
429 % Why was this kern here? It messes up equalizing space above and below
430 % environments. --karl, 6may93
431 %{\advance \baselineskip by -\singlespaceskip
432 %\kern \baselineskip}%
433 \setleading \singlespaceskip
436 %% Simple single-character @ commands
439 % Kludge this until the fonts are right (grr).
442 % This is turned off because it was never documented
443 % and you can use @w{...} around a quote to suppress ligatures.
444 %% Define @` and @' to be the same as ` and '
445 %% but suppressing ligatures.
449 % Used to generate quoted braces.
450 \def\mylbrace {{\tt\char123}}
451 \def\myrbrace {{\tt\char125}}
455 % Definitions to produce actual \{ & \} command in an index.
456 \catcode`\
{ =
12 \catcode`\
} =
12
457 \catcode`\
[ =
1 \catcode`\
] =
2
458 \catcode`\@ =
0 \catcode`\\ =
12
463 % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
464 % Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H.
467 \def\ringaccent#1{{\accent23 #1}}
472 % Other special characters: @questiondown @exclamdown
473 % Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss.
474 \def\questiondown{?`
}
477 % Dotless i and dotless j, used for accents.
482 \ifx\temp\imacro \ptexi
483 \else\ifx\temp\jmacro \j
484 \else \errmessage{@dotless can be used only with i or j
}%
488 % Be sure we're in horizontal mode when doing a tie, since we make space
489 % equivalent to this in @example-like environments. Otherwise, a space
490 % at the beginning of a line will start with \penalty -- and
491 % since \penalty is valid in vertical mode, we'd end up putting the
492 % penalty on the vertical list instead of in the new paragraph.
494 % Avoid using \@M directly, because that causes trouble
495 % if the definition is written into an index file.
496 \global\let\tiepenalty = \@M
497 \gdef\tie{\leavevmode\penalty\tiepenalty\
}
500 % @: forces normal size whitespace following.
501 \def\:
{\spacefactor=
1000 }
503 % @* forces a line break.
504 \def\*
{\hfil\break\hbox{}\ignorespaces}
506 % @. is an end-of-sentence period.
507 \def\.
{.
\spacefactor=
3000 }
509 % @! is an end-of-sentence bang.
510 \def\!
{!
\spacefactor=
3000 }
512 % @? is an end-of-sentence query.
513 \def\?
{?
\spacefactor=
3000 }
515 % @w prevents a word break. Without the \leavevmode, @w at the
516 % beginning of a paragraph, when TeX is still in vertical mode, would
517 % produce a whole line of output instead of starting the paragraph.
518 \def\w#1{\leavevmode\hbox{#1}}
520 % @group ... @end group forces ... to be all on one page, by enclosing
521 % it in a TeX vbox. We use \vtop instead of \vbox to construct the box
522 % to keep its height that of a normal line. According to the rules for
523 % \topskip (p.114 of the TeXbook), the glue inserted is
524 % max (\topskip - \ht (first item), 0). If that height is large,
525 % therefore, no glue is inserted, and the space between the headline and
526 % the text is small, which looks bad.
528 \def\group{\begingroup
529 \ifnum\catcode13=
\active \else
530 \errhelp =
\groupinvalidhelp
531 \errmessage{@group invalid in context where filling is enabled
}%
534 % The \vtop we start below produces a box with normal height and large
535 % depth; thus, TeX puts \baselineskip glue before it, and (when the
536 % next line of text is done) \lineskip glue after it. (See p.82 of
537 % the TeXbook.) Thus, space below is not quite equal to space
538 % above. But it's pretty close.
540 \egroup % End the \vtop.
541 \endgroup % End the \group.
545 % We have to put a strut on the last line in case the @group is in
546 % the midst of an example, rather than completely enclosing it.
547 % Otherwise, the interline space between the last line of the group
548 % and the first line afterwards is too small. But we can't put the
549 % strut in \Egroup, since there it would be on a line by itself.
550 % Hence this just inserts a strut at the beginning of each line.
551 \everypar =
{\strut}%
553 % Since we have a strut on every line, we don't need any of TeX's
554 % normal interline spacing.
557 % OK, but now we have to do something about blank
558 % lines in the input in @example-like environments, which normally
559 % just turn into \lisppar, which will insert no space now that we've
560 % turned off the interline space. Simplest is to make them be an
563 \edef\par{\leavevmode \par}%
565 % Reset ^^M's definition to new definition of \par.
569 % Do @comment since we are called inside an environment such as
570 % @example, where each end-of-line in the input causes an
571 % end-of-line in the output. We don't want the end-of-line after
572 % the `@group' to put extra space in the output. Since @group
573 % should appear on a line by itself (according to the Texinfo
574 % manual), we don't worry about eating any user text.
578 % TeX puts in an \escapechar (i.e., `@') at the beginning of the help
579 % message, so this ends up printing `@group can only ...'.
581 \newhelp\groupinvalidhelp{%
582 group can only be used in environments such as @example,^^J
%
583 where each line of input produces a line of output.
}
585 % @need space-in-mils
586 % forces a page break if there is not space-in-mils remaining.
588 \newdimen\mil \mil=
0.001in
590 \def\need{\parsearg\needx}
592 % Old definition--didn't work.
593 %\def\needx #1{\par %
594 %% This method tries to make TeX break the page naturally
595 %% if the depth of the box does not fit.
597 %\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak
602 % Go into vertical mode, so we don't make a big box in the middle of a
606 % Don't add any leading before our big empty box, but allow a page
607 % break, since the best break might be right here.
610 \vtop to
#1\mil{\vfil}%
612 % TeX does not even consider page breaks if a penalty added to the
613 % main vertical list is 10000 or more. But in order to see if the
614 % empty box we just added fits on the page, we must make it consider
615 % page breaks. On the other hand, we don't want to actually break the
616 % page after the empty box. So we use a penalty of 9999.
618 % There is an extremely small chance that TeX will actually break the
619 % page at this \penalty, if there are no other feasible breakpoints in
620 % sight. (If the user is using lots of big @group commands, which
621 % almost-but-not-quite fill up a page, TeX will have a hard time doing
622 % good page breaking, for example.) However, I could not construct an
623 % example where a page broke at this \penalty; if it happens in a real
624 % document, then we can reconsider our strategy.
627 % Back up by the size of the box, whether we did a page break or not.
630 % Do not allow a page break right after this kern.
634 % @br forces paragraph break
638 % @dots{} output an ellipsis using the current font.
639 % We do .5em per period so that it has the same spacing in a typewriter
640 % font as three actual period characters.
645 \hskip 0pt plus
0.25fil minus
0.25fil
647 \hskip 0pt plus
0.5fil minus
0.5fil
651 % @enddots{} is an end-of-sentence ellipsis.
656 \hskip 0pt plus
0.25fil minus
0.25fil
658 \hskip 0pt plus
0.5fil minus
0.5fil
664 % @page forces the start of a new page
666 \def\page{\par\vfill\supereject}
669 % outputs text on separate line in roman font, starting at standard page margin
671 % This records the amount of indent in the innermost environment.
672 % That's how much \exdent should take out.
673 \newskip\exdentamount
675 % This defn is used inside fill environments such as @defun.
676 \def\exdent{\parsearg\exdentyyy}
677 \def\exdentyyy #1{{\hfil\break\hbox{\kern -
\exdentamount{\rm#1}}\hfil\break}}
679 % This defn is used inside nofill environments such as @example.
680 \def\nofillexdent{\parsearg\nofillexdentyyy}
681 \def\nofillexdentyyy #1{{\advance \leftskip by -
\exdentamount
682 \leftline{\hskip\leftskip{\rm#1}}}}
684 % @inmargin{TEXT} puts TEXT in the margin next to the current paragraph.
687 \strut\vadjust{\nobreak\kern-
\strutdepth
688 \vtop to
\strutdepth{\baselineskip\strutdepth\vss
689 \llap{\rightskip=
\inmarginspacing \vbox{\noindent #1}}\null}}}
690 \newskip\inmarginspacing \inmarginspacing=
1cm
691 \def\strutdepth{\dp\strutbox}
693 %\hbox{{\rm#1}}\hfil\break}}
695 % @include file insert text of that file as input.
696 % Allow normal characters that we make active in the argument (a file name).
697 \def\include{\begingroup
706 \parsearg\includezzz}
707 % Restore active chars for included file.
708 \def\includezzz#1{\endgroup\begingroup
709 % Read the included file in a group so nested @include's work.
716 % @center line outputs that line, centered
718 \def\center{\parsearg\centerzzz}
719 \def\centerzzz #1{{\advance\hsize by -
\leftskip
720 \advance\hsize by -
\rightskip
723 % @sp n outputs n lines of vertical space
725 \def\sp{\parsearg\spxxx}
726 \def\spxxx #1{\vskip #1\baselineskip}
728 % @comment ...line which is ignored...
729 % @c is the same as @comment
730 % @ignore ... @end ignore is another way to write a comment
732 \def\comment{\begingroup \catcode`\^^M=
\other%
733 \catcode`\@=
\other \catcode`\
{=
\other \catcode`\
}=
\other%
735 {\catcode`\^^M=
\other \gdef\commentxxx#1^^M
{\endgroup}}
739 % @paragraphindent NCHARS
740 % We'll use ems for NCHARS, close enough.
741 % We cannot implement @paragraphindent asis, though.
743 \def\asisword{asis
} % no translation, these are keywords
746 \def\paragraphindent{\parsearg\doparagraphindent}
747 \def\doparagraphindent#1{%
752 \defaultparindent =
0pt
754 \defaultparindent =
#1em
757 \parindent =
\defaultparindent
760 % @exampleindent NCHARS
761 % We'll use ems for NCHARS like @paragraphindent.
762 % It seems @exampleindent asis isn't necessary, but
763 % I preserve it to make it similar to @paragraphindent.
764 \def\exampleindent{\parsearg\doexampleindent}
765 \def\doexampleindent#1{%
772 \lispnarrowing =
#1em
777 % @asis just yields its argument. Used with @table, for example.
781 % @math means output in math mode.
782 % We don't use $'s directly in the definition of \math because control
783 % sequences like \math are expanded when the toc file is written. Then,
784 % we read the toc file back, the $'s will be normal characters (as they
785 % should be, according to the definition of Texinfo). So we must use a
786 % control sequence to switch into and out of math mode.
788 % This isn't quite enough for @math to work properly in indices, but it
789 % seems unlikely it will ever be needed there.
791 \let\implicitmath = $
792 \def\math#1{\implicitmath #1\implicitmath}
794 % @bullet and @minus need the same treatment as @math, just above.
795 \def\bullet{\implicitmath\ptexbullet\implicitmath}
796 \def\minus{\implicitmath-
\implicitmath}
798 % @refill is a no-op.
801 % If working on a large document in chapters, it is convenient to
802 % be able to disable indexing, cross-referencing, and contents, for test runs.
803 % This is done with @novalidate (before @setfilename).
805 \newif\iflinks \linkstrue % by default we want the aux files.
806 \let\novalidate =
\linksfalse
808 % @setfilename is done at the beginning of every texinfo file.
809 % So open here the files we need to have open while reading the input.
810 % This makes it possible to make a .fmt file for texinfo.
814 \fi % \openindices needs to do some work in any case.
816 \fixbackslash % Turn off hack to swallow `\input texinfo'.
817 \global\let\setfilename=
\comment % Ignore extra @setfilename cmds.
819 % If texinfo.cnf is present on the system, read it.
820 % Useful for site-wide @afourpaper, etc.
821 % Just to be on the safe side, close the input stream before the \input.
822 \openin 1 texinfo.cnf
823 \ifeof1 \let\temp=
\relax \else \def\temp{\input texinfo.cnf
}\fi
827 \comment % Ignore the actual filename.
830 % Called from \setfilename.
842 \outer\def\bye{\pagealignmacro\tracingstats=
1\ptexend}
846 % Font-change commands.
848 % Texinfo sort of supports the sans serif font style, which plain TeX does not.
849 % So we set up a \sf analogous to plain's \rm, etc.
851 \def\sf{\fam=
\sffam \tensf}
852 \let\li =
\sf % Sometimes we call it \li, not \sf.
854 % We don't need math for this one.
857 % Use Computer Modern fonts at \magstephalf (11pt).
858 \newcount\mainmagstep
859 \mainmagstep=
\magstephalf
861 % Set the font macro #1 to the font named #2, adding on the
862 % specified font prefix (normally `cm').
863 % #3 is the font's design size, #4 is a scale factor
864 \def\setfont#1#2#3#4{\font#1=
\fontprefix#2#3 scaled
#4}
866 % Use cm as the default font prefix.
867 % To specify the font prefix, you must define \fontprefix
868 % before you read in texinfo.tex.
869 \ifx\fontprefix\undefined
872 % Support font families that don't use the same naming scheme as CM.
874 \def\rmbshape{bx
} %where the normal face is bold
890 \let\mainmagstep=
\magstep1
891 \setfont\textrm\rmshape{12}{1000}
892 \setfont\texttt\ttshape{12}{1000}
894 \setfont\textrm\rmshape{10}{\mainmagstep}
895 \setfont\texttt\ttshape{10}{\mainmagstep}
897 % Instead of cmb10, you many want to use cmbx10.
898 % cmbx10 is a prettier font on its own, but cmb10
899 % looks better when embedded in a line with cmr10.
900 \setfont\textbf\bfshape{10}{\mainmagstep}
901 \setfont\textit\itshape{10}{\mainmagstep}
902 \setfont\textsl\slshape{10}{\mainmagstep}
903 \setfont\textsf\sfshape{10}{\mainmagstep}
904 \setfont\textsc\scshape{10}{\mainmagstep}
905 \setfont\textttsl\ttslshape{10}{\mainmagstep}
906 \font\texti=cmmi10 scaled
\mainmagstep
907 \font\textsy=cmsy10 scaled
\mainmagstep
909 % A few fonts for @defun, etc.
910 \setfont\defbf\bxshape{10}{\magstep1} %was 1314
911 \setfont\deftt\ttshape{10}{\magstep1}
912 \def\df{\let\tentt=
\deftt \let\tenbf =
\defbf \bf}
914 % Fonts for indices and small examples (9pt).
915 % We actually use the slanted font rather than the italic,
916 % because texinfo normally uses the slanted fonts for that.
917 % Do not make many font distinctions in general in the index, since they
918 % aren't very useful.
919 \setfont\ninett\ttshape{9}{1000}
920 \setfont\ninettsl\ttslshape{10}{900}
921 \setfont\indrm\rmshape{9}{1000}
922 \setfont\indit\itshape{9}{1000}
923 \setfont\indsl\slshape{9}{1000}
925 \let\indttsl=
\ninettsl
928 \setfont\indsc\scshape{10}{900}
932 % Fonts for title page:
933 \setfont\titlerm\rmbshape{12}{\magstep3}
934 \setfont\titleit\itbshape{10}{\magstep4}
935 \setfont\titlesl\slbshape{10}{\magstep4}
936 \setfont\titlett\ttbshape{12}{\magstep3}
937 \setfont\titlettsl\ttslshape{10}{\magstep4}
938 \setfont\titlesf\sfbshape{17}{\magstep1}
939 \let\titlebf=
\titlerm
940 \setfont\titlesc\scbshape{10}{\magstep4}
941 \font\titlei=cmmi12 scaled
\magstep3
942 \font\titlesy=cmsy10 scaled
\magstep4
943 \def\authorrm{\secrm}
945 % Chapter (and unnumbered) fonts (17.28pt).
946 \setfont\chaprm\rmbshape{12}{\magstep2}
947 \setfont\chapit\itbshape{10}{\magstep3}
948 \setfont\chapsl\slbshape{10}{\magstep3}
949 \setfont\chaptt\ttbshape{12}{\magstep2}
950 \setfont\chapttsl\ttslshape{10}{\magstep3}
951 \setfont\chapsf\sfbshape{17}{1000}
953 \setfont\chapsc\scbshape{10}{\magstep3}
954 \font\chapi=cmmi12 scaled
\magstep2
955 \font\chapsy=cmsy10 scaled
\magstep3
957 % Section fonts (14.4pt).
958 \setfont\secrm\rmbshape{12}{\magstep1}
959 \setfont\secit\itbshape{10}{\magstep2}
960 \setfont\secsl\slbshape{10}{\magstep2}
961 \setfont\sectt\ttbshape{12}{\magstep1}
962 \setfont\secttsl\ttslshape{10}{\magstep2}
963 \setfont\secsf\sfbshape{12}{\magstep1}
965 \setfont\secsc\scbshape{10}{\magstep2}
966 \font\seci=cmmi12 scaled
\magstep1
967 \font\secsy=cmsy10 scaled
\magstep2
969 % \setfont\ssecrm\bxshape{10}{\magstep1} % This size an font looked bad.
970 % \setfont\ssecit\itshape{10}{\magstep1} % The letters were too crowded.
971 % \setfont\ssecsl\slshape{10}{\magstep1}
972 % \setfont\ssectt\ttshape{10}{\magstep1}
973 % \setfont\ssecsf\sfshape{10}{\magstep1}
975 %\setfont\ssecrm\bfshape{10}{1315} % Note the use of cmb rather than cmbx.
976 %\setfont\ssecit\itshape{10}{1315} % Also, the size is a little larger than
977 %\setfont\ssecsl\slshape{10}{1315} % being scaled magstep1.
978 %\setfont\ssectt\ttshape{10}{1315}
979 %\setfont\ssecsf\sfshape{10}{1315}
983 % Subsection fonts (13.15pt).
984 \setfont\ssecrm\rmbshape{12}{\magstephalf}
985 \setfont\ssecit\itbshape{10}{1315}
986 \setfont\ssecsl\slbshape{10}{1315}
987 \setfont\ssectt\ttbshape{12}{\magstephalf}
988 \setfont\ssecttsl\ttslshape{10}{1315}
989 \setfont\ssecsf\sfbshape{12}{\magstephalf}
991 \setfont\ssecsc\scbshape{10}{\magstep1}
992 \font\sseci=cmmi12 scaled
\magstephalf
993 \font\ssecsy=cmsy10 scaled
1315
994 % The smallcaps and symbol fonts should actually be scaled \magstep1.5,
995 % but that is not a standard magnification.
997 % In order for the font changes to affect most math symbols and letters,
998 % we have to define the \textfont of the standard families. Since
999 % texinfo doesn't allow for producing subscripts and superscripts, we
1000 % don't bother to reset \scriptfont and \scriptscriptfont (which would
1001 % also require loading a lot more fonts).
1003 \def\resetmathfonts{%
1004 \textfont0 =
\tenrm \textfont1 =
\teni \textfont2 =
\tensy
1005 \textfont\itfam =
\tenit \textfont\slfam =
\tensl \textfont\bffam =
\tenbf
1006 \textfont\ttfam =
\tentt \textfont\sffam =
\tensf
1010 % The font-changing commands redefine the meanings of \tenSTYLE, instead
1011 % of just \STYLE. We do this so that font changes will continue to work
1012 % in math mode, where it is the current \fam that is relevant in most
1013 % cases, not the current font. Plain TeX does \def\bf{\fam=\bffam
1014 % \tenbf}, for example. By redefining \tenbf, we obviate the need to
1015 % redefine \bf itself.
1017 \let\tenrm=
\textrm \let\tenit=
\textit \let\tensl=
\textsl
1018 \let\tenbf=
\textbf \let\tentt=
\texttt \let\smallcaps=
\textsc
1019 \let\tensf=
\textsf \let\teni=
\texti \let\tensy=
\textsy \let\tenttsl=
\textttsl
1022 \let\tenrm=
\titlerm \let\tenit=
\titleit \let\tensl=
\titlesl
1023 \let\tenbf=
\titlebf \let\tentt=
\titlett \let\smallcaps=
\titlesc
1024 \let\tensf=
\titlesf \let\teni=
\titlei \let\tensy=
\titlesy
1025 \let\tenttsl=
\titlettsl
1026 \resetmathfonts \setleading{25pt
}}
1027 \def\titlefont#1{{\titlefonts\rm #1}}
1029 \let\tenrm=
\chaprm \let\tenit=
\chapit \let\tensl=
\chapsl
1030 \let\tenbf=
\chapbf \let\tentt=
\chaptt \let\smallcaps=
\chapsc
1031 \let\tensf=
\chapsf \let\teni=
\chapi \let\tensy=
\chapsy \let\tenttsl=
\chapttsl
1032 \resetmathfonts \setleading{19pt
}}
1034 \let\tenrm=
\secrm \let\tenit=
\secit \let\tensl=
\secsl
1035 \let\tenbf=
\secbf \let\tentt=
\sectt \let\smallcaps=
\secsc
1036 \let\tensf=
\secsf \let\teni=
\seci \let\tensy=
\secsy \let\tenttsl=
\secttsl
1037 \resetmathfonts \setleading{16pt
}}
1039 \let\tenrm=
\ssecrm \let\tenit=
\ssecit \let\tensl=
\ssecsl
1040 \let\tenbf=
\ssecbf \let\tentt=
\ssectt \let\smallcaps=
\ssecsc
1041 \let\tensf=
\ssecsf \let\teni=
\sseci \let\tensy=
\ssecsy \let\tenttsl=
\ssecttsl
1042 \resetmathfonts \setleading{15pt
}}
1043 \let\subsubsecfonts =
\subsecfonts % Maybe make sssec fonts scaled magstephalf?
1045 \let\tenrm=
\indrm \let\tenit=
\indit \let\tensl=
\indsl
1046 \let\tenbf=
\indbf \let\tentt=
\indtt \let\smallcaps=
\indsc
1047 \let\tensf=
\indsf \let\teni=
\indi \let\tensy=
\indsy \let\tenttsl=
\indttsl
1048 \resetmathfonts \setleading{12pt
}}
1050 % Set up the default fonts, so we can use them for creating boxes.
1054 % Define these so they can be easily changed for other fonts.
1055 \def\angleleft{$
\langle$
}
1056 \def\angleright{$
\rangle$
}
1058 % Count depth in font-changes, for error checks
1059 \newcount\fontdepth \fontdepth=
0
1061 % Fonts for short table of contents.
1062 \setfont\shortcontrm\rmshape{12}{1000}
1063 \setfont\shortcontbf\bxshape{12}{1000}
1064 \setfont\shortcontsl\slshape{12}{1000}
1066 %% Add scribe-like font environments, plus @l for inline lisp (usually sans
1067 %% serif) and @ii for TeX italic
1069 % \smartitalic{ARG} outputs arg in italics, followed by an italic correction
1070 % unless the following character is such as not to need one.
1071 \def\smartitalicx{\ifx\next,
\else\ifx\next-
\else\ifx\next.
\else\/
\fi\fi\fi}
1072 \def\smartslanted#1{{\sl #1}\futurelet\next\smartitalicx}
1073 \def\smartitalic#1{{\it #1}\futurelet\next\smartitalicx}
1076 \let\var=
\smartslanted
1077 \let\dfn=
\smartslanted
1078 \let\emph=
\smartitalic
1079 \let\cite=
\smartslanted
1084 % We can't just use \exhyphenpenalty, because that only has effect at
1085 % the end of a paragraph. Restore normal hyphenation at the end of the
1086 % group within which \nohyphenation is presumably called.
1088 \def\nohyphenation{\hyphenchar\font = -
1 \aftergroup\restorehyphenation}
1089 \def\restorehyphenation{\hyphenchar\font = `-
}
1092 {\tt \rawbackslash \frenchspacing #1}%
1096 \def\samp#1{`
\tclose{#1}'
\null}
1097 \setfont\smallrm\rmshape{8}{1000}
1099 \def\key#1{{\smallrm\textfont2=
\smallsy \leavevmode\hbox{%
1100 \raise0.4pt
\hbox{\angleleft}\kern-
.08em
\vtop{%
1101 \vbox{\hrule\kern-
0.4pt
1102 \hbox{\raise0.4pt
\hbox{\vphantom{\angleleft}}#1}}%
1104 \kern-
.06em
\raise0.4pt
\hbox{\angleright}}}}
1105 % The old definition, with no lozenge:
1106 %\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
1107 \def\ctrl #1{{\tt \rawbackslash \hat}#1}
1109 % @file, @option are the same as @samp.
1113 % @code is a modification of @t,
1114 % which makes spaces the same size as normal in the surrounding text.
1117 % Change normal interword space to be same as for the current font.
1118 \spaceskip =
\fontdimen2\font
1120 % Switch to typewriter.
1123 % But `\ ' produces the large typewriter interword space.
1124 \def\
{{\spaceskip =
0pt
{} }}%
1126 % Turn off hyphenation.
1136 % We *must* turn on hyphenation at `-' and `_' in \code.
1137 % Otherwise, it is too hard to avoid overfull hboxes
1138 % in the Emacs manual, the Library manual, etc.
1140 % Unfortunately, TeX uses one parameter (\hyphenchar) to control
1141 % both hyphenation at - and hyphenation within words.
1142 % We must therefore turn them both off (\tclose does that)
1143 % and arrange explicitly to hyphenate at a dash.
1149 \global\def\code{\begingroup
1150 \catcode`\-=
\active \let-
\codedash
1151 \catcode`
\_=
\active \let_\codeunder
1155 % If we end up with any active - characters when handling the index,
1156 % just treat them as a normal -.
1157 \global\def\indexbreaks{\catcode`\-=
\active \let-
\realdash}
1161 \def\codedash{-
\discretionary{}{}{}}
1162 \def\codeunder{\ifusingtt{\normalunderscore\discretionary{}{}{}}{\_}}
1163 \def\codex #1{\tclose{#1}\endgroup}
1165 %\let\exp=\tclose %Was temporary
1167 % @kbd is like @code, except that if the argument is just one @key command,
1168 % then @kbd has no effect.
1170 % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
1171 % `example' (@kbd uses ttsl only inside of @example and friends),
1172 % or `code' (@kbd uses normal tty font always).
1173 \def\kbdinputstyle{\parsearg\kbdinputstylexxx}
1174 \def\kbdinputstylexxx#1{%
1176 \ifx\arg\worddistinct
1177 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
1178 \else\ifx\arg\wordexample
1179 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
1180 \else\ifx\arg\wordcode
1181 \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
1184 \def\worddistinct{distinct
}
1185 \def\wordexample{example
}
1188 % Default is kbdinputdistinct. (Too much of a hassle to call the macro,
1189 % the catcodes are wrong for parsearg to work.)
1190 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}
1193 \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??
}%
1194 \ifx\one\xkey\ifx\threex\three \key{#2}%
1195 \else{\tclose{\kbdfont\look}}\fi
1196 \else{\tclose{\kbdfont\look}}\fi}
1198 % For @url, @env, @command quotes seem unnecessary, so use \code.
1203 % @uref (abbreviation for `urlref') takes an optional (comma-separated)
1204 % second argument specifying the text to display and an optional third
1205 % arg as text to display instead of (rather than in addition to) the url
1206 % itself. First (mandatory) arg is the url. Perhaps eventually put in
1207 % a hypertex \special here.
1209 \def\uref#1{\douref #1,,,
\finish}
1210 \def\douref#1,
#2,
#3,
#4\finish{%
1211 \setbox0 =
\hbox{\ignorespaces #3}%
1213 \unhbox0 % third arg given, show only that
1215 \setbox0 =
\hbox{\ignorespaces #2}%
1217 \unhbox0\ (
\code{#1})
% second arg given, show both it and url
1219 \code{#1}% only url given, so show it
1224 % rms does not like the angle brackets --karl, 17may97.
1225 % So now @email is just like @uref.
1226 %\def\email#1{\angleleft{\tt #1}\angleright}
1229 % Check if we are currently using a typewriter font. Since all the
1230 % Computer Modern typewriter fonts have zero interword stretch (and
1231 % shrink), and it is reasonable to expect all typewriter fonts to have
1232 % this property, we can check that font parameter.
1234 \def\ifmonospace{\ifdim\fontdimen3\font=
0pt
}
1236 % Typeset a dimension, e.g., `in' or `pt'. The only reason for the
1237 % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
1239 \def\dmn#1{\thinspace #1}
1241 \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??
\par}
1243 % @l was never documented to mean ``switch to the Lisp font'',
1244 % and it is not used as such in any manual I can find. We need it for
1245 % Polish suppressed-l. --karl, 22sep96.
1246 %\def\l#1{{\li #1}\null}
1248 % Explicit font changes: @r, @sc, undocumented @ii.
1249 \def\r#1{{\rm #1}} % roman font
1250 \def\sc#1{{\smallcaps#1}} % smallcaps font
1251 \def\ii#1{{\it #1}} % italic font
1253 % @acronym downcases the argument and prints in smallcaps.
1254 \def\acronym#1{{\smallcaps \lowercase{#1}}}
1256 % @pounds{} is a sterling sign.
1257 \def\pounds{{\it\$
}}
1260 \message{page headings,
}
1262 \newskip\titlepagetopglue \titlepagetopglue =
1.5in
1263 \newskip\titlepagebottomglue \titlepagebottomglue =
2pc
1265 % First the title page. Must do @settitle before @titlepage.
1267 \newif\iffinishedtitlepage
1269 % Do an implicit @contents or @shortcontents after @end titlepage if the
1270 % user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
1272 \newif\ifsetcontentsaftertitlepage
1273 \let\setcontentsaftertitlepage =
\setcontentsaftertitlepagetrue
1274 \newif\ifsetshortcontentsaftertitlepage
1275 \let\setshortcontentsaftertitlepage =
\setshortcontentsaftertitlepagetrue
1277 \def\shorttitlepage{\parsearg\shorttitlepagezzz}
1278 \def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in
\chaprm \centerline{#1}%
1279 \endgroup\page\hbox{}\page}
1281 \def\titlepage{\begingroup \parindent=
0pt
\textfonts
1282 \let\subtitlerm=
\tenrm
1283 \def\subtitlefont{\subtitlerm \normalbaselineskip =
13pt
\normalbaselines}%
1285 \def\authorfont{\authorrm \normalbaselineskip =
16pt
\normalbaselines}%
1287 % Leave some space at the very top of the page.
1288 \vglue\titlepagetopglue
1290 % Now you can print the title using @title.
1291 \def\title{\parsearg\titlezzz}%
1292 \def\titlezzz#
#1{\leftline{\titlefonts\rm #
#1}
1293 % print a rule at the page bottom also.
1294 \finishedtitlepagefalse
1295 \vskip4pt \hrule height
4pt width
\hsize \vskip4pt}%
1296 % No rule at page bottom unless we print one at the top with @title.
1297 \finishedtitlepagetrue
1299 % Now you can put text using @subtitle.
1300 \def\subtitle{\parsearg\subtitlezzz}%
1301 \def\subtitlezzz#
#1{{\subtitlefont \rightline{#
#1}}}%
1303 % @author should come last, but may come many times.
1304 \def\author{\parsearg\authorzzz}%
1305 \def\authorzzz#
#1{\ifseenauthor\else\vskip 0pt plus
1filll
\seenauthortrue\fi
1306 {\authorfont \leftline{#
#1}}}%
1308 % Most title ``pages'' are actually two pages long, with space
1309 % at the top of the second. We don't want the ragged left on the second.
1310 \let\oldpage =
\page
1312 \iffinishedtitlepage\else
1316 \let\page =
\oldpage
1318 % \def\page{\oldpage \hbox{}}
1322 \iffinishedtitlepage\else
1325 % It is important to do the page break before ending the group,
1326 % because the headline and footline are only empty inside the group.
1327 % If we use the new definition of \page, we always get a blank page
1328 % after the title page, which we certainly don't want.
1332 % If they want short, they certainly want long too.
1333 \ifsetshortcontentsaftertitlepage
1336 \global\let\shortcontents =
\relax
1337 \global\let\contents =
\relax
1340 \ifsetcontentsaftertitlepage
1342 \global\let\contents =
\relax
1343 \global\let\shortcontents =
\relax
1349 \def\finishtitlepage{%
1350 \vskip4pt \hrule height
2pt width
\hsize
1351 \vskip\titlepagebottomglue
1352 \finishedtitlepagetrue
1355 %%% Set up page headings and footings.
1357 \let\thispage=
\folio
1359 \newtoks\evenheadline % headline on even pages
1360 \newtoks\oddheadline % headline on odd pages
1361 \newtoks\evenfootline % footline on even pages
1362 \newtoks\oddfootline % footline on odd pages
1364 % Now make Tex use those variables
1365 \headline=
{{\textfonts\rm \ifodd\pageno \the\oddheadline
1366 \else \the\evenheadline \fi}}
1367 \footline=
{{\textfonts\rm \ifodd\pageno \the\oddfootline
1368 \else \the\evenfootline \fi}\HEADINGShook}
1369 \let\HEADINGShook=
\relax
1371 % Commands to set those variables.
1372 % For example, this is what @headings on does
1373 % @evenheading @thistitle|@thispage|@thischapter
1374 % @oddheading @thischapter|@thispage|@thistitle
1375 % @evenfooting @thisfile||
1376 % @oddfooting ||@thisfile
1378 \def\evenheading{\parsearg\evenheadingxxx}
1379 \def\oddheading{\parsearg\oddheadingxxx}
1380 \def\everyheading{\parsearg\everyheadingxxx}
1382 \def\evenfooting{\parsearg\evenfootingxxx}
1383 \def\oddfooting{\parsearg\oddfootingxxx}
1384 \def\everyfooting{\parsearg\everyfootingxxx}
1388 \gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|
\finish}
1389 \gdef\evenheadingyyy #1@|
#2@|
#3@|
#4\finish{%
1390 \global\evenheadline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1392 \gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|
\finish}
1393 \gdef\oddheadingyyy #1@|
#2@|
#3@|
#4\finish{%
1394 \global\oddheadline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1396 \gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
1398 \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|
\finish}
1399 \gdef\evenfootingyyy #1@|
#2@|
#3@|
#4\finish{%
1400 \global\evenfootline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1402 \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|
\finish}
1403 \gdef\oddfootingyyy #1@|
#2@|
#3@|
#4\finish{%
1404 \global\oddfootline =
{\rlap{\centerline{#2}}\line{#1\hfil#3}}%
1406 % Leave some space for the footline. Hopefully ok to assume
1407 % @evenfooting will not be used by itself.
1408 \global\advance\pageheight by -
\baselineskip
1409 \global\advance\vsize by -
\baselineskip
1412 \gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}}
1414 }% unbind the catcode of @.
1416 % @headings double turns headings on for double-sided printing.
1417 % @headings single turns headings on for single-sided printing.
1418 % @headings off turns them off.
1419 % @headings on same as @headings double, retained for compatibility.
1420 % @headings after turns on double-sided headings after this page.
1421 % @headings doubleafter turns on double-sided headings after this page.
1422 % @headings singleafter turns on single-sided headings after this page.
1423 % By default, they are off at the start of a document,
1424 % and turned `on' after @end titlepage.
1426 \def\headings #1 {\csname HEADINGS
#1\endcsname}
1429 \global\evenheadline=
{\hfil} \global\evenfootline=
{\hfil}
1430 \global\oddheadline=
{\hfil} \global\oddfootline=
{\hfil}}
1432 % When we turn headings on, set the page number to 1.
1433 % For double-sided printing, put current file name in lower left corner,
1434 % chapter name on inside top of right hand pages, document
1435 % title on inside top of left hand pages, and page numbers on outside top
1436 % edge of all pages.
1437 \def\HEADINGSdouble{
1439 \global\evenfootline=
{\hfil}
1440 \global\oddfootline=
{\hfil}
1441 \global\evenheadline=
{\line{\folio\hfil\thistitle}}
1442 \global\oddheadline=
{\line{\thischapter\hfil\folio}}
1443 \global\let\contentsalignmacro =
\chapoddpage
1445 \let\contentsalignmacro =
\chappager
1447 % For single-sided printing, chapter title goes across top left of page,
1448 % page number on top right.
1449 \def\HEADINGSsingle{
1451 \global\evenfootline=
{\hfil}
1452 \global\oddfootline=
{\hfil}
1453 \global\evenheadline=
{\line{\thischapter\hfil\folio}}
1454 \global\oddheadline=
{\line{\thischapter\hfil\folio}}
1455 \global\let\contentsalignmacro =
\chappager
1457 \def\HEADINGSon{\HEADINGSdouble}
1459 \def\HEADINGSafter{\let\HEADINGShook=
\HEADINGSdoublex}
1460 \let\HEADINGSdoubleafter=
\HEADINGSafter
1461 \def\HEADINGSdoublex{%
1462 \global\evenfootline=
{\hfil}
1463 \global\oddfootline=
{\hfil}
1464 \global\evenheadline=
{\line{\folio\hfil\thistitle}}
1465 \global\oddheadline=
{\line{\thischapter\hfil\folio}}
1466 \global\let\contentsalignmacro =
\chapoddpage
1469 \def\HEADINGSsingleafter{\let\HEADINGShook=
\HEADINGSsinglex}
1470 \def\HEADINGSsinglex{%
1471 \global\evenfootline=
{\hfil}
1472 \global\oddfootline=
{\hfil}
1473 \global\evenheadline=
{\line{\thischapter\hfil\folio}}
1474 \global\oddheadline=
{\line{\thischapter\hfil\folio}}
1475 \global\let\contentsalignmacro =
\chappager
1478 % Subroutines used in generating headings
1479 % Produces Day Month Year style of output.
1483 \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
1484 \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
1485 \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
1489 % @settitle line... specifies the title of the document, for headings.
1490 % It generates no output of its own.
1491 \def\thistitle{\putwordNoTitle}
1492 \def\settitle{\parsearg\settitlezzz}
1493 \def\settitlezzz #1{\gdef\thistitle{#1}}
1497 % Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
1499 % default indentation of table text
1500 \newdimen\tableindent \tableindent=
.8in
1501 % default indentation of @itemize and @enumerate text
1502 \newdimen\itemindent \itemindent=
.3in
1503 % margin between end of table item and start of table text.
1504 \newdimen\itemmargin \itemmargin=
.1in
1506 % used internally for \itemindent minus \itemmargin
1509 % Note @table, @vtable, and @vtable define @item, @itemx, etc., with
1511 % They also define \itemindex
1512 % to index the item name in whatever manner is desired (perhaps none).
1514 \newif\ifitemxneedsnegativevskip
1516 \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-
\parskip\nobreak\fi}
1518 \def\internalBitem{\smallbreak \parsearg\itemzzz}
1519 \def\internalBitemx{\itemxpar \parsearg\itemzzz}
1521 \def\internalBxitem "
#1"
{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
1522 \def\internalBxitemx "
#1"
{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz}
1524 \def\internalBkitem{\smallbreak \parsearg\kitemzzz}
1525 \def\internalBkitemx{\itemxpar \parsearg\kitemzzz}
1527 \def\kitemzzz #1{\dosubind {kw
}{\code{#1}}{for
{\bf \lastfunction}}%
1530 \def\xitemzzz #1{\dosubind {kw
}{\code{#1}}{for
{\bf \xitemsubtopic}}%
1533 \def\itemzzz #1{\begingroup %
1534 \advance\hsize by -
\rightskip
1535 \advance\hsize by -
\tableindent
1536 \setbox0=
\hbox{\itemfont{#1}}%
1538 \nobreak % This prevents a break before @itemx.
1540 % If the item text does not fit in the space we have, put it on a line
1541 % by itself, and do not allow a page break either before or after that
1542 % line. We do not start a paragraph here because then if the next
1543 % command is, e.g., @kindex, the whatsit would get put into the
1544 % horizontal list on a line by itself, resulting in extra blank space.
1545 \ifdim \wd0>
\itemmax
1547 % Make this a paragraph so we get the \parskip glue and wrapping,
1548 % but leave it ragged-right.
1550 \advance\leftskip by-
\tableindent
1551 \advance\hsize by
\tableindent
1552 \advance\rightskip by0pt plus1fil
1553 \leavevmode\unhbox0\par
1556 % We're going to be starting a paragraph, but we don't want the
1557 % \parskip glue -- logically it's part of the @item we just started.
1558 \nobreak \vskip-
\parskip
1560 % Stop a page break at the \parskip glue coming up. Unfortunately
1561 % we can't prevent a possible page break at the following
1562 % \baselineskip glue.
1565 \itemxneedsnegativevskipfalse
1567 % The item text fits into the space. Start a paragraph, so that the
1568 % following text (if any) will end up on the same line.
1570 % Do this with kerns and \unhbox so that if there is a footnote in
1571 % the item text, it can migrate to the main vertical list and
1572 % eventually be printed.
1573 \nobreak\kern-
\tableindent
1574 \dimen0 =
\itemmax \advance\dimen0 by
\itemmargin \advance\dimen0 by -
\wd0
1576 \nobreak\kern\dimen0
1578 \itemxneedsnegativevskiptrue
1582 \def\item{\errmessage{@item while not in a table
}}
1583 \def\itemx{\errmessage{@itemx while not in a table
}}
1584 \def\kitem{\errmessage{@kitem while not in a table
}}
1585 \def\kitemx{\errmessage{@kitemx while not in a table
}}
1586 \def\xitem{\errmessage{@xitem while not in a table
}}
1587 \def\xitemx{\errmessage{@xitemx while not in a table
}}
1589 % Contains a kludge to get @end[description] to work.
1590 \def\description{\tablez{\dontindex}{1}{}{}{}{}}
1592 % @table, @ftable, @vtable.
1593 \def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
1594 {\obeylines\obeyspaces%
1595 \gdef\tablex #1^^M
{%
1596 \tabley\dontindex#1 \endtabley}}
1598 \def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
1599 {\obeylines\obeyspaces%
1600 \gdef\ftablex #1^^M
{%
1601 \tabley\fnitemindex#1 \endtabley
1602 \def\Eftable{\endgraf\afterenvbreak\endgroup}%
1603 \let\Etable=
\relax}}
1605 \def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex}
1606 {\obeylines\obeyspaces%
1607 \gdef\vtablex #1^^M
{%
1608 \tabley\vritemindex#1 \endtabley
1609 \def\Evtable{\endgraf\afterenvbreak\endgroup}%
1610 \let\Etable=
\relax}}
1613 \def\fnitemindex #1{\doind {fn
}{\code{#1}}}%
1614 \def\vritemindex #1{\doind {vr
}{\code{#1}}}%
1617 \gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
1618 \tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
1620 \def\tablez #1#2#3#4#5#6{%
1623 \def\Edescription{\Etable}% Necessary kludge.
1625 \ifnum 0#3>
0 \advance \leftskip by
#3\mil \fi %
1626 \ifnum 0#4>
0 \tableindent=
#4\mil \fi %
1627 \ifnum 0#5>
0 \advance \rightskip by
#5\mil \fi %
1629 \itemmax=
\tableindent %
1630 \advance \itemmax by -
\itemmargin %
1631 \advance \leftskip by
\tableindent %
1632 \exdentamount=
\tableindent
1634 \parskip =
\smallskipamount
1635 \ifdim \parskip=
0pt
\parskip=
2pt
\fi%
1636 \def\Etable{\endgraf\afterenvbreak\endgroup}%
1637 \let\item =
\internalBitem %
1638 \let\itemx =
\internalBitemx %
1639 \let\kitem =
\internalBkitem %
1640 \let\kitemx =
\internalBkitemx %
1641 \let\xitem =
\internalBxitem %
1642 \let\xitemx =
\internalBxitemx %
1645 % This is the counter used by @enumerate, which is really @itemize
1649 \def\itemize{\parsearg\itemizezzz}
1651 \def\itemizezzz #1{%
1652 \begingroup % ended by the @end itemize
1653 \itemizey {#1}{\Eitemize}
1656 \def\itemizey #1#2{%
1658 \itemmax=
\itemindent %
1659 \advance \itemmax by -
\itemmargin %
1660 \advance \leftskip by
\itemindent %
1661 \exdentamount=
\itemindent
1663 \parskip =
\smallskipamount %
1664 \ifdim \parskip=
0pt
\parskip=
2pt
\fi%
1665 \def#2{\endgraf\afterenvbreak\endgroup}%
1666 \def\itemcontents{#1}%
1667 \let\item=
\itemizeitem}
1669 % Set sfcode to normal for the chars that usually have another value.
1670 % These are `.?!:;,'
1671 \def\frenchspacing{\sfcode46=
1000 \sfcode63=
1000 \sfcode33=
1000
1672 \sfcode58=
1000 \sfcode59=
1000 \sfcode44=
1000 }
1674 % \splitoff TOKENS\endmark defines \first to be the first token in
1675 % TOKENS, and \rest to be the remainder.
1677 \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
1679 % Allow an optional argument of an uppercase letter, lowercase letter,
1680 % or number, to specify the first label in the enumerated list. No
1681 % argument is the same as `1'.
1683 \def\enumerate{\parsearg\enumeratezzz}
1684 \def\enumeratezzz #1{\enumeratey #1 \endenumeratey}
1685 \def\enumeratey #1 #2\endenumeratey{%
1686 \begingroup % ended by the @end enumerate
1688 % If we were given no argument, pretend we were given `1'.
1690 \ifx\thearg\empty \def\thearg{1}\fi
1692 % Detect if the argument is a single token. If so, it might be a
1693 % letter. Otherwise, the only valid thing it can be is a number.
1694 % (We will always have one token, because of the test we just made.
1695 % This is a good thing, since \splitoff doesn't work given nothing at
1696 % all -- the first parameter is undelimited.)
1697 \expandafter\splitoff\thearg\endmark
1699 % Only one token in the argument. It could still be anything.
1700 % A ``lowercase letter'' is one whose \lccode is nonzero.
1701 % An ``uppercase letter'' is one whose \lccode is both nonzero, and
1702 % not equal to itself.
1703 % Otherwise, we assume it's a number.
1705 % We need the \relax at the end of the \ifnum lines to stop TeX from
1706 % continuing to look for a <number>.
1708 \ifnum\lccode\expandafter`
\thearg=
0\relax
1709 \numericenumerate % a number (we hope)
1712 \ifnum\lccode\expandafter`
\thearg=
\expandafter`
\thearg\relax
1713 \lowercaseenumerate % lowercase letter
1715 \uppercaseenumerate % uppercase letter
1719 % Multiple tokens in the argument. We hope it's a number.
1724 % An @enumerate whose labels are integers. The starting integer is
1727 \def\numericenumerate{%
1729 \startenumeration{\the\itemno}%
1732 % The starting (lowercase) letter is in \thearg.
1733 \def\lowercaseenumerate{%
1734 \itemno =
\expandafter`
\thearg
1736 % Be sure we're not beyond the end of the alphabet.
1738 \errmessage{No more lowercase letters in @enumerate; get a bigger
1745 % The starting (uppercase) letter is in \thearg.
1746 \def\uppercaseenumerate{%
1747 \itemno =
\expandafter`
\thearg
1749 % Be sure we're not beyond the end of the alphabet.
1751 \errmessage{No more uppercase letters in @enumerate; get a bigger
1758 % Call itemizey, adding a period to the first argument and supplying the
1759 % common last two arguments. Also subtract one from the initial value in
1760 % \itemno, since @item increments \itemno.
1762 \def\startenumeration#1{%
1763 \advance\itemno by -
1
1764 \itemizey{#1.
}\Eenumerate\flushcr
1767 % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
1770 \def\alphaenumerate{\enumerate{a
}}
1771 \def\capsenumerate{\enumerate{A
}}
1772 \def\Ealphaenumerate{\Eenumerate}
1773 \def\Ecapsenumerate{\Eenumerate}
1775 % Definition of @item while inside @itemize.
1778 \advance\itemno by
1
1779 {\let\par=
\endgraf \smallbreak}%
1780 \ifhmode \errmessage{In hmode at itemizeitem
}\fi
1781 {\parskip=
0in
\hskip 0pt
1782 \hbox to
0pt
{\hss \itemcontents\hskip \itemmargin}%
1783 \vadjust{\penalty 1200}}%
1786 % @multitable macros
1787 % Amy Hendrickson, 8/18/94, 3/6/96
1789 % @multitable ... @end multitable will make as many columns as desired.
1790 % Contents of each column will wrap at width given in preamble. Width
1791 % can be specified either with sample text given in a template line,
1792 % or in percent of \hsize, the current width of text on page.
1794 % Table can continue over pages but will only break between lines.
1798 % Either define widths of columns in terms of percent of \hsize:
1799 % @multitable @columnfractions .25 .3 .45
1802 % Numbers following @columnfractions are the percent of the total
1803 % current hsize to be used for each column. You may use as many
1804 % columns as desired.
1807 % Or use a template:
1808 % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
1810 % using the widest term desired in each column.
1812 % For those who want to use more than one line's worth of words in
1813 % the preamble, break the line within one argument and it
1814 % will parse correctly, i.e.,
1816 % @multitable {Column 1 template} {Column 2 template} {Column 3
1819 % @multitable {Column 1 template} {Column 2 template}
1820 % {Column 3 template}
1822 % Each new table line starts with @item, each subsequent new column
1823 % starts with @tab. Empty columns may be produced by supplying @tab's
1824 % with nothing between them for as many times as empty columns are needed,
1825 % ie, @tab@tab@tab will produce two empty columns.
1827 % @item, @tab, @multitable or @end multitable do not need to be on their
1828 % own lines, but it will not hurt if they are.
1830 % Sample multitable:
1832 % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
1833 % @item first col stuff @tab second col stuff @tab third col
1840 % @item first col stuff @tab second col stuff
1841 % @tab Many paragraphs of text may be used in any column.
1843 % They will wrap at the width determined by the template.
1844 % @item@tab@tab This will be in third column.
1847 % Default dimensions may be reset by user.
1848 % @multitableparskip is vertical space between paragraphs in table.
1849 % @multitableparindent is paragraph indent in table.
1850 % @multitablecolmargin is horizontal space to be left between columns.
1851 % @multitablelinespace is space to leave between table items, baseline
1853 % 0pt means it depends on current normal line spacing.
1855 \newskip\multitableparskip
1856 \newskip\multitableparindent
1857 \newdimen\multitablecolspace
1858 \newskip\multitablelinespace
1859 \multitableparskip=
0pt
1860 \multitableparindent=
6pt
1861 \multitablecolspace=
12pt
1862 \multitablelinespace=
0pt
1864 % Macros used to set up halign preamble:
1866 \let\endsetuptable\relax
1867 \def\xendsetuptable{\endsetuptable}
1868 \let\columnfractions\relax
1869 \def\xcolumnfractions{\columnfractions}
1872 % #1 is the part of the @columnfraction before the decimal point, which
1873 % is presumably either 0 or the empty string (but we don't check, we
1874 % just throw it away). #2 is the decimal part, which we use as the
1875 % percent of \hsize for this column.
1876 \def\pickupwholefraction#1.
#2 {%
1877 \global\advance\colcount by
1
1878 \expandafter\xdef\csname col
\the\colcount\endcsname{.
#2\hsize}%
1885 \ifx\firstarg\xendsetuptable
1888 \ifx\firstarg\xcolumnfractions
1889 \global\setpercenttrue
1892 \let\go\pickupwholefraction
1894 \global\advance\colcount by
1
1895 \setbox0=
\hbox{#1\unskip }% Add a normal word space as a separator;
1896 % typically that is always in the input, anyway.
1897 \expandafter\xdef\csname col
\the\colcount\endcsname{\the\wd0}%
1900 \ifx\go\pickupwholefraction
1901 % Put the argument back for the \pickupwholefraction call, so
1902 % we'll always have a period there to be parsed.
1903 \def\go{\pickupwholefraction#1}%
1905 \let\go =
\setuptable
1912 \def\tab{&
\hskip1sp\relax} % 2/2/96
1913 % tiny skip here makes sure this column space is
1914 % maintained, even if it is never used.
1916 % @multitable ... @end multitable definitions:
1918 \def\multitable{\parsearg\dotable}
1919 \def\dotable#1{\bgroup
1924 \setmultitablespacing
1925 \parskip=
\multitableparskip
1926 \parindent=
\multitableparindent
1929 \def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}%
1931 % To parse everything between @multitable and @item:
1932 \setuptable#1 \endsetuptable
1934 % \everycr will reset column counter, \colcount, at the end of
1935 % each line. Every column entry will cause \colcount to advance by one.
1936 % The table preamble
1937 % looks at the current \colcount to find the correct column width.
1940 % \filbreak%% keeps underfull box messages off when table breaks over pages.
1941 % Maybe so, but it also creates really weird page breaks when the table
1942 % breaks over pages. Wouldn't \vfil be better? Wait until the problem
1943 % manifests itself, so it can be fixed for real --karl.
1944 \global\colcount=
0\relax}}%
1946 % This preamble sets up a generic column definition, which will
1947 % be used as many times as user calls for columns.
1948 % \vtop will set a single line and will also let text wrap and
1949 % continue for many paragraphs if desired.
1950 \halign\bgroup&
\global\advance\colcount by
1\relax
1951 \multistrut\vtop{\hsize=
\expandafter\csname col
\the\colcount\endcsname
1953 % In order to keep entries from bumping into each other
1954 % we will add a \leftskip of \multitablecolspace to all columns after
1957 % If a template has been used, we will add \multitablecolspace
1958 % to the width of each template entry.
1960 % If the user has set preamble in terms of percent of \hsize we will
1961 % use that dimension as the width of the column, and the \leftskip
1962 % will keep entries from bumping into each other. Table will start at
1963 % left margin and final column will justify at right margin.
1965 % Make sure we don't inherit \rightskip from the outer environment.
1968 % The first column will be indented with the surrounding text.
1969 \advance\hsize by
\leftskip
1972 % If user has not set preamble in terms of percent of \hsize
1973 % we will advance \hsize by \multitablecolspace.
1974 \advance\hsize by
\multitablecolspace
1976 % In either case we will make \leftskip=\multitablecolspace:
1977 \leftskip=
\multitablecolspace
1979 % Ignoring space at the beginning and end avoids an occasional spurious
1980 % blank line, when TeX decides to break the line at the space before the
1981 % box from the multistrut, so the strut ends up on a line by itself.
1983 % @multitable @columnfractions .11 .89
1985 % @tab Legal holiday which is valid in major parts of the whole country.
1986 % Is automatically provided with highlighting sequences respectively marking
1988 \noindent\ignorespaces##
\unskip\multistrut}\cr
1991 \def\setmultitablespacing{% test to see if user has set \multitablelinespace.
1992 % If so, do nothing. If not, give it an appropriate dimension based on
1993 % current baselineskip.
1994 \ifdim\multitablelinespace=
0pt
1995 %% strut to put in table in case some entry doesn't have descenders,
1996 %% to keep lines equally spaced
1997 \let\multistrut =
\strut
1998 %% Test to see if parskip is larger than space between lines of
1999 %% table. If not, do nothing.
2000 %% If so, set to same dimension as multitablelinespace.
2002 \gdef\multistrut{\vrule height
\multitablelinespace depth
\dp0
2004 \ifdim\multitableparskip>
\multitablelinespace
2005 \global\multitableparskip=
\multitablelinespace
2006 \global\advance\multitableparskip-
7pt
%% to keep parskip somewhat smaller
2007 %% than skip between lines in the table.
2009 \ifdim\multitableparskip=
0pt
2010 \global\multitableparskip=
\multitablelinespace
2011 \global\advance\multitableparskip-
7pt
%% to keep parskip somewhat smaller
2012 %% than skip between lines in the table.
2016 \message{conditionals,
}
2017 % Prevent errors for section commands.
2018 % Used in @ignore and in failing conditionals.
2019 \def\ignoresections{%
2021 \let\unnumbered=
\relax
2023 \let\unnumberedsec=
\relax
2024 \let\unnumberedsection=
\relax
2025 \let\unnumberedsubsec=
\relax
2026 \let\unnumberedsubsection=
\relax
2027 \let\unnumberedsubsubsec=
\relax
2028 \let\unnumberedsubsubsection=
\relax
2031 \let\subsubsec=
\relax
2032 \let\subsection=
\relax
2033 \let\subsubsection=
\relax
2034 \let\appendix=
\relax
2035 \let\appendixsec=
\relax
2036 \let\appendixsection=
\relax
2037 \let\appendixsubsec=
\relax
2038 \let\appendixsubsection=
\relax
2039 \let\appendixsubsubsec=
\relax
2040 \let\appendixsubsubsection=
\relax
2041 \let\contents=
\relax
2042 \let\smallbook=
\relax
2043 \let\titlepage=
\relax
2046 % Used in nested conditionals, where we have to parse the Texinfo source
2047 % and so want to turn off most commands, in case they are used
2050 \def\ignoremorecommands{%
2051 \let\defcodeindex =
\relax
2054 \let\deffnx =
\relax
2055 \let\defindex =
\relax
2056 \let\defivar =
\relax
2057 \let\defmac =
\relax
2058 \let\defmethod =
\relax
2060 \let\defopt =
\relax
2061 \let\defspec =
\relax
2063 \let\deftypefn =
\relax
2064 \let\deftypefun =
\relax
2065 \let\deftypevar =
\relax
2066 \let\deftypevr =
\relax
2068 \let\defvar =
\relax
2072 \let\printindex =
\relax
2074 \let\settitle =
\relax
2075 \let\setchapternewpage =
\relax
2076 \let\setchapterstyle =
\relax
2077 \let\everyheading =
\relax
2078 \let\evenheading =
\relax
2079 \let\oddheading =
\relax
2080 \let\everyfooting =
\relax
2081 \let\evenfooting =
\relax
2082 \let\oddfooting =
\relax
2083 \let\headings =
\relax
2084 \let\include =
\relax
2085 \let\lowersections =
\relax
2087 \let\raisesections =
\relax
2094 % Ignore @ignore ... @end ignore.
2096 \def\ignore{\doignore{ignore
}}
2098 % Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text.
2100 \def\ifinfo{\doignore{ifinfo
}}
2101 \def\ifhtml{\doignore{ifhtml
}}
2102 \def\ifnottex{\doignore{ifnottex
}}
2103 \def\html{\doignore{html
}}
2104 \def\menu{\doignore{menu
}}
2105 \def\direntry{\doignore{direntry
}}
2107 % @dircategory CATEGORY -- specify a category of the dir file
2108 % which this file should belong to. Ignore this in TeX.
2109 \let\dircategory =
\comment
2111 % Ignore text until a line `@end #1'.
2113 \def\doignore#1{\begingroup
2114 % Don't complain about control sequences we have declared \outer.
2117 % Define a command to swallow text until we reach `@end #1'.
2118 % This @ is a catcode 12 token (that is the normal catcode of @ in
2119 % this texinfo.tex file). We change the catcode of @ below to match.
2120 \long\def\doignoretext#
#1@end
#1{\enddoignore}%
2122 % Make sure that spaces turn into tokens that match what \doignoretext wants.
2125 % Ignore braces, too, so mismatched braces don't cause trouble.
2129 % We must not have @c interpreted as a control sequence.
2132 % Make the letter c a comment character so that the rest of the line
2133 % will be ignored. This way, the document can have (for example)
2135 % and the @end ifinfo will be properly ignored.
2136 % (We've just changed @ to catcode 12.)
2139 % And now expand that command.
2143 % What we do to finish off ignored text.
2145 \def\enddoignore{\endgroup\ignorespaces}%
2147 \newif\ifwarnedobs\warnedobsfalse
2149 \ifwarnedobs\relax\else
2150 % We need to warn folks that they may have trouble with TeX 3.0.
2151 % This uses \immediate\write16 rather than \message to get newlines.
2152 \immediate\write16{}
2153 \immediate\write16{WARNING: for users of Unix TeX
3.0!
}
2154 \immediate\write16{This manual trips a bug in TeX version
3.0 (tex hangs).
}
2155 \immediate\write16{If you are running another version of TeX, relax.
}
2156 \immediate\write16{If you are running Unix TeX
3.0, kill this TeX process.
}
2157 \immediate\write16{ Then upgrade your TeX installation if you can.
}
2158 \immediate\write16{ (See ftp://ftp.gnu.org/pub/gnu/TeX.README.)
}
2159 \immediate\write16{If you are stuck with version
3.0, run the
}
2160 \immediate\write16{ script ``tex3patch'' from the Texinfo distribution
}
2161 \immediate\write16{ to use a workaround.
}
2162 \immediate\write16{}
2163 \global\warnedobstrue
2167 % **In TeX 3.0, setting text in \nullfont hangs tex. For a
2168 % workaround (which requires the file ``dummy.tfm'' to be installed),
2169 % uncomment the following line:
2170 %%%%%\font\nullfont=dummy\let\obstexwarn=\relax
2172 % Ignore text, except that we keep track of conditional commands for
2173 % purposes of nesting, up to an `@end #1' command.
2175 \def\nestedignore#1{%
2177 % We must actually expand the ignored text to look for the @end
2178 % command, so that nested ignore constructs work. Thus, we put the
2179 % text into a \vbox and then do nothing with the result. To minimize
2180 % the change of memory overflow, we follow the approach outlined on
2181 % page 401 of the TeXbook: make the current font be a dummy font.
2183 \setbox0 =
\vbox\bgroup
2184 % Don't complain about control sequences we have declared \outer.
2187 % Define `@end #1' to end the box, which will in turn undefine the
2188 % @end command again.
2189 \expandafter\def\csname E
#1\endcsname{\egroup\ignorespaces}%
2191 % We are going to be parsing Texinfo commands. Most cause no
2192 % trouble when they are used incorrectly, but some commands do
2193 % complicated argument parsing or otherwise get confused, so we
2196 % We can't do anything about stray @-signs, unfortunately;
2197 % they'll produce `undefined control sequence' errors.
2200 % Set the current font to be \nullfont, a TeX primitive, and define
2201 % all the font commands to also use \nullfont. We don't use
2202 % dummy.tfm, as suggested in the TeXbook, because not all sites
2203 % might have that installed. Therefore, math mode will still
2204 % produce output, but that should be an extremely small amount of
2205 % stuff compared to the main input.
2208 \let\tenrm =
\nullfont \let\tenit =
\nullfont \let\tensl =
\nullfont
2209 \let\tenbf =
\nullfont \let\tentt =
\nullfont \let\smallcaps =
\nullfont
2210 \let\tensf =
\nullfont
2211 % Similarly for index fonts (mostly for their use in
2213 \let\indrm =
\nullfont \let\indit =
\nullfont \let\indsl =
\nullfont
2214 \let\indbf =
\nullfont \let\indtt =
\nullfont \let\indsc =
\nullfont
2215 \let\indsf =
\nullfont
2217 % Don't complain when characters are missing from the fonts.
2218 \tracinglostchars =
0
2220 % Don't bother to do space factor calculations.
2223 % Don't report underfull hboxes.
2226 % Do minimal line-breaking.
2227 \pretolerance =
10000
2229 % Do not execute instructions in @tex
2230 \def\tex{\doignore{tex
}}%
2231 % Do not execute macro definitions.
2232 % `c' is a comment character, so the word `macro' will get cut off.
2233 \def\macro{\doignore{ma
}}%
2236 % @set VAR sets the variable VAR to an empty value.
2237 % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
2239 % Since we want to separate VAR from REST-OF-LINE (which might be
2240 % empty), we can't just use \parsearg; we have to insert a space of our
2241 % own to delimit the rest of the line, and then take it out again if we
2242 % didn't need it. Make sure the catcode of space is correct to avoid
2243 % losing inside @example, for instance.
2245 \def\set{\begingroup\catcode` =
10
2246 \catcode`\-=
12 \catcode`
\_=
12 % Allow - and _ in VAR.
2248 \def\setxxx#1{\setyyy#1 \endsetyyy}
2249 \def\setyyy#1 #2\endsetyyy{%
2251 \ifx\temp\empty \global\expandafter\let\csname SET
#1\endcsname =
\empty
2252 \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted.
2256 % Can't use \xdef to pre-expand #2 and save some time, since \temp or
2257 % \next or other control sequences that we've defined might get us into
2258 % an infinite loop. Consider `@set foo @cite{bar}'.
2259 \def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET
#1\endcsname{#2}}
2261 % @clear VAR clears (i.e., unsets) the variable VAR.
2263 \def\clear{\parsearg\clearxxx}
2264 \def\clearxxx#1{\global\expandafter\let\csname SET
#1\endcsname=
\relax}
2266 % @value{foo} gets the text saved in variable foo.
2268 \catcode`
\_ =
\active
2270 % We might end up with active _ or - characters in the argument if
2271 % we're called from @code, as @code{@value{foo-bar_}}. So \let any
2272 % such active characters to their normal equivalents.
2273 \gdef\value{\begingroup
2274 \catcode`\-=
12 \catcode`
\_=
12
2275 \indexbreaks \let_\normalunderscore
2278 \def\valuexxx#1{\expandablevalue{#1}\endgroup}
2280 % We have this subroutine so that we can handle at least some @value's
2281 % properly in indexes (we \let\value to this in \indexdummies). Ones
2282 % whose names contain - or _ still won't work, but we can't do anything
2283 % about that. The command has to be fully expandable, since the result
2284 % winds up in the index file. This means that if the variable's value
2285 % contains other Texinfo commands, it's almost certain it will fail
2286 % (although perhaps we could fix that with sufficient work to do a
2287 % one-level expansion on the result, instead of complete).
2289 \def\expandablevalue#1{%
2290 \expandafter\ifx\csname SET
#1\endcsname\relax
2291 {[No value for ``
#1''
]}%
2293 \csname SET
#1\endcsname
2297 % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
2300 \def\ifset{\parsearg\ifsetxxx}
2302 \expandafter\ifx\csname SET
#1\endcsname\relax
2303 \expandafter\ifsetfail
2305 \expandafter\ifsetsucceed
2308 \def\ifsetsucceed{\conditionalsucceed{ifset
}}
2309 \def\ifsetfail{\nestedignore{ifset
}}
2310 \defineunmatchedend{ifset
}
2312 % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
2313 % defined with @set, or has been undefined with @clear.
2315 \def\ifclear{\parsearg\ifclearxxx}
2316 \def\ifclearxxx #1{%
2317 \expandafter\ifx\csname SET
#1\endcsname\relax
2318 \expandafter\ifclearsucceed
2320 \expandafter\ifclearfail
2323 \def\ifclearsucceed{\conditionalsucceed{ifclear
}}
2324 \def\ifclearfail{\nestedignore{ifclear
}}
2325 \defineunmatchedend{ifclear
}
2327 % @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text
2328 % following, through the first @end iftex (etc.). Make `@end iftex'
2329 % (etc.) valid only after an @iftex.
2331 \def\iftex{\conditionalsucceed{iftex
}}
2332 \def\ifnothtml{\conditionalsucceed{ifnothtml
}}
2333 \def\ifnotinfo{\conditionalsucceed{ifnotinfo
}}
2334 \defineunmatchedend{iftex
}
2335 \defineunmatchedend{ifnothtml
}
2336 \defineunmatchedend{ifnotinfo
}
2338 % We can't just want to start a group at @iftex (for example) and end it
2339 % at @end iftex, since then @set commands inside the conditional have no
2340 % effect (they'd get reverted at the end of the group). So we must
2341 % define \Eiftex to redefine itself to be its previous value. (We can't
2342 % just define it to fail again with an ``unmatched end'' error, since
2343 % the @ifset might be nested.)
2345 \def\conditionalsucceed#1{%
2347 % Remember the current value of \E#1.
2348 \let\nece{prevE
#1} =
\nece{E
#1}%
2350 % At the `@end #1', redefine \E#1 to be its previous value.
2351 \def\nece{E
#1}{\let\nece{E
#1} =
\nece{prevE
#1}}%
2356 % We need to expand lots of \csname's, but we don't want to expand the
2357 % control sequences after we've constructed them.
2359 \def\nece#1{\expandafter\noexpand\csname#1\endcsname}
2361 % @defininfoenclose.
2362 \let\definfoenclose=
\comment
2366 % Index generation facilities
2368 % Define \newwrite to be identical to plain tex's \newwrite
2369 % except not \outer, so it can be used within \newindex.
2371 \gdef\newwrite{\alloc@
7\write\chardef\sixt@@n
}}
2373 % \newindex {foo} defines an index named foo.
2374 % It automatically defines \fooindex such that
2375 % \fooindex ...rest of line... puts an entry in the index foo.
2376 % It also defines \fooindfile to be the number of the output channel for
2377 % the file that accumulates this index. The file's extension is foo.
2378 % The name of an index should be no more than 2 characters long
2379 % for the sake of vms.
2383 \expandafter\newwrite \csname#1indfile
\endcsname
2384 \openout \csname#1indfile
\endcsname \jobname.
#1 % Open the file
2386 \expandafter\xdef\csname#1index
\endcsname{% % Define @#1index
2387 \noexpand\doindex{#1}}
2390 % @defindex foo == \newindex{foo}
2392 \def\defindex{\parsearg\newindex}
2394 % Define @defcodeindex, like @defindex except put all entries in @code.
2396 \def\newcodeindex#1{%
2398 \expandafter\newwrite \csname#1indfile
\endcsname
2399 \openout \csname#1indfile
\endcsname \jobname.
#1
2401 \expandafter\xdef\csname#1index
\endcsname{%
2402 \noexpand\docodeindex{#1}}
2405 \def\defcodeindex{\parsearg\newcodeindex}
2407 % @synindex foo bar makes index foo feed into index bar.
2408 % Do this instead of @defindex foo if you don't want it as a separate index.
2409 % The \closeout helps reduce unnecessary open files; the limit on the
2410 % Acorn RISC OS is a mere 16 files.
2411 \def\synindex#1 #2 {%
2412 \expandafter\let\expandafter\synindexfoo\expandafter=
\csname#2indfile
\endcsname
2413 \expandafter\closeout\csname#1indfile
\endcsname
2414 \expandafter\let\csname#1indfile
\endcsname=
\synindexfoo
2415 \expandafter\xdef\csname#1index
\endcsname{% define \xxxindex
2416 \noexpand\doindex{#2}}%
2419 % @syncodeindex foo bar similar, but put all entries made for index foo
2421 \def\syncodeindex#1 #2 {%
2422 \expandafter\let\expandafter\synindexfoo\expandafter=
\csname#2indfile
\endcsname
2423 \expandafter\closeout\csname#1indfile
\endcsname
2424 \expandafter\let\csname#1indfile
\endcsname=
\synindexfoo
2425 \expandafter\xdef\csname#1index
\endcsname{% define \xxxindex
2426 \noexpand\docodeindex{#2}}%
2429 % Define \doindex, the driver for all \fooindex macros.
2430 % Argument #1 is generated by the calling \fooindex macro,
2431 % and it is "foo", the name of the index.
2433 % \doindex just uses \parsearg; it calls \doind for the actual work.
2434 % This is because \doind is more useful to call from other macros.
2436 % There is also \dosubind {index}{topic}{subtopic}
2437 % which makes an entry in a two-level index such as the operation index.
2439 \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
2440 \def\singleindexer #1{\doind{\indexname}{#1}}
2442 % like the previous two, but they put @code around the argument.
2443 \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
2444 \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
2448 % Take care of the plain tex accent commands.
2449 \def\"
{\realbackslash "
}%
2450 \def\`
{\realbackslash `
}%
2451 \def\'
{\realbackslash '
}%
2452 \def\^
{\realbackslash ^
}%
2453 \def\~
{\realbackslash ~
}%
2454 \def\=
{\realbackslash =
}%
2455 \def\b{\realbackslash b
}%
2456 \def\c{\realbackslash c
}%
2457 \def\d{\realbackslash d
}%
2458 \def\u{\realbackslash u
}%
2459 \def\v{\realbackslash v
}%
2460 \def\H{\realbackslash H
}%
2461 % Take care of the plain tex special European modified letters.
2462 \def\oe{\realbackslash oe
}%
2463 \def\ae{\realbackslash ae
}%
2464 \def\aa{\realbackslash aa
}%
2465 \def\OE{\realbackslash OE
}%
2466 \def\AE{\realbackslash AE
}%
2467 \def\AA{\realbackslash AA
}%
2468 \def\o{\realbackslash o
}%
2469 \def\O{\realbackslash O
}%
2470 \def\l{\realbackslash l
}%
2471 \def\L{\realbackslash L
}%
2472 \def\ss{\realbackslash ss
}%
2473 % Take care of texinfo commands likely to appear in an index entry.
2474 % (Must be a way to avoid doing expansion at all, and thus not have to
2475 % laboriously list every single command here.)
2476 \def\@
{@
}% will be @@ when we switch to @ as escape char.
2477 % Need these in case \tex is in effect and \{ is a \delimiter again.
2478 % But can't use \lbracecmd and \rbracecmd because texindex assumes
2479 % braces and backslashes are used only as delimiters.
2482 \def\_{{\realbackslash _
}}%
2483 \def\w{\realbackslash w
}%
2484 \def\bf{\realbackslash bf
}%
2485 %\def\rm{\realbackslash rm }%
2486 \def\sl{\realbackslash sl
}%
2487 \def\sf{\realbackslash sf
}%
2488 \def\tt{\realbackslash tt
}%
2489 \def\gtr{\realbackslash gtr
}%
2490 \def\less{\realbackslash less
}%
2491 \def\hat{\realbackslash hat
}%
2492 \def\TeX{\realbackslash TeX
}%
2493 \def\dots{\realbackslash dots
}%
2494 \def\result{\realbackslash result
}%
2495 \def\equiv{\realbackslash equiv
}%
2496 \def\expansion{\realbackslash expansion
}%
2497 \def\print{\realbackslash print
}%
2498 \def\error{\realbackslash error
}%
2499 \def\point{\realbackslash point
}%
2500 \def\copyright{\realbackslash copyright
}%
2501 \def\tclose#
#1{\realbackslash tclose
{#
#1}}%
2502 \def\code#
#1{\realbackslash code
{#
#1}}%
2503 \def\uref#
#1{\realbackslash uref
{#
#1}}%
2504 \def\url#
#1{\realbackslash url
{#
#1}}%
2505 \def\env#
#1{\realbackslash env
{#
#1}}%
2506 \def\command#
#1{\realbackslash command
{#
#1}}%
2507 \def\option#
#1{\realbackslash option
{#
#1}}%
2508 \def\dotless#
#1{\realbackslash dotless
{#
#1}}%
2509 \def\samp#
#1{\realbackslash samp
{#
#1}}%
2510 \def\,#
#1{\realbackslash ,
{#
#1}}%
2511 \def\t#
#1{\realbackslash t
{#
#1}}%
2512 \def\r#
#1{\realbackslash r
{#
#1}}%
2513 \def\i#
#1{\realbackslash i
{#
#1}}%
2514 \def\b#
#1{\realbackslash b
{#
#1}}%
2515 \def\sc#
#1{\realbackslash sc
{#
#1}}%
2516 \def\cite#
#1{\realbackslash cite
{#
#1}}%
2517 \def\key#
#1{\realbackslash key
{#
#1}}%
2518 \def\file#
#1{\realbackslash file
{#
#1}}%
2519 \def\var#
#1{\realbackslash var
{#
#1}}%
2520 \def\kbd#
#1{\realbackslash kbd
{#
#1}}%
2521 \def\dfn#
#1{\realbackslash dfn
{#
#1}}%
2522 \def\emph#
#1{\realbackslash emph
{#
#1}}%
2523 \def\acronym#
#1{\realbackslash acronym
{#
#1}}%
2525 % Handle some cases of @value -- where the variable name does not
2526 % contain - or _, and the value does not contain any
2527 % (non-fully-expandable) commands.
2528 \let\value =
\expandablevalue
2531 % Turn off macro expansion
2535 % If an index command is used in an @example environment, any spaces
2536 % therein should become regular spaces in the raw index file, not the
2537 % expansion of \tie (\\leavevmode \penalty \@M \ ).
2539 \gdef\unsepspaces{\obeyspaces\let =
\space}}
2541 % \indexnofonts no-ops all font-change commands.
2542 % This is used when outputting the strings to sort the index by.
2543 \def\indexdummyfont#1{#1}
2544 \def\indexdummytex{TeX
}
2545 \def\indexdummydots{...
}
2548 % Just ignore accents.
2549 \let\,=
\indexdummyfont
2550 \let\"=
\indexdummyfont
2551 \let\`=
\indexdummyfont
2552 \let\'=
\indexdummyfont
2553 \let\^=
\indexdummyfont
2554 \let\~=
\indexdummyfont
2555 \let\==
\indexdummyfont
2556 \let\b=
\indexdummyfont
2557 \let\c=
\indexdummyfont
2558 \let\d=
\indexdummyfont
2559 \let\u=
\indexdummyfont
2560 \let\v=
\indexdummyfont
2561 \let\H=
\indexdummyfont
2562 \let\dotless=
\indexdummyfont
2563 % Take care of the plain tex special European modified letters.
2575 \let\w=
\indexdummyfont
2576 \let\t=
\indexdummyfont
2577 \let\r=
\indexdummyfont
2578 \let\i=
\indexdummyfont
2579 \let\b=
\indexdummyfont
2580 \let\emph=
\indexdummyfont
2581 \let\strong=
\indexdummyfont
2582 \let\cite=
\indexdummyfont
2583 \let\sc=
\indexdummyfont
2584 %Don't no-op \tt, since it isn't a user-level command
2585 % and is used in the definitions of the active chars like <, >, |...
2586 %\let\tt=\indexdummyfont
2587 \let\tclose=
\indexdummyfont
2588 \let\code=
\indexdummyfont
2589 \let\url=
\indexdummyfont
2590 \let\uref=
\indexdummyfont
2591 \let\env=
\indexdummyfont
2592 \let\command=
\indexdummyfont
2593 \let\option=
\indexdummyfont
2594 \let\file=
\indexdummyfont
2595 \let\samp=
\indexdummyfont
2596 \let\kbd=
\indexdummyfont
2597 \let\key=
\indexdummyfont
2598 \let\var=
\indexdummyfont
2599 \let\TeX=
\indexdummytex
2600 \let\dots=
\indexdummydots
2604 % To define \realbackslash, we must make \ not be an escape.
2605 % We must first make another character (@) an escape
2606 % so we do not become unable to do a definition.
2608 {\catcode`\@=
0 \catcode`\\=
\other
2609 @gdef@realbackslash
{\
}}
2611 \let\indexbackslash=
0 %overridden during \printindex.
2612 \let\SETmarginindex=
\relax % put index entries in margin (undocumented)?
2614 % For \ifx comparisons.
2615 \def\emptymacro{\empty}
2617 % Most index entries go through here, but \dosubind is the general case.
2619 \def\doind#1#2{\dosubind{#1}{#2}\empty}
2621 % Workhorse for all \fooindexes.
2622 % #1 is name of index, #2 is stuff to put there, #3 is subentry --
2623 % \empty if called from \doind, as we usually are. The main exception
2624 % is with defuns, which call us directly.
2626 \def\dosubind#1#2#3{%
2627 % Put the index entry in the margin if desired.
2628 \ifx\SETmarginindex\relax\else
2629 \insert\margin{\hbox{\vrule height8pt depth3pt width0pt
#2}}%
2632 \count255=
\lastpenalty
2634 \indexdummies % Must do this here, since \bf, etc expand at this stage
2637 \let\folio =
0% We will expand all macros now EXCEPT \folio.
2638 \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
2639 % so it will be output as is; and it will print as backslash.
2643 % If third arg is present, precede it with space in sort key.
2644 \ifx\thirdarg\emptymacro
2645 \let\subentry =
\empty
2650 % First process the index entry with all font commands turned
2651 % off to get the string to sort by.
2652 {\indexnofonts \xdef\indexsorttmp{#2\subentry}}%
2654 % Now the real index entry with the fonts.
2657 % If third (subentry) arg is present, add it to the index
2658 % string. And include a space.
2659 \ifx\thirdarg\emptymacro \else
2660 \toks0 =
\expandafter{\the\toks0 \space #3}%
2663 % Set up the complete index entry, with both the sort key
2664 % and the original text, including any font commands. We write
2665 % three arguments to \entry to the .?? file, texindex reduces to
2666 % two when writing the .??s sorted result.
2668 \write\csname#1indfile
\endcsname{%
2669 \realbackslash entry
{\indexsorttmp}{\folio}{\the\toks0}}%
2672 % If a skip is the last thing on the list now, preserve it
2673 % by backing up by \lastskip, doing the \write, then inserting
2674 % the skip again. Otherwise, the whatsit generated by the
2675 % \write will make \lastskip zero. The result is that sequences
2680 % will have extra space inserted, because the \medbreak in the
2681 % start of the @defun won't see the skip inserted by the @end of
2682 % the previous defun.
2684 % But don't do any of this if we're not in vertical mode. We
2685 % don't want to do a \vskip and prematurely end a paragraph.
2687 % Avoid page breaks due to these extra skips, too.
2692 \ifdim\lastskip =
0pt
\else \nobreak\vskip-
\lastskip \fi
2695 \temp % do the write
2698 \ifvmode \ifdim\skip0 =
0pt
\else \nobreak\vskip\skip0 \fi \fi
2706 % The index entry written in the file actually looks like
2707 % \entry {sortstring}{page}{topic}
2709 % \entry {sortstring}{page}{topic}{subtopic}
2710 % The texindex program reads in these files and writes files
2711 % containing these kinds of lines:
2713 % before the first topic whose initial is c
2714 % \entry {topic}{pagelist}
2715 % for a topic that is used without subtopics
2717 % for the beginning of a topic that is used with subtopics
2718 % \secondary {subtopic}{pagelist}
2719 % for each subtopic.
2721 % Define the user-accessible indexing commands
2722 % @findex, @vindex, @kindex, @cindex.
2724 \def\findex {\fnindex}
2725 \def\kindex {\kyindex}
2726 \def\cindex {\cpindex}
2727 \def\vindex {\vrindex}
2728 \def\tindex {\tpindex}
2729 \def\pindex {\pgindex}
2731 \def\cindexsub {\begingroup\obeylines\cindexsub}
2733 \gdef\cindexsub "
#1"
#2^^M
{\endgroup %
2734 \dosubind{cp
}{#2}{#1}}}
2736 % Define the macros used in formatting output of the sorted index material.
2738 % @printindex causes a particular index (the ??s file) to get printed.
2739 % It does not print any chapter heading (usually an @unnumbered).
2741 \def\printindex{\parsearg\doprintindex}
2742 \def\doprintindex#1{\begingroup
2743 \dobreak \chapheadingskip{10000}%
2749 % See if the index file exists and is nonempty.
2750 % Change catcode of @ here so that if the index file contains
2752 % as its first line, TeX doesn't complain about mismatched braces
2753 % (because it thinks @} is a control sequence).
2755 \openin 1 \jobname.
#1s
2757 % \enddoublecolumns gets confused if there is no text in the index,
2758 % and it loses the chapter title and the aux file entries for the
2759 % index. The easiest way to prevent this problem is to make sure
2760 % there is some text.
2761 \putwordIndexNonexistent
2764 % If the index file exists but is empty, then \openin leaves \ifeof
2765 % false. We have to make TeX try to read something from the file, so
2766 % it can discover if there is anything in it.
2769 \putwordIndexIsEmpty
2771 % Index files are almost Texinfo source, but we use \ as the escape
2772 % character. It would be better to use @, but that's too big a change
2773 % to make right now.
2774 \def\indexbackslash{\rawbackslashxx}%
2785 % These macros are used by the sorted index file itself.
2786 % Change them to control the appearance of the index.
2789 % Some minor font changes for the special characters.
2790 \let\tentt=
\sectt \let\tt=
\sectt \let\sf=
\sectt
2792 % Remove any glue we may have, we'll be inserting our own.
2795 % We like breaks before the index initials, so insert a bonus.
2798 % Typeset the initial. Making this add up to a whole number of
2799 % baselineskips increases the chance of the dots lining up from column
2800 % to column. It still won't often be perfect, because of the stretch
2801 % we need before each entry, but it's better.
2803 % No shrink because it confuses \balancecolumns.
2804 \vskip 1.67\baselineskip plus
.5\baselineskip
2805 \leftline{\secbf #1}%
2806 \vskip .33\baselineskip plus
.1\baselineskip
2808 % Do our best not to break after the initial.
2812 % This typesets a paragraph consisting of #1, dot leaders, and then #2
2813 % flush to the right margin. It is used for index and table of contents
2814 % entries. The paragraph is indented by \leftskip.
2816 \def\entry#1#2{\begingroup
2818 % Start a new paragraph if necessary, so our assignments below can't
2819 % affect previous text.
2822 % Do not fill out the last line with white space.
2825 % No extra space above this paragraph.
2828 % Do not prefer a separate line ending with a hyphen to fewer lines.
2829 \finalhyphendemerits =
0
2831 % \hangindent is only relevant when the entry text and page number
2832 % don't both fit on one line. In that case, bob suggests starting the
2833 % dots pretty far over on the line. Unfortunately, a large
2834 % indentation looks wrong when the entry text itself is broken across
2835 % lines. So we use a small indentation and put up with long leaders.
2837 % \hangafter is reset to 1 (which is the value we want) at the start
2838 % of each paragraph, so we need not do anything with that.
2841 % When the entry text needs to be broken, just fill out the first line
2843 \rightskip =
0pt plus1fil
2845 % A bit of stretch before each entry for the benefit of balancing columns.
2848 % Start a ``paragraph'' for the index entry so the line breaking
2849 % parameters we've set above will have an effect.
2852 % Insert the text of the index entry. TeX will do line-breaking on it.
2854 % The following is kludged to not output a line of dots in the index if
2855 % there are no page numbers. The next person who breaks this will be
2856 % cursed by a Unix daemon.
2859 \edef\tempc{\tempa}%
2860 \edef\tempd{\tempb}%
2861 \ifx\tempc\tempd\
\else%
2863 % If we must, put the page number on a line of its own, and fill out
2864 % this line with blank space. (The \hfil is overwhelmed with the
2865 % fill leaders glue in \indexdotfill if the page number does fit.)
2867 \null\nobreak\indexdotfill % Have leaders before the page number.
2869 % The `\ ' here is removed by the implicit \unskip that TeX does as
2870 % part of (the primitive) \par. Without it, a spurious underfull
2872 \
#2% The page number ends the paragraph.
2877 % Like \dotfill except takes at least 1 em.
2878 \def\indexdotfill{\cleaders
2879 \hbox{$
\mathsurround=
0pt
\mkern1.5mu $
{\it .
}$
\mkern1.5mu$
}\hskip 1em plus
1fill
}
2881 \def\primary #1{\line{#1\hfil}}
2883 \newskip\secondaryindent \secondaryindent=
0.5cm
2885 \def\secondary #1#2{
2886 {\parfillskip=
0in
\parskip=
0in
2887 \hangindent =
1in
\hangafter=
1
2888 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par
2891 % Define two-column mode, which we use to typeset indexes.
2892 % Adapted from the TeXbook, page 416, which is to say,
2893 % the manmac.tex format used to print the TeXbook itself.
2897 \newdimen\doublecolumnhsize
2899 \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
2900 % Grab any single-column material above us.
2903 % Here is a possibility not foreseen in manmac: if we accumulate a
2904 % whole lot of material, we might end up calling this \output
2905 % routine twice in a row (see the doublecol-lose test, which is
2906 % essentially a couple of indexes with @setchapternewpage off). In
2907 % that case we just ship out what is in \partialpage with the normal
2908 % output routine. Generally, \partialpage will be empty when this
2909 % runs and this will be a no-op. See the indexspread.tex test case.
2910 \ifvoid\partialpage \else
2911 \onepageout{\pagecontents\partialpage}%
2914 \global\setbox\partialpage =
\vbox{%
2915 % Unvbox the main output page.
2917 \kern-
\topskip \kern\baselineskip
2920 \eject % run that output routine to set \partialpage
2922 % Use the double-column output routine for subsequent pages.
2923 \output =
{\doublecolumnout}%
2925 % Change the page size parameters. We could do this once outside this
2926 % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
2927 % format, but then we repeat the same computation. Repeating a couple
2928 % of assignments once per index is clearly meaningless for the
2929 % execution time, so we may as well do it in one place.
2931 % First we halve the line length, less a little for the gutter between
2932 % the columns. We compute the gutter based on the line length, so it
2933 % changes automatically with the paper format. The magic constant
2934 % below is chosen so that the gutter has the same value (well, +-<1pt)
2935 % as it did when we hard-coded it.
2937 % We put the result in a separate register, \doublecolumhsize, so we
2938 % can restore it in \pagesofar, after \hsize itself has (potentially)
2941 \doublecolumnhsize =
\hsize
2942 \advance\doublecolumnhsize by -
.04154\hsize
2943 \divide\doublecolumnhsize by
2
2944 \hsize =
\doublecolumnhsize
2946 % Double the \vsize as well. (We don't need a separate register here,
2947 % since nobody clobbers \vsize.)
2948 \advance\vsize by -
\ht\partialpage
2952 % The double-column output routine for all double-column pages except
2955 \def\doublecolumnout{%
2956 \splittopskip=
\topskip \splitmaxdepth=
\maxdepth
2957 % Get the available space for the double columns -- the normal
2958 % (undoubled) page height minus any material left over from the
2963 % box0 will be the left-hand column, box2 the right.
2964 \setbox0=
\vsplit255 to
\dimen@
\setbox2=
\vsplit255 to
\dimen@
2965 \onepageout\pagesofar
2967 \penalty\outputpenalty
2970 % Re-output the contents of the output page -- any previous material,
2971 % followed by the two boxes we just split, in box0 and box2.
2974 \hsize =
\doublecolumnhsize
2975 \wd0=
\hsize \wd2=
\hsize
2976 \hbox to
\pagewidth{\box0\hfil\box2}%
2978 \def\enddoublecolumns{%
2980 % Split the last of the double-column material. Leave it on the
2981 % current page, no automatic page break.
2984 % If we end up splitting too much material for the current page,
2985 % though, there will be another page break right after this \output
2986 % invocation ends. Having called \balancecolumns once, we do not
2987 % want to call it again. Therefore, reset \output to its normal
2988 % definition right away. (We hope \balancecolumns will never be
2989 % called on to balance too much material, but if it is, this makes
2990 % the output somewhat more palatable.)
2991 \global\output =
{\onepageout{\pagecontents\PAGE}}%
2994 \endgroup % started in \begindoublecolumns
2996 % \pagegoal was set to the doubled \vsize above, since we restarted
2997 % the current page. We're now back to normal single-column
2998 % typesetting, so reset \pagegoal to the normal \vsize (after the
2999 % \endgroup where \vsize got restored).
3002 \def\balancecolumns{%
3003 % Called at the end of the double column material.
3004 \setbox0 =
\vbox{\unvbox255}% like \box255 but more efficient, see p.120.
3006 \advance\dimen@ by
\topskip
3007 \advance\dimen@ by-
\baselineskip
3008 \divide\dimen@ by
2 % target to split to
3009 %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
3010 \splittopskip =
\topskip
3011 % Loop until we get a decent breakpoint.
3015 \global\setbox3 =
\copy0
3016 \global\setbox1 =
\vsplit3 to
\dimen@
3018 \global\advance\dimen@ by
1pt
3021 %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
3022 \setbox0=
\vbox to
\dimen@
{\unvbox1}%
3023 \setbox2=
\vbox to
\dimen@
{\unvbox3}%
3027 \catcode`\@ =
\other
3030 \message{sectioning,
}
3031 % Define chapters, sections, etc.
3034 \newcount\secno \secno=
0
3035 \newcount\subsecno \subsecno=
0
3036 \newcount\subsubsecno \subsubsecno=
0
3038 % This counter is funny since it counts through charcodes of letters A, B, ...
3039 \newcount\appendixno \appendixno = `\@
3040 \def\appendixletter{\char\appendixno}
3042 % Each @chapter defines this as the name of the chapter.
3043 % page headings and footings can use it. @section does likewise.
3047 \newcount\absseclevel % used to calculate proper heading level
3048 \newcount\secbase\secbase=
0 % @raise/lowersections modify this count
3050 % @raisesections: treat @section as chapter, @subsection as section, etc.
3051 \def\raisesections{\global\advance\secbase by -
1}
3052 \let\up=
\raisesections % original BFox name
3054 % @lowersections: treat @chapter as section, @section as subsection, etc.
3055 \def\lowersections{\global\advance\secbase by
1}
3056 \let\down=
\lowersections % original BFox name
3058 % Choose a numbered-heading macro
3059 % #1 is heading level if unmodified by @raisesections or @lowersections
3060 % #2 is text for heading
3061 \def\numhead#1#2{\absseclevel=
\secbase\advance\absseclevel by
#1
3067 \numberedsubseczzz{#2}
3069 \numberedsubsubseczzz{#2}
3071 \ifnum \absseclevel<
0
3074 \numberedsubsubseczzz{#2}
3079 % like \numhead, but chooses appendix heading levels
3080 \def\apphead#1#2{\absseclevel=
\secbase\advance\absseclevel by
#1
3084 \appendixsectionzzz{#2}
3086 \appendixsubseczzz{#2}
3088 \appendixsubsubseczzz{#2}
3090 \ifnum \absseclevel<
0
3093 \appendixsubsubseczzz{#2}
3098 % like \numhead, but chooses numberless heading levels
3099 \def\unnmhead#1#2{\absseclevel=
\secbase\advance\absseclevel by
#1
3103 \unnumberedseczzz{#2}
3105 \unnumberedsubseczzz{#2}
3107 \unnumberedsubsubseczzz{#2}
3109 \ifnum \absseclevel<
0
3112 \unnumberedsubsubseczzz{#2}
3117 % @chapter, @appendix, @unnumbered.
3118 \def\thischaptername{No Chapter Title
}
3119 \outer\def\chapter{\parsearg\chapteryyy}
3120 \def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz
3121 \def\chapterzzz #1{%
3122 \secno=
0 \subsecno=
0 \subsubsecno=
0
3123 \global\advance \chapno by
1 \message{\putwordChapter\space \the\chapno}%
3124 \chapmacro {#1}{\the\chapno}%
3125 \gdef\thissection{#1}%
3126 \gdef\thischaptername{#1}%
3127 % We don't substitute the actual chapter name into \thischapter
3128 % because we don't want its macros evaluated now.
3129 \xdef\thischapter{\putwordChapter{} \the\chapno:
\noexpand\thischaptername}%
3131 \edef\temp{\noexpand\writetocentry{\realbackslash chapentry
{\the\toks0}%
3135 \global\let\section =
\numberedsec
3136 \global\let\subsection =
\numberedsubsec
3137 \global\let\subsubsection =
\numberedsubsubsec
3140 \outer\def\appendix{\parsearg\appendixyyy}
3141 \def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz
3142 \def\appendixzzz #1{%
3143 \secno=
0 \subsecno=
0 \subsubsecno=
0
3144 \global\advance \appendixno by
1
3145 \message{\putwordAppendix\space \appendixletter}%
3146 \chapmacro {#1}{\putwordAppendix{} \appendixletter}%
3147 \gdef\thissection{#1}%
3148 \gdef\thischaptername{#1}%
3149 \xdef\thischapter{\putwordAppendix{} \appendixletter:
\noexpand\thischaptername}%
3151 \edef\temp{\noexpand\writetocentry{\realbackslash chapentry
{\the\toks0}%
3152 {\putwordAppendix{} \appendixletter}}}%
3155 \global\let\section =
\appendixsec
3156 \global\let\subsection =
\appendixsubsec
3157 \global\let\subsubsection =
\appendixsubsubsec
3160 % @centerchap is like @unnumbered, but the heading is centered.
3161 \outer\def\centerchap{\parsearg\centerchapyyy}
3162 \def\centerchapyyy #1{{\let\unnumbchapmacro=
\centerchapmacro \unnumberedyyy{#1}}}
3164 % @top is like @unnumbered.
3165 \outer\def\top{\parsearg\unnumberedyyy}
3167 \outer\def\unnumbered{\parsearg\unnumberedyyy}
3168 \def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
3169 \def\unnumberedzzz #1{%
3170 \secno=
0 \subsecno=
0 \subsubsecno=
0
3172 % This used to be simply \message{#1}, but TeX fully expands the
3173 % argument to \message. Therefore, if #1 contained @-commands, TeX
3174 % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
3175 % expanded @cite (which turns out to cause errors because \cite is meant
3176 % to be executed, not expanded).
3178 % Anyway, we don't want the fully-expanded definition of @cite to appear
3179 % as a result of the \message, we just want `@cite' itself. We use
3180 % \the<toks register> to achieve this: TeX expands \the<toks> only once,
3181 % simply yielding the contents of <toks register>. (We also do this for
3183 \toks0 =
{#1}\message{(
\the\toks0)
}%
3185 \unnumbchapmacro {#1}%
3186 \gdef\thischapter{#1}\gdef\thissection{#1}%
3188 \edef\temp{\noexpand\writetocentry{\realbackslash unnumbchapentry
{\the\toks0}}}%
3191 \global\let\section =
\unnumberedsec
3192 \global\let\subsection =
\unnumberedsubsec
3193 \global\let\subsubsection =
\unnumberedsubsubsec
3197 \outer\def\numberedsec{\parsearg\secyyy}
3198 \def\secyyy #1{\numhead1{#1}} % normally calls seczzz
3200 \subsecno=
0 \subsubsecno=
0 \global\advance \secno by
1 %
3201 \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
3203 \edef\temp{\noexpand\writetocentry{\realbackslash secentry
{\the\toks0}%
3204 {\the\chapno}{\the\secno}}}%
3210 \outer\def\appendixsection{\parsearg\appendixsecyyy}
3211 \outer\def\appendixsec{\parsearg\appendixsecyyy}
3212 \def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz
3213 \def\appendixsectionzzz #1{%
3214 \subsecno=
0 \subsubsecno=
0 \global\advance \secno by
1 %
3215 \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
3217 \edef\temp{\noexpand\writetocentry{\realbackslash secentry
{\the\toks0}%
3218 {\appendixletter}{\the\secno}}}%
3224 \outer\def\unnumberedsec{\parsearg\unnumberedsecyyy}
3225 \def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz
3226 \def\unnumberedseczzz #1{%
3227 \plainsecheading {#1}\gdef\thissection{#1}%
3229 \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry
{\the\toks0}}}%
3236 \outer\def\numberedsubsec{\parsearg\numberedsubsecyyy}
3237 \def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz
3238 \def\numberedsubseczzz #1{%
3239 \gdef\thissection{#1}\subsubsecno=
0 \global\advance \subsecno by
1 %
3240 \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
3242 \edef\temp{\noexpand\writetocentry{\realbackslash subsecentry
{\the\toks0}%
3243 {\the\chapno}{\the\secno}{\the\subsecno}}}%
3249 \outer\def\appendixsubsec{\parsearg\appendixsubsecyyy}
3250 \def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz
3251 \def\appendixsubseczzz #1{%
3252 \gdef\thissection{#1}\subsubsecno=
0 \global\advance \subsecno by
1 %
3253 \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
3255 \edef\temp{\noexpand\writetocentry{\realbackslash subsecentry
{\the\toks0}%
3256 {\appendixletter}{\the\secno}{\the\subsecno}}}%
3262 \outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy}
3263 \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
3264 \def\unnumberedsubseczzz #1{%
3265 \plainsubsecheading {#1}\gdef\thissection{#1}%
3267 \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry
%
3275 \outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy}
3276 \def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz
3277 \def\numberedsubsubseczzz #1{%
3278 \gdef\thissection{#1}\global\advance \subsubsecno by
1 %
3279 \subsubsecheading {#1}
3280 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
3282 \edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry
{\the\toks0}%
3283 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
3289 \outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy}
3290 \def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz
3291 \def\appendixsubsubseczzz #1{%
3292 \gdef\thissection{#1}\global\advance \subsubsecno by
1 %
3293 \subsubsecheading {#1}
3294 {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
3296 \edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry
{\the\toks0}%
3297 {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
3303 \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy}
3304 \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
3305 \def\unnumberedsubsubseczzz #1{%
3306 \plainsubsubsecheading {#1}\gdef\thissection{#1}%
3308 \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry
%
3315 % These are variants which are not "outer", so they can appear in @ifinfo.
3316 % Actually, they should now be obsolete; ordinary section commands should work.
3317 \def\infotop{\parsearg\unnumberedzzz}
3318 \def\infounnumbered{\parsearg\unnumberedzzz}
3319 \def\infounnumberedsec{\parsearg\unnumberedseczzz}
3320 \def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz}
3321 \def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
3323 \def\infoappendix{\parsearg\appendixzzz}
3324 \def\infoappendixsec{\parsearg\appendixseczzz}
3325 \def\infoappendixsubsec{\parsearg\appendixsubseczzz}
3326 \def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz}
3328 \def\infochapter{\parsearg\chapterzzz}
3329 \def\infosection{\parsearg\sectionzzz}
3330 \def\infosubsection{\parsearg\subsectionzzz}
3331 \def\infosubsubsection{\parsearg\subsubsectionzzz}
3333 % These macros control what the section commands do, according
3334 % to what kind of chapter we are in (ordinary, appendix, or unnumbered).
3335 % Define them by default for a numbered chapter.
3336 \global\let\section =
\numberedsec
3337 \global\let\subsection =
\numberedsubsec
3338 \global\let\subsubsection =
\numberedsubsubsec
3340 % Define @majorheading, @heading and @subheading
3342 % NOTE on use of \vbox for chapter headings, section headings, and such:
3343 % 1) We use \vbox rather than the earlier \line to permit
3344 % overlong headings to fold.
3345 % 2) \hyphenpenalty is set to 10000 because hyphenation in a
3346 % heading is obnoxious; this forbids it.
3347 % 3) Likewise, headings look best if no \parindent is used, and
3348 % if justification is not attempted. Hence \raggedright.
3351 \def\majorheading{\parsearg\majorheadingzzz}
3352 \def\majorheadingzzz #1{%
3353 {\advance\chapheadingskip by
10pt
\chapbreak }%
3354 {\chapfonts \vbox{\hyphenpenalty=
10000\tolerance=
5000
3355 \parindent=
0pt
\raggedright
3356 \rm #1\hfill}}\bigskip \par\penalty 200}
3358 \def\chapheading{\parsearg\chapheadingzzz}
3359 \def\chapheadingzzz #1{\chapbreak %
3360 {\chapfonts \vbox{\hyphenpenalty=
10000\tolerance=
5000
3361 \parindent=
0pt
\raggedright
3362 \rm #1\hfill}}\bigskip \par\penalty 200}
3364 % @heading, @subheading, @subsubheading.
3365 \def\heading{\parsearg\plainsecheading}
3366 \def\subheading{\parsearg\plainsubsecheading}
3367 \def\subsubheading{\parsearg\plainsubsubsecheading}
3369 % These macros generate a chapter, section, etc. heading only
3370 % (including whitespace, linebreaking, etc. around it),
3371 % given all the information in convenient, parsed form.
3373 %%% Args are the skip and penalty (usually negative)
3374 \def\dobreak#1#2{\par\ifdim\lastskip<
#1\removelastskip\penalty#2\vskip#1\fi}
3376 \def\setchapterstyle #1 {\csname CHAPF
#1\endcsname}
3378 %%% Define plain chapter starts, and page on/off switching for it
3379 % Parameter controlling skip before chapter headings (if needed)
3381 \newskip\chapheadingskip
3383 \def\chapbreak{\dobreak \chapheadingskip {-
4000}}
3384 \def\chappager{\par\vfill\supereject}
3385 \def\chapoddpage{\chappager \ifodd\pageno \else \hbox to
0pt
{} \chappager\fi}
3387 \def\setchapternewpage #1 {\csname CHAPPAG
#1\endcsname}
3390 \global\let\contentsalignmacro =
\chappager
3391 \global\let\pchapsepmacro=
\chapbreak
3392 \global\let\pagealignmacro=
\chappager}
3395 \global\let\contentsalignmacro =
\chappager
3396 \global\let\pchapsepmacro=
\chappager
3397 \global\let\pagealignmacro=
\chappager
3398 \global\def\HEADINGSon{\HEADINGSsingle}}
3401 \global\let\contentsalignmacro =
\chapoddpage
3402 \global\let\pchapsepmacro=
\chapoddpage
3403 \global\let\pagealignmacro=
\chapoddpage
3404 \global\def\HEADINGSon{\HEADINGSdouble}}
3409 \global\let\chapmacro=
\chfplain
3410 \global\let\unnumbchapmacro=
\unnchfplain
3411 \global\let\centerchapmacro=
\centerchfplain}
3413 % Plain chapter opening.
3414 % #1 is the text, #2 the chapter number or empty if unnumbered.
3420 \setbox0 =
\hbox{#2\ifx\chapnum\empty\else\enspace\fi}%
3421 \vbox{\hyphenpenalty=
10000 \tolerance=
5000 \parindent=
0pt
\raggedright
3422 \hangindent =
\wd0 \centerparametersmaybe
3425 \nobreak\bigskip % no page break after a chapter title
3429 % Plain opening for unnumbered.
3430 \def\unnchfplain#1{\chfplain{#1}{}}
3432 % @centerchap -- centered and unnumbered.
3433 \let\centerparametersmaybe =
\relax
3434 \def\centerchfplain#1{{%
3435 \def\centerparametersmaybe{%
3436 \advance\rightskip by
3\rightskip
3437 \leftskip =
\rightskip
3443 \CHAPFplain % The default
3445 \def\unnchfopen #1{%
3446 \chapoddpage {\chapfonts \vbox{\hyphenpenalty=
10000\tolerance=
5000
3447 \parindent=
0pt
\raggedright
3448 \rm #1\hfill}}\bigskip \par\nobreak
3451 \def\chfopen #1#2{\chapoddpage {\chapfonts
3452 \vbox to
3in
{\vfil \hbox to
\hsize{\hfil #2} \hbox to
\hsize{\hfil #1} \vfil}}%
3456 \def\centerchfopen #1{%
3457 \chapoddpage {\chapfonts \vbox{\hyphenpenalty=
10000\tolerance=
5000
3459 \hfill {\rm #1}\hfill}}\bigskip \par\nobreak
3463 \global\let\chapmacro=
\chfopen
3464 \global\let\unnumbchapmacro=
\unnchfopen
3465 \global\let\centerchapmacro=
\centerchfopen}
3469 \newskip\secheadingskip
3470 \def\secheadingbreak{\dobreak \secheadingskip {-
1000}}
3471 \def\secheading#1#2#3{\sectionheading{sec
}{#2.
#3}{#1}}
3472 \def\plainsecheading#1{\sectionheading{sec
}{}{#1}}
3474 % Subsection titles.
3475 \newskip \subsecheadingskip
3476 \def\subsecheadingbreak{\dobreak \subsecheadingskip {-
500}}
3477 \def\subsecheading#1#2#3#4{\sectionheading{subsec
}{#2.
#3.
#4}{#1}}
3478 \def\plainsubsecheading#1{\sectionheading{subsec
}{}{#1}}
3480 % Subsubsection titles.
3481 \let\subsubsecheadingskip =
\subsecheadingskip
3482 \let\subsubsecheadingbreak =
\subsecheadingbreak
3483 \def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec
}{#2.
#3.
#4.
#5}{#1}}
3484 \def\plainsubsubsecheading#1{\sectionheading{subsubsec
}{}{#1}}
3487 % Print any size section title.
3489 % #1 is the section type (sec/subsec/subsubsec), #2 is the section
3490 % number (maybe empty), #3 the text.
3491 \def\sectionheading#1#2#3{%
3493 \expandafter\advance\csname #1headingskip
\endcsname by
\parskip
3494 \csname #1headingbreak
\endcsname
3497 % Switch to the right set of fonts.
3498 \csname #1fonts
\endcsname \rm
3500 % Only insert the separating space if we have a section number.
3502 \setbox0 =
\hbox{#2\ifx\secnum\empty\else\enspace\fi}%
3504 \vbox{\hyphenpenalty=
10000 \tolerance=
5000 \parindent=
0pt
\raggedright
3505 \hangindent =
\wd0 % zero if no section number
3508 \ifdim\parskip<
10pt
\nobreak\kern10pt\nobreak\kern-
\parskip\fi \nobreak
3515 % Write an entry to the toc file, opening it if necessary.
3516 % Called from @chapter, etc. We supply {\folio} at the end of the
3517 % argument, which will end up as the last argument to the \...entry macro.
3519 % We open the .toc file here instead of at @setfilename or any other
3520 % given time so that @contents can be put in the document anywhere.
3522 \newif\iftocfileopened
3523 \def\writetocentry#1{%
3524 \iftocfileopened\else
3525 \immediate\openout\tocfile =
\jobname.toc
3526 \global\tocfileopenedtrue
3528 \iflinks \write\tocfile{#1{\folio}}\fi
3531 \newskip\contentsrightmargin \contentsrightmargin=
1in
3532 \newcount\savepageno
3533 \newcount\lastnegativepageno \lastnegativepageno = -
1
3535 % Finish up the main text and prepare to read what we've written
3538 \def\startcontents#1{%
3539 % If @setchapternewpage on, and @headings double, the contents should
3540 % start on an odd page, unlike chapters. Thus, we maintain
3541 % \contentsalignmacro in parallel with \pagealignmacro.
3542 % From: Torbjorn Granlund <tege@matematik.su.se>
3544 \immediate\closeout\tocfile
3546 % Don't need to put `Contents' or `Short Contents' in the headline.
3547 % It is abundantly clear what they are.
3548 \unnumbchapmacro{#1}\def\thischapter{}%
3549 \savepageno =
\pageno
3550 \begingroup % Set up to handle contents files properly.
3551 \catcode`\\=
0 \catcode`\
{=
1 \catcode`\
}=
2 \catcode`\@=
11
3552 % We can't do this, because then an actual ^ in a section
3553 % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97.
3554 %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
3555 \raggedbottom % Worry more about breakpoints than the bottom.
3556 \advance\hsize by -
\contentsrightmargin % Don't use the full line length.
3558 % Roman numerals for page numbers.
3559 \ifnum \pageno>
0 \pageno =
\lastnegativepageno \fi
3563 % Normal (long) toc.
3565 \startcontents{\putwordTOC}%
3566 \openin 1 \jobname.toc
3572 \contentsalignmacro % in case @setchapternewpage odd is in effect
3574 \lastnegativepageno =
\pageno
3575 \pageno =
\savepageno
3578 % And just the chapters.
3579 \def\summarycontents{%
3580 \startcontents{\putwordShortTOC}%
3582 \let\chapentry =
\shortchapentry
3583 \let\unnumbchapentry =
\shortunnumberedentry
3584 % We want a true roman here for the page numbers.
3586 \let\rm=
\shortcontrm \let\bf=
\shortcontbf \let\sl=
\shortcontsl
3588 \hyphenpenalty =
10000
3589 \advance\baselineskip by
1pt
% Open it up a little.
3590 \def\secentry #
#1#
#2#
#3#
#4{}
3591 \def\unnumbsecentry #
#1#
#2{}
3592 \def\subsecentry #
#1#
#2#
#3#
#4#
#5{}
3593 \def\unnumbsubsecentry #
#1#
#2{}
3594 \def\subsubsecentry #
#1#
#2#
#3#
#4#
#5#
#6{}
3595 \def\unnumbsubsubsecentry #
#1#
#2{}
3596 \openin 1 \jobname.toc
3602 \contentsalignmacro % in case @setchapternewpage odd is in effect
3604 \lastnegativepageno =
\pageno
3605 \pageno =
\savepageno
3607 \let\shortcontents =
\summarycontents
3609 % These macros generate individual entries in the table of contents.
3610 % The first argument is the chapter or section name.
3611 % The last argument is the page number.
3612 % The arguments in between are the chapter number, section number, ...
3614 % Chapter-level things, for both the long and short contents.
3615 \def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}
3617 % See comments in \dochapentry re vbox and related settings
3618 \def\shortchapentry#1#2#3{%
3619 \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno{#3}}%
3622 % Typeset the label for a chapter or appendix for the short contents.
3623 % The arg is, e.g. `Appendix A' for an appendix, or `3' for a chapter.
3624 % We could simplify the code here by writing out an \appendixentry
3625 % command in the toc file for appendices, instead of using \chapentry
3626 % for both, but it doesn't seem worth it.
3627 \setbox0 =
\hbox{\shortcontrm \putwordAppendix }
3628 \newdimen\shortappendixwidth \shortappendixwidth =
\wd0
3630 \def\shortchaplabel#1{%
3631 % We typeset #1 in a box of constant width, regardless of the text of
3632 % #1, so the chapter titles will come out aligned.
3633 \setbox0 =
\hbox{#1}%
3634 \dimen0 =
\ifdim\wd0 >
\shortappendixwidth \shortappendixwidth \else 0pt
\fi
3636 % This space should be plenty, since a single number is .5em, and the
3637 % widest letter (M) is 1em, at least in the Computer Modern fonts.
3638 % (This space doesn't include the extra space that gets added after
3639 % the label; that gets put in by \shortchapentry above.)
3640 \advance\dimen0 by
1.1em
3641 \hbox to
\dimen0{#1\hfil}%
3644 \def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
3645 \def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno{#2}}}
3648 \def\secentry#1#2#3#4{\dosecentry{#2.
#3\labelspace#1}{#4}}
3649 \def\unnumbsecentry#1#2{\dosecentry{#1}{#2}}
3652 \def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.
#3.
#4\labelspace#1}{#5}}
3653 \def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}}
3655 % And subsubsections.
3656 \def\subsubsecentry#1#2#3#4#5#6{%
3657 \dosubsubsecentry{#2.
#3.
#4.
#5\labelspace#1}{#6}}
3658 \def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}}
3660 % This parameter controls the indentation of the various levels.
3661 \newdimen\tocindent \tocindent =
3pc
3663 % Now for the actual typesetting. In all these, #1 is the text and #2 is the
3666 % If the toc has to be broken over pages, we want it to be at chapters
3667 % if at all possible; hence the \penalty.
3668 \def\dochapentry#1#2{%
3669 \penalty-
300 \vskip1\baselineskip plus
.33\baselineskip minus
.25\baselineskip
3672 \tocentry{#1}{\dopageno{#2}}%
3674 \nobreak\vskip .25\baselineskip plus
.1\baselineskip
3677 \def\dosecentry#1#2{\begingroup
3678 \secentryfonts \leftskip=
\tocindent
3679 \tocentry{#1}{\dopageno{#2}}%
3682 \def\dosubsecentry#1#2{\begingroup
3683 \subsecentryfonts \leftskip=
2\tocindent
3684 \tocentry{#1}{\dopageno{#2}}%
3687 \def\dosubsubsecentry#1#2{\begingroup
3688 \subsubsecentryfonts \leftskip=
3\tocindent
3689 \tocentry{#1}{\dopageno{#2}}%
3692 % Final typesetting of a toc entry; we use the same \entry macro as for
3693 % the index entries, but we want to suppress hyphenation here. (We
3694 % can't do that in the \entry macro, since index entries might consist
3695 % of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.)
3696 \def\tocentry#1#2{\begingroup
3697 \vskip 0pt plus1pt
% allow a little stretch for the sake of nice page breaks
3698 % Do not use \turnoffactive in these arguments. Since the toc is
3699 % typeset in cmr, so characters such as _ would come out wrong; we
3700 % have to do the usual translation tricks.
3704 % Space between chapter (or whatever) number and the title.
3705 \def\labelspace{\hskip1em \relax}
3707 \def\dopageno#1{{\rm #1}}
3708 \def\doshortpageno#1{{\rm #1}}
3710 \def\chapentryfonts{\secfonts \rm}
3711 \def\secentryfonts{\textfonts}
3712 \let\subsecentryfonts =
\textfonts
3713 \let\subsubsecentryfonts =
\textfonts
3716 \message{environments,
}
3718 % Since these characters are used in examples, it should be an even number of
3719 % \tt widths. Each \tt character is 1en, so two makes it 1em.
3720 % Furthermore, these definitions must come after we define our fonts.
3721 \newbox\dblarrowbox \newbox\longdblarrowbox
3722 \newbox\pushcharbox \newbox\bullbox
3723 \newbox\equivbox \newbox\errorbox
3726 %\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil}
3727 %\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil}
3728 %\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil}
3729 %\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil}
3730 % Adapted from the manmac format (p.420 of TeXbook)
3731 %\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex
3735 % @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
3737 \def\result{\leavevmode\raise.15ex
\hbox to
1em
{\hfil$
\Rightarrow$
\hfil}}
3738 \def\expansion{\leavevmode\raise.1ex
\hbox to
1em
{\hfil$
\mapsto$
\hfil}}
3739 \def\print{\leavevmode\lower.1ex
\hbox to
1em
{\hfil$
\dashv$
\hfil}}
3740 \def\equiv{\leavevmode\lower.1ex
\hbox to
1em
{\hfil$
\ptexequiv$
\hfil}}
3742 % Adapted from the TeXbook's \boxit.
3743 {\tentt \global\dimen0 =
3em
}% Width of the box.
3744 \dimen2 =
.55pt
% Thickness of rules
3745 % The text. (`r' is open on the right, `e' somewhat less so on the left.)
3746 \setbox0 =
\hbox{\kern-
.75pt
\tensf error
\kern-
1.5pt
}
3748 \global\setbox\errorbox=
\hbox to
\dimen0{\hfil
3749 \hsize =
\dimen0 \advance\hsize by -
5.8pt
% Space to left+right.
3750 \advance\hsize by -
2\dimen2 % Rules.
3752 \hrule height
\dimen2
3753 \hbox{\vrule width
\dimen2 \kern3pt % Space to left of text.
3754 \vtop{\kern2.4pt
\box0 \kern2.4pt
}% Space above/below.
3755 \kern3pt\vrule width
\dimen2}% Space to right.
3756 \hrule height
\dimen2}
3759 % The @error{} command.
3760 \def\error{\leavevmode\lower.7ex
\copy\errorbox}
3762 % @tex ... @end tex escapes into raw Tex temporarily.
3763 % One exception: @ is still an escape character, so that @end tex works.
3764 % But \@ or @@ will get a plain tex @ character.
3766 \def\tex{\begingroup
3767 \catcode `\\=
0 \catcode `\
{=
1 \catcode `\
}=
2
3768 \catcode `\$=
3 \catcode `\&=
4 \catcode `\#=
6
3769 \catcode `\^=
7 \catcode `
\_=
8 \catcode `\~=
13 \let~=
\tie
3771 \catcode 43=
12 % plus
3780 \let\bullet=
\ptexbullet
3785 \let\equiv=
\ptexequiv
3794 \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
3795 \def\enddots{\relax\ifmmode\endldots\else$
\mathsurround=
0pt
\endldots\,$
\fi}%
3797 \let\Etex=
\endgroup}
3799 % Define @lisp ... @endlisp.
3800 % @lisp does a \begingroup so it can rebind things,
3801 % including the definition of @endlisp (which normally is erroneous).
3803 % Amount to narrow the margins by for @lisp.
3804 \newskip\lispnarrowing \lispnarrowing=
0.4in
3806 % This is the definition that ^^M gets inside @lisp, @example, and other
3807 % such environments. \null is better than a space, since it doesn't
3809 \def\lisppar{\null\endgraf}
3811 % Make each space character in the input produce a normal interword
3812 % space in the output. Don't allow a line break at this space, as this
3813 % is used only in environments like @example, where each line of input
3814 % should produce a line of output anyway.
3817 \gdef\sepspaces{\obeyspaces\let =
\tie}}
3819 % Define \obeyedspace to be our active space, whatever it is. This is
3820 % for use in \parsearg.
3822 \global\let\obeyedspace=
}
3824 % This space is always present above and below environments.
3825 \newskip\envskipamount \envskipamount =
0pt
3827 % Make spacing and below environment symmetrical. We use \parskip here
3828 % to help in doing that, since in @example-like environments \parskip
3829 % is reset to zero; thus the \afterenvbreak inserts no space -- but the
3830 % start of the next paragraph will insert \parskip
3832 \def\aboveenvbreak{{\advance\envskipamount by
\parskip
3833 \endgraf \ifdim\lastskip<
\envskipamount
3834 \removelastskip \penalty-
50 \vskip\envskipamount \fi}}
3836 \let\afterenvbreak =
\aboveenvbreak
3838 % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins.
3839 \let\nonarrowing=
\relax
3841 % @cartouche ... @end cartouche: draw rectangle w/rounded corners around
3842 % environment contents.
3843 \font\circle=lcircle10
3845 \newdimen\cartouter\newdimen\cartinner
3846 \newskip\normbskip\newskip\normpskip\newskip\normlskip
3847 \circthick=
\fontdimen8\circle
3849 \def\ctl{{\circle\char'
013\hskip -
6pt
}}% 6pt from pl file: 1/2charwidth
3850 \def\ctr{{\hskip 6pt
\circle\char'
010}}
3851 \def\cbl{{\circle\char'
012\hskip -
6pt
}}
3852 \def\cbr{{\hskip 6pt
\circle\char'
011}}
3853 \def\carttop{\hbox to
\cartouter{\hskip\lskip
3854 \ctl\leaders\hrule height
\circthick\hfil\ctr
3856 \def\cartbot{\hbox to
\cartouter{\hskip\lskip
3857 \cbl\leaders\hrule height
\circthick\hfil\cbr
3860 \newskip\lskip\newskip\rskip
3862 \long\def\cartouche{%
3864 \lskip=
\leftskip \rskip=
\rightskip
3865 \leftskip=
0pt
\rightskip=
0pt
%we want these *outside*.
3866 \cartinner=
\hsize \advance\cartinner by-
\lskip
3867 \advance\cartinner by-
\rskip
3869 \advance\cartouter by
18.4pt
% allow for 3pt kerns on either
3870 % side, and for 6pt waste from
3871 % each corner char, and rule thickness
3872 \normbskip=
\baselineskip \normpskip=
\parskip \normlskip=
\lineskip
3873 % Flag to tell @lisp, etc., not to narrow margin.
3874 \let\nonarrowing=
\comment
3876 \baselineskip=
0pt
\parskip=
0pt
\lineskip=
0pt
3885 \baselineskip=
\normbskip
3886 \lineskip=
\normlskip
3902 % This macro is called at the beginning of all the @example variants,
3906 \inENV % This group ends at the end of the body
3907 \hfuzz =
12pt
% Don't be fussy
3908 \sepspaces % Make spaces be word-separators rather than space tokens.
3910 \let\par =
\lisppar % don't ignore blank lines
3911 \obeylines % each line of input is a line of output
3914 \emergencystretch =
0pt
% don't try to avoid overfull boxes
3915 % @cartouche defines \nonarrowing to inhibit narrowing
3916 % at next level down.
3917 \ifx\nonarrowing\relax
3918 \advance \leftskip by
\lispnarrowing
3919 \exdentamount=
\lispnarrowing
3920 \let\exdent=
\nofillexdent
3921 \let\nonarrowing=
\relax
3925 % Define the \E... control sequence only if we are inside the particular
3926 % environment, so the error checking in \end will work.
3928 % To end an @example-like environment, we first end the paragraph (via
3929 % \afterenvbreak's vertical glue), and then the group. That way we keep
3930 % the zero \parskip that the environments set -- \parskip glue will be
3931 % inserted at the beginning of the next paragraph in the document, after
3934 \def\nonfillfinish{\afterenvbreak\endgroup}
3936 % @lisp: indented, narrowed, typewriter font.
3937 \def\lisp{\begingroup
3939 \let\Elisp =
\nonfillfinish
3941 \let\kbdfont =
\kbdexamplefont % Allow @kbd to do something special.
3942 \gobble % eat return
3945 % @example: Same as @lisp.
3946 \def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp}
3948 % @small... is usually equivalent to the non-small (@smallbook
3949 % redefines). We must call \example (or whatever) last in the
3950 % definition, since it reads the return following the @example (or
3951 % whatever) command.
3953 % This actually allows (for example) @end display inside an
3954 % @smalldisplay. Too bad, but makeinfo will catch the error anyway.
3956 \def\smalldisplay{\begingroup\def\Esmalldisplay{\nonfillfinish\endgroup}\display}
3957 \def\smallexample{\begingroup\def\Esmallexample{\nonfillfinish\endgroup}\lisp}
3958 \def\smallformat{\begingroup\def\Esmallformat{\nonfillfinish\endgroup}\format}
3959 \def\smalllisp{\begingroup\def\Esmalllisp{\nonfillfinish\endgroup}\lisp}
3961 % Real @smallexample and @smalllisp (when @smallbook): use smaller fonts.
3962 % Originally contributed by Pavel@xerox.
3963 \def\smalllispx{\begingroup
3964 \def\Esmalllisp{\nonfillfinish\endgroup}%
3965 \def\Esmallexample{\nonfillfinish\endgroup}%
3970 % @display: same as @lisp except keep current font.
3972 \def\display{\begingroup
3974 \let\Edisplay =
\nonfillfinish
3978 % @smalldisplay (when @smallbook): @display plus smaller fonts.
3980 \def\smalldisplayx{\begingroup
3981 \def\Esmalldisplay{\nonfillfinish\endgroup}%
3986 % @format: same as @display except don't narrow margins.
3988 \def\format{\begingroup
3989 \let\nonarrowing = t
3991 \let\Eformat =
\nonfillfinish
3995 % @smallformat (when @smallbook): @format plus smaller fonts.
3997 \def\smallformatx{\begingroup
3998 \def\Esmallformat{\nonfillfinish\endgroup}%
4003 % @flushleft (same as @format).
4005 \def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format}
4009 \def\flushright{\begingroup
4010 \let\nonarrowing = t
4012 \let\Eflushright =
\nonfillfinish
4013 \advance\leftskip by
0pt plus
1fill
4017 % @quotation does normal linebreaking (hence we can't use \nonfillstart)
4018 % and narrows the margins.
4021 \begingroup\inENV %This group ends at the end of the @quotation body
4022 {\parskip=
0pt
\aboveenvbreak}% because \aboveenvbreak inserts \parskip
4025 % We have retained a nonzero parskip for the environment, since we're
4026 % doing normal filling. So to avoid extra space below the environment...
4027 \def\Equotation{\parskip =
0pt
\nonfillfinish}%
4029 % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
4030 \ifx\nonarrowing\relax
4031 \advance\leftskip by
\lispnarrowing
4032 \advance\rightskip by
\lispnarrowing
4033 \exdentamount =
\lispnarrowing
4034 \let\nonarrowing =
\relax
4040 % Define formatter for defuns
4041 % First, allow user to change definition object font (\df) internally
4042 \def\setdeffont #1 {\csname DEF
#1\endcsname}
4044 \newskip\defbodyindent \defbodyindent=
.4in
4045 \newskip\defargsindent \defargsindent=
50pt
4046 \newskip\deftypemargin \deftypemargin=
12pt
4047 \newskip\deflastargmargin \deflastargmargin=
18pt
4049 \newcount\parencount
4050 % define \functionparens, which makes ( and ) and & do special things.
4051 % \functionparens affects the group it is contained in.
4053 \catcode`\(=
\active \catcode`\)=
\active \catcode`\&=
\active
4054 \catcode`\
[=
\active \catcode`\
]=
\active}
4056 % Make control sequences which act like normal parenthesis chars.
4057 \let\lparen = (
\let\rparen = )
4059 {\activeparens % Now, smart parens don't turn on until &foo (see \amprm)
4061 % Be sure that we always have a definition for `(', etc. For example,
4062 % if the fn name has parens in it, \boldbrax will not be in effect yet,
4063 % so TeX would otherwise complain about undefined control sequence.
4064 \global\let(=
\lparen \global\let)=
\rparen
4065 \global\let[=
\lbrack \global\let]=
\rbrack
4067 \gdef\functionparens{\boldbrax\let&=
\amprm\parencount=
0 }
4068 \gdef\boldbrax{\let(=
\opnr\let)=
\clnr\let[=
\lbrb\let]=
\rbrb}
4069 % This is used to turn on special parens
4070 % but make & act ordinary (given that it's active).
4071 \gdef\boldbraxnoamp{\let(=
\opnr\let)=
\clnr\let[=
\lbrb\let]=
\rbrb\let&=
\ampnr}
4073 % Definitions of (, ) and & used in args for functions.
4074 % This is the definition of ( outside of all parentheses.
4075 \gdef\oprm#1 {{\rm\char`\(
}#1 \bf \let(=
\opnested
4076 \global\advance\parencount by
1
4079 % This is the definition of ( when already inside a level of parens.
4080 \gdef\opnested{\char`\(
\global\advance\parencount by
1 }
4082 \gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
4083 % also in that case restore the outer-level definition of (.
4084 \ifnum \parencount=
1 {\rm \char `\)
}\sl \let(=
\oprm \else \char `\)
\fi
4085 \global\advance \parencount by -
1 }
4086 % If we encounter &foo, then turn on ()-hacking afterwards
4087 \gdef\amprm#1 {{\rm\&
#1}\let(=
\oprm \let)=
\clrm\
}
4089 \gdef\normalparens{\boldbrax\let&=
\ampnr}
4090 } % End of definition inside \activeparens
4091 %% These parens (in \boldbrax) actually are a little bolder than the
4092 %% contained text. This is especially needed for [ and ]
4093 \def\opnr{{\sf\char`\(
}\global\advance\parencount by
1 }
4094 \def\clnr{{\sf\char`\)
}\global\advance\parencount by -
1 }
4096 \def\lbrb{{\bf\char`\
[}}
4097 \def\rbrb{{\bf\char`\
]}}
4099 % Active &'s sneak into the index arguments, so make sure it's defined.
4102 \global\let& =
\ampnr
4105 % First, defname, which formats the header line itself.
4106 % #1 should be the function name.
4107 % #2 should be the type of definition, such as "Function".
4110 % Get the values of \leftskip and \rightskip as they were
4111 % outside the @def...
4113 \advance\dimen2 by -
\defbodyindent
4115 \setbox0=
\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
4116 \dimen0=
\hsize \advance \dimen0 by -
\wd0 % compute size for first line
4117 \dimen1=
\hsize \advance \dimen1 by -
\defargsindent %size for continuations
4118 \parshape 2 0in
\dimen0 \defargsindent \dimen1
4119 % Now output arg 2 ("Function" or some such)
4120 % ending at \deftypemargin from the right margin,
4121 % but stuck inside a box of width 0 so it does not interfere with linebreaking
4122 {% Adjust \hsize to exclude the ambient margins,
4123 % so that \rightline will obey them.
4124 \advance \hsize by -
\dimen2
4125 \rlap{\rightline{{\rm #2}\hskip -
1.25pc
}}}%
4126 % Make all lines underfull and no complaints:
4127 \tolerance=
10000 \hbadness=
10000
4128 \advance\leftskip by -
\defbodyindent
4129 \exdentamount=
\defbodyindent
4130 {\df #1}\enskip % Generate function name
4133 % Actually process the body of a definition
4134 % #1 should be the terminating control sequence, such as \Edefun.
4135 % #2 should be the "another name" control sequence, such as \defunx.
4136 % #3 should be the control sequence that actually processes the header,
4137 % such as \defunheader.
4139 \def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
4141 % Define the end token that this defining construct specifies
4142 % so that it will exit this group.
4143 \def#1{\endgraf\endgroup\medbreak}%
4144 \def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
4146 \advance\leftskip by
\defbodyindent
4147 \exdentamount=
\defbodyindent
4149 \catcode 61=
\active % 61 is `='
4150 \obeylines\activeparens\spacesplit#3}
4152 % #1 is the \E... control sequence to end the definition (which we define).
4153 % #2 is the \...x control sequence for consecutive fns (which we define).
4154 % #3 is the control sequence to call to resume processing.
4155 % #4, delimited by the space, is the class name.
4157 \def\defmethparsebody#1#2#3#4 {\begingroup\inENV %
4159 % Define the end token that this defining construct specifies
4160 % so that it will exit this group.
4161 \def#1{\endgraf\endgroup\medbreak}%
4162 \def#2#
#1 {\begingroup\obeylines\activeparens\spacesplit{#3{#
#1}}}%
4164 \advance\leftskip by
\defbodyindent
4165 \exdentamount=
\defbodyindent
4166 \begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
4168 % @deftypemethod has an extra argument that nothing else does. Sigh.
4169 % #1 is the \E... control sequence to end the definition (which we define).
4170 % #2 is the \...x control sequence for consecutive fns (which we define).
4171 % #3 is the control sequence to call to resume processing.
4172 % #4, delimited by the space, is the class name.
4173 % #5 is the method's return type.
4175 \def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV %
4177 % Define the end token that this defining construct specifies
4178 % so that it will exit this group.
4179 \def#1{\endgraf\endgroup\medbreak}%
4180 \def#2#
#1 #
#2 {\begingroup\obeylines\activeparens\spacesplit{#3{#
#1}{#
#2}}}%
4182 \advance\leftskip by
\defbodyindent
4183 \exdentamount=
\defbodyindent
4184 \begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}}
4186 \def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
4188 % Define the end token that this defining construct specifies
4189 % so that it will exit this group.
4190 \def#1{\endgraf\endgroup\medbreak}%
4191 \def#2#
#1 #
#2 {\def#4{#
#1}%
4192 \begingroup\obeylines\activeparens\spacesplit{#3{#
#2}}}%
4194 \advance\leftskip by
\defbodyindent
4195 \exdentamount=
\defbodyindent
4196 \begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
4198 % These parsing functions are similar to the preceding ones
4199 % except that they do not make parens into active characters.
4200 % These are used for "variables" since they have no arguments.
4202 \def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
4204 % Define the end token that this defining construct specifies
4205 % so that it will exit this group.
4206 \def#1{\endgraf\endgroup\medbreak}%
4207 \def#2{\begingroup\obeylines\spacesplit#3}%
4209 \advance\leftskip by
\defbodyindent
4210 \exdentamount=
\defbodyindent
4212 \catcode 61=
\active %
4213 \obeylines\spacesplit#3}
4215 % This is used for \def{tp,vr}parsebody. It could probably be used for
4216 % some of the others, too, with some judicious conditionals.
4218 \def\parsebodycommon#1#2#3{%
4221 % Define the end token that this defining construct specifies
4222 % so that it will exit this group.
4223 \def#1{\endgraf\endgroup\medbreak}%
4224 \def#2#
#1 {\begingroup\obeylines\spacesplit{#3{#
#1}}}%
4226 \advance\leftskip by
\defbodyindent
4227 \exdentamount=
\defbodyindent
4228 \begingroup\obeylines
4231 \def\defvrparsebody#1#2#3#4 {%
4232 \parsebodycommon{#1}{#2}{#3}%
4233 \spacesplit{#3{#4}}%
4236 % This loses on `@deftp {Data Type} {struct termios}' -- it thinks the
4237 % type is just `struct', because we lose the braces in `{struct
4238 % termios}' when \spacesplit reads its undelimited argument. Sigh.
4239 % \let\deftpparsebody=\defvrparsebody
4241 % So, to get around this, we put \empty in with the type name. That
4242 % way, TeX won't find exactly `{...}' as an undelimited argument, and
4243 % won't strip off the braces.
4245 \def\deftpparsebody #1#2#3#4 {%
4246 \parsebodycommon{#1}{#2}{#3}%
4247 \spacesplit{\parsetpheaderline{#3{#4}}}\empty
4250 % Fine, but then we have to eventually remove the \empty *and* the
4251 % braces (if any). That's what this does.
4253 \def\removeemptybraces\empty#1\relax{#1}
4255 % After \spacesplit has done its work, this is called -- #1 is the final
4256 % thing to call, #2 the type name (which starts with \empty), and #3
4257 % (which might be empty) the arguments.
4259 \def\parsetpheaderline#1#2#3{%
4260 #1{\removeemptybraces#2\relax}{#3}%
4263 \def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV %
4265 % Define the end token that this defining construct specifies
4266 % so that it will exit this group.
4267 \def#1{\endgraf\endgroup\medbreak}%
4268 \def#2#
#1 #
#2 {\def#4{#
#1}%
4269 \begingroup\obeylines\spacesplit{#3{#
#2}}}%
4271 \advance\leftskip by
\defbodyindent
4272 \exdentamount=
\defbodyindent
4273 \begingroup\obeylines\spacesplit{#3{#5}}}
4275 % Split up #2 at the first space token.
4276 % call #1 with two arguments:
4277 % the first is all of #2 before the space token,
4278 % the second is all of #2 after that space token.
4279 % If #2 contains no space token, all of it is passed as the first arg
4280 % and the second is passed as empty.
4283 \gdef\spacesplit#1#2^^M
{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}%
4284 \long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{%
4286 #1{#2}{}\else #1{#2}{#3#4}\fi}}
4288 % So much for the things common to all kinds of definitions.
4292 % First, define the processing that is wanted for arguments of \defun
4293 % Use this to expand the args and terminate the paragraph they make up
4295 \def\defunargs #1{\functionparens \sl
4296 % Expand, preventing hyphenation at `-' chars.
4297 % Note that groups don't affect changes in \hyphenchar.
4300 \hyphenchar\tensl=
45
4301 \ifnum\parencount=
0 \else \errmessage{Unbalanced parentheses in @def
}\fi%
4302 \interlinepenalty=
10000
4303 \advance\rightskip by
0pt plus
1fil
4304 \endgraf\nobreak\vskip -
\parskip\nobreak
4307 \def\deftypefunargs #1{%
4308 % Expand, preventing hyphenation at `-' chars.
4309 % Note that groups don't affect changes in \hyphenchar.
4310 % Use \boldbraxnoamp, not \functionparens, so that & is not special.
4312 \tclose{#1}% avoid \code because of side effects on active chars
4313 \interlinepenalty=
10000
4314 \advance\rightskip by
0pt plus
1fil
4315 \endgraf\nobreak\vskip -
\parskip\nobreak
4318 % Do complete processing of one @defun or @defunx line already parsed.
4320 % @deffn Command forward-char nchars
4322 \def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader}
4324 \def\deffnheader #1#2#3{\doind {fn
}{\code{#2}}%
4325 \begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
4326 \catcode 61=
\other % Turn off change made in \defparsebody
4329 % @defun == @deffn Function
4331 \def\defun{\defparsebody\Edefun\defunx\defunheader}
4333 \def\defunheader #1#2{\doind {fn
}{\code{#1}}% Make entry in function index
4334 \begingroup\defname {#1}{\putwordDeffunc}%
4335 \defunargs {#2}\endgroup %
4336 \catcode 61=
\other % Turn off change made in \defparsebody
4339 % @deftypefun int foobar (int @var{foo}, float @var{bar})
4341 \def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader}
4343 % #1 is the data type. #2 is the name and args.
4344 \def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax}
4345 % #1 is the data type, #2 the name, #3 the args.
4346 \def\deftypefunheaderx #1#2 #3\relax{%
4347 \doind {fn
}{\code{#2}}% Make entry in function index
4348 \begingroup\defname {\defheaderxcond#1\relax$$$
#2}{\putwordDeftypefun}%
4349 \deftypefunargs {#3}\endgroup %
4350 \catcode 61=
\other % Turn off change made in \defparsebody
4353 % @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
4355 \def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
4357 % \defheaderxcond#1\relax$$$
4358 % puts #1 in @code, followed by a space, but does nothing if #1 is null.
4359 \def\defheaderxcond#1#2$$$
{\ifx#1\relax\else\code{#1#2} \fi}
4361 % #1 is the classification. #2 is the data type. #3 is the name and args.
4362 \def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax}
4363 % #1 is the classification, #2 the data type, #3 the name, #4 the args.
4364 \def\deftypefnheaderx #1#2#3 #4\relax{%
4365 \doind {fn
}{\code{#3}}% Make entry in function index
4367 \normalparens % notably, turn off `&' magic, which prevents
4368 % at least some C++ text from working
4369 \defname {\defheaderxcond#2\relax$$$
#3}{#1}%
4370 \deftypefunargs {#4}\endgroup %
4371 \catcode 61=
\other % Turn off change made in \defparsebody
4374 % @defmac == @deffn Macro
4376 \def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
4378 \def\defmacheader #1#2{\doind {fn
}{\code{#1}}% Make entry in function index
4379 \begingroup\defname {#1}{\putwordDefmac}%
4380 \defunargs {#2}\endgroup %
4381 \catcode 61=
\other % Turn off change made in \defparsebody
4384 % @defspec == @deffn Special Form
4386 \def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
4388 \def\defspecheader #1#2{\doind {fn
}{\code{#1}}% Make entry in function index
4389 \begingroup\defname {#1}{\putwordDefspec}%
4390 \defunargs {#2}\endgroup %
4391 \catcode 61=
\other % Turn off change made in \defparsebody
4394 % This definition is run if you use @defunx
4395 % anywhere other than immediately after a @defun or @defunx.
4397 \def\deffnx #1 {\errmessage{@deffnx in invalid context
}}
4398 \def\defunx #1 {\errmessage{@defunx in invalid context
}}
4399 \def\defmacx #1 {\errmessage{@defmacx in invalid context
}}
4400 \def\defspecx #1 {\errmessage{@defspecx in invalid context
}}
4401 \def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context
}}
4402 \def\deftypemethodx #1 {\errmessage{@deftypemethodx in invalid context
}}
4403 \def\deftypefunx #1 {\errmessage{@deftypefunx in invalid context
}}
4405 % @defmethod, and so on
4407 % @defop CATEGORY CLASS OPERATION ARG...
4409 \def\defop #1 {\def\defoptype{#1}%
4410 \defopparsebody\Edefop\defopx\defopheader\defoptype}
4412 \def\defopheader #1#2#3{%
4413 \dosubind {fn
}{\code{#2}}{\putwordon\
#1}% Make entry in function index
4414 \begingroup\defname {#2}{\defoptype{}\putwordon\
#1}%
4415 \defunargs {#3}\endgroup %
4418 % @deftypemethod CLASS RETURN-TYPE METHOD ARG...
4420 \def\deftypemethod{%
4421 \deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader}
4423 % #1 is the class name, #2 the data type, #3 the method name, #4 the args.
4424 \def\deftypemethodheader#1#2#3#4{%
4425 \dosubind{fn
}{\code{#3}}{\putwordon\
\code{#1}}% entry in function index
4427 \defname{\defheaderxcond#2\relax$$$
#3}{\putwordMethodon\
\code{#1}}%
4428 \deftypefunargs{#4}%
4432 % @defmethod == @defop Method
4434 \def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
4436 % #1 is the class name, #2 the method name, #3 the args.
4437 \def\defmethodheader#1#2#3{%
4438 \dosubind{fn
}{\code{#2}}{\putwordon\
\code{#1}}% entry in function index
4440 \defname{#2}{\putwordMethodon\
\code{#1}}%
4445 % @defcv {Class Option} foo-class foo-flag
4447 \def\defcv #1 {\def\defcvtype{#1}%
4448 \defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
4450 \def\defcvarheader #1#2#3{%
4451 \dosubind {vr
}{\code{#2}}{\putwordof\
#1}% Make entry in var index
4452 \begingroup\defname {#2}{\defcvtype\
\putwordof\
#1}%
4453 \defvarargs {#3}\endgroup %
4456 % @defivar == @defcv {Instance Variable}
4458 \def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
4460 \def\defivarheader #1#2#3{%
4461 \dosubind {vr
}{\code{#2}}{\putwordof\
#1}% Make entry in var index
4462 \begingroup\defname {#2}{\putwordDefivar\
\putwordof\
#1}%
4463 \defvarargs {#3}\endgroup %
4466 % These definitions are run if you use @defmethodx, etc.,
4467 % anywhere other than immediately after a @defmethod, etc.
4469 \def\defopx #1 {\errmessage{@defopx in invalid context
}}
4470 \def\defmethodx #1 {\errmessage{@defmethodx in invalid context
}}
4471 \def\defcvx #1 {\errmessage{@defcvx in invalid context
}}
4472 \def\defivarx #1 {\errmessage{@defivarx in invalid context
}}
4476 % First, define the processing that is wanted for arguments of @defvar.
4477 % This is actually simple: just print them in roman.
4478 % This must expand the args and terminate the paragraph they make up
4479 \def\defvarargs #1{\normalparens #1%
4480 \interlinepenalty=
10000
4481 \endgraf\nobreak\vskip -
\parskip\nobreak}
4483 % @defvr Counter foo-count
4485 \def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader}
4487 \def\defvrheader #1#2#3{\doind {vr
}{\code{#2}}%
4488 \begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup}
4490 % @defvar == @defvr Variable
4492 \def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader}
4494 \def\defvarheader #1#2{\doind {vr
}{\code{#1}}% Make entry in var index
4495 \begingroup\defname {#1}{\putwordDefvar}%
4496 \defvarargs {#2}\endgroup %
4499 % @defopt == @defvr {User Option}
4501 \def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader}
4503 \def\defoptheader #1#2{\doind {vr
}{\code{#1}}% Make entry in var index
4504 \begingroup\defname {#1}{\putwordDefopt}%
4505 \defvarargs {#2}\endgroup %
4508 % @deftypevar int foobar
4510 \def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader}
4512 % #1 is the data type. #2 is the name, perhaps followed by text that
4513 % is actually part of the data type, which should not be put into the index.
4514 \def\deftypevarheader #1#2{%
4515 \dovarind#2 \relax% Make entry in variables index
4516 \begingroup\defname {\defheaderxcond#1\relax$$$
#2}{\putwordDeftypevar}%
4517 \interlinepenalty=
10000
4518 \endgraf\nobreak\vskip -
\parskip\nobreak
4520 \def\dovarind#1 #2\relax{\doind{vr
}{\code{#1}}}
4522 % @deftypevr {Global Flag} int enable
4524 \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
4526 \def\deftypevrheader #1#2#3{\dovarind#3 \relax%
4527 \begingroup\defname {\defheaderxcond#2\relax$$$
#3}{#1}
4528 \interlinepenalty=
10000
4529 \endgraf\nobreak\vskip -
\parskip\nobreak
4532 % This definition is run if you use @defvarx
4533 % anywhere other than immediately after a @defvar or @defvarx.
4535 \def\defvrx #1 {\errmessage{@defvrx in invalid context
}}
4536 \def\defvarx #1 {\errmessage{@defvarx in invalid context
}}
4537 \def\defoptx #1 {\errmessage{@defoptx in invalid context
}}
4538 \def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context
}}
4539 \def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context
}}
4542 % Args are printed in bold, a slight difference from @defvar.
4544 \def\deftpargs #1{\bf \defvarargs{#1}}
4546 % @deftp Class window height width ...
4548 \def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader}
4550 \def\deftpheader #1#2#3{\doind {tp
}{\code{#2}}%
4551 \begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
4553 % This definition is run if you use @deftpx, etc
4554 % anywhere other than immediately after a @deftp, etc.
4556 \def\deftpx #1 {\errmessage{@deftpx in invalid context
}}
4562 % To do this right we need a feature of e-TeX, \scantokens,
4563 % which we arrange to emulate with a temporary file in ordinary TeX.
4564 \ifx\eTeXversion\undefined
4565 \newwrite\macscribble
4567 \begingroup \newlinechar`\^^M
4568 % Undo catcode changes of \startcontents and \doprintindex
4569 \catcode`\@=
0 \catcode`\\=
12 \escapechar=`\@
4570 % Append \endinput to make sure that TeX does not see the ending newline.
4571 \toks0=
{#1\endinput}%
4572 \immediate\openout\macscribble=
\jobname.tmp
4573 \immediate\write\macscribble{\the\toks0}%
4574 \immediate\closeout\macscribble
4575 \let\xeatspaces\eatspaces
4581 \begingroup \newlinechar`\^^M
4582 % Undo catcode changes of \startcontents and \doprintindex
4583 \catcode`\@=
0 \catcode`\\=
12 \escapechar=`\@
4584 \let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup}
4587 \newcount\paramno % Count of parameters
4588 \newtoks\macname % Macro name
4589 \newif\ifrecursive % Is it recursive?
4590 \def\macrolist{} % List of all defined macros in the form
4591 % \do\macro1\do\macro2...
4594 % Thisdoes \let #1 = #2, except with \csnames.
4596 \expandafter\expandafter
4598 \expandafter\expandafter
4600 \csname#2\endcsname}
4602 % Trim leading and trailing spaces off a string.
4603 % Concepts from aro-bend problem 15 (see CTAN).
4605 \gdef\eatspaces #1{\expandafter\trim@
\expandafter{#1 }}
4606 \gdef\trim@
#1{\trim@@ @
#1 @
#1 @ @@
}
4607 \gdef\trim@@
#1@
#2@
#3@@
{\trim@@@
\empty #2 @
}
4609 \unbrace{\gdef\trim@@@
#1 } #2@
{#1}
4612 % Trim a single trailing ^^M off a string.
4613 {\catcode`\^^M=
12\catcode`
\Q=
3%
4614 \gdef\eatcr #1{\eatcra #1Q^^MQ
}%
4615 \gdef\eatcra#1^^MQ
{\eatcrb#1Q
}%
4616 \gdef\eatcrb#1Q
#2Q
{#1}%
4619 % Macro bodies are absorbed as an argument in a context where
4620 % all characters are catcode 10, 11 or 12, except \ which is active
4621 % (as in normal texinfo). It is necessary to change the definition of \.
4623 % It's necessary to have hard CRs when the macro is executed. This is
4624 % done by making ^^M (\endlinechar) catcode 12 when reading the macro
4625 % body, and then making it the \newlinechar in \scanmacro.
4627 \def\macrobodyctxt{%
4652 % \mbodybackslash is the definition of \ in @macro bodies.
4653 % It maps \foo\ => \csname macarg.foo\endcsname => #N
4654 % where N is the macro parameter number.
4655 % We define \csname macarg.\endcsname to be \realbackslash, so
4656 % \\ in macro replacement text gets you a backslash.
4658 {\catcode`@=
0 @catcode`@\=@active
4659 @gdef@usembodybackslash
{@let\=@mbodybackslash
}
4660 @gdef@mbodybackslash
#1\
{@csname macarg.
#1@endcsname
}
4662 \expandafter\def\csname macarg.
\endcsname{\realbackslash}
4664 \def\macro{\recursivefalse\parsearg\macroxxx}
4665 \def\rmacro{\recursivetrue\parsearg\macroxxx}
4668 \getargs{#1}% now \macname is the macname and \argl the arglist
4669 \ifx\argl\empty % no arguments
4672 \expandafter\parsemargdef \argl;
%
4674 \if1\csname ismacro.
\the\macname\endcsname
4675 \message{Warning: redefining
\the\macname}%
4677 \expandafter\ifx\csname \the\macname\endcsname \relax
4678 \else \errmessage{The name
\the\macname\space is reserved
}\fi
4679 \global\cslet{macsave.
\the\macname}{\the\macname}%
4680 \global\expandafter\let\csname ismacro.
\the\macname\endcsname=
1%
4681 % Add the macroname to \macrolist
4682 \toks0 =
\expandafter{\macrolist\do}%
4683 \xdef\macrolist{\the\toks0
4684 \expandafter\noexpand\csname\the\macname\endcsname}%
4686 \begingroup \macrobodyctxt
4687 \ifrecursive \expandafter\parsermacbody
4688 \else \expandafter\parsemacbody
4691 \def\unmacro{\parsearg\unmacroxxx}
4693 \if1\csname ismacro.
#1\endcsname
4694 \global\cslet{#1}{macsave.
#1}%
4695 \global\expandafter\let \csname ismacro.
#1\endcsname=
0%
4696 % Remove the macro name from \macrolist
4698 \edef\tempa{\expandafter\noexpand\csname#1\endcsname}%
4704 \toks0 =
\expandafter{\newmacrolist\do}%
4705 \edef\newmacrolist{\the\toks0\expandafter\noexpand\tempa}%
4707 \def\newmacrolist{}%
4708 % Execute macro list to define \newmacrolist
4710 \global\let\macrolist\newmacrolist
4713 \errmessage{Macro
#1 not defined
}%
4717 % This makes use of the obscure feature that if the last token of a
4718 % <parameter list> is #, then the preceding argument is delimited by
4719 % an opening brace, and that opening brace is not consumed.
4720 \def\getargs#1{\getargsxxx#1{}}
4721 \def\getargsxxx#1#
{\getmacname #1 \relax\getmacargs}
4722 \def\getmacname #1 #2\relax{\macname=
{#1}}
4723 \def\getmacargs#1{\def\argl{#1}}
4725 % Parse the optional {params} list. Set up \paramno and \paramlist
4726 % so \defmacro knows what to do. Define \macarg.blah for each blah
4727 % in the params list, to be ##N where N is the position in that list.
4728 % That gets used by \mbodybackslash (above).
4730 % We need to get `macro parameter char #' into several definitions.
4731 % The technique used is stolen from LaTeX: let \hash be something
4732 % unexpandable, insert that wherever you need a #, and then redefine
4733 % it to # just before using the token list produced.
4735 % The same technique is used to protect \eatspaces till just before
4736 % the macro is used.
4738 \def\parsemargdef#1;
{\paramno=
0\def\paramlist{}%
4739 \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,
}
4740 \def\parsemargdefxxx#1,
{%
4741 \if#1;
\let\next=
\relax
4742 \else \let\next=
\parsemargdefxxx
4743 \advance\paramno by
1%
4744 \expandafter\edef\csname macarg.
\eatspaces{#1}\endcsname
4745 {\xeatspaces{\hash\the\paramno}}%
4746 \edef\paramlist{\paramlist\hash\the\paramno,
}%
4749 % These two commands read recursive and nonrecursive macro bodies.
4750 % (They're different since rec and nonrec macros end differently.)
4752 \long\def\parsemacbody#1@end macro
%
4753 {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
4754 \long\def\parsermacbody#1@end rmacro
%
4755 {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
4757 % This defines the macro itself. There are six cases: recursive and
4758 % nonrecursive macros of zero, one, and many arguments.
4759 % Much magic with \expandafter here.
4760 % \xdef is used so that macro definitions will survive the file
4761 % they're defined in; @include reads the file inside a group.
4763 \let\hash=##
% convert placeholders to macro parameter chars
4767 \expandafter\xdef\csname\the\macname\endcsname{%
4768 \noexpand\scanmacro{\temp}}%
4770 \expandafter\xdef\csname\the\macname\endcsname{%
4771 \bgroup\noexpand\macroargctxt
4772 \noexpand\braceorline
4773 \expandafter\noexpand\csname\the\macname xxx
\endcsname}%
4774 \expandafter\xdef\csname\the\macname xxx
\endcsname#
#1{%
4775 \egroup\noexpand\scanmacro{\temp}}%
4777 \expandafter\xdef\csname\the\macname\endcsname{%
4778 \bgroup\noexpand\macroargctxt
4779 \noexpand\csname\the\macname xx
\endcsname}%
4780 \expandafter\xdef\csname\the\macname xx
\endcsname#
#1{%
4781 \expandafter\noexpand\csname\the\macname xxx
\endcsname #
#1,
}%
4782 \expandafter\expandafter
4784 \expandafter\expandafter
4785 \csname\the\macname xxx
\endcsname
4786 \paramlist{\egroup\noexpand\scanmacro{\temp}}%
4791 \expandafter\xdef\csname\the\macname\endcsname{%
4792 \noexpand\norecurse{\the\macname}%
4793 \noexpand\scanmacro{\temp}\egroup}%
4795 \expandafter\xdef\csname\the\macname\endcsname{%
4796 \bgroup\noexpand\macroargctxt
4797 \noexpand\braceorline
4798 \expandafter\noexpand\csname\the\macname xxx
\endcsname}%
4799 \expandafter\xdef\csname\the\macname xxx
\endcsname#
#1{%
4801 \noexpand\norecurse{\the\macname}%
4802 \noexpand\scanmacro{\temp}\egroup}%
4804 \expandafter\xdef\csname\the\macname\endcsname{%
4805 \bgroup\noexpand\macroargctxt
4806 \expandafter\noexpand\csname\the\macname xx
\endcsname}%
4807 \expandafter\xdef\csname\the\macname xx
\endcsname#
#1{%
4808 \expandafter\noexpand\csname\the\macname xxx
\endcsname #
#1,
}%
4809 \expandafter\expandafter
4811 \expandafter\expandafter
4812 \csname\the\macname xxx
\endcsname
4815 \noexpand\norecurse{\the\macname}%
4816 \noexpand\scanmacro{\temp}\egroup}%
4820 \def\norecurse#1{\bgroup\cslet{#1}{macsave.
#1}}
4822 % \braceorline decides whether the next nonwhitespace character is a
4823 % {. If so it reads up to the closing }, if not, it reads the whole
4824 % line. Whatever was read is then fed to the next control sequence
4825 % as an argument (by \parsebrace or \parsearg)
4826 \def\braceorline#1{\let\next=
#1\futurelet\nchar\braceorlinexxx}
4827 \def\braceorlinexxx{%
4828 \ifx\nchar\bgroup\else
4829 \expandafter\parsearg
4832 % We mant to disable all macros during \shipout so that they are not
4833 % expanded by \write.
4834 \def\turnoffmacros{\begingroup \def\do#
#1{\let\noexpand#
#1=
\relax}%
4835 \edef\next{\macrolist}\expandafter\endgroup\next}
4839 \def\alias#1=
#2{\gdef#1{#2}}
4842 \message{cross references,
}
4845 \newif\ifhavexrefs % True if xref values are known.
4846 \newif\ifwarnedxrefs % True if we warned once that they aren't known.
4848 % @inforef is relatively simple.
4849 \def\inforef #1{\inforefzzz #1,,,,**
}
4850 \def\inforefzzz #1,
#2,
#3,
#4**
{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
4851 node
\samp{\ignorespaces#1{}}}
4853 % @node's job is to define \lastnode.
4854 \def\node{\ENVcheck\parsearg\nodezzz}
4855 \def\nodezzz#1{\nodexxx [#1,
]}
4856 \def\nodexxx[#1,
#2]{\gdef\lastnode{#1}}
4858 \let\lastnode=
\relax
4860 % The sectioning commands (@chapter, etc.) call these.
4862 \ifx\lastnode\relax\else
4863 \expandafter\expandafter\expandafter\setref{\lastnode}%
4864 {Ysectionnumberandtype
}%
4865 \global\let\lastnode=
\relax
4868 \def\unnumbnoderef{%
4869 \ifx\lastnode\relax\else
4870 \expandafter\expandafter\expandafter\setref{\lastnode}{Ynothing
}%
4871 \global\let\lastnode=
\relax
4874 \def\appendixnoderef{%
4875 \ifx\lastnode\relax\else
4876 \expandafter\expandafter\expandafter\setref{\lastnode}%
4877 {Yappendixletterandtype
}%
4878 \global\let\lastnode=
\relax
4883 % @anchor{NAME} -- define xref target at arbitrary point.
4886 % From latex.ltx, to make @anchor truely invisible.
4889 \gdef\@bsphack
{\relax
4890 \ifhmode \@savsk
\lastskip \@savsf
\spacefactor \fi
4892 \gdef\@esphack
{\relax
4893 \ifhmode \spacefactor\@savsf
4894 \ifdim\@savsk>
\z@
\ignorespaces \fi
4897 \gdef\anchor#1{\@bsphack
\setref{#1}{Ynothing
}\@esphack
}
4900 % \setref{NAME}{SNT} defines a cross-reference point NAME, namely
4901 % NAME-title, NAME-pg, and NAME-SNT. Called from \foonoderef. We have
4902 % to set \indexdummies so commands such as @code in a section title
4903 % aren't expanded. It would be nicer not to expand the titles in the
4904 % first place, but there's so many layers that that is hard to do.
4908 \dosetq{#1-title
}{Ytitle
}%
4909 \dosetq{#1-pg
}{Ypagenumber
}%
4910 \dosetq{#1-snt
}{#2}%
4913 % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
4914 % the node name, #2 the name of the Info cross-reference, #3 the printed
4915 % node name, #4 the name of the Info file, #5 the name of the printed
4916 % manual. All but the node name can be omitted.
4918 \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,
]}
4919 \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,
]}
4920 \def\ref#1{\xrefX[#1,,,,,,,
]}
4921 \def\xrefX[#1,
#2,
#3,
#4,
#5,
#6]{\begingroup
4922 \def\printedmanual{\ignorespaces #5}%
4923 \def\printednodename{\ignorespaces #3}%
4924 \setbox1=
\hbox{\printedmanual}%
4925 \setbox0=
\hbox{\printednodename}%
4927 % No printed node name was explicitly given.
4928 \expandafter\ifx\csname SETxref-automatic-section-title
\endcsname\relax
4929 % Use the node name inside the square brackets.
4930 \def\printednodename{\ignorespaces #1}%
4932 % Use the actual chapter/section title appear inside
4933 % the square brackets. Use the real section title if we have it.
4935 % It is in another manual, so we don't have it.
4936 \def\printednodename{\ignorespaces #1}%
4939 % We know the real title if we have the xref values.
4940 \def\printednodename{\refx{#1-title
}{}}%
4942 % Otherwise just copy the Info node name.
4943 \def\printednodename{\ignorespaces #1}%
4949 % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
4950 % insert empty discretionaries after hyphens, which means that it will
4951 % not find a line break at a hyphen in a node names. Since some manuals
4952 % are best written with fairly long node names, containing hyphens, this
4953 % is a loss. Therefore, we give the text of the node name again, so it
4954 % is as if TeX is seeing it for the first time.
4956 \putwordsection{} ``
\printednodename''
\putwordin{} \cite{\printedmanual}%
4958 % _ (for example) has to be the character _ for the purposes of the
4959 % control sequence corresponding to the node, but it has to expand
4960 % into the usual \leavevmode...\vrule stuff for purposes of
4961 % printing. So we \turnoffactive for the \refx-snt, back on for the
4962 % printing, back off for the \refx-pg.
4963 {\normalturnoffactive
4964 % Only output a following space if the -snt ref is nonempty; for
4965 % @unnumbered and @anchor, it won't be.
4966 \setbox2 =
\hbox{\ignorespaces \refx{#1-snt
}{}}%
4967 \ifdim \wd2 >
0pt
\refx{#1-snt
}\space\fi
4970 [\printednodename],
\space
4972 \turnoffactive \putwordpage\tie\refx{#1-pg
}{}%
4976 % \dosetq is the interface for calls from other macros
4978 % Use \normalturnoffactive so that punctuation chars such as underscore
4979 % and backslash work in node names. (\turnoffactive doesn't do \.)
4982 \normalturnoffactive
4983 \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}%
4990 % \internalsetq {foo}{page} expands into
4991 % CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
4992 % When the aux file is read, ' is the escape character
4994 \def\internalsetq #1#2{'xrdef
{#1}{\csname #2\endcsname}}
4996 % Things to be expanded by \internalsetq
4998 \def\Ypagenumber{\folio}
5000 \def\Ytitle{\thissection}
5004 \def\Ysectionnumberandtype{%
5005 \ifnum\secno=
0 \putwordChapter\xreftie\the\chapno %
5006 \else \ifnum \subsecno=
0 \putwordSection\xreftie\the\chapno.
\the\secno %
5007 \else \ifnum \subsubsecno=
0 %
5008 \putwordSection\xreftie\the\chapno.
\the\secno.
\the\subsecno %
5010 \putwordSection\xreftie\the\chapno.
\the\secno.
\the\subsecno.
\the\subsubsecno %
5013 \def\Yappendixletterandtype{%
5014 \ifnum\secno=
0 \putwordAppendix\xreftie'char
\the\appendixno{}%
5015 \else \ifnum \subsecno=
0 \putwordSection\xreftie'char
\the\appendixno.
\the\secno %
5016 \else \ifnum \subsubsecno=
0 %
5017 \putwordSection\xreftie'char
\the\appendixno.
\the\secno.
\the\subsecno %
5019 \putwordSection\xreftie'char
\the\appendixno.
\the\secno.
\the\subsecno.
\the\subsubsecno %
5024 % Use TeX 3.0's \inputlineno to get the line number, for better error
5025 % messages, but if we're using an old version of TeX, don't do anything.
5027 \ifx\inputlineno\thisisundefined
5028 \let\linenumber =
\empty % Non-3.0.
5030 \def\linenumber{\the\inputlineno:
\space}
5033 % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
5034 % If its value is nonempty, SUFFIX is output afterward.
5037 \expandafter\ifx\csname X
#1\endcsname\relax
5038 % If not defined, say something at least.
5039 \angleleft un\-de\-fined
\angleright
5042 \message{\linenumber Undefined cross reference `
#1'.
}%
5045 \global\warnedxrefstrue
5046 \message{Cross reference values unknown; you must run TeX again.
}%
5051 % It's defined, so just use it.
5052 \csname X
#1\endcsname
5054 #2% Output the suffix in any case.
5057 % This is the macro invoked by entries in the aux file.
5059 \def\xrdef#1{\begingroup
5060 % Reenable \ as an escape while reading the second argument.
5062 \afterassignment\endgroup
5063 \expandafter\gdef\csname X
#1\endcsname
5066 % Read the last existing aux file, if any. No error if none exists.
5067 \def\readauxfile{\begingroup
5068 \catcode`\^^@=
\other
5069 \catcode`\^^A=
\other
5070 \catcode`\^^B=
\other
5071 \catcode`\^^C=
\other
5072 \catcode`\^^D=
\other
5073 \catcode`\^^E=
\other
5074 \catcode`\^^F=
\other
5075 \catcode`\^^G=
\other
5076 \catcode`\^^H=
\other
5077 \catcode`\^^K=
\other
5078 \catcode`\^^L=
\other
5079 \catcode`\^^N=
\other
5080 \catcode`\^^P=
\other
5081 \catcode`\^^Q=
\other
5082 \catcode`\^^R=
\other
5083 \catcode`\^^S=
\other
5084 \catcode`\^^T=
\other
5085 \catcode`\^^U=
\other
5086 \catcode`\^^V=
\other
5087 \catcode`\^^W=
\other
5088 \catcode`\^^X=
\other
5089 \catcode`\^^Z=
\other
5090 \catcode`\^^
[=
\other
5091 \catcode`\^^\=
\other
5092 \catcode`\^^
]=
\other
5093 \catcode`\^^^=
\other
5094 \catcode`\^^_=
\other
5097 % It was suggested to define this as 7, which would allow ^^e4 etc.
5098 % in xref tags, i.e., node names. But since ^^e4 notation isn't
5099 % supported in the main text, it doesn't seem desirable. Furthermore,
5100 % that is not enough: for node names that actually contain a ^
5101 % character, we would end up writing a line like this: 'xrdef {'hat
5102 % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
5103 % argument, and \hat is not an expandable control sequence. It could
5104 % all be worked out, but why? Either we support ^^ or we don't.
5106 % The other change necessary for this was to define \auxhat:
5107 % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
5108 % and then to call \auxhat in \setq.
5121 \catcode`+=
\other % avoid \+ for paranoia even though we've turned it off
5122 % Make the characters 128-255 be printing characters
5126 \catcode\count 1=
\other
5127 \advance\count 1 by
1
5128 \ifnum \count 1<
256 \loop \fi
5131 % The aux file uses ' as the escape (for now).
5132 % Turn off \ as an escape so we do not lose on
5133 % entries which were dumped with control sequences in their names.
5134 % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
5135 % Reference to such entries still does not work the way one would wish,
5136 % but at least they do not bomb out when the aux file is read in.
5143 \openin 1 \jobname.aux
5147 \global\havexrefstrue
5148 \global\warnedobstrue
5150 % Open the new aux file. TeX will close it automatically at exit.
5151 \openout\auxfile=
\jobname.aux
5157 \newcount \footnoteno
5159 % The trailing space in the following definition for supereject is
5160 % vital for proper filling; pages come out unaligned when you do a
5161 % pagealignmacro call if that space before the closing brace is
5162 % removed. (Generally, numeric constants should always be followed by a
5163 % space to prevent strange expansion errors.)
5164 \def\supereject{\par\penalty -
20000\footnoteno =
0 }
5166 % @footnotestyle is meaningful for info output only.
5167 \let\footnotestyle=
\comment
5169 \let\ptexfootnote=
\footnote
5173 % Auto-number footnotes. Otherwise like plain.
5175 \global\advance\footnoteno by \@ne
5176 \edef\thisfootno{$^
{\the\footnoteno}$
}%
5178 % In case the footnote comes at the end of a sentence, preserve the
5179 % extra spacing after we do the footnote number.
5181 \ifhmode\edef\@sf
{\spacefactor\the\spacefactor}\/
\fi
5183 % Remove inadvertent blank space before typesetting the footnote number.
5189 % Don't bother with the trickery in plain.tex to not require the
5190 % footnote text as a parameter. Our footnotes don't need to be so general.
5192 % Oh yes, they do; otherwise, @ifset and anything else that uses
5193 % \parseargline fail inside footnotes because the tokens are fixed when
5194 % the footnote is read. --karl, 16nov96.
5196 \long\gdef\footnotezzz{\insert\footins\bgroup
5197 % We want to typeset this text as a normal paragraph, even if the
5198 % footnote reference occurs in (for example) a display environment.
5199 % So reset some parameters.
5200 \interlinepenalty\interfootnotelinepenalty
5201 \splittopskip\ht\strutbox % top baseline for broken footnotes
5202 \splitmaxdepth\dp\strutbox
5203 \floatingpenalty\@MM
5208 \parindent\defaultparindent
5210 % Hang the footnote text off the number.
5212 \textindent{\thisfootno}%
5214 % Don't crash into the line above the footnote text. Since this
5215 % expands into a box, it must come within the paragraph, lest it
5216 % provide a place where TeX can split the footnote.
5218 \futurelet\next\fo@t
5220 \def\fo@t
{\ifcat\bgroup\noexpand\next \let\next\f@@t
5221 \else\let\next\f@t
\fi \next}
5222 \def\f@@t
{\bgroup\aftergroup\@foot
\let\next}
5223 \def\f@t
#1{#1\@foot
}
5224 \def\@foot
{\strut\egroup}
5226 }%end \catcode `\@=11
5228 % Set the baselineskip to #1, and the lineskip and strut size
5229 % correspondingly. There is no deep meaning behind these magic numbers
5230 % used as factors; they just match (closely enough) what Knuth defined.
5232 \def\lineskipfactor{.08333}
5233 \def\strutheightpercent{.70833}
5234 \def\strutdepthpercent {.29167}
5237 \normalbaselineskip =
#1\relax
5238 \normallineskip =
\lineskipfactor\normalbaselineskip
5240 \setbox\strutbox =
\hbox{%
5241 \vrule width0pt height
\strutheightpercent\baselineskip
5242 depth
\strutdepthpercent \baselineskip
5246 % @| inserts a changebar to the left of the current line. It should
5247 % surround any changed text. This approach does *not* work if the
5248 % change spans more than two lines of output. To handle that, we would
5249 % have adopt a much more difficult approach (putting marks into the main
5250 % vertical list for the beginning and end of each change).
5253 % \vadjust can only be used in horizontal mode.
5256 % Append this vertical mode material after the current line in the output.
5258 % We want to insert a rule with the height and depth of the current
5259 % leading; that is exactly what \strutbox is supposed to record.
5260 \vskip-
\baselineskip
5262 % \vadjust-items are inserted at the left edge of the type. So
5263 % the \llap here moves out into the left-hand margin.
5266 % For a thicker or thinner bar, change the `1pt'.
5267 \vrule height
\baselineskip width1pt
5269 % This is the space between the bar and the text.
5275 % For a final copy, take out the rectangles
5276 % that mark overfull boxes (in case you have decided
5277 % that the text looks ok even though it passes the margin).
5279 \def\finalout{\overfullrule=
0pt
}
5281 % @image. We use the macros from epsf.tex to support this.
5282 % If epsf.tex is not installed and @image is used, we complain.
5284 % Check for and read epsf.tex up front. If we read it only at @image
5285 % time, we might be inside a group, and then its definitions would get
5286 % undone and the next image would fail.
5287 \openin 1 = epsf.tex
5290 % Do not bother showing banner with post-v2.7 epsf.tex (available in
5291 % doc/epsf.tex until it shows up on ctan).
5292 \def\epsfannounce{\toks0 =
}%
5296 % We will only complain once about lack of epsf.tex.
5297 \newif\ifwarnednoepsf
5298 \newhelp\noepsfhelp{epsf.tex must be installed for images to
5299 work. It is also included in the Texinfo distribution, or you can get
5300 it from ftp://tug.org/tex/epsf.tex.
}
5303 \ifx\epsfbox\undefined
5304 \ifwarnednoepsf \else
5305 \errhelp =
\noepsfhelp
5306 \errmessage{epsf.tex not found, images will be ignored
}%
5307 \global\warnednoepsftrue
5310 \imagexxx #1,,,
\finish
5314 % Arguments to @image:
5315 % #1 is (mandatory) image filename; we tack on .eps extension.
5316 % #2 is (optional) width, #3 is (optional) height.
5317 % #4 is just the usual extra ignored arg for parsing this stuff.
5318 \def\imagexxx#1,
#2,
#3,
#4\finish{%
5319 \ifx\pdfoutput\undefined
5320 % \epsfbox itself resets \epsf?size at each figure.
5321 \setbox0 =
\hbox{\ignorespaces #2}\ifdim\wd0 >
0pt
\epsfxsize=
#2\relax \fi
5322 \setbox0 =
\hbox{\ignorespaces #3}\ifdim\wd0 >
0pt
\epsfysize=
#3\relax \fi
5324 \catcode`\^^M =
5 % in case we're inside an example
5325 % If the image is by itself, center it.
5329 \centerline{\epsfbox{#1.eps
}}%
5332 % In the middle of a paragraph, no extra space.
5337 \centerline{\pdfimage #1.pdf
}%
5342 \message{localization,
}
5344 % @documentlanguage is usually given very early, just after
5345 % @setfilename. If done too late, it may not override everything
5346 % properly. Single argument is the language abbreviation.
5347 % It would be nice if we could set up a hyphenation file here.
5349 \def\documentlanguage{\parsearg\dodocumentlanguage}
5350 \def\dodocumentlanguage#1{%
5351 \tex % read txi-??.tex file in plain TeX.
5352 % Read the file if it exists.
5353 \openin 1 txi-
#1.tex
5355 \errhelp =
\nolanghelp
5356 \errmessage{Cannot read language file txi-
#1.tex
}%
5359 \def\temp{\input txi-
#1.tex
}%
5364 \newhelp\nolanghelp{The given language definition file cannot be found or
5365 is empty. Maybe you need to install it? In the current directory
5366 should work if nowhere else does.
}
5369 % @documentencoding should change something in TeX eventually, most
5370 % likely, but for now just recognize it.
5371 \let\documentencoding =
\comment
5374 % Page size parameters.
5376 \newdimen\defaultparindent \defaultparindent =
15pt
5378 \chapheadingskip =
15pt plus
4pt minus
2pt
5379 \secheadingskip =
12pt plus
3pt minus
2pt
5380 \subsecheadingskip =
9pt plus
2pt minus
2pt
5382 % Prevent underfull vbox error messages.
5385 % Don't be so finicky about underfull hboxes, either.
5388 % Following George Bush, just get rid of widows and orphans.
5392 % Use TeX 3.0's \emergencystretch to help line breaking, but if we're
5393 % using an old version of TeX, don't do anything. We want the amount of
5394 % stretch added to depend on the line length, hence the dependence on
5395 % \hsize. We call this whenever the paper size is set.
5397 \def\setemergencystretch{%
5398 \ifx\emergencystretch\thisisundefined
5399 % Allow us to assign to \emergencystretch anyway.
5400 \def\emergencystretch{\dimen0}%
5402 \emergencystretch =
\hsize
5403 \divide\emergencystretch by
40
5407 % Parameters in order: 1) textheight; 2) textwidth; 3) voffset;
5408 % 4) hoffset; 5) binding offset; 6) topskip. Then whoever calls us can
5409 % set \parskip and call \setleading for \baselineskip.
5411 \def\internalpagesizes#1#2#3#4#5#6{%
5414 \splittopskip =
\topskip
5417 \advance\vsize by
\topskip
5418 \outervsize =
\vsize
5419 \advance\outervsize by
2\topandbottommargin
5420 \pageheight =
\vsize
5423 \outerhsize =
\hsize
5424 \advance\outerhsize by
0.5in
5427 \normaloffset =
#4\relax
5428 \bindingoffset =
#5\relax
5430 \parindent =
\defaultparindent
5431 \setemergencystretch
5434 % @letterpaper (the default).
5435 \def\letterpaper{{\globaldefs =
1
5436 \parskip =
3pt plus
2pt minus
1pt
5437 \setleading{13.2pt
}%
5439 % If page is nothing but text, make it come out even.
5440 \internalpagesizes{46\baselineskip}{6in
}{\voffset}{.25in
}{\bindingoffset}{36pt
}%
5443 % Use @smallbook to reset parameters for 7x9.5 (or so) format.
5444 \def\smallbook{{\globaldefs =
1
5445 \parskip =
2pt plus
1pt
5448 \internalpagesizes{7.5in
}{5.in
}{\voffset}{.25in
}{\bindingoffset}{16pt
}%
5450 \lispnarrowing =
0.3in
5453 \contentsrightmargin =
0pt
5454 \deftypemargin =
0pt
5455 \defbodyindent =
.5cm
5457 \let\smalldisplay =
\smalldisplayx
5458 \let\smallexample =
\smalllispx
5459 \let\smallformat =
\smallformatx
5460 \let\smalllisp =
\smalllispx
5463 % Use @afourpaper to print on European A4 paper.
5464 \def\afourpaper{{\globaldefs =
1
5466 \parskip =
3pt plus
2pt minus
1pt
5468 \internalpagesizes{53\baselineskip}{160mm
}{\voffset}{4mm
}{\bindingoffset}{44pt
}%
5474 % A specific text layout, 24x15cm overall, intended for A4 paper. Top margin
5475 % 29mm, hence bottom margin 28mm, nominal side margin 3cm.
5476 \def\afourlatex{{\globaldefs =
1
5477 \setleading{13.6pt
}%
5480 \internalpagesizes{237mm
}{150mm
}{3.6mm
}{3.6mm
}{3mm
}{7mm
}%
5485 % Use @afourwide to print on European A4 paper in wide format.
5488 \internalpagesizes{9.5in
}{6.5in
}{\hoffset}{\normaloffset}{\bindingoffset}{7mm
}%
5493 % @pagesizes TEXTHEIGHT[,TEXTWIDTH]
5494 % Perhaps we should allow setting the margins, \topskip, \parskip,
5495 % and/or leading, also. Or perhaps we should compute them somehow.
5497 \def\pagesizes{\parsearg\pagesizesxxx}
5498 \def\pagesizesxxx#1{\pagesizesyyy #1,,
\finish}
5499 \def\pagesizesyyy#1,
#2,
#3\finish{{%
5500 \setbox0 =
\hbox{\ignorespaces #2}\ifdim\wd0 >
0pt
\hsize=
#2\relax \fi
5503 \parskip =
3pt plus
2pt minus
1pt
5504 \setleading{13.2pt
}%
5506 \internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt
}%
5509 % Set default to letter.
5513 \message{and turning on texinfo input format.
}
5515 % Define macros to output various characters with catcode for normal text.
5525 \def\normaldoublequote{"
}
5528 \def\normalunderscore{_
}
5529 \def\normalverticalbar{|
}
5531 \def\normalgreater{>
}
5533 \def\normaldollar{$
}
5535 % This macro is used to make a character print one way in ttfont
5536 % where it can probably just be output, and another way in other fonts,
5537 % where something hairier probably needs to be done.
5539 % #1 is what to print if we are indeed using \tt; #2 is what to print
5540 % otherwise. Since all the Computer Modern typewriter fonts have zero
5541 % interword stretch (and shrink), and it is reasonable to expect all
5542 % typewriter fonts to have this, we can check that font parameter.
5544 \def\ifusingtt#1#2{\ifdim \fontdimen3\font=
0pt
#1\else #2\fi}
5546 % Same as above, but check for italic font. Actually this also catches
5547 % non-italic slanted fonts since it is impossible to distinguish them from
5548 % italic fonts. But since this is only used by $ and it uses \sl anyway
5549 % this is not a problem.
5550 \def\ifusingit#1#2{\ifdim \fontdimen1\font>
0pt
#1\else #2\fi}
5552 % Turn off all special characters except @
5553 % (and those which the user can use as if they were ordinary).
5554 % Most of these we simply print from the \tt font, but for some, we can
5555 % use math or other variants that look better in normal text.
5558 \def\activedoublequote{{\tt\char34}}
5559 \let"=
\activedoublequote
5561 \def~
{{\tt\char126}}
5567 \def_{\ifusingtt\normalunderscore\_}
5568 % Subroutine for the previous macro.
5569 \def\_{\leavevmode \kern.06em
\vbox{\hrule width
.3em height
.1ex
}}
5572 \def|
{{\tt\char124}}
5580 \def+
{{\tt \char 43}}
5582 \def$
{\ifusingit{{\sl\$
}}\normaldollar}
5583 %\catcode 27=\active
5584 %\def^^[{$\diamondsuit$}
5586 % Set up an active definition for =, but don't enable it most of the time.
5587 {\catcode`\==
\active
5588 \global\def=
{{\tt \char 61}}}
5593 % If a .fmt file is being used, characters that might appear in a file
5594 % name cannot be active until we have parsed the command line.
5595 % So turn them off again, and have \everyjob (or @setfilename) turn them on.
5596 % \otherifyactive is called near the end of this file.
5597 \def\otherifyactive{\catcode`+=
\other \catcode`
\_=
\other}
5601 % \rawbackslashxx output one backslash character in current font
5602 \global\chardef\rawbackslashxx=`\\
5603 %{\catcode`\\=\other
5604 %@gdef@rawbackslashxx{\}}
5606 % \rawbackslash redefines \ as input to do \rawbackslashxx.
5607 {\catcode`\\=
\active
5608 @gdef@rawbackslash
{@let\=@rawbackslashxx
}}
5610 % \normalbackslash outputs one backslash in fixed width font.
5611 \def\normalbackslash{{\tt\rawbackslashxx}}
5613 % \catcode 17=0 % Define control-q
5616 % Used sometimes to turn off (effectively) the active characters
5617 % even after parsing them.
5618 @def@turnoffactive
{@let"=@normaldoublequote
5619 @let\=@realbackslash
5622 @let_=@normalunderscore
5623 @let|=@normalverticalbar
5625 @let>=@normalgreater
5627 @let$=@normaldollar
}
5629 @def@normalturnoffactive
{@let"=@normaldoublequote
5630 @let\=@normalbackslash
5633 @let_=@normalunderscore
5634 @let|=@normalverticalbar
5636 @let>=@normalgreater
5638 @let$=@normaldollar
}
5640 % Make _ and + \other characters, temporarily.
5641 % This is canceled by @fixbackslash.
5644 % If a .fmt file is being used, we don't want the `\input texinfo' to show up.
5645 % That is what \eatinput is for; after that, the `\' should revert to printing
5648 @gdef@eatinput input texinfo
{@fixbackslash
}
5649 @global@let\ = @eatinput
5651 % On the other hand, perhaps the file did not have a `\input texinfo'. Then
5652 % the first `\{ in the file would cause an error. This macro tries to fix
5653 % that, assuming it is called before the first `\' could plausibly occur.
5654 % Also back turn on active characters that might appear in the input
5655 % file name, in case not using a pre-dumped format.
5657 @gdef@fixbackslash
{%
5658 @ifx\@eatinput @let\ = @normalbackslash @fi
5663 % Say @foo, not \foo, in error messages.
5666 % These look ok in all fonts, so just make them not special.
5667 @catcode`@& = @other
5668 @catcode`@# = @other
5669 @catcode`@
% = @other
5671 @c Set initial fonts.
5677 @c eval: (add-hook 'write-file-hooks 'time-stamp)
5678 @c page-delimiter: "^\\\
\message"
5679 @c time-stamp-start: "def\\\
\texinfoversion{"
5680 @c time-stamp-format: "
%:y-%02m-%02d.%H"
5681 @c time-stamp-end: "
}"