1 %% TeX macros to handle Texinfo files.
2 %% $Id: texinfo.tex,v 1.6 1997/03/09 06:17:27 tromey Exp $
4 % Copyright (C) 1985, 86, 88, 90, 91, 92, 93,
5 % 94, 95, 96, 97 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.
23 %In other words, you are welcome to use, share and improve this program.
24 %You are forbidden to forbid anyone else to use, share and improve
25 %what you give them. Help stamp out software-hoarding!
28 % Send bug reports to bug-texinfo@prep.ai.mit.edu.
29 % Please include a *precise* test case in each bug report.
32 % Make it possible to create a .fmt file just by loading this file:
33 % if the underlying format is not loaded, start by loading it now.
34 % Added by gildea November 1993.
35 \expandafter\ifx\csname fmtname
\endcsname\relax\input plain
\fi
37 % This automatically updates the version number based on RCS.
38 \def\deftexinfoversion$
#1:
#2 $
{\def\texinfoversion{#2}}
39 \deftexinfoversion$Revision:
1.6 $
40 \message{Loading texinfo package
[Version
\texinfoversion]:
}
42 % If in a .fmt file, print the version number
43 % and turn on active characters that we couldn't do earlier because
44 % they might have appeared in the input file name.
45 \everyjob{\message{[Texinfo version
\texinfoversion]}\message{}
46 \catcode`+=
\active \catcode`
\_=
\active}
48 % Save some parts of plain tex whose names we will redefine.
51 \let\ptexbullet=
\bullet
57 \let\ptexequiv =
\equiv
64 % Be sure we're in horizontal mode when doing a tie, since we make space
65 % equivalent to this in @example-like environments. Otherwise, a space
66 % at the beginning of a line will start with \penalty -- and
67 % since \penalty is valid in vertical mode, we'd end up putting the
68 % penalty on the vertical list instead of in the new paragraph.
70 % Avoid using \@M directly, because that causes trouble
71 % if the definition is written into an index file.
72 \global\let\tiepenalty = \@M
73 \gdef\tie{\leavevmode\penalty\tiepenalty\
}
80 % If this character appears in an error message or help string, it
81 % starts a new line in the output.
84 % Set up fixed words for English.
85 \ifx\putwordChapter\undefined{\gdef\putwordChapter{Chapter
}}\fi%
86 \def\putwordInfo{Info
}%
87 \ifx\putwordSee\undefined{\gdef\putwordSee{See
}}\fi%
88 \ifx\putwordsee\undefined{\gdef\putwordsee{see
}}\fi%
89 \ifx\putwordfile\undefined{\gdef\putwordfile{file
}}\fi%
90 \ifx\putwordpage\undefined{\gdef\putwordpage{page
}}\fi%
91 \ifx\putwordsection\undefined{\gdef\putwordsection{section
}}\fi%
92 \ifx\putwordSection\undefined{\gdef\putwordSection{Section
}}\fi%
93 \ifx\putwordTableofContents\undefined{\gdef\putwordTableofContents{Table of Contents
}}\fi%
94 \ifx\putwordShortContents\undefined{\gdef\putwordShortContents{Short Contents
}}\fi%
95 \ifx\putwordAppendix\undefined{\gdef\putwordAppendix{Appendix
}}\fi%
101 \hyphenation{ap-pen-dix
}
102 \hyphenation{mini-buf-fer mini-buf-fers
}
105 % Margin to add to right of even pages, to left of odd pages.
106 \newdimen \bindingoffset
107 \newdimen \normaloffset
108 \newdimen\pagewidth \newdimen\pageheight
110 % Sometimes it is convenient to have everything in the transcript file
111 % and nothing on the terminal. We don't just call \tracingall here,
112 % since that produces some useless output on the terminal.
114 \def\gloggingall{\begingroup \globaldefs =
1 \loggingall \endgroup}%
115 \def\loggingall{\tracingcommands2 \tracingstats2
116 \tracingpages1 \tracingoutput1 \tracinglostchars1
117 \tracingmacros2 \tracingparagraphs1 \tracingrestores1
118 \showboxbreadth\maxdimen\showboxdepth\maxdimen
121 %---------------------Begin change-----------------------
123 %%%% For @cropmarks command.
124 % Dimensions to add cropmarks at corners Added by P. A. MacKay, 12 Nov. 1986
126 \newdimen\cornerlong \newdimen\cornerthick
127 \newdimen \topandbottommargin
128 \newdimen \outerhsize \newdimen \outervsize
129 \cornerlong=
1pc
\cornerthick=
.3pt
% These set size of cropmarks
132 % Alternative @smallbook page size is 9.25in
134 \topandbottommargin=
.75in
136 %---------------------End change-----------------------
138 % Main output routine.
140 \output =
{\onepageout{\pagecontents\PAGE}}
142 \newbox\headlinebox \newbox\footlinebox
144 % \onepageout takes a vbox as an argument. Note that \pagecontents
145 % does insertions, but you have to call it yourself.
147 \hoffset=
\normaloffset
148 \ifodd\pageno \advance\hoffset by
\bindingoffset
149 \else \advance\hoffset by -
\bindingoffset\fi
151 % Do this outside of the \shipout so @code etc. will be expanded in
152 % the headline as they should be, not taken literally (outputting ''code).
153 \setbox\headlinebox =
\vbox{\let\hsize=
\pagewidth \makeheadline}%
154 \setbox\footlinebox =
\vbox{\let\hsize=
\pagewidth \makefootline}%
157 % Have to do this stuff outside the \shipout because we want it to
158 % take effect in \write's, yet the group defined by the \vbox ends
159 % before the \shipout runs.
161 \escapechar = `\\
% use backslash in output files.
162 \indexdummies % don't expand commands in the output.
163 \normalturnoffactive % \ in index entries must not stay \, e.g., if
164 % the page break happens to be in the middle of an example.
172 \ifnum\outputpenalty>-
20000 \else\dosupereject\fi
175 %%%% For @cropmarks command %%%%
177 % Here is a modification of the main output routine for Near East Publications
178 % This provides right-angle cropmarks at all four corners.
179 % The contents of the page are centerlined into the cropmarks,
180 % and any desired binding offset is added as an \hskip on either
181 % site of the centerlined box. (P. A. MacKay, 12 November, 1986)
183 \def\croppageout#1{\hoffset=
0pt
% make sure this doesn't mess things up
184 {\escapechar=`\\
\relax % makes sure backslash is used in output files.
186 \vbox to
\outervsize{\hsize=
\outerhsize
187 \vbox{\line{\ewtop\hfill\ewtop}}
189 \line{\vbox{\moveleft\cornerthick\nstop}
191 \vbox{\moveright\cornerthick\nstop}}
192 \vskip \topandbottommargin
193 \centerline{\ifodd\pageno\hskip\bindingoffset\fi
195 {\let\hsize=
\pagewidth \makeheadline}
197 {\let\hsize=
\pagewidth \makefootline}}
198 \ifodd\pageno\else\hskip\bindingoffset\fi}
199 \vskip \topandbottommargin plus1fill minus1fill
200 \boxmaxdepth\cornerthick
201 \line{\vbox{\moveleft\cornerthick\nsbot}
203 \vbox{\moveright\cornerthick\nsbot}}
205 \vbox{\line{\ewbot\hfill\ewbot}}
208 \ifnum\outputpenalty>-
20000 \else\dosupereject\fi}
210 % Do @cropmarks to get crop marks
211 \def\cropmarks{\let\onepageout=
\croppageout }
213 \newinsert\margin \dimen\margin=
\maxdimen
215 \def\pagebody#1{\vbox to
\pageheight{\boxmaxdepth=
\maxdepth #1}}
217 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
218 % marginal hacks, juha@viisa.uucp (Juha Takala)
219 \ifvoid\margin\else % marginal info is present
220 \rlap{\kern\hsize\vbox to
\z@
{\kern1pt\box\margin \vss}}\fi
221 \dimen@=
\dp#1 \unvbox#1
222 \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
223 \ifr@ggedbottom
\kern-
\dimen@
\vfil \fi}
227 % Here are the rules for the cropmarks. Note that they are
228 % offset so that the space between them is truly \outerhsize or \outervsize
229 % (P. A. MacKay, 12 November, 1986)
231 \def\ewtop{\vrule height
\cornerthick depth0pt width
\cornerlong}
233 {\hrule height
\cornerthick depth
\cornerlong width
\cornerthick}}
234 \def\ewbot{\vrule height0pt depth
\cornerthick width
\cornerlong}
236 {\hrule height
\cornerlong depth
\cornerthick width
\cornerthick}}
238 % Parse an argument, then pass it to #1. The argument is the rest of
239 % the input line (except we remove a trailing comment). #1 should be a
240 % macro which expects an ordinary undelimited TeX argument.
246 \futurelet\temp\parseargx
249 % If the next token is an obeyed space (from an @example environment or
250 % the like), remove it and recurse. Otherwise, we're done.
252 % \obeyedspace is defined far below, after the definition of \sepspaces.
253 \ifx\obeyedspace\temp
254 \expandafter\parseargdiscardspace
256 \expandafter\parseargline
260 % Remove a single space (as the delimiter token to the macro call).
262 \gdef\parseargdiscardspace {\futurelet\temp\parseargx}}
265 \gdef\parseargline#1^^M
{%
266 \endgroup % End of the group started in \parsearg.
268 % First remove any @c comment, then any @comment.
269 % Result of each macro is put in \toks0.
270 \argremovec #1\c\relax %
271 \expandafter\argremovecomment \the\toks0 \comment\relax %
273 % Call the caller's macro, saved as \next in \parsearg.
274 \expandafter\next\expandafter{\the\toks0}%
278 % Since all \c{,omment} does is throw away the argument, we can let TeX
279 % do that for us. The \relax here is matched by the \relax in the call
280 % in \parseargline; it could be more or less anything, its purpose is
281 % just to delimit the argument to the \c.
282 \def\argremovec#1\c#2\relax{\toks0 =
{#1}}
283 \def\argremovecomment#1\comment#2\relax{\toks0 =
{#1}}
285 % \argremovec{,omment} might leave us with trailing spaces, though; e.g.,
286 % @end itemize @c foo
287 % will have two active spaces as part of the argument with the
288 % `itemize'. Here we remove all active spaces from #1, and assign the
291 % This loses if there are any *other* active characters besides spaces
292 % in the argument -- _ ^ +, for example -- since they get expanded.
293 % Fortunately, Texinfo does not define any such commands. (If it ever
294 % does, the catcode of the characters in questionwill have to be changed
295 % here.) But this means we cannot call \removeactivespaces as part of
296 % \argremovec{,omment}, since @c uses \parsearg, and thus the argument
297 % that \parsearg gets might well have any character at all in it.
299 \def\removeactivespaces#1{%
303 \global\toks0 =
\expandafter{\temp}%
307 % Change the active space to expand to nothing.
311 \gdef\ignoreactivespaces{\obeyspaces\let =
\empty}
315 \def\flushcr{\ifx\par\lisppar \def\next#
#1{}\else \let\next=
\relax \fi \next}
317 %% These are used to keep @begin/@end levels from running away
318 %% Call \inENV within environments (after a \begingroup)
319 \newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
321 \ifENV\errmessage{Still within an environment. Type Return to continue.
}
322 \endgroup\fi} % This is not perfect, but it should reduce lossage
324 % @begin foo is the same as @foo, for now.
325 \newhelp\EMsimple{Type <Return> to continue.
}
327 \outer\def\begin{\parsearg\beginxxx}
330 \expandafter\ifx\csname #1\endcsname\relax
331 {\errhelp=
\EMsimple \errmessage{Undefined command @begin
#1}}\else
332 \csname #1\endcsname\fi}
334 % @end foo executes the definition of \Efoo.
336 \def\end{\parsearg\endxxx}
338 \removeactivespaces{#1}%
339 \edef\endthing{\the\toks0}%
341 \expandafter\ifx\csname E
\endthing\endcsname\relax
342 \expandafter\ifx\csname \endthing\endcsname\relax
343 % There's no \foo, i.e., no ``environment'' foo.
345 \errmessage{Undefined command `@end
\endthing'
}%
347 \unmatchedenderror\endthing
350 % Everything's ok; the right environment has been started.
351 \csname E
\endthing\endcsname
355 % There is an environment #1, but it hasn't been started. Give an error.
357 \def\unmatchedenderror#1{%
359 \errmessage{This `@end
#1' doesn't have a matching `@
#1'
}%
362 % Define the control sequence \E#1 to give an unmatched @end error.
364 \def\defineunmatchedend#1{%
365 \expandafter\def\csname E
#1\endcsname{\unmatchedenderror{#1}}%
369 % Single-spacing is done by various environments (specifically, in
370 % \nonfillstart and \quotations).
371 \newskip\singlespaceskip \singlespaceskip =
12.5pt
373 % Why was this kern here? It messes up equalizing space above and below
374 % environments. --karl, 6may93
375 %{\advance \baselineskip by -\singlespaceskip
376 %\kern \baselineskip}%
377 \setleading \singlespaceskip
380 %% Simple single-character @ commands
383 % Kludge this until the fonts are right (grr).
384 \def\@
{{\tt \char '
100}}
386 % This is turned off because it was never documented
387 % and you can use @w{...} around a quote to suppress ligatures.
388 %% Define @` and @' to be the same as ` and '
389 %% but suppressing ligatures.
393 % Used to generate quoted braces.
394 \def\mylbrace {{\tt \char '
173}}
395 \def\myrbrace {{\tt \char '
175}}
399 % Definitions to produce actual \{ & \} command in an index.
400 \catcode`\
{ =
12 \catcode`\
} =
12
401 \catcode`\
[ =
1 \catcode`\
] =
2
402 \catcode`\@ =
0 \catcode`\\ =
12
407 % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
408 % Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H.
411 \def\ringaccent#1{{\accent23 #1}}
416 % Other special characters: @questiondown @exclamdown
417 % Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss.
418 \def\questiondown{?`
}
421 % Dotless i and dotless j, used for accents.
426 \ifx\temp\imacro \ptexi
427 \else\ifx\temp\jmacro \j
428 \else \errmessage{@dotless can be used only with i or j
}%
432 % @: forces normal size whitespace following.
433 \def\:
{\spacefactor=
1000 }
435 % @* forces a line break.
436 \def\*
{\hfil\break\hbox{}\ignorespaces}
438 % @. is an end-of-sentence period.
439 \def\.
{.
\spacefactor=
3000 }
441 % @enddots{} is an end-of-sentence ellipsis.
442 \gdef\enddots{$
\mathinner{\ldotp\ldotp\ldotp\ldotp}$
\spacefactor=
3000}
444 % @! is an end-of-sentence bang.
445 \gdef\!
{!
\spacefactor=
3000 }
447 % @? is an end-of-sentence query.
448 \gdef\?
{?
\spacefactor=
3000 }
450 % @w prevents a word break. Without the \leavevmode, @w at the
451 % beginning of a paragraph, when TeX is still in vertical mode, would
452 % produce a whole line of output instead of starting the paragraph.
453 \def\w#1{\leavevmode\hbox{#1}}
455 % @group ... @end group forces ... to be all on one page, by enclosing
456 % it in a TeX vbox. We use \vtop instead of \vbox to construct the box
457 % to keep its height that of a normal line. According to the rules for
458 % \topskip (p.114 of the TeXbook), the glue inserted is
459 % max (\topskip - \ht (first item), 0). If that height is large,
460 % therefore, no glue is inserted, and the space between the headline and
461 % the text is small, which looks bad.
463 \def\group{\begingroup
464 \ifnum\catcode13=
\active \else
465 \errhelp =
\groupinvalidhelp
466 \errmessage{@group invalid in context where filling is enabled
}%
469 % The \vtop we start below produces a box with normal height and large
470 % depth; thus, TeX puts \baselineskip glue before it, and (when the
471 % next line of text is done) \lineskip glue after it. (See p.82 of
472 % the TeXbook.) Thus, space below is not quite equal to space
473 % above. But it's pretty close.
475 \egroup % End the \vtop.
476 \endgroup % End the \group.
480 % We have to put a strut on the last line in case the @group is in
481 % the midst of an example, rather than completely enclosing it.
482 % Otherwise, the interline space between the last line of the group
483 % and the first line afterwards is too small. But we can't put the
484 % strut in \Egroup, since there it would be on a line by itself.
485 % Hence this just inserts a strut at the beginning of each line.
486 \everypar =
{\strut}%
488 % Since we have a strut on every line, we don't need any of TeX's
489 % normal interline spacing.
492 % OK, but now we have to do something about blank
493 % lines in the input in @example-like environments, which normally
494 % just turn into \lisppar, which will insert no space now that we've
495 % turned off the interline space. Simplest is to make them be an
498 \edef\par{\leavevmode \par}%
500 % Reset ^^M's definition to new definition of \par.
504 % Do @comment since we are called inside an environment such as
505 % @example, where each end-of-line in the input causes an
506 % end-of-line in the output. We don't want the end-of-line after
507 % the `@group' to put extra space in the output. Since @group
508 % should appear on a line by itself (according to the Texinfo
509 % manual), we don't worry about eating any user text.
513 % TeX puts in an \escapechar (i.e., `@') at the beginning of the help
514 % message, so this ends up printing `@group can only ...'.
516 \newhelp\groupinvalidhelp{%
517 group can only be used in environments such as @example,^^J
%
518 where each line of input produces a line of output.
}
520 % @need space-in-mils
521 % forces a page break if there is not space-in-mils remaining.
523 \newdimen\mil \mil=
0.001in
525 \def\need{\parsearg\needx}
527 % Old definition--didn't work.
528 %\def\needx #1{\par %
529 %% This method tries to make TeX break the page naturally
530 %% if the depth of the box does not fit.
532 %\vtop to #1\mil{\vfil}\kern -#1\mil\penalty 10000
537 % Go into vertical mode, so we don't make a big box in the middle of a
541 % Don't add any leading before our big empty box, but allow a page
542 % break, since the best break might be right here.
545 \vtop to
#1\mil{\vfil}%
547 % TeX does not even consider page breaks if a penalty added to the
548 % main vertical list is 10000 or more. But in order to see if the
549 % empty box we just added fits on the page, we must make it consider
550 % page breaks. On the other hand, we don't want to actually break the
551 % page after the empty box. So we use a penalty of 9999.
553 % There is an extremely small chance that TeX will actually break the
554 % page at this \penalty, if there are no other feasible breakpoints in
555 % sight. (If the user is using lots of big @group commands, which
556 % almost-but-not-quite fill up a page, TeX will have a hard time doing
557 % good page breaking, for example.) However, I could not construct an
558 % example where a page broke at this \penalty; if it happens in a real
559 % document, then we can reconsider our strategy.
562 % Back up by the size of the box, whether we did a page break or not.
565 % Do not allow a page break right after this kern.
569 % @br forces paragraph break
573 % @dots{} output some dots
577 % @page forces the start of a new page
579 \def\page{\par\vfill\supereject}
582 % outputs text on separate line in roman font, starting at standard page margin
584 % This records the amount of indent in the innermost environment.
585 % That's how much \exdent should take out.
586 \newskip\exdentamount
588 % This defn is used inside fill environments such as @defun.
589 \def\exdent{\parsearg\exdentyyy}
590 \def\exdentyyy #1{{\hfil\break\hbox{\kern -
\exdentamount{\rm#1}}\hfil\break}}
592 % This defn is used inside nofill environments such as @example.
593 \def\nofillexdent{\parsearg\nofillexdentyyy}
594 \def\nofillexdentyyy #1{{\advance \leftskip by -
\exdentamount
595 \leftline{\hskip\leftskip{\rm#1}}}}
597 % @inmargin{TEXT} puts TEXT in the margin next to the current paragraph.
600 \strut\vadjust{\nobreak\kern-
\strutdepth
601 \vtop to
\strutdepth{\baselineskip\strutdepth\vss
602 \llap{\rightskip=
\inmarginspacing \vbox{\noindent #1}}\null}}}
603 \newskip\inmarginspacing \inmarginspacing=
1cm
604 \def\strutdepth{\dp\strutbox}
606 %\hbox{{\rm#1}}\hfil\break}}
608 % @include file insert text of that file as input.
609 % Allow normal characters that we make active in the argument (a file name).
610 \def\include{\begingroup
619 \parsearg\includezzz}
620 % Restore active chars for included file.
621 \def\includezzz#1{\endgroup\begingroup
622 % Read the included file in a group so nested @include's work.
629 % @center line outputs that line, centered
631 \def\center{\parsearg\centerzzz}
632 \def\centerzzz #1{{\advance\hsize by -
\leftskip
633 \advance\hsize by -
\rightskip
636 % @sp n outputs n lines of vertical space
638 \def\sp{\parsearg\spxxx}
639 \def\spxxx #1{\vskip #1\baselineskip}
641 % @comment ...line which is ignored...
642 % @c is the same as @comment
643 % @ignore ... @end ignore is another way to write a comment
645 \def\comment{\catcode 64=
\other \catcode 123=
\other \catcode 125=
\other%
646 \parsearg \commentxxx}
648 \def\commentxxx #1{\catcode 64=
0 \catcode 123=
1 \catcode 125=
2 }
652 % @paragraphindent is defined for the Info formatting commands only.
653 \let\paragraphindent=
\comment
655 % Prevent errors for section commands.
656 % Used in @ignore and in failing conditionals.
657 \def\ignoresections{%
659 \let\unnumbered=
\relax
661 \let\unnumberedsec=
\relax
662 \let\unnumberedsection=
\relax
663 \let\unnumberedsubsec=
\relax
664 \let\unnumberedsubsection=
\relax
665 \let\unnumberedsubsubsec=
\relax
666 \let\unnumberedsubsubsection=
\relax
669 \let\subsubsec=
\relax
670 \let\subsection=
\relax
671 \let\subsubsection=
\relax
673 \let\appendixsec=
\relax
674 \let\appendixsection=
\relax
675 \let\appendixsubsec=
\relax
676 \let\appendixsubsection=
\relax
677 \let\appendixsubsubsec=
\relax
678 \let\appendixsubsubsection=
\relax
680 \let\smallbook=
\relax
681 \let\titlepage=
\relax
684 % Used in nested conditionals, where we have to parse the Texinfo source
685 % and so want to turn off most commands, in case they are used
688 \def\ignoremorecommands{%
689 \let\defcodeindex =
\relax
693 \let\defindex =
\relax
694 \let\defivar =
\relax
696 \let\defmethod =
\relax
699 \let\defspec =
\relax
701 \let\deftypefn =
\relax
702 \let\deftypefun =
\relax
703 \let\deftypevar =
\relax
704 \let\deftypevr =
\relax
710 \let\printindex =
\relax
712 \let\settitle =
\relax
713 \let\setchapternewpage =
\relax
714 \let\setchapterstyle =
\relax
715 \let\everyheading =
\relax
716 \let\evenheading =
\relax
717 \let\oddheading =
\relax
718 \let\everyfooting =
\relax
719 \let\evenfooting =
\relax
720 \let\oddfooting =
\relax
721 \let\headings =
\relax
722 \let\include =
\relax
723 \let\lowersections =
\relax
725 \let\raisesections =
\relax
732 % Ignore @ignore ... @end ignore.
734 \def\ignore{\doignore{ignore
}}
736 % Also ignore @ifinfo, @ifhtml, @html, @menu, and @direntry text.
738 \def\ifinfo{\doignore{ifinfo
}}
739 \def\ifhtml{\doignore{ifhtml
}}
740 \def\html{\doignore{html
}}
741 \def\menu{\doignore{menu
}}
742 \def\direntry{\doignore{direntry
}}
744 % Also ignore @macro ... @end macro. The user must run texi2dvi,
745 % which runs makeinfo to do macro expansion. Ignore @unmacro, too.
746 \def\macro{\doignore{macro
}}
747 \let\unmacro =
\comment
750 % @dircategory CATEGORY -- specify a category of the dir file
751 % which this file should belong to. Ignore this in TeX.
752 \let\dircategory =
\comment
754 % Ignore text until a line `@end #1'.
756 \def\doignore#1{\begingroup
757 % Don't complain about control sequences we have declared \outer.
760 % Define a command to swallow text until we reach `@end #1'.
761 \long\def\doignoretext#
#1\end #1{\enddoignore}%
763 % Make sure that spaces turn into tokens that match what \doignoretext wants.
766 % And now expand that command.
770 % What we do to finish off ignored text.
772 \def\enddoignore{\endgroup\ignorespaces}%
774 \newif\ifwarnedobs\warnedobsfalse
776 \ifwarnedobs\relax\else
777 % We need to warn folks that they may have trouble with TeX 3.0.
778 % This uses \immediate\write16 rather than \message to get newlines.
780 \immediate\write16{***WARNING*** for users of Unix TeX
3.0!
}
781 \immediate\write16{This manual trips a bug in TeX version
3.0 (tex hangs).
}
782 \immediate\write16{If you are running another version of TeX, relax.
}
783 \immediate\write16{If you are running Unix TeX
3.0, kill this TeX process.
}
784 \immediate\write16{ Then upgrade your TeX installation if you can.
}
785 \immediate\write16{ (See ftp://ftp.gnu.ai.mit.edu/pub/gnu/TeX.README.)
}
786 \immediate\write16{If you are stuck with version
3.0, run the
}
787 \immediate\write16{ script ``tex3patch'' from the Texinfo distribution
}
788 \immediate\write16{ to use a workaround.
}
790 \global\warnedobstrue
794 % **In TeX 3.0, setting text in \nullfont hangs tex. For a
795 % workaround (which requires the file ``dummy.tfm'' to be installed),
796 % uncomment the following line:
797 %%%%%\font\nullfont=dummy\let\obstexwarn=\relax
799 % Ignore text, except that we keep track of conditional commands for
800 % purposes of nesting, up to an `@end #1' command.
802 \def\nestedignore#1{%
804 % We must actually expand the ignored text to look for the @end
805 % command, so that nested ignore constructs work. Thus, we put the
806 % text into a \vbox and then do nothing with the result. To minimize
807 % the change of memory overflow, we follow the approach outlined on
808 % page 401 of the TeXbook: make the current font be a dummy font.
810 \setbox0 =
\vbox\bgroup
811 % Don't complain about control sequences we have declared \outer.
814 % Define `@end #1' to end the box, which will in turn undefine the
815 % @end command again.
816 \expandafter\def\csname E
#1\endcsname{\egroup\ignorespaces}%
818 % We are going to be parsing Texinfo commands. Most cause no
819 % trouble when they are used incorrectly, but some commands do
820 % complicated argument parsing or otherwise get confused, so we
823 % We can't do anything about stray @-signs, unfortunately;
824 % they'll produce `undefined control sequence' errors.
827 % Set the current font to be \nullfont, a TeX primitive, and define
828 % all the font commands to also use \nullfont. We don't use
829 % dummy.tfm, as suggested in the TeXbook, because not all sites
830 % might have that installed. Therefore, math mode will still
831 % produce output, but that should be an extremely small amount of
832 % stuff compared to the main input.
835 \let\tenrm =
\nullfont \let\tenit =
\nullfont \let\tensl =
\nullfont
836 \let\tenbf =
\nullfont \let\tentt =
\nullfont \let\smallcaps =
\nullfont
837 \let\tensf =
\nullfont
838 % Similarly for index fonts (mostly for their use in
840 \let\indrm =
\nullfont \let\indit =
\nullfont \let\indsl =
\nullfont
841 \let\indbf =
\nullfont \let\indtt =
\nullfont \let\indsc =
\nullfont
842 \let\indsf =
\nullfont
844 % Don't complain when characters are missing from the fonts.
845 \tracinglostchars =
0
847 % Don't bother to do space factor calculations.
850 % Don't report underfull hboxes.
853 % Do minimal line-breaking.
854 \pretolerance =
10000
856 % Do not execute instructions in @tex
857 \def\tex{\doignore{tex
}}
860 % @set VAR sets the variable VAR to an empty value.
861 % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
863 % Since we want to separate VAR from REST-OF-LINE (which might be
864 % empty), we can't just use \parsearg; we have to insert a space of our
865 % own to delimit the rest of the line, and then take it out again if we
866 % didn't need it. Make sure the catcode of space is correct to avoid
867 % losing inside @example, for instance.
869 \def\set{\begingroup\catcode` =
10
870 \catcode`\-=
12 \catcode`
\_=
12 % Allow - and _ in VAR.
872 \def\setxxx#1{\setyyy#1 \endsetyyy}
873 \def\setyyy#1 #2\endsetyyy{%
875 \ifx\temp\empty \global\expandafter\let\csname SET
#1\endcsname =
\empty
876 \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted.
880 % Can't use \xdef to pre-expand #2 and save some time, since \temp or
881 % \next or other control sequences that we've defined might get us into
882 % an infinite loop. Consider `@set foo @cite{bar}'.
883 \def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET
#1\endcsname{#2}}
885 % @clear VAR clears (i.e., unsets) the variable VAR.
887 \def\clear{\parsearg\clearxxx}
888 \def\clearxxx#1{\global\expandafter\let\csname SET
#1\endcsname=
\relax}
890 % @value{foo} gets the text saved in variable foo.
892 \def\value{\begingroup
893 \catcode`\-=
12 \catcode`
\_=
12 % Allow - and _ in VAR.
896 \expandafter\ifx\csname SET
#1\endcsname\relax
897 {\
{No value for ``
#1''\
}}%
899 \csname SET
#1\endcsname
903 % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
906 \def\ifset{\parsearg\ifsetxxx}
908 \expandafter\ifx\csname SET
#1\endcsname\relax
909 \expandafter\ifsetfail
911 \expandafter\ifsetsucceed
914 \def\ifsetsucceed{\conditionalsucceed{ifset
}}
915 \def\ifsetfail{\nestedignore{ifset
}}
916 \defineunmatchedend{ifset
}
918 % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
919 % defined with @set, or has been undefined with @clear.
921 \def\ifclear{\parsearg\ifclearxxx}
923 \expandafter\ifx\csname SET
#1\endcsname\relax
924 \expandafter\ifclearsucceed
926 \expandafter\ifclearfail
929 \def\ifclearsucceed{\conditionalsucceed{ifclear
}}
930 \def\ifclearfail{\nestedignore{ifclear
}}
931 \defineunmatchedend{ifclear
}
933 % @iftex always succeeds; we read the text following, through @end
934 % iftex). But `@end iftex' should be valid only after an @iftex.
936 \def\iftex{\conditionalsucceed{iftex
}}
937 \defineunmatchedend{iftex
}
939 % We can't just want to start a group at @iftex (for example) and end it
940 % at @end iftex, since then @set commands inside the conditional have no
941 % effect (they'd get reverted at the end of the group). So we must
942 % define \Eiftex to redefine itself to be its previous value. (We can't
943 % just define it to fail again with an ``unmatched end'' error, since
944 % the @ifset might be nested.)
946 \def\conditionalsucceed#1{%
948 % Remember the current value of \E#1.
949 \let\nece{prevE
#1} =
\nece{E
#1}%
951 % At the `@end #1', redefine \E#1 to be its previous value.
952 \def\nece{E
#1}{\let\nece{E
#1} =
\nece{prevE
#1}}%
957 % We need to expand lots of \csname's, but we don't want to expand the
958 % control sequences after we've constructed them.
960 \def\nece#1{\expandafter\noexpand\csname#1\endcsname}
962 % @asis just yields its argument. Used with @table, for example.
966 % @math means output in math mode.
967 % We don't use $'s directly in the definition of \math because control
968 % sequences like \math are expanded when the toc file is written. Then,
969 % we read the toc file back, the $'s will be normal characters (as they
970 % should be, according to the definition of Texinfo). So we must use a
971 % control sequence to switch into and out of math mode.
973 % This isn't quite enough for @math to work properly in indices, but it
974 % seems unlikely it will ever be needed there.
976 \let\implicitmath = $
977 \def\math#1{\implicitmath #1\implicitmath}
979 % @bullet and @minus need the same treatment as @math, just above.
980 \def\bullet{\implicitmath\ptexbullet\implicitmath}
981 \def\minus{\implicitmath-
\implicitmath}
983 \def\node{\ENVcheck\parsearg\nodezzz}
984 \def\nodezzz#1{\nodexxx [#1,
]}
985 \def\nodexxx[#1,
#2]{\gdef\lastnode{#1}}
989 \def\donoderef{\ifx\lastnode\relax\else
990 \expandafter\expandafter\expandafter\setref{\lastnode}\fi
991 \global\let\lastnode=
\relax}
993 \def\unnumbnoderef{\ifx\lastnode\relax\else
994 \expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi
995 \global\let\lastnode=
\relax}
997 \def\appendixnoderef{\ifx\lastnode\relax\else
998 \expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi
999 \global\let\lastnode=
\relax}
1001 % @refill is a no-op.
1004 % @setfilename is done at the beginning of every texinfo file.
1005 % So open here the files we need to have open while reading the input.
1006 % This makes it possible to make a .fmt file for texinfo.
1011 \fixbackslash % Turn off hack to swallow `\input texinfo'.
1012 \global\let\setfilename=
\comment % Ignore extra @setfilename cmds.
1013 \comment % Ignore the actual filename.
1017 \outer\def\bye{\pagealignmacro\tracingstats=
1\ptexend}
1019 % \def\macro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\macroxxx}
1020 % \def\macroxxx#1#2 \end macro{%
1021 % \expandafter\gdef\macrotemp#1{#2}%
1024 %\def\linemacro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\linemacroxxx}
1025 %\def\linemacroxxx#1#2 \end linemacro{%
1026 %\let\parsearg=\relax
1027 %\edef\macrotempx{\csname M\butfirst\expandafter\string\macrotemp\endcsname}%
1028 %\expandafter\xdef\macrotemp{\parsearg\macrotempx}%
1029 %\expandafter\gdef\macrotempx#1{#2}%
1037 % Font-change commands.
1039 % Texinfo supports the sans serif font style, which plain TeX does not.
1040 % So we set up a \sf analogous to plain's \rm, etc.
1042 \def\sf{\fam=
\sffam \tensf}
1043 \let\li =
\sf % Sometimes we call it \li, not \sf.
1045 % We don't need math for this one.
1048 %% Try out Computer Modern fonts at \magstephalf
1049 \let\mainmagstep=
\magstephalf
1051 % Set the font macro #1 to the font named #2, adding on the
1052 % specified font prefix (normally `cm').
1053 % #3 is the font's design size, #4 is a scale factor
1054 \def\setfont#1#2#3#4{\font#1=
\fontprefix#2#3 scaled
#4}
1056 % Use cm as the default font prefix.
1057 % To specify the font prefix, you must define \fontprefix
1058 % before you read in texinfo.tex.
1059 \ifx\fontprefix\undefined
1062 % Support font families that don't use the same naming scheme as CM.
1064 \def\rmbshape{bx
} %where the normal face is bold
1069 \def\ttslshape{sltt
}
1080 \let\mainmagstep=
\magstep1
1081 \setfont\textrm\rmshape{12}{1000}
1082 \setfont\texttt\ttshape{12}{1000}
1084 \setfont\textrm\rmshape{10}{\mainmagstep}
1085 \setfont\texttt\ttshape{10}{\mainmagstep}
1087 % Instead of cmb10, you many want to use cmbx10.
1088 % cmbx10 is a prettier font on its own, but cmb10
1089 % looks better when embedded in a line with cmr10.
1090 \setfont\textbf\bfshape{10}{\mainmagstep}
1091 \setfont\textit\itshape{10}{\mainmagstep}
1092 \setfont\textsl\slshape{10}{\mainmagstep}
1093 \setfont\textsf\sfshape{10}{\mainmagstep}
1094 \setfont\textsc\scshape{10}{\mainmagstep}
1095 \setfont\textttsl\ttslshape{10}{\mainmagstep}
1096 \font\texti=cmmi10 scaled
\mainmagstep
1097 \font\textsy=cmsy10 scaled
\mainmagstep
1099 % A few fonts for @defun, etc.
1100 \setfont\defbf\bxshape{10}{\magstep1} %was 1314
1101 \setfont\deftt\ttshape{10}{\magstep1}
1102 \def\df{\let\tentt=
\deftt \let\tenbf =
\defbf \bf}
1104 % Fonts for indices and small examples (9pt).
1105 % We actually use the slanted font rather than the italic,
1106 % because texinfo normally uses the slanted fonts for that.
1107 % Do not make many font distinctions in general in the index, since they
1108 % aren't very useful.
1109 \setfont\ninett\ttshape{9}{1000}
1110 \setfont\indrm\rmshape{9}{1000}
1111 \setfont\indit\slshape{9}{1000}
1114 \let\indttsl=
\ninett
1117 \setfont\indsc\scshape{10}{900}
1121 % Chapter (and unnumbered) fonts (17.28pt).
1122 \setfont\chaprm\rmbshape{12}{\magstep2}
1123 \setfont\chapit\itbshape{10}{\magstep3}
1124 \setfont\chapsl\slbshape{10}{\magstep3}
1125 \setfont\chaptt\ttbshape{12}{\magstep2}
1126 \setfont\chapttsl\ttslshape{10}{\magstep3}
1127 \setfont\chapsf\sfbshape{12}{\magstep2}
1129 \setfont\chapsc\scbshape{10}{\magstep3}
1130 \font\chapi=cmmi12 scaled
\magstep2
1131 \font\chapsy=cmsy10 scaled
\magstep3
1133 % Section fonts (14.4pt).
1134 \setfont\secrm\rmbshape{12}{\magstep1}
1135 \setfont\secit\itbshape{10}{\magstep2}
1136 \setfont\secsl\slbshape{10}{\magstep2}
1137 \setfont\sectt\ttbshape{12}{\magstep1}
1138 \setfont\secttsl\ttslshape{10}{\magstep2}
1139 \setfont\secsf\sfbshape{12}{\magstep1}
1141 \setfont\secsc\scbshape{10}{\magstep2}
1142 \font\seci=cmmi12 scaled
\magstep1
1143 \font\secsy=cmsy10 scaled
\magstep2
1145 % \setfont\ssecrm\bxshape{10}{\magstep1} % This size an font looked bad.
1146 % \setfont\ssecit\itshape{10}{\magstep1} % The letters were too crowded.
1147 % \setfont\ssecsl\slshape{10}{\magstep1}
1148 % \setfont\ssectt\ttshape{10}{\magstep1}
1149 % \setfont\ssecsf\sfshape{10}{\magstep1}
1151 %\setfont\ssecrm\bfshape{10}{1315} % Note the use of cmb rather than cmbx.
1152 %\setfont\ssecit\itshape{10}{1315} % Also, the size is a little larger than
1153 %\setfont\ssecsl\slshape{10}{1315} % being scaled magstep1.
1154 %\setfont\ssectt\ttshape{10}{1315}
1155 %\setfont\ssecsf\sfshape{10}{1315}
1157 %\let\ssecbf=\ssecrm
1159 % Subsection fonts (13.15pt).
1160 \setfont\ssecrm\rmbshape{12}{\magstephalf}
1161 \setfont\ssecit\itbshape{10}{1315}
1162 \setfont\ssecsl\slbshape{10}{1315}
1163 \setfont\ssectt\ttbshape{12}{\magstephalf}
1164 \setfont\ssecttsl\ttslshape{10}{\magstep1}
1165 \setfont\ssecsf\sfbshape{12}{\magstephalf}
1167 \setfont\ssecsc\scbshape{10}{\magstep1}
1168 \font\sseci=cmmi12 scaled
\magstephalf
1169 \font\ssecsy=cmsy10 scaled
\magstep1
1170 % The smallcaps and symbol fonts should actually be scaled \magstep1.5,
1171 % but that is not a standard magnification.
1173 % Fonts for title page:
1174 \setfont\titlerm\rmbshape{12}{\magstep3}
1175 \let\authorrm =
\secrm
1177 % In order for the font changes to affect most math symbols and letters,
1178 % we have to define the \textfont of the standard families. Since
1179 % texinfo doesn't allow for producing subscripts and superscripts, we
1180 % don't bother to reset \scriptfont and \scriptscriptfont (which would
1181 % also require loading a lot more fonts).
1183 \def\resetmathfonts{%
1184 \textfont0 =
\tenrm \textfont1 =
\teni \textfont2 =
\tensy
1185 \textfont\itfam =
\tenit \textfont\slfam =
\tensl \textfont\bffam =
\tenbf
1186 \textfont\ttfam =
\tentt \textfont\sffam =
\tensf
1190 % The font-changing commands redefine the meanings of \tenSTYLE, instead
1191 % of just \STYLE. We do this so that font changes will continue to work
1192 % in math mode, where it is the current \fam that is relevant in most
1193 % cases, not the current font. Plain TeX does \def\bf{\fam=\bffam
1194 % \tenbf}, for example. By redefining \tenbf, we obviate the need to
1195 % redefine \bf itself.
1197 \let\tenrm=
\textrm \let\tenit=
\textit \let\tensl=
\textsl
1198 \let\tenbf=
\textbf \let\tentt=
\texttt \let\smallcaps=
\textsc
1199 \let\tensf=
\textsf \let\teni=
\texti \let\tensy=
\textsy \let\tenttsl=
\textttsl
1202 \let\tenrm=
\chaprm \let\tenit=
\chapit \let\tensl=
\chapsl
1203 \let\tenbf=
\chapbf \let\tentt=
\chaptt \let\smallcaps=
\chapsc
1204 \let\tensf=
\chapsf \let\teni=
\chapi \let\tensy=
\chapsy \let\tenttsl=
\chapttsl
1205 \resetmathfonts \setleading{19pt
}}
1207 \let\tenrm=
\secrm \let\tenit=
\secit \let\tensl=
\secsl
1208 \let\tenbf=
\secbf \let\tentt=
\sectt \let\smallcaps=
\secsc
1209 \let\tensf=
\secsf \let\teni=
\seci \let\tensy=
\secsy \let\tenttsl=
\secttsl
1210 \resetmathfonts \setleading{16pt
}}
1212 \let\tenrm=
\ssecrm \let\tenit=
\ssecit \let\tensl=
\ssecsl
1213 \let\tenbf=
\ssecbf \let\tentt=
\ssectt \let\smallcaps=
\ssecsc
1214 \let\tensf=
\ssecsf \let\teni=
\sseci \let\tensy=
\ssecsy \let\tenttsl=
\ssecttsl
1215 \resetmathfonts \setleading{15pt
}}
1216 \let\subsubsecfonts =
\subsecfonts % Maybe make sssec fonts scaled magstephalf?
1218 \let\tenrm=
\indrm \let\tenit=
\indit \let\tensl=
\indsl
1219 \let\tenbf=
\indbf \let\tentt=
\indtt \let\smallcaps=
\indsc
1220 \let\tensf=
\indsf \let\teni=
\indi \let\tensy=
\indsy \let\tenttsl=
\indttsl
1221 \resetmathfonts \setleading{12pt
}}
1223 % Set up the default fonts, so we can use them for creating boxes.
1227 % Count depth in font-changes, for error checks
1228 \newcount\fontdepth \fontdepth=
0
1230 % Fonts for short table of contents.
1231 \setfont\shortcontrm\rmshape{12}{1000}
1232 \setfont\shortcontbf\bxshape{12}{1000}
1233 \setfont\shortcontsl\slshape{12}{1000}
1235 %% Add scribe-like font environments, plus @l for inline lisp (usually sans
1236 %% serif) and @ii for TeX italic
1238 % \smartitalic{ARG} outputs arg in italics, followed by an italic correction
1239 % unless the following character is such as not to need one.
1240 \def\smartitalicx{\ifx\next,
\else\ifx\next-
\else\ifx\next.
\else\/
\fi\fi\fi}
1241 \def\smartitalic#1{{\sl #1}\futurelet\next\smartitalicx}
1244 \let\var=
\smartitalic
1245 \let\dfn=
\smartitalic
1246 \let\emph=
\smartitalic
1247 \let\cite=
\smartitalic
1252 % We can't just use \exhyphenpenalty, because that only has effect at
1253 % the end of a paragraph. Restore normal hyphenation at the end of the
1254 % group within which \nohyphenation is presumably called.
1256 \def\nohyphenation{\hyphenchar\font = -
1 \aftergroup\restorehyphenation}
1257 \def\restorehyphenation{\hyphenchar\font = `-
}
1260 {\tt \rawbackslash \frenchspacing #1}%
1264 \def\samp #1{`
\tclose{#1}'
\null}
1265 \setfont\smallrm\rmshape{8}{1000}
1267 \def\key#1{{\smallrm\textfont2=
\smallsy \leavevmode\hbox{%
1268 \raise0.4pt
\hbox{$
\langle$
}\kern-
.08em
\vtop{%
1269 \vbox{\hrule\kern-
0.4pt
1270 \hbox{\raise0.4pt
\hbox{\vphantom{$
\langle$
}}#1}}%
1272 \kern-
.06em
\raise0.4pt
\hbox{$
\rangle$
}}}}
1273 % The old definition, with no lozenge:
1274 %\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
1275 \def\ctrl #1{{\tt \rawbackslash \hat}#1}
1278 \let\url=
\samp % perhaps include a hypertex \special eventually
1279 \def\email#1{$
\langle$
{\tt #1}$
\rangle$
}
1281 % @code is a modification of @t,
1282 % which makes spaces the same size as normal in the surrounding text.
1285 % Change normal interword space to be same as for the current font.
1286 \spaceskip =
\fontdimen2\font
1288 % Switch to typewriter.
1291 % But `\ ' produces the large typewriter interword space.
1292 \def\
{{\spaceskip =
0pt
{} }}%
1294 % Turn off hyphenation.
1304 % We *must* turn on hyphenation at `-' and `_' in \code.
1305 % Otherwise, it is too hard to avoid overfull hboxes
1306 % in the Emacs manual, the Library manual, etc.
1308 % Unfortunately, TeX uses one parameter (\hyphenchar) to control
1309 % both hyphenation at - and hyphenation within words.
1310 % We must therefore turn them both off (\tclose does that)
1311 % and arrange explicitly to hyphenate at a dash.
1317 \global\def\code{\begingroup \catcode`\-=
\active \let-
\codedash \catcode`
\_=
\active \let_\codeunder \codex}
1318 % The following is used by \doprintindex to insure that long function names
1319 % wrap around. It is necessary for - and _ to be active before the index is
1320 % read from the file, as \entry parses the arguments long before \code is
1321 % ever called. -- mycroft
1322 % _ is always active; and it shouldn't be \let = to an _ that is a
1323 % subscript character anyway. Then, @cindex @samp{_} (for example)
1325 \global\def\indexbreaks{%
1326 \catcode`\-=
\active \let-
\realdash
1331 \def\codedash{-
\discretionary{}{}{}}
1332 \def\codeunder{\normalunderscore\discretionary{}{}{}}
1333 \def\codex #1{\tclose{#1}\endgroup}
1335 %\let\exp=\tclose %Was temporary
1337 % @kbd is like @code, except that if the argument is just one @key command,
1338 % then @kbd has no effect.
1341 \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??
}%
1342 \ifx\one\xkey\ifx\threex\three \key{#2}%
1343 \else{\tclose{\ttsl\look}}\fi
1344 \else{\tclose{\ttsl\look}}\fi}
1346 % Check if we are currently using a typewriter font. Since all the
1347 % Computer Modern typewriter fonts have zero interword stretch (and
1348 % shrink), and it is reasonable to expect all typewriter fonts to have
1349 % this property, we can check that font parameter.
1351 \def\ifmonospace{\ifdim\fontdimen3\font=
0pt
}
1353 % Typeset a dimension, e.g., `in' or `pt'. The only reason for the
1354 % argument is to make the input look right: @dmn{pt} instead of
1357 \def\dmn#1{\thinspace #1}
1359 \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??
\par}
1361 % @l was never documented to mean ``switch to the Lisp font'',
1362 % and it is not used as such in any manual I can find. We need it for
1363 % Polish suppressed-l. --karl, 22sep96.
1364 %\def\l#1{{\li #1}\null}
1366 \def\r#1{{\rm #1}} % roman font
1367 % Use of \lowercase was suggested.
1368 \def\sc#1{{\smallcaps#1}} % smallcaps font
1369 \def\ii#1{{\it #1}} % italic font
1371 % @pounds{} is a sterling sign.
1372 \def\pounds{{\it\$
}}
1375 \message{page headings,
}
1377 \newskip\titlepagetopglue \titlepagetopglue =
1.5in
1378 \newskip\titlepagebottomglue \titlepagebottomglue =
2pc
1380 % First the title page. Must do @settitle before @titlepage.
1381 \def\titlefont#1{{\titlerm #1}}
1384 \newif\iffinishedtitlepage
1386 \def\shorttitlepage{\parsearg\shorttitlepagezzz}
1387 \def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in
\chaprm \centerline{#1}%
1388 \endgroup\page\hbox{}\page}
1390 \def\titlepage{\begingroup \parindent=
0pt
\textfonts
1391 \let\subtitlerm=
\tenrm
1392 % I deinstalled the following change because \cmr12 is undefined.
1393 % This change was not in the ChangeLog anyway. --rms.
1394 % \let\subtitlerm=\cmr12
1395 \def\subtitlefont{\subtitlerm \normalbaselineskip =
13pt
\normalbaselines}%
1397 \def\authorfont{\authorrm \normalbaselineskip =
16pt
\normalbaselines}%
1399 % Leave some space at the very top of the page.
1400 \vglue\titlepagetopglue
1402 % Now you can print the title using @title.
1403 \def\title{\parsearg\titlezzz}%
1404 \def\titlezzz#
#1{\leftline{\titlefont{#
#1}}
1405 % print a rule at the page bottom also.
1406 \finishedtitlepagefalse
1407 \vskip4pt \hrule height
4pt width
\hsize \vskip4pt}%
1408 % No rule at page bottom unless we print one at the top with @title.
1409 \finishedtitlepagetrue
1411 % Now you can put text using @subtitle.
1412 \def\subtitle{\parsearg\subtitlezzz}%
1413 \def\subtitlezzz#
#1{{\subtitlefont \rightline{#
#1}}}%
1415 % @author should come last, but may come many times.
1416 \def\author{\parsearg\authorzzz}%
1417 \def\authorzzz#
#1{\ifseenauthor\else\vskip 0pt plus
1filll
\seenauthortrue\fi
1418 {\authorfont \leftline{#
#1}}}%
1420 % Most title ``pages'' are actually two pages long, with space
1421 % at the top of the second. We don't want the ragged left on the second.
1422 \let\oldpage =
\page
1424 \iffinishedtitlepage\else
1428 \let\page =
\oldpage
1430 % \def\page{\oldpage \hbox{}}
1434 \iffinishedtitlepage\else
1437 % It is important to do the page break before ending the group,
1438 % because the headline and footline are only empty inside the group.
1439 % If we use the new definition of \page, we always get a blank page
1440 % after the title page, which we certainly don't want.
1446 \def\finishtitlepage{%
1447 \vskip4pt \hrule height
2pt width
\hsize
1448 \vskip\titlepagebottomglue
1449 \finishedtitlepagetrue
1452 %%% Set up page headings and footings.
1454 \let\thispage=
\folio
1456 \newtoks \evenheadline % Token sequence for heading line of even pages
1457 \newtoks \oddheadline % Token sequence for heading line of odd pages
1458 \newtoks \evenfootline % Token sequence for footing line of even pages
1459 \newtoks \oddfootline % Token sequence for footing line of odd pages
1461 % Now make Tex use those variables
1462 \headline=
{{\textfonts\rm \ifodd\pageno \the\oddheadline
1463 \else \the\evenheadline \fi}}
1464 \footline=
{{\textfonts\rm \ifodd\pageno \the\oddfootline
1465 \else \the\evenfootline \fi}\HEADINGShook}
1466 \let\HEADINGShook=
\relax
1468 % Commands to set those variables.
1469 % For example, this is what @headings on does
1470 % @evenheading @thistitle|@thispage|@thischapter
1471 % @oddheading @thischapter|@thispage|@thistitle
1472 % @evenfooting @thisfile||
1473 % @oddfooting ||@thisfile
1475 \def\evenheading{\parsearg\evenheadingxxx}
1476 \def\oddheading{\parsearg\oddheadingxxx}
1477 \def\everyheading{\parsearg\everyheadingxxx}
1479 \def\evenfooting{\parsearg\evenfootingxxx}
1480 \def\oddfooting{\parsearg\oddfootingxxx}
1481 \def\everyfooting{\parsearg\everyfootingxxx}
1485 \gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|
\finish}
1486 \gdef\evenheadingyyy #1@|
#2@|
#3@|
#4\finish{%
1487 \global\evenheadline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1489 \gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|
\finish}
1490 \gdef\oddheadingyyy #1@|
#2@|
#3@|
#4\finish{%
1491 \global\oddheadline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1493 \gdef\everyheadingxxx #1{\everyheadingyyy #1@|@|@|@|
\finish}
1494 \gdef\everyheadingyyy #1@|
#2@|
#3@|
#4\finish{%
1495 \global\evenheadline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}
1496 \global\oddheadline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1498 \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|
\finish}
1499 \gdef\evenfootingyyy #1@|
#2@|
#3@|
#4\finish{%
1500 \global\evenfootline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1502 \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|
\finish}
1503 \gdef\oddfootingyyy #1@|
#2@|
#3@|
#4\finish{%
1504 \global\oddfootline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1506 \gdef\everyfootingxxx #1{\everyfootingyyy #1@|@|@|@|
\finish}
1507 \gdef\everyfootingyyy #1@|
#2@|
#3@|
#4\finish{%
1508 \global\evenfootline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}
1509 \global\oddfootline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1511 }% unbind the catcode of @.
1513 % @headings double turns headings on for double-sided printing.
1514 % @headings single turns headings on for single-sided printing.
1515 % @headings off turns them off.
1516 % @headings on same as @headings double, retained for compatibility.
1517 % @headings after turns on double-sided headings after this page.
1518 % @headings doubleafter turns on double-sided headings after this page.
1519 % @headings singleafter turns on single-sided headings after this page.
1520 % By default, they are off at the start of a document,
1521 % and turned `on' after @end titlepage.
1523 \def\headings #1 {\csname HEADINGS
#1\endcsname}
1526 \global\evenheadline=
{\hfil} \global\evenfootline=
{\hfil}
1527 \global\oddheadline=
{\hfil} \global\oddfootline=
{\hfil}}
1529 % When we turn headings on, set the page number to 1.
1530 % For double-sided printing, put current file name in lower left corner,
1531 % chapter name on inside top of right hand pages, document
1532 % title on inside top of left hand pages, and page numbers on outside top
1533 % edge of all pages.
1534 \def\HEADINGSdouble{
1536 \global\evenfootline=
{\hfil}
1537 \global\oddfootline=
{\hfil}
1538 \global\evenheadline=
{\line{\folio\hfil\thistitle}}
1539 \global\oddheadline=
{\line{\thischapter\hfil\folio}}
1540 \global\let\contentsalignmacro =
\chapoddpage
1542 \let\contentsalignmacro =
\chappager
1544 % For single-sided printing, chapter title goes across top left of page,
1545 % page number on top right.
1546 \def\HEADINGSsingle{
1548 \global\evenfootline=
{\hfil}
1549 \global\oddfootline=
{\hfil}
1550 \global\evenheadline=
{\line{\thischapter\hfil\folio}}
1551 \global\oddheadline=
{\line{\thischapter\hfil\folio}}
1552 \global\let\contentsalignmacro =
\chappager
1554 \def\HEADINGSon{\HEADINGSdouble}
1556 \def\HEADINGSafter{\let\HEADINGShook=
\HEADINGSdoublex}
1557 \let\HEADINGSdoubleafter=
\HEADINGSafter
1558 \def\HEADINGSdoublex{%
1559 \global\evenfootline=
{\hfil}
1560 \global\oddfootline=
{\hfil}
1561 \global\evenheadline=
{\line{\folio\hfil\thistitle}}
1562 \global\oddheadline=
{\line{\thischapter\hfil\folio}}
1563 \global\let\contentsalignmacro =
\chapoddpage
1566 \def\HEADINGSsingleafter{\let\HEADINGShook=
\HEADINGSsinglex}
1567 \def\HEADINGSsinglex{%
1568 \global\evenfootline=
{\hfil}
1569 \global\oddfootline=
{\hfil}
1570 \global\evenheadline=
{\line{\thischapter\hfil\folio}}
1571 \global\oddheadline=
{\line{\thischapter\hfil\folio}}
1572 \global\let\contentsalignmacro =
\chappager
1575 % Subroutines used in generating headings
1576 % Produces Day Month Year style of output.
1577 \def\today{\number\day\space
1579 January
\or February
\or March
\or April
\or May
\or June
\or
1580 July
\or August
\or September
\or October
\or November
\or December
\fi
1583 % Use this if you want the Month Day, Year style of output.
1584 %\def\today{\ifcase\month\or
1585 %January\or February\or March\or April\or May\or June\or
1586 %July\or August\or September\or October\or November\or December\fi
1587 %\space\number\day, \number\year}
1589 % @settitle line... specifies the title of the document, for headings
1590 % It generates no output of its own
1592 \def\thistitle{No Title
}
1593 \def\settitle{\parsearg\settitlezzz}
1594 \def\settitlezzz #1{\gdef\thistitle{#1}}
1599 % @tabs -- simple alignment
1601 % These don't work. For one thing, \+ is defined as outer.
1602 % So these macros cannot even be defined.
1604 %\def\tabs{\parsearg\tabszzz}
1605 %\def\tabszzz #1{\settabs\+#1\cr}
1606 %\def\tabline{\parsearg\tablinezzz}
1607 %\def\tablinezzz #1{\+#1\cr}
1610 % Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
1612 % default indentation of table text
1613 \newdimen\tableindent \tableindent=
.8in
1614 % default indentation of @itemize and @enumerate text
1615 \newdimen\itemindent \itemindent=
.3in
1616 % margin between end of table item and start of table text.
1617 \newdimen\itemmargin \itemmargin=
.1in
1619 % used internally for \itemindent minus \itemmargin
1622 % Note @table, @vtable, and @vtable define @item, @itemx, etc., with
1624 % They also define \itemindex
1625 % to index the item name in whatever manner is desired (perhaps none).
1627 \newif\ifitemxneedsnegativevskip
1629 \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-
\parskip\nobreak\fi}
1631 \def\internalBitem{\smallbreak \parsearg\itemzzz}
1632 \def\internalBitemx{\itemxpar \parsearg\itemzzz}
1634 \def\internalBxitem "
#1"
{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
1635 \def\internalBxitemx "
#1"
{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz}
1637 \def\internalBkitem{\smallbreak \parsearg\kitemzzz}
1638 \def\internalBkitemx{\itemxpar \parsearg\kitemzzz}
1640 \def\kitemzzz #1{\dosubind {kw
}{\code{#1}}{for
{\bf \lastfunction}}%
1643 \def\xitemzzz #1{\dosubind {kw
}{\code{#1}}{for
{\bf \xitemsubtopic}}%
1646 \def\itemzzz #1{\begingroup %
1647 \advance\hsize by -
\rightskip
1648 \advance\hsize by -
\tableindent
1649 \setbox0=
\hbox{\itemfont{#1}}%
1651 \nobreak % This prevents a break before @itemx.
1653 % Be sure we are not still in the middle of a paragraph.
1658 % If the item text does not fit in the space we have, put it on a line
1659 % by itself, and do not allow a page break either before or after that
1660 % line. We do not start a paragraph here because then if the next
1661 % command is, e.g., @kindex, the whatsit would get put into the
1662 % horizontal list on a line by itself, resulting in extra blank space.
1663 \ifdim \wd0>
\itemmax
1665 % Make this a paragraph so we get the \parskip glue and wrapping,
1666 % but leave it ragged-right.
1668 \advance\leftskip by-
\tableindent
1669 \advance\hsize by
\tableindent
1670 \advance\rightskip by0pt plus1fil
1671 \leavevmode\unhbox0\par
1674 % We're going to be starting a paragraph, but we don't want the
1675 % \parskip glue -- logically it's part of the @item we just started.
1676 \nobreak \vskip-
\parskip
1678 % Stop a page break at the \parskip glue coming up. Unfortunately
1679 % we can't prevent a possible page break at the following
1680 % \baselineskip glue.
1683 \itemxneedsnegativevskipfalse
1685 % The item text fits into the space. Start a paragraph, so that the
1686 % following text (if any) will end up on the same line. Since that
1687 % text will be indented by \tableindent, we make the item text be in
1690 \rlap{\hskip -
\tableindent\box0}\ignorespaces%
1692 \itemxneedsnegativevskiptrue%
1696 \def\item{\errmessage{@item while not in a table
}}
1697 \def\itemx{\errmessage{@itemx while not in a table
}}
1698 \def\kitem{\errmessage{@kitem while not in a table
}}
1699 \def\kitemx{\errmessage{@kitemx while not in a table
}}
1700 \def\xitem{\errmessage{@xitem while not in a table
}}
1701 \def\xitemx{\errmessage{@xitemx while not in a table
}}
1703 %% Contains a kludge to get @end[description] to work
1704 \def\description{\tablez{\dontindex}{1}{}{}{}{}}
1706 \def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
1707 {\obeylines\obeyspaces%
1708 \gdef\tablex #1^^M
{%
1709 \tabley\dontindex#1 \endtabley}}
1711 \def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
1712 {\obeylines\obeyspaces%
1713 \gdef\ftablex #1^^M
{%
1714 \tabley\fnitemindex#1 \endtabley
1715 \def\Eftable{\endgraf\afterenvbreak\endgroup}%
1716 \let\Etable=
\relax}}
1718 \def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex}
1719 {\obeylines\obeyspaces%
1720 \gdef\vtablex #1^^M
{%
1721 \tabley\vritemindex#1 \endtabley
1722 \def\Evtable{\endgraf\afterenvbreak\endgroup}%
1723 \let\Etable=
\relax}}
1726 \def\fnitemindex #1{\doind {fn
}{\code{#1}}}%
1727 \def\vritemindex #1{\doind {vr
}{\code{#1}}}%
1730 \gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
1731 \tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
1733 \def\tablez #1#2#3#4#5#6{%
1736 \def\Edescription{\Etable}% Necessary kludge.
1738 \ifnum 0#3>
0 \advance \leftskip by
#3\mil \fi %
1739 \ifnum 0#4>
0 \tableindent=
#4\mil \fi %
1740 \ifnum 0#5>
0 \advance \rightskip by
#5\mil \fi %
1742 \itemmax=
\tableindent %
1743 \advance \itemmax by -
\itemmargin %
1744 \advance \leftskip by
\tableindent %
1745 \exdentamount=
\tableindent
1747 \parskip =
\smallskipamount
1748 \ifdim \parskip=
0pt
\parskip=
2pt
\fi%
1749 \def\Etable{\endgraf\afterenvbreak\endgroup}%
1750 \let\item =
\internalBitem %
1751 \let\itemx =
\internalBitemx %
1752 \let\kitem =
\internalBkitem %
1753 \let\kitemx =
\internalBkitemx %
1754 \let\xitem =
\internalBxitem %
1755 \let\xitemx =
\internalBxitemx %
1758 % This is the counter used by @enumerate, which is really @itemize
1762 \def\itemize{\parsearg\itemizezzz}
1764 \def\itemizezzz #1{%
1765 \begingroup % ended by the @end itemsize
1766 \itemizey {#1}{\Eitemize}
1769 \def\itemizey #1#2{%
1771 \itemmax=
\itemindent %
1772 \advance \itemmax by -
\itemmargin %
1773 \advance \leftskip by
\itemindent %
1774 \exdentamount=
\itemindent
1776 \parskip =
\smallskipamount %
1777 \ifdim \parskip=
0pt
\parskip=
2pt
\fi%
1778 \def#2{\endgraf\afterenvbreak\endgroup}%
1779 \def\itemcontents{#1}%
1780 \let\item=
\itemizeitem}
1782 % Set sfcode to normal for the chars that usually have another value.
1783 % These are `.?!:;,'
1784 \def\frenchspacing{\sfcode46=
1000 \sfcode63=
1000 \sfcode33=
1000
1785 \sfcode58=
1000 \sfcode59=
1000 \sfcode44=
1000 }
1787 % \splitoff TOKENS\endmark defines \first to be the first token in
1788 % TOKENS, and \rest to be the remainder.
1790 \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
1792 % Allow an optional argument of an uppercase letter, lowercase letter,
1793 % or number, to specify the first label in the enumerated list. No
1794 % argument is the same as `1'.
1796 \def\enumerate{\parsearg\enumeratezzz}
1797 \def\enumeratezzz #1{\enumeratey #1 \endenumeratey}
1798 \def\enumeratey #1 #2\endenumeratey{%
1799 \begingroup % ended by the @end enumerate
1801 % If we were given no argument, pretend we were given `1'.
1803 \ifx\thearg\empty \def\thearg{1}\fi
1805 % Detect if the argument is a single token. If so, it might be a
1806 % letter. Otherwise, the only valid thing it can be is a number.
1807 % (We will always have one token, because of the test we just made.
1808 % This is a good thing, since \splitoff doesn't work given nothing at
1809 % all -- the first parameter is undelimited.)
1810 \expandafter\splitoff\thearg\endmark
1812 % Only one token in the argument. It could still be anything.
1813 % A ``lowercase letter'' is one whose \lccode is nonzero.
1814 % An ``uppercase letter'' is one whose \lccode is both nonzero, and
1815 % not equal to itself.
1816 % Otherwise, we assume it's a number.
1818 % We need the \relax at the end of the \ifnum lines to stop TeX from
1819 % continuing to look for a <number>.
1821 \ifnum\lccode\expandafter`
\thearg=
0\relax
1822 \numericenumerate % a number (we hope)
1825 \ifnum\lccode\expandafter`
\thearg=
\expandafter`
\thearg\relax
1826 \lowercaseenumerate % lowercase letter
1828 \uppercaseenumerate % uppercase letter
1832 % Multiple tokens in the argument. We hope it's a number.
1837 % An @enumerate whose labels are integers. The starting integer is
1840 \def\numericenumerate{%
1842 \startenumeration{\the\itemno}%
1845 % The starting (lowercase) letter is in \thearg.
1846 \def\lowercaseenumerate{%
1847 \itemno =
\expandafter`
\thearg
1849 % Be sure we're not beyond the end of the alphabet.
1851 \errmessage{No more lowercase letters in @enumerate; get a bigger
1858 % The starting (uppercase) letter is in \thearg.
1859 \def\uppercaseenumerate{%
1860 \itemno =
\expandafter`
\thearg
1862 % Be sure we're not beyond the end of the alphabet.
1864 \errmessage{No more uppercase letters in @enumerate; get a bigger
1871 % Call itemizey, adding a period to the first argument and supplying the
1872 % common last two arguments. Also subtract one from the initial value in
1873 % \itemno, since @item increments \itemno.
1875 \def\startenumeration#1{%
1876 \advance\itemno by -
1
1877 \itemizey{#1.
}\Eenumerate\flushcr
1880 % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
1883 \def\alphaenumerate{\enumerate{a
}}
1884 \def\capsenumerate{\enumerate{A
}}
1885 \def\Ealphaenumerate{\Eenumerate}
1886 \def\Ecapsenumerate{\Eenumerate}
1888 % Definition of @item while inside @itemize.
1891 \advance\itemno by
1
1892 {\let\par=
\endgraf \smallbreak}%
1893 \ifhmode \errmessage{\in hmode at itemizeitem
}\fi
1894 {\parskip=
0in
\hskip 0pt
1895 \hbox to
0pt
{\hss \itemcontents\hskip \itemmargin}%
1896 \vadjust{\penalty 1200}}%
1899 % @multitable macros
1900 % Amy Hendrickson, 8/18/94, 3/6/96
1902 % @multitable ... @end multitable will make as many columns as desired.
1903 % Contents of each column will wrap at width given in preamble. Width
1904 % can be specified either with sample text given in a template line,
1905 % or in percent of \hsize, the current width of text on page.
1907 % Table can continue over pages but will only break between lines.
1911 % Either define widths of columns in terms of percent of \hsize:
1912 % @multitable @columnfractions .25 .3 .45
1915 % Numbers following @columnfractions are the percent of the total
1916 % current hsize to be used for each column. You may use as many
1917 % columns as desired.
1920 % Or use a template:
1921 % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
1923 % using the widest term desired in each column.
1925 % For those who want to use more than one line's worth of words in
1926 % the preamble, break the line within one argument and it
1927 % will parse correctly, i.e.,
1929 % @multitable {Column 1 template} {Column 2 template} {Column 3
1932 % @multitable {Column 1 template} {Column 2 template}
1933 % {Column 3 template}
1935 % Each new table line starts with @item, each subsequent new column
1936 % starts with @tab. Empty columns may be produced by supplying @tab's
1937 % with nothing between them for as many times as empty columns are needed,
1938 % ie, @tab@tab@tab will produce two empty columns.
1940 % @item, @tab, @multitable or @end multitable do not need to be on their
1941 % own lines, but it will not hurt if they are.
1943 % Sample multitable:
1945 % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
1946 % @item first col stuff @tab second col stuff @tab third col
1953 % @item first col stuff @tab second col stuff
1954 % @tab Many paragraphs of text may be used in any column.
1956 % They will wrap at the width determined by the template.
1957 % @item@tab@tab This will be in third column.
1960 % Default dimensions may be reset by user.
1961 % @multitableparskip is vertical space between paragraphs in table.
1962 % @multitableparindent is paragraph indent in table.
1963 % @multitablecolmargin is horizontal space to be left between columns.
1964 % @multitablelinespace is space to leave between table items, baseline
1966 % 0pt means it depends on current normal line spacing.
1971 \newskip\multitableparskip
1972 \newskip\multitableparindent
1973 \newdimen\multitablecolspace
1974 \newskip\multitablelinespace
1975 \multitableparskip=
0pt
1976 \multitableparindent=
6pt
1977 \multitablecolspace=
12pt
1978 \multitablelinespace=
0pt
1981 % Macros used to set up halign preamble:
1982 \let\endsetuptable\relax
1983 \def\xendsetuptable{\endsetuptable}
1984 \let\columnfractions\relax
1985 \def\xcolumnfractions{\columnfractions}
1988 %% 2/1/96, to allow fractions to be given with more than one digit.
1989 \def\pickupwholefraction#1 {\global\advance\colcount by1
%
1990 \expandafter\xdef\csname col
\the\colcount\endcsname{.
#1\hsize}%
1994 \def\setuptable#1{\def\firstarg{#1}%
1995 \ifx\firstarg\xendsetuptable\let\go\relax%
1997 \ifx\firstarg\xcolumnfractions\global\setpercenttrue%
2000 \let\go\pickupwholefraction % In this case arg of setuptable
2001 % is the decimal point before the
2002 % number given in percent of hsize.
2003 % We don't need this so we don't use it.
2005 \global\advance\colcount by1
2006 \setbox0=
\hbox{#1 }% Add a normal word space as a separator;
2007 % typically that is always in the input, anyway.
2008 \expandafter\xdef\csname col
\the\colcount\endcsname{\the\wd0}%
2011 \ifx\go\pickupwholefraction\else\let\go\setuptable\fi%
2016 \def\tab{&
\hskip1sp\relax} % 2/2/96
2017 % tiny skip here makes sure this column space is
2018 % maintained, even if it is never used.
2022 % @multitable ... @end multitable definitions:
2024 \def\multitable{\parsearg\dotable}
2026 \def\dotable#1{\bgroup
2030 \setmultitablespacing
2031 \parskip=
\multitableparskip
2032 \parindent=
\multitableparindent
2034 \global\colcount=
0\relax%
2035 \def\Emultitable{\global\setpercentfalse\global\everycr{}\cr\egroup\egroup}%
2036 % To parse everything between @multitable and @item :
2037 \setuptable#1 \endsetuptable
2038 % Need to reset this to 0 after \setuptable.
2039 \global\colcount=
0\relax%
2041 % This preamble sets up a generic column definition, which will
2042 % be used as many times as user calls for columns.
2043 % \vtop will set a single line and will also let text wrap and
2044 % continue for many paragraphs if desired.
2045 \halign\bgroup&
\global\advance\colcount by
1\relax%
2046 \multistrut\vtop{\hsize=
\expandafter\csname col
\the\colcount\endcsname
2047 % In order to keep entries from bumping into each other
2048 % we will add a \leftskip of \multitablecolspace to all columns after
2050 % If a template has been used, we will add \multitablecolspace
2051 % to the width of each template entry.
2052 % If user has set preamble in terms of percent of \hsize
2053 % we will use that dimension as the width of the column, and
2054 % the \leftskip will keep entries from bumping into each other.
2055 % Table will start at left margin and final column will justify at
2061 % If user has <not> set preamble in terms of percent of \hsize
2062 % we will advance \hsize by \multitablecolspace
2063 \advance\hsize by
\multitablecolspace
2065 % In either case we will make \leftskip=\multitablecolspace:
2066 \leftskip=
\multitablecolspace
2068 % Ignoring space at the beginning and end avoids an occasional spurious
2069 % blank line, when TeX decides to break the line at the space before the
2070 % box from the multistrut, so the strut ends up on a line by itself.
2072 % @multitable @columnfractions .11 .89
2074 % @tab Legal holiday which is valid in major parts of the whole country.
2075 % Is automatically provided with highlighting sequences respectively marking
2077 \noindent\ignorespaces##
\unskip\multistrut}\cr
2078 % \everycr will reset column counter, \colcount, at the end of
2079 % each line. Every column entry will cause \colcount to advance by one.
2080 % The table preamble
2081 % looks at the current \colcount to find the correct column width.
2082 \global\everycr{\noalign{%
2083 % \filbreak%% keeps underfull box messages off when table breaks over pages.
2084 % Maybe so, but it also creates really weird page breaks when the table
2085 % breaks over pages Wouldn't \vfil be better? Wait until the problem
2086 % manifests itself, so it can be fixed for real --karl.
2087 \global\colcount=
0\relax}}
2090 \def\setmultitablespacing{% test to see if user has set \multitablelinespace.
2091 % If so, do nothing. If not, give it an appropriate dimension based on
2092 % current baselineskip.
2093 \ifdim\multitablelinespace=
0pt
2094 %% strut to put in table in case some entry doesn't have descenders,
2095 %% to keep lines equally spaced
2096 \let\multistrut =
\strut
2097 %% Test to see if parskip is larger than space between lines of
2098 %% table. If not, do nothing.
2099 %% If so, set to same dimension as multitablelinespace.
2101 \gdef\multistrut{\vrule height
\multitablelinespace depth
\dp0
2103 \ifdim\multitableparskip>
\multitablelinespace
2104 \global\multitableparskip=
\multitablelinespace
2105 \global\advance\multitableparskip-
7pt
%% to keep parskip somewhat smaller
2106 %% than skip between lines in the table.
2108 \ifdim\multitableparskip=
0pt
2109 \global\multitableparskip=
\multitablelinespace
2110 \global\advance\multitableparskip-
7pt
%% to keep parskip somewhat smaller
2111 %% than skip between lines in the table.
2116 % Index generation facilities
2118 % Define \newwrite to be identical to plain tex's \newwrite
2119 % except not \outer, so it can be used within \newindex.
2121 \gdef\newwrite{\alloc@
7\write\chardef\sixt@@n
}}
2123 % \newindex {foo} defines an index named foo.
2124 % It automatically defines \fooindex such that
2125 % \fooindex ...rest of line... puts an entry in the index foo.
2126 % It also defines \fooindfile to be the number of the output channel for
2127 % the file that accumulates this index. The file's extension is foo.
2128 % The name of an index should be no more than 2 characters long
2129 % for the sake of vms.
2132 \expandafter\newwrite \csname#1indfile
\endcsname% Define number for output file
2133 \openout \csname#1indfile
\endcsname \jobname.
#1 % Open the file
2134 \expandafter\xdef\csname#1index
\endcsname{% % Define \xxxindex
2135 \noexpand\doindex {#1}}
2138 % @defindex foo == \newindex{foo}
2140 \def\defindex{\parsearg\newindex}
2142 % Define @defcodeindex, like @defindex except put all entries in @code.
2144 \def\newcodeindex #1{
2145 \expandafter\newwrite \csname#1indfile
\endcsname% Define number for output file
2146 \openout \csname#1indfile
\endcsname \jobname.
#1 % Open the file
2147 \expandafter\xdef\csname#1index
\endcsname{% % Define \xxxindex
2148 \noexpand\docodeindex {#1}}
2151 \def\defcodeindex{\parsearg\newcodeindex}
2153 % @synindex foo bar makes index foo feed into index bar.
2154 % Do this instead of @defindex foo if you don't want it as a separate index.
2155 \def\synindex #1 #2 {%
2156 \expandafter\let\expandafter\synindexfoo\expandafter=
\csname#2indfile
\endcsname
2157 \expandafter\let\csname#1indfile
\endcsname=
\synindexfoo
2158 \expandafter\xdef\csname#1index
\endcsname{% % Define \xxxindex
2159 \noexpand\doindex {#2}}%
2162 % @syncodeindex foo bar similar, but put all entries made for index foo
2164 \def\syncodeindex #1 #2 {%
2165 \expandafter\let\expandafter\synindexfoo\expandafter=
\csname#2indfile
\endcsname
2166 \expandafter\let\csname#1indfile
\endcsname=
\synindexfoo
2167 \expandafter\xdef\csname#1index
\endcsname{% % Define \xxxindex
2168 \noexpand\docodeindex {#2}}%
2171 % Define \doindex, the driver for all \fooindex macros.
2172 % Argument #1 is generated by the calling \fooindex macro,
2173 % and it is "foo", the name of the index.
2175 % \doindex just uses \parsearg; it calls \doind for the actual work.
2176 % This is because \doind is more useful to call from other macros.
2178 % There is also \dosubind {index}{topic}{subtopic}
2179 % which makes an entry in a two-level index such as the operation index.
2181 \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
2182 \def\singleindexer #1{\doind{\indexname}{#1}}
2184 % like the previous two, but they put @code around the argument.
2185 \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
2186 \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
2189 % Take care of the plain tex accent commands.
2190 \def\"
{\realbackslash "
}%
2191 \def\`
{\realbackslash `
}%
2192 \def\'
{\realbackslash '
}%
2193 \def\^
{\realbackslash ^
}%
2194 \def\~
{\realbackslash ~
}%
2195 \def\=
{\realbackslash =
}%
2196 \def\b{\realbackslash b
}%
2197 \def\c{\realbackslash c
}%
2198 \def\d{\realbackslash d
}%
2199 \def\u{\realbackslash u
}%
2200 \def\v{\realbackslash v
}%
2201 \def\H{\realbackslash H
}%
2202 % Take care of the plain tex special European modified letters.
2203 \def\oe{\realbackslash oe
}%
2204 \def\ae{\realbackslash ae
}%
2205 \def\aa{\realbackslash aa
}%
2206 \def\OE{\realbackslash OE
}%
2207 \def\AE{\realbackslash AE
}%
2208 \def\AA{\realbackslash AA
}%
2209 \def\o{\realbackslash o
}%
2210 \def\O{\realbackslash O
}%
2211 \def\l{\realbackslash l
}%
2212 \def\L{\realbackslash L
}%
2213 \def\ss{\realbackslash ss
}%
2214 % Take care of texinfo commands likely to appear in an index entry.
2215 % (Must be a way to avoid doing expansion at all, and thus not have to
2216 % laboriously list every single command here.)
2217 \def\@
{@
}% will be @@ when we switch to @ as escape char.
2218 %\let\{ = \lbracecmd
2219 %\let\} = \rbracecmd
2220 \def\_{{\realbackslash _
}}%
2221 \def\w{\realbackslash w
}%
2222 \def\bf{\realbackslash bf
}%
2223 %\def\rm{\realbackslash rm }%
2224 \def\sl{\realbackslash sl
}%
2225 \def\sf{\realbackslash sf
}%
2226 \def\tt{\realbackslash tt
}%
2227 \def\gtr{\realbackslash gtr
}%
2228 \def\less{\realbackslash less
}%
2229 \def\hat{\realbackslash hat
}%
2230 %\def\char{\realbackslash char}%
2231 \def\TeX{\realbackslash TeX
}%
2232 \def\dots{\realbackslash dots
}%
2233 \def\copyright{\realbackslash copyright
}%
2234 \def\tclose#
#1{\realbackslash tclose
{#
#1}}%
2235 \def\code#
#1{\realbackslash code
{#
#1}}%
2236 \def\dotless#
#1{\realbackslash dotless
{#
#1}}%
2237 \def\samp#
#1{\realbackslash samp
{#
#1}}%
2238 \def\,#
#1{\realbackslash ,
{#
#1}}%
2239 \def\t#
#1{\realbackslash t
{#
#1}}%
2240 \def\r#
#1{\realbackslash r
{#
#1}}%
2241 \def\i#
#1{\realbackslash i
{#
#1}}%
2242 \def\b#
#1{\realbackslash b
{#
#1}}%
2243 \def\cite#
#1{\realbackslash cite
{#
#1}}%
2244 \def\key#
#1{\realbackslash key
{#
#1}}%
2245 \def\file#
#1{\realbackslash file
{#
#1}}%
2246 \def\var#
#1{\realbackslash var
{#
#1}}%
2247 \def\kbd#
#1{\realbackslash kbd
{#
#1}}%
2248 \def\dfn#
#1{\realbackslash dfn
{#
#1}}%
2249 \def\emph#
#1{\realbackslash emph
{#
#1}}%
2253 % If an index command is used in an @example environment, any spaces
2254 % therein should become regular spaces in the raw index file, not the
2255 % expansion of \tie (\\leavevmode \penalty \@M \ ).
2257 \gdef\unsepspaces{\obeyspaces\let =
\space}}
2259 % \indexnofonts no-ops all font-change commands.
2260 % This is used when outputting the strings to sort the index by.
2261 \def\indexdummyfont#1{#1}
2262 \def\indexdummytex{TeX
}
2263 \def\indexdummydots{...
}
2266 % Just ignore accents.
2267 \let\,=
\indexdummyfont
2268 \let\"=
\indexdummyfont
2269 \let\`=
\indexdummyfont
2270 \let\'=
\indexdummyfont
2271 \let\^=
\indexdummyfont
2272 \let\~=
\indexdummyfont
2273 \let\==
\indexdummyfont
2274 \let\b=
\indexdummyfont
2275 \let\c=
\indexdummyfont
2276 \let\d=
\indexdummyfont
2277 \let\u=
\indexdummyfont
2278 \let\v=
\indexdummyfont
2279 \let\H=
\indexdummyfont
2280 \let\dotless=
\indexdummyfont
2281 % Take care of the plain tex special European modified letters.
2293 \let\w=
\indexdummyfont
2294 \let\t=
\indexdummyfont
2295 \let\r=
\indexdummyfont
2296 \let\i=
\indexdummyfont
2297 \let\b=
\indexdummyfont
2298 \let\emph=
\indexdummyfont
2299 \let\strong=
\indexdummyfont
2300 \let\cite=
\indexdummyfont
2301 \let\sc=
\indexdummyfont
2302 %Don't no-op \tt, since it isn't a user-level command
2303 % and is used in the definitions of the active chars like <, >, |...
2304 %\let\tt=\indexdummyfont
2305 \let\tclose=
\indexdummyfont
2306 \let\code=
\indexdummyfont
2307 \let\file=
\indexdummyfont
2308 \let\samp=
\indexdummyfont
2309 \let\kbd=
\indexdummyfont
2310 \let\key=
\indexdummyfont
2311 \let\var=
\indexdummyfont
2312 \let\TeX=
\indexdummytex
2313 \let\dots=
\indexdummydots
2317 % To define \realbackslash, we must make \ not be an escape.
2318 % We must first make another character (@) an escape
2319 % so we do not become unable to do a definition.
2321 {\catcode`\@=
0 \catcode`\\=
\other
2322 @gdef@realbackslash
{\
}}
2324 \let\indexbackslash=
0 %overridden during \printindex.
2326 \let\SETmarginindex=
\relax %initialize!
2327 % workhorse for all \fooindexes
2328 % #1 is name of index, #2 is stuff to put there
2330 % Put the index entry in the margin if desired.
2331 \ifx\SETmarginindex\relax\else
2332 \insert\margin{\hbox{\vrule height8pt depth3pt width0pt
#2}}%
2335 \count255=
\lastpenalty
2337 \indexdummies % Must do this here, since \bf, etc expand at this stage
2340 \let\folio=
0% We will expand all macros now EXCEPT \folio.
2341 \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
2342 % so it will be output as is; and it will print as backslash.
2344 % First process the index-string with all font commands turned off
2345 % to get the string to sort by.
2346 {\indexnofonts \xdef\indexsorttmp{#2}}%
2348 % Now produce the complete index entry, with both the sort key and the
2349 % original text, including any font commands.
2352 \write\csname#1indfile
\endcsname{%
2353 \realbackslash entry
{\indexsorttmp}{\folio}{\the\toks0}}%
2362 \def\dosubind #1#2#3{%
2363 {\count10=
\lastpenalty %
2364 {\indexdummies % Must do this here, since \bf, etc expand at this stage
2367 \def\rawbackslashxx{\indexbackslash}%
2369 % Now process the index-string once, with all font commands turned off,
2370 % to get the string to sort the index by.
2374 % Now produce the complete index entry. We process the index-string again,
2375 % this time with font commands expanded, to get what to print in the index.
2377 \write \csname#1indfile
\endcsname{%
2378 \realbackslash entry
{\temp1}{\folio}{#2}{#3}}}%
2382 % The index entry written in the file actually looks like
2383 % \entry {sortstring}{page}{topic}
2385 % \entry {sortstring}{page}{topic}{subtopic}
2386 % The texindex program reads in these files and writes files
2387 % containing these kinds of lines:
2389 % before the first topic whose initial is c
2390 % \entry {topic}{pagelist}
2391 % for a topic that is used without subtopics
2393 % for the beginning of a topic that is used with subtopics
2394 % \secondary {subtopic}{pagelist}
2395 % for each subtopic.
2397 % Define the user-accessible indexing commands
2398 % @findex, @vindex, @kindex, @cindex.
2400 \def\findex {\fnindex}
2401 \def\kindex {\kyindex}
2402 \def\cindex {\cpindex}
2403 \def\vindex {\vrindex}
2404 \def\tindex {\tpindex}
2405 \def\pindex {\pgindex}
2407 \def\cindexsub {\begingroup\obeylines\cindexsub}
2409 \gdef\cindexsub "
#1"
#2^^M
{\endgroup %
2410 \dosubind{cp
}{#2}{#1}}}
2412 % Define the macros used in formatting output of the sorted index material.
2414 % This is what you call to cause a particular index to get printed.
2416 % @unnumbered Function Index
2419 \def\printindex{\parsearg\doprintindex}
2421 \def\doprintindex#1{\begingroup
2422 \dobreak \chapheadingskip{10000}%
2427 \def\indexbackslash{\rawbackslashxx}%
2428 % Index files are almost Texinfo source, but we use \ as the escape
2429 % character. It would be better to use @, but that's too big a change
2430 % to make right now.
2436 % See if the index file exists and is nonempty.
2437 \openin 1 \jobname.
#1s
2439 % \enddoublecolumns gets confused if there is no text in the index,
2440 % and it loses the chapter title and the aux file entries for the
2441 % index. The easiest way to prevent this problem is to make sure
2442 % there is some text.
2443 (Index is nonexistent)
2446 % If the index file exists but is empty, then \openin leaves \ifeof
2447 % false. We have to make TeX try to read something from the file, so
2448 % it can discover if there is anything in it.
2460 % These macros are used by the sorted index file itself.
2461 % Change them to control the appearance of the index.
2463 % Same as \bigskipamount except no shrink.
2464 % \balancecolumns gets confused if there is any shrink.
2465 \newskip\initialskipamount \initialskipamount 12pt plus4pt
2468 {\let\tentt=
\sectt \let\tt=
\sectt \let\sf=
\sectt
2469 \ifdim\lastskip<
\initialskipamount
2470 \removelastskip \penalty-
200 \vskip \initialskipamount\fi
2471 \line{\secbf#1\hfill}\kern 2pt
\penalty10000}}
2473 % This typesets a paragraph consisting of #1, dot leaders, and then #2
2474 % flush to the right margin. It is used for index and table of contents
2475 % entries. The paragraph is indented by \leftskip.
2477 \def\entry #1#2{\begingroup
2479 % Start a new paragraph if necessary, so our assignments below can't
2480 % affect previous text.
2483 % Do not fill out the last line with white space.
2486 % No extra space above this paragraph.
2489 % Do not prefer a separate line ending with a hyphen to fewer lines.
2490 \finalhyphendemerits =
0
2492 % \hangindent is only relevant when the entry text and page number
2493 % don't both fit on one line. In that case, bob suggests starting the
2494 % dots pretty far over on the line. Unfortunately, a large
2495 % indentation looks wrong when the entry text itself is broken across
2496 % lines. So we use a small indentation and put up with long leaders.
2498 % \hangafter is reset to 1 (which is the value we want) at the start
2499 % of each paragraph, so we need not do anything with that.
2502 % When the entry text needs to be broken, just fill out the first line
2504 \rightskip =
0pt plus1fil
2506 % Start a ``paragraph'' for the index entry so the line breaking
2507 % parameters we've set above will have an effect.
2510 % Insert the text of the index entry. TeX will do line-breaking on it.
2512 % The following is kludged to not output a line of dots in the index if
2513 % there are no page numbers. The next person who breaks this will be
2514 % cursed by a Unix daemon.
2517 \edef\tempc{\tempa}%
2518 \edef\tempd{\tempb}%
2519 \ifx\tempc\tempd\
\else%
2521 % If we must, put the page number on a line of its own, and fill out
2522 % this line with blank space. (The \hfil is overwhelmed with the
2523 % fill leaders glue in \indexdotfill if the page number does fit.)
2525 \null\nobreak\indexdotfill % Have leaders before the page number.
2527 % The `\ ' here is removed by the implicit \unskip that TeX does as
2528 % part of (the primitive) \par. Without it, a spurious underfull
2530 \
#2% The page number ends the paragraph.
2535 % Like \dotfill except takes at least 1 em.
2536 \def\indexdotfill{\cleaders
2537 \hbox{$
\mathsurround=
0pt
\mkern1.5mu $
{\it .
}$
\mkern1.5mu$
}\hskip 1em plus
1fill
}
2539 \def\primary #1{\line{#1\hfil}}
2541 \newskip\secondaryindent \secondaryindent=
0.5cm
2543 \def\secondary #1#2{
2544 {\parfillskip=
0in
\parskip=
0in
2545 \hangindent =
1in
\hangafter=
1
2546 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par
2549 % Define two-column mode, which we use to typeset indexes.
2550 % Adapted from the TeXbook, page 416, which is to say,
2551 % the manmac.tex format used to print the TeXbook itself.
2555 \newdimen\doublecolumnhsize
2557 \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
2558 % Grab any single-column material above us.
2559 \output =
{\global\setbox\partialpage
2560 =
\vbox{\unvbox255\kern -
\topskip \kern \baselineskip}}%
2563 % Now switch to the double-column output routine.
2564 \output=
{\doublecolumnout}%
2566 % Change the page size parameters. We could do this once outside this
2567 % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
2568 % format, but then we repeat the same computation. Repeating a couple
2569 % of assignments once per index is clearly meaningless for the
2570 % execution time, so we may as well do it once.
2572 % First we halve the line length, less a little for the gutter between
2573 % the columns. We compute the gutter based on the line length, so it
2574 % changes automatically with the paper format. The magic constant
2575 % below is chosen so that the gutter has the same value (well, +- <
2576 % 1pt) as it did when we hard-coded it.
2578 % We put the result in a separate register, \doublecolumhsize, so we
2579 % can restore it in \pagesofar, after \hsize itself has (potentially)
2582 \doublecolumnhsize =
\hsize
2583 \advance\doublecolumnhsize by -
.04154\hsize
2584 \divide\doublecolumnhsize by
2
2585 \hsize =
\doublecolumnhsize
2587 % Double the \vsize as well. (We don't need a separate register here,
2588 % since nobody clobbers \vsize.)
2591 \def\doublecolumnout{%
2592 \splittopskip=
\topskip \splitmaxdepth=
\maxdepth
2593 % Get the available space for the double columns -- the normal
2594 % (undoubled) page height minus any material left over from the
2596 \dimen@=
\pageheight \advance\dimen@ by-
\ht\partialpage
2597 % box0 will be the left-hand column, box1 the right.
2598 \setbox0=
\vsplit255 to
\dimen@
\setbox2=
\vsplit255 to
\dimen@
2599 \onepageout\pagesofar
2600 \unvbox255 \penalty\outputpenalty
2603 % The contents of the output page -- any previous material,
2604 % followed by the two boxes we just split.
2606 \hsize =
\doublecolumnhsize
2607 \wd0=
\hsize \wd2=
\hsize \hbox to
\pagewidth{\box0\hfil\box2}%
2609 \def\enddoublecolumns{%
2610 \output=
{\balancecolumns}\eject % split what we have
2612 % Back to normal single-column typesetting, but take account of the
2613 % fact that we just accumulated some stuff on the output page.
2616 \def\balancecolumns{%
2617 % Called on the last page of the double column material.
2618 \setbox0=
\vbox{\unvbox255}%
2620 \advance\dimen@ by
\topskip
2621 \advance\dimen@ by-
\baselineskip
2623 \splittopskip =
\topskip
2624 % Loop until we get a decent breakpoint.
2625 {\vbadness=
10000 \loop \global\setbox3=
\copy0
2626 \global\setbox1=
\vsplit3 to
\dimen@
2627 \ifdim\ht3>
\dimen@
\global\advance\dimen@ by1pt
\repeat}%
2628 \setbox0=
\vbox to
\dimen@
{\unvbox1}%
2629 \setbox2=
\vbox to
\dimen@
{\unvbox3}%
2635 \message{sectioning,
}
2636 % Define chapters, sections, etc.
2639 \newcount \secno \secno=
0
2640 \newcount \subsecno \subsecno=
0
2641 \newcount \subsubsecno \subsubsecno=
0
2643 % This counter is funny since it counts through charcodes of letters A, B, ...
2644 \newcount \appendixno \appendixno = `\@
2645 \def\appendixletter{\char\the\appendixno}
2647 \newwrite \contentsfile
2648 % This is called from \setfilename.
2649 \def\opencontents{\openout \contentsfile =
\jobname.toc
}
2651 % Each @chapter defines this as the name of the chapter.
2652 % page headings and footings can use it. @section does likewise
2654 \def\thischapter{} \def\thissection{}
2655 \def\seccheck#1{\if \pageno<
0 %
2656 \errmessage{@
#1 not allowed after generating table of contents
}\fi
2660 \def\chapternofonts{%
2661 \let\rawbackslash=
\relax%
2662 \let\frenchspacing=
\relax%
2663 \def\result{\realbackslash result
}
2664 \def\equiv{\realbackslash equiv
}
2665 \def\expansion{\realbackslash expansion
}
2666 \def\print{\realbackslash print
}
2667 \def\TeX{\realbackslash TeX
}
2668 \def\dots{\realbackslash dots
}
2669 \def\copyright{\realbackslash copyright
}
2670 \def\tt{\realbackslash tt
}
2671 \def\bf{\realbackslash bf
}
2672 \def\w{\realbackslash w
}
2673 \def\less{\realbackslash less
}
2674 \def\gtr{\realbackslash gtr
}
2675 \def\hat{\realbackslash hat
}
2676 \def\char{\realbackslash char
}
2677 \def\tclose#
#1{\realbackslash tclose
{#
#1}}
2678 \def\code#
#1{\realbackslash code
{#
#1}}
2679 \def\samp#
#1{\realbackslash samp
{#
#1}}
2680 \def\r#
#1{\realbackslash r
{#
#1}}
2681 \def\b#
#1{\realbackslash b
{#
#1}}
2682 \def\key#
#1{\realbackslash key
{#
#1}}
2683 \def\file#
#1{\realbackslash file
{#
#1}}
2684 \def\kbd#
#1{\realbackslash kbd
{#
#1}}
2685 % These are redefined because @smartitalic wouldn't work inside xdef.
2686 \def\i#
#1{\realbackslash i
{#
#1}}
2687 \def\cite#
#1{\realbackslash cite
{#
#1}}
2688 \def\var#
#1{\realbackslash var
{#
#1}}
2689 \def\emph#
#1{\realbackslash emph
{#
#1}}
2690 \def\dfn#
#1{\realbackslash dfn
{#
#1}}
2693 \newcount\absseclevel % used to calculate proper heading level
2694 \newcount\secbase\secbase=
0 % @raise/lowersections modify this count
2696 % @raisesections: treat @section as chapter, @subsection as section, etc.
2697 \def\raisesections{\global\advance\secbase by -
1}
2698 \let\up=
\raisesections % original BFox name
2700 % @lowersections: treat @chapter as section, @section as subsection, etc.
2701 \def\lowersections{\global\advance\secbase by
1}
2702 \let\down=
\lowersections % original BFox name
2704 % Choose a numbered-heading macro
2705 % #1 is heading level if unmodified by @raisesections or @lowersections
2706 % #2 is text for heading
2707 \def\numhead#1#2{\absseclevel=
\secbase\advance\absseclevel by
#1
2713 \numberedsubseczzz{#2}
2715 \numberedsubsubseczzz{#2}
2717 \ifnum \absseclevel<
0
2720 \numberedsubsubseczzz{#2}
2725 % like \numhead, but chooses appendix heading levels
2726 \def\apphead#1#2{\absseclevel=
\secbase\advance\absseclevel by
#1
2730 \appendixsectionzzz{#2}
2732 \appendixsubseczzz{#2}
2734 \appendixsubsubseczzz{#2}
2736 \ifnum \absseclevel<
0
2739 \appendixsubsubseczzz{#2}
2744 % like \numhead, but chooses numberless heading levels
2745 \def\unnmhead#1#2{\absseclevel=
\secbase\advance\absseclevel by
#1
2749 \unnumberedseczzz{#2}
2751 \unnumberedsubseczzz{#2}
2753 \unnumberedsubsubseczzz{#2}
2755 \ifnum \absseclevel<
0
2758 \unnumberedsubsubseczzz{#2}
2764 \def\thischaptername{No Chapter Title
}
2765 \outer\def\chapter{\parsearg\chapteryyy}
2766 \def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz
2767 \def\chapterzzz #1{\seccheck{chapter
}%
2768 \secno=
0 \subsecno=
0 \subsubsecno=
0
2769 \global\advance \chapno by
1 \message{\putwordChapter \the\chapno}%
2770 \chapmacro {#1}{\the\chapno}%
2771 \gdef\thissection{#1}%
2772 \gdef\thischaptername{#1}%
2773 % We don't substitute the actual chapter name into \thischapter
2774 % because we don't want its macros evaluated now.
2775 \xdef\thischapter{\putwordChapter{} \the\chapno:
\noexpand\thischaptername}%
2777 \edef\temp{{\realbackslash chapentry
{#1}{\the\chapno}{\noexpand\folio}}}%
2779 \write \contentsfile \temp %
2781 \global\let\section =
\numberedsec
2782 \global\let\subsection =
\numberedsubsec
2783 \global\let\subsubsection =
\numberedsubsubsec
2786 \outer\def\appendix{\parsearg\appendixyyy}
2787 \def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz
2788 \def\appendixzzz #1{\seccheck{appendix
}%
2789 \secno=
0 \subsecno=
0 \subsubsecno=
0
2790 \global\advance \appendixno by
1 \message{Appendix
\appendixletter}%
2791 \chapmacro {#1}{\putwordAppendix{} \appendixletter}%
2792 \gdef\thissection{#1}%
2793 \gdef\thischaptername{#1}%
2794 \xdef\thischapter{\putwordAppendix{} \appendixletter:
\noexpand\thischaptername}%
2796 \edef\temp{{\realbackslash chapentry
2797 {#1}{\putwordAppendix{} \appendixletter}{\noexpand\folio}}}%
2799 \write \contentsfile \temp %
2801 \global\let\section =
\appendixsec
2802 \global\let\subsection =
\appendixsubsec
2803 \global\let\subsubsection =
\appendixsubsubsec
2806 % @centerchap is like @unnumbered, but the heading is centered.
2807 \outer\def\centerchap{\parsearg\centerchapyyy}
2808 \def\centerchapyyy #1{{\let\unnumbchapmacro=
\centerchapmacro \unnumberedyyy{#1}}}
2810 \outer\def\top{\parsearg\unnumberedyyy}
2811 \outer\def\unnumbered{\parsearg\unnumberedyyy}
2812 \def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
2813 \def\unnumberedzzz #1{\seccheck{unnumbered
}%
2814 \secno=
0 \subsecno=
0 \subsubsecno=
0
2816 % This used to be simply \message{#1}, but TeX fully expands the
2817 % argument to \message. Therefore, if #1 contained @-commands, TeX
2818 % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
2819 % expanded @cite (which turns out to cause errors because \cite is meant
2820 % to be executed, not expanded).
2822 % Anyway, we don't want the fully-expanded definition of @cite to appear
2823 % as a result of the \message, we just want `@cite' itself. We use
2824 % \the<toks register> to achieve this: TeX expands \the<toks> only once,
2825 % simply yielding the contents of the <toks register>.
2826 \toks0 =
{#1}\message{(
\the\toks0)
}%
2828 \unnumbchapmacro {#1}%
2829 \gdef\thischapter{#1}\gdef\thissection{#1}%
2831 \edef\temp{{\realbackslash unnumbchapentry
{#1}{\noexpand\folio}}}%
2833 \write \contentsfile \temp %
2835 \global\let\section =
\unnumberedsec
2836 \global\let\subsection =
\unnumberedsubsec
2837 \global\let\subsubsection =
\unnumberedsubsubsec
2840 \outer\def\numberedsec{\parsearg\secyyy}
2841 \def\secyyy #1{\numhead1{#1}} % normally calls seczzz
2842 \def\seczzz #1{\seccheck{section
}%
2843 \subsecno=
0 \subsubsecno=
0 \global\advance \secno by
1 %
2844 \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
2846 \edef\temp{{\realbackslash secentry
%
2847 {#1}{\the\chapno}{\the\secno}{\noexpand\folio}}}%
2849 \write \contentsfile \temp %
2854 \outer\def\appendixsection{\parsearg\appendixsecyyy}
2855 \outer\def\appendixsec{\parsearg\appendixsecyyy}
2856 \def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz
2857 \def\appendixsectionzzz #1{\seccheck{appendixsection
}%
2858 \subsecno=
0 \subsubsecno=
0 \global\advance \secno by
1 %
2859 \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
2861 \edef\temp{{\realbackslash secentry
%
2862 {#1}{\appendixletter}{\the\secno}{\noexpand\folio}}}%
2864 \write \contentsfile \temp %
2869 \outer\def\unnumberedsec{\parsearg\unnumberedsecyyy}
2870 \def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz
2871 \def\unnumberedseczzz #1{\seccheck{unnumberedsec
}%
2872 \plainsecheading {#1}\gdef\thissection{#1}%
2874 \edef\temp{{\realbackslash unnumbsecentry
{#1}{\noexpand\folio}}}%
2876 \write \contentsfile \temp %
2881 \outer\def\numberedsubsec{\parsearg\numberedsubsecyyy}
2882 \def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz
2883 \def\numberedsubseczzz #1{\seccheck{subsection
}%
2884 \gdef\thissection{#1}\subsubsecno=
0 \global\advance \subsecno by
1 %
2885 \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
2887 \edef\temp{{\realbackslash subsecentry
%
2888 {#1}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
2890 \write \contentsfile \temp %
2895 \outer\def\appendixsubsec{\parsearg\appendixsubsecyyy}
2896 \def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz
2897 \def\appendixsubseczzz #1{\seccheck{appendixsubsec
}%
2898 \gdef\thissection{#1}\subsubsecno=
0 \global\advance \subsecno by
1 %
2899 \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
2901 \edef\temp{{\realbackslash subsecentry
%
2902 {#1}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
2904 \write \contentsfile \temp %
2909 \outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy}
2910 \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
2911 \def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec
}%
2912 \plainsubsecheading {#1}\gdef\thissection{#1}%
2914 \edef\temp{{\realbackslash unnumbsubsecentry
{#1}{\noexpand\folio}}}%
2916 \write \contentsfile \temp %
2921 \outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy}
2922 \def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz
2923 \def\numberedsubsubseczzz #1{\seccheck{subsubsection
}%
2924 \gdef\thissection{#1}\global\advance \subsubsecno by
1 %
2925 \subsubsecheading {#1}
2926 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
2928 \edef\temp{{\realbackslash subsubsecentry
%
2930 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}
2931 {\noexpand\folio}}}%
2933 \write \contentsfile \temp %
2938 \outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy}
2939 \def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz
2940 \def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec
}%
2941 \gdef\thissection{#1}\global\advance \subsubsecno by
1 %
2942 \subsubsecheading {#1}
2943 {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
2945 \edef\temp{{\realbackslash subsubsecentry
{#1}%
2947 {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}%
2949 \write \contentsfile \temp %
2954 \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy}
2955 \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
2956 \def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec
}%
2957 \plainsubsubsecheading {#1}\gdef\thissection{#1}%
2959 \edef\temp{{\realbackslash unnumbsubsubsecentry
{#1}{\noexpand\folio}}}%
2961 \write \contentsfile \temp %
2966 % These are variants which are not "outer", so they can appear in @ifinfo.
2967 % Actually, they should now be obsolete; ordinary section commands should work.
2968 \def\infotop{\parsearg\unnumberedzzz}
2969 \def\infounnumbered{\parsearg\unnumberedzzz}
2970 \def\infounnumberedsec{\parsearg\unnumberedseczzz}
2971 \def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz}
2972 \def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
2974 \def\infoappendix{\parsearg\appendixzzz}
2975 \def\infoappendixsec{\parsearg\appendixseczzz}
2976 \def\infoappendixsubsec{\parsearg\appendixsubseczzz}
2977 \def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz}
2979 \def\infochapter{\parsearg\chapterzzz}
2980 \def\infosection{\parsearg\sectionzzz}
2981 \def\infosubsection{\parsearg\subsectionzzz}
2982 \def\infosubsubsection{\parsearg\subsubsectionzzz}
2984 % These macros control what the section commands do, according
2985 % to what kind of chapter we are in (ordinary, appendix, or unnumbered).
2986 % Define them by default for a numbered chapter.
2987 \global\let\section =
\numberedsec
2988 \global\let\subsection =
\numberedsubsec
2989 \global\let\subsubsection =
\numberedsubsubsec
2991 % Define @majorheading, @heading and @subheading
2993 % NOTE on use of \vbox for chapter headings, section headings, and
2995 % 1) We use \vbox rather than the earlier \line to permit
2996 % overlong headings to fold.
2997 % 2) \hyphenpenalty is set to 10000 because hyphenation in a
2998 % heading is obnoxious; this forbids it.
2999 % 3) Likewise, headings look best if no \parindent is used, and
3000 % if justification is not attempted. Hence \raggedright.
3003 \def\majorheading{\parsearg\majorheadingzzz}
3004 \def\majorheadingzzz #1{%
3005 {\advance\chapheadingskip by
10pt
\chapbreak }%
3006 {\chapfonts \vbox{\hyphenpenalty=
10000\tolerance=
5000
3007 \parindent=
0pt
\raggedright
3008 \rm #1\hfill}}\bigskip \par\penalty 200}
3010 \def\chapheading{\parsearg\chapheadingzzz}
3011 \def\chapheadingzzz #1{\chapbreak %
3012 {\chapfonts \vbox{\hyphenpenalty=
10000\tolerance=
5000
3013 \parindent=
0pt
\raggedright
3014 \rm #1\hfill}}\bigskip \par\penalty 200}
3016 % @heading, @subheading, @subsubheading.
3017 \def\heading{\parsearg\plainsecheading}
3018 \def\subheading{\parsearg\plainsubsecheading}
3019 \def\subsubheading{\parsearg\plainsubsubsecheading}
3021 % These macros generate a chapter, section, etc. heading only
3022 % (including whitespace, linebreaking, etc. around it),
3023 % given all the information in convenient, parsed form.
3025 %%% Args are the skip and penalty (usually negative)
3026 \def\dobreak#1#2{\par\ifdim\lastskip<
#1\removelastskip\penalty#2\vskip#1\fi}
3028 \def\setchapterstyle #1 {\csname CHAPF
#1\endcsname}
3030 %%% Define plain chapter starts, and page on/off switching for it
3031 % Parameter controlling skip before chapter headings (if needed)
3033 \newskip\chapheadingskip
3035 \def\chapbreak{\dobreak \chapheadingskip {-
4000}}
3036 \def\chappager{\par\vfill\supereject}
3037 \def\chapoddpage{\chappager \ifodd\pageno \else \hbox to
0pt
{} \chappager\fi}
3039 \def\setchapternewpage #1 {\csname CHAPPAG
#1\endcsname}
3042 \global\let\contentsalignmacro =
\chappager
3043 \global\let\pchapsepmacro=
\chapbreak
3044 \global\let\pagealignmacro=
\chappager}
3047 \global\let\contentsalignmacro =
\chappager
3048 \global\let\pchapsepmacro=
\chappager
3049 \global\let\pagealignmacro=
\chappager
3050 \global\def\HEADINGSon{\HEADINGSsingle}}
3053 \global\let\contentsalignmacro =
\chapoddpage
3054 \global\let\pchapsepmacro=
\chapoddpage
3055 \global\let\pagealignmacro=
\chapoddpage
3056 \global\def\HEADINGSon{\HEADINGSdouble}}
3061 \global\let\chapmacro=
\chfplain
3062 \global\let\unnumbchapmacro=
\unnchfplain
3063 \global\let\centerchapmacro=
\centerchfplain}
3065 % Plain chapter opening.
3066 % #1 is the text, #2 the chapter number or empty if unnumbered.
3072 \setbox0 =
\hbox{#2\ifx\chapnum\empty\else\enspace\fi}%
3073 \vbox{\hyphenpenalty=
10000 \tolerance=
5000 \parindent=
0pt
\raggedright
3074 \hangindent =
\wd0 \centerparametersmaybe
3077 \nobreak\bigskip % no page break after a chapter title
3081 % Plain opening for unnumbered.
3082 \def\unnchfplain#1{\chfplain{#1}{}}
3084 % @centerchap -- centered and unnumbered.
3085 \let\centerparametersmaybe =
\relax
3086 \def\centerchfplain#1{{%
3087 \def\centerparametersmaybe{%
3088 \advance\rightskip by
3\rightskip
3089 \leftskip =
\rightskip
3095 \CHAPFplain % The default
3097 \def\unnchfopen #1{%
3098 \chapoddpage {\chapfonts \vbox{\hyphenpenalty=
10000\tolerance=
5000
3099 \parindent=
0pt
\raggedright
3100 \rm #1\hfill}}\bigskip \par\penalty 10000 %
3103 \def\chfopen #1#2{\chapoddpage {\chapfonts
3104 \vbox to
3in
{\vfil \hbox to
\hsize{\hfil #2} \hbox to
\hsize{\hfil #1} \vfil}}%
3108 \def\centerchfopen #1{%
3109 \chapoddpage {\chapfonts \vbox{\hyphenpenalty=
10000\tolerance=
5000
3111 \hfill {\rm #1}\hfill}}\bigskip \par\penalty 10000 %
3115 \global\let\chapmacro=
\chfopen
3116 \global\let\unnumbchapmacro=
\unnchfopen
3117 \global\let\centerchapmacro=
\centerchfopen}
3121 \newskip\secheadingskip
3122 \def\secheadingbreak{\dobreak \secheadingskip {-
1000}}
3123 \def\secheading#1#2#3{\sectionheading{sec
}{#2.
#3}{#1}}
3124 \def\plainsecheading#1{\sectionheading{sec
}{}{#1}}
3126 % Subsection titles.
3127 \newskip \subsecheadingskip
3128 \def\subsecheadingbreak{\dobreak \subsecheadingskip {-
500}}
3129 \def\subsecheading#1#2#3#4{\sectionheading{subsec
}{#2.
#3.
#4}{#1}}
3130 \def\plainsubsecheading#1{\sectionheading{subsec
}{}{#1}}
3132 % Subsubsection titles.
3133 \let\subsubsecheadingskip =
\subsecheadingskip
3134 \let\subsubsecheadingbreak =
\subsecheadingbreak
3135 \def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec
}{#2.
#3.
#4.
#5}{#1}}
3136 \def\plainsubsubsecheading#1{\sectionheading{subsubsec
}{}{#1}}
3139 % Print any size section title.
3141 % #1 is the section type (sec/subsec/subsubsec), #2 is the section
3142 % number (maybe empty), #3 the text.
3143 \def\sectionheading#1#2#3{%
3145 \expandafter\advance\csname #1headingskip
\endcsname by
\parskip
3146 \csname #1headingbreak
\endcsname
3149 % Switch to the right set of fonts.
3150 \csname #1fonts
\endcsname \rm
3152 % Only insert the separating space if we have a section number.
3154 \setbox0 =
\hbox{#2\ifx\secnum\empty\else\enspace\fi}%
3156 \vbox{\hyphenpenalty=
10000 \tolerance=
5000 \parindent=
0pt
\raggedright
3157 \hangindent =
\wd0 % zero if no section number
3160 \ifdim\parskip<
10pt
\nobreak\kern10pt\nobreak\kern-
\parskip\fi \nobreak
3164 \message{toc printing,
}
3165 % Finish up the main text and prepare to read what we've written
3168 \newskip\contentsrightmargin \contentsrightmargin=
1in
3169 \def\startcontents#1{%
3170 % If @setchapternewpage on, and @headings double, the contents should
3171 % start on an odd page, unlike chapters. Thus, we maintain
3172 % \contentsalignmacro in parallel with \pagealignmacro.
3173 % From: Torbjorn Granlund <tege@matematik.su.se>
3175 \immediate\closeout \contentsfile
3177 \pageno = -
1 % Request roman numbered pages.
3179 % Don't need to put `Contents' or `Short Contents' in the headline.
3180 % It is abundantly clear what they are.
3181 \unnumbchapmacro{#1}\def\thischapter{}%
3182 \begingroup % Set up to handle contents files properly.
3183 \catcode`\\=
0 \catcode`\
{=
1 \catcode`\
}=
2 \catcode`\@=
11
3184 \catcode`\^=
7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
3185 \raggedbottom % Worry more about breakpoints than the bottom.
3186 \advance\hsize by -
\contentsrightmargin % Don't use the full line length.
3190 % Normal (long) toc.
3191 \outer\def\contents{%
3192 \startcontents{\putwordTableofContents}%
3198 % And just the chapters.
3199 \outer\def\summarycontents{%
3200 \startcontents{\putwordShortContents}%
3202 \let\chapentry =
\shortchapentry
3203 \let\unnumbchapentry =
\shortunnumberedentry
3204 % We want a true roman here for the page numbers.
3206 \let\rm=
\shortcontrm \let\bf=
\shortcontbf \let\sl=
\shortcontsl
3208 \hyphenpenalty =
10000
3209 \advance\baselineskip by
1pt
% Open it up a little.
3210 \def\secentry #
#1#
#2#
#3#
#4{}
3211 \def\unnumbsecentry #
#1#
#2{}
3212 \def\subsecentry #
#1#
#2#
#3#
#4#
#5{}
3213 \def\unnumbsubsecentry #
#1#
#2{}
3214 \def\subsubsecentry #
#1#
#2#
#3#
#4#
#5#
#6{}
3215 \def\unnumbsubsubsecentry #
#1#
#2{}
3220 \let\shortcontents =
\summarycontents
3222 % These macros generate individual entries in the table of contents.
3223 % The first argument is the chapter or section name.
3224 % The last argument is the page number.
3225 % The arguments in between are the chapter number, section number, ...
3227 % Chapter-level things, for both the long and short contents.
3228 \def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}
3230 % See comments in \dochapentry re vbox and related settings
3231 \def\shortchapentry#1#2#3{%
3232 \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno{#3}}%
3235 % Typeset the label for a chapter or appendix for the short contents.
3236 % The arg is, e.g. `Appendix A' for an appendix, or `3' for a chapter.
3237 % We could simplify the code here by writing out an \appendixentry
3238 % command in the toc file for appendices, instead of using \chapentry
3239 % for both, but it doesn't seem worth it.
3240 \setbox0 =
\hbox{\shortcontrm \putwordAppendix }
3241 \newdimen\shortappendixwidth \shortappendixwidth =
\wd0
3243 \def\shortchaplabel#1{%
3244 % We typeset #1 in a box of constant width, regardless of the text of
3245 % #1, so the chapter titles will come out aligned.
3246 \setbox0 =
\hbox{#1}%
3247 \dimen0 =
\ifdim\wd0 >
\shortappendixwidth \shortappendixwidth \else 0pt
\fi
3249 % This space should be plenty, since a single number is .5em, and the
3250 % widest letter (M) is 1em, at least in the Computer Modern fonts.
3251 % (This space doesn't include the extra space that gets added after
3252 % the label; that gets put in by \shortchapentry above.)
3253 \advance\dimen0 by
1.1em
3254 \hbox to
\dimen0{#1\hfil}%
3257 \def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
3258 \def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno{#2}}}
3261 \def\secentry#1#2#3#4{\dosecentry{#2.
#3\labelspace#1}{#4}}
3262 \def\unnumbsecentry#1#2{\dosecentry{#1}{#2}}
3265 \def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.
#3.
#4\labelspace#1}{#5}}
3266 \def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}}
3268 % And subsubsections.
3269 \def\subsubsecentry#1#2#3#4#5#6{%
3270 \dosubsubsecentry{#2.
#3.
#4.
#5\labelspace#1}{#6}}
3271 \def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}}
3273 % This parameter controls the indentation of the various levels.
3274 \newdimen\tocindent \tocindent =
3pc
3276 % Now for the actual typesetting. In all these, #1 is the text and #2 is the
3279 % If the toc has to be broken over pages, we want it to be at chapters
3280 % if at all possible; hence the \penalty.
3281 \def\dochapentry#1#2{%
3282 \penalty-
300 \vskip1\baselineskip plus
.33\baselineskip minus
.25\baselineskip
3285 \tocentry{#1}{\dopageno{#2}}%
3287 \nobreak\vskip .25\baselineskip plus
.1\baselineskip
3290 \def\dosecentry#1#2{\begingroup
3291 \secentryfonts \leftskip=
\tocindent
3292 \tocentry{#1}{\dopageno{#2}}%
3295 \def\dosubsecentry#1#2{\begingroup
3296 \subsecentryfonts \leftskip=
2\tocindent
3297 \tocentry{#1}{\dopageno{#2}}%
3300 \def\dosubsubsecentry#1#2{\begingroup
3301 \subsubsecentryfonts \leftskip=
3\tocindent
3302 \tocentry{#1}{\dopageno{#2}}%
3305 % Final typesetting of a toc entry; we use the same \entry macro as for
3306 % the index entries, but we want to suppress hyphenation here. (We
3307 % can't do that in the \entry macro, since index entries might consist
3308 % of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.)
3310 % \turnoffactive is for the sake of @" used for umlauts.
3311 \def\tocentry#1#2{\begingroup
3312 \vskip 0pt plus1pt
% allow a little stretch for the sake of nice page breaks
3313 \entry{\turnoffactive #1}{\turnoffactive #2}%
3316 % Space between chapter (or whatever) number and the title.
3317 \def\labelspace{\hskip1em \relax}
3319 \def\dopageno#1{{\rm #1}}
3320 \def\doshortpageno#1{{\rm #1}}
3322 \def\chapentryfonts{\secfonts \rm}
3323 \def\secentryfonts{\textfonts}
3324 \let\subsecentryfonts =
\textfonts
3325 \let\subsubsecentryfonts =
\textfonts
3328 \message{environments,
}
3330 % Since these characters are used in examples, it should be an even number of
3331 % \tt widths. Each \tt character is 1en, so two makes it 1em.
3332 % Furthermore, these definitions must come after we define our fonts.
3333 \newbox\dblarrowbox \newbox\longdblarrowbox
3334 \newbox\pushcharbox \newbox\bullbox
3335 \newbox\equivbox \newbox\errorbox
3338 %\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil}
3339 %\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil}
3340 %\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil}
3341 %\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil}
3342 % Adapted from the manmac format (p.420 of TeXbook)
3343 %\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex
3347 % @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
3349 \def\result{\leavevmode\raise.15ex
\hbox to
1em
{\hfil$
\Rightarrow$
\hfil}}
3350 \def\expansion{\leavevmode\raise.1ex
\hbox to
1em
{\hfil$
\mapsto$
\hfil}}
3351 \def\print{\leavevmode\lower.1ex
\hbox to
1em
{\hfil$
\dashv$
\hfil}}
3352 \def\equiv{\leavevmode\lower.1ex
\hbox to
1em
{\hfil$
\ptexequiv$
\hfil}}
3354 % Adapted from the TeXbook's \boxit.
3355 {\tentt \global\dimen0 =
3em
}% Width of the box.
3356 \dimen2 =
.55pt
% Thickness of rules
3357 % The text. (`r' is open on the right, `e' somewhat less so on the left.)
3358 \setbox0 =
\hbox{\kern-
.75pt
\tensf error
\kern-
1.5pt
}
3360 \global\setbox\errorbox=
\hbox to
\dimen0{\hfil
3361 \hsize =
\dimen0 \advance\hsize by -
5.8pt
% Space to left+right.
3362 \advance\hsize by -
2\dimen2 % Rules.
3364 \hrule height
\dimen2
3365 \hbox{\vrule width
\dimen2 \kern3pt % Space to left of text.
3366 \vtop{\kern2.4pt
\box0 \kern2.4pt
}% Space above/below.
3367 \kern3pt\vrule width
\dimen2}% Space to right.
3368 \hrule height
\dimen2}
3371 % The @error{} command.
3372 \def\error{\leavevmode\lower.7ex
\copy\errorbox}
3374 % @tex ... @end tex escapes into raw Tex temporarily.
3375 % One exception: @ is still an escape character, so that @end tex works.
3376 % But \@ or @@ will get a plain tex @ character.
3378 \def\tex{\begingroup
3379 \catcode `\\=
0 \catcode `\
{=
1 \catcode `\
}=
2
3380 \catcode `\$=
3 \catcode `\&=
4 \catcode `\#=
6
3381 \catcode `\^=
7 \catcode `
\_=
8 \catcode `\~=
13 \let~=
\tie
3383 \catcode 43=
12 % plus
3397 \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}
3398 \def\enddots{\relax\ifmmode\endldots\else$
\mathsurround=
0pt
\endldots\,$
\fi}
3400 \let\bullet=
\ptexbullet
3401 \let\b=
\ptexb \let\c=
\ptexc \let\i=
\ptexi \let\t=
\ptext
3403 \let\Etex=
\endgroup}
3405 % Define @lisp ... @endlisp.
3406 % @lisp does a \begingroup so it can rebind things,
3407 % including the definition of @endlisp (which normally is erroneous).
3409 % Amount to narrow the margins by for @lisp.
3410 \newskip\lispnarrowing \lispnarrowing=
0.4in
3412 % This is the definition that ^^M gets inside @lisp, @example, and other
3413 % such environments. \null is better than a space, since it doesn't
3415 \def\lisppar{\null\endgraf}
3417 % Make each space character in the input produce a normal interword
3418 % space in the output. Don't allow a line break at this space, as this
3419 % is used only in environments like @example, where each line of input
3420 % should produce a line of output anyway.
3423 \gdef\sepspaces{\obeyspaces\let =
\tie}}
3425 % Define \obeyedspace to be our active space, whatever it is. This is
3426 % for use in \parsearg.
3428 \global\let\obeyedspace=
}
3430 % This space is always present above and below environments.
3431 \newskip\envskipamount \envskipamount =
0pt
3433 % Make spacing and below environment symmetrical. We use \parskip here
3434 % to help in doing that, since in @example-like environments \parskip
3435 % is reset to zero; thus the \afterenvbreak inserts no space -- but the
3436 % start of the next paragraph will insert \parskip
3438 \def\aboveenvbreak{{\advance\envskipamount by
\parskip
3439 \endgraf \ifdim\lastskip<
\envskipamount
3440 \removelastskip \penalty-
50 \vskip\envskipamount \fi}}
3442 \let\afterenvbreak =
\aboveenvbreak
3444 % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins.
3445 \let\nonarrowing=
\relax
3447 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3448 % \cartouche: draw rectangle w/rounded corners around argument
3449 \font\circle=lcircle10
3451 \newdimen\cartouter\newdimen\cartinner
3452 \newskip\normbskip\newskip\normpskip\newskip\normlskip
3453 \circthick=
\fontdimen8\circle
3455 \def\ctl{{\circle\char'
013\hskip -
6pt
}}% 6pt from pl file: 1/2charwidth
3456 \def\ctr{{\hskip 6pt
\circle\char'
010}}
3457 \def\cbl{{\circle\char'
012\hskip -
6pt
}}
3458 \def\cbr{{\hskip 6pt
\circle\char'
011}}
3459 \def\carttop{\hbox to
\cartouter{\hskip\lskip
3460 \ctl\leaders\hrule height
\circthick\hfil\ctr
3462 \def\cartbot{\hbox to
\cartouter{\hskip\lskip
3463 \cbl\leaders\hrule height
\circthick\hfil\cbr
3466 \newskip\lskip\newskip\rskip
3468 \long\def\cartouche{%
3470 \lskip=
\leftskip \rskip=
\rightskip
3471 \leftskip=
0pt
\rightskip=
0pt
%we want these *outside*.
3472 \cartinner=
\hsize \advance\cartinner by-
\lskip
3473 \advance\cartinner by-
\rskip
3475 \advance\cartouter by
18pt
% allow for 3pt kerns on either
3476 % side, and for 6pt waste from
3478 \normbskip=
\baselineskip \normpskip=
\parskip \normlskip=
\lineskip
3479 % Flag to tell @lisp, etc., not to narrow margin.
3480 \let\nonarrowing=
\comment
3482 \baselineskip=
0pt
\parskip=
0pt
\lineskip=
0pt
3491 \baselineskip=
\normbskip
3492 \lineskip=
\normlskip
3508 % This macro is called at the beginning of all the @example variants,
3512 \inENV % This group ends at the end of the body
3513 \hfuzz =
12pt
% Don't be fussy
3514 \sepspaces % Make spaces be word-separators rather than space tokens.
3516 \let\par =
\lisppar % don't ignore blank lines
3517 \obeylines % each line of input is a line of output
3520 \emergencystretch =
0pt
% don't try to avoid overfull boxes
3521 % @cartouche defines \nonarrowing to inhibit narrowing
3522 % at next level down.
3523 \ifx\nonarrowing\relax
3524 \advance \leftskip by
\lispnarrowing
3525 \exdentamount=
\lispnarrowing
3526 \let\exdent=
\nofillexdent
3527 \let\nonarrowing=
\relax
3531 % To ending an @example-like environment, we first end the paragraph
3532 % (via \afterenvbreak's vertical glue), and then the group. That way we
3533 % keep the zero \parskip that the environments set -- \parskip glue
3534 % will be inserted at the beginning of the next paragraph in the
3535 % document, after the environment.
3537 \def\nonfillfinish{\afterenvbreak\endgroup}%
3540 \def\lisp{\begingroup
3542 \let\Elisp =
\nonfillfinish
3544 \rawbackslash % have \ input char produce \ char from current font
3548 % Define the \E... control sequence only if we are inside the
3549 % environment, so the error checking in \end will work.
3551 % We must call \lisp last in the definition, since it reads the
3552 % return following the @example (or whatever) command.
3554 \def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp}
3555 \def\smallexample{\begingroup \def\Esmallexample{\nonfillfinish\endgroup}\lisp}
3556 \def\smalllisp{\begingroup \def\Esmalllisp{\nonfillfinish\endgroup}\lisp}
3558 % @smallexample and @smalllisp. This is not used unless the @smallbook
3559 % command is given. Originally contributed by Pavel@xerox.
3561 \def\smalllispx{\begingroup
3563 \let\Esmalllisp =
\nonfillfinish
3564 \let\Esmallexample =
\nonfillfinish
3566 % Smaller fonts for small examples.
3568 \rawbackslash % make \ output the \ character from the current font (tt)
3572 % This is @display; same as @lisp except use roman font.
3574 \def\display{\begingroup
3576 \let\Edisplay =
\nonfillfinish
3580 % This is @format; same as @display except don't narrow margins.
3582 \def\format{\begingroup
3583 \let\nonarrowing = t
3585 \let\Eformat =
\nonfillfinish
3589 % @flushleft (same as @format) and @flushright.
3591 \def\flushleft{\begingroup
3592 \let\nonarrowing = t
3594 \let\Eflushleft =
\nonfillfinish
3597 \def\flushright{\begingroup
3598 \let\nonarrowing = t
3600 \let\Eflushright =
\nonfillfinish
3601 \advance\leftskip by
0pt plus
1fill
3604 % @quotation does normal linebreaking (hence we can't use \nonfillstart)
3605 % and narrows the margins.
3608 \begingroup\inENV %This group ends at the end of the @quotation body
3609 {\parskip=
0pt
\aboveenvbreak}% because \aboveenvbreak inserts \parskip
3612 % We have retained a nonzero parskip for the environment, since we're
3613 % doing normal filling. So to avoid extra space below the environment...
3614 \def\Equotation{\parskip =
0pt
\nonfillfinish}%
3616 % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
3617 \ifx\nonarrowing\relax
3618 \advance\leftskip by
\lispnarrowing
3619 \advance\rightskip by
\lispnarrowing
3620 \exdentamount =
\lispnarrowing
3621 \let\nonarrowing =
\relax
3626 % Define formatter for defuns
3627 % First, allow user to change definition object font (\df) internally
3628 \def\setdeffont #1 {\csname DEF
#1\endcsname}
3630 \newskip\defbodyindent \defbodyindent=
.4in
3631 \newskip\defargsindent \defargsindent=
50pt
3632 \newskip\deftypemargin \deftypemargin=
12pt
3633 \newskip\deflastargmargin \deflastargmargin=
18pt
3635 \newcount\parencount
3636 % define \functionparens, which makes ( and ) and & do special things.
3637 % \functionparens affects the group it is contained in.
3639 \catcode`\(=
\active \catcode`\)=
\active \catcode`\&=
\active
3640 \catcode`\
[=
\active \catcode`\
]=
\active}
3642 % Make control sequences which act like normal parenthesis chars.
3643 \let\lparen = (
\let\rparen = )
3645 {\activeparens % Now, smart parens don't turn on until &foo (see \amprm)
3647 % Be sure that we always have a definition for `(', etc. For example,
3648 % if the fn name has parens in it, \boldbrax will not be in effect yet,
3649 % so TeX would otherwise complain about undefined control sequence.
3650 \global\let(=
\lparen \global\let)=
\rparen
3651 \global\let[=
\lbrack \global\let]=
\rbrack
3653 \gdef\functionparens{\boldbrax\let&=
\amprm\parencount=
0 }
3654 \gdef\boldbrax{\let(=
\opnr\let)=
\clnr\let[=
\lbrb\let]=
\rbrb}
3655 % This is used to turn on special parens
3656 % but make & act ordinary (given that it's active).
3657 \gdef\boldbraxnoamp{\let(=
\opnr\let)=
\clnr\let[=
\lbrb\let]=
\rbrb\let&=
\ampnr}
3659 % Definitions of (, ) and & used in args for functions.
3660 % This is the definition of ( outside of all parentheses.
3661 \gdef\oprm#1 {{\rm\char`\(
}#1 \bf \let(=
\opnested %
3662 \global\advance\parencount by
1 }
3664 % This is the definition of ( when already inside a level of parens.
3665 \gdef\opnested{\char`\(
\global\advance\parencount by
1 }
3667 \gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
3668 % also in that case restore the outer-level definition of (.
3669 \ifnum \parencount=
1 {\rm \char `\)
}\sl \let(=
\oprm \else \char `\)
\fi
3670 \global\advance \parencount by -
1 }
3671 % If we encounter &foo, then turn on ()-hacking afterwards
3672 \gdef\amprm#1 {{\rm\&
#1}\let(=
\oprm \let)=
\clrm\
}
3674 \gdef\normalparens{\boldbrax\let&=
\ampnr}
3675 } % End of definition inside \activeparens
3676 %% These parens (in \boldbrax) actually are a little bolder than the
3677 %% contained text. This is especially needed for [ and ]
3678 \def\opnr{{\sf\char`\(
}} \def\clnr{{\sf\char`\)
}} \def\ampnr{\&
}
3679 \def\lbrb{{\bf\char`\
[}} \def\rbrb{{\bf\char`\
]}}
3681 % First, defname, which formats the header line itself.
3682 % #1 should be the function name.
3683 % #2 should be the type of definition, such as "Function".
3686 % Get the values of \leftskip and \rightskip as they were
3687 % outside the @def...
3689 \advance\dimen2 by -
\defbodyindent
3691 \advance\dimen3 by -
\defbodyindent
3693 \setbox0=
\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
3694 \dimen0=
\hsize \advance \dimen0 by -
\wd0 % compute size for first line
3695 \dimen1=
\hsize \advance \dimen1 by -
\defargsindent %size for continuations
3696 \parshape 2 0in
\dimen0 \defargsindent \dimen1 %
3697 % Now output arg 2 ("Function" or some such)
3698 % ending at \deftypemargin from the right margin,
3699 % but stuck inside a box of width 0 so it does not interfere with linebreaking
3700 {% Adjust \hsize to exclude the ambient margins,
3701 % so that \rightline will obey them.
3702 \advance \hsize by -
\dimen2 \advance \hsize by -
\dimen3
3703 \rlap{\rightline{{\rm #2}\hskip \deftypemargin}}}%
3704 % Make all lines underfull and no complaints:
3705 \tolerance=
10000 \hbadness=
10000
3706 \advance\leftskip by -
\defbodyindent
3707 \exdentamount=
\defbodyindent
3708 {\df #1}\enskip % Generate function name
3711 % Actually process the body of a definition
3712 % #1 should be the terminating control sequence, such as \Edefun.
3713 % #2 should be the "another name" control sequence, such as \defunx.
3714 % #3 should be the control sequence that actually processes the header,
3715 % such as \defunheader.
3717 \def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
3719 % Define the end token that this defining construct specifies
3720 % so that it will exit this group.
3721 \def#1{\endgraf\endgroup\medbreak}%
3722 \def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
3724 \advance\leftskip by
\defbodyindent \advance \rightskip by
\defbodyindent
3725 \exdentamount=
\defbodyindent
3727 \catcode 61=
\active % 61 is `='
3728 \obeylines\activeparens\spacesplit#3}
3730 \def\defmethparsebody #1#2#3#4 {\begingroup\inENV %
3732 % Define the end token that this defining construct specifies
3733 % so that it will exit this group.
3734 \def#1{\endgraf\endgroup\medbreak}%
3735 \def#2#
#1 {\begingroup\obeylines\activeparens\spacesplit{#3{#
#1}}}%
3737 \advance\leftskip by
\defbodyindent \advance \rightskip by
\defbodyindent
3738 \exdentamount=
\defbodyindent
3739 \begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
3741 \def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
3743 % Define the end token that this defining construct specifies
3744 % so that it will exit this group.
3745 \def#1{\endgraf\endgroup\medbreak}%
3746 \def#2#
#1 #
#2 {\def#4{#
#1}%
3747 \begingroup\obeylines\activeparens\spacesplit{#3{#
#2}}}%
3749 \advance\leftskip by
\defbodyindent \advance \rightskip by
\defbodyindent
3750 \exdentamount=
\defbodyindent
3751 \begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
3753 % These parsing functions are similar to the preceding ones
3754 % except that they do not make parens into active characters.
3755 % These are used for "variables" since they have no arguments.
3757 \def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
3759 % Define the end token that this defining construct specifies
3760 % so that it will exit this group.
3761 \def#1{\endgraf\endgroup\medbreak}%
3762 \def#2{\begingroup\obeylines\spacesplit#3}%
3764 \advance\leftskip by
\defbodyindent \advance \rightskip by
\defbodyindent
3765 \exdentamount=
\defbodyindent
3767 \catcode 61=
\active %
3768 \obeylines\spacesplit#3}
3770 % This is used for \def{tp,vr}parsebody. It could probably be used for
3771 % some of the others, too, with some judicious conditionals.
3773 \def\parsebodycommon#1#2#3{%
3776 % Define the end token that this defining construct specifies
3777 % so that it will exit this group.
3778 \def#1{\endgraf\endgroup\medbreak}%
3779 \def#2#
#1 {\begingroup\obeylines\spacesplit{#3{#
#1}}}%
3781 \advance\leftskip by
\defbodyindent \advance \rightskip by
\defbodyindent
3782 \exdentamount=
\defbodyindent
3783 \begingroup\obeylines
3786 \def\defvrparsebody#1#2#3#4 {%
3787 \parsebodycommon{#1}{#2}{#3}%
3788 \spacesplit{#3{#4}}%
3791 % This loses on `@deftp {Data Type} {struct termios}' -- it thinks the
3792 % type is just `struct', because we lose the braces in `{struct
3793 % termios}' when \spacesplit reads its undelimited argument. Sigh.
3794 % \let\deftpparsebody=\defvrparsebody
3796 % So, to get around this, we put \empty in with the type name. That
3797 % way, TeX won't find exactly `{...}' as an undelimited argument, and
3798 % won't strip off the braces.
3800 \def\deftpparsebody #1#2#3#4 {%
3801 \parsebodycommon{#1}{#2}{#3}%
3802 \spacesplit{\parsetpheaderline{#3{#4}}}\empty
3805 % Fine, but then we have to eventually remove the \empty *and* the
3806 % braces (if any). That's what this does.
3808 \def\removeemptybraces\empty#1\relax{#1}
3810 % After \spacesplit has done its work, this is called -- #1 is the final
3811 % thing to call, #2 the type name (which starts with \empty), and #3
3812 % (which might be empty) the arguments.
3814 \def\parsetpheaderline#1#2#3{%
3815 #1{\removeemptybraces#2\relax}{#3}%
3818 \def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV %
3820 % Define the end token that this defining construct specifies
3821 % so that it will exit this group.
3822 \def#1{\endgraf\endgroup\medbreak}%
3823 \def#2#
#1 #
#2 {\def#4{#
#1}%
3824 \begingroup\obeylines\spacesplit{#3{#
#2}}}%
3826 \advance\leftskip by
\defbodyindent \advance \rightskip by
\defbodyindent
3827 \exdentamount=
\defbodyindent
3828 \begingroup\obeylines\spacesplit{#3{#5}}}
3830 % Split up #2 at the first space token.
3831 % call #1 with two arguments:
3832 % the first is all of #2 before the space token,
3833 % the second is all of #2 after that space token.
3834 % If #2 contains no space token, all of it is passed as the first arg
3835 % and the second is passed as empty.
3838 \gdef\spacesplit#1#2^^M
{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}%
3839 \long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{%
3841 #1{#2}{}\else #1{#2}{#3#4}\fi}}
3843 % So much for the things common to all kinds of definitions.
3847 % First, define the processing that is wanted for arguments of \defun
3848 % Use this to expand the args and terminate the paragraph they make up
3850 \def\defunargs #1{\functionparens \sl
3851 % Expand, preventing hyphenation at `-' chars.
3852 % Note that groups don't affect changes in \hyphenchar.
3855 \hyphenchar\tensl=
45
3856 \ifnum\parencount=
0 \else \errmessage{unbalanced parens in @def arguments
}\fi%
3857 \interlinepenalty=
10000
3858 \advance\rightskip by
0pt plus
1fil
3859 \endgraf\penalty 10000\vskip -
\parskip\penalty 10000%
3862 \def\deftypefunargs #1{%
3863 % Expand, preventing hyphenation at `-' chars.
3864 % Note that groups don't affect changes in \hyphenchar.
3865 % Use \boldbraxnoamp, not \functionparens, so that & is not special.
3867 \tclose{#1}% avoid \code because of side effects on active chars
3868 \interlinepenalty=
10000
3869 \advance\rightskip by
0pt plus
1fil
3870 \endgraf\penalty 10000\vskip -
\parskip\penalty 10000%
3873 % Do complete processing of one @defun or @defunx line already parsed.
3875 % @deffn Command forward-char nchars
3877 \def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader}
3879 \def\deffnheader #1#2#3{\doind {fn
}{\code{#2}}%
3880 \begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
3881 \catcode 61=
\other % Turn off change made in \defparsebody
3884 % @defun == @deffn Function
3886 \def\defun{\defparsebody\Edefun\defunx\defunheader}
3888 \def\defunheader #1#2{\doind {fn
}{\code{#1}}% Make entry in function index
3889 \begingroup\defname {#1}{Function
}%
3890 \defunargs {#2}\endgroup %
3891 \catcode 61=
\other % Turn off change made in \defparsebody
3894 % @deftypefun int foobar (int @var{foo}, float @var{bar})
3896 \def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader}
3898 % #1 is the data type. #2 is the name and args.
3899 \def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax}
3900 % #1 is the data type, #2 the name, #3 the args.
3901 \def\deftypefunheaderx #1#2 #3\relax{%
3902 \doind {fn
}{\code{#2}}% Make entry in function index
3903 \begingroup\defname {\defheaderxcond#1\relax$$$
#2}{Function
}%
3904 \deftypefunargs {#3}\endgroup %
3905 \catcode 61=
\other % Turn off change made in \defparsebody
3908 % @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
3910 \def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
3912 % \defheaderxcond#1\relax$$$
3913 % puts #1 in @code, followed by a space, but does nothing if #1 is null.
3914 \def\defheaderxcond#1#2$$$
{\ifx#1\relax\else\code{#1#2} \fi}
3916 % #1 is the classification. #2 is the data type. #3 is the name and args.
3917 \def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax}
3918 % #1 is the classification, #2 the data type, #3 the name, #4 the args.
3919 \def\deftypefnheaderx #1#2#3 #4\relax{%
3920 \doind {fn
}{\code{#3}}% Make entry in function index
3922 \normalparens % notably, turn off `&' magic, which prevents
3923 % at least some C++ text from working
3924 \defname {\defheaderxcond#2\relax$$$
#3}{#1}%
3925 \deftypefunargs {#4}\endgroup %
3926 \catcode 61=
\other % Turn off change made in \defparsebody
3929 % @defmac == @deffn Macro
3931 \def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
3933 \def\defmacheader #1#2{\doind {fn
}{\code{#1}}% Make entry in function index
3934 \begingroup\defname {#1}{Macro
}%
3935 \defunargs {#2}\endgroup %
3936 \catcode 61=
\other % Turn off change made in \defparsebody
3939 % @defspec == @deffn Special Form
3941 \def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
3943 \def\defspecheader #1#2{\doind {fn
}{\code{#1}}% Make entry in function index
3944 \begingroup\defname {#1}{Special Form
}%
3945 \defunargs {#2}\endgroup %
3946 \catcode 61=
\other % Turn off change made in \defparsebody
3949 % This definition is run if you use @defunx
3950 % anywhere other than immediately after a @defun or @defunx.
3952 \def\deffnx #1 {\errmessage{@deffnx in invalid context
}}
3953 \def\defunx #1 {\errmessage{@defunx in invalid context
}}
3954 \def\defmacx #1 {\errmessage{@defmacx in invalid context
}}
3955 \def\defspecx #1 {\errmessage{@defspecx in invalid context
}}
3956 \def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context
}}
3957 \def\deftypeunx #1 {\errmessage{@deftypeunx in invalid context
}}
3959 % @defmethod, and so on
3961 % @defop {Funny Method} foo-class frobnicate argument
3963 \def\defop #1 {\def\defoptype{#1}%
3964 \defopparsebody\Edefop\defopx\defopheader\defoptype}
3966 \def\defopheader #1#2#3{%
3967 \dosubind {fn
}{\code{#2}}{on
#1}% Make entry in function index
3968 \begingroup\defname {#2}{\defoptype{} on
#1}%
3969 \defunargs {#3}\endgroup %
3972 % @defmethod == @defop Method
3974 \def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
3976 \def\defmethodheader #1#2#3{%
3977 \dosubind {fn
}{\code{#2}}{on
#1}% entry in function index
3978 \begingroup\defname {#2}{Method on
#1}%
3979 \defunargs {#3}\endgroup %
3982 % @defcv {Class Option} foo-class foo-flag
3984 \def\defcv #1 {\def\defcvtype{#1}%
3985 \defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
3987 \def\defcvarheader #1#2#3{%
3988 \dosubind {vr
}{\code{#2}}{of
#1}% Make entry in var index
3989 \begingroup\defname {#2}{\defcvtype{} of
#1}%
3990 \defvarargs {#3}\endgroup %
3993 % @defivar == @defcv {Instance Variable}
3995 \def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
3997 \def\defivarheader #1#2#3{%
3998 \dosubind {vr
}{\code{#2}}{of
#1}% Make entry in var index
3999 \begingroup\defname {#2}{Instance Variable of
#1}%
4000 \defvarargs {#3}\endgroup %
4003 % These definitions are run if you use @defmethodx, etc.,
4004 % anywhere other than immediately after a @defmethod, etc.
4006 \def\defopx #1 {\errmessage{@defopx in invalid context
}}
4007 \def\defmethodx #1 {\errmessage{@defmethodx in invalid context
}}
4008 \def\defcvx #1 {\errmessage{@defcvx in invalid context
}}
4009 \def\defivarx #1 {\errmessage{@defivarx in invalid context
}}
4013 % First, define the processing that is wanted for arguments of @defvar.
4014 % This is actually simple: just print them in roman.
4015 % This must expand the args and terminate the paragraph they make up
4016 \def\defvarargs #1{\normalparens #1%
4017 \interlinepenalty=
10000
4018 \endgraf\penalty 10000\vskip -
\parskip\penalty 10000}
4020 % @defvr Counter foo-count
4022 \def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader}
4024 \def\defvrheader #1#2#3{\doind {vr
}{\code{#2}}%
4025 \begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup}
4027 % @defvar == @defvr Variable
4029 \def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader}
4031 \def\defvarheader #1#2{\doind {vr
}{\code{#1}}% Make entry in var index
4032 \begingroup\defname {#1}{Variable
}%
4033 \defvarargs {#2}\endgroup %
4036 % @defopt == @defvr {User Option}
4038 \def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader}
4040 \def\defoptheader #1#2{\doind {vr
}{\code{#1}}% Make entry in var index
4041 \begingroup\defname {#1}{User Option
}%
4042 \defvarargs {#2}\endgroup %
4045 % @deftypevar int foobar
4047 \def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader}
4049 % #1 is the data type. #2 is the name, perhaps followed by text that
4050 % is actually part of the data type, which should not be put into the index.
4051 \def\deftypevarheader #1#2{%
4052 \dovarind#2 \relax% Make entry in variables index
4053 \begingroup\defname {\defheaderxcond#1\relax$$$
#2}{Variable
}%
4054 \interlinepenalty=
10000
4055 \endgraf\penalty 10000\vskip -
\parskip\penalty 10000
4057 \def\dovarind#1 #2\relax{\doind{vr
}{\code{#1}}}
4059 % @deftypevr {Global Flag} int enable
4061 \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
4063 \def\deftypevrheader #1#2#3{\dovarind#3 \relax%
4064 \begingroup\defname {\defheaderxcond#2\relax$$$
#3}{#1}
4065 \interlinepenalty=
10000
4066 \endgraf\penalty 10000\vskip -
\parskip\penalty 10000
4069 % This definition is run if you use @defvarx
4070 % anywhere other than immediately after a @defvar or @defvarx.
4072 \def\defvrx #1 {\errmessage{@defvrx in invalid context
}}
4073 \def\defvarx #1 {\errmessage{@defvarx in invalid context
}}
4074 \def\defoptx #1 {\errmessage{@defoptx in invalid context
}}
4075 \def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context
}}
4076 \def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context
}}
4079 % Args are printed in bold, a slight difference from @defvar.
4081 \def\deftpargs #1{\bf \defvarargs{#1}}
4083 % @deftp Class window height width ...
4085 \def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader}
4087 \def\deftpheader #1#2#3{\doind {tp
}{\code{#2}}%
4088 \begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
4090 % This definition is run if you use @deftpx, etc
4091 % anywhere other than immediately after a @deftp, etc.
4093 \def\deftpx #1 {\errmessage{@deftpx in invalid context
}}
4096 \message{cross reference,
}
4097 % Define cross-reference macros
4100 \newif\ifhavexrefs % True if xref values are known.
4101 \newif\ifwarnedxrefs % True if we warned once that they aren't known.
4103 % @inforef is simple.
4104 \def\inforef #1{\inforefzzz #1,,,,**
}
4105 \def\inforefzzz #1,
#2,
#3,
#4**
{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
4106 node
\samp{\ignorespaces#1{}}}
4108 % \setref{foo} defines a cross-reference point named foo.
4111 \dosetq{#1-title
}{Ytitle
}%
4112 \dosetq{#1-pg
}{Ypagenumber
}%
4113 \dosetq{#1-snt
}{Ysectionnumberandtype
}}
4115 \def\unnumbsetref#1{%
4116 \dosetq{#1-title
}{Ytitle
}%
4117 \dosetq{#1-pg
}{Ypagenumber
}%
4118 \dosetq{#1-snt
}{Ynothing
}}
4120 \def\appendixsetref#1{%
4121 \dosetq{#1-title
}{Ytitle
}%
4122 \dosetq{#1-pg
}{Ypagenumber
}%
4123 \dosetq{#1-snt
}{Yappendixletterandtype
}}
4125 % \xref, \pxref, and \ref generate cross-references to specified points.
4126 % For \xrefX, #1 is the node name, #2 the name of the Info
4127 % cross-reference, #3 the printed node name, #4 the name of the Info
4128 % file, #5 the name of the printed manual. All but the node name can be
4131 \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,
]}
4132 \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,
]}
4133 \def\ref#1{\xrefX[#1,,,,,,,
]}
4134 \def\xrefX[#1,
#2,
#3,
#4,
#5,
#6]{\begingroup
4135 \def\printedmanual{\ignorespaces #5}%
4136 \def\printednodename{\ignorespaces #3}%
4137 \setbox1=
\hbox{\printedmanual}%
4138 \setbox0=
\hbox{\printednodename}%
4140 % No printed node name was explicitly given.
4141 \expandafter\ifx\csname SETxref-automatic-section-title
\endcsname\relax
4142 % Use the node name inside the square brackets.
4143 \def\printednodename{\ignorespaces #1}%
4145 % Use the actual chapter/section title appear inside
4146 % the square brackets. Use the real section title if we have it.
4148 % It is in another manual, so we don't have it.
4149 \def\printednodename{\ignorespaces #1}%
4152 % We know the real title if we have the xref values.
4153 \def\printednodename{\refx{#1-title
}{}}%
4155 % Otherwise just copy the Info node name.
4156 \def\printednodename{\ignorespaces #1}%
4162 % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
4163 % insert empty discretionaries after hyphens, which means that it will
4164 % not find a line break at a hyphen in a node names. Since some manuals
4165 % are best written with fairly long node names, containing hyphens, this
4166 % is a loss. Therefore, we give the text of the node name again, so it
4167 % is as if TeX is seeing it for the first time.
4169 \putwordsection{} ``
\printednodename'' in
\cite{\printedmanual}%
4171 % _ (for example) has to be the character _ for the purposes of the
4172 % control sequence corresponding to the node, but it has to expand
4173 % into the usual \leavevmode...\vrule stuff for purposes of
4174 % printing. So we \turnoffactive for the \refx-snt, back on for the
4175 % printing, back off for the \refx-pg.
4176 {\turnoffactive \refx{#1-snt
}{}}%
4177 \space [\printednodename],
\space
4178 \turnoffactive \putwordpage\tie\refx{#1-pg
}{}%
4182 % \dosetq is the interface for calls from other macros
4184 % Use \turnoffactive so that punctuation chars such as underscore
4185 % work in node names.
4186 \def\dosetq #1#2{{\let\folio=
0 \turnoffactive
4187 \edef\next{\write\auxfile{\internalsetq {#1}{#2}}}%
4190 % \internalsetq {foo}{page} expands into
4191 % CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
4192 % When the aux file is read, ' is the escape character
4194 \def\internalsetq #1#2{'xrdef
{#1}{\csname #2\endcsname}}
4196 % Things to be expanded by \internalsetq
4198 \def\Ypagenumber{\folio}
4200 \def\Ytitle{\thissection}
4204 \def\Ysectionnumberandtype{%
4205 \ifnum\secno=
0 \putwordChapter\xreftie\the\chapno %
4206 \else \ifnum \subsecno=
0 \putwordSection\xreftie\the\chapno.
\the\secno %
4207 \else \ifnum \subsubsecno=
0 %
4208 \putwordSection\xreftie\the\chapno.
\the\secno.
\the\subsecno %
4210 \putwordSection\xreftie\the\chapno.
\the\secno.
\the\subsecno.
\the\subsubsecno %
4213 \def\Yappendixletterandtype{%
4214 \ifnum\secno=
0 \putwordAppendix\xreftie'char
\the\appendixno{}%
4215 \else \ifnum \subsecno=
0 \putwordSection\xreftie'char
\the\appendixno.
\the\secno %
4216 \else \ifnum \subsubsecno=
0 %
4217 \putwordSection\xreftie'char
\the\appendixno.
\the\secno.
\the\subsecno %
4219 \putwordSection\xreftie'char
\the\appendixno.
\the\secno.
\the\subsecno.
\the\subsubsecno %
4224 % Use TeX 3.0's \inputlineno to get the line number, for better error
4225 % messages, but if we're using an old version of TeX, don't do anything.
4227 \ifx\inputlineno\thisisundefined
4228 \let\linenumber =
\empty % Non-3.0.
4230 \def\linenumber{\the\inputlineno:
\space}
4233 % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
4234 % If its value is nonempty, SUFFIX is output afterward.
4237 \expandafter\ifx\csname X
#1\endcsname\relax
4238 % If not defined, say something at least.
4239 $
\langle$un\-de\-fined$
\rangle$
%
4241 \message{\linenumber Undefined cross reference `
#1'.
}%
4244 \global\warnedxrefstrue
4245 \message{Cross reference values unknown; you must run TeX again.
}%
4249 % It's defined, so just use it.
4250 \csname X
#1\endcsname
4252 #2% Output the suffix in any case.
4255 % This is the macro invoked by entries in the aux file.
4258 \expandafter\gdef\csname X
#1\endcsname{#2}%
4261 % Read the last existing aux file, if any. No error if none exists.
4262 \def\readauxfile{\begingroup
4263 \catcode`\^^@=
\other
4264 \catcode`\
\x01=
\other
4265 \catcode`\
\x02=
\other
4266 \catcode`\^^C=
\other
4267 \catcode`\^^D=
\other
4268 \catcode`\^^E=
\other
4269 \catcode`\^^F=
\other
4270 \catcode`\^^G=
\other
4271 \catcode`\^^H=
\other
4273 \catcode`\^^L=
\other
4274 \catcode`\
\x0e=
\other
4275 \catcode`\
\x0f=
\other
4276 \catcode`\
\x10=
\other
4277 \catcode`\
\x11=
\other
4278 \catcode`\
\x12=
\other
4279 \catcode`\
\x13=
\other
4280 \catcode`\
\x14=
\other
4281 \catcode`\
\x15=
\other
4282 \catcode`\
\x16=
\other
4283 \catcode`\
\x17=
\other
4284 \catcode`\
\x18=
\other
4285 \catcode`\
\x19=
\other
4287 \catcode`\^^
[=
\other
4288 \catcode`\^^\=
\other
4289 \catcode`\^^
]=
\other
4290 \catcode`\^^^=
\other
4291 \catcode`\^^_=
\other
4294 % It was suggested to define this as 7, which would allow ^^e4 etc.
4295 % in xref tags, i.e., node names. But since ^^e4 notation isn't
4296 % supported in the main text, it doesn't seem desirable. Furthermore,
4297 % that is not enough: for node names that actually contain a ^
4298 % character, we would end up writing a line like this: 'xrdef {'hat
4299 % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
4300 % argument, and \hat is not an expandable control sequence. It could
4301 % all be worked out, but why? Either we support ^^ or we don't.
4303 % The other change necessary for this was to define \auxhat:
4304 % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
4305 % and then to call \auxhat in \setq.
4318 % `\+ does not work, so use 43.
4320 % Make the characters 128-255 be printing characters
4324 \catcode\count 1=
\other
4325 \advance\count 1 by
1
4326 \ifnum \count 1<
256 \loop \fi
4329 % The aux file uses ' as the escape (for now).
4330 % Turn off \ as an escape so we do not lose on
4331 % entries which were dumped with control sequences in their names.
4332 % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
4333 % Reference to such entries still does not work the way one would wish,
4334 % but at least they do not bomb out when the aux file is read in.
4341 \openin 1 \jobname.aux
4345 \global\havexrefstrue
4346 \global\warnedobstrue
4348 % Open the new aux file. TeX will close it automatically at exit.
4349 \openout\auxfile=
\jobname.aux
4355 \newcount \footnoteno
4357 % The trailing space in the following definition for supereject is
4358 % vital for proper filling; pages come out unaligned when you do a
4359 % pagealignmacro call if that space before the closing brace is
4360 % removed. (Generally, numeric constants should always be followed by a
4361 % space to prevent strange expansion errors.)
4362 \def\supereject{\par\penalty -
20000\footnoteno =
0 }
4364 % @footnotestyle is meaningful for info output only..
4365 \let\footnotestyle=
\comment
4367 \let\ptexfootnote=
\footnote
4371 % Auto-number footnotes. Otherwise like plain.
4373 \global\advance\footnoteno by \@ne
4374 \edef\thisfootno{$^
{\the\footnoteno}$
}%
4376 % In case the footnote comes at the end of a sentence, preserve the
4377 % extra spacing after we do the footnote number.
4379 \ifhmode\edef\@sf
{\spacefactor\the\spacefactor}\/
\fi
4381 % Remove inadvertent blank space before typesetting the footnote number.
4387 % Don't bother with the trickery in plain.tex to not require the
4388 % footnote text as a parameter. Our footnotes don't need to be so general.
4390 % Oh yes, they do; otherwise, @ifset and anything else that uses
4391 % \parseargline fail inside footnotes because the tokens are fixed when
4392 % the footnote is read. --karl, 16nov96.
4394 \long\gdef\footnotezzz{\insert\footins\bgroup
4395 % We want to typeset this text as a normal paragraph, even if the
4396 % footnote reference occurs in (for example) a display environment.
4397 % So reset some parameters.
4398 \interlinepenalty\interfootnotelinepenalty
4399 \splittopskip\ht\strutbox % top baseline for broken footnotes
4400 \splitmaxdepth\dp\strutbox
4401 \floatingpenalty\@MM
4406 \parindent\defaultparindent
4408 % Hang the footnote text off the number.
4410 \textindent{\thisfootno}%
4412 % Don't crash into the line above the footnote text. Since this
4413 % expands into a box, it must come within the paragraph, lest it
4414 % provide a place where TeX can split the footnote.
4416 \futurelet\next\fo@t
4418 \def\fo@t
{\ifcat\bgroup\noexpand\next \let\next\f@@t
4419 \else\let\next\f@t
\fi \next}
4420 \def\f@@t
{\bgroup\aftergroup\@foot
\let\next}
4421 \def\f@t
#1{#1\@foot
}
4422 \def\@foot
{\strut\egroup}
4424 }%end \catcode `\@=11
4426 % Set the baselineskip to #1, and the lineskip and strut size
4427 % correspondingly. There is no deep meaning behind these magic numbers
4428 % used as factors; they just match (closely enough) what Knuth defined.
4430 \def\lineskipfactor{.08333}
4431 \def\strutheightpercent{.70833}
4432 \def\strutdepthpercent {.29167}
4435 \normalbaselineskip =
#1\relax
4436 \normallineskip =
\lineskipfactor\normalbaselineskip
4438 \setbox\strutbox =
\hbox{%
4439 \vrule width0pt height
\strutheightpercent\baselineskip
4440 depth
\strutdepthpercent \baselineskip
4444 % @| inserts a changebar to the left of the current line. It should
4445 % surround any changed text. This approach does *not* work if the
4446 % change spans more than two lines of output. To handle that, we would
4447 % have adopt a much more difficult approach (putting marks into the main
4448 % vertical list for the beginning and end of each change).
4451 % \vadjust can only be used in horizontal mode.
4454 % Append this vertical mode material after the current line in the output.
4456 % We want to insert a rule with the height and depth of the current
4457 % leading; that is exactly what \strutbox is supposed to record.
4458 \vskip-
\baselineskip
4460 % \vadjust-items are inserted at the left edge of the type. So
4461 % the \llap here moves out into the left-hand margin.
4464 % For a thicker or thinner bar, change the `1pt'.
4465 \vrule height
\baselineskip width1pt
4467 % This is the space between the bar and the text.
4473 % For a final copy, take out the rectangles
4474 % that mark overfull boxes (in case you have decided
4475 % that the text looks ok even though it passes the margin).
4477 \def\finalout{\overfullrule=
0pt
}
4480 % End of control word definitions.
4482 \message{and turning on texinfo input format.
}
4493 % Set some numeric style parameters, for 8.5 x 11 format.
4497 \newdimen\defaultparindent \defaultparindent =
15pt
4498 \parindent =
\defaultparindent
4499 \parskip 3pt plus
2pt minus
1pt
4501 \advance\topskip by
1.2cm
4503 \chapheadingskip =
15pt plus
4pt minus
2pt
4504 \secheadingskip =
12pt plus
3pt minus
2pt
4505 \subsecheadingskip =
9pt plus
2pt minus
2pt
4507 % Prevent underfull vbox error messages.
4510 % Following George Bush, just get rid of widows and orphans.
4514 % Use TeX 3.0's \emergencystretch to help line breaking, but if we're
4515 % using an old version of TeX, don't do anything. We want the amount of
4516 % stretch added to depend on the line length, hence the dependence on
4517 % \hsize. This makes it come to about 9pt for the 8.5x11 format.
4519 \ifx\emergencystretch\thisisundefined
4520 % Allow us to assign to \emergencystretch anyway.
4521 \def\emergencystretch{\dimen0}%
4523 \emergencystretch =
\hsize
4524 \divide\emergencystretch by
45
4527 % Use @smallbook to reset parameters for 7x9.5 format (or else 7x9.25)
4529 \global\chapheadingskip =
15pt plus
4pt minus
2pt
4530 \global\secheadingskip =
12pt plus
3pt minus
2pt
4531 \global\subsecheadingskip =
9pt plus
2pt minus
2pt
4533 \global\lispnarrowing =
0.3in
4535 \advance\topskip by -
1cm
4536 \global\parskip 2pt plus
1pt
4539 \global\tolerance=
700
4541 \global\contentsrightmargin=
0pt
4542 \global\deftypemargin=
0pt
4543 \global\defbodyindent=
.5cm
4545 \global\pagewidth=
\hsize
4546 \global\pageheight=
\vsize
4548 \global\let\smalllisp=
\smalllispx
4549 \global\let\smallexample=
\smalllispx
4550 \global\def\Esmallexample{\Esmalllisp}
4553 % Use @afourpaper to print on European A4 paper.
4555 \global\tolerance=
700
4558 \global\parskip 15pt plus
1pt
4560 \global\vsize=
53\baselineskip
4561 \advance\vsize by
\topskip
4562 %\global\hsize= 5.85in % A4 wide 10pt
4563 \global\hsize=
6.5in
4564 \global\outerhsize=
\hsize
4565 \global\advance\outerhsize by
0.5in
4566 \global\outervsize=
\vsize
4567 \global\advance\outervsize by
0.6in
4569 \global\pagewidth=
\hsize
4570 \global\pageheight=
\vsize
4574 \normaloffset=
\hoffset
4578 % Allow control of the text dimensions. Parameters in order: textheight;
4579 % textwidth; voffset; hoffset; binding offset; topskip.
4580 % All require a dimension;
4581 % header is additional; added length extends the bottom of the page.
4583 \def\changepagesizes#1#2#3#4#5#6{
4586 \advance\vsize by
\topskip
4589 \global\outerhsize=
\hsize
4590 \global\advance\outerhsize by
0.5in
4591 \global\outervsize=
\vsize
4592 \global\advance\outervsize by
0.6in
4593 \global\pagewidth=
\hsize
4594 \global\pageheight=
\vsize
4595 \global\normaloffset=
#4
4596 \global\bindingoffset=
#5}
4598 % A specific text layout, 24x15cm overall, intended for A4 paper. Top margin
4599 % 29mm, hence bottom margin 28mm, nominal side margin 3cm.
4601 {\global\tolerance=
700
4604 \global\parskip 15pt plus
1pt
4605 \advance\baselineskip by
1.6pt
4606 \changepagesizes{237mm
}{150mm
}{3.6mm
}{3.6mm
}{3mm
}{7mm
}
4609 % Use @afourwide to print on European A4 paper in wide format.
4610 \def\afourwide{\afourpaper
4611 \changepagesizes{9.5in
}{6.5in
}{\hoffset}{\normaloffset}{\bindingoffset}{7mm
}}
4613 % Define macros to output various characters with catcode for normal text.
4622 \def\normaldoublequote{"
}
4625 \def\normalunderscore{_
}
4626 \def\normalverticalbar{|
}
4628 \def\normalgreater{>
}
4631 % This macro is used to make a character print one way in ttfont
4632 % where it can probably just be output, and another way in other fonts,
4633 % where something hairier probably needs to be done.
4635 % #1 is what to print if we are indeed using \tt; #2 is what to print
4636 % otherwise. Since all the Computer Modern typewriter fonts have zero
4637 % interword stretch (and shrink), and it is reasonable to expect all
4638 % typewriter fonts to have this, we can check that font parameter.
4640 \def\ifusingtt#1#2{\ifdim \fontdimen3\the\font=
0pt
#1\else #2\fi}
4642 % Turn off all special characters except @
4643 % (and those which the user can use as if they were ordinary).
4644 % Most of these we simply print from the \tt font, but for some, we can
4645 % use math or other variants that look better in normal text.
4648 \def\activedoublequote{{\tt \char '
042}}
4649 \let"=
\activedoublequote
4651 \def~
{{\tt \char '
176}}
4657 \def_{\ifusingtt\normalunderscore\_}
4658 % Subroutine for the previous macro.
4659 \def\_{\leavevmode \kern.06em
\vbox{\hrule width
.3em height
.1ex
}}
4662 \def|
{{\tt \char '
174}}
4670 \def+
{{\tt \char 43}}
4671 %\catcode 27=\active
4672 %\def^^[{$\diamondsuit$}
4674 % Set up an active definition for =, but don't enable it most of the time.
4675 {\catcode`\==
\active
4676 \global\def=
{{\tt \char 61}}}
4681 % If a .fmt file is being used, characters that might appear in a file
4682 % name cannot be active until we have parsed the command line.
4683 % So turn them off again, and have \everyjob (or @setfilename) turn them on.
4684 % \otherifyactive is called near the end of this file.
4685 \def\otherifyactive{\catcode`+=
\other \catcode`
\_=
\other}
4689 % \rawbackslashxx output one backslash character in current font
4690 \global\chardef\rawbackslashxx=`\\
4691 %{\catcode`\\=\other
4692 %@gdef@rawbackslashxx{\}}
4694 % \rawbackslash redefines \ as input to do \rawbackslashxx.
4695 {\catcode`\\=
\active
4696 @gdef@rawbackslash
{@let\=@rawbackslashxx
}}
4698 % \normalbackslash outputs one backslash in fixed width font.
4699 \def\normalbackslash{{\tt\rawbackslashxx}}
4701 % Say @foo, not \foo, in error messages.
4704 % \catcode 17=0 % Define control-q
4707 % Used sometimes to turn off (effectively) the active characters
4708 % even after parsing them.
4709 @def@turnoffactive
{@let"=@normaldoublequote
4710 @let\=@realbackslash
4713 @let_=@normalunderscore
4714 @let|=@normalverticalbar
4716 @let>=@normalgreater
4719 @def@normalturnoffactive
{@let"=@normaldoublequote
4720 @let\=@normalbackslash
4723 @let_=@normalunderscore
4724 @let|=@normalverticalbar
4726 @let>=@normalgreater
4729 % Make _ and + \other characters, temporarily.
4730 % This is canceled by @fixbackslash.
4733 % If a .fmt file is being used, we don't want the `\input texinfo' to show up.
4734 % That is what \eatinput is for; after that, the `\' should revert to printing
4737 @gdef@eatinput input texinfo
{@fixbackslash
}
4738 @global@let\ = @eatinput
4740 % On the other hand, perhaps the file did not have a `\input texinfo'. Then
4741 % the first `\{ in the file would cause an error. This macro tries to fix
4742 % that, assuming it is called before the first `\' could plausibly occur.
4743 % Also back turn on active characters that might appear in the input
4744 % file name, in case not using a pre-dumped format.
4746 @gdef@fixbackslash
{@ifx\@eatinput @let\ = @normalbackslash @fi
4747 @catcode`+=@active @catcode`@_=@active
}
4749 %% These look ok in all fonts, so just make them not special. The @rm below
4750 %% makes sure that the current font starts out as the newly loaded cmr10
4751 @catcode`@$=@other @catcode`@
%=@other @catcode`@&=@other @catcode`@#=@other
4757 @c page-delimiter: "^\\\
\message"