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{2000-12-12.07}
8 % Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
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/gnu/texinfo.tex
33 % (and all GNU mirrors, see http://www.gnu.org/order/ftp.html)
34 % ftp://texinfo.org/tex/texinfo.tex
35 % ftp://us.ctan.org/macros/texinfo/texinfo.tex
36 % (and all CTAN mirrors, finger ctan@us.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 % Texinfo has a small home page 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.
71 \let\ptexbullet=\bullet
85 % We never want plain's outer \+ definition in Texinfo.
86 % For @tex, we can use \tabalign.
92 % If this character appears in an error message or help string, it
93 % starts a new line in the output.
96 % Set up fixed words for English if not already set.
97 \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
98 \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
99 \ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
100 \ifx\putwordin\undefined \gdef\putwordin{in}\fi
101 \ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
102 \ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
103 \ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
104 \ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
105 \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
106 \ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi
107 \ifx\putwordof\undefined \gdef\putwordof{of}\fi
108 \ifx\putwordon\undefined \gdef\putwordon{on}\fi
109 \ifx\putwordpage\undefined \gdef\putwordpage{page}\fi
110 \ifx\putwordsection\undefined \gdef\putwordsection{section}\fi
111 \ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi
112 \ifx\putwordsee\undefined \gdef\putwordsee{see}\fi
113 \ifx\putwordSee\undefined \gdef\putwordSee{See}\fi
114 \ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi
115 \ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi
117 \ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
118 \ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
119 \ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
120 \ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
121 \ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
122 \ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
123 \ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
124 \ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
125 \ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
126 \ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
127 \ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
128 \ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
130 \ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi
131 \ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi
132 \ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi
133 \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
134 \ifx\putwordDeftypevar\undefined\gdef\putwordDeftypevar{Variable}\fi
135 \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
136 \ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function}\fi
142 \hyphenation{ap-pen-dix}
143 \hyphenation{mini-buf-fer mini-buf-fers}
145 \hyphenation{white-space}
147 % Margin to add to right of even pages, to left of odd pages.
148 \newdimen \bindingoffset
149 \newdimen \normaloffset
150 \newdimen\pagewidth \newdimen\pageheight
152 % Sometimes it is convenient to have everything in the transcript file
153 % and nothing on the terminal. We don't just call \tracingall here,
154 % since that produces some useless output on the terminal.
156 \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
157 \ifx\eTeXversion\undefined
158 \def\loggingall{\tracingcommands2 \tracingstats2
159 \tracingpages1 \tracingoutput1 \tracinglostchars1
160 \tracingmacros2 \tracingparagraphs1 \tracingrestores1
161 \showboxbreadth\maxdimen\showboxdepth\maxdimen
164 \def\loggingall{\tracingcommands3 \tracingstats2
165 \tracingpages1 \tracingoutput1 \tracinglostchars1
166 \tracingmacros2 \tracingparagraphs1 \tracingrestores1
167 \tracingscantokens1 \tracingassigns1 \tracingifs1
168 \tracinggroups1 \tracingnesting2
169 \showboxbreadth\maxdimen\showboxdepth\maxdimen
173 % For @cropmarks command.
174 % Do @cropmarks to get crop marks.
177 \let\cropmarks = \cropmarkstrue
179 % Dimensions to add cropmarks at corners.
180 % Added by P. A. MacKay, 12 Nov. 1986
182 \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
183 \newdimen\cornerlong \cornerlong=1pc
184 \newdimen\cornerthick \cornerthick=.3pt
185 \newdimen\topandbottommargin \topandbottommargin=.75in
187 % Main output routine.
189 \output = {\onepageout{\pagecontents\PAGE}}
194 % \onepageout takes a vbox as an argument. Note that \pagecontents
195 % does insertions, but you have to call it yourself.
197 \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
199 \ifodd\pageno \advance\hoffset by \bindingoffset
200 \else \advance\hoffset by -\bindingoffset\fi
202 % Do this outside of the \shipout so @code etc. will be expanded in
203 % the headline as they should be, not taken literally (outputting ''code).
204 \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
205 \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
208 % Have to do this stuff outside the \shipout because we want it to
209 % take effect in \write's, yet the group defined by the \vbox ends
210 % before the \shipout runs.
212 \escapechar = `\\ % use backslash in output files.
213 \indexdummies % don't expand commands in the output.
214 \normalturnoffactive % \ in index entries must not stay \, e.g., if
215 % the page break happens to be in the middle of an example.
217 % Do this early so pdf references go to the beginning of the page.
218 \ifpdfmakepagedest \pdfmkdest{\the\pageno} \fi
220 \ifcropmarks \vbox to \outervsize\bgroup
222 \vskip-\topandbottommargin
224 \line{\ewtop\hfil\ewtop}%
227 \vbox{\moveleft\cornerthick\nstop}%
229 \vbox{\moveright\cornerthick\nstop}%
232 \vskip\topandbottommargin
234 \hfil % center the page within the outer (page) hsize.
235 \ifodd\pageno\hskip\bindingoffset\fi
241 \ifdim\ht\footlinebox > 0pt
242 % Only leave this space if the footline is nonempty.
243 % (We lessened \vsize for it in \oddfootingxxx.)
244 % The \baselineskip=24pt in plain's \makefootline has no effect.
245 \vskip 2\baselineskip
250 \egroup % end of \vbox\bgroup
251 \hfil\egroup % end of (centering) \line\bgroup
252 \vskip\topandbottommargin plus1fill minus1fill
253 \boxmaxdepth = \cornerthick
256 \vbox{\moveleft\cornerthick\nsbot}%
258 \vbox{\moveright\cornerthick\nsbot}%
261 \line{\ewbot\hfil\ewbot}%
263 \egroup % \vbox from first cropmarks clause
265 }% end of \shipout\vbox
266 }% end of group with \turnoffactive
268 \ifnum\outputpenalty>-20000 \else\dosupereject\fi
271 \newinsert\margin \dimen\margin=\maxdimen
273 \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
275 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
276 % marginal hacks, juha@viisa.uucp (Juha Takala)
277 \ifvoid\margin\else % marginal info is present
278 \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
279 \dimen@=\dp#1 \unvbox#1
280 \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
281 \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
284 % Here are the rules for the cropmarks. Note that they are
285 % offset so that the space between them is truly \outerhsize or \outervsize
286 % (P. A. MacKay, 12 November, 1986)
288 \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
290 {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
291 \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
293 {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
295 % Parse an argument, then pass it to #1. The argument is the rest of
296 % the input line (except we remove a trailing comment). #1 should be a
297 % macro which expects an ordinary undelimited TeX argument.
303 \futurelet\temp\parseargx
306 % If the next token is an obeyed space (from an @example environment or
307 % the like), remove it and recurse. Otherwise, we're done.
309 % \obeyedspace is defined far below, after the definition of \sepspaces.
310 \ifx\obeyedspace\temp
311 \expandafter\parseargdiscardspace
313 \expandafter\parseargline
317 % Remove a single space (as the delimiter token to the macro call).
319 \gdef\parseargdiscardspace {\futurelet\temp\parseargx}}
322 \gdef\parseargline#1^^M{%
323 \endgroup % End of the group started in \parsearg.
325 % First remove any @c comment, then any @comment.
326 % Result of each macro is put in \toks0.
327 \argremovec #1\c\relax %
328 \expandafter\argremovecomment \the\toks0 \comment\relax %
330 % Call the caller's macro, saved as \next in \parsearg.
331 \expandafter\next\expandafter{\the\toks0}%
335 % Since all \c{,omment} does is throw away the argument, we can let TeX
336 % do that for us. The \relax here is matched by the \relax in the call
337 % in \parseargline; it could be more or less anything, its purpose is
338 % just to delimit the argument to the \c.
339 \def\argremovec#1\c#2\relax{\toks0 = {#1}}
340 \def\argremovecomment#1\comment#2\relax{\toks0 = {#1}}
342 % \argremovec{,omment} might leave us with trailing spaces, though; e.g.,
343 % @end itemize @c foo
344 % will have two active spaces as part of the argument with the
345 % `itemize'. Here we remove all active spaces from #1, and assign the
348 % This loses if there are any *other* active characters besides spaces
349 % in the argument -- _ ^ +, for example -- since they get expanded.
350 % Fortunately, Texinfo does not define any such commands. (If it ever
351 % does, the catcode of the characters in questionwill have to be changed
352 % here.) But this means we cannot call \removeactivespaces as part of
353 % \argremovec{,omment}, since @c uses \parsearg, and thus the argument
354 % that \parsearg gets might well have any character at all in it.
356 \def\removeactivespaces#1{%
360 \global\toks0 = \expandafter{\temp}%
364 % Change the active space to expand to nothing.
368 \gdef\ignoreactivespaces{\obeyspaces\let =\empty}
372 \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
374 %% These are used to keep @begin/@end levels from running away
375 %% Call \inENV within environments (after a \begingroup)
376 \newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
378 \ifENV\errmessage{Still within an environment; press RETURN to continue}
379 \endgroup\fi} % This is not perfect, but it should reduce lossage
381 % @begin foo is the same as @foo, for now.
382 \newhelp\EMsimple{Press RETURN to continue.}
384 \outer\def\begin{\parsearg\beginxxx}
387 \expandafter\ifx\csname #1\endcsname\relax
388 {\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else
389 \csname #1\endcsname\fi}
391 % @end foo executes the definition of \Efoo.
393 \def\end{\parsearg\endxxx}
395 \removeactivespaces{#1}%
396 \edef\endthing{\the\toks0}%
398 \expandafter\ifx\csname E\endthing\endcsname\relax
399 \expandafter\ifx\csname \endthing\endcsname\relax
400 % There's no \foo, i.e., no ``environment'' foo.
402 \errmessage{Undefined command `@end \endthing'}%
404 \unmatchedenderror\endthing
407 % Everything's ok; the right environment has been started.
408 \csname E\endthing\endcsname
412 % There is an environment #1, but it hasn't been started. Give an error.
414 \def\unmatchedenderror#1{%
416 \errmessage{This `@end #1' doesn't have a matching `@#1'}%
419 % Define the control sequence \E#1 to give an unmatched @end error.
421 \def\defineunmatchedend#1{%
422 \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}%
426 % Single-spacing is done by various environments (specifically, in
427 % \nonfillstart and \quotations).
428 \newskip\singlespaceskip \singlespaceskip = 12.5pt
430 % Why was this kern here? It messes up equalizing space above and below
431 % environments. --karl, 6may93
432 %{\advance \baselineskip by -\singlespaceskip
433 %\kern \baselineskip}%
434 \setleading \singlespaceskip
437 %% Simple single-character @ commands
440 % Kludge this until the fonts are right (grr).
443 % This is turned off because it was never documented
444 % and you can use @w{...} around a quote to suppress ligatures.
445 %% Define @` and @' to be the same as ` and '
446 %% but suppressing ligatures.
450 % Used to generate quoted braces.
451 \def\mylbrace {{\tt\char123}}
452 \def\myrbrace {{\tt\char125}}
456 % Definitions to produce actual \{ & \} command in an index.
457 \catcode`\{ = 12 \catcode`\} = 12
458 \catcode`\[ = 1 \catcode`\] = 2
459 \catcode`\@ = 0 \catcode`\\ = 12
464 % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
465 % Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H.
468 \def\ringaccent#1{{\accent23 #1}}
473 % Other special characters: @questiondown @exclamdown
474 % Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss.
475 \def\questiondown{?`}
478 % Dotless i and dotless j, used for accents.
483 \ifx\temp\imacro \ptexi
484 \else\ifx\temp\jmacro \j
485 \else \errmessage{@dotless can be used only with i or j}%
489 % Be sure we're in horizontal mode when doing a tie, since we make space
490 % equivalent to this in @example-like environments. Otherwise, a space
491 % at the beginning of a line will start with \penalty -- and
492 % since \penalty is valid in vertical mode, we'd end up putting the
493 % penalty on the vertical list instead of in the new paragraph.
495 % Avoid using \@M directly, because that causes trouble
496 % if the definition is written into an index file.
497 \global\let\tiepenalty = \@M
498 \gdef\tie{\leavevmode\penalty\tiepenalty\ }
501 % @: forces normal size whitespace following.
502 \def\:{\spacefactor=1000 }
504 % @* forces a line break.
505 \def\*{\hfil\break\hbox{}\ignorespaces}
507 % @. is an end-of-sentence period.
508 \def\.{.\spacefactor=3000 }
510 % @! is an end-of-sentence bang.
511 \def\!{!\spacefactor=3000 }
513 % @? is an end-of-sentence query.
514 \def\?{?\spacefactor=3000 }
516 % @w prevents a word break. Without the \leavevmode, @w at the
517 % beginning of a paragraph, when TeX is still in vertical mode, would
518 % produce a whole line of output instead of starting the paragraph.
519 \def\w#1{\leavevmode\hbox{#1}}
521 % @group ... @end group forces ... to be all on one page, by enclosing
522 % it in a TeX vbox. We use \vtop instead of \vbox to construct the box
523 % to keep its height that of a normal line. According to the rules for
524 % \topskip (p.114 of the TeXbook), the glue inserted is
525 % max (\topskip - \ht (first item), 0). If that height is large,
526 % therefore, no glue is inserted, and the space between the headline and
527 % the text is small, which looks bad.
529 \def\group{\begingroup
530 \ifnum\catcode13=\active \else
531 \errhelp = \groupinvalidhelp
532 \errmessage{@group invalid in context where filling is enabled}%
535 % The \vtop we start below produces a box with normal height and large
536 % depth; thus, TeX puts \baselineskip glue before it, and (when the
537 % next line of text is done) \lineskip glue after it. (See p.82 of
538 % the TeXbook.) Thus, space below is not quite equal to space
539 % above. But it's pretty close.
541 \egroup % End the \vtop.
542 \endgroup % End the \group.
546 % We have to put a strut on the last line in case the @group is in
547 % the midst of an example, rather than completely enclosing it.
548 % Otherwise, the interline space between the last line of the group
549 % and the first line afterwards is too small. But we can't put the
550 % strut in \Egroup, since there it would be on a line by itself.
551 % Hence this just inserts a strut at the beginning of each line.
552 \everypar = {\strut}%
554 % Since we have a strut on every line, we don't need any of TeX's
555 % normal interline spacing.
558 % OK, but now we have to do something about blank
559 % lines in the input in @example-like environments, which normally
560 % just turn into \lisppar, which will insert no space now that we've
561 % turned off the interline space. Simplest is to make them be an
564 \edef\par{\leavevmode \par}%
566 % Reset ^^M's definition to new definition of \par.
570 % Do @comment since we are called inside an environment such as
571 % @example, where each end-of-line in the input causes an
572 % end-of-line in the output. We don't want the end-of-line after
573 % the `@group' to put extra space in the output. Since @group
574 % should appear on a line by itself (according to the Texinfo
575 % manual), we don't worry about eating any user text.
579 % TeX puts in an \escapechar (i.e., `@') at the beginning of the help
580 % message, so this ends up printing `@group can only ...'.
582 \newhelp\groupinvalidhelp{%
583 group can only be used in environments such as @example,^^J%
584 where each line of input produces a line of output.}
586 % @need space-in-mils
587 % forces a page break if there is not space-in-mils remaining.
589 \newdimen\mil \mil=0.001in
591 \def\need{\parsearg\needx}
593 % Old definition--didn't work.
594 %\def\needx #1{\par %
595 %% This method tries to make TeX break the page naturally
596 %% if the depth of the box does not fit.
598 %\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak
603 % Ensure vertical mode, so we don't make a big box in the middle of a
607 % If the @need value is less than one line space, it's useless.
609 \dimen2 = \ht\strutbox
610 \advance\dimen2 by \dp\strutbox
611 \ifdim\dimen0 > \dimen2
613 % Do a \strut just to make the height of this box be normal, so the
614 % normal leading is inserted relative to the preceding line.
615 % And a page break here is fine.
616 \vtop to #1\mil{\strut\vfil}%
618 % TeX does not even consider page breaks if a penalty added to the
619 % main vertical list is 10000 or more. But in order to see if the
620 % empty box we just added fits on the page, we must make it consider
621 % page breaks. On the other hand, we don't want to actually break the
622 % page after the empty box. So we use a penalty of 9999.
624 % There is an extremely small chance that TeX will actually break the
625 % page at this \penalty, if there are no other feasible breakpoints in
626 % sight. (If the user is using lots of big @group commands, which
627 % almost-but-not-quite fill up a page, TeX will have a hard time doing
628 % good page breaking, for example.) However, I could not construct an
629 % example where a page broke at this \penalty; if it happens in a real
630 % document, then we can reconsider our strategy.
633 % Back up by the size of the box, whether we did a page break or not.
636 % Do not allow a page break right after this kern.
641 % @br forces paragraph break
645 % @dots{} output an ellipsis using the current font.
646 % We do .5em per period so that it has the same spacing in a typewriter
647 % font as three actual period characters.
652 \hskip 0pt plus 0.25fil minus 0.25fil
654 \hskip 0pt plus 0.5fil minus 0.5fil
658 % @enddots{} is an end-of-sentence ellipsis.
663 \hskip 0pt plus 0.25fil minus 0.25fil
665 \hskip 0pt plus 0.5fil minus 0.5fil
671 % @page forces the start of a new page
673 \def\page{\par\vfill\supereject}
676 % outputs text on separate line in roman font, starting at standard page margin
678 % This records the amount of indent in the innermost environment.
679 % That's how much \exdent should take out.
680 \newskip\exdentamount
682 % This defn is used inside fill environments such as @defun.
683 \def\exdent{\parsearg\exdentyyy}
684 \def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}}
686 % This defn is used inside nofill environments such as @example.
687 \def\nofillexdent{\parsearg\nofillexdentyyy}
688 \def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount
689 \leftline{\hskip\leftskip{\rm#1}}}}
691 % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
692 % paragraph. For more general purposes, use the \margin insertion
693 % class. WHICH is `l' or `r'.
695 \newskip\inmarginspacing \inmarginspacing=1cm
696 \def\strutdepth{\dp\strutbox}
698 \def\doinmargin#1#2{\strut\vadjust{%
701 \vtop to \strutdepth{%
702 \baselineskip=\strutdepth
704 % if you have multiple lines of stuff to put here, you'll need to
705 % make the vbox yourself of the appropriate size.
707 \llap{\ignorespaces #2\hskip\inmarginspacing}%
709 \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
714 \def\inleftmargin{\doinmargin l}
715 \def\inrightmargin{\doinmargin r}
717 % @inmargin{TEXT [, RIGHT-TEXT]}
718 % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
719 % else use TEXT for both).
721 \def\inmargin#1{\parseinmargin #1,,\finish}
722 \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
723 \setbox0 = \hbox{\ignorespaces #2}%
725 \def\lefttext{#1}% have both texts
728 \def\lefttext{#1}% have only one text
733 \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
735 \def\temp{\inleftmargin\lefttext}%
740 % @include file insert text of that file as input.
741 % Allow normal characters that we make active in the argument (a file name).
742 \def\include{\begingroup
751 \parsearg\includezzz}
752 % Restore active chars for included file.
753 \def\includezzz#1{\endgroup\begingroup
754 % Read the included file in a group so nested @include's work.
761 % @center line outputs that line, centered
763 \def\center{\parsearg\centerzzz}
764 \def\centerzzz #1{{\advance\hsize by -\leftskip
765 \advance\hsize by -\rightskip
768 % @sp n outputs n lines of vertical space
770 \def\sp{\parsearg\spxxx}
771 \def\spxxx #1{\vskip #1\baselineskip}
773 % @comment ...line which is ignored...
774 % @c is the same as @comment
775 % @ignore ... @end ignore is another way to write a comment
777 \def\comment{\begingroup \catcode`\^^M=\other%
778 \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
780 {\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
784 % @paragraphindent NCHARS
785 % We'll use ems for NCHARS, close enough.
786 % We cannot implement @paragraphindent asis, though.
788 \def\asisword{asis} % no translation, these are keywords
791 \def\paragraphindent{\parsearg\doparagraphindent}
792 \def\doparagraphindent#1{%
797 \defaultparindent = 0pt
799 \defaultparindent = #1em
802 \parindent = \defaultparindent
805 % @exampleindent NCHARS
806 % We'll use ems for NCHARS like @paragraphindent.
807 % It seems @exampleindent asis isn't necessary, but
808 % I preserve it to make it similar to @paragraphindent.
809 \def\exampleindent{\parsearg\doexampleindent}
810 \def\doexampleindent#1{%
817 \lispnarrowing = #1em
822 % @asis just yields its argument. Used with @table, for example.
826 % @math means output in math mode.
827 % We don't use $'s directly in the definition of \math because control
828 % sequences like \math are expanded when the toc file is written. Then,
829 % we read the toc file back, the $'s will be normal characters (as they
830 % should be, according to the definition of Texinfo). So we must use a
831 % control sequence to switch into and out of math mode.
833 % This isn't quite enough for @math to work properly in indices, but it
834 % seems unlikely it will ever be needed there.
836 \let\implicitmath = $
837 \def\math#1{\implicitmath #1\implicitmath}
839 % @bullet and @minus need the same treatment as @math, just above.
840 \def\bullet{\implicitmath\ptexbullet\implicitmath}
841 \def\minus{\implicitmath-\implicitmath}
843 % @refill is a no-op.
846 % If working on a large document in chapters, it is convenient to
847 % be able to disable indexing, cross-referencing, and contents, for test runs.
848 % This is done with @novalidate (before @setfilename).
850 \newif\iflinks \linkstrue % by default we want the aux files.
851 \let\novalidate = \linksfalse
853 % @setfilename is done at the beginning of every texinfo file.
854 % So open here the files we need to have open while reading the input.
855 % This makes it possible to make a .fmt file for texinfo.
859 \fi % \openindices needs to do some work in any case.
861 \fixbackslash % Turn off hack to swallow `\input texinfo'.
862 \global\let\setfilename=\comment % Ignore extra @setfilename cmds.
864 % If texinfo.cnf is present on the system, read it.
865 % Useful for site-wide @afourpaper, etc.
866 % Just to be on the safe side, close the input stream before the \input.
867 \openin 1 texinfo.cnf
868 \ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi
872 \comment % Ignore the actual filename.
875 % Called from \setfilename.
887 \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
891 % adobe `portable' document format
895 \newcount\filenamelength
904 \newif\ifpdfmakepagedest
906 \ifx\pdfoutput\undefined
908 \let\pdfmkdest = \gobble
909 \let\pdfurl = \gobble
910 \let\endlink = \relax
911 \let\linkcolor = \relax
912 \let\pdfmakeoutlines = \relax
917 \def\dopdfimage#1#2#3{%
919 \def\imageheight{#3}%
920 \ifnum\pdftexversion < 14
925 \ifx\empty\imagewidth\else width \imagewidth \fi
926 \ifx\empty\imageheight\else height \imageheight \fi
928 \ifnum\pdftexversion < 14 \else
929 \pdfrefximage \pdflastximage
931 \def\pdfmkdest#1{\pdfdest name{#1@} xyz}
933 \let\linkcolor = \Blue % was Cyan, but that seems light?
934 \def\endlink{\Black\pdfendlink}
935 % Adding outlines to PDF; macros for calculating structure of outlines
936 % come from Petr Olsak
937 \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
938 \else \csname#1\endcsname \fi}
939 \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
941 \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
942 \def\pdfmakeoutlines{{%
943 \openin 1 \jobname.toc
948 \let\_ = \normalunderscore
949 % Thanh's hack / proper braces in bookmarks
950 \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
951 \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
953 \def\chapentry ##1##2##3{}
954 \def\unnumbchapentry ##1##2{}
955 \def\secentry ##1##2##3##4{\advancenumber{chap##2}}
956 \def\unnumbsecentry ##1##2{}
957 \def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}}
958 \def\unnumbsubsecentry ##1##2{}
959 \def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}}
960 \def\unnumbsubsubsecentry ##1##2{}
962 \def\chapentry ##1##2##3{%
963 \pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}}
964 \def\unnumbchapentry ##1##2{%
965 \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
966 \def\secentry ##1##2##3##4{%
967 \pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}}
968 \def\unnumbsecentry ##1##2{%
969 \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
970 \def\subsecentry ##1##2##3##4##5{%
971 \pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}}
972 \def\unnumbsubsecentry ##1##2{%
973 \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
974 \def\subsubsecentry ##1##2##3##4##5##6{%
975 \pdfoutline goto name{\pdfmkpgn{##6}}{##1}}
976 \def\unnumbsubsubsecentry ##1##2{%
977 \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
982 \def\params{#1}\def\E{END}%
984 \let\nextmakelinks=\relax
986 \let\nextmakelinks=\makelinks
987 \ifnum\lnkcount>0,\fi
989 \startlink attr{/Border [0 0 0]}
990 goto name{\pdfmkpgn{\the\pgn}}%
992 \advance\lnkcount by 1%
997 \def\picknum#1{\expandafter\pn#1}
1008 \def\ppn#1{\pgn=#1\gobble}
1009 \def\ppnn{\pgn=\first}
1010 \def\pdfmklnk#1{\lnkcount=0\makelinks #1,END,}
1011 \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
1012 \def\skipspaces#1{\def\PP{#1}\def\D{|}%
1013 \ifx\PP\D\let\nextsp\relax
1014 \else\let\nextsp\skipspaces
1015 \ifx\p\space\else\addtokens{\filename}{\PP}%
1016 \advance\filenamelength by 1
1020 \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax}
1021 \ifnum\pdftexversion < 14
1022 \let \startlink \pdfannotlink
1024 \let \startlink \pdfstartlink
1028 \normalturnoffactive\def\@{@}%
1030 \startlink attr{/Border [0 0 0]}%
1031 user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
1034 \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
1035 \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
1036 \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
1037 \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
1039 \expandafter\poptoks\the\toksA|ENDTOKS|
1041 \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
1042 \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
1043 \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
1045 \ifnum0=\countA\else\makelink\fi
1046 \ifx\first.\let\next=\done\else
1048 \addtokens{\toksB}{\the\toksD}
1049 \ifx\first,\addtokens{\toksB}{\space}\fi
1051 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
1053 \def\makelink{\addtokens{\toksB}%
1054 {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
1056 \startlink attr{/Border [0 0 0]} goto name{\mkpgn{#1}}
1057 \linkcolor #1\endlink}
1059 \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
1060 \fi % \ifx\pdfoutput
1064 % Font-change commands.
1066 % Texinfo sort of supports the sans serif font style, which plain TeX does not.
1067 % So we set up a \sf analogous to plain's \rm, etc.
1069 \def\sf{\fam=\sffam \tensf}
1070 \let\li = \sf % Sometimes we call it \li, not \sf.
1072 % We don't need math for this one.
1075 % Use Computer Modern fonts at \magstephalf (11pt).
1076 \newcount\mainmagstep
1077 \mainmagstep=\magstephalf
1079 % Set the font macro #1 to the font named #2, adding on the
1080 % specified font prefix (normally `cm').
1081 % #3 is the font's design size, #4 is a scale factor
1082 \def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4}
1084 % Use cm as the default font prefix.
1085 % To specify the font prefix, you must define \fontprefix
1086 % before you read in texinfo.tex.
1087 \ifx\fontprefix\undefined
1090 % Support font families that don't use the same naming scheme as CM.
1092 \def\rmbshape{bx} %where the normal face is bold
1097 \def\ttslshape{sltt}
1108 \let\mainmagstep=\magstep1
1109 \setfont\textrm\rmshape{12}{1000}
1110 \setfont\texttt\ttshape{12}{1000}
1112 \setfont\textrm\rmshape{10}{\mainmagstep}
1113 \setfont\texttt\ttshape{10}{\mainmagstep}
1115 % Instead of cmb10, you many want to use cmbx10.
1116 % cmbx10 is a prettier font on its own, but cmb10
1117 % looks better when embedded in a line with cmr10.
1118 \setfont\textbf\bfshape{10}{\mainmagstep}
1119 \setfont\textit\itshape{10}{\mainmagstep}
1120 \setfont\textsl\slshape{10}{\mainmagstep}
1121 \setfont\textsf\sfshape{10}{\mainmagstep}
1122 \setfont\textsc\scshape{10}{\mainmagstep}
1123 \setfont\textttsl\ttslshape{10}{\mainmagstep}
1124 \font\texti=cmmi10 scaled \mainmagstep
1125 \font\textsy=cmsy10 scaled \mainmagstep
1127 % A few fonts for @defun, etc.
1128 \setfont\defbf\bxshape{10}{\magstep1} %was 1314
1129 \setfont\deftt\ttshape{10}{\magstep1}
1130 \def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf}
1132 % Fonts for indices, footnotes, small examples (9pt).
1133 \setfont\smallrm\rmshape{9}{1000}
1134 \setfont\smalltt\ttshape{9}{1000}
1135 \setfont\smallbf\bfshape{10}{900}
1136 \setfont\smallit\itshape{9}{1000}
1137 \setfont\smallsl\slshape{9}{1000}
1138 \setfont\smallsf\sfshape{9}{1000}
1139 \setfont\smallsc\scshape{10}{900}
1140 \setfont\smallttsl\ttslshape{10}{900}
1144 % Fonts for title page:
1145 \setfont\titlerm\rmbshape{12}{\magstep3}
1146 \setfont\titleit\itbshape{10}{\magstep4}
1147 \setfont\titlesl\slbshape{10}{\magstep4}
1148 \setfont\titlett\ttbshape{12}{\magstep3}
1149 \setfont\titlettsl\ttslshape{10}{\magstep4}
1150 \setfont\titlesf\sfbshape{17}{\magstep1}
1151 \let\titlebf=\titlerm
1152 \setfont\titlesc\scbshape{10}{\magstep4}
1153 \font\titlei=cmmi12 scaled \magstep3
1154 \font\titlesy=cmsy10 scaled \magstep4
1155 \def\authorrm{\secrm}
1157 % Chapter (and unnumbered) fonts (17.28pt).
1158 \setfont\chaprm\rmbshape{12}{\magstep2}
1159 \setfont\chapit\itbshape{10}{\magstep3}
1160 \setfont\chapsl\slbshape{10}{\magstep3}
1161 \setfont\chaptt\ttbshape{12}{\magstep2}
1162 \setfont\chapttsl\ttslshape{10}{\magstep3}
1163 \setfont\chapsf\sfbshape{17}{1000}
1165 \setfont\chapsc\scbshape{10}{\magstep3}
1166 \font\chapi=cmmi12 scaled \magstep2
1167 \font\chapsy=cmsy10 scaled \magstep3
1169 % Section fonts (14.4pt).
1170 \setfont\secrm\rmbshape{12}{\magstep1}
1171 \setfont\secit\itbshape{10}{\magstep2}
1172 \setfont\secsl\slbshape{10}{\magstep2}
1173 \setfont\sectt\ttbshape{12}{\magstep1}
1174 \setfont\secttsl\ttslshape{10}{\magstep2}
1175 \setfont\secsf\sfbshape{12}{\magstep1}
1177 \setfont\secsc\scbshape{10}{\magstep2}
1178 \font\seci=cmmi12 scaled \magstep1
1179 \font\secsy=cmsy10 scaled \magstep2
1181 % \setfont\ssecrm\bxshape{10}{\magstep1} % This size an font looked bad.
1182 % \setfont\ssecit\itshape{10}{\magstep1} % The letters were too crowded.
1183 % \setfont\ssecsl\slshape{10}{\magstep1}
1184 % \setfont\ssectt\ttshape{10}{\magstep1}
1185 % \setfont\ssecsf\sfshape{10}{\magstep1}
1187 %\setfont\ssecrm\bfshape{10}{1315} % Note the use of cmb rather than cmbx.
1188 %\setfont\ssecit\itshape{10}{1315} % Also, the size is a little larger than
1189 %\setfont\ssecsl\slshape{10}{1315} % being scaled magstep1.
1190 %\setfont\ssectt\ttshape{10}{1315}
1191 %\setfont\ssecsf\sfshape{10}{1315}
1193 %\let\ssecbf=\ssecrm
1195 % Subsection fonts (13.15pt).
1196 \setfont\ssecrm\rmbshape{12}{\magstephalf}
1197 \setfont\ssecit\itbshape{10}{1315}
1198 \setfont\ssecsl\slbshape{10}{1315}
1199 \setfont\ssectt\ttbshape{12}{\magstephalf}
1200 \setfont\ssecttsl\ttslshape{10}{1315}
1201 \setfont\ssecsf\sfbshape{12}{\magstephalf}
1203 \setfont\ssecsc\scbshape{10}{\magstep1}
1204 \font\sseci=cmmi12 scaled \magstephalf
1205 \font\ssecsy=cmsy10 scaled 1315
1206 % The smallcaps and symbol fonts should actually be scaled \magstep1.5,
1207 % but that is not a standard magnification.
1209 % In order for the font changes to affect most math symbols and letters,
1210 % we have to define the \textfont of the standard families. Since
1211 % texinfo doesn't allow for producing subscripts and superscripts, we
1212 % don't bother to reset \scriptfont and \scriptscriptfont (which would
1213 % also require loading a lot more fonts).
1215 \def\resetmathfonts{%
1216 \textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy
1217 \textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf
1218 \textfont\ttfam = \tentt \textfont\sffam = \tensf
1222 % The font-changing commands redefine the meanings of \tenSTYLE, instead
1223 % of just \STYLE. We do this so that font changes will continue to work
1224 % in math mode, where it is the current \fam that is relevant in most
1225 % cases, not the current font. Plain TeX does \def\bf{\fam=\bffam
1226 % \tenbf}, for example. By redefining \tenbf, we obviate the need to
1227 % redefine \bf itself.
1229 \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
1230 \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
1231 \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl
1234 \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
1235 \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
1236 \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
1237 \let\tenttsl=\titlettsl
1238 \resetmathfonts \setleading{25pt}}
1239 \def\titlefont#1{{\titlefonts\rm #1}}
1241 \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
1242 \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
1243 \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl
1244 \resetmathfonts \setleading{19pt}}
1246 \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
1247 \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
1248 \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl
1249 \resetmathfonts \setleading{16pt}}
1251 \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
1252 \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
1253 \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl
1254 \resetmathfonts \setleading{15pt}}
1255 \let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf?
1257 \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
1258 \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
1259 \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
1260 \let\tenttsl=\smallttsl
1261 \resetmathfonts \setleading{11pt}}
1263 % Set up the default fonts, so we can use them for creating boxes.
1267 % Define these so they can be easily changed for other fonts.
1268 \def\angleleft{$\langle$}
1269 \def\angleright{$\rangle$}
1271 % Count depth in font-changes, for error checks
1272 \newcount\fontdepth \fontdepth=0
1274 % Fonts for short table of contents.
1275 \setfont\shortcontrm\rmshape{12}{1000}
1276 \setfont\shortcontbf\bxshape{12}{1000}
1277 \setfont\shortcontsl\slshape{12}{1000}
1279 %% Add scribe-like font environments, plus @l for inline lisp (usually sans
1280 %% serif) and @ii for TeX italic
1282 % \smartitalic{ARG} outputs arg in italics, followed by an italic correction
1283 % unless the following character is such as not to need one.
1284 \def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
1285 \def\smartslanted#1{{\sl #1}\futurelet\next\smartitalicx}
1286 \def\smartitalic#1{{\it #1}\futurelet\next\smartitalicx}
1289 \let\var=\smartslanted
1290 \let\dfn=\smartslanted
1291 \let\emph=\smartitalic
1292 \let\cite=\smartslanted
1297 % We can't just use \exhyphenpenalty, because that only has effect at
1298 % the end of a paragraph. Restore normal hyphenation at the end of the
1299 % group within which \nohyphenation is presumably called.
1301 \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
1302 \def\restorehyphenation{\hyphenchar\font = `- }
1305 {\tt \rawbackslash \frenchspacing #1}%
1309 \def\samp#1{`\tclose{#1}'\null}
1310 \setfont\keyrm\rmshape{8}{1000}
1312 \def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
1313 \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
1314 \vbox{\hrule\kern-0.4pt
1315 \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
1317 \kern-.06em\raise0.4pt\hbox{\angleright}}}}
1318 % The old definition, with no lozenge:
1319 %\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
1320 \def\ctrl #1{{\tt \rawbackslash \hat}#1}
1322 % @file, @option are the same as @samp.
1326 % @code is a modification of @t,
1327 % which makes spaces the same size as normal in the surrounding text.
1330 % Change normal interword space to be same as for the current font.
1331 \spaceskip = \fontdimen2\font
1333 % Switch to typewriter.
1336 % But `\ ' produces the large typewriter interword space.
1337 \def\ {{\spaceskip = 0pt{} }}%
1339 % Turn off hyphenation.
1349 % We *must* turn on hyphenation at `-' and `_' in \code.
1350 % Otherwise, it is too hard to avoid overfull hboxes
1351 % in the Emacs manual, the Library manual, etc.
1353 % Unfortunately, TeX uses one parameter (\hyphenchar) to control
1354 % both hyphenation at - and hyphenation within words.
1355 % We must therefore turn them both off (\tclose does that)
1356 % and arrange explicitly to hyphenate at a dash.
1362 \global\def\code{\begingroup
1363 \catcode`\-=\active \let-\codedash
1364 \catcode`\_=\active \let_\codeunder
1368 % If we end up with any active - characters when handling the index,
1369 % just treat them as a normal -.
1370 \global\def\indexbreaks{\catcode`\-=\active \let-\realdash}
1374 \def\codedash{-\discretionary{}{}{}}
1375 \def\codeunder{\ifusingtt{\normalunderscore\discretionary{}{}{}}{\_}}
1376 \def\codex #1{\tclose{#1}\endgroup}
1378 %\let\exp=\tclose %Was temporary
1380 % @kbd is like @code, except that if the argument is just one @key command,
1381 % then @kbd has no effect.
1383 % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
1384 % `example' (@kbd uses ttsl only inside of @example and friends),
1385 % or `code' (@kbd uses normal tty font always).
1386 \def\kbdinputstyle{\parsearg\kbdinputstylexxx}
1387 \def\kbdinputstylexxx#1{%
1389 \ifx\arg\worddistinct
1390 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
1391 \else\ifx\arg\wordexample
1392 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
1393 \else\ifx\arg\wordcode
1394 \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
1397 \def\worddistinct{distinct}
1398 \def\wordexample{example}
1401 % Default is kbdinputdistinct. (Too much of a hassle to call the macro,
1402 % the catcodes are wrong for parsearg to work.)
1403 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}
1406 \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
1407 \ifx\one\xkey\ifx\threex\three \key{#2}%
1408 \else{\tclose{\kbdfont\look}}\fi
1409 \else{\tclose{\kbdfont\look}}\fi}
1411 % For @url, @env, @command quotes seem unnecessary, so use \code.
1416 % @uref (abbreviation for `urlref') takes an optional (comma-separated)
1417 % second argument specifying the text to display and an optional third
1418 % arg as text to display instead of (rather than in addition to) the url
1419 % itself. First (mandatory) arg is the url. Perhaps eventually put in
1420 % a hypertex \special here.
1422 \def\uref#1{\douref #1,,,\finish}
1423 \def\douref#1,#2,#3,#4\finish{\begingroup
1426 \setbox0 = \hbox{\ignorespaces #3}%
1428 \unhbox0 % third arg given, show only that
1430 \setbox0 = \hbox{\ignorespaces #2}%
1433 \unhbox0 % PDF: 2nd arg given, show only it
1435 \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
1438 \code{#1}% only url given, so show it
1444 % rms does not like angle brackets --karl, 17may97.
1445 % So now @email is just like @uref, unless we are pdf.
1447 %\def\email#1{\angleleft{\tt #1}\angleright}
1449 \def\email#1{\doemail#1,,\finish}
1450 \def\doemail#1,#2,#3\finish{\begingroup
1453 \setbox0 = \hbox{\ignorespaces #2}%
1454 \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
1461 % Check if we are currently using a typewriter font. Since all the
1462 % Computer Modern typewriter fonts have zero interword stretch (and
1463 % shrink), and it is reasonable to expect all typewriter fonts to have
1464 % this property, we can check that font parameter.
1466 \def\ifmonospace{\ifdim\fontdimen3\font=0pt }
1468 % Typeset a dimension, e.g., `in' or `pt'. The only reason for the
1469 % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
1471 \def\dmn#1{\thinspace #1}
1473 \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}
1475 % @l was never documented to mean ``switch to the Lisp font'',
1476 % and it is not used as such in any manual I can find. We need it for
1477 % Polish suppressed-l. --karl, 22sep96.
1478 %\def\l#1{{\li #1}\null}
1480 % Explicit font changes: @r, @sc, undocumented @ii.
1481 \def\r#1{{\rm #1}} % roman font
1482 \def\sc#1{{\smallcaps#1}} % smallcaps font
1483 \def\ii#1{{\it #1}} % italic font
1485 % @acronym downcases the argument and prints in smallcaps.
1486 \def\acronym#1{{\smallcaps \lowercase{#1}}}
1488 % @pounds{} is a sterling sign.
1489 \def\pounds{{\it\$}}
1492 \message{page headings,}
1494 \newskip\titlepagetopglue \titlepagetopglue = 1.5in
1495 \newskip\titlepagebottomglue \titlepagebottomglue = 2pc
1497 % First the title page. Must do @settitle before @titlepage.
1499 \newif\iffinishedtitlepage
1501 % Do an implicit @contents or @shortcontents after @end titlepage if the
1502 % user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
1504 \newif\ifsetcontentsaftertitlepage
1505 \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
1506 \newif\ifsetshortcontentsaftertitlepage
1507 \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
1509 \def\shorttitlepage{\parsearg\shorttitlepagezzz}
1510 \def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
1511 \endgroup\page\hbox{}\page}
1513 \def\titlepage{\begingroup \parindent=0pt \textfonts
1514 \let\subtitlerm=\tenrm
1515 \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
1517 \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}%
1519 % Leave some space at the very top of the page.
1520 \vglue\titlepagetopglue
1522 % Now you can print the title using @title.
1523 \def\title{\parsearg\titlezzz}%
1524 \def\titlezzz##1{\leftline{\titlefonts\rm ##1}
1525 % print a rule at the page bottom also.
1526 \finishedtitlepagefalse
1527 \vskip4pt \hrule height 4pt width \hsize \vskip4pt}%
1528 % No rule at page bottom unless we print one at the top with @title.
1529 \finishedtitlepagetrue
1531 % Now you can put text using @subtitle.
1532 \def\subtitle{\parsearg\subtitlezzz}%
1533 \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}%
1535 % @author should come last, but may come many times.
1536 \def\author{\parsearg\authorzzz}%
1537 \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi
1538 {\authorfont \leftline{##1}}}%
1540 % Most title ``pages'' are actually two pages long, with space
1541 % at the top of the second. We don't want the ragged left on the second.
1542 \let\oldpage = \page
1544 \iffinishedtitlepage\else
1548 \let\page = \oldpage
1550 % \def\page{\oldpage \hbox{}}
1554 \iffinishedtitlepage\else
1557 % It is important to do the page break before ending the group,
1558 % because the headline and footline are only empty inside the group.
1559 % If we use the new definition of \page, we always get a blank page
1560 % after the title page, which we certainly don't want.
1564 % If they want short, they certainly want long too.
1565 \ifsetshortcontentsaftertitlepage
1568 \global\let\shortcontents = \relax
1569 \global\let\contents = \relax
1572 \ifsetcontentsaftertitlepage
1574 \global\let\contents = \relax
1575 \global\let\shortcontents = \relax
1578 \ifpdf \pdfmakepagedesttrue \fi
1583 \def\finishtitlepage{%
1584 \vskip4pt \hrule height 2pt width \hsize
1585 \vskip\titlepagebottomglue
1586 \finishedtitlepagetrue
1589 %%% Set up page headings and footings.
1591 \let\thispage=\folio
1593 \newtoks\evenheadline % headline on even pages
1594 \newtoks\oddheadline % headline on odd pages
1595 \newtoks\evenfootline % footline on even pages
1596 \newtoks\oddfootline % footline on odd pages
1598 % Now make Tex use those variables
1599 \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
1600 \else \the\evenheadline \fi}}
1601 \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
1602 \else \the\evenfootline \fi}\HEADINGShook}
1603 \let\HEADINGShook=\relax
1605 % Commands to set those variables.
1606 % For example, this is what @headings on does
1607 % @evenheading @thistitle|@thispage|@thischapter
1608 % @oddheading @thischapter|@thispage|@thistitle
1609 % @evenfooting @thisfile||
1610 % @oddfooting ||@thisfile
1612 \def\evenheading{\parsearg\evenheadingxxx}
1613 \def\oddheading{\parsearg\oddheadingxxx}
1614 \def\everyheading{\parsearg\everyheadingxxx}
1616 \def\evenfooting{\parsearg\evenfootingxxx}
1617 \def\oddfooting{\parsearg\oddfootingxxx}
1618 \def\everyfooting{\parsearg\everyfootingxxx}
1622 \gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish}
1623 \gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{%
1624 \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1626 \gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish}
1627 \gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{%
1628 \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1630 \gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
1632 \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish}
1633 \gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{%
1634 \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1636 \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish}
1637 \gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{%
1638 \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
1640 % Leave some space for the footline. Hopefully ok to assume
1641 % @evenfooting will not be used by itself.
1642 \global\advance\pageheight by -\baselineskip
1643 \global\advance\vsize by -\baselineskip
1646 \gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}}
1648 }% unbind the catcode of @.
1650 % @headings double turns headings on for double-sided printing.
1651 % @headings single turns headings on for single-sided printing.
1652 % @headings off turns them off.
1653 % @headings on same as @headings double, retained for compatibility.
1654 % @headings after turns on double-sided headings after this page.
1655 % @headings doubleafter turns on double-sided headings after this page.
1656 % @headings singleafter turns on single-sided headings after this page.
1657 % By default, they are off at the start of a document,
1658 % and turned `on' after @end titlepage.
1660 \def\headings #1 {\csname HEADINGS#1\endcsname}
1663 \global\evenheadline={\hfil} \global\evenfootline={\hfil}
1664 \global\oddheadline={\hfil} \global\oddfootline={\hfil}}
1666 % When we turn headings on, set the page number to 1.
1667 % For double-sided printing, put current file name in lower left corner,
1668 % chapter name on inside top of right hand pages, document
1669 % title on inside top of left hand pages, and page numbers on outside top
1670 % edge of all pages.
1671 \def\HEADINGSdouble{
1673 \global\evenfootline={\hfil}
1674 \global\oddfootline={\hfil}
1675 \global\evenheadline={\line{\folio\hfil\thistitle}}
1676 \global\oddheadline={\line{\thischapter\hfil\folio}}
1677 \global\let\contentsalignmacro = \chapoddpage
1679 \let\contentsalignmacro = \chappager
1681 % For single-sided printing, chapter title goes across top left of page,
1682 % page number on top right.
1683 \def\HEADINGSsingle{
1685 \global\evenfootline={\hfil}
1686 \global\oddfootline={\hfil}
1687 \global\evenheadline={\line{\thischapter\hfil\folio}}
1688 \global\oddheadline={\line{\thischapter\hfil\folio}}
1689 \global\let\contentsalignmacro = \chappager
1691 \def\HEADINGSon{\HEADINGSdouble}
1693 \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
1694 \let\HEADINGSdoubleafter=\HEADINGSafter
1695 \def\HEADINGSdoublex{%
1696 \global\evenfootline={\hfil}
1697 \global\oddfootline={\hfil}
1698 \global\evenheadline={\line{\folio\hfil\thistitle}}
1699 \global\oddheadline={\line{\thischapter\hfil\folio}}
1700 \global\let\contentsalignmacro = \chapoddpage
1703 \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
1704 \def\HEADINGSsinglex{%
1705 \global\evenfootline={\hfil}
1706 \global\oddfootline={\hfil}
1707 \global\evenheadline={\line{\thischapter\hfil\folio}}
1708 \global\oddheadline={\line{\thischapter\hfil\folio}}
1709 \global\let\contentsalignmacro = \chappager
1712 % Subroutines used in generating headings
1713 % This produces Day Month Year style of output.
1714 % Only define if not already defined, in case a txi-??.tex file has set
1715 % up a different format (e.g., txi-cs.tex does this).
1716 \ifx\today\undefined
1720 \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
1721 \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
1722 \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
1727 % @settitle line... specifies the title of the document, for headings.
1728 % It generates no output of its own.
1729 \def\thistitle{\putwordNoTitle}
1730 \def\settitle{\parsearg\settitlezzz}
1731 \def\settitlezzz #1{\gdef\thistitle{#1}}
1735 % Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
1737 % default indentation of table text
1738 \newdimen\tableindent \tableindent=.8in
1739 % default indentation of @itemize and @enumerate text
1740 \newdimen\itemindent \itemindent=.3in
1741 % margin between end of table item and start of table text.
1742 \newdimen\itemmargin \itemmargin=.1in
1744 % used internally for \itemindent minus \itemmargin
1747 % Note @table, @vtable, and @vtable define @item, @itemx, etc., with
1749 % They also define \itemindex
1750 % to index the item name in whatever manner is desired (perhaps none).
1752 \newif\ifitemxneedsnegativevskip
1754 \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
1756 \def\internalBitem{\smallbreak \parsearg\itemzzz}
1757 \def\internalBitemx{\itemxpar \parsearg\itemzzz}
1759 \def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
1760 \def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz}
1762 \def\internalBkitem{\smallbreak \parsearg\kitemzzz}
1763 \def\internalBkitemx{\itemxpar \parsearg\kitemzzz}
1765 \def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}%
1768 \def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}%
1771 \def\itemzzz #1{\begingroup %
1772 \advance\hsize by -\rightskip
1773 \advance\hsize by -\tableindent
1774 \setbox0=\hbox{\itemfont{#1}}%
1776 \nobreak % This prevents a break before @itemx.
1778 % If the item text does not fit in the space we have, put it on a line
1779 % by itself, and do not allow a page break either before or after that
1780 % line. We do not start a paragraph here because then if the next
1781 % command is, e.g., @kindex, the whatsit would get put into the
1782 % horizontal list on a line by itself, resulting in extra blank space.
1783 \ifdim \wd0>\itemmax
1785 % Make this a paragraph so we get the \parskip glue and wrapping,
1786 % but leave it ragged-right.
1788 \advance\leftskip by-\tableindent
1789 \advance\hsize by\tableindent
1790 \advance\rightskip by0pt plus1fil
1791 \leavevmode\unhbox0\par
1794 % We're going to be starting a paragraph, but we don't want the
1795 % \parskip glue -- logically it's part of the @item we just started.
1796 \nobreak \vskip-\parskip
1798 % Stop a page break at the \parskip glue coming up. Unfortunately
1799 % we can't prevent a possible page break at the following
1800 % \baselineskip glue.
1803 \itemxneedsnegativevskipfalse
1805 % The item text fits into the space. Start a paragraph, so that the
1806 % following text (if any) will end up on the same line.
1808 % Do this with kerns and \unhbox so that if there is a footnote in
1809 % the item text, it can migrate to the main vertical list and
1810 % eventually be printed.
1811 \nobreak\kern-\tableindent
1812 \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
1814 \nobreak\kern\dimen0
1816 \itemxneedsnegativevskiptrue
1820 \def\item{\errmessage{@item while not in a table}}
1821 \def\itemx{\errmessage{@itemx while not in a table}}
1822 \def\kitem{\errmessage{@kitem while not in a table}}
1823 \def\kitemx{\errmessage{@kitemx while not in a table}}
1824 \def\xitem{\errmessage{@xitem while not in a table}}
1825 \def\xitemx{\errmessage{@xitemx while not in a table}}
1827 % Contains a kludge to get @end[description] to work.
1828 \def\description{\tablez{\dontindex}{1}{}{}{}{}}
1830 % @table, @ftable, @vtable.
1831 \def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
1832 {\obeylines\obeyspaces%
1833 \gdef\tablex #1^^M{%
1834 \tabley\dontindex#1 \endtabley}}
1836 \def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
1837 {\obeylines\obeyspaces%
1838 \gdef\ftablex #1^^M{%
1839 \tabley\fnitemindex#1 \endtabley
1840 \def\Eftable{\endgraf\afterenvbreak\endgroup}%
1841 \let\Etable=\relax}}
1843 \def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex}
1844 {\obeylines\obeyspaces%
1845 \gdef\vtablex #1^^M{%
1846 \tabley\vritemindex#1 \endtabley
1847 \def\Evtable{\endgraf\afterenvbreak\endgroup}%
1848 \let\Etable=\relax}}
1851 \def\fnitemindex #1{\doind {fn}{\code{#1}}}%
1852 \def\vritemindex #1{\doind {vr}{\code{#1}}}%
1855 \gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
1856 \tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
1858 \def\tablez #1#2#3#4#5#6{%
1861 \def\Edescription{\Etable}% Necessary kludge.
1863 \ifnum 0#3>0 \advance \leftskip by #3\mil \fi %
1864 \ifnum 0#4>0 \tableindent=#4\mil \fi %
1865 \ifnum 0#5>0 \advance \rightskip by #5\mil \fi %
1867 \itemmax=\tableindent %
1868 \advance \itemmax by -\itemmargin %
1869 \advance \leftskip by \tableindent %
1870 \exdentamount=\tableindent
1872 \parskip = \smallskipamount
1873 \ifdim \parskip=0pt \parskip=2pt \fi%
1874 \def\Etable{\endgraf\afterenvbreak\endgroup}%
1875 \let\item = \internalBitem %
1876 \let\itemx = \internalBitemx %
1877 \let\kitem = \internalBkitem %
1878 \let\kitemx = \internalBkitemx %
1879 \let\xitem = \internalBxitem %
1880 \let\xitemx = \internalBxitemx %
1883 % This is the counter used by @enumerate, which is really @itemize
1887 \def\itemize{\parsearg\itemizezzz}
1889 \def\itemizezzz #1{%
1890 \begingroup % ended by the @end itemize
1891 \itemizey {#1}{\Eitemize}
1894 \def\itemizey #1#2{%
1896 \itemmax=\itemindent %
1897 \advance \itemmax by -\itemmargin %
1898 \advance \leftskip by \itemindent %
1899 \exdentamount=\itemindent
1901 \parskip = \smallskipamount %
1902 \ifdim \parskip=0pt \parskip=2pt \fi%
1903 \def#2{\endgraf\afterenvbreak\endgroup}%
1904 \def\itemcontents{#1}%
1905 \let\item=\itemizeitem}
1907 % Set sfcode to normal for the chars that usually have another value.
1908 % These are `.?!:;,'
1909 \def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000
1910 \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 }
1912 % \splitoff TOKENS\endmark defines \first to be the first token in
1913 % TOKENS, and \rest to be the remainder.
1915 \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
1917 % Allow an optional argument of an uppercase letter, lowercase letter,
1918 % or number, to specify the first label in the enumerated list. No
1919 % argument is the same as `1'.
1921 \def\enumerate{\parsearg\enumeratezzz}
1922 \def\enumeratezzz #1{\enumeratey #1 \endenumeratey}
1923 \def\enumeratey #1 #2\endenumeratey{%
1924 \begingroup % ended by the @end enumerate
1926 % If we were given no argument, pretend we were given `1'.
1928 \ifx\thearg\empty \def\thearg{1}\fi
1930 % Detect if the argument is a single token. If so, it might be a
1931 % letter. Otherwise, the only valid thing it can be is a number.
1932 % (We will always have one token, because of the test we just made.
1933 % This is a good thing, since \splitoff doesn't work given nothing at
1934 % all -- the first parameter is undelimited.)
1935 \expandafter\splitoff\thearg\endmark
1937 % Only one token in the argument. It could still be anything.
1938 % A ``lowercase letter'' is one whose \lccode is nonzero.
1939 % An ``uppercase letter'' is one whose \lccode is both nonzero, and
1940 % not equal to itself.
1941 % Otherwise, we assume it's a number.
1943 % We need the \relax at the end of the \ifnum lines to stop TeX from
1944 % continuing to look for a <number>.
1946 \ifnum\lccode\expandafter`\thearg=0\relax
1947 \numericenumerate % a number (we hope)
1950 \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
1951 \lowercaseenumerate % lowercase letter
1953 \uppercaseenumerate % uppercase letter
1957 % Multiple tokens in the argument. We hope it's a number.
1962 % An @enumerate whose labels are integers. The starting integer is
1965 \def\numericenumerate{%
1967 \startenumeration{\the\itemno}%
1970 % The starting (lowercase) letter is in \thearg.
1971 \def\lowercaseenumerate{%
1972 \itemno = \expandafter`\thearg
1974 % Be sure we're not beyond the end of the alphabet.
1976 \errmessage{No more lowercase letters in @enumerate; get a bigger
1983 % The starting (uppercase) letter is in \thearg.
1984 \def\uppercaseenumerate{%
1985 \itemno = \expandafter`\thearg
1987 % Be sure we're not beyond the end of the alphabet.
1989 \errmessage{No more uppercase letters in @enumerate; get a bigger
1996 % Call itemizey, adding a period to the first argument and supplying the
1997 % common last two arguments. Also subtract one from the initial value in
1998 % \itemno, since @item increments \itemno.
2000 \def\startenumeration#1{%
2001 \advance\itemno by -1
2002 \itemizey{#1.}\Eenumerate\flushcr
2005 % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
2008 \def\alphaenumerate{\enumerate{a}}
2009 \def\capsenumerate{\enumerate{A}}
2010 \def\Ealphaenumerate{\Eenumerate}
2011 \def\Ecapsenumerate{\Eenumerate}
2013 % Definition of @item while inside @itemize.
2016 \advance\itemno by 1
2017 {\let\par=\endgraf \smallbreak}%
2018 \ifhmode \errmessage{In hmode at itemizeitem}\fi
2019 {\parskip=0in \hskip 0pt
2020 \hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
2021 \vadjust{\penalty 1200}}%
2024 % @multitable macros
2025 % Amy Hendrickson, 8/18/94, 3/6/96
2027 % @multitable ... @end multitable will make as many columns as desired.
2028 % Contents of each column will wrap at width given in preamble. Width
2029 % can be specified either with sample text given in a template line,
2030 % or in percent of \hsize, the current width of text on page.
2032 % Table can continue over pages but will only break between lines.
2036 % Either define widths of columns in terms of percent of \hsize:
2037 % @multitable @columnfractions .25 .3 .45
2040 % Numbers following @columnfractions are the percent of the total
2041 % current hsize to be used for each column. You may use as many
2042 % columns as desired.
2045 % Or use a template:
2046 % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
2048 % using the widest term desired in each column.
2050 % For those who want to use more than one line's worth of words in
2051 % the preamble, break the line within one argument and it
2052 % will parse correctly, i.e.,
2054 % @multitable {Column 1 template} {Column 2 template} {Column 3
2057 % @multitable {Column 1 template} {Column 2 template}
2058 % {Column 3 template}
2060 % Each new table line starts with @item, each subsequent new column
2061 % starts with @tab. Empty columns may be produced by supplying @tab's
2062 % with nothing between them for as many times as empty columns are needed,
2063 % ie, @tab@tab@tab will produce two empty columns.
2065 % @item, @tab, @multitable or @end multitable do not need to be on their
2066 % own lines, but it will not hurt if they are.
2068 % Sample multitable:
2070 % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
2071 % @item first col stuff @tab second col stuff @tab third col
2078 % @item first col stuff @tab second col stuff
2079 % @tab Many paragraphs of text may be used in any column.
2081 % They will wrap at the width determined by the template.
2082 % @item@tab@tab This will be in third column.
2085 % Default dimensions may be reset by user.
2086 % @multitableparskip is vertical space between paragraphs in table.
2087 % @multitableparindent is paragraph indent in table.
2088 % @multitablecolmargin is horizontal space to be left between columns.
2089 % @multitablelinespace is space to leave between table items, baseline
2091 % 0pt means it depends on current normal line spacing.
2093 \newskip\multitableparskip
2094 \newskip\multitableparindent
2095 \newdimen\multitablecolspace
2096 \newskip\multitablelinespace
2097 \multitableparskip=0pt
2098 \multitableparindent=6pt
2099 \multitablecolspace=12pt
2100 \multitablelinespace=0pt
2102 % Macros used to set up halign preamble:
2104 \let\endsetuptable\relax
2105 \def\xendsetuptable{\endsetuptable}
2106 \let\columnfractions\relax
2107 \def\xcolumnfractions{\columnfractions}
2110 % #1 is the part of the @columnfraction before the decimal point, which
2111 % is presumably either 0 or the empty string (but we don't check, we
2112 % just throw it away). #2 is the decimal part, which we use as the
2113 % percent of \hsize for this column.
2114 \def\pickupwholefraction#1.#2 {%
2115 \global\advance\colcount by 1
2116 \expandafter\xdef\csname col\the\colcount\endcsname{.#2\hsize}%
2123 \ifx\firstarg\xendsetuptable
2126 \ifx\firstarg\xcolumnfractions
2127 \global\setpercenttrue
2130 \let\go\pickupwholefraction
2132 \global\advance\colcount by 1
2133 \setbox0=\hbox{#1\unskip }% Add a normal word space as a separator;
2134 % typically that is always in the input, anyway.
2135 \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
2138 \ifx\go\pickupwholefraction
2139 % Put the argument back for the \pickupwholefraction call, so
2140 % we'll always have a period there to be parsed.
2141 \def\go{\pickupwholefraction#1}%
2143 \let\go = \setuptable
2149 % This used to have \hskip1sp. But then the space in a template line is
2150 % not enough. That is bad. So let's go back to just & until we
2151 % encounter the problem it was intended to solve again.
2152 % --karl, nathan@acm.org, 20apr99.
2155 % @multitable ... @end multitable definitions:
2157 \def\multitable{\parsearg\dotable}
2158 \def\dotable#1{\bgroup
2163 \setmultitablespacing
2164 \parskip=\multitableparskip
2165 \parindent=\multitableparindent
2168 \def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}%
2170 % To parse everything between @multitable and @item:
2171 \setuptable#1 \endsetuptable
2173 % \everycr will reset column counter, \colcount, at the end of
2174 % each line. Every column entry will cause \colcount to advance by one.
2175 % The table preamble
2176 % looks at the current \colcount to find the correct column width.
2179 % \filbreak%% keeps underfull box messages off when table breaks over pages.
2180 % Maybe so, but it also creates really weird page breaks when the table
2181 % breaks over pages. Wouldn't \vfil be better? Wait until the problem
2182 % manifests itself, so it can be fixed for real --karl.
2183 \global\colcount=0\relax}}%
2185 % This preamble sets up a generic column definition, which will
2186 % be used as many times as user calls for columns.
2187 % \vtop will set a single line and will also let text wrap and
2188 % continue for many paragraphs if desired.
2189 \halign\bgroup&\global\advance\colcount by 1\relax
2190 \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
2192 % In order to keep entries from bumping into each other
2193 % we will add a \leftskip of \multitablecolspace to all columns after
2196 % If a template has been used, we will add \multitablecolspace
2197 % to the width of each template entry.
2199 % If the user has set preamble in terms of percent of \hsize we will
2200 % use that dimension as the width of the column, and the \leftskip
2201 % will keep entries from bumping into each other. Table will start at
2202 % left margin and final column will justify at right margin.
2204 % Make sure we don't inherit \rightskip from the outer environment.
2207 % The first column will be indented with the surrounding text.
2208 \advance\hsize by\leftskip
2211 % If user has not set preamble in terms of percent of \hsize
2212 % we will advance \hsize by \multitablecolspace.
2213 \advance\hsize by \multitablecolspace
2215 % In either case we will make \leftskip=\multitablecolspace:
2216 \leftskip=\multitablecolspace
2218 % Ignoring space at the beginning and end avoids an occasional spurious
2219 % blank line, when TeX decides to break the line at the space before the
2220 % box from the multistrut, so the strut ends up on a line by itself.
2222 % @multitable @columnfractions .11 .89
2224 % @tab Legal holiday which is valid in major parts of the whole country.
2225 % Is automatically provided with highlighting sequences respectively marking
2227 \noindent\ignorespaces##\unskip\multistrut}\cr
2230 \def\setmultitablespacing{% test to see if user has set \multitablelinespace.
2231 % If so, do nothing. If not, give it an appropriate dimension based on
2232 % current baselineskip.
2233 \ifdim\multitablelinespace=0pt
2234 \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
2235 \global\advance\multitablelinespace by-\ht0
2236 %% strut to put in table in case some entry doesn't have descenders,
2237 %% to keep lines equally spaced
2238 \let\multistrut = \strut
2240 %% FIXME: what is \box0 supposed to be?
2241 \gdef\multistrut{\vrule height\multitablelinespace depth\dp0
2243 %% Test to see if parskip is larger than space between lines of
2244 %% table. If not, do nothing.
2245 %% If so, set to same dimension as multitablelinespace.
2246 \ifdim\multitableparskip>\multitablelinespace
2247 \global\multitableparskip=\multitablelinespace
2248 \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
2249 %% than skip between lines in the table.
2251 \ifdim\multitableparskip=0pt
2252 \global\multitableparskip=\multitablelinespace
2253 \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
2254 %% than skip between lines in the table.
2258 \message{conditionals,}
2259 % Prevent errors for section commands.
2260 % Used in @ignore and in failing conditionals.
2261 \def\ignoresections{%
2263 \let\unnumbered=\relax
2265 \let\unnumberedsec=\relax
2266 \let\unnumberedsection=\relax
2267 \let\unnumberedsubsec=\relax
2268 \let\unnumberedsubsection=\relax
2269 \let\unnumberedsubsubsec=\relax
2270 \let\unnumberedsubsubsection=\relax
2273 \let\subsubsec=\relax
2274 \let\subsection=\relax
2275 \let\subsubsection=\relax
2276 \let\appendix=\relax
2277 \let\appendixsec=\relax
2278 \let\appendixsection=\relax
2279 \let\appendixsubsec=\relax
2280 \let\appendixsubsection=\relax
2281 \let\appendixsubsubsec=\relax
2282 \let\appendixsubsubsection=\relax
2283 \let\contents=\relax
2284 \let\smallbook=\relax
2285 \let\titlepage=\relax
2288 % Used in nested conditionals, where we have to parse the Texinfo source
2289 % and so want to turn off most commands, in case they are used
2292 \def\ignoremorecommands{%
2293 \let\defcodeindex = \relax
2296 \let\deffnx = \relax
2297 \let\defindex = \relax
2298 \let\defivar = \relax
2299 \let\defmac = \relax
2300 \let\defmethod = \relax
2302 \let\defopt = \relax
2303 \let\defspec = \relax
2305 \let\deftypefn = \relax
2306 \let\deftypefun = \relax
2307 \let\deftypeivar = \relax
2308 \let\deftypeop = \relax
2309 \let\deftypevar = \relax
2310 \let\deftypevr = \relax
2312 \let\defvar = \relax
2316 \let\printindex = \relax
2318 \let\settitle = \relax
2319 \let\setchapternewpage = \relax
2320 \let\setchapterstyle = \relax
2321 \let\everyheading = \relax
2322 \let\evenheading = \relax
2323 \let\oddheading = \relax
2324 \let\everyfooting = \relax
2325 \let\evenfooting = \relax
2326 \let\oddfooting = \relax
2327 \let\headings = \relax
2328 \let\include = \relax
2329 \let\lowersections = \relax
2331 \let\raisesections = \relax
2338 % Ignore @ignore ... @end ignore.
2340 \def\ignore{\doignore{ignore}}
2342 % Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text.
2344 \def\ifinfo{\doignore{ifinfo}}
2345 \def\ifhtml{\doignore{ifhtml}}
2346 \def\ifnottex{\doignore{ifnottex}}
2347 \def\html{\doignore{html}}
2348 \def\menu{\doignore{menu}}
2349 \def\direntry{\doignore{direntry}}
2351 % @dircategory CATEGORY -- specify a category of the dir file
2352 % which this file should belong to. Ignore this in TeX.
2353 \let\dircategory = \comment
2355 % Ignore text until a line `@end #1'.
2357 \def\doignore#1{\begingroup
2358 % Don't complain about control sequences we have declared \outer.
2361 % Define a command to swallow text until we reach `@end #1'.
2362 % This @ is a catcode 12 token (that is the normal catcode of @ in
2363 % this texinfo.tex file). We change the catcode of @ below to match.
2364 \long\def\doignoretext##1@end #1{\enddoignore}%
2366 % Make sure that spaces turn into tokens that match what \doignoretext wants.
2369 % Ignore braces, too, so mismatched braces don't cause trouble.
2373 % We must not have @c interpreted as a control sequence.
2376 % Make the letter c a comment character so that the rest of the line
2377 % will be ignored. This way, the document can have (for example)
2379 % and the @end ifinfo will be properly ignored.
2380 % (We've just changed @ to catcode 12.)
2383 % And now expand that command.
2387 % What we do to finish off ignored text.
2389 \def\enddoignore{\endgroup\ignorespaces}%
2391 \newif\ifwarnedobs\warnedobsfalse
2393 \ifwarnedobs\relax\else
2394 % We need to warn folks that they may have trouble with TeX 3.0.
2395 % This uses \immediate\write16 rather than \message to get newlines.
2396 \immediate\write16{}
2397 \immediate\write16{WARNING: for users of Unix TeX 3.0!}
2398 \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).}
2399 \immediate\write16{If you are running another version of TeX, relax.}
2400 \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.}
2401 \immediate\write16{ Then upgrade your TeX installation if you can.}
2402 \immediate\write16{ (See ftp://ftp.gnu.org/pub/gnu/TeX.README.)}
2403 \immediate\write16{If you are stuck with version 3.0, run the}
2404 \immediate\write16{ script ``tex3patch'' from the Texinfo distribution}
2405 \immediate\write16{ to use a workaround.}
2406 \immediate\write16{}
2407 \global\warnedobstrue
2411 % **In TeX 3.0, setting text in \nullfont hangs tex. For a
2412 % workaround (which requires the file ``dummy.tfm'' to be installed),
2413 % uncomment the following line:
2414 %%%%%\font\nullfont=dummy\let\obstexwarn=\relax
2416 % Ignore text, except that we keep track of conditional commands for
2417 % purposes of nesting, up to an `@end #1' command.
2419 \def\nestedignore#1{%
2421 % We must actually expand the ignored text to look for the @end
2422 % command, so that nested ignore constructs work. Thus, we put the
2423 % text into a \vbox and then do nothing with the result. To minimize
2424 % the change of memory overflow, we follow the approach outlined on
2425 % page 401 of the TeXbook: make the current font be a dummy font.
2427 \setbox0 = \vbox\bgroup
2428 % Don't complain about control sequences we have declared \outer.
2431 % Define `@end #1' to end the box, which will in turn undefine the
2432 % @end command again.
2433 \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}%
2435 % We are going to be parsing Texinfo commands. Most cause no
2436 % trouble when they are used incorrectly, but some commands do
2437 % complicated argument parsing or otherwise get confused, so we
2440 % We can't do anything about stray @-signs, unfortunately;
2441 % they'll produce `undefined control sequence' errors.
2444 % Set the current font to be \nullfont, a TeX primitive, and define
2445 % all the font commands to also use \nullfont. We don't use
2446 % dummy.tfm, as suggested in the TeXbook, because not all sites
2447 % might have that installed. Therefore, math mode will still
2448 % produce output, but that should be an extremely small amount of
2449 % stuff compared to the main input.
2452 \let\tenrm=\nullfont \let\tenit=\nullfont \let\tensl=\nullfont
2453 \let\tenbf=\nullfont \let\tentt=\nullfont \let\smallcaps=\nullfont
2454 \let\tensf=\nullfont
2455 % Similarly for index fonts (mostly for their use in smallexample).
2456 \let\smallrm=\nullfont \let\smallit=\nullfont \let\smallsl=\nullfont
2457 \let\smallbf=\nullfont \let\smalltt=\nullfont \let\smallsc=\nullfont
2458 \let\smallsf=\nullfont
2460 % Don't complain when characters are missing from the fonts.
2461 \tracinglostchars = 0
2463 % Don't bother to do space factor calculations.
2466 % Don't report underfull hboxes.
2469 % Do minimal line-breaking.
2470 \pretolerance = 10000
2472 % Do not execute instructions in @tex
2473 \def\tex{\doignore{tex}}%
2474 % Do not execute macro definitions.
2475 % `c' is a comment character, so the word `macro' will get cut off.
2476 \def\macro{\doignore{ma}}%
2479 % @set VAR sets the variable VAR to an empty value.
2480 % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
2482 % Since we want to separate VAR from REST-OF-LINE (which might be
2483 % empty), we can't just use \parsearg; we have to insert a space of our
2484 % own to delimit the rest of the line, and then take it out again if we
2485 % didn't need it. Make sure the catcode of space is correct to avoid
2486 % losing inside @example, for instance.
2488 \def\set{\begingroup\catcode` =10
2489 \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR.
2491 \def\setxxx#1{\setyyy#1 \endsetyyy}
2492 \def\setyyy#1 #2\endsetyyy{%
2494 \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty
2495 \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted.
2499 % Can't use \xdef to pre-expand #2 and save some time, since \temp or
2500 % \next or other control sequences that we've defined might get us into
2501 % an infinite loop. Consider `@set foo @cite{bar}'.
2502 \def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}}
2504 % @clear VAR clears (i.e., unsets) the variable VAR.
2506 \def\clear{\parsearg\clearxxx}
2507 \def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax}
2509 % @value{foo} gets the text saved in variable foo.
2511 \catcode`\_ = \active
2513 % We might end up with active _ or - characters in the argument if
2514 % we're called from @code, as @code{@value{foo-bar_}}. So \let any
2515 % such active characters to their normal equivalents.
2516 \gdef\value{\begingroup
2517 \catcode`\-=12 \catcode`\_=12
2518 \indexbreaks \let_\normalunderscore
2521 \def\valuexxx#1{\expandablevalue{#1}\endgroup}
2523 % We have this subroutine so that we can handle at least some @value's
2524 % properly in indexes (we \let\value to this in \indexdummies). Ones
2525 % whose names contain - or _ still won't work, but we can't do anything
2526 % about that. The command has to be fully expandable, since the result
2527 % winds up in the index file. This means that if the variable's value
2528 % contains other Texinfo commands, it's almost certain it will fail
2529 % (although perhaps we could fix that with sufficient work to do a
2530 % one-level expansion on the result, instead of complete).
2532 \def\expandablevalue#1{%
2533 \expandafter\ifx\csname SET#1\endcsname\relax
2534 {[No value for ``#1'']}%
2536 \csname SET#1\endcsname
2540 % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
2543 \def\ifset{\parsearg\ifsetxxx}
2545 \expandafter\ifx\csname SET#1\endcsname\relax
2546 \expandafter\ifsetfail
2548 \expandafter\ifsetsucceed
2551 \def\ifsetsucceed{\conditionalsucceed{ifset}}
2552 \def\ifsetfail{\nestedignore{ifset}}
2553 \defineunmatchedend{ifset}
2555 % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
2556 % defined with @set, or has been undefined with @clear.
2558 \def\ifclear{\parsearg\ifclearxxx}
2559 \def\ifclearxxx #1{%
2560 \expandafter\ifx\csname SET#1\endcsname\relax
2561 \expandafter\ifclearsucceed
2563 \expandafter\ifclearfail
2566 \def\ifclearsucceed{\conditionalsucceed{ifclear}}
2567 \def\ifclearfail{\nestedignore{ifclear}}
2568 \defineunmatchedend{ifclear}
2570 % @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text
2571 % following, through the first @end iftex (etc.). Make `@end iftex'
2572 % (etc.) valid only after an @iftex.
2574 \def\iftex{\conditionalsucceed{iftex}}
2575 \def\ifnothtml{\conditionalsucceed{ifnothtml}}
2576 \def\ifnotinfo{\conditionalsucceed{ifnotinfo}}
2577 \defineunmatchedend{iftex}
2578 \defineunmatchedend{ifnothtml}
2579 \defineunmatchedend{ifnotinfo}
2581 % We can't just want to start a group at @iftex (for example) and end it
2582 % at @end iftex, since then @set commands inside the conditional have no
2583 % effect (they'd get reverted at the end of the group). So we must
2584 % define \Eiftex to redefine itself to be its previous value. (We can't
2585 % just define it to fail again with an ``unmatched end'' error, since
2586 % the @ifset might be nested.)
2588 \def\conditionalsucceed#1{%
2590 % Remember the current value of \E#1.
2591 \let\nece{prevE#1} = \nece{E#1}%
2593 % At the `@end #1', redefine \E#1 to be its previous value.
2594 \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}%
2599 % We need to expand lots of \csname's, but we don't want to expand the
2600 % control sequences after we've constructed them.
2602 \def\nece#1{\expandafter\noexpand\csname#1\endcsname}
2604 % @defininfoenclose.
2605 \let\definfoenclose=\comment
2609 % Index generation facilities
2611 % Define \newwrite to be identical to plain tex's \newwrite
2612 % except not \outer, so it can be used within \newindex.
2614 \gdef\newwrite{\alloc@7\write\chardef\sixt@@n}}
2616 % \newindex {foo} defines an index named foo.
2617 % It automatically defines \fooindex such that
2618 % \fooindex ...rest of line... puts an entry in the index foo.
2619 % It also defines \fooindfile to be the number of the output channel for
2620 % the file that accumulates this index. The file's extension is foo.
2621 % The name of an index should be no more than 2 characters long
2622 % for the sake of vms.
2626 \expandafter\newwrite \csname#1indfile\endcsname
2627 \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
2629 \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
2630 \noexpand\doindex{#1}}
2633 % @defindex foo == \newindex{foo}
2635 \def\defindex{\parsearg\newindex}
2637 % Define @defcodeindex, like @defindex except put all entries in @code.
2639 \def\defcodeindex{\parsearg\newcodeindex}
2641 \def\newcodeindex#1{%
2643 \expandafter\newwrite \csname#1indfile\endcsname
2644 \openout \csname#1indfile\endcsname \jobname.#1
2646 \expandafter\xdef\csname#1index\endcsname{%
2647 \noexpand\docodeindex{#1}}%
2651 % @synindex foo bar makes index foo feed into index bar.
2652 % Do this instead of @defindex foo if you don't want it as a separate index.
2654 % @syncodeindex foo bar similar, but put all entries made for in