1 % texinfo.tex -- TeX macros to handle Texinfo files.
2 % $Id: texinfo.tex,v 2.218 1998/07/22 10:59:56 drepper Exp $
4 % Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98
5 % Free Software Foundation, Inc.
7 % This texinfo.tex file is free software; you can redistribute it and/or
8 % modify it under the terms of the GNU General Public License as
9 % published by the Free Software Foundation; either version 2, or (at
10 % your option) any later version.
12 % This texinfo.tex file is distributed in the hope that it will be
13 % useful, but WITHOUT ANY WARRANTY; without even the implied warranty
14 % of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 % General Public License for more details.
17 % You should have received a copy of the GNU General Public License
18 % along with this texinfo.tex file; see the file COPYING. If not, write
19 % to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 % Boston, MA 02111-1307, USA.
22 % In other words, you are welcome to use, share and improve this program.
23 % You are forbidden to forbid anyone else to use, share and improve
24 % what you give them. Help stamp out software-hoarding!
26 % Please try the latest version of texinfo.tex before submitting bug
27 % reports; you can get the latest version from:
28 % ftp://ftp.gnu.org/pub/gnu/texinfo.tex
29 % /home/gd/gnu/doc/texinfo.tex on the GNU machines.
30 % (and all GNU mirrors, see ftp://ftp.gnu.org/pub/gnu/README.mirrors)
31 % ftp://tug.org/tex/texinfo.tex
32 % ftp://ctan.org/macros/texinfo/texinfo.tex
33 % (and all CTAN mirrors, finger ctan@tug.org for a list).
34 % The texinfo.tex in the texinfo distribution itself could well be out
35 % of date, so if that's what you're using, please check.
37 % Send bug reports to bug-texinfo@gnu.org.
38 % Please include a precise test case in each bug report,
39 % including a complete document with which we can reproduce the problem.
41 % To process a Texinfo manual with TeX, it's most reliable to use the
42 % texi2dvi shell script that comes with the distribution. For simple
43 % manuals, you can get away with:
48 % dvips foo.dvi -o # or whatever, to process the dvi file.
49 % The extra runs of TeX get the cross-reference information correct.
50 % Sometimes one run after texindex suffices, and sometimes you need more
51 % than two; texi2dvi does it as many times as necessary.
54 % Make it possible to create a .fmt file just by loading this file:
55 % if the underlying format is not loaded, start by loading it now.
56 % Added by gildea November 1993.
57 \expandafter\ifx\csname fmtname
\endcsname\relax\input plain
\fi
59 % This automatically updates the version number based on RCS.
60 \def\deftexinfoversion$
#1:
#2 $
{\def\texinfoversion{#2}}
61 \deftexinfoversion$Revision:
2.218 $
62 \message{Loading texinfo package
[Version
\texinfoversion]:
}
64 % If in a .fmt file, print the version number
65 % and turn on active characters that we couldn't do earlier because
66 % they might have appeared in the input file name.
67 \everyjob{\message{[Texinfo version
\texinfoversion]}\message{}
68 \catcode`+=
\active \catcode`
\_=
\active}
70 % Save some parts of plain tex whose names we will redefine.
73 \let\ptexbullet=
\bullet
87 % We never want plain's outer \+ definition in Texinfo.
88 % For @tex, we can use \tabalign.
95 % If this character appears in an error message or help string, it
96 % starts a new line in the output.
99 % Set up fixed words for English if not already set.
100 \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix
}\fi
101 \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter
}\fi
102 \ifx\putwordfile\undefined \gdef\putwordfile{file
}\fi
103 \ifx\putwordInfo\undefined \gdef\putwordInfo{Info
}\fi
104 \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on
}\fi
105 \ifx\putwordon\undefined \gdef\putwordon{on
}\fi
106 \ifx\putwordpage\undefined \gdef\putwordpage{page
}\fi
107 \ifx\putwordsection\undefined \gdef\putwordsection{section
}\fi
108 \ifx\putwordSection\undefined \gdef\putwordSection{Section
}\fi
109 \ifx\putwordsee\undefined \gdef\putwordsee{see
}\fi
110 \ifx\putwordSee\undefined \gdef\putwordSee{See
}\fi
111 \ifx\putwordShortContents\undefined \gdef\putwordShortContents{Short Contents
}\fi
112 \ifx\putwordTableofContents\undefined\gdef\putwordTableofContents{Table of Contents
}\fi
118 \hyphenation{ap-pen-dix
}
119 \hyphenation{mini-buf-fer mini-buf-fers
}
121 \hyphenation{white-space
}
123 % Margin to add to right of even pages, to left of odd pages.
124 \newdimen \bindingoffset
125 \newdimen \normaloffset
126 \newdimen\pagewidth \newdimen\pageheight
128 % Sometimes it is convenient to have everything in the transcript file
129 % and nothing on the terminal. We don't just call \tracingall here,
130 % since that produces some useless output on the terminal.
132 \def\gloggingall{\begingroup \globaldefs =
1 \loggingall \endgroup}%
133 \ifx\eTeXversion\undefined
134 \def\loggingall{\tracingcommands2 \tracingstats2
135 \tracingpages1 \tracingoutput1 \tracinglostchars1
136 \tracingmacros2 \tracingparagraphs1 \tracingrestores1
137 \showboxbreadth\maxdimen\showboxdepth\maxdimen
140 \def\loggingall{\tracingcommands3 \tracingstats2
141 \tracingpages1 \tracingoutput1 \tracinglostchars1
142 \tracingmacros2 \tracingparagraphs1 \tracingrestores1
143 \tracingscantokens1 \tracingassigns1 \tracingifs1
144 \tracinggroups1 \tracingnesting2
145 \showboxbreadth\maxdimen\showboxdepth\maxdimen
149 % For @cropmarks command.
150 % Do @cropmarks to get crop marks.
153 \let\cropmarks =
\cropmarkstrue
155 % Dimensions to add cropmarks at corners.
156 % Added by P. A. MacKay, 12 Nov. 1986
158 \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
159 \newdimen\cornerlong \cornerlong=
1pc
160 \newdimen\cornerthick \cornerthick=
.3pt
161 \newdimen\topandbottommargin \topandbottommargin=
.75in
163 % Main output routine.
165 \output =
{\onepageout{\pagecontents\PAGE}}
170 % \onepageout takes a vbox as an argument. Note that \pagecontents
171 % does insertions, but you have to call it yourself.
173 \ifcropmarks \hoffset=
0pt
\else \hoffset=
\normaloffset \fi
175 \ifodd\pageno \advance\hoffset by
\bindingoffset
176 \else \advance\hoffset by -
\bindingoffset\fi
178 % Do this outside of the \shipout so @code etc. will be expanded in
179 % the headline as they should be, not taken literally (outputting ''code).
180 \setbox\headlinebox =
\vbox{\let\hsize=
\pagewidth \makeheadline}%
181 \setbox\footlinebox =
\vbox{\let\hsize=
\pagewidth \makefootline}%
184 % Have to do this stuff outside the \shipout because we want it to
185 % take effect in \write's, yet the group defined by the \vbox ends
186 % before the \shipout runs.
188 \escapechar = `\\
% use backslash in output files.
189 \indexdummies % don't expand commands in the output.
190 \normalturnoffactive % \ in index entries must not stay \, e.g., if
191 % the page break happens to be in the middle of an example.
193 \ifcropmarks \vbox to
\outervsize\bgroup
195 \line{\ewtop\hfil\ewtop}%
198 \vbox{\moveleft\cornerthick\nstop}%
200 \vbox{\moveright\cornerthick\nstop}%
202 \vskip\topandbottommargin
204 \hfil % center the page within the outer (page) hsize.
205 \ifodd\pageno\hskip\bindingoffset\fi
211 \ifdim\ht\footlinebox >
0pt
212 % Only leave this space if the footline is nonempty.
213 % (We lessened \vsize for it in \oddfootingxxx.)
214 % The \baselineskip=24pt in plain's \makefootline has no effect.
215 \vskip 2\baselineskip
220 \egroup % end of \vbox\bgroup
221 \hfil\egroup % end of (centering) \line\bgroup
222 \vskip\topandbottommargin plus1fill minus1fill
223 \boxmaxdepth =
\cornerthick
225 \vbox{\moveleft\cornerthick\nsbot}%
227 \vbox{\moveright\cornerthick\nsbot}%
230 \line{\ewbot\hfil\ewbot}%
231 \egroup % \vbox from first cropmarks clause
233 }% end of \shipout\vbox
234 }% end of group with \turnoffactive
236 \ifnum\outputpenalty>-
20000 \else\dosupereject\fi
239 \newinsert\margin \dimen\margin=
\maxdimen
241 \def\pagebody#1{\vbox to
\pageheight{\boxmaxdepth=
\maxdepth #1}}
243 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
244 % marginal hacks, juha@viisa.uucp (Juha Takala)
245 \ifvoid\margin\else % marginal info is present
246 \rlap{\kern\hsize\vbox to
\z@
{\kern1pt\box\margin \vss}}\fi
247 \dimen@=
\dp#1 \unvbox#1
248 \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
249 \ifr@ggedbottom
\kern-
\dimen@
\vfil \fi}
252 % Here are the rules for the cropmarks. Note that they are
253 % offset so that the space between them is truly \outerhsize or \outervsize
254 % (P. A. MacKay, 12 November, 1986)
256 \def\ewtop{\vrule height
\cornerthick depth0pt width
\cornerlong}
258 {\hrule height
\cornerthick depth
\cornerlong width
\cornerthick}}
259 \def\ewbot{\vrule height0pt depth
\cornerthick width
\cornerlong}
261 {\hrule height
\cornerlong depth
\cornerthick width
\cornerthick}}
263 % Parse an argument, then pass it to #1. The argument is the rest of
264 % the input line (except we remove a trailing comment). #1 should be a
265 % macro which expects an ordinary undelimited TeX argument.
271 \futurelet\temp\parseargx
274 % If the next token is an obeyed space (from an @example environment or
275 % the like), remove it and recurse. Otherwise, we're done.
277 % \obeyedspace is defined far below, after the definition of \sepspaces.
278 \ifx\obeyedspace\temp
279 \expandafter\parseargdiscardspace
281 \expandafter\parseargline
285 % Remove a single space (as the delimiter token to the macro call).
287 \gdef\parseargdiscardspace {\futurelet\temp\parseargx}}
290 \gdef\parseargline#1^^M
{%
291 \endgroup % End of the group started in \parsearg.
293 % First remove any @c comment, then any @comment.
294 % Result of each macro is put in \toks0.
295 \argremovec #1\c\relax %
296 \expandafter\argremovecomment \the\toks0 \comment\relax %
298 % Call the caller's macro, saved as \next in \parsearg.
299 \expandafter\next\expandafter{\the\toks0}%
303 % Since all \c{,omment} does is throw away the argument, we can let TeX
304 % do that for us. The \relax here is matched by the \relax in the call
305 % in \parseargline; it could be more or less anything, its purpose is
306 % just to delimit the argument to the \c.
307 \def\argremovec#1\c#2\relax{\toks0 =
{#1}}
308 \def\argremovecomment#1\comment#2\relax{\toks0 =
{#1}}
310 % \argremovec{,omment} might leave us with trailing spaces, though; e.g.,
311 % @end itemize @c foo
312 % will have two active spaces as part of the argument with the
313 % `itemize'. Here we remove all active spaces from #1, and assign the
316 % This loses if there are any *other* active characters besides spaces
317 % in the argument -- _ ^ +, for example -- since they get expanded.
318 % Fortunately, Texinfo does not define any such commands. (If it ever
319 % does, the catcode of the characters in questionwill have to be changed
320 % here.) But this means we cannot call \removeactivespaces as part of
321 % \argremovec{,omment}, since @c uses \parsearg, and thus the argument
322 % that \parsearg gets might well have any character at all in it.
324 \def\removeactivespaces#1{%
328 \global\toks0 =
\expandafter{\temp}%
332 % Change the active space to expand to nothing.
336 \gdef\ignoreactivespaces{\obeyspaces\let =
\empty}
340 \def\flushcr{\ifx\par\lisppar \def\next#
#1{}\else \let\next=
\relax \fi \next}
342 %% These are used to keep @begin/@end levels from running away
343 %% Call \inENV within environments (after a \begingroup)
344 \newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
346 \ifENV\errmessage{Still within an environment. Type Return to continue.
}
347 \endgroup\fi} % This is not perfect, but it should reduce lossage
349 % @begin foo is the same as @foo, for now.
350 \newhelp\EMsimple{Type <Return> to continue.
}
352 \outer\def\begin{\parsearg\beginxxx}
355 \expandafter\ifx\csname #1\endcsname\relax
356 {\errhelp=
\EMsimple \errmessage{Undefined command @begin
#1}}\else
357 \csname #1\endcsname\fi}
359 % @end foo executes the definition of \Efoo.
361 \def\end{\parsearg\endxxx}
363 \removeactivespaces{#1}%
364 \edef\endthing{\the\toks0}%
366 \expandafter\ifx\csname E
\endthing\endcsname\relax
367 \expandafter\ifx\csname \endthing\endcsname\relax
368 % There's no \foo, i.e., no ``environment'' foo.
370 \errmessage{Undefined command `@end
\endthing'
}%
372 \unmatchedenderror\endthing
375 % Everything's ok; the right environment has been started.
376 \csname E
\endthing\endcsname
380 % There is an environment #1, but it hasn't been started. Give an error.
382 \def\unmatchedenderror#1{%
384 \errmessage{This `@end
#1' doesn't have a matching `@
#1'
}%
387 % Define the control sequence \E#1 to give an unmatched @end error.
389 \def\defineunmatchedend#1{%
390 \expandafter\def\csname E
#1\endcsname{\unmatchedenderror{#1}}%
394 % Single-spacing is done by various environments (specifically, in
395 % \nonfillstart and \quotations).
396 \newskip\singlespaceskip \singlespaceskip =
12.5pt
398 % Why was this kern here? It messes up equalizing space above and below
399 % environments. --karl, 6may93
400 %{\advance \baselineskip by -\singlespaceskip
401 %\kern \baselineskip}%
402 \setleading \singlespaceskip
405 %% Simple single-character @ commands
408 % Kludge this until the fonts are right (grr).
411 % This is turned off because it was never documented
412 % and you can use @w{...} around a quote to suppress ligatures.
413 %% Define @` and @' to be the same as ` and '
414 %% but suppressing ligatures.
418 % Used to generate quoted braces.
419 \def\mylbrace {{\tt\char123}}
420 \def\myrbrace {{\tt\char125}}
424 % Definitions to produce actual \{ & \} command in an index.
425 \catcode`\
{ =
12 \catcode`\
} =
12
426 \catcode`\
[ =
1 \catcode`\
] =
2
427 \catcode`\@ =
0 \catcode`\\ =
12
432 % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
433 % Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H.
436 \def\ringaccent#1{{\accent23 #1}}
441 % Other special characters: @questiondown @exclamdown
442 % Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss.
443 \def\questiondown{?`
}
446 % Dotless i and dotless j, used for accents.
451 \ifx\temp\imacro \ptexi
452 \else\ifx\temp\jmacro \j
453 \else \errmessage{@dotless can be used only with i or j
}%
457 % Be sure we're in horizontal mode when doing a tie, since we make space
458 % equivalent to this in @example-like environments. Otherwise, a space
459 % at the beginning of a line will start with \penalty -- and
460 % since \penalty is valid in vertical mode, we'd end up putting the
461 % penalty on the vertical list instead of in the new paragraph.
463 % Avoid using \@M directly, because that causes trouble
464 % if the definition is written into an index file.
465 \global\let\tiepenalty = \@M
466 \gdef\tie{\leavevmode\penalty\tiepenalty\
}
469 % @: forces normal size whitespace following.
470 \def\:
{\spacefactor=
1000 }
472 % @* forces a line break.
473 \def\*
{\hfil\break\hbox{}\ignorespaces}
475 % @. is an end-of-sentence period.
476 \def\.
{.
\spacefactor=
3000 }
478 % @! is an end-of-sentence bang.
479 \def\!
{!
\spacefactor=
3000 }
481 % @? is an end-of-sentence query.
482 \def\?
{?
\spacefactor=
3000 }
484 % @w prevents a word break. Without the \leavevmode, @w at the
485 % beginning of a paragraph, when TeX is still in vertical mode, would
486 % produce a whole line of output instead of starting the paragraph.
487 \def\w#1{\leavevmode\hbox{#1}}
489 % @group ... @end group forces ... to be all on one page, by enclosing
490 % it in a TeX vbox. We use \vtop instead of \vbox to construct the box
491 % to keep its height that of a normal line. According to the rules for
492 % \topskip (p.114 of the TeXbook), the glue inserted is
493 % max (\topskip - \ht (first item), 0). If that height is large,
494 % therefore, no glue is inserted, and the space between the headline and
495 % the text is small, which looks bad.
497 \def\group{\begingroup
498 \ifnum\catcode13=
\active \else
499 \errhelp =
\groupinvalidhelp
500 \errmessage{@group invalid in context where filling is enabled
}%
503 % The \vtop we start below produces a box with normal height and large
504 % depth; thus, TeX puts \baselineskip glue before it, and (when the
505 % next line of text is done) \lineskip glue after it. (See p.82 of
506 % the TeXbook.) Thus, space below is not quite equal to space
507 % above. But it's pretty close.
509 \egroup % End the \vtop.
510 \endgroup % End the \group.
514 % We have to put a strut on the last line in case the @group is in
515 % the midst of an example, rather than completely enclosing it.
516 % Otherwise, the interline space between the last line of the group
517 % and the first line afterwards is too small. But we can't put the
518 % strut in \Egroup, since there it would be on a line by itself.
519 % Hence this just inserts a strut at the beginning of each line.
520 \everypar =
{\strut}%
522 % Since we have a strut on every line, we don't need any of TeX's
523 % normal interline spacing.
526 % OK, but now we have to do something about blank
527 % lines in the input in @example-like environments, which normally
528 % just turn into \lisppar, which will insert no space now that we've
529 % turned off the interline space. Simplest is to make them be an
532 \edef\par{\leavevmode \par}%
534 % Reset ^^M's definition to new definition of \par.
538 % Do @comment since we are called inside an environment such as
539 % @example, where each end-of-line in the input causes an
540 % end-of-line in the output. We don't want the end-of-line after
541 % the `@group' to put extra space in the output. Since @group
542 % should appear on a line by itself (according to the Texinfo
543 % manual), we don't worry about eating any user text.
547 % TeX puts in an \escapechar (i.e., `@') at the beginning of the help
548 % message, so this ends up printing `@group can only ...'.
550 \newhelp\groupinvalidhelp{%
551 group can only be used in environments such as @example,^^J
%
552 where each line of input produces a line of output.
}
554 % @need space-in-mils
555 % forces a page break if there is not space-in-mils remaining.
557 \newdimen\mil \mil=
0.001in
559 \def\need{\parsearg\needx}
561 % Old definition--didn't work.
562 %\def\needx #1{\par %
563 %% This method tries to make TeX break the page naturally
564 %% if the depth of the box does not fit.
566 %\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak
571 % Go into vertical mode, so we don't make a big box in the middle of a
575 % Don't add any leading before our big empty box, but allow a page
576 % break, since the best break might be right here.
579 \vtop to
#1\mil{\vfil}%
581 % TeX does not even consider page breaks if a penalty added to the
582 % main vertical list is 10000 or more. But in order to see if the
583 % empty box we just added fits on the page, we must make it consider
584 % page breaks. On the other hand, we don't want to actually break the
585 % page after the empty box. So we use a penalty of 9999.
587 % There is an extremely small chance that TeX will actually break the
588 % page at this \penalty, if there are no other feasible breakpoints in
589 % sight. (If the user is using lots of big @group commands, which
590 % almost-but-not-quite fill up a page, TeX will have a hard time doing
591 % good page breaking, for example.) However, I could not construct an
592 % example where a page broke at this \penalty; if it happens in a real
593 % document, then we can reconsider our strategy.
596 % Back up by the size of the box, whether we did a page break or not.
599 % Do not allow a page break right after this kern.
603 % @br forces paragraph break
607 % @dots{} output an ellipsis using the current font.
608 % We do .5em per period so that it has the same spacing in a typewriter
609 % font as three actual period characters.
614 \hskip 0pt plus
0.25fil minus
0.25fil
616 \hskip 0pt plus
0.5fil minus
0.5fil
620 % @enddots{} is an end-of-sentence ellipsis.
625 \hskip 0pt plus
0.25fil minus
0.25fil
627 \hskip 0pt plus
0.5fil minus
0.5fil
633 % @page forces the start of a new page
635 \def\page{\par\vfill\supereject}
638 % outputs text on separate line in roman font, starting at standard page margin
640 % This records the amount of indent in the innermost environment.
641 % That's how much \exdent should take out.
642 \newskip\exdentamount
644 % This defn is used inside fill environments such as @defun.
645 \def\exdent{\parsearg\exdentyyy}
646 \def\exdentyyy #1{{\hfil\break\hbox{\kern -
\exdentamount{\rm#1}}\hfil\break}}
648 % This defn is used inside nofill environments such as @example.
649 \def\nofillexdent{\parsearg\nofillexdentyyy}
650 \def\nofillexdentyyy #1{{\advance \leftskip by -
\exdentamount
651 \leftline{\hskip\leftskip{\rm#1}}}}
653 % @inmargin{TEXT} puts TEXT in the margin next to the current paragraph.
656 \strut\vadjust{\nobreak\kern-
\strutdepth
657 \vtop to
\strutdepth{\baselineskip\strutdepth\vss
658 \llap{\rightskip=
\inmarginspacing \vbox{\noindent #1}}\null}}}
659 \newskip\inmarginspacing \inmarginspacing=
1cm
660 \def\strutdepth{\dp\strutbox}
662 %\hbox{{\rm#1}}\hfil\break}}
664 % @include file insert text of that file as input.
665 % Allow normal characters that we make active in the argument (a file name).
666 \def\include{\begingroup
675 \parsearg\includezzz}
676 % Restore active chars for included file.
677 \def\includezzz#1{\endgroup\begingroup
678 % Read the included file in a group so nested @include's work.
685 % @center line outputs that line, centered
687 \def\center{\parsearg\centerzzz}
688 \def\centerzzz #1{{\advance\hsize by -
\leftskip
689 \advance\hsize by -
\rightskip
692 % @sp n outputs n lines of vertical space
694 \def\sp{\parsearg\spxxx}
695 \def\spxxx #1{\vskip #1\baselineskip}
697 % @comment ...line which is ignored...
698 % @c is the same as @comment
699 % @ignore ... @end ignore is another way to write a comment
701 \def\comment{\begingroup \catcode`\^^M=
\other%
702 \catcode`\@=
\other \catcode`\
{=
\other \catcode`\
}=
\other%
704 {\catcode`\^^M=
\other \gdef\commentxxx#1^^M
{\endgroup}}
708 % @paragraphindent is defined for the Info formatting commands only.
709 \let\paragraphindent=
\comment
711 % Prevent errors for section commands.
712 % Used in @ignore and in failing conditionals.
713 \def\ignoresections{%
715 \let\unnumbered=
\relax
717 \let\unnumberedsec=
\relax
718 \let\unnumberedsection=
\relax
719 \let\unnumberedsubsec=
\relax
720 \let\unnumberedsubsection=
\relax
721 \let\unnumberedsubsubsec=
\relax
722 \let\unnumberedsubsubsection=
\relax
725 \let\subsubsec=
\relax
726 \let\subsection=
\relax
727 \let\subsubsection=
\relax
729 \let\appendixsec=
\relax
730 \let\appendixsection=
\relax
731 \let\appendixsubsec=
\relax
732 \let\appendixsubsection=
\relax
733 \let\appendixsubsubsec=
\relax
734 \let\appendixsubsubsection=
\relax
736 \let\smallbook=
\relax
737 \let\titlepage=
\relax
740 % Used in nested conditionals, where we have to parse the Texinfo source
741 % and so want to turn off most commands, in case they are used
744 \def\ignoremorecommands{%
745 \let\defcodeindex =
\relax
749 \let\defindex =
\relax
750 \let\defivar =
\relax
752 \let\defmethod =
\relax
755 \let\defspec =
\relax
757 \let\deftypefn =
\relax
758 \let\deftypefun =
\relax
759 \let\deftypevar =
\relax
760 \let\deftypevr =
\relax
766 \let\printindex =
\relax
768 \let\settitle =
\relax
769 \let\setchapternewpage =
\relax
770 \let\setchapterstyle =
\relax
771 \let\everyheading =
\relax
772 \let\evenheading =
\relax
773 \let\oddheading =
\relax
774 \let\everyfooting =
\relax
775 \let\evenfooting =
\relax
776 \let\oddfooting =
\relax
777 \let\headings =
\relax
778 \let\include =
\relax
779 \let\lowersections =
\relax
781 \let\raisesections =
\relax
788 % Ignore @ignore ... @end ignore.
790 \def\ignore{\doignore{ignore
}}
792 % Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text.
794 \def\ifinfo{\doignore{ifinfo
}}
795 \def\ifhtml{\doignore{ifhtml
}}
796 \def\ifnottex{\doignore{ifnottex
}}
797 \def\html{\doignore{html
}}
798 \def\menu{\doignore{menu
}}
799 \def\direntry{\doignore{direntry
}}
801 % @dircategory CATEGORY -- specify a category of the dir file
802 % which this file should belong to. Ignore this in TeX.
803 \let\dircategory =
\comment
805 % Ignore text until a line `@end #1'.
807 \def\doignore#1{\begingroup
808 % Don't complain about control sequences we have declared \outer.
811 % Define a command to swallow text until we reach `@end #1'.
812 % This @ is a catcode 12 token (that is the normal catcode of @ in
813 % this texinfo.tex file). We change the catcode of @ below to match.
814 \long\def\doignoretext#
#1@end
#1{\enddoignore}%
816 % Make sure that spaces turn into tokens that match what \doignoretext wants.
819 % Ignore braces, too, so mismatched braces don't cause trouble.
823 % We must not have @c interpreted as a control sequence.
826 % Make the letter c a comment character so that the rest of the line
827 % will be ignored. This way, the document can have (for example)
829 % and the @end ifinfo will be properly ignored.
830 % (We've just changed @ to catcode 12.)
833 % And now expand that command.
837 % What we do to finish off ignored text.
839 \def\enddoignore{\endgroup\ignorespaces}%
841 \newif\ifwarnedobs\warnedobsfalse
843 \ifwarnedobs\relax\else
844 % We need to warn folks that they may have trouble with TeX 3.0.
845 % This uses \immediate\write16 rather than \message to get newlines.
847 \immediate\write16{***WARNING*** for users of Unix TeX
3.0!
}
848 \immediate\write16{This manual trips a bug in TeX version
3.0 (tex hangs).
}
849 \immediate\write16{If you are running another version of TeX, relax.
}
850 \immediate\write16{If you are running Unix TeX
3.0, kill this TeX process.
}
851 \immediate\write16{ Then upgrade your TeX installation if you can.
}
852 \immediate\write16{ (See ftp://ftp.gnu.ai.mit.edu/pub/gnu/TeX.README.)
}
853 \immediate\write16{If you are stuck with version
3.0, run the
}
854 \immediate\write16{ script ``tex3patch'' from the Texinfo distribution
}
855 \immediate\write16{ to use a workaround.
}
857 \global\warnedobstrue
861 % **In TeX 3.0, setting text in \nullfont hangs tex. For a
862 % workaround (which requires the file ``dummy.tfm'' to be installed),
863 % uncomment the following line:
864 %%%%%\font\nullfont=dummy\let\obstexwarn=\relax
866 % Ignore text, except that we keep track of conditional commands for
867 % purposes of nesting, up to an `@end #1' command.
869 \def\nestedignore#1{%
871 % We must actually expand the ignored text to look for the @end
872 % command, so that nested ignore constructs work. Thus, we put the
873 % text into a \vbox and then do nothing with the result. To minimize
874 % the change of memory overflow, we follow the approach outlined on
875 % page 401 of the TeXbook: make the current font be a dummy font.
877 \setbox0 =
\vbox\bgroup
878 % Don't complain about control sequences we have declared \outer.
881 % Define `@end #1' to end the box, which will in turn undefine the
882 % @end command again.
883 \expandafter\def\csname E
#1\endcsname{\egroup\ignorespaces}%
885 % We are going to be parsing Texinfo commands. Most cause no
886 % trouble when they are used incorrectly, but some commands do
887 % complicated argument parsing or otherwise get confused, so we
890 % We can't do anything about stray @-signs, unfortunately;
891 % they'll produce `undefined control sequence' errors.
894 % Set the current font to be \nullfont, a TeX primitive, and define
895 % all the font commands to also use \nullfont. We don't use
896 % dummy.tfm, as suggested in the TeXbook, because not all sites
897 % might have that installed. Therefore, math mode will still
898 % produce output, but that should be an extremely small amount of
899 % stuff compared to the main input.
902 \let\tenrm =
\nullfont \let\tenit =
\nullfont \let\tensl =
\nullfont
903 \let\tenbf =
\nullfont \let\tentt =
\nullfont \let\smallcaps =
\nullfont
904 \let\tensf =
\nullfont
905 % Similarly for index fonts (mostly for their use in
907 \let\indrm =
\nullfont \let\indit =
\nullfont \let\indsl =
\nullfont
908 \let\indbf =
\nullfont \let\indtt =
\nullfont \let\indsc =
\nullfont
909 \let\indsf =
\nullfont
911 % Don't complain when characters are missing from the fonts.
912 \tracinglostchars =
0
914 % Don't bother to do space factor calculations.
917 % Don't report underfull hboxes.
920 % Do minimal line-breaking.
921 \pretolerance =
10000
923 % Do not execute instructions in @tex
924 \def\tex{\doignore{tex
}}%
925 % Do not execute macro definitions.
926 % `c' is a comment character, so the word `macro' will get cut off.
927 \def\macro{\doignore{ma
}}%
930 % @set VAR sets the variable VAR to an empty value.
931 % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
933 % Since we want to separate VAR from REST-OF-LINE (which might be
934 % empty), we can't just use \parsearg; we have to insert a space of our
935 % own to delimit the rest of the line, and then take it out again if we
936 % didn't need it. Make sure the catcode of space is correct to avoid
937 % losing inside @example, for instance.
939 \def\set{\begingroup\catcode` =
10
940 \catcode`\-=
12 \catcode`
\_=
12 % Allow - and _ in VAR.
942 \def\setxxx#1{\setyyy#1 \endsetyyy}
943 \def\setyyy#1 #2\endsetyyy{%
945 \ifx\temp\empty \global\expandafter\let\csname SET
#1\endcsname =
\empty
946 \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted.
950 % Can't use \xdef to pre-expand #2 and save some time, since \temp or
951 % \next or other control sequences that we've defined might get us into
952 % an infinite loop. Consider `@set foo @cite{bar}'.
953 \def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET
#1\endcsname{#2}}
955 % @clear VAR clears (i.e., unsets) the variable VAR.
957 \def\clear{\parsearg\clearxxx}
958 \def\clearxxx#1{\global\expandafter\let\csname SET
#1\endcsname=
\relax}
960 % @value{foo} gets the text saved in variable foo.
962 \def\value{\begingroup
963 \catcode`\-=
12 \catcode`
\_=
12 % Allow - and _ in VAR.
965 \def\valuexxx#1{\expandablevalue{#1}\endgroup}
967 % We have this subroutine so that we can handle at least some @value's
968 % properly in indexes (we \let\value to this in \indexdummies). Ones
969 % whose names contain - or _ still won't work, but we can't do anything
970 % about that. The command has to be fully expandable, since the result
971 % winds up in the index file. This means that if the variable's value
972 % contains other Texinfo commands, it's almost certain it will fail
973 % (although perhaps we could fix that with sufficient work to do a
974 % one-level expansion on the result, instead of complete).
976 \def\expandablevalue#1{%
977 \expandafter\ifx\csname SET
#1\endcsname\relax
978 {[No value for ``
#1''
]v
}%
980 \csname SET
#1\endcsname
984 % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
987 \def\ifset{\parsearg\ifsetxxx}
989 \expandafter\ifx\csname SET
#1\endcsname\relax
990 \expandafter\ifsetfail
992 \expandafter\ifsetsucceed
995 \def\ifsetsucceed{\conditionalsucceed{ifset
}}
996 \def\ifsetfail{\nestedignore{ifset
}}
997 \defineunmatchedend{ifset
}
999 % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
1000 % defined with @set, or has been undefined with @clear.
1002 \def\ifclear{\parsearg\ifclearxxx}
1003 \def\ifclearxxx #1{%
1004 \expandafter\ifx\csname SET
#1\endcsname\relax
1005 \expandafter\ifclearsucceed
1007 \expandafter\ifclearfail
1010 \def\ifclearsucceed{\conditionalsucceed{ifclear
}}
1011 \def\ifclearfail{\nestedignore{ifclear
}}
1012 \defineunmatchedend{ifclear
}
1014 % @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text
1015 % following, through the first @end iftex (etc.). Make `@end iftex'
1016 % (etc.) valid only after an @iftex.
1018 \def\iftex{\conditionalsucceed{iftex
}}
1019 \def\ifnothtml{\conditionalsucceed{ifnothtml
}}
1020 \def\ifnotinfo{\conditionalsucceed{ifnotinfo
}}
1021 \defineunmatchedend{iftex
}
1022 \defineunmatchedend{ifnothtml
}
1023 \defineunmatchedend{ifnotinfo
}
1025 % We can't just want to start a group at @iftex (for example) and end it
1026 % at @end iftex, since then @set commands inside the conditional have no
1027 % effect (they'd get reverted at the end of the group). So we must
1028 % define \Eiftex to redefine itself to be its previous value. (We can't
1029 % just define it to fail again with an ``unmatched end'' error, since
1030 % the @ifset might be nested.)
1032 \def\conditionalsucceed#1{%
1034 % Remember the current value of \E#1.
1035 \let\nece{prevE
#1} =
\nece{E
#1}%
1037 % At the `@end #1', redefine \E#1 to be its previous value.
1038 \def\nece{E
#1}{\let\nece{E
#1} =
\nece{prevE
#1}}%
1043 % We need to expand lots of \csname's, but we don't want to expand the
1044 % control sequences after we've constructed them.
1046 \def\nece#1{\expandafter\noexpand\csname#1\endcsname}
1048 % @asis just yields its argument. Used with @table, for example.
1052 % @math means output in math mode.
1053 % We don't use $'s directly in the definition of \math because control
1054 % sequences like \math are expanded when the toc file is written. Then,
1055 % we read the toc file back, the $'s will be normal characters (as they
1056 % should be, according to the definition of Texinfo). So we must use a
1057 % control sequence to switch into and out of math mode.
1059 % This isn't quite enough for @math to work properly in indices, but it
1060 % seems unlikely it will ever be needed there.
1062 \let\implicitmath = $
1063 \def\math#1{\implicitmath #1\implicitmath}
1065 % @bullet and @minus need the same treatment as @math, just above.
1066 \def\bullet{\implicitmath\ptexbullet\implicitmath}
1067 \def\minus{\implicitmath-
\implicitmath}
1069 % @refill is a no-op.
1072 % If working on a large document in chapters, it is convenient to
1073 % be able to disable indexing, cross-referencing, and contents, for test runs.
1074 % This is done with @novalidate (before @setfilename).
1076 \newif\iflinks \linkstrue % by default we want the aux files.
1077 \let\novalidate =
\linksfalse
1079 % @setfilename is done at the beginning of every texinfo file.
1080 % So open here the files we need to have open while reading the input.
1081 % This makes it possible to make a .fmt file for texinfo.
1085 \fi % \openindices needs to do some work in any case.
1087 \fixbackslash % Turn off hack to swallow `\input texinfo'.
1088 \global\let\setfilename=
\comment % Ignore extra @setfilename cmds.
1090 % If texinfo.cnf is present on the system, read it.
1091 % Useful for site-wide @afourpaper, etc.
1092 % Just to be on the safe side, close the input stream before the \input.
1093 \openin 1 texinfo.cnf
1094 \ifeof1 \let\temp=
\relax \else \def\temp{\input texinfo.cnf
}\fi
1098 \comment % Ignore the actual filename.
1101 % Called from \setfilename.
1113 \outer\def\bye{\pagealignmacro\tracingstats=
1\ptexend}
1117 % Font-change commands.
1119 % Texinfo sort of supports the sans serif font style, which plain TeX does not.
1120 % So we set up a \sf analogous to plain's \rm, etc.
1122 \def\sf{\fam=
\sffam \tensf}
1123 \let\li =
\sf % Sometimes we call it \li, not \sf.
1125 % We don't need math for this one.
1128 % Use Computer Modern fonts at \magstephalf (11pt).
1129 \newcount\mainmagstep
1130 \mainmagstep=
\magstephalf
1132 % Set the font macro #1 to the font named #2, adding on the
1133 % specified font prefix (normally `cm').
1134 % #3 is the font's design size, #4 is a scale factor
1135 \def\setfont#1#2#3#4{\font#1=
\fontprefix#2#3 scaled
#4}
1137 % Use cm as the default font prefix.
1138 % To specify the font prefix, you must define \fontprefix
1139 % before you read in texinfo.tex.
1140 \ifx\fontprefix\undefined
1143 % Support font families that don't use the same naming scheme as CM.
1145 \def\rmbshape{bx
} %where the normal face is bold
1150 \def\ttslshape{sltt
}
1161 \let\mainmagstep=
\magstep1
1162 \setfont\textrm\rmshape{12}{1000}
1163 \setfont\texttt\ttshape{12}{1000}
1165 \setfont\textrm\rmshape{10}{\mainmagstep}
1166 \setfont\texttt\ttshape{10}{\mainmagstep}
1168 % Instead of cmb10, you many want to use cmbx10.
1169 % cmbx10 is a prettier font on its own, but cmb10
1170 % looks better when embedded in a line with cmr10.
1171 \setfont\textbf\bfshape{10}{\mainmagstep}
1172 \setfont\textit\itshape{10}{\mainmagstep}
1173 \setfont\textsl\slshape{10}{\mainmagstep}
1174 \setfont\textsf\sfshape{10}{\mainmagstep}
1175 \setfont\textsc\scshape{10}{\mainmagstep}
1176 \setfont\textttsl\ttslshape{10}{\mainmagstep}
1177 \font\texti=cmmi10 scaled
\mainmagstep
1178 \font\textsy=cmsy10 scaled
\mainmagstep
1180 % A few fonts for @defun, etc.
1181 \setfont\defbf\bxshape{10}{\magstep1} %was 1314
1182 \setfont\deftt\ttshape{10}{\magstep1}
1183 \def\df{\let\tentt=
\deftt \let\tenbf =
\defbf \bf}
1185 % Fonts for indices and small examples (9pt).
1186 % We actually use the slanted font rather than the italic,
1187 % because texinfo normally uses the slanted fonts for that.
1188 % Do not make many font distinctions in general in the index, since they
1189 % aren't very useful.
1190 \setfont\ninett\ttshape{9}{1000}
1191 \setfont\ninettsl\ttslshape{10}{900}
1192 \setfont\indrm\rmshape{9}{1000}
1193 \setfont\indit\slshape{9}{1000}
1196 \let\indttsl=
\ninettsl
1199 \setfont\indsc\scshape{10}{900}
1203 % Fonts for title page:
1204 \setfont\titlerm\rmbshape{12}{\magstep3}
1205 \setfont\titleit\itbshape{10}{\magstep4}
1206 \setfont\titlesl\slbshape{10}{\magstep4}
1207 \setfont\titlett\ttbshape{12}{\magstep3}
1208 \setfont\titlettsl\ttslshape{10}{\magstep4}
1209 \setfont\titlesf\sfbshape{17}{\magstep1}
1210 \let\titlebf=
\titlerm
1211 \setfont\titlesc\scbshape{10}{\magstep4}
1212 \font\titlei=cmmi12 scaled
\magstep3
1213 \font\titlesy=cmsy10 scaled
\magstep4
1214 \def\authorrm{\secrm}
1216 % Chapter (and unnumbered) fonts (17.28pt).
1217 \setfont\chaprm\rmbshape{12}{\magstep2}
1218 \setfont\chapit\itbshape{10}{\magstep3}
1219 \setfont\chapsl\slbshape{10}{\magstep3}
1220 \setfont\chaptt\ttbshape{12}{\magstep2}
1221 \setfont\chapttsl\ttslshape{10}{\magstep3}
1222 \setfont\chapsf\sfbshape{17}{1000}
1224 \setfont\chapsc\scbshape{10}{\magstep3}
1225 \font\chapi=cmmi12 scaled
\magstep2
1226 \font\chapsy=cmsy10 scaled
\magstep3
1228 % Section fonts (14.4pt).
1229 \setfont\secrm\rmbshape{12}{\magstep1}
1230 \setfont\secit\itbshape{10}{\magstep2}
1231 \setfont\secsl\slbshape{10}{\magstep2}
1232 \setfont\sectt\ttbshape{12}{\magstep1}
1233 \setfont\secttsl\ttslshape{10}{\magstep2}
1234 \setfont\secsf\sfbshape{12}{\magstep1}
1236 \setfont\secsc\scbshape{10}{\magstep2}
1237 \font\seci=cmmi12 scaled
\magstep1
1238 \font\secsy=cmsy10 scaled
\magstep2
1240 % \setfont\ssecrm\bxshape{10}{\magstep1} % This size an font looked bad.
1241 % \setfont\ssecit\itshape{10}{\magstep1} % The letters were too crowded.
1242 % \setfont\ssecsl\slshape{10}{\magstep1}
1243 % \setfont\ssectt\ttshape{10}{\magstep1}
1244 % \setfont\ssecsf\sfshape{10}{\magstep1}
1246 %\setfont\ssecrm\bfshape{10}{1315} % Note the use of cmb rather than cmbx.
1247 %\setfont\ssecit\itshape{10}{1315} % Also, the size is a little larger than
1248 %\setfont\ssecsl\slshape{10}{1315} % being scaled magstep1.
1249 %\setfont\ssectt\ttshape{10}{1315}
1250 %\setfont\ssecsf\sfshape{10}{1315}
1252 %\let\ssecbf=\ssecrm
1254 % Subsection fonts (13.15pt).
1255 \setfont\ssecrm\rmbshape{12}{\magstephalf}
1256 \setfont\ssecit\itbshape{10}{1315}
1257 \setfont\ssecsl\slbshape{10}{1315}
1258 \setfont\ssectt\ttbshape{12}{\magstephalf}
1259 \setfont\ssecttsl\ttslshape{10}{1315}
1260 \setfont\ssecsf\sfbshape{12}{\magstephalf}
1262 \setfont\ssecsc\scbshape{10}{\magstep1}
1263 \font\sseci=cmmi12 scaled
\magstephalf
1264 \font\ssecsy=cmsy10 scaled
1315
1265 % The smallcaps and symbol fonts should actually be scaled \magstep1.5,
1266 % but that is not a standard magnification.
1268 % In order for the font changes to affect most math symbols and letters,
1269 % we have to define the \textfont of the standard families. Since
1270 % texinfo doesn't allow for producing subscripts and superscripts, we
1271 % don't bother to reset \scriptfont and \scriptscriptfont (which would
1272 % also require loading a lot more fonts).
1274 \def\resetmathfonts{%
1275 \textfont0 =
\tenrm \textfont1 =
\teni \textfont2 =
\tensy
1276 \textfont\itfam =
\tenit \textfont\slfam =
\tensl \textfont\bffam =
\tenbf
1277 \textfont\ttfam =
\tentt \textfont\sffam =
\tensf
1281 % The font-changing commands redefine the meanings of \tenSTYLE, instead
1282 % of just \STYLE. We do this so that font changes will continue to work
1283 % in math mode, where it is the current \fam that is relevant in most
1284 % cases, not the current font. Plain TeX does \def\bf{\fam=\bffam
1285 % \tenbf}, for example. By redefining \tenbf, we obviate the need to
1286 % redefine \bf itself.
1288 \let\tenrm=
\textrm \let\tenit=
\textit \let\tensl=
\textsl
1289 \let\tenbf=
\textbf \let\tentt=
\texttt \let\smallcaps=
\textsc
1290 \let\tensf=
\textsf \let\teni=
\texti \let\tensy=
\textsy \let\tenttsl=
\textttsl
1293 \let\tenrm=
\titlerm \let\tenit=
\titleit \let\tensl=
\titlesl
1294 \let\tenbf=
\titlebf \let\tentt=
\titlett \let\smallcaps=
\titlesc
1295 \let\tensf=
\titlesf \let\teni=
\titlei \let\tensy=
\titlesy
1296 \let\tenttsl=
\titlettsl
1297 \resetmathfonts \setleading{25pt
}}
1298 \def\titlefont#1{{\titlefonts\rm #1}}
1300 \let\tenrm=
\chaprm \let\tenit=
\chapit \let\tensl=
\chapsl
1301 \let\tenbf=
\chapbf \let\tentt=
\chaptt \let\smallcaps=
\chapsc
1302 \let\tensf=
\chapsf \let\teni=
\chapi \let\tensy=
\chapsy \let\tenttsl=
\chapttsl
1303 \resetmathfonts \setleading{19pt
}}
1305 \let\tenrm=
\secrm \let\tenit=
\secit \let\tensl=
\secsl
1306 \let\tenbf=
\secbf \let\tentt=
\sectt \let\smallcaps=
\secsc
1307 \let\tensf=
\secsf \let\teni=
\seci \let\tensy=
\secsy \let\tenttsl=
\secttsl
1308 \resetmathfonts \setleading{16pt
}}
1310 \let\tenrm=
\ssecrm \let\tenit=
\ssecit \let\tensl=
\ssecsl
1311 \let\tenbf=
\ssecbf \let\tentt=
\ssectt \let\smallcaps=
\ssecsc
1312 \let\tensf=
\ssecsf \let\teni=
\sseci \let\tensy=
\ssecsy \let\tenttsl=
\ssecttsl
1313 \resetmathfonts \setleading{15pt
}}
1314 \let\subsubsecfonts =
\subsecfonts % Maybe make sssec fonts scaled magstephalf?
1316 \let\tenrm=
\indrm \let\tenit=
\indit \let\tensl=
\indsl
1317 \let\tenbf=
\indbf \let\tentt=
\indtt \let\smallcaps=
\indsc
1318 \let\tensf=
\indsf \let\teni=
\indi \let\tensy=
\indsy \let\tenttsl=
\indttsl
1319 \resetmathfonts \setleading{12pt
}}
1321 % Set up the default fonts, so we can use them for creating boxes.
1325 % Define these so they can be easily changed for other fonts.
1326 \def\angleleft{$
\langle$
}
1327 \def\angleright{$
\rangle$
}
1329 % Count depth in font-changes, for error checks
1330 \newcount\fontdepth \fontdepth=
0
1332 % Fonts for short table of contents.
1333 \setfont\shortcontrm\rmshape{12}{1000}
1334 \setfont\shortcontbf\bxshape{12}{1000}
1335 \setfont\shortcontsl\slshape{12}{1000}
1337 %% Add scribe-like font environments, plus @l for inline lisp (usually sans
1338 %% serif) and @ii for TeX italic
1340 % \smartitalic{ARG} outputs arg in italics, followed by an italic correction
1341 % unless the following character is such as not to need one.
1342 \def\smartitalicx{\ifx\next,
\else\ifx\next-
\else\ifx\next.
\else\/
\fi\fi\fi}
1343 \def\smartitalic#1{{\sl #1}\futurelet\next\smartitalicx}
1346 \let\var=
\smartitalic
1347 \let\dfn=
\smartitalic
1348 \let\emph=
\smartitalic
1349 \let\cite=
\smartitalic
1354 % We can't just use \exhyphenpenalty, because that only has effect at
1355 % the end of a paragraph. Restore normal hyphenation at the end of the
1356 % group within which \nohyphenation is presumably called.
1358 \def\nohyphenation{\hyphenchar\font = -
1 \aftergroup\restorehyphenation}
1359 \def\restorehyphenation{\hyphenchar\font = `-
}
1362 {\tt \rawbackslash \frenchspacing #1}%
1366 \def\samp#1{`
\tclose{#1}'
\null}
1367 \setfont\smallrm\rmshape{8}{1000}
1369 \def\key#1{{\smallrm\textfont2=
\smallsy \leavevmode\hbox{%
1370 \raise0.4pt
\hbox{\angleleft}\kern-
.08em
\vtop{%
1371 \vbox{\hrule\kern-
0.4pt
1372 \hbox{\raise0.4pt
\hbox{\vphantom{\angleleft}}#1}}%
1374 \kern-
.06em
\raise0.4pt
\hbox{\angleright}}}}
1375 % The old definition, with no lozenge:
1376 %\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
1377 \def\ctrl #1{{\tt \rawbackslash \hat}#1}
1379 % @file, @option are the same as @samp.
1383 % @code is a modification of @t,
1384 % which makes spaces the same size as normal in the surrounding text.
1387 % Change normal interword space to be same as for the current font.
1388 \spaceskip =
\fontdimen2\font
1390 % Switch to typewriter.
1393 % But `\ ' produces the large typewriter interword space.
1394 \def\
{{\spaceskip =
0pt
{} }}%
1396 % Turn off hyphenation.
1406 % We *must* turn on hyphenation at `-' and `_' in \code.
1407 % Otherwise, it is too hard to avoid overfull hboxes
1408 % in the Emacs manual, the Library manual, etc.
1410 % Unfortunately, TeX uses one parameter (\hyphenchar) to control
1411 % both hyphenation at - and hyphenation within words.
1412 % We must therefore turn them both off (\tclose does that)
1413 % and arrange explicitly to hyphenate at a dash.
1419 \global\def\code{\begingroup \catcode`\-=
\active \let-
\codedash \catcode`
\_=
\active \let_\codeunder \codex}
1420 % The following is used by \doprintindex to insure that long function names
1421 % wrap around. It is necessary for - and _ to be active before the index is
1422 % read from the file, as \entry parses the arguments long before \code is
1423 % ever called. -- mycroft
1424 % _ is always active; and it shouldn't be \let = to an _ that is a
1425 % subscript character anyway. Then, @cindex @samp{_} (for example)
1427 \global\def\indexbreaks{%
1428 \catcode`\-=
\active \let-
\realdash
1433 \def\codedash{-
\discretionary{}{}{}}
1434 \def\codeunder{\ifusingtt{\normalunderscore\discretionary{}{}{}}{\_}}
1435 \def\codex #1{\tclose{#1}\endgroup}
1437 %\let\exp=\tclose %Was temporary
1439 % @kbd is like @code, except that if the argument is just one @key command,
1440 % then @kbd has no effect.
1442 % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
1443 % `example' (@kbd uses ttsl only inside of @example and friends),
1444 % or `code' (@kbd uses normal tty font always).
1445 \def\kbdinputstyle{\parsearg\kbdinputstylexxx}
1446 \def\kbdinputstylexxx#1{%
1448 \ifx\arg\worddistinct
1449 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
1450 \else\ifx\arg\wordexample
1451 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
1452 \else\ifx\arg\wordcode
1453 \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
1456 \def\worddistinct{distinct
}
1457 \def\wordexample{example
}
1460 % Default is kbdinputdistinct. (Too much of a hassle to call the macro,
1461 % the catcodes are wrong for parsearg to work.)
1462 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}
1465 \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??
}%
1466 \ifx\one\xkey\ifx\threex\three \key{#2}%
1467 \else{\tclose{\kbdfont\look}}\fi
1468 \else{\tclose{\kbdfont\look}}\fi}
1470 % For @url, @env, @command quotes seem unnecessary, so use \code.
1475 % @uref (abbreviation for `urlref') takes an optional second argument
1476 % specifying the text to display. First (mandatory) arg is the url.
1477 % Perhaps eventually put in a hypertex \special here.
1479 \def\uref#1{\urefxxx #1,,
\finish}
1480 \def\urefxxx#1,
#2,
#3\finish{%
1481 \setbox0 =
\hbox{\ignorespaces #2}%
1483 \unhbox0\ (
\code{#1})
%
1489 % rms does not like the angle brackets --karl, 17may97.
1490 % So now @email is just like @uref.
1491 %\def\email#1{\angleleft{\tt #1}\angleright}
1494 % Check if we are currently using a typewriter font. Since all the
1495 % Computer Modern typewriter fonts have zero interword stretch (and
1496 % shrink), and it is reasonable to expect all typewriter fonts to have
1497 % this property, we can check that font parameter.
1499 \def\ifmonospace{\ifdim\fontdimen3\font=
0pt
}
1501 % Typeset a dimension, e.g., `in' or `pt'. The only reason for the
1502 % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
1504 \def\dmn#1{\thinspace #1}
1506 \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??
\par}
1508 % @l was never documented to mean ``switch to the Lisp font'',
1509 % and it is not used as such in any manual I can find. We need it for
1510 % Polish suppressed-l. --karl, 22sep96.
1511 %\def\l#1{{\li #1}\null}
1513 % Explicit font changes: @r, @sc, undocumented @ii.
1514 \def\r#1{{\rm #1}} % roman font
1515 \def\sc#1{{\smallcaps#1}} % smallcaps font
1516 \def\ii#1{{\it #1}} % italic font
1518 % @acronym downcases the argument and prints in smallcaps.
1519 \def\acronym#1{{\smallcaps \lowercase{#1}}}
1521 % @pounds{} is a sterling sign.
1522 \def\pounds{{\it\$
}}
1525 \message{page headings,
}
1527 \newskip\titlepagetopglue \titlepagetopglue =
1.5in
1528 \newskip\titlepagebottomglue \titlepagebottomglue =
2pc
1530 % First the title page. Must do @settitle before @titlepage.
1532 \newif\iffinishedtitlepage
1534 % Do an implicit @contents or @shortcontents after @end titlepage if the
1535 % user says @contentsaftertitlepage or @shortcontentsaftertitlepage.
1537 \newif\ifsetcontentsaftertitlepage
1538 \let\setcontentsaftertitlepage =
\setcontentsaftertitlepagetrue
1539 \newif\ifsetshortcontentsaftertitlepage
1540 \let\setshortcontentsaftertitlepage =
\setshortcontentsaftertitlepagetrue
1542 \def\shorttitlepage{\parsearg\shorttitlepagezzz}
1543 \def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in
\chaprm \centerline{#1}%
1544 \endgroup\page\hbox{}\page}
1546 \def\titlepage{\begingroup \parindent=
0pt
\textfonts
1547 \let\subtitlerm=
\tenrm
1548 \def\subtitlefont{\subtitlerm \normalbaselineskip =
13pt
\normalbaselines}%
1550 \def\authorfont{\authorrm \normalbaselineskip =
16pt
\normalbaselines}%
1552 % Leave some space at the very top of the page.
1553 \vglue\titlepagetopglue
1555 % Now you can print the title using @title.
1556 \def\title{\parsearg\titlezzz}%
1557 \def\titlezzz#
#1{\leftline{\titlefonts\rm #
#1}
1558 % print a rule at the page bottom also.
1559 \finishedtitlepagefalse
1560 \vskip4pt \hrule height
4pt width
\hsize \vskip4pt}%
1561 % No rule at page bottom unless we print one at the top with @title.
1562 \finishedtitlepagetrue
1564 % Now you can put text using @subtitle.
1565 \def\subtitle{\parsearg\subtitlezzz}%
1566 \def\subtitlezzz#
#1{{\subtitlefont \rightline{#
#1}}}%
1568 % @author should come last, but may come many times.
1569 \def\author{\parsearg\authorzzz}%
1570 \def\authorzzz#
#1{\ifseenauthor\else\vskip 0pt plus
1filll
\seenauthortrue\fi
1571 {\authorfont \leftline{#
#1}}}%
1573 % Most title ``pages'' are actually two pages long, with space
1574 % at the top of the second. We don't want the ragged left on the second.
1575 \let\oldpage =
\page
1577 \iffinishedtitlepage\else
1581 \let\page =
\oldpage
1583 % \def\page{\oldpage \hbox{}}
1587 \iffinishedtitlepage\else
1590 % It is important to do the page break before ending the group,
1591 % because the headline and footline are only empty inside the group.
1592 % If we use the new definition of \page, we always get a blank page
1593 % after the title page, which we certainly don't want.
1597 % If they want short, they certainly want long too.
1598 \ifsetshortcontentsaftertitlepage
1601 \global\let\shortcontents =
\relax
1602 \global\let\contents =
\relax
1605 \ifsetcontentsaftertitlepage
1607 \global\let\contents =
\relax
1608 \global\let\shortcontents =
\relax
1614 \def\finishtitlepage{%
1615 \vskip4pt \hrule height
2pt width
\hsize
1616 \vskip\titlepagebottomglue
1617 \finishedtitlepagetrue
1620 %%% Set up page headings and footings.
1622 \let\thispage=
\folio
1624 \newtoks\evenheadline % headline on even pages
1625 \newtoks\oddheadline % headline on odd pages
1626 \newtoks\evenfootline % footline on even pages
1627 \newtoks\oddfootline % footline on odd pages
1629 % Now make Tex use those variables
1630 \headline=
{{\textfonts\rm \ifodd\pageno \the\oddheadline
1631 \else \the\evenheadline \fi}}
1632 \footline=
{{\textfonts\rm \ifodd\pageno \the\oddfootline
1633 \else \the\evenfootline \fi}\HEADINGShook}
1634 \let\HEADINGShook=
\relax
1636 % Commands to set those variables.
1637 % For example, this is what @headings on does
1638 % @evenheading @thistitle|@thispage|@thischapter
1639 % @oddheading @thischapter|@thispage|@thistitle
1640 % @evenfooting @thisfile||
1641 % @oddfooting ||@thisfile
1643 \def\evenheading{\parsearg\evenheadingxxx}
1644 \def\oddheading{\parsearg\oddheadingxxx}
1645 \def\everyheading{\parsearg\everyheadingxxx}
1647 \def\evenfooting{\parsearg\evenfootingxxx}
1648 \def\oddfooting{\parsearg\oddfootingxxx}
1649 \def\everyfooting{\parsearg\everyfootingxxx}
1653 \gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|
\finish}
1654 \gdef\evenheadingyyy #1@|
#2@|
#3@|
#4\finish{%
1655 \global\evenheadline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1657 \gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|
\finish}
1658 \gdef\oddheadingyyy #1@|
#2@|
#3@|
#4\finish{%
1659 \global\oddheadline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1661 \gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
1663 \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|
\finish}
1664 \gdef\evenfootingyyy #1@|
#2@|
#3@|
#4\finish{%
1665 \global\evenfootline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1667 \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|
\finish}
1668 \gdef\oddfootingyyy #1@|
#2@|
#3@|
#4\finish{%
1669 \global\oddfootline =
{\rlap{\centerline{#2}}\line{#1\hfil#3}}%
1671 % Leave some space for the footline. Hopefully ok to assume
1672 % @evenfooting will not be used by itself.
1673 \global\advance\pageheight by -
\baselineskip
1674 \global\advance\vsize by -
\baselineskip
1677 \gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}}
1679 }% unbind the catcode of @.
1681 % @headings double turns headings on for double-sided printing.
1682 % @headings single turns headings on for single-sided printing.
1683 % @headings off turns them off.
1684 % @headings on same as @headings double, retained for compatibility.
1685 % @headings after turns on double-sided headings after this page.
1686 % @headings doubleafter turns on double-sided headings after this page.
1687 % @headings singleafter turns on single-sided headings after this page.
1688 % By default, they are off at the start of a document,
1689 % and turned `on' after @end titlepage.
1691 \def\headings #1 {\csname HEADINGS
#1\endcsname}
1694 \global\evenheadline=
{\hfil} \global\evenfootline=
{\hfil}
1695 \global\oddheadline=
{\hfil} \global\oddfootline=
{\hfil}}
1697 % When we turn headings on, set the page number to 1.
1698 % For double-sided printing, put current file name in lower left corner,
1699 % chapter name on inside top of right hand pages, document
1700 % title on inside top of left hand pages, and page numbers on outside top
1701 % edge of all pages.
1702 \def\HEADINGSdouble{
1704 \global\evenfootline=
{\hfil}
1705 \global\oddfootline=
{\hfil}
1706 \global\evenheadline=
{\line{\folio\hfil\thistitle}}
1707 \global\oddheadline=
{\line{\thischapter\hfil\folio}}
1708 \global\let\contentsalignmacro =
\chapoddpage
1710 \let\contentsalignmacro =
\chappager
1712 % For single-sided printing, chapter title goes across top left of page,
1713 % page number on top right.
1714 \def\HEADINGSsingle{
1716 \global\evenfootline=
{\hfil}
1717 \global\oddfootline=
{\hfil}
1718 \global\evenheadline=
{\line{\thischapter\hfil\folio}}
1719 \global\oddheadline=
{\line{\thischapter\hfil\folio}}
1720 \global\let\contentsalignmacro =
\chappager
1722 \def\HEADINGSon{\HEADINGSdouble}
1724 \def\HEADINGSafter{\let\HEADINGShook=
\HEADINGSdoublex}
1725 \let\HEADINGSdoubleafter=
\HEADINGSafter
1726 \def\HEADINGSdoublex{%
1727 \global\evenfootline=
{\hfil}
1728 \global\oddfootline=
{\hfil}
1729 \global\evenheadline=
{\line{\folio\hfil\thistitle}}
1730 \global\oddheadline=
{\line{\thischapter\hfil\folio}}
1731 \global\let\contentsalignmacro =
\chapoddpage
1734 \def\HEADINGSsingleafter{\let\HEADINGShook=
\HEADINGSsinglex}
1735 \def\HEADINGSsinglex{%
1736 \global\evenfootline=
{\hfil}
1737 \global\oddfootline=
{\hfil}
1738 \global\evenheadline=
{\line{\thischapter\hfil\folio}}
1739 \global\oddheadline=
{\line{\thischapter\hfil\folio}}
1740 \global\let\contentsalignmacro =
\chappager
1743 % Subroutines used in generating headings
1744 % Produces Day Month Year style of output.
1745 \def\today{\number\day\space
1747 January
\or February
\or March
\or April
\or May
\or June
\or
1748 July
\or August
\or September
\or October
\or November
\or December
\fi
1751 % Use this if you want the Month Day, Year style of output.
1752 %\def\today{\ifcase\month\or
1753 %January\or February\or March\or April\or May\or June\or
1754 %July\or August\or September\or October\or November\or December\fi
1755 %\space\number\day, \number\year}
1757 % @settitle line... specifies the title of the document, for headings
1758 % It generates no output of its own
1760 \def\thistitle{No Title
}
1761 \def\settitle{\parsearg\settitlezzz}
1762 \def\settitlezzz #1{\gdef\thistitle{#1}}
1766 % Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
1768 % default indentation of table text
1769 \newdimen\tableindent \tableindent=
.8in
1770 % default indentation of @itemize and @enumerate text
1771 \newdimen\itemindent \itemindent=
.3in
1772 % margin between end of table item and start of table text.
1773 \newdimen\itemmargin \itemmargin=
.1in
1775 % used internally for \itemindent minus \itemmargin
1778 % Note @table, @vtable, and @vtable define @item, @itemx, etc., with
1780 % They also define \itemindex
1781 % to index the item name in whatever manner is desired (perhaps none).
1783 \newif\ifitemxneedsnegativevskip
1785 \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-
\parskip\nobreak\fi}
1787 \def\internalBitem{\smallbreak \parsearg\itemzzz}
1788 \def\internalBitemx{\itemxpar \parsearg\itemzzz}
1790 \def\internalBxitem "
#1"
{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
1791 \def\internalBxitemx "
#1"
{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz}
1793 \def\internalBkitem{\smallbreak \parsearg\kitemzzz}
1794 \def\internalBkitemx{\itemxpar \parsearg\kitemzzz}
1796 \def\kitemzzz #1{\dosubind {kw
}{\code{#1}}{for
{\bf \lastfunction}}%
1799 \def\xitemzzz #1{\dosubind {kw
}{\code{#1}}{for
{\bf \xitemsubtopic}}%
1802 \def\itemzzz #1{\begingroup %
1803 \advance\hsize by -
\rightskip
1804 \advance\hsize by -
\tableindent
1805 \setbox0=
\hbox{\itemfont{#1}}%
1807 \nobreak % This prevents a break before @itemx.
1809 % If the item text does not fit in the space we have, put it on a line
1810 % by itself, and do not allow a page break either before or after that
1811 % line. We do not start a paragraph here because then if the next
1812 % command is, e.g., @kindex, the whatsit would get put into the
1813 % horizontal list on a line by itself, resulting in extra blank space.
1814 \ifdim \wd0>
\itemmax
1816 % Make this a paragraph so we get the \parskip glue and wrapping,
1817 % but leave it ragged-right.
1819 \advance\leftskip by-
\tableindent
1820 \advance\hsize by
\tableindent
1821 \advance\rightskip by0pt plus1fil
1822 \leavevmode\unhbox0\par
1825 % We're going to be starting a paragraph, but we don't want the
1826 % \parskip glue -- logically it's part of the @item we just started.
1827 \nobreak \vskip-
\parskip
1829 % Stop a page break at the \parskip glue coming up. Unfortunately
1830 % we can't prevent a possible page break at the following
1831 % \baselineskip glue.
1834 \itemxneedsnegativevskipfalse
1836 % The item text fits into the space. Start a paragraph, so that the
1837 % following text (if any) will end up on the same line. Since that
1838 % text will be indented by \tableindent, we make the item text be in
1841 % Do this with kerns and \unhbox so that if there is a footnote in
1842 % the item text, it can migrate to the main vertical list and
1843 % eventually be printed.
1844 \nobreak\kern-
\tableindent
1845 \dimen0 =
\itemmax \advance\dimen0 by -
\wd0
1847 \nobreak\kern\dimen0
1849 \itemxneedsnegativevskiptrue
1853 \def\item{\errmessage{@item while not in a table
}}
1854 \def\itemx{\errmessage{@itemx while not in a table
}}
1855 \def\kitem{\errmessage{@kitem while not in a table
}}
1856 \def\kitemx{\errmessage{@kitemx while not in a table
}}
1857 \def\xitem{\errmessage{@xitem while not in a table
}}
1858 \def\xitemx{\errmessage{@xitemx while not in a table
}}
1860 % Contains a kludge to get @end[description] to work.
1861 \def\description{\tablez{\dontindex}{1}{}{}{}{}}
1863 % @table, @ftable, @vtable.
1864 \def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
1865 {\obeylines\obeyspaces%
1866 \gdef\tablex #1^^M
{%
1867 \tabley\dontindex#1 \endtabley}}
1869 \def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
1870 {\obeylines\obeyspaces%
1871 \gdef\ftablex #1^^M
{%
1872 \tabley\fnitemindex#1 \endtabley
1873 \def\Eftable{\endgraf\afterenvbreak\endgroup}%
1874 \let\Etable=
\relax}}
1876 \def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex}
1877 {\obeylines\obeyspaces%
1878 \gdef\vtablex #1^^M
{%
1879 \tabley\vritemindex#1 \endtabley
1880 \def\Evtable{\endgraf\afterenvbreak\endgroup}%
1881 \let\Etable=
\relax}}
1884 \def\fnitemindex #1{\doind {fn
}{\code{#1}}}%
1885 \def\vritemindex #1{\doind {vr
}{\code{#1}}}%
1888 \gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
1889 \tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
1891 \def\tablez #1#2#3#4#5#6{%
1894 \def\Edescription{\Etable}% Necessary kludge.
1896 \ifnum 0#3>
0 \advance \leftskip by
#3\mil \fi %
1897 \ifnum 0#4>
0 \tableindent=
#4\mil \fi %
1898 \ifnum 0#5>
0 \advance \rightskip by
#5\mil \fi %
1900 \itemmax=
\tableindent %
1901 \advance \itemmax by -
\itemmargin %
1902 \advance \leftskip by
\tableindent %
1903 \exdentamount=
\tableindent
1905 \parskip =
\smallskipamount
1906 \ifdim \parskip=
0pt
\parskip=
2pt
\fi%
1907 \def\Etable{\endgraf\afterenvbreak\endgroup}%
1908 \let\item =
\internalBitem %
1909 \let\itemx =
\internalBitemx %
1910 \let\kitem =
\internalBkitem %
1911 \let\kitemx =
\internalBkitemx %
1912 \let\xitem =
\internalBxitem %
1913 \let\xitemx =
\internalBxitemx %
1916 % This is the counter used by @enumerate, which is really @itemize
1920 \def\itemize{\parsearg\itemizezzz}
1922 \def\itemizezzz #1{%
1923 \begingroup % ended by the @end itemize
1924 \itemizey {#1}{\Eitemize}
1927 \def\itemizey #1#2{%
1929 \itemmax=
\itemindent %
1930 \advance \itemmax by -
\itemmargin %
1931 \advance \leftskip by
\itemindent %
1932 \exdentamount=
\itemindent
1934 \parskip =
\smallskipamount %
1935 \ifdim \parskip=
0pt
\parskip=
2pt
\fi%
1936 \def#2{\endgraf\afterenvbreak\endgroup}%
1937 \def\itemcontents{#1}%
1938 \let\item=
\itemizeitem}
1940 % Set sfcode to normal for the chars that usually have another value.
1941 % These are `.?!:;,'
1942 \def\frenchspacing{\sfcode46=
1000 \sfcode63=
1000 \sfcode33=
1000
1943 \sfcode58=
1000 \sfcode59=
1000 \sfcode44=
1000 }
1945 % \splitoff TOKENS\endmark defines \first to be the first token in
1946 % TOKENS, and \rest to be the remainder.
1948 \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
1950 % Allow an optional argument of an uppercase letter, lowercase letter,
1951 % or number, to specify the first label in the enumerated list. No
1952 % argument is the same as `1'.
1954 \def\enumerate{\parsearg\enumeratezzz}
1955 \def\enumeratezzz #1{\enumeratey #1 \endenumeratey}
1956 \def\enumeratey #1 #2\endenumeratey{%
1957 \begingroup % ended by the @end enumerate
1959 % If we were given no argument, pretend we were given `1'.
1961 \ifx\thearg\empty \def\thearg{1}\fi
1963 % Detect if the argument is a single token. If so, it might be a
1964 % letter. Otherwise, the only valid thing it can be is a number.
1965 % (We will always have one token, because of the test we just made.
1966 % This is a good thing, since \splitoff doesn't work given nothing at
1967 % all -- the first parameter is undelimited.)
1968 \expandafter\splitoff\thearg\endmark
1970 % Only one token in the argument. It could still be anything.
1971 % A ``lowercase letter'' is one whose \lccode is nonzero.
1972 % An ``uppercase letter'' is one whose \lccode is both nonzero, and
1973 % not equal to itself.
1974 % Otherwise, we assume it's a number.
1976 % We need the \relax at the end of the \ifnum lines to stop TeX from
1977 % continuing to look for a <number>.
1979 \ifnum\lccode\expandafter`
\thearg=
0\relax
1980 \numericenumerate % a number (we hope)
1983 \ifnum\lccode\expandafter`
\thearg=
\expandafter`
\thearg\relax
1984 \lowercaseenumerate % lowercase letter
1986 \uppercaseenumerate % uppercase letter
1990 % Multiple tokens in the argument. We hope it's a number.
1995 % An @enumerate whose labels are integers. The starting integer is
1998 \def\numericenumerate{%
2000 \startenumeration{\the\itemno}%
2003 % The starting (lowercase) letter is in \thearg.
2004 \def\lowercaseenumerate{%
2005 \itemno =
\expandafter`
\thearg
2007 % Be sure we're not beyond the end of the alphabet.
2009 \errmessage{No more lowercase letters in @enumerate; get a bigger
2016 % The starting (uppercase) letter is in \thearg.
2017 \def\uppercaseenumerate{%
2018 \itemno =
\expandafter`
\thearg
2020 % Be sure we're not beyond the end of the alphabet.
2022 \errmessage{No more uppercase letters in @enumerate; get a bigger
2029 % Call itemizey, adding a period to the first argument and supplying the
2030 % common last two arguments. Also subtract one from the initial value in
2031 % \itemno, since @item increments \itemno.
2033 \def\startenumeration#1{%
2034 \advance\itemno by -
1
2035 \itemizey{#1.
}\Eenumerate\flushcr
2038 % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
2041 \def\alphaenumerate{\enumerate{a
}}
2042 \def\capsenumerate{\enumerate{A
}}
2043 \def\Ealphaenumerate{\Eenumerate}
2044 \def\Ecapsenumerate{\Eenumerate}
2046 % Definition of @item while inside @itemize.
2049 \advance\itemno by
1
2050 {\let\par=
\endgraf \smallbreak}%
2051 \ifhmode \errmessage{In hmode at itemizeitem
}\fi
2052 {\parskip=
0in
\hskip 0pt
2053 \hbox to
0pt
{\hss \itemcontents\hskip \itemmargin}%
2054 \vadjust{\penalty 1200}}%
2057 % @multitable macros
2058 % Amy Hendrickson, 8/18/94, 3/6/96
2060 % @multitable ... @end multitable will make as many columns as desired.
2061 % Contents of each column will wrap at width given in preamble. Width
2062 % can be specified either with sample text given in a template line,
2063 % or in percent of \hsize, the current width of text on page.
2065 % Table can continue over pages but will only break between lines.
2069 % Either define widths of columns in terms of percent of \hsize:
2070 % @multitable @columnfractions .25 .3 .45
2073 % Numbers following @columnfractions are the percent of the total
2074 % current hsize to be used for each column. You may use as many
2075 % columns as desired.
2078 % Or use a template:
2079 % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
2081 % using the widest term desired in each column.
2083 % For those who want to use more than one line's worth of words in
2084 % the preamble, break the line within one argument and it
2085 % will parse correctly, i.e.,
2087 % @multitable {Column 1 template} {Column 2 template} {Column 3
2090 % @multitable {Column 1 template} {Column 2 template}
2091 % {Column 3 template}
2093 % Each new table line starts with @item, each subsequent new column
2094 % starts with @tab. Empty columns may be produced by supplying @tab's
2095 % with nothing between them for as many times as empty columns are needed,
2096 % ie, @tab@tab@tab will produce two empty columns.
2098 % @item, @tab, @multitable or @end multitable do not need to be on their
2099 % own lines, but it will not hurt if they are.
2101 % Sample multitable:
2103 % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
2104 % @item first col stuff @tab second col stuff @tab third col
2111 % @item first col stuff @tab second col stuff
2112 % @tab Many paragraphs of text may be used in any column.
2114 % They will wrap at the width determined by the template.
2115 % @item@tab@tab This will be in third column.
2118 % Default dimensions may be reset by user.
2119 % @multitableparskip is vertical space between paragraphs in table.
2120 % @multitableparindent is paragraph indent in table.
2121 % @multitablecolmargin is horizontal space to be left between columns.
2122 % @multitablelinespace is space to leave between table items, baseline
2124 % 0pt means it depends on current normal line spacing.
2126 \newskip\multitableparskip
2127 \newskip\multitableparindent
2128 \newdimen\multitablecolspace
2129 \newskip\multitablelinespace
2130 \multitableparskip=
0pt
2131 \multitableparindent=
6pt
2132 \multitablecolspace=
12pt
2133 \multitablelinespace=
0pt
2135 % Macros used to set up halign preamble:
2137 \let\endsetuptable\relax
2138 \def\xendsetuptable{\endsetuptable}
2139 \let\columnfractions\relax
2140 \def\xcolumnfractions{\columnfractions}
2143 % 2/1/96, to allow fractions to be given with more than one digit.
2144 \def\pickupwholefraction#1 {\global\advance\colcount by1
%
2145 \expandafter\xdef\csname col
\the\colcount\endcsname{.
#1\hsize}%
2149 \def\setuptable#1{\def\firstarg{#1}%
2150 \ifx\firstarg\xendsetuptable\let\go\relax%
2152 \ifx\firstarg\xcolumnfractions\global\setpercenttrue%
2155 \let\go\pickupwholefraction % In this case arg of setuptable
2156 % is the decimal point before the
2157 % number given in percent of hsize.
2158 % We don't need this so we don't use it.
2160 \global\advance\colcount by1
2161 \setbox0=
\hbox{#1 }% Add a normal word space as a separator;
2162 % typically that is always in the input, anyway.
2163 \expandafter\xdef\csname col
\the\colcount\endcsname{\the\wd0}%
2166 \ifx\go\pickupwholefraction\else\let\go\setuptable\fi%
2170 \def\tab{&
\hskip1sp\relax} % 2/2/96
2171 % tiny skip here makes sure this column space is
2172 % maintained, even if it is never used.
2174 % @multitable ... @end multitable definitions:
2176 \def\multitable{\parsearg\dotable}
2177 \def\dotable#1{\bgroup
2182 \setmultitablespacing
2183 \parskip=
\multitableparskip
2184 \parindent=
\multitableparindent
2187 \def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}%
2189 % To parse everything between @multitable and @item:
2190 \setuptable#1 \endsetuptable
2192 % \everycr will reset column counter, \colcount, at the end of
2193 % each line. Every column entry will cause \colcount to advance by one.
2194 % The table preamble
2195 % looks at the current \colcount to find the correct column width.
2198 % \filbreak%% keeps underfull box messages off when table breaks over pages.
2199 % Maybe so, but it also creates really weird page breaks when the table
2200 % breaks over pages. Wouldn't \vfil be better? Wait until the problem
2201 % manifests itself, so it can be fixed for real --karl.
2202 \global\colcount=
0\relax}}%
2204 % This preamble sets up a generic column definition, which will
2205 % be used as many times as user calls for columns.
2206 % \vtop will set a single line and will also let text wrap and
2207 % continue for many paragraphs if desired.
2208 \halign\bgroup&
\global\advance\colcount by
1\relax
2209 \multistrut\vtop{\hsize=
\expandafter\csname col
\the\colcount\endcsname
2211 % In order to keep entries from bumping into each other
2212 % we will add a \leftskip of \multitablecolspace to all columns after
2215 % If a template has been used, we will add \multitablecolspace
2216 % to the width of each template entry.
2218 % If the user has set preamble in terms of percent of \hsize we will
2219 % use that dimension as the width of the column, and the \leftskip
2220 % will keep entries from bumping into each other. Table will start at
2221 % left margin and final column will justify at right margin.
2223 % Make sure we don't inherit \rightskip from the outer environment.
2226 % The first column will be indented with the surrounding text.
2227 \advance\hsize by
\leftskip
2230 % If user has not set preamble in terms of percent of \hsize
2231 % we will advance \hsize by \multitablecolspace.
2232 \advance\hsize by
\multitablecolspace
2234 % In either case we will make \leftskip=\multitablecolspace:
2235 \leftskip=
\multitablecolspace
2237 % Ignoring space at the beginning and end avoids an occasional spurious
2238 % blank line, when TeX decides to break the line at the space before the
2239 % box from the multistrut, so the strut ends up on a line by itself.
2241 % @multitable @columnfractions .11 .89
2243 % @tab Legal holiday which is valid in major parts of the whole country.
2244 % Is automatically provided with highlighting sequences respectively marking
2246 \noindent\ignorespaces##
\unskip\multistrut}\cr
2249 \def\setmultitablespacing{% test to see if user has set \multitablelinespace.
2250 % If so, do nothing. If not, give it an appropriate dimension based on
2251 % current baselineskip.
2252 \ifdim\multitablelinespace=
0pt
2253 %% strut to put in table in case some entry doesn't have descenders,
2254 %% to keep lines equally spaced
2255 \let\multistrut =
\strut
2256 %% Test to see if parskip is larger than space between lines of
2257 %% table. If not, do nothing.
2258 %% If so, set to same dimension as multitablelinespace.
2260 \gdef\multistrut{\vrule height
\multitablelinespace depth
\dp0
2262 \ifdim\multitableparskip>
\multitablelinespace
2263 \global\multitableparskip=
\multitablelinespace
2264 \global\advance\multitableparskip-
7pt
%% to keep parskip somewhat smaller
2265 %% than skip between lines in the table.
2267 \ifdim\multitableparskip=
0pt
2268 \global\multitableparskip=
\multitablelinespace
2269 \global\advance\multitableparskip-
7pt
%% to keep parskip somewhat smaller
2270 %% than skip between lines in the table.
2275 % Index generation facilities
2277 % Define \newwrite to be identical to plain tex's \newwrite
2278 % except not \outer, so it can be used within \newindex.
2280 \gdef\newwrite{\alloc@
7\write\chardef\sixt@@n
}}
2282 % \newindex {foo} defines an index named foo.
2283 % It automatically defines \fooindex such that
2284 % \fooindex ...rest of line... puts an entry in the index foo.
2285 % It also defines \fooindfile to be the number of the output channel for
2286 % the file that accumulates this index. The file's extension is foo.
2287 % The name of an index should be no more than 2 characters long
2288 % for the sake of vms.
2292 \expandafter\newwrite \csname#1indfile
\endcsname
2293 \openout \csname#1indfile
\endcsname \jobname.
#1 % Open the file
2295 \expandafter\xdef\csname#1index
\endcsname{% % Define @#1index
2296 \noexpand\doindex{#1}}
2299 % @defindex foo == \newindex{foo}
2301 \def\defindex{\parsearg\newindex}
2303 % Define @defcodeindex, like @defindex except put all entries in @code.
2305 \def\newcodeindex#1{%
2307 \expandafter\newwrite \csname#1indfile
\endcsname
2308 \openout \csname#1indfile
\endcsname \jobname.
#1
2310 \expandafter\xdef\csname#1index
\endcsname{%
2311 \noexpand\docodeindex{#1}}
2314 \def\defcodeindex{\parsearg\newcodeindex}
2316 % @synindex foo bar makes index foo feed into index bar.
2317 % Do this instead of @defindex foo if you don't want it as a separate index.
2318 % The \closeout helps reduce unnecessary open files; the limit on the
2319 % Acorn RISC OS is a mere 16 files.
2320 \def\synindex#1 #2 {%
2321 \expandafter\let\expandafter\synindexfoo\expandafter=
\csname#2indfile
\endcsname
2322 \expandafter\closeout\csname#1indfile
\endcsname
2323 \expandafter\let\csname#1indfile
\endcsname=
\synindexfoo
2324 \expandafter\xdef\csname#1index
\endcsname{% define \xxxindex
2325 \noexpand\doindex{#2}}%
2328 % @syncodeindex foo bar similar, but put all entries made for index foo
2330 \def\syncodeindex#1 #2 {%
2331 \expandafter\let\expandafter\synindexfoo\expandafter=
\csname#2indfile
\endcsname
2332 \expandafter\closeout\csname#1indfile
\endcsname
2333 \expandafter\let\csname#1indfile
\endcsname=
\synindexfoo
2334 \expandafter\xdef\csname#1index
\endcsname{% define \xxxindex
2335 \noexpand\docodeindex{#2}}%
2338 % Define \doindex, the driver for all \fooindex macros.
2339 % Argument #1 is generated by the calling \fooindex macro,
2340 % and it is "foo", the name of the index.
2342 % \doindex just uses \parsearg; it calls \doind for the actual work.
2343 % This is because \doind is more useful to call from other macros.
2345 % There is also \dosubind {index}{topic}{subtopic}
2346 % which makes an entry in a two-level index such as the operation index.
2348 \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
2349 \def\singleindexer #1{\doind{\indexname}{#1}}
2351 % like the previous two, but they put @code around the argument.
2352 \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
2353 \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
2357 % Take care of the plain tex accent commands.
2358 \def\"
{\realbackslash "
}%
2359 \def\`
{\realbackslash `
}%
2360 \def\'
{\realbackslash '
}%
2361 \def\^
{\realbackslash ^
}%
2362 \def\~
{\realbackslash ~
}%
2363 \def\=
{\realbackslash =
}%
2364 \def\b{\realbackslash b
}%
2365 \def\c{\realbackslash c
}%
2366 \def\d{\realbackslash d
}%
2367 \def\u{\realbackslash u
}%
2368 \def\v{\realbackslash v
}%
2369 \def\H{\realbackslash H
}%
2370 % Take care of the plain tex special European modified letters.
2371 \def\oe{\realbackslash oe
}%
2372 \def\ae{\realbackslash ae
}%
2373 \def\aa{\realbackslash aa
}%
2374 \def\OE{\realbackslash OE
}%
2375 \def\AE{\realbackslash AE
}%
2376 \def\AA{\realbackslash AA
}%
2377 \def\o{\realbackslash o
}%
2378 \def\O{\realbackslash O
}%
2379 \def\l{\realbackslash l
}%
2380 \def\L{\realbackslash L
}%
2381 \def\ss{\realbackslash ss
}%
2382 % Take care of texinfo commands likely to appear in an index entry.
2383 % (Must be a way to avoid doing expansion at all, and thus not have to
2384 % laboriously list every single command here.)
2385 \def\@
{@
}% will be @@ when we switch to @ as escape char.
2386 %\let\{ = \lbracecmd
2387 %\let\} = \rbracecmd
2388 \def\_{{\realbackslash _
}}%
2389 \def\w{\realbackslash w
}%
2390 \def\bf{\realbackslash bf
}%
2391 %\def\rm{\realbackslash rm }%
2392 \def\sl{\realbackslash sl
}%
2393 \def\sf{\realbackslash sf
}%
2394 \def\tt{\realbackslash tt
}%
2395 \def\gtr{\realbackslash gtr
}%
2396 \def\less{\realbackslash less
}%
2397 \def\hat{\realbackslash hat
}%
2398 \def\TeX{\realbackslash TeX
}%
2399 \def\dots{\realbackslash dots
}%
2400 \def\result{\realbackslash result
}%
2401 \def\equiv{\realbackslash equiv
}%
2402 \def\expansion{\realbackslash expansion
}%
2403 \def\print{\realbackslash print
}%
2404 \def\error{\realbackslash error
}%
2405 \def\point{\realbackslash point
}%
2406 \def\copyright{\realbackslash copyright
}%
2407 \def\tclose#
#1{\realbackslash tclose
{#
#1}}%
2408 \def\code#
#1{\realbackslash code
{#
#1}}%
2409 \def\dotless#
#1{\realbackslash dotless
{#
#1}}%
2410 \def\samp#
#1{\realbackslash samp
{#
#1}}%
2411 \def\,#
#1{\realbackslash ,
{#
#1}}%
2412 \def\t#
#1{\realbackslash t
{#
#1}}%
2413 \def\r#
#1{\realbackslash r
{#
#1}}%
2414 \def\i#
#1{\realbackslash i
{#
#1}}%
2415 \def\b#
#1{\realbackslash b
{#
#1}}%
2416 \def\sc#
#1{\realbackslash sc
{#
#1}}%
2417 \def\cite#
#1{\realbackslash cite
{#
#1}}%
2418 \def\key#
#1{\realbackslash key
{#
#1}}%
2419 \def\file#
#1{\realbackslash file
{#
#1}}%
2420 \def\var#
#1{\realbackslash var
{#
#1}}%
2421 \def\kbd#
#1{\realbackslash kbd
{#
#1}}%
2422 \def\dfn#
#1{\realbackslash dfn
{#
#1}}%
2423 \def\emph#
#1{\realbackslash emph
{#
#1}}%
2425 % Handle some cases of @value -- where the variable name does not
2426 % contain - or _, and the value does not contain any
2427 % (non-fully-expandable) commands.
2428 \let\value =
\expandablevalue
2433 % If an index command is used in an @example environment, any spaces
2434 % therein should become regular spaces in the raw index file, not the
2435 % expansion of \tie (\\leavevmode \penalty \@M \ ).
2437 \gdef\unsepspaces{\obeyspaces\let =
\space}}
2439 % \indexnofonts no-ops all font-change commands.
2440 % This is used when outputting the strings to sort the index by.
2441 \def\indexdummyfont#1{#1}
2442 \def\indexdummytex{TeX
}
2443 \def\indexdummydots{...
}
2446 % Just ignore accents.
2447 \let\,=
\indexdummyfont
2448 \let\"=
\indexdummyfont
2449 \let\`=
\indexdummyfont
2450 \let\'=
\indexdummyfont
2451 \let\^=
\indexdummyfont
2452 \let\~=
\indexdummyfont
2453 \let\==
\indexdummyfont
2454 \let\b=
\indexdummyfont
2455 \let\c=
\indexdummyfont
2456 \let\d=
\indexdummyfont
2457 \let\u=
\indexdummyfont
2458 \let\v=
\indexdummyfont
2459 \let\H=
\indexdummyfont
2460 \let\dotless=
\indexdummyfont
2461 % Take care of the plain tex special European modified letters.
2473 \let\w=
\indexdummyfont
2474 \let\t=
\indexdummyfont
2475 \let\r=
\indexdummyfont
2476 \let\i=
\indexdummyfont
2477 \let\b=
\indexdummyfont
2478 \let\emph=
\indexdummyfont
2479 \let\strong=
\indexdummyfont
2480 \let\cite=
\indexdummyfont
2481 \let\sc=
\indexdummyfont
2482 %Don't no-op \tt, since it isn't a user-level command
2483 % and is used in the definitions of the active chars like <, >, |...
2484 %\let\tt=\indexdummyfont
2485 \let\tclose=
\indexdummyfont
2486 \let\code=
\indexdummyfont
2487 \let\file=
\indexdummyfont
2488 \let\samp=
\indexdummyfont
2489 \let\kbd=
\indexdummyfont
2490 \let\key=
\indexdummyfont
2491 \let\var=
\indexdummyfont
2492 \let\TeX=
\indexdummytex
2493 \let\dots=
\indexdummydots
2497 % To define \realbackslash, we must make \ not be an escape.
2498 % We must first make another character (@) an escape
2499 % so we do not become unable to do a definition.
2501 {\catcode`\@=
0 \catcode`\\=
\other
2502 @gdef@realbackslash
{\
}}
2504 \let\indexbackslash=
0 %overridden during \printindex.
2505 \let\SETmarginindex=
\relax % put index entries in margin (undocumented)?
2507 % For \ifx comparisons.
2508 \def\emptymacro{\empty}
2510 % Most index entries go through here, but \dosubind is the general case.
2512 \def\doind#1#2{\dosubind{#1}{#2}\empty}
2514 % Workhorse for all \fooindexes.
2515 % #1 is name of index, #2 is stuff to put there, #3 is subentry --
2516 % \empty if called from \doind, as we usually are. The main exception
2517 % is with defuns, which call us directly.
2519 \def\dosubind#1#2#3{%
2520 % Put the index entry in the margin if desired.
2521 \ifx\SETmarginindex\relax\else
2522 \insert\margin{\hbox{\vrule height8pt depth3pt width0pt
#2}}%
2525 \count255=
\lastpenalty
2527 \indexdummies % Must do this here, since \bf, etc expand at this stage
2530 \let\folio =
0% We will expand all macros now EXCEPT \folio.
2531 \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
2532 % so it will be output as is; and it will print as backslash.
2536 % If third arg is present, precede it with space in sort key.
2537 \ifx\thirdarg\emptymacro
2538 \let\subentry =
\empty
2543 % First process the index-string with all font commands turned off
2544 % to get the string to sort by.
2545 {\indexnofonts \xdef\indexsorttmp{#2\subentry}}%
2547 % Now produce the complete index entry, with both the sort key and the
2548 % original text, including any font commands.
2551 \write\csname#1indfile
\endcsname{%
2552 \realbackslash entry
{\indexsorttmp}{\folio}{\the\toks0}}%
2555 % If third (subentry) arg is present, add it to the index string.
2556 \ifx\thirdarg\emptymacro \else
2558 \edef\temp{\temp{\the\toks0}}%
2561 % If a skip is the last thing on the list now, preserve it
2562 % by backing up by \lastskip, doing the \write, then inserting
2563 % the skip again. Otherwise, the whatsit generated by the
2564 % \write will make \lastskip zero. The result is that sequences
2569 % will have extra space inserted, because the \medbreak in the
2570 % start of the @defun won't see the skip inserted by the @end of
2571 % the previous defun.
2573 % But don't do any of this if we're not in vertical mode. We
2574 % don't want to do a \vskip and prematurely end a paragraph.
2576 % Avoid page breaks due to these extra skips, too.
2581 \ifdim\lastskip =
0pt
\else \nobreak\vskip-
\lastskip \fi
2584 \temp % do the write
2587 \ifvmode \ifdim\skip0 =
0pt
\else \nobreak\vskip\skip0 \fi \fi
2595 % The index entry written in the file actually looks like
2596 % \entry {sortstring}{page}{topic}
2598 % \entry {sortstring}{page}{topic}{subtopic}
2599 % The texindex program reads in these files and writes files
2600 % containing these kinds of lines:
2602 % before the first topic whose initial is c
2603 % \entry {topic}{pagelist}
2604 % for a topic that is used without subtopics
2606 % for the beginning of a topic that is used with subtopics
2607 % \secondary {subtopic}{pagelist}
2608 % for each subtopic.
2610 % Define the user-accessible indexing commands
2611 % @findex, @vindex, @kindex, @cindex.
2613 \def\findex {\fnindex}
2614 \def\kindex {\kyindex}
2615 \def\cindex {\cpindex}
2616 \def\vindex {\vrindex}
2617 \def\tindex {\tpindex}
2618 \def\pindex {\pgindex}
2620 \def\cindexsub {\begingroup\obeylines\cindexsub}
2622 \gdef\cindexsub "
#1"
#2^^M
{\endgroup %
2623 \dosubind{cp
}{#2}{#1}}}
2625 % Define the macros used in formatting output of the sorted index material.
2627 % @printindex causes a particular index (the ??s file) to get printed.
2628 % It does not print any chapter heading (usually an @unnumbered).
2630 \def\printindex{\parsearg\doprintindex}
2631 \def\doprintindex#1{\begingroup
2632 \dobreak \chapheadingskip{10000}%
2638 % See if the index file exists and is nonempty.
2639 % Change catcode of @ here so that if the index file contains
2641 % as its first line, TeX doesn't complain about mismatched braces
2642 % (because it thinks @} is a control sequence).
2644 \openin 1 \jobname.
#1s
2646 % \enddoublecolumns gets confused if there is no text in the index,
2647 % and it loses the chapter title and the aux file entries for the
2648 % index. The easiest way to prevent this problem is to make sure
2649 % there is some text.
2650 (Index is nonexistent)
2653 % If the index file exists but is empty, then \openin leaves \ifeof
2654 % false. We have to make TeX try to read something from the file, so
2655 % it can discover if there is anything in it.
2660 % Index files are almost Texinfo source, but we use \ as the escape
2661 % character. It would be better to use @, but that's too big a change
2662 % to make right now.
2663 \def\indexbackslash{\rawbackslashxx}%
2674 % These macros are used by the sorted index file itself.
2675 % Change them to control the appearance of the index.
2678 % Some minor font changes for the special characters.
2679 \let\tentt=
\sectt \let\tt=
\sectt \let\sf=
\sectt
2681 % Remove any glue we may have, we'll be inserting our own.
2684 % We like breaks before the index initials, so insert a bonus.
2687 % Typeset the initial. Making this add up to a whole number of
2688 % baselineskips increases the chance of the dots lining up from column
2689 % to column. It still won't often be perfect, because of the stretch
2690 % we need before each entry, but it's better.
2692 % No shrink because it confuses \balancecolumns.
2693 \vskip 1.67\baselineskip plus
.5\baselineskip
2694 \leftline{\secbf #1}%
2695 \vskip .33\baselineskip plus
.1\baselineskip
2697 % Do our best not to break after the initial.
2701 % This typesets a paragraph consisting of #1, dot leaders, and then #2
2702 % flush to the right margin. It is used for index and table of contents
2703 % entries. The paragraph is indented by \leftskip.
2705 \def\entry#1#2{\begingroup
2707 % Start a new paragraph if necessary, so our assignments below can't
2708 % affect previous text.
2711 % Do not fill out the last line with white space.
2714 % No extra space above this paragraph.
2717 % Do not prefer a separate line ending with a hyphen to fewer lines.
2718 \finalhyphendemerits =
0
2720 % \hangindent is only relevant when the entry text and page number
2721 % don't both fit on one line. In that case, bob suggests starting the
2722 % dots pretty far over on the line. Unfortunately, a large
2723 % indentation looks wrong when the entry text itself is broken across
2724 % lines. So we use a small indentation and put up with long leaders.
2726 % \hangafter is reset to 1 (which is the value we want) at the start
2727 % of each paragraph, so we need not do anything with that.
2730 % When the entry text needs to be broken, just fill out the first line
2732 \rightskip =
0pt plus1fil
2734 % A bit of stretch before each entry for the benefit of balancing columns.
2737 % Start a ``paragraph'' for the index entry so the line breaking
2738 % parameters we've set above will have an effect.
2741 % Insert the text of the index entry. TeX will do line-breaking on it.
2743 % The following is kludged to not output a line of dots in the index if
2744 % there are no page numbers. The next person who breaks this will be
2745 % cursed by a Unix daemon.
2748 \edef\tempc{\tempa}%
2749 \edef\tempd{\tempb}%
2750 \ifx\tempc\tempd\
\else%
2752 % If we must, put the page number on a line of its own, and fill out
2753 % this line with blank space. (The \hfil is overwhelmed with the
2754 % fill leaders glue in \indexdotfill if the page number does fit.)
2756 \null\nobreak\indexdotfill % Have leaders before the page number.
2758 % The `\ ' here is removed by the implicit \unskip that TeX does as
2759 % part of (the primitive) \par. Without it, a spurious underfull
2761 \
#2% The page number ends the paragraph.
2766 % Like \dotfill except takes at least 1 em.
2767 \def\indexdotfill{\cleaders
2768 \hbox{$
\mathsurround=
0pt
\mkern1.5mu $
{\it .
}$
\mkern1.5mu$
}\hskip 1em plus
1fill
}
2770 \def\primary #1{\line{#1\hfil}}
2772 \newskip\secondaryindent \secondaryindent=
0.5cm
2774 \def\secondary #1#2{
2775 {\parfillskip=
0in
\parskip=
0in
2776 \hangindent =
1in
\hangafter=
1
2777 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par
2780 % Define two-column mode, which we use to typeset indexes.
2781 % Adapted from the TeXbook, page 416, which is to say,
2782 % the manmac.tex format used to print the TeXbook itself.
2786 \newdimen\doublecolumnhsize
2788 \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
2789 % Grab any single-column material above us.
2790 \output =
{\global\setbox\partialpage =
\vbox{%
2792 % Here is a possibility not foreseen in manmac: if we accumulate a
2793 % whole lot of material, we might end up calling this \output
2794 % routine twice in a row (see the doublecol-lose test, which is
2795 % essentially a couple of indexes with @setchapternewpage off). In
2796 % that case, we must prevent the second \partialpage from
2797 % simply overwriting the first, causing us to lose the page.
2798 % This will preserve it until a real output routine can ship it
2799 % out. Generally, \partialpage will be empty when this runs and
2800 % this will be a no-op.
2803 % Unvbox the main output page.
2805 \kern-
\topskip \kern\baselineskip
2809 % Use the double-column output routine for subsequent pages.
2810 \output =
{\doublecolumnout}%
2812 % Change the page size parameters. We could do this once outside this
2813 % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
2814 % format, but then we repeat the same computation. Repeating a couple
2815 % of assignments once per index is clearly meaningless for the
2816 % execution time, so we may as well do it in one place.
2818 % First we halve the line length, less a little for the gutter between
2819 % the columns. We compute the gutter based on the line length, so it
2820 % changes automatically with the paper format. The magic constant
2821 % below is chosen so that the gutter has the same value (well, +-<1pt)
2822 % as it did when we hard-coded it.
2824 % We put the result in a separate register, \doublecolumhsize, so we
2825 % can restore it in \pagesofar, after \hsize itself has (potentially)
2828 \doublecolumnhsize =
\hsize
2829 \advance\doublecolumnhsize by -
.04154\hsize
2830 \divide\doublecolumnhsize by
2
2831 \hsize =
\doublecolumnhsize
2833 % Double the \vsize as well. (We don't need a separate register here,
2834 % since nobody clobbers \vsize.)
2835 \advance\vsize by -
\ht\partialpage
2839 % The double-column output routine for all double-column pages except
2842 \def\doublecolumnout{%
2843 \splittopskip=
\topskip \splitmaxdepth=
\maxdepth
2844 % Get the available space for the double columns -- the normal
2845 % (undoubled) page height minus any material left over from the
2850 % box0 will be the left-hand column, box2 the right.
2851 \setbox0=
\vsplit255 to
\dimen@
\setbox2=
\vsplit255 to
\dimen@
2852 \onepageout\pagesofar
2854 \penalty\outputpenalty
2857 % Re-output the contents of the output page -- any previous material,
2858 % followed by the two boxes we just split, in box0 and box2.
2859 \advance\vsize by
\ht\partialpage
2862 \hsize =
\doublecolumnhsize
2863 \wd0=
\hsize \wd2=
\hsize
2864 \hbox to
\pagewidth{\box0\hfil\box2}%
2866 \def\enddoublecolumns{%
2868 % Split the last of the double-column material. Leave on the
2869 % current page, no automatic page break.
2872 % If we end up splitting too much material for the current page,
2873 % though, there will be another page break right after this \output
2874 % invocation ends. Having called \balancecolumns once, we do not
2875 % want to call it again. Therefore, reset \output to its normal
2876 % definition right away. (We hope \balancecolumns will never be
2877 % called on to balance too much material, but if it is, this makes
2878 % the output somewhat more palatable.)
2879 \global\output =
{\onepageout{\pagecontents\PAGE}}%
2881 % \pagegoal was set to the doubled \vsize above, since we restarted
2882 % the current page. We're now back to normal single-column
2883 % typesetting, so reset \pagegoal to the normal \vsize.
2887 \endgroup % started in \begindoublecolumns
2889 \def\balancecolumns{%
2890 % Called at the end of the double column material.
2891 \setbox0 =
\vbox{\unvbox255}% like \box255 but more efficient, see p.120.
2893 \advance\dimen@ by
\topskip
2894 \advance\dimen@ by-
\baselineskip
2895 \divide\dimen@ by
2 % target to split to
2896 %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
2897 \splittopskip =
\topskip
2898 % Loop until we get a decent breakpoint.
2902 \global\setbox3 =
\copy0
2903 \global\setbox1 =
\vsplit3 to
\dimen@
2905 \global\advance\dimen@ by
1pt
2908 %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
2909 \setbox0=
\vbox to
\dimen@
{\unvbox1}%
2910 \setbox2=
\vbox to
\dimen@
{\unvbox3}%
2914 \catcode`\@ =
\other
2917 \message{sectioning,
}
2918 % Define chapters, sections, etc.
2921 \newcount\secno \secno=
0
2922 \newcount\subsecno \subsecno=
0
2923 \newcount\subsubsecno \subsubsecno=
0
2925 % This counter is funny since it counts through charcodes of letters A, B, ...
2926 \newcount\appendixno \appendixno = `\@
2927 \def\appendixletter{\char\the\appendixno}
2929 % Each @chapter defines this as the name of the chapter.
2930 % page headings and footings can use it. @section does likewise.
2934 \newcount\absseclevel % used to calculate proper heading level
2935 \newcount\secbase\secbase=
0 % @raise/lowersections modify this count
2937 % @raisesections: treat @section as chapter, @subsection as section, etc.
2938 \def\raisesections{\global\advance\secbase by -
1}
2939 \let\up=
\raisesections % original BFox name
2941 % @lowersections: treat @chapter as section, @section as subsection, etc.
2942 \def\lowersections{\global\advance\secbase by
1}
2943 \let\down=
\lowersections % original BFox name
2945 % Choose a numbered-heading macro
2946 % #1 is heading level if unmodified by @raisesections or @lowersections
2947 % #2 is text for heading
2948 \def\numhead#1#2{\absseclevel=
\secbase\advance\absseclevel by
#1
2954 \numberedsubseczzz{#2}
2956 \numberedsubsubseczzz{#2}
2958 \ifnum \absseclevel<
0
2961 \numberedsubsubseczzz{#2}
2966 % like \numhead, but chooses appendix heading levels
2967 \def\apphead#1#2{\absseclevel=
\secbase\advance\absseclevel by
#1
2971 \appendixsectionzzz{#2}
2973 \appendixsubseczzz{#2}
2975 \appendixsubsubseczzz{#2}
2977 \ifnum \absseclevel<
0
2980 \appendixsubsubseczzz{#2}
2985 % like \numhead, but chooses numberless heading levels
2986 \def\unnmhead#1#2{\absseclevel=
\secbase\advance\absseclevel by
#1
2990 \unnumberedseczzz{#2}
2992 \unnumberedsubseczzz{#2}
2994 \unnumberedsubsubseczzz{#2}
2996 \ifnum \absseclevel<
0
2999 \unnumberedsubsubseczzz{#2}
3004 % @chapter, @appendix, @unnumbered.
3005 \def\thischaptername{No Chapter Title
}
3006 \outer\def\chapter{\parsearg\chapteryyy}
3007 \def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz
3008 \def\chapterzzz #1{%
3009 \secno=
0 \subsecno=
0 \subsubsecno=
0
3010 \global\advance \chapno by
1 \message{\putwordChapter\space \the\chapno}%
3011 \chapmacro {#1}{\the\chapno}%
3012 \gdef\thissection{#1}%
3013 \gdef\thischaptername{#1}%
3014 % We don't substitute the actual chapter name into \thischapter
3015 % because we don't want its macros evaluated now.
3016 \xdef\thischapter{\putwordChapter{} \the\chapno:
\noexpand\thischaptername}%
3018 \edef\temp{\noexpand\writetocentry{\realbackslash chapentry
{\the\toks0}%
3022 \global\let\section =
\numberedsec
3023 \global\let\subsection =
\numberedsubsec
3024 \global\let\subsubsection =
\numberedsubsubsec
3027 \outer\def\appendix{\parsearg\appendixyyy}
3028 \def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz
3029 \def\appendixzzz #1{%
3030 \secno=
0 \subsecno=
0 \subsubsecno=
0
3031 \global\advance \appendixno by
1
3032 \message{\putwordAppendix\space \appendixletter}%
3033 \chapmacro {#1}{\putwordAppendix{} \appendixletter}%
3034 \gdef\thissection{#1}%
3035 \gdef\thischaptername{#1}%
3036 \xdef\thischapter{\putwordAppendix{} \appendixletter:
\noexpand\thischaptername}%
3038 \edef\temp{\noexpand\writetocentry{\realbackslash chapentry
{\the\toks0}%
3039 {\putwordAppendix{} \appendixletter}}}%
3042 \global\let\section =
\appendixsec
3043 \global\let\subsection =
\appendixsubsec
3044 \global\let\subsubsection =
\appendixsubsubsec
3047 % @centerchap is like @unnumbered, but the heading is centered.
3048 \outer\def\centerchap{\parsearg\centerchapyyy}
3049 \def\centerchapyyy #1{{\let\unnumbchapmacro=
\centerchapmacro \unnumberedyyy{#1}}}
3051 % @top is like @unnumbered.
3052 \outer\def\top{\parsearg\unnumberedyyy}
3054 \outer\def\unnumbered{\parsearg\unnumberedyyy}
3055 \def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
3056 \def\unnumberedzzz #1{%
3057 \secno=
0 \subsecno=
0 \subsubsecno=
0
3059 % This used to be simply \message{#1}, but TeX fully expands the
3060 % argument to \message. Therefore, if #1 contained @-commands, TeX
3061 % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
3062 % expanded @cite (which turns out to cause errors because \cite is meant
3063 % to be executed, not expanded).
3065 % Anyway, we don't want the fully-expanded definition of @cite to appear
3066 % as a result of the \message, we just want `@cite' itself. We use
3067 % \the<toks register> to achieve this: TeX expands \the<toks> only once,
3068 % simply yielding the contents of <toks register>. (We also do this for
3070 \toks0 =
{#1}\message{(
\the\toks0)
}%
3072 \unnumbchapmacro {#1}%
3073 \gdef\thischapter{#1}\gdef\thissection{#1}%
3075 \edef\temp{\noexpand\writetocentry{\realbackslash unnumbchapentry
{\the\toks0}}}%
3078 \global\let\section =
\unnumberedsec
3079 \global\let\subsection =
\unnumberedsubsec
3080 \global\let\subsubsection =
\unnumberedsubsubsec
3084 \outer\def\numberedsec{\parsearg\secyyy}
3085 \def\secyyy #1{\numhead1{#1}} % normally calls seczzz
3087 \subsecno=
0 \subsubsecno=
0 \global\advance \secno by
1 %
3088 \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
3090 \edef\temp{\noexpand\writetocentry{\realbackslash secentry
{\the\toks0}%
3091 {\the\chapno}{\the\secno}}}%
3097 \outer\def\appendixsection{\parsearg\appendixsecyyy}
3098 \outer\def\appendixsec{\parsearg\appendixsecyyy}
3099 \def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz
3100 \def\appendixsectionzzz #1{%
3101 \subsecno=
0 \subsubsecno=
0 \global\advance \secno by
1 %
3102 \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
3104 \edef\temp{\noexpand\writetocentry{\realbackslash secentry
{\the\toks0}%
3105 {\appendixletter}{\the\secno}}}%
3111 \outer\def\unnumberedsec{\parsearg\unnumberedsecyyy}
3112 \def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz
3113 \def\unnumberedseczzz #1{%
3114 \plainsecheading {#1}\gdef\thissection{#1}%
3116 \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry
{\the\toks0}}}%
3123 \outer\def\numberedsubsec{\parsearg\numberedsubsecyyy}
3124 \def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz
3125 \def\numberedsubseczzz #1{%
3126 \gdef\thissection{#1}\subsubsecno=
0 \global\advance \subsecno by
1 %
3127 \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
3129 \edef\temp{\noexpand\writetocentry{\realbackslash subsecentry
{\the\toks0}%
3130 {\the\chapno}{\the\secno}{\the\subsecno}}}%
3136 \outer\def\appendixsubsec{\parsearg\appendixsubsecyyy}
3137 \def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz
3138 \def\appendixsubseczzz #1{%
3139 \gdef\thissection{#1}\subsubsecno=
0 \global\advance \subsecno by
1 %
3140 \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
3142 \edef\temp{\noexpand\writetocentry{\realbackslash subsecentry
{\the\toks0}%
3143 {\appendixletter}{\the\secno}{\the\subsecno}}}%
3149 \outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy}
3150 \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
3151 \def\unnumberedsubseczzz #1{%
3152 \plainsubsecheading {#1}\gdef\thissection{#1}%
3154 \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry
%
3162 \outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy}
3163 \def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz
3164 \def\numberedsubsubseczzz #1{%
3165 \gdef\thissection{#1}\global\advance \subsubsecno by
1 %
3166 \subsubsecheading {#1}
3167 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
3169 \edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry
{\the\toks0}%
3170 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
3176 \outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy}
3177 \def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz
3178 \def\appendixsubsubseczzz #1{%
3179 \gdef\thissection{#1}\global\advance \subsubsecno by
1 %
3180 \subsubsecheading {#1}
3181 {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
3183 \edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry
{\the\toks0}%
3184 {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
3190 \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy}
3191 \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
3192 \def\unnumberedsubsubseczzz #1{%
3193 \plainsubsubsecheading {#1}\gdef\thissection{#1}%
3195 \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry
%
3202 % These are variants which are not "outer", so they can appear in @ifinfo.
3203 % Actually, they should now be obsolete; ordinary section commands should work.
3204 \def\infotop{\parsearg\unnumberedzzz}
3205 \def\infounnumbered{\parsearg\unnumberedzzz}
3206 \def\infounnumberedsec{\parsearg\unnumberedseczzz}
3207 \def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz}
3208 \def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
3210 \def\infoappendix{\parsearg\appendixzzz}
3211 \def\infoappendixsec{\parsearg\appendixseczzz}
3212 \def\infoappendixsubsec{\parsearg\appendixsubseczzz}
3213 \def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz}
3215 \def\infochapter{\parsearg\chapterzzz}
3216 \def\infosection{\parsearg\sectionzzz}
3217 \def\infosubsection{\parsearg\subsectionzzz}
3218 \def\infosubsubsection{\parsearg\subsubsectionzzz}
3220 % These macros control what the section commands do, according
3221 % to what kind of chapter we are in (ordinary, appendix, or unnumbered).
3222 % Define them by default for a numbered chapter.
3223 \global\let\section =
\numberedsec
3224 \global\let\subsection =
\numberedsubsec
3225 \global\let\subsubsection =
\numberedsubsubsec
3227 % Define @majorheading, @heading and @subheading
3229 % NOTE on use of \vbox for chapter headings, section headings, and such:
3230 % 1) We use \vbox rather than the earlier \line to permit
3231 % overlong headings to fold.
3232 % 2) \hyphenpenalty is set to 10000 because hyphenation in a
3233 % heading is obnoxious; this forbids it.
3234 % 3) Likewise, headings look best if no \parindent is used, and
3235 % if justification is not attempted. Hence \raggedright.
3238 \def\majorheading{\parsearg\majorheadingzzz}
3239 \def\majorheadingzzz #1{%
3240 {\advance\chapheadingskip by
10pt
\chapbreak }%
3241 {\chapfonts \vbox{\hyphenpenalty=
10000\tolerance=
5000
3242 \parindent=
0pt
\raggedright
3243 \rm #1\hfill}}\bigskip \par\penalty 200}
3245 \def\chapheading{\parsearg\chapheadingzzz}
3246 \def\chapheadingzzz #1{\chapbreak %
3247 {\chapfonts \vbox{\hyphenpenalty=
10000\tolerance=
5000
3248 \parindent=
0pt
\raggedright
3249 \rm #1\hfill}}\bigskip \par\penalty 200}
3251 % @heading, @subheading, @subsubheading.
3252 \def\heading{\parsearg\plainsecheading}
3253 \def\subheading{\parsearg\plainsubsecheading}
3254 \def\subsubheading{\parsearg\plainsubsubsecheading}
3256 % These macros generate a chapter, section, etc. heading only
3257 % (including whitespace, linebreaking, etc. around it),
3258 % given all the information in convenient, parsed form.
3260 %%% Args are the skip and penalty (usually negative)
3261 \def\dobreak#1#2{\par\ifdim\lastskip<
#1\removelastskip\penalty#2\vskip#1\fi}
3263 \def\setchapterstyle #1 {\csname CHAPF
#1\endcsname}
3265 %%% Define plain chapter starts, and page on/off switching for it
3266 % Parameter controlling skip before chapter headings (if needed)
3268 \newskip\chapheadingskip
3270 \def\chapbreak{\dobreak \chapheadingskip {-
4000}}
3271 \def\chappager{\par\vfill\supereject}
3272 \def\chapoddpage{\chappager \ifodd\pageno \else \hbox to
0pt
{} \chappager\fi}
3274 \def\setchapternewpage #1 {\csname CHAPPAG
#1\endcsname}
3277 \global\let\contentsalignmacro =
\chappager
3278 \global\let\pchapsepmacro=
\chapbreak
3279 \global\let\pagealignmacro=
\chappager}
3282 \global\let\contentsalignmacro =
\chappager
3283 \global\let\pchapsepmacro=
\chappager
3284 \global\let\pagealignmacro=
\chappager
3285 \global\def\HEADINGSon{\HEADINGSsingle}}
3288 \global\let\contentsalignmacro =
\chapoddpage
3289 \global\let\pchapsepmacro=
\chapoddpage
3290 \global\let\pagealignmacro=
\chapoddpage
3291 \global\def\HEADINGSon{\HEADINGSdouble}}
3296 \global\let\chapmacro=
\chfplain
3297 \global\let\unnumbchapmacro=
\unnchfplain
3298 \global\let\centerchapmacro=
\centerchfplain}
3300 % Plain chapter opening.
3301 % #1 is the text, #2 the chapter number or empty if unnumbered.
3307 \setbox0 =
\hbox{#2\ifx\chapnum\empty\else\enspace\fi}%
3308 \vbox{\hyphenpenalty=
10000 \tolerance=
5000 \parindent=
0pt
\raggedright
3309 \hangindent =
\wd0 \centerparametersmaybe
3312 \nobreak\bigskip % no page break after a chapter title
3316 % Plain opening for unnumbered.
3317 \def\unnchfplain#1{\chfplain{#1}{}}
3319 % @centerchap -- centered and unnumbered.
3320 \let\centerparametersmaybe =
\relax
3321 \def\centerchfplain#1{{%
3322 \def\centerparametersmaybe{%
3323 \advance\rightskip by
3\rightskip
3324 \leftskip =
\rightskip
3330 \CHAPFplain % The default
3332 \def\unnchfopen #1{%
3333 \chapoddpage {\chapfonts \vbox{\hyphenpenalty=
10000\tolerance=
5000
3334 \parindent=
0pt
\raggedright
3335 \rm #1\hfill}}\bigskip \par\nobreak
3338 \def\chfopen #1#2{\chapoddpage {\chapfonts
3339 \vbox to
3in
{\vfil \hbox to
\hsize{\hfil #2} \hbox to
\hsize{\hfil #1} \vfil}}%
3343 \def\centerchfopen #1{%
3344 \chapoddpage {\chapfonts \vbox{\hyphenpenalty=
10000\tolerance=
5000
3346 \hfill {\rm #1}\hfill}}\bigskip \par\nobreak
3350 \global\let\chapmacro=
\chfopen
3351 \global\let\unnumbchapmacro=
\unnchfopen
3352 \global\let\centerchapmacro=
\centerchfopen}
3356 \newskip\secheadingskip
3357 \def\secheadingbreak{\dobreak \secheadingskip {-
1000}}
3358 \def\secheading#1#2#3{\sectionheading{sec
}{#2.
#3}{#1}}
3359 \def\plainsecheading#1{\sectionheading{sec
}{}{#1}}
3361 % Subsection titles.
3362 \newskip \subsecheadingskip
3363 \def\subsecheadingbreak{\dobreak \subsecheadingskip {-
500}}
3364 \def\subsecheading#1#2#3#4{\sectionheading{subsec
}{#2.
#3.
#4}{#1}}
3365 \def\plainsubsecheading#1{\sectionheading{subsec
}{}{#1}}
3367 % Subsubsection titles.
3368 \let\subsubsecheadingskip =
\subsecheadingskip
3369 \let\subsubsecheadingbreak =
\subsecheadingbreak
3370 \def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec
}{#2.
#3.
#4.
#5}{#1}}
3371 \def\plainsubsubsecheading#1{\sectionheading{subsubsec
}{}{#1}}
3374 % Print any size section title.
3376 % #1 is the section type (sec/subsec/subsubsec), #2 is the section
3377 % number (maybe empty), #3 the text.
3378 \def\sectionheading#1#2#3{%
3380 \expandafter\advance\csname #1headingskip
\endcsname by
\parskip
3381 \csname #1headingbreak
\endcsname
3384 % Switch to the right set of fonts.
3385 \csname #1fonts
\endcsname \rm
3387 % Only insert the separating space if we have a section number.
3389 \setbox0 =
\hbox{#2\ifx\secnum\empty\else\enspace\fi}%
3391 \vbox{\hyphenpenalty=
10000 \tolerance=
5000 \parindent=
0pt
\raggedright
3392 \hangindent =
\wd0 % zero if no section number
3395 \ifdim\parskip<
10pt
\nobreak\kern10pt\nobreak\kern-
\parskip\fi \nobreak
3402 % Write an entry to the toc file, opening it if necessary.
3403 % Called from @chapter, etc. We supply {\folio} at the end of the
3404 % argument, which will end up as the last argument to the \...entry macro.
3406 % We open the .toc file here instead of at @setfilename or any other
3407 % given time so that @contents can be put in the document anywhere.
3409 \newif\iftocfileopened
3410 \def\writetocentry#1{%
3411 \iftocfileopened\else
3412 \immediate\openout\tocfile =
\jobname.toc
3413 \global\tocfileopenedtrue
3415 \iflinks \write\tocfile{#1{\folio}}\fi
3418 \newskip\contentsrightmargin \contentsrightmargin=
1in
3419 \newcount\savepageno
3420 \newcount\lastnegativepageno \lastnegativepageno = -
1
3422 % Finish up the main text and prepare to read what we've written
3425 \def\startcontents#1{%
3426 % If @setchapternewpage on, and @headings double, the contents should
3427 % start on an odd page, unlike chapters. Thus, we maintain
3428 % \contentsalignmacro in parallel with \pagealignmacro.
3429 % From: Torbjorn Granlund <tege@matematik.su.se>
3431 \immediate\closeout\tocfile
3433 % Don't need to put `Contents' or `Short Contents' in the headline.
3434 % It is abundantly clear what they are.
3435 \unnumbchapmacro{#1}\def\thischapter{}%
3436 \savepageno =
\pageno
3437 \begingroup % Set up to handle contents files properly.
3438 \catcode`\\=
0 \catcode`\
{=
1 \catcode`\
}=
2 \catcode`\@=
11
3439 % We can't do this, because then an actual ^ in a section
3440 % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97.
3441 %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
3442 \raggedbottom % Worry more about breakpoints than the bottom.
3443 \advance\hsize by -
\contentsrightmargin % Don't use the full line length.
3445 % Roman numerals for page numbers.
3446 \ifnum \pageno>
0 \pageno =
\lastnegativepageno \fi
3450 % Normal (long) toc.
3452 \startcontents{\putwordTableofContents}%
3453 \openin 1 \jobname.toc
3460 \lastnegativepageno =
\pageno
3461 \pageno =
\savepageno
3464 % And just the chapters.
3465 \def\summarycontents{%
3466 \startcontents{\putwordShortContents}%
3468 \let\chapentry =
\shortchapentry
3469 \let\unnumbchapentry =
\shortunnumberedentry
3470 % We want a true roman here for the page numbers.
3472 \let\rm=
\shortcontrm \let\bf=
\shortcontbf \let\sl=
\shortcontsl
3474 \hyphenpenalty =
10000
3475 \advance\baselineskip by
1pt
% Open it up a little.
3476 \def\secentry #
#1#
#2#
#3#
#4{}
3477 \def\unnumbsecentry #
#1#
#2{}
3478 \def\subsecentry #
#1#
#2#
#3#
#4#
#5{}
3479 \def\unnumbsubsecentry #
#1#
#2{}
3480 \def\subsubsecentry #
#1#
#2#
#3#
#4#
#5#
#6{}
3481 \def\unnumbsubsubsecentry #
#1#
#2{}
3482 \openin 1 \jobname.toc
3489 \lastnegativepageno =
\pageno
3490 \pageno =
\savepageno
3492 \let\shortcontents =
\summarycontents
3494 % These macros generate individual entries in the table of contents.
3495 % The first argument is the chapter or section name.
3496 % The last argument is the page number.
3497 % The arguments in between are the chapter number, section number, ...
3499 % Chapter-level things, for both the long and short contents.
3500 \def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}
3502 % See comments in \dochapentry re vbox and related settings
3503 \def\shortchapentry#1#2#3{%
3504 \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno{#3}}%
3507 % Typeset the label for a chapter or appendix for the short contents.
3508 % The arg is, e.g. `Appendix A' for an appendix, or `3' for a chapter.
3509 % We could simplify the code here by writing out an \appendixentry
3510 % command in the toc file for appendices, instead of using \chapentry
3511 % for both, but it doesn't seem worth it.
3512 \setbox0 =
\hbox{\shortcontrm \putwordAppendix }
3513 \newdimen\shortappendixwidth \shortappendixwidth =
\wd0
3515 \def\shortchaplabel#1{%
3516 % We typeset #1 in a box of constant width, regardless of the text of
3517 % #1, so the chapter titles will come out aligned.
3518 \setbox0 =
\hbox{#1}%
3519 \dimen0 =
\ifdim\wd0 >
\shortappendixwidth \shortappendixwidth \else 0pt
\fi
3521 % This space should be plenty, since a single number is .5em, and the
3522 % widest letter (M) is 1em, at least in the Computer Modern fonts.
3523 % (This space doesn't include the extra space that gets added after
3524 % the label; that gets put in by \shortchapentry above.)
3525 \advance\dimen0 by
1.1em
3526 \hbox to
\dimen0{#1\hfil}%
3529 \def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
3530 \def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno{#2}}}
3533 \def\secentry#1#2#3#4{\dosecentry{#2.
#3\labelspace#1}{#4}}
3534 \def\unnumbsecentry#1#2{\dosecentry{#1}{#2}}
3537 \def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.
#3.
#4\labelspace#1}{#5}}
3538 \def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}}
3540 % And subsubsections.
3541 \def\subsubsecentry#1#2#3#4#5#6{%
3542 \dosubsubsecentry{#2.
#3.
#4.
#5\labelspace#1}{#6}}
3543 \def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}}
3545 % This parameter controls the indentation of the various levels.
3546 \newdimen\tocindent \tocindent =
3pc
3548 % Now for the actual typesetting. In all these, #1 is the text and #2 is the
3551 % If the toc has to be broken over pages, we want it to be at chapters
3552 % if at all possible; hence the \penalty.
3553 \def\dochapentry#1#2{%
3554 \penalty-
300 \vskip1\baselineskip plus
.33\baselineskip minus
.25\baselineskip
3557 \tocentry{#1}{\dopageno{#2}}%
3559 \nobreak\vskip .25\baselineskip plus
.1\baselineskip
3562 \def\dosecentry#1#2{\begingroup
3563 \secentryfonts \leftskip=
\tocindent
3564 \tocentry{#1}{\dopageno{#2}}%
3567 \def\dosubsecentry#1#2{\begingroup
3568 \subsecentryfonts \leftskip=
2\tocindent
3569 \tocentry{#1}{\dopageno{#2}}%
3572 \def\dosubsubsecentry#1#2{\begingroup
3573 \subsubsecentryfonts \leftskip=
3\tocindent
3574 \tocentry{#1}{\dopageno{#2}}%
3577 % Final typesetting of a toc entry; we use the same \entry macro as for
3578 % the index entries, but we want to suppress hyphenation here. (We
3579 % can't do that in the \entry macro, since index entries might consist
3580 % of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.)
3581 \def\tocentry#1#2{\begingroup
3582 \vskip 0pt plus1pt
% allow a little stretch for the sake of nice page breaks
3583 % Do not use \turnoffactive in these arguments. Since the toc is
3584 % typeset in cmr, so characters such as _ would come out wrong; we
3585 % have to do the usual translation tricks.
3589 % Space between chapter (or whatever) number and the title.
3590 \def\labelspace{\hskip1em \relax}
3592 \def\dopageno#1{{\rm #1}}
3593 \def\doshortpageno#1{{\rm #1}}
3595 \def\chapentryfonts{\secfonts \rm}
3596 \def\secentryfonts{\textfonts}
3597 \let\subsecentryfonts =
\textfonts
3598 \let\subsubsecentryfonts =
\textfonts
3601 \message{environments,
}
3603 % Since these characters are used in examples, it should be an even number of
3604 % \tt widths. Each \tt character is 1en, so two makes it 1em.
3605 % Furthermore, these definitions must come after we define our fonts.
3606 \newbox\dblarrowbox \newbox\longdblarrowbox
3607 \newbox\pushcharbox \newbox\bullbox
3608 \newbox\equivbox \newbox\errorbox
3611 %\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil}
3612 %\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil}
3613 %\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil}
3614 %\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil}
3615 % Adapted from the manmac format (p.420 of TeXbook)
3616 %\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex
3620 % @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
3622 \def\result{\leavevmode\raise.15ex
\hbox to
1em
{\hfil$
\Rightarrow$
\hfil}}
3623 \def\expansion{\leavevmode\raise.1ex
\hbox to
1em
{\hfil$
\mapsto$
\hfil}}
3624 \def\print{\leavevmode\lower.1ex
\hbox to
1em
{\hfil$
\dashv$
\hfil}}
3625 \def\equiv{\leavevmode\lower.1ex
\hbox to
1em
{\hfil$
\ptexequiv$
\hfil}}
3627 % Adapted from the TeXbook's \boxit.
3628 {\tentt \global\dimen0 =
3em
}% Width of the box.
3629 \dimen2 =
.55pt
% Thickness of rules
3630 % The text. (`r' is open on the right, `e' somewhat less so on the left.)
3631 \setbox0 =
\hbox{\kern-
.75pt
\tensf error
\kern-
1.5pt
}
3633 \global\setbox\errorbox=
\hbox to
\dimen0{\hfil
3634 \hsize =
\dimen0 \advance\hsize by -
5.8pt
% Space to left+right.
3635 \advance\hsize by -
2\dimen2 % Rules.
3637 \hrule height
\dimen2
3638 \hbox{\vrule width
\dimen2 \kern3pt % Space to left of text.
3639 \vtop{\kern2.4pt
\box0 \kern2.4pt
}% Space above/below.
3640 \kern3pt\vrule width
\dimen2}% Space to right.
3641 \hrule height
\dimen2}
3644 % The @error{} command.
3645 \def\error{\leavevmode\lower.7ex
\copy\errorbox}
3647 % @tex ... @end tex escapes into raw Tex temporarily.
3648 % One exception: @ is still an escape character, so that @end tex works.
3649 % But \@ or @@ will get a plain tex @ character.
3651 \def\tex{\begingroup
3652 \catcode `\\=
0 \catcode `\
{=
1 \catcode `\
}=
2
3653 \catcode `\$=
3 \catcode `\&=
4 \catcode `\#=
6
3654 \catcode `\^=
7 \catcode `
\_=
8 \catcode `\~=
13 \let~=
\tie
3656 \catcode 43=
12 % plus
3665 \let\bullet=
\ptexbullet
3670 \let\equiv=
\ptexequiv
3679 \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
3680 \def\enddots{\relax\ifmmode\endldots\else$
\mathsurround=
0pt
\endldots\,$
\fi}%
3682 \let\Etex=
\endgroup}
3684 % Define @lisp ... @endlisp.
3685 % @lisp does a \begingroup so it can rebind things,
3686 % including the definition of @endlisp (which normally is erroneous).
3688 % Amount to narrow the margins by for @lisp.
3689 \newskip\lispnarrowing \lispnarrowing=
0.4in
3691 % This is the definition that ^^M gets inside @lisp, @example, and other
3692 % such environments. \null is better than a space, since it doesn't
3694 \def\lisppar{\null\endgraf}
3696 % Make each space character in the input produce a normal interword
3697 % space in the output. Don't allow a line break at this space, as this
3698 % is used only in environments like @example, where each line of input
3699 % should produce a line of output anyway.
3702 \gdef\sepspaces{\obeyspaces\let =
\tie}}
3704 % Define \obeyedspace to be our active space, whatever it is. This is
3705 % for use in \parsearg.
3707 \global\let\obeyedspace=
}
3709 % This space is always present above and below environments.
3710 \newskip\envskipamount \envskipamount =
0pt
3712 % Make spacing and below environment symmetrical. We use \parskip here
3713 % to help in doing that, since in @example-like environments \parskip
3714 % is reset to zero; thus the \afterenvbreak inserts no space -- but the
3715 % start of the next paragraph will insert \parskip
3717 \def\aboveenvbreak{{\advance\envskipamount by
\parskip
3718 \endgraf \ifdim\lastskip<
\envskipamount
3719 \removelastskip \penalty-
50 \vskip\envskipamount \fi}}
3721 \let\afterenvbreak =
\aboveenvbreak
3723 % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins.
3724 \let\nonarrowing=
\relax
3726 % @cartouche ... @end cartouche: draw rectangle w/rounded corners around
3727 % environment contents.
3728 \font\circle=lcircle10
3730 \newdimen\cartouter\newdimen\cartinner
3731 \newskip\normbskip\newskip\normpskip\newskip\normlskip
3732 \circthick=
\fontdimen8\circle
3734 \def\ctl{{\circle\char'
013\hskip -
6pt
}}% 6pt from pl file: 1/2charwidth
3735 \def\ctr{{\hskip 6pt
\circle\char'
010}}
3736 \def\cbl{{\circle\char'
012\hskip -
6pt
}}
3737 \def\cbr{{\hskip 6pt
\circle\char'
011}}
3738 \def\carttop{\hbox to
\cartouter{\hskip\lskip
3739 \ctl\leaders\hrule height
\circthick\hfil\ctr
3741 \def\cartbot{\hbox to
\cartouter{\hskip\lskip
3742 \cbl\leaders\hrule height
\circthick\hfil\cbr
3745 \newskip\lskip\newskip\rskip
3747 \long\def\cartouche{%
3749 \lskip=
\leftskip \rskip=
\rightskip
3750 \leftskip=
0pt
\rightskip=
0pt
%we want these *outside*.
3751 \cartinner=
\hsize \advance\cartinner by-
\lskip
3752 \advance\cartinner by-
\rskip
3754 \advance\cartouter by
18.4pt
% allow for 3pt kerns on either
3755 % side, and for 6pt waste from
3756 % each corner char, and rule thickness
3757 \normbskip=
\baselineskip \normpskip=
\parskip \normlskip=
\lineskip
3758 % Flag to tell @lisp, etc., not to narrow margin.
3759 \let\nonarrowing=
\comment
3761 \baselineskip=
0pt
\parskip=
0pt
\lineskip=
0pt
3770 \baselineskip=
\normbskip
3771 \lineskip=
\normlskip
3787 % This macro is called at the beginning of all the @example variants,
3791 \inENV % This group ends at the end of the body
3792 \hfuzz =
12pt
% Don't be fussy
3793 \sepspaces % Make spaces be word-separators rather than space tokens.
3795 \let\par =
\lisppar % don't ignore blank lines
3796 \obeylines % each line of input is a line of output
3799 \emergencystretch =
0pt
% don't try to avoid overfull boxes
3800 % @cartouche defines \nonarrowing to inhibit narrowing
3801 % at next level down.
3802 \ifx\nonarrowing\relax
3803 \advance \leftskip by
\lispnarrowing
3804 \exdentamount=
\lispnarrowing
3805 \let\exdent=
\nofillexdent
3806 \let\nonarrowing=
\relax
3810 % Define the \E... control sequence only if we are inside the particular
3811 % environment, so the error checking in \end will work.
3813 % To end an @example-like environment, we first end the paragraph (via
3814 % \afterenvbreak's vertical glue), and then the group. That way we keep
3815 % the zero \parskip that the environments set -- \parskip glue will be
3816 % inserted at the beginning of the next paragraph in the document, after
3819 \def\nonfillfinish{\afterenvbreak\endgroup}
3821 % @lisp: indented, narrowed, typewriter font.
3822 \def\lisp{\begingroup
3824 \let\Elisp =
\nonfillfinish
3826 \let\kbdfont =
\kbdexamplefont % Allow @kbd to do something special.
3827 \gobble % eat return
3830 % @example: Same as @lisp.
3831 \def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp}
3833 % @small... is usually equivalent to the non-small (@smallbook
3834 % redefines). We must call \example (or whatever) last in the
3835 % definition, since it reads the return following the @example (or
3836 % whatever) command.
3838 % This actually allows (for example) @end display inside an
3839 % @smalldisplay. Too bad, but makeinfo will catch the error anyway.
3841 \def\smalldisplay{\begingroup\def\Esmalldisplay{\nonfillfinish\endgroup}\display}
3842 \def\smallexample{\begingroup\def\Esmallexample{\nonfillfinish\endgroup}\lisp}
3843 \def\smallformat{\begingroup\def\Esmallformat{\nonfillfinish\endgroup}\format}
3844 \def\smalllisp{\begingroup\def\Esmalllisp{\nonfillfinish\endgroup}\lisp}
3846 % Real @smallexample and @smalllisp (when @smallbook): use smaller fonts.
3847 % Originally contributed by Pavel@xerox.
3848 \def\smalllispx{\begingroup
3849 \def\Esmalllisp{\nonfillfinish\endgroup}%
3850 \def\Esmallexample{\nonfillfinish\endgroup}%
3855 % @display: same as @lisp except keep current font.
3857 \def\display{\begingroup
3859 \let\Edisplay =
\nonfillfinish
3863 % @smalldisplay (when @smallbook): @display plus smaller fonts.
3865 \def\smalldisplayx{\begingroup
3866 \def\Esmalldisplay{\nonfillfinish\endgroup}%
3871 % @format: same as @display except don't narrow margins.
3873 \def\format{\begingroup
3874 \let\nonarrowing = t
3876 \let\Eformat =
\nonfillfinish
3880 % @smallformat (when @smallbook): @format plus smaller fonts.
3882 \def\smallformatx{\begingroup
3883 \def\Esmallformat{\nonfillfinish\endgroup}%
3888 % @flushleft (same as @format).
3890 \def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format}
3894 \def\flushright{\begingroup
3895 \let\nonarrowing = t
3897 \let\Eflushright =
\nonfillfinish
3898 \advance\leftskip by
0pt plus
1fill
3902 % @quotation does normal linebreaking (hence we can't use \nonfillstart)
3903 % and narrows the margins.
3906 \begingroup\inENV %This group ends at the end of the @quotation body
3907 {\parskip=
0pt
\aboveenvbreak}% because \aboveenvbreak inserts \parskip
3910 % We have retained a nonzero parskip for the environment, since we're
3911 % doing normal filling. So to avoid extra space below the environment...
3912 \def\Equotation{\parskip =
0pt
\nonfillfinish}%
3914 % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
3915 \ifx\nonarrowing\relax
3916 \advance\leftskip by
\lispnarrowing
3917 \advance\rightskip by
\lispnarrowing
3918 \exdentamount =
\lispnarrowing
3919 \let\nonarrowing =
\relax
3925 % Define formatter for defuns
3926 % First, allow user to change definition object font (\df) internally
3927 \def\setdeffont #1 {\csname DEF
#1\endcsname}
3929 \newskip\defbodyindent \defbodyindent=
.4in
3930 \newskip\defargsindent \defargsindent=
50pt
3931 \newskip\deftypemargin \deftypemargin=
12pt
3932 \newskip\deflastargmargin \deflastargmargin=
18pt
3934 \newcount\parencount
3935 % define \functionparens, which makes ( and ) and & do special things.
3936 % \functionparens affects the group it is contained in.
3938 \catcode`\(=
\active \catcode`\)=
\active \catcode`\&=
\active
3939 \catcode`\
[=
\active \catcode`\
]=
\active}
3941 % Make control sequences which act like normal parenthesis chars.
3942 \let\lparen = (
\let\rparen = )
3944 {\activeparens % Now, smart parens don't turn on until &foo (see \amprm)
3946 % Be sure that we always have a definition for `(', etc. For example,
3947 % if the fn name has parens in it, \boldbrax will not be in effect yet,
3948 % so TeX would otherwise complain about undefined control sequence.
3949 \global\let(=
\lparen \global\let)=
\rparen
3950 \global\let[=
\lbrack \global\let]=
\rbrack
3952 \gdef\functionparens{\boldbrax\let&=
\amprm\parencount=
0 }
3953 \gdef\boldbrax{\let(=
\opnr\let)=
\clnr\let[=
\lbrb\let]=
\rbrb}
3954 % This is used to turn on special parens
3955 % but make & act ordinary (given that it's active).
3956 \gdef\boldbraxnoamp{\let(=
\opnr\let)=
\clnr\let[=
\lbrb\let]=
\rbrb\let&=
\ampnr}
3958 % Definitions of (, ) and & used in args for functions.
3959 % This is the definition of ( outside of all parentheses.
3960 \gdef\oprm#1 {{\rm\char`\(
}#1 \bf \let(=
\opnested
3961 \global\advance\parencount by
1
3964 % This is the definition of ( when already inside a level of parens.
3965 \gdef\opnested{\char`\(
\global\advance\parencount by
1 }
3967 \gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
3968 % also in that case restore the outer-level definition of (.
3969 \ifnum \parencount=
1 {\rm \char `\)
}\sl \let(=
\oprm \else \char `\)
\fi
3970 \global\advance \parencount by -
1 }
3971 % If we encounter &foo, then turn on ()-hacking afterwards
3972 \gdef\amprm#1 {{\rm\&
#1}\let(=
\oprm \let)=
\clrm\
}
3974 \gdef\normalparens{\boldbrax\let&=
\ampnr}
3975 } % End of definition inside \activeparens
3976 %% These parens (in \boldbrax) actually are a little bolder than the
3977 %% contained text. This is especially needed for [ and ]
3978 \def\opnr{{\sf\char`\(
}\global\advance\parencount by
1 }
3979 \def\clnr{{\sf\char`\)
}\global\advance\parencount by -
1 }
3981 \def\lbrb{{\bf\char`\
[}}
3982 \def\rbrb{{\bf\char`\
]}}
3984 % First, defname, which formats the header line itself.
3985 % #1 should be the function name.
3986 % #2 should be the type of definition, such as "Function".
3989 % Get the values of \leftskip and \rightskip as they were
3990 % outside the @def...
3992 \advance\dimen2 by -
\defbodyindent
3994 \advance\dimen3 by -
\defbodyindent
3996 \setbox0=
\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
3997 \dimen0=
\hsize \advance \dimen0 by -
\wd0 % compute size for first line
3998 \dimen1=
\hsize \advance \dimen1 by -
\defargsindent %size for continuations
3999 \parshape 2 0in
\dimen0 \defargsindent \dimen1 %
4000 % Now output arg 2 ("Function" or some such)
4001 % ending at \deftypemargin from the right margin,
4002 % but stuck inside a box of width 0 so it does not interfere with linebreaking
4003 {% Adjust \hsize to exclude the ambient margins,
4004 % so that \rightline will obey them.
4005 \advance \hsize by -
\dimen2 \advance \hsize by -
\dimen3
4006 \rlap{\rightline{{\rm #2}\hskip \deftypemargin}}}%
4007 % Make all lines underfull and no complaints:
4008 \tolerance=
10000 \hbadness=
10000
4009 \advance\leftskip by -
\defbodyindent
4010 \exdentamount=
\defbodyindent
4011 {\df #1}\enskip % Generate function name
4014 % Actually process the body of a definition
4015 % #1 should be the terminating control sequence, such as \Edefun.
4016 % #2 should be the "another name" control sequence, such as \defunx.
4017 % #3 should be the control sequence that actually processes the header,
4018 % such as \defunheader.
4020 \def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
4022 % Define the end token that this defining construct specifies
4023 % so that it will exit this group.
4024 \def#1{\endgraf\endgroup\medbreak}%
4025 \def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
4027 \advance\leftskip by
\defbodyindent \advance \rightskip by
\defbodyindent
4028 \exdentamount=
\defbodyindent
4030 \catcode 61=
\active % 61 is `='
4031 \obeylines\activeparens\spacesplit#3}
4033 % #1 is the \E... control sequence to end the definition (which we define).
4034 % #2 is the \...x control sequence for consecutive fns (which we define).
4035 % #3 is the control sequence to call to resume processing.
4036 % #4, delimited by the space, is the class name.
4038 \def\defmethparsebody#1#2#3#4 {\begingroup\inENV %
4040 % Define the end token that this defining construct specifies
4041 % so that it will exit this group.
4042 \def#1{\endgraf\endgroup\medbreak}%
4043 \def#2#
#1 {\begingroup\obeylines\activeparens\spacesplit{#3{#
#1}}}%
4045 \advance\leftskip by
\defbodyindent \advance \rightskip by
\defbodyindent
4046 \exdentamount=
\defbodyindent
4047 \begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
4049 % @deftypemethod has an extra argument that nothing else does. Sigh.
4050 % #1 is the \E... control sequence to end the definition (which we define).
4051 % #2 is the \...x control sequence for consecutive fns (which we define).
4052 % #3 is the control sequence to call to resume processing.
4053 % #4, delimited by the space, is the class name.
4054 % #5 is the method's return type.
4056 \def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV %
4058 % Define the end token that this defining construct specifies
4059 % so that it will exit this group.
4060 \def#1{\endgraf\endgroup\medbreak}%
4061 \def#2#
#1 #
#2 {\begingroup\obeylines\activeparens\spacesplit{#3{#
#1}{#
#2}}}%
4063 \advance\leftskip by
\defbodyindent \advance \rightskip by
\defbodyindent
4064 \exdentamount=
\defbodyindent
4065 \begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}}
4067 \def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
4069 % Define the end token that this defining construct specifies
4070 % so that it will exit this group.
4071 \def#1{\endgraf\endgroup\medbreak}%
4072 \def#2#
#1 #
#2 {\def#4{#
#1}%
4073 \begingroup\obeylines\activeparens\spacesplit{#3{#
#2}}}%
4075 \advance\leftskip by
\defbodyindent \advance \rightskip by
\defbodyindent
4076 \exdentamount=
\defbodyindent
4077 \begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
4079 % These parsing functions are similar to the preceding ones
4080 % except that they do not make parens into active characters.
4081 % These are used for "variables" since they have no arguments.
4083 \def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
4085 % Define the end token that this defining construct specifies
4086 % so that it will exit this group.
4087 \def#1{\endgraf\endgroup\medbreak}%
4088 \def#2{\begingroup\obeylines\spacesplit#3}%
4090 \advance\leftskip by
\defbodyindent \advance \rightskip by
\defbodyindent
4091 \exdentamount=
\defbodyindent
4093 \catcode 61=
\active %
4094 \obeylines\spacesplit#3}
4096 % This is used for \def{tp,vr}parsebody. It could probably be used for
4097 % some of the others, too, with some judicious conditionals.
4099 \def\parsebodycommon#1#2#3{%
4102 % Define the end token that this defining construct specifies
4103 % so that it will exit this group.
4104 \def#1{\endgraf\endgroup\medbreak}%
4105 \def#2#
#1 {\begingroup\obeylines\spacesplit{#3{#
#1}}}%
4107 \advance\leftskip by
\defbodyindent \advance \rightskip by
\defbodyindent
4108 \exdentamount=
\defbodyindent
4109 \begingroup\obeylines
4112 \def\defvrparsebody#1#2#3#4 {%
4113 \parsebodycommon{#1}{#2}{#3}%
4114 \spacesplit{#3{#4}}%
4117 % This loses on `@deftp {Data Type} {struct termios}' -- it thinks the
4118 % type is just `struct', because we lose the braces in `{struct
4119 % termios}' when \spacesplit reads its undelimited argument. Sigh.
4120 % \let\deftpparsebody=\defvrparsebody
4122 % So, to get around this, we put \empty in with the type name. That
4123 % way, TeX won't find exactly `{...}' as an undelimited argument, and
4124 % won't strip off the braces.
4126 \def\deftpparsebody #1#2#3#4 {%
4127 \parsebodycommon{#1}{#2}{#3}%
4128 \spacesplit{\parsetpheaderline{#3{#4}}}\empty
4131 % Fine, but then we have to eventually remove the \empty *and* the
4132 % braces (if any). That's what this does.
4134 \def\removeemptybraces\empty#1\relax{#1}
4136 % After \spacesplit has done its work, this is called -- #1 is the final
4137 % thing to call, #2 the type name (which starts with \empty), and #3
4138 % (which might be empty) the arguments.
4140 \def\parsetpheaderline#1#2#3{%
4141 #1{\removeemptybraces#2\relax}{#3}%
4144 \def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV %
4146 % Define the end token that this defining construct specifies
4147 % so that it will exit this group.
4148 \def#1{\endgraf\endgroup\medbreak}%
4149 \def#2#
#1 #
#2 {\def#4{#
#1}%
4150 \begingroup\obeylines\spacesplit{#3{#
#2}}}%
4152 \advance\leftskip by
\defbodyindent \advance \rightskip by
\defbodyindent
4153 \exdentamount=
\defbodyindent
4154 \begingroup\obeylines\spacesplit{#3{#5}}}
4156 % Split up #2 at the first space token.
4157 % call #1 with two arguments:
4158 % the first is all of #2 before the space token,
4159 % the second is all of #2 after that space token.
4160 % If #2 contains no space token, all of it is passed as the first arg
4161 % and the second is passed as empty.
4164 \gdef\spacesplit#1#2^^M
{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}%
4165 \long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{%
4167 #1{#2}{}\else #1{#2}{#3#4}\fi}}
4169 % So much for the things common to all kinds of definitions.
4173 % First, define the processing that is wanted for arguments of \defun
4174 % Use this to expand the args and terminate the paragraph they make up
4176 \def\defunargs #1{\functionparens \sl
4177 % Expand, preventing hyphenation at `-' chars.
4178 % Note that groups don't affect changes in \hyphenchar.
4181 \hyphenchar\tensl=
45
4182 \ifnum\parencount=
0 \else \errmessage{Unbalanced parentheses in @def
}\fi%
4183 \interlinepenalty=
10000
4184 \advance\rightskip by
0pt plus
1fil
4185 \endgraf\nobreak\vskip -
\parskip\nobreak
4188 \def\deftypefunargs #1{%
4189 % Expand, preventing hyphenation at `-' chars.
4190 % Note that groups don't affect changes in \hyphenchar.
4191 % Use \boldbraxnoamp, not \functionparens, so that & is not special.
4193 \tclose{#1}% avoid \code because of side effects on active chars
4194 \interlinepenalty=
10000
4195 \advance\rightskip by
0pt plus
1fil
4196 \endgraf\nobreak\vskip -
\parskip\nobreak
4199 % Do complete processing of one @defun or @defunx line already parsed.
4201 % @deffn Command forward-char nchars
4203 \def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader}
4205 \def\deffnheader #1#2#3{\doind {fn
}{\code{#2}}%
4206 \begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
4207 \catcode 61=
\other % Turn off change made in \defparsebody
4210 % @defun == @deffn Function
4212 \def\defun{\defparsebody\Edefun\defunx\defunheader}
4214 \def\defunheader #1#2{\doind {fn
}{\code{#1}}% Make entry in function index
4215 \begingroup\defname {#1}{Function
}%
4216 \defunargs {#2}\endgroup %
4217 \catcode 61=
\other % Turn off change made in \defparsebody
4220 % @deftypefun int foobar (int @var{foo}, float @var{bar})
4222 \def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader}
4224 % #1 is the data type. #2 is the name and args.
4225 \def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax}
4226 % #1 is the data type, #2 the name, #3 the args.
4227 \def\deftypefunheaderx #1#2 #3\relax{%
4228 \doind {fn
}{\code{#2}}% Make entry in function index
4229 \begingroup\defname {\defheaderxcond#1\relax$$$
#2}{Function
}%
4230 \deftypefunargs {#3}\endgroup %
4231 \catcode 61=
\other % Turn off change made in \defparsebody
4234 % @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
4236 \def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
4238 % \defheaderxcond#1\relax$$$
4239 % puts #1 in @code, followed by a space, but does nothing if #1 is null.
4240 \def\defheaderxcond#1#2$$$
{\ifx#1\relax\else\code{#1#2} \fi}
4242 % #1 is the classification. #2 is the data type. #3 is the name and args.
4243 \def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax}
4244 % #1 is the classification, #2 the data type, #3 the name, #4 the args.
4245 \def\deftypefnheaderx #1#2#3 #4\relax{%
4246 \doind {fn
}{\code{#3}}% Make entry in function index
4248 \normalparens % notably, turn off `&' magic, which prevents
4249 % at least some C++ text from working
4250 \defname {\defheaderxcond#2\relax$$$
#3}{#1}%
4251 \deftypefunargs {#4}\endgroup %
4252 \catcode 61=
\other % Turn off change made in \defparsebody
4255 % @defmac == @deffn Macro
4257 \def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
4259 \def\defmacheader #1#2{\doind {fn
}{\code{#1}}% Make entry in function index
4260 \begingroup\defname {#1}{Macro
}%
4261 \defunargs {#2}\endgroup %
4262 \catcode 61=
\other % Turn off change made in \defparsebody
4265 % @defspec == @deffn Special Form
4267 \def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
4269 \def\defspecheader #1#2{\doind {fn
}{\code{#1}}% Make entry in function index
4270 \begingroup\defname {#1}{Special Form
}%
4271 \defunargs {#2}\endgroup %
4272 \catcode 61=
\other % Turn off change made in \defparsebody
4275 % This definition is run if you use @defunx
4276 % anywhere other than immediately after a @defun or @defunx.
4278 \def\deffnx #1 {\errmessage{@deffnx in invalid context
}}
4279 \def\defunx #1 {\errmessage{@defunx in invalid context
}}
4280 \def\defmacx #1 {\errmessage{@defmacx in invalid context
}}
4281 \def\defspecx #1 {\errmessage{@defspecx in invalid context
}}
4282 \def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context
}}
4283 \def\deftypemethodx #1 {\errmessage{@deftypemethodx in invalid context
}}
4284 \def\deftypefunx #1 {\errmessage{@deftypefunx in invalid context
}}
4286 % @defmethod, and so on
4288 % @defop CATEGORY CLASS OPERATION ARG...
4290 \def\defop #1 {\def\defoptype{#1}%
4291 \defopparsebody\Edefop\defopx\defopheader\defoptype}
4293 \def\defopheader #1#2#3{%
4294 \dosubind {fn
}{\code{#2}}{\putwordon\
#1}% Make entry in function index
4295 \begingroup\defname {#2}{\defoptype{} on
#1}%
4296 \defunargs {#3}\endgroup %
4299 % @deftypemethod CLASS RETURN-TYPE METHOD ARG...
4301 \def\deftypemethod{%
4302 \deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader}
4304 % #1 is the class name, #2 the data type, #3 the method name, #4 the args.
4305 \def\deftypemethodheader#1#2#3#4{%
4306 \dosubind{fn
}{\code{#3}}{\putwordon\
\code{#1}}% entry in function index
4308 \defname{\defheaderxcond#2\relax$$$
#3}{\putwordMethodon\
\code{#1}}%
4309 \deftypefunargs{#4}%
4313 % @defmethod == @defop Method
4315 \def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
4317 % #1 is the class name, #2 the method name, #3 the args.
4318 \def\defmethodheader#1#2#3{%
4319 \dosubind{fn
}{\code{#2}}{\putwordon\
\code{#1}}% entry in function index
4321 \defname{#2}{\putwordMethodon\
\code{#1}}%
4326 % @defcv {Class Option} foo-class foo-flag
4328 \def\defcv #1 {\def\defcvtype{#1}%
4329 \defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
4331 \def\defcvarheader #1#2#3{%
4332 \dosubind {vr
}{\code{#2}}{of
#1}% Make entry in var index
4333 \begingroup\defname {#2}{\defcvtype{} of
#1}%
4334 \defvarargs {#3}\endgroup %
4337 % @defivar == @defcv {Instance Variable}
4339 \def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
4341 \def\defivarheader #1#2#3{%
4342 \dosubind {vr
}{\code{#2}}{of
#1}% Make entry in var index
4343 \begingroup\defname {#2}{Instance Variable of
#1}%
4344 \defvarargs {#3}\endgroup %
4347 % These definitions are run if you use @defmethodx, etc.,
4348 % anywhere other than immediately after a @defmethod, etc.
4350 \def\defopx #1 {\errmessage{@defopx in invalid context
}}
4351 \def\defmethodx #1 {\errmessage{@defmethodx in invalid context
}}
4352 \def\defcvx #1 {\errmessage{@defcvx in invalid context
}}
4353 \def\defivarx #1 {\errmessage{@defivarx in invalid context
}}
4357 % First, define the processing that is wanted for arguments of @defvar.
4358 % This is actually simple: just print them in roman.
4359 % This must expand the args and terminate the paragraph they make up
4360 \def\defvarargs #1{\normalparens #1%
4361 \interlinepenalty=
10000
4362 \endgraf\nobreak\vskip -
\parskip\nobreak}
4364 % @defvr Counter foo-count
4366 \def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader}
4368 \def\defvrheader #1#2#3{\doind {vr
}{\code{#2}}%
4369 \begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup}
4371 % @defvar == @defvr Variable
4373 \def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader}
4375 \def\defvarheader #1#2{\doind {vr
}{\code{#1}}% Make entry in var index
4376 \begingroup\defname {#1}{Variable
}%
4377 \defvarargs {#2}\endgroup %
4380 % @defopt == @defvr {User Option}
4382 \def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader}
4384 \def\defoptheader #1#2{\doind {vr
}{\code{#1}}% Make entry in var index
4385 \begingroup\defname {#1}{User Option
}%
4386 \defvarargs {#2}\endgroup %
4389 % @deftypevar int foobar
4391 \def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader}
4393 % #1 is the data type. #2 is the name, perhaps followed by text that
4394 % is actually part of the data type, which should not be put into the index.
4395 \def\deftypevarheader #1#2{%
4396 \dovarind#2 \relax% Make entry in variables index
4397 \begingroup\defname {\defheaderxcond#1\relax$$$
#2}{Variable
}%
4398 \interlinepenalty=
10000
4399 \endgraf\nobreak\vskip -
\parskip\nobreak
4401 \def\dovarind#1 #2\relax{\doind{vr
}{\code{#1}}}
4403 % @deftypevr {Global Flag} int enable
4405 \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
4407 \def\deftypevrheader #1#2#3{\dovarind#3 \relax%
4408 \begingroup\defname {\defheaderxcond#2\relax$$$
#3}{#1}
4409 \interlinepenalty=
10000
4410 \endgraf\nobreak\vskip -
\parskip\nobreak
4413 % This definition is run if you use @defvarx
4414 % anywhere other than immediately after a @defvar or @defvarx.
4416 \def\defvrx #1 {\errmessage{@defvrx in invalid context
}}
4417 \def\defvarx #1 {\errmessage{@defvarx in invalid context
}}
4418 \def\defoptx #1 {\errmessage{@defoptx in invalid context
}}
4419 \def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context
}}
4420 \def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context
}}
4423 % Args are printed in bold, a slight difference from @defvar.
4425 \def\deftpargs #1{\bf \defvarargs{#1}}
4427 % @deftp Class window height width ...
4429 \def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader}
4431 \def\deftpheader #1#2#3{\doind {tp
}{\code{#2}}%
4432 \begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
4434 % This definition is run if you use @deftpx, etc
4435 % anywhere other than immediately after a @deftp, etc.
4437 \def\deftpx #1 {\errmessage{@deftpx in invalid context
}}
4443 % To do this right we need a feature of e-TeX, \scantokens,
4444 % which we arrange to emulate with a temporary file in ordinary TeX.
4445 \ifx\eTeXversion\undefined
4446 \newwrite\macscribble
4448 \begingroup \newlinechar`\^^M
4449 \immediate\openout\macscribble=
\jobname.tmp
4450 \immediate\write\macscribble{#1}%
4451 \immediate\closeout\macscribble
4452 \let\xeatspaces\eatspaces
4458 \begingroup \newlinechar`\^^M
4459 \let\xeatspaces\eatspaces\scantokens{#1}\endgroup}
4462 \newcount\paramno % Count of parameters
4463 \newtoks\macname % Macro name
4464 \newif\ifrecursive % Is it recursive?
4467 % Thisdoes \let #1 = #2, except with \csnames.
4469 \expandafter\expandafter
4471 \expandafter\expandafter
4473 \csname#2\endcsname}
4475 % Trim leading and trailing spaces off a string.
4476 % Concepts from aro-bend problem 15 (see CTAN).
4478 \gdef\eatspaces #1{\expandafter\trim@
\expandafter{#1 }}
4479 \gdef\trim@
#1{\trim@@ @
#1 @
#1 @ @@
}
4480 \gdef\trim@@
#1@
#2@
#3@@
{\trim@@@
\empty #2 @
}
4482 \unbrace{\gdef\trim@@@
#1 } #2@
{#1}
4485 % Trim a single trailing ^^M off a string.
4486 {\catcode`\^^M=
12\catcode`
\Q=
3%
4487 \gdef\eatcr #1{\eatcra #1Q^^MQ
}%
4488 \gdef\eatcra#1^^MQ
{\eatcrb#1Q
}%
4489 \gdef\eatcrb#1Q
#2Q
{#1}%
4492 % Macro bodies are absorbed as an argument in a context where
4493 % all characters are catcode 10, 11 or 12, except \ which is active
4494 % (as in normal texinfo). It is necessary to change the definition of \.
4496 % It's necessary to have hard CRs when the macro is executed. This is
4497 % done by making ^^M (\endlinechar) catcode 12 when reading the macro
4498 % body, and then making it the \newlinechar in \scanmacro.
4500 \def\macrobodyctxt{%
4514 % \mbodybackslash is the definition of \ in @macro bodies.
4515 % It maps \foo\ => \csname macarg.foo\endcsname => #N
4516 % where N is the macro parameter number.
4517 % We define \csname macarg.\endcsname to be \realbackslash, so
4518 % \\ in macro replacement text gets you a backslash.
4520 {\catcode`@=
0 @catcode`@\=@active
4521 @gdef@usembodybackslash
{@let\=@mbodybackslash
}
4522 @gdef@mbodybackslash
#1\
{@csname macarg.
#1@endcsname
}
4524 \expandafter\def\csname macarg.
\endcsname{\realbackslash}
4526 \def\macro{\recursivefalse\parsearg\macroxxx}
4527 \def\rmacro{\recursivetrue\parsearg\macroxxx}
4530 \getargs{#1}% now \macname is the macname and \argl the arglist
4531 \ifx\argl\empty % no arguments
4534 \expandafter\parsemargdef \argl;
%
4536 \expandafter\ifx \csname macsave.
\the\macname\endcsname \relax
4537 \cslet{macsave.
\the\macname}{\the\macname}%
4539 \message{Warning: redefining
\the\macname}%
4541 \begingroup \macrobodyctxt
4542 \ifrecursive \expandafter\parsermacbody
4543 \else \expandafter\parsemacbody
4546 \def\unmacro{\parsearg\unmacroxxx}
4548 \expandafter\ifx \csname macsave.
\the\macname\endcsname \relax
4549 \errmessage{Macro
\the\macname\ not defined.
}%
4551 \cslet{#1}{macsave.
#1}%
4552 \expandafter\let \csname macsave.
\the\macname\endcsname \undefined
4556 % This makes use of the obscure feature that if the last token of a
4557 % <parameter list> is #, then the preceding argument is delimited by
4558 % an opening brace, and that opening brace is not consumed.
4559 \def\getargs#1{\getargsxxx#1{}}
4560 \def\getargsxxx#1#
{\getmacname #1 \relax\getmacargs}
4561 \def\getmacname #1 #2\relax{\macname=
{#1}}
4562 \def\getmacargs#1{\def\argl{#1}}
4564 % Parse the optional {params} list. Set up \paramno and \paramlist
4565 % so \defmacro knows what to do. Define \macarg.blah for each blah
4566 % in the params list, to be ##N where N is the position in that list.
4567 % That gets used by \mbodybackslash (above).
4569 % We need to get `macro parameter char #' into several definitions.
4570 % The technique used is stolen from LaTeX: let \hash be something
4571 % unexpandable, insert that wherever you need a #, and then redefine
4572 % it to # just before using the token list produced.
4574 % The same technique is used to protect \eatspaces till just before
4575 % the macro is used.
4577 \def\parsemargdef#1;
{\paramno=
0\def\paramlist{}%
4578 \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,
}
4579 \def\parsemargdefxxx#1,
{%
4580 \if#1;
\let\next=
\relax
4581 \else \let\next=
\parsemargdefxxx
4582 \advance\paramno by
1%
4583 \expandafter\edef\csname macarg.
\eatspaces{#1}\endcsname
4584 {\xeatspaces{\hash\the\paramno}}%
4585 \edef\paramlist{\paramlist\hash\the\paramno,
}%
4588 % These two commands read recursive and nonrecursive macro bodies.
4589 % (They're different since rec and nonrec macros end differently.)
4591 \long\def\parsemacbody#1@end macro
%
4592 {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
4593 \long\def\parsermacbody#1@end rmacro
%
4594 {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
4596 % This defines the macro itself. There are six cases: recursive and
4597 % nonrecursive macros of zero, one, and many arguments.
4598 % Much magic with \expandafter here.
4599 % \xdef is used so that macro definitions will survive the file
4600 % they're defined in; @include reads the file inside a group.
4602 \let\hash=##
% convert placeholders to macro parameter chars
4606 \expandafter\xdef\csname\the\macname\endcsname{%
4607 \noexpand\scanmacro{\temp}}%
4609 \expandafter\xdef\csname\the\macname\endcsname{%
4610 \noexpand\braceorline\csname\the\macname xxx
\endcsname}%
4611 \expandafter\xdef\csname\the\macname xxx
\endcsname#
#1{%
4612 \noexpand\scanmacro{\temp}}%
4614 \expandafter\xdef\csname\the\macname\endcsname#
#1{%
4615 \csname\the\macname xxx
\endcsname #
#1,
}%
4616 \expandafter\expandafter
4618 \expandafter\expandafter
4619 \csname\the\macname xxx
\endcsname
4620 \paramlist{\noexpand\scanmacro{\temp}}%
4625 \expandafter\xdef\csname\the\macname\endcsname{%
4626 \noexpand\norecurse{\the\macname}%
4627 \noexpand\scanmacro{\temp}\egroup}%
4629 \expandafter\xdef\csname\the\macname\endcsname{%
4630 \noexpand\braceorline\csname\the\macname xxx
\endcsname}%
4631 \expandafter\xdef\csname\the\macname xxx
\endcsname#
#1{%
4632 \noexpand\norecurse{\the\macname}%
4633 \noexpand\scanmacro{\temp}\egroup}%
4635 \expandafter\xdef\csname\the\macname\endcsname#
#1{%
4636 \csname\the\macname xxx
\endcsname #
#1,
}%
4637 \expandafter\expandafter
4639 \expandafter\expandafter
4640 \csname\the\macname xxx
\endcsname
4642 \noexpand\norecurse{\the\macname}%
4643 \noexpand\scanmacro{\temp}\egroup}%
4647 \def\norecurse#1{\bgroup\cslet{#1}{macsave.
#1}}
4649 % \braceorline decides whether the next nonwhitespace character is a
4650 % {. If so it reads up to the closing }, if not, it reads the whole
4651 % line. Whatever was read is then fed to the next control sequence
4652 % as an argument (by \parsebrace or \parsearg)
4653 \def\braceorline#1{\let\next=
#1\futurelet\nchar\braceorlinexxx}
4654 \def\braceorlinexxx{%
4655 \ifx\nchar\bgroup\else
4656 \expandafter\parsearg
4660 \message{cross references,
}
4663 \newif\ifhavexrefs % True if xref values are known.
4664 \newif\ifwarnedxrefs % True if we warned once that they aren't known.
4666 % @inforef is relatively simple.
4667 \def\inforef #1{\inforefzzz #1,,,,**
}
4668 \def\inforefzzz #1,
#2,
#3,
#4**
{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
4669 node
\samp{\ignorespaces#1{}}}
4671 % @node's job is to define \lastnode.
4672 \def\node{\ENVcheck\parsearg\nodezzz}
4673 \def\nodezzz#1{\nodexxx [#1,
]}
4674 \def\nodexxx[#1,
#2]{\gdef\lastnode{#1}}
4676 \let\lastnode=
\relax
4678 % The sectioning commands (@chapter, etc.) call these.
4680 \ifx\lastnode\relax\else
4681 \expandafter\expandafter\expandafter\setref{\lastnode}%
4682 {Ysectionnumberandtype
}%
4683 \global\let\lastnode=
\relax
4686 \def\unnumbnoderef{%
4687 \ifx\lastnode\relax\else
4688 \expandafter\expandafter\expandafter\setref{\lastnode}{Ynothing
}%
4689 \global\let\lastnode=
\relax
4692 \def\appendixnoderef{%
4693 \ifx\lastnode\relax\else
4694 \expandafter\expandafter\expandafter\setref{\lastnode}%
4695 {Yappendixletterandtype
}%
4696 \global\let\lastnode=
\relax
4701 % @anchor{NAME} -- define xref target at arbitrary point.
4703 \def\anchor#1{\setref{#1}{Ynothing
}}
4706 % \setref{NAME}{SNT} defines a cross-reference point NAME, namely
4707 % NAME-title, NAME-pg, and NAME-SNT. Called from \foonoderef. We have
4708 % to set \indexdummies so commands such as @code in a section title
4709 % aren't expanded. It would be nicer not to expand the titles in the
4710 % first place, but there's so many layers that that is hard to do.
4714 \dosetq{#1-title
}{Ytitle
}%
4715 \dosetq{#1-pg
}{Ypagenumber
}%
4719 % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
4720 % the node name, #2 the name of the Info cross-reference, #3 the printed
4721 % node name, #4 the name of the Info file, #5 the name of the printed
4722 % manual. All but the node name can be omitted.
4724 \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,
]}
4725 \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,
]}
4726 \def\ref#1{\xrefX[#1,,,,,,,
]}
4727 \def\xrefX[#1,
#2,
#3,
#4,
#5,
#6]{\begingroup
4728 \def\printedmanual{\ignorespaces #5}%
4729 \def\printednodename{\ignorespaces #3}%
4730 \setbox1=
\hbox{\printedmanual}%
4731 \setbox0=
\hbox{\printednodename}%
4733 % No printed node name was explicitly given.
4734 \expandafter\ifx\csname SETxref-automatic-section-title
\endcsname\relax
4735 % Use the node name inside the square brackets.
4736 \def\printednodename{\ignorespaces #1}%
4738 % Use the actual chapter/section title appear inside
4739 % the square brackets. Use the real section title if we have it.
4741 % It is in another manual, so we don't have it.
4742 \def\printednodename{\ignorespaces #1}%
4745 % We know the real title if we have the xref values.
4746 \def\printednodename{\refx{#1-title
}{}}%
4748 % Otherwise just copy the Info node name.
4749 \def\printednodename{\ignorespaces #1}%
4755 % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
4756 % insert empty discretionaries after hyphens, which means that it will
4757 % not find a line break at a hyphen in a node names. Since some manuals
4758 % are best written with fairly long node names, containing hyphens, this
4759 % is a loss. Therefore, we give the text of the node name again, so it
4760 % is as if TeX is seeing it for the first time.
4762 \putwordsection{} ``
\printednodename'' in
\cite{\printedmanual}%
4764 % _ (for example) has to be the character _ for the purposes of the
4765 % control sequence corresponding to the node, but it has to expand
4766 % into the usual \leavevmode...\vrule stuff for purposes of
4767 % printing. So we \turnoffactive for the \refx-snt, back on for the
4768 % printing, back off for the \refx-pg.
4769 {\normalturnoffactive
4770 % Only output a following space if the -snt ref is nonempty; for
4771 % @unnumbered and @anchor, it won't be.
4772 \setbox2 =
\hbox{\ignorespaces \refx{#1-snt
}{}}%
4773 \ifdim \wd2 >
0pt
\refx{#1-snt
}\space\fi
4776 [\printednodename],
\space
4778 \turnoffactive \putwordpage\tie\refx{#1-pg
}{}%
4782 % \dosetq is the interface for calls from other macros
4784 % Use \normalturnoffactive so that punctuation chars such as underscore
4785 % and backslash work in node names. (\turnoffactive doesn't do \.)
4788 \normalturnoffactive
4789 \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}%
4796 % \internalsetq {foo}{page} expands into
4797 % CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
4798 % When the aux file is read, ' is the escape character
4800 \def\internalsetq #1#2{'xrdef
{#1}{\csname #2\endcsname}}
4802 % Things to be expanded by \internalsetq
4804 \def\Ypagenumber{\folio}
4806 \def\Ytitle{\thissection}
4810 \def\Ysectionnumberandtype{%
4811 \ifnum\secno=
0 \putwordChapter\xreftie\the\chapno %
4812 \else \ifnum \subsecno=
0 \putwordSection\xreftie\the\chapno.
\the\secno %
4813 \else \ifnum \subsubsecno=
0 %
4814 \putwordSection\xreftie\the\chapno.
\the\secno.
\the\subsecno %
4816 \putwordSection\xreftie\the\chapno.
\the\secno.
\the\subsecno.
\the\subsubsecno %
4819 \def\Yappendixletterandtype{%
4820 \ifnum\secno=
0 \putwordAppendix\xreftie'char
\the\appendixno{}%
4821 \else \ifnum \subsecno=
0 \putwordSection\xreftie'char
\the\appendixno.
\the\secno %
4822 \else \ifnum \subsubsecno=
0 %
4823 \putwordSection\xreftie'char
\the\appendixno.
\the\secno.
\the\subsecno %
4825 \putwordSection\xreftie'char
\the\appendixno.
\the\secno.
\the\subsecno.
\the\subsubsecno %
4830 % Use TeX 3.0's \inputlineno to get the line number, for better error
4831 % messages, but if we're using an old version of TeX, don't do anything.
4833 \ifx\inputlineno\thisisundefined
4834 \let\linenumber =
\empty % Non-3.0.
4836 \def\linenumber{\the\inputlineno:
\space}
4839 % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
4840 % If its value is nonempty, SUFFIX is output afterward.
4843 \expandafter\ifx\csname X
#1\endcsname\relax
4844 % If not defined, say something at least.
4845 \angleleft un\-de\-fined
\angleright
4848 \message{\linenumber Undefined cross reference `
#1'.
}%
4851 \global\warnedxrefstrue
4852 \message{Cross reference values unknown; you must run TeX again.
}%
4857 % It's defined, so just use it.
4858 \csname X
#1\endcsname
4860 #2% Output the suffix in any case.
4863 % This is the macro invoked by entries in the aux file.
4865 \def\xrdef#1{\begingroup
4866 % Reenable \ as an escape while reading the second argument.
4868 \afterassignment\endgroup
4869 \expandafter\gdef\csname X
#1\endcsname
4872 % Read the last existing aux file, if any. No error if none exists.
4873 \def\readauxfile{\begingroup
4874 \catcode`\^^@=
\other
4875 \catcode`\^^A=
\other
4876 \catcode`\^^B=
\other
4877 \catcode`\^^C=
\other
4878 \catcode`\^^D=
\other
4879 \catcode`\^^E=
\other
4880 \catcode`\^^F=
\other
4881 \catcode`\^^G=
\other
4882 \catcode`\^^H=
\other
4883 \catcode`\^^K=
\other
4884 \catcode`\^^L=
\other
4885 \catcode`\^^N=
\other
4886 \catcode`\^^P=
\other
4887 \catcode`\^^Q=
\other
4888 \catcode`\^^R=
\other
4889 \catcode`\^^S=
\other
4890 \catcode`\^^T=
\other
4891 \catcode`\^^U=
\other
4892 \catcode`\^^V=
\other
4893 \catcode`\^^W=
\other
4894 \catcode`\^^X=
\other
4895 \catcode`\^^Z=
\other
4896 \catcode`\^^
[=
\other
4897 \catcode`\^^\=
\other
4898 \catcode`\^^
]=
\other
4899 \catcode`\^^^=
\other
4900 \catcode`\^^_=
\other
4903 % It was suggested to define this as 7, which would allow ^^e4 etc.
4904 % in xref tags, i.e., node names. But since ^^e4 notation isn't
4905 % supported in the main text, it doesn't seem desirable. Furthermore,
4906 % that is not enough: for node names that actually contain a ^
4907 % character, we would end up writing a line like this: 'xrdef {'hat
4908 % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
4909 % argument, and \hat is not an expandable control sequence. It could
4910 % all be worked out, but why? Either we support ^^ or we don't.
4912 % The other change necessary for this was to define \auxhat:
4913 % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
4914 % and then to call \auxhat in \setq.
4927 \catcode`+=
\other % avoid \+ for paranoia even though we've turned it off
4928 % Make the characters 128-255 be printing characters
4932 \catcode\count 1=
\other
4933 \advance\count 1 by
1
4934 \ifnum \count 1<
256 \loop \fi
4937 % The aux file uses ' as the escape (for now).
4938 % Turn off \ as an escape so we do not lose on
4939 % entries which were dumped with control sequences in their names.
4940 % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
4941 % Reference to such entries still does not work the way one would wish,
4942 % but at least they do not bomb out when the aux file is read in.
4949 \openin 1 \jobname.aux
4953 \global\havexrefstrue
4954 \global\warnedobstrue
4956 % Open the new aux file. TeX will close it automatically at exit.
4957 \openout\auxfile=
\jobname.aux
4963 \newcount \footnoteno
4965 % The trailing space in the following definition for supereject is
4966 % vital for proper filling; pages come out unaligned when you do a
4967 % pagealignmacro call if that space before the closing brace is
4968 % removed. (Generally, numeric constants should always be followed by a
4969 % space to prevent strange expansion errors.)
4970 \def\supereject{\par\penalty -
20000\footnoteno =
0 }
4972 % @footnotestyle is meaningful for info output only.
4973 \let\footnotestyle=
\comment
4975 \let\ptexfootnote=
\footnote
4979 % Auto-number footnotes. Otherwise like plain.
4981 \global\advance\footnoteno by \@ne
4982 \edef\thisfootno{$^
{\the\footnoteno}$
}%
4984 % In case the footnote comes at the end of a sentence, preserve the
4985 % extra spacing after we do the footnote number.
4987 \ifhmode\edef\@sf
{\spacefactor\the\spacefactor}\/
\fi
4989 % Remove inadvertent blank space before typesetting the footnote number.
4995 % Don't bother with the trickery in plain.tex to not require the
4996 % footnote text as a parameter. Our footnotes don't need to be so general.
4998 % Oh yes, they do; otherwise, @ifset and anything else that uses
4999 % \parseargline fail inside footnotes because the tokens are fixed when
5000 % the footnote is read. --karl, 16nov96.
5002 \long\gdef\footnotezzz{\insert\footins\bgroup
5003 % We want to typeset this text as a normal paragraph, even if the
5004 % footnote reference occurs in (for example) a display environment.
5005 % So reset some parameters.
5006 \interlinepenalty\interfootnotelinepenalty
5007 \splittopskip\ht\strutbox % top baseline for broken footnotes
5008 \splitmaxdepth\dp\strutbox
5009 \floatingpenalty\@MM
5014 \parindent\defaultparindent
5016 % Hang the footnote text off the number.
5018 \textindent{\thisfootno}%
5020 % Don't crash into the line above the footnote text. Since this
5021 % expands into a box, it must come within the paragraph, lest it
5022 % provide a place where TeX can split the footnote.
5024 \futurelet\next\fo@t
5026 \def\fo@t
{\ifcat\bgroup\noexpand\next \let\next\f@@t
5027 \else\let\next\f@t
\fi \next}
5028 \def\f@@t
{\bgroup\aftergroup\@foot
\let\next}
5029 \def\f@t
#1{#1\@foot
}
5030 \def\@foot
{\strut\egroup}
5032 }%end \catcode `\@=11
5034 % Set the baselineskip to #1, and the lineskip and strut size
5035 % correspondingly. There is no deep meaning behind these magic numbers
5036 % used as factors; they just match (closely enough) what Knuth defined.
5038 \def\lineskipfactor{.08333}
5039 \def\strutheightpercent{.70833}
5040 \def\strutdepthpercent {.29167}
5043 \normalbaselineskip =
#1\relax
5044 \normallineskip =
\lineskipfactor\normalbaselineskip
5046 \setbox\strutbox =
\hbox{%
5047 \vrule width0pt height
\strutheightpercent\baselineskip
5048 depth
\strutdepthpercent \baselineskip
5052 % @| inserts a changebar to the left of the current line. It should
5053 % surround any changed text. This approach does *not* work if the
5054 % change spans more than two lines of output. To handle that, we would
5055 % have adopt a much more difficult approach (putting marks into the main
5056 % vertical list for the beginning and end of each change).
5059 % \vadjust can only be used in horizontal mode.
5062 % Append this vertical mode material after the current line in the output.
5064 % We want to insert a rule with the height and depth of the current
5065 % leading; that is exactly what \strutbox is supposed to record.
5066 \vskip-
\baselineskip
5068 % \vadjust-items are inserted at the left edge of the type. So
5069 % the \llap here moves out into the left-hand margin.
5072 % For a thicker or thinner bar, change the `1pt'.
5073 \vrule height
\baselineskip width1pt
5075 % This is the space between the bar and the text.
5081 % For a final copy, take out the rectangles
5082 % that mark overfull boxes (in case you have decided
5083 % that the text looks ok even though it passes the margin).
5085 \def\finalout{\overfullrule=
0pt
}
5087 % @image. We use the macros from epsf.tex to support this.
5088 % If epsf.tex is not installed and @image is used, we complain.
5090 % Check for and read epsf.tex up front. If we read it only at @image
5091 % time, we might be inside a group, and then its definitions would get
5092 % undone and the next image would fail.
5093 \openin 1 = epsf.tex
5096 % Do not bother showing banner with post-v2.7 epsf.tex (available in
5097 % doc/epsf.tex until it shows up on ctan).
5098 \def\epsfannounce{\toks0 =
}%
5102 \newif\ifwarnednoepsf
5103 \newhelp\noepsfhelp{epsf.tex must be installed for images to
5104 work. It is also included in the Texinfo distribution, or you can get
5105 it from ftp://ftp.tug.org/tex/epsf.tex.
}
5107 % Only complain once about lack of epsf.tex.
5109 \ifx\epsfbox\undefined
5110 \ifwarnednoepsf \else
5111 \errhelp =
\noepsfhelp
5112 \errmessage{epsf.tex not found, images will be ignored
}%
5113 \global\warnednoepsftrue
5116 \imagexxx #1,,,
\finish
5120 % Arguments to @image:
5121 % #1 is (mandatory) image filename; we tack on .eps extension.
5122 % #2 is (optional) width, #3 is (optional) height.
5123 % #4 is just the usual extra ignored arg for parsing this stuff.
5124 \def\imagexxx#1,
#2,
#3,
#4\finish{%
5125 % \epsfbox itself resets \epsf?size at each figure.
5126 \setbox0 =
\hbox{\ignorespaces #2}\ifdim\wd0 >
0pt
\epsfxsize=
#2\relax \fi
5127 \setbox0 =
\hbox{\ignorespaces #3}\ifdim\wd0 >
0pt
\epsfysize=
#3\relax \fi
5128 % If the image is by itself, center it.
5132 \centerline{\epsfbox{#1.eps
}}%
5140 \message{paper sizes,
}
5141 % And other related parameters.
5143 \newdimen\defaultparindent \defaultparindent =
15pt
5145 \chapheadingskip =
15pt plus
4pt minus
2pt
5146 \secheadingskip =
12pt plus
3pt minus
2pt
5147 \subsecheadingskip =
9pt plus
2pt minus
2pt
5149 % Prevent underfull vbox error messages.
5152 % Don't be so finicky about underfull hboxes, either.
5155 % Following George Bush, just get rid of widows and orphans.
5159 % Use TeX 3.0's \emergencystretch to help line breaking, but if we're
5160 % using an old version of TeX, don't do anything. We want the amount of
5161 % stretch added to depend on the line length, hence the dependence on
5162 % \hsize. This makes it come to about 9pt for the 8.5x11 format. We
5163 % call this whenever the paper size is set.
5165 \def\setemergencystretch{%
5166 \ifx\emergencystretch\thisisundefined
5167 % Allow us to assign to \emergencystretch anyway.
5168 \def\emergencystretch{\dimen0}%
5170 \emergencystretch =
\hsize
5171 \divide\emergencystretch by
45
5175 % Parameters in order: 1) textheight; 2) textwidth; 3) voffset;
5176 % 4) hoffset; 5) binding offset; 6) topskip. Then whoever calls us can
5177 % set \parskip and call \setleading for \baselineskip.
5179 \def\internalpagesizes#1#2#3#4#5#6{%
5182 \splittopskip =
\topskip
5185 \advance\vsize by
\topskip
5186 \outervsize =
\vsize
5187 \advance\outervsize by
0.6in
5188 \pageheight =
\vsize
5191 \outerhsize =
\hsize
5192 \advance\outerhsize by
0.5in
5195 \normaloffset =
#4\relax
5196 \bindingoffset =
#5\relax
5198 \parindent =
\defaultparindent
5199 \setemergencystretch
5202 % @letterpaper (the default).
5203 \def\letterpaper{{\globaldefs =
1
5204 \parskip =
3pt plus
2pt minus
1pt
5205 \setleading{13.2pt
}%
5207 % If page is nothing but text, make it come out even.
5208 \internalpagesizes{46\baselineskip}{6in
}{\voffset}{.25in
}{\bindingoffset}{36pt
}%
5211 % Use @smallbook to reset parameters for 7x9.5 (or so) format.
5212 \def\smallbook{{\globaldefs =
1
5213 \parskip =
2pt plus
1pt
5216 \internalpagesizes{7.5in
}{5.in
}{\voffset}{.25in
}{\bindingoffset}{16pt
}%
5218 \lispnarrowing =
0.3in
5221 \contentsrightmargin =
0pt
5222 \deftypemargin =
0pt
5223 \defbodyindent =
.5cm
5225 \let\smalldisplay =
\smalldisplayx
5226 \let\smallexample =
\smalllispx
5227 \let\smallformat =
\smallformatx
5228 \let\smalllisp =
\smalllispx
5231 % Use @afourpaper to print on European A4 paper.
5232 \def\afourpaper{{\globaldefs =
1
5234 \parskip =
3pt plus
2pt minus
1pt
5236 \internalpagesizes{53\baselineskip}{160mm
}{\voffset}{4mm
}{\bindingoffset}{44pt
}%
5242 % A specific text layout, 24x15cm overall, intended for A4 paper. Top margin
5243 % 29mm, hence bottom margin 28mm, nominal side margin 3cm.
5244 \def\afourlatex{{\globaldefs =
1
5245 \setleading{13.6pt
}%
5248 \internalpagesizes{237mm
}{150mm
}{3.6mm
}{3.6mm
}{3mm
}{7mm
}%
5253 % Use @afourwide to print on European A4 paper in wide format.
5256 \internalpagesizes{9.5in
}{6.5in
}{\hoffset}{\normaloffset}{\bindingoffset}{7mm
}%
5261 % @pagesizes TEXTHEIGHT[,TEXTWIDTH]
5262 % Perhaps we should allow setting the margins, \topskip, \parskip,
5263 % and/or leading, also. Or perhaps we should compute them somehow.
5265 \def\pagesizes{\parsearg\pagesizesxxx}
5266 \def\pagesizesxxx#1{\pagesizesyyy #1,,
\finish}
5267 \def\pagesizesyyy#1,
#2,
#3\finish{{%
5268 \setbox0 =
\hbox{\ignorespaces #2}\ifdim\wd0 >
0pt
\hsize=
#2\relax \fi
5271 \parskip =
3pt plus
2pt minus
1pt
5272 \setleading{13.2pt
}%
5274 \internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt
}%
5277 % Set default to letter.
5281 \message{and turning on texinfo input format.
}
5283 % Define macros to output various characters with catcode for normal text.
5292 \def\normaldoublequote{"
}
5295 \def\normalunderscore{_
}
5296 \def\normalverticalbar{|
}
5298 \def\normalgreater{>
}
5301 % This macro is used to make a character print one way in ttfont
5302 % where it can probably just be output, and another way in other fonts,
5303 % where something hairier probably needs to be done.
5305 % #1 is what to print if we are indeed using \tt; #2 is what to print
5306 % otherwise. Since all the Computer Modern typewriter fonts have zero
5307 % interword stretch (and shrink), and it is reasonable to expect all
5308 % typewriter fonts to have this, we can check that font parameter.
5310 \def\ifusingtt#1#2{\ifdim \fontdimen3\the\font=
0pt
#1\else #2\fi}
5312 % Turn off all special characters except @
5313 % (and those which the user can use as if they were ordinary).
5314 % Most of these we simply print from the \tt font, but for some, we can
5315 % use math or other variants that look better in normal text.
5318 \def\activedoublequote{{\tt\char34}}
5319 \let"=
\activedoublequote
5321 \def~
{{\tt\char126}}
5327 \def_{\ifusingtt\normalunderscore\_}
5328 % Subroutine for the previous macro.
5329 \def\_{\leavevmode \kern.06em
\vbox{\hrule width
.3em height
.1ex
}}
5332 \def|
{{\tt\char124}}
5340 \def+
{{\tt \char 43}}
5341 %\catcode 27=\active
5342 %\def^^[{$\diamondsuit$}
5344 % Set up an active definition for =, but don't enable it most of the time.
5345 {\catcode`\==
\active
5346 \global\def=
{{\tt \char 61}}}
5351 % If a .fmt file is being used, characters that might appear in a file
5352 % name cannot be active until we have parsed the command line.
5353 % So turn them off again, and have \everyjob (or @setfilename) turn them on.
5354 % \otherifyactive is called near the end of this file.
5355 \def\otherifyactive{\catcode`+=
\other \catcode`
\_=
\other}
5359 % \rawbackslashxx output one backslash character in current font
5360 \global\chardef\rawbackslashxx=`\\
5361 %{\catcode`\\=\other
5362 %@gdef@rawbackslashxx{\}}
5364 % \rawbackslash redefines \ as input to do \rawbackslashxx.
5365 {\catcode`\\=
\active
5366 @gdef@rawbackslash
{@let\=@rawbackslashxx
}}
5368 % \normalbackslash outputs one backslash in fixed width font.
5369 \def\normalbackslash{{\tt\rawbackslashxx}}
5371 % Say @foo, not \foo, in error messages.
5374 % \catcode 17=0 % Define control-q
5377 % Used sometimes to turn off (effectively) the active characters
5378 % even after parsing them.
5379 @def@turnoffactive
{@let"=@normaldoublequote
5380 @let\=@realbackslash
5383 @let_=@normalunderscore
5384 @let|=@normalverticalbar
5386 @let>=@normalgreater
5389 @def@normalturnoffactive
{@let"=@normaldoublequote
5390 @let\=@normalbackslash
5393 @let_=@normalunderscore
5394 @let|=@normalverticalbar
5396 @let>=@normalgreater
5399 % Make _ and + \other characters, temporarily.
5400 % This is canceled by @fixbackslash.
5403 % If a .fmt file is being used, we don't want the `\input texinfo' to show up.
5404 % That is what \eatinput is for; after that, the `\' should revert to printing
5407 @gdef@eatinput input texinfo
{@fixbackslash
}
5408 @global@let\ = @eatinput
5410 % On the other hand, perhaps the file did not have a `\input texinfo'. Then
5411 % the first `\{ in the file would cause an error. This macro tries to fix
5412 % that, assuming it is called before the first `\' could plausibly occur.
5413 % Also back turn on active characters that might appear in the input
5414 % file name, in case not using a pre-dumped format.
5416 @gdef@fixbackslash
{@ifx\@eatinput @let\ = @normalbackslash @fi
5417 @catcode`+=@active @catcode`@_=@active
}
5419 % These look ok in all fonts, so just make them not special. The @rm below
5420 % makes sure that the current font starts out as the newly loaded cmr10
5421 @catcode`@$=@other @catcode`@
%=@other @catcode`@&=@other @catcode`@#=@other
5427 @c page-delimiter: "^\\\
\message"