Add comma after e.g. in comment.
[coreutils.git] / doc / texinfo.tex
blobda39ea2d1ff12eb5374d299176ab6e8ed784a9f9
1 %% TeX macros to handle texinfo files
3 % Copyright (C) 1985, 86, 88, 90, 91, 92, 93,
4 % 94, 95, 1996 Free Software Foundation, Inc.
6 %This texinfo.tex file is free software; you can redistribute it and/or
7 %modify it under the terms of the GNU General Public License as
8 %published by the Free Software Foundation; either version 2, or (at
9 %your option) any later version.
11 %This texinfo.tex file is distributed in the hope that it will be
12 %useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 %of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 %General Public License for more details.
16 %You should have received a copy of the GNU General Public License
17 %along with this texinfo.tex file; see the file COPYING. If not, write
18 %to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 %Boston, MA 02111-1307, USA.
22 %In other words, you are welcome to use, share and improve this program.
23 %You are forbidden to forbid anyone else to use, share and improve
24 %what you give them. Help stamp out software-hoarding!
27 % Send bug reports to bug-texinfo@prep.ai.mit.edu.
28 % Please include a *precise* test case in each bug report.
31 % Make it possible to create a .fmt file just by loading this file:
32 % if the underlying format is not loaded, start by loading it now.
33 % Added by gildea November 1993.
34 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
36 % This automatically updates the version number based on RCS.
37 \def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}}
38 \deftexinfoversion$Revision: 1.10 $
39 \message{Loading texinfo package [Version \texinfoversion]:}
41 % If in a .fmt file, print the version number
42 % and turn on active characters that we couldn't do earlier because
43 % they might have appeared in the input file name.
44 \everyjob{\message{[Texinfo version \texinfoversion]}\message{}
45 \catcode`+=\active \catcode`\_=\active}
47 % Save some parts of plain tex whose names we will redefine.
49 \let\ptextilde=\~
50 \let\ptexlbrace=\{
51 \let\ptexrbrace=\}
52 \let\ptexdots=\dots
53 \let\ptexdot=\.
54 \let\ptexstar=\*
55 \let\ptexend=\end
56 \let\ptexbullet=\bullet
57 \let\ptexb=\b
58 \let\ptexc=\c
59 \let\ptexi=\i
60 \let\ptext=\t
61 \let\ptexl=\l
62 \let\ptexL=\L
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.
69 {\catcode`@ = 11
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\ }
75 \let\~ = \tie % And make it available as @~.
77 \message{Basics,}
78 \chardef\other=12
80 % If this character appears in an error message or help string, it
81 % starts a new line in the output.
82 \newlinechar = `^^J
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%
97 % Ignore a token.
99 \def\gobble#1{}
101 \hyphenation{ap-pen-dix}
102 \hyphenation{mini-buf-fer mini-buf-fers}
103 \hyphenation{eshell}
105 % Margin to add to right of even pages, to left of odd pages.
106 \newdimen \bindingoffset \bindingoffset=0pt
107 \newdimen \normaloffset \normaloffset=\hoffset
108 \newdimen\pagewidth \newdimen\pageheight
109 \pagewidth=\hsize \pageheight=\vsize
111 % Sometimes it is convenient to have everything in the transcript file
112 % and nothing on the terminal. We don't just call \tracingall here,
113 % since that produces some useless output on the terminal.
115 \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
116 \def\loggingall{\tracingcommands2 \tracingstats2
117 \tracingpages1 \tracingoutput1 \tracinglostchars1
118 \tracingmacros2 \tracingparagraphs1 \tracingrestores1
119 \showboxbreadth\maxdimen\showboxdepth\maxdimen
122 %---------------------Begin change-----------------------
124 %%%% For @cropmarks command.
125 % Dimensions to add cropmarks at corners Added by P. A. MacKay, 12 Nov. 1986
127 \newdimen\cornerlong \newdimen\cornerthick
128 \newdimen \topandbottommargin
129 \newdimen \outerhsize \newdimen \outervsize
130 \cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks
131 \outerhsize=7in
132 %\outervsize=9.5in
133 % Alternative @smallbook page size is 9.25in
134 \outervsize=9.25in
135 \topandbottommargin=.75in
137 %---------------------End change-----------------------
139 % \onepageout takes a vbox as an argument. Note that \pagecontents
140 % does insertions itself, but you have to call it yourself.
141 \chardef\PAGE=255 \output={\onepageout{\pagecontents\PAGE}}
142 \def\onepageout#1{\hoffset=\normaloffset
143 \ifodd\pageno \advance\hoffset by \bindingoffset
144 \else \advance\hoffset by -\bindingoffset\fi
145 {\escapechar=`\\\relax % makes sure backslash is used in output files.
146 \shipout\vbox{{\let\hsize=\pagewidth \makeheadline} \pagebody{#1}%
147 {\let\hsize=\pagewidth \makefootline}}}%
148 \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi}
150 %%%% For @cropmarks command %%%%
152 % Here is a modification of the main output routine for Near East Publications
153 % This provides right-angle cropmarks at all four corners.
154 % The contents of the page are centerlined into the cropmarks,
155 % and any desired binding offset is added as an \hskip on either
156 % site of the centerlined box. (P. A. MacKay, 12 November, 1986)
158 \def\croppageout#1{\hoffset=0pt % make sure this doesn't mess things up
159 {\escapechar=`\\\relax % makes sure backslash is used in output files.
160 \shipout
161 \vbox to \outervsize{\hsize=\outerhsize
162 \vbox{\line{\ewtop\hfill\ewtop}}
163 \nointerlineskip
164 \line{\vbox{\moveleft\cornerthick\nstop}
165 \hfill
166 \vbox{\moveright\cornerthick\nstop}}
167 \vskip \topandbottommargin
168 \centerline{\ifodd\pageno\hskip\bindingoffset\fi
169 \vbox{
170 {\let\hsize=\pagewidth \makeheadline}
171 \pagebody{#1}
172 {\let\hsize=\pagewidth \makefootline}}
173 \ifodd\pageno\else\hskip\bindingoffset\fi}
174 \vskip \topandbottommargin plus1fill minus1fill
175 \boxmaxdepth\cornerthick
176 \line{\vbox{\moveleft\cornerthick\nsbot}
177 \hfill
178 \vbox{\moveright\cornerthick\nsbot}}
179 \nointerlineskip
180 \vbox{\line{\ewbot\hfill\ewbot}}
182 \advancepageno
183 \ifnum\outputpenalty>-20000 \else\dosupereject\fi}
185 % Do @cropmarks to get crop marks
186 \def\cropmarks{\let\onepageout=\croppageout }
188 \newinsert\margin \dimen\margin=\maxdimen
190 \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
191 {\catcode`\@ =11
192 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
193 % marginal hacks, juha@viisa.uucp (Juha Takala)
194 \ifvoid\margin\else % marginal info is present
195 \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
196 \dimen@=\dp#1 \unvbox#1
197 \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
198 \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
202 % Here are the rules for the cropmarks. Note that they are
203 % offset so that the space between them is truly \outerhsize or \outervsize
204 % (P. A. MacKay, 12 November, 1986)
206 \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
207 \def\nstop{\vbox
208 {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
209 \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
210 \def\nsbot{\vbox
211 {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
213 % Parse an argument, then pass it to #1. The argument is the rest of
214 % the input line (except we remove a trailing comment). #1 should be a
215 % macro which expects an ordinary undelimited TeX argument.
217 \def\parsearg#1{%
218 \let\next = #1%
219 \begingroup
220 \obeylines
221 \futurelet\temp\parseargx
224 % If the next token is an obeyed space (from an @example environment or
225 % the like), remove it and recurse. Otherwise, we're done.
226 \def\parseargx{%
227 % \obeyedspace is defined far below, after the definition of \sepspaces.
228 \ifx\obeyedspace\temp
229 \expandafter\parseargdiscardspace
230 \else
231 \expandafter\parseargline
235 % Remove a single space (as the delimiter token to the macro call).
236 {\obeyspaces %
237 \gdef\parseargdiscardspace {\futurelet\temp\parseargx}}
239 {\obeylines %
240 \gdef\parseargline#1^^M{%
241 \endgroup % End of the group started in \parsearg.
243 % First remove any @c comment, then any @comment.
244 % Result of each macro is put in \toks0.
245 \argremovec #1\c\relax %
246 \expandafter\argremovecomment \the\toks0 \comment\relax %
248 % Call the caller's macro, saved as \next in \parsearg.
249 \expandafter\next\expandafter{\the\toks0}%
253 % Since all \c{,omment} does is throw away the argument, we can let TeX
254 % do that for us. The \relax here is matched by the \relax in the call
255 % in \parseargline; it could be more or less anything, its purpose is
256 % just to delimit the argument to the \c.
257 \def\argremovec#1\c#2\relax{\toks0 = {#1}}
258 \def\argremovecomment#1\comment#2\relax{\toks0 = {#1}}
260 % \argremovec{,omment} might leave us with trailing spaces, though; e.g.,
261 % @end itemize @c foo
262 % will have two active spaces as part of the argument with the
263 % `itemize'. Here we remove all active spaces from #1, and assign the
264 % result to \toks0.
266 % This loses if there are any *other* active characters besides spaces
267 % in the argument -- _ ^ +, for example -- since they get expanded.
268 % Fortunately, Texinfo does not define any such commands. (If it ever
269 % does, the catcode of the characters in questionwill have to be changed
270 % here.) But this means we cannot call \removeactivespaces as part of
271 % \argremovec{,omment}, since @c uses \parsearg, and thus the argument
272 % that \parsearg gets might well have any character at all in it.
274 \def\removeactivespaces#1{%
275 \begingroup
276 \ignoreactivespaces
277 \edef\temp{#1}%
278 \global\toks0 = \expandafter{\temp}%
279 \endgroup
282 % Change the active space to expand to nothing.
284 \begingroup
285 \obeyspaces
286 \gdef\ignoreactivespaces{\obeyspaces\let =\empty}
287 \endgroup
290 \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
292 %% These are used to keep @begin/@end levels from running away
293 %% Call \inENV within environments (after a \begingroup)
294 \newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
295 \def\ENVcheck{%
296 \ifENV\errmessage{Still within an environment. Type Return to continue.}
297 \endgroup\fi} % This is not perfect, but it should reduce lossage
299 % @begin foo is the same as @foo, for now.
300 \newhelp\EMsimple{Type <Return> to continue.}
302 \outer\def\begin{\parsearg\beginxxx}
304 \def\beginxxx #1{%
305 \expandafter\ifx\csname #1\endcsname\relax
306 {\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else
307 \csname #1\endcsname\fi}
309 % @end foo executes the definition of \Efoo.
311 \def\end{\parsearg\endxxx}
312 \def\endxxx #1{%
313 \removeactivespaces{#1}%
314 \edef\endthing{\the\toks0}%
316 \expandafter\ifx\csname E\endthing\endcsname\relax
317 \expandafter\ifx\csname \endthing\endcsname\relax
318 % There's no \foo, i.e., no ``environment'' foo.
319 \errhelp = \EMsimple
320 \errmessage{Undefined command `@end \endthing'}%
321 \else
322 \unmatchedenderror\endthing
324 \else
325 % Everything's ok; the right environment has been started.
326 \csname E\endthing\endcsname
330 % There is an environment #1, but it hasn't been started. Give an error.
332 \def\unmatchedenderror#1{%
333 \errhelp = \EMsimple
334 \errmessage{This `@end #1' doesn't have a matching `@#1'}%
337 % Define the control sequence \E#1 to give an unmatched @end error.
339 \def\defineunmatchedend#1{%
340 \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}%
344 % Single-spacing is done by various environments (specifically, in
345 % \nonfillstart and \quotations).
346 \newskip\singlespaceskip \singlespaceskip = 12.5pt
347 \def\singlespace{%
348 % Why was this kern here? It messes up equalizing space above and below
349 % environments. --karl, 6may93
350 %{\advance \baselineskip by -\singlespaceskip
351 %\kern \baselineskip}%
352 \setleading \singlespaceskip
355 %% Simple single-character @ commands
357 % @@ prints an @
358 % Kludge this until the fonts are right (grr).
359 \def\@{{\tt \char '100}}
361 % This is turned off because it was never documented
362 % and you can use @w{...} around a quote to suppress ligatures.
363 %% Define @` and @' to be the same as ` and '
364 %% but suppressing ligatures.
365 %\def\`{{`}}
366 %\def\'{{'}}
368 % Used to generate quoted braces.
370 \def\mylbrace {{\tt \char '173}}
371 \def\myrbrace {{\tt \char '175}}
372 \let\{=\mylbrace
373 \let\}=\myrbrace
375 % @: forces normal size whitespace following.
376 \def\:{\spacefactor=1000 }
378 % @* forces a line break.
379 \def\*{\hfil\break\hbox{}\ignorespaces}
381 % @. is an end-of-sentence period.
382 \def\.{.\spacefactor=3000 }
384 % @enddots{} is an end-of-sentence ellipsis.
385 \gdef\enddots{$\mathinner{\ldotp\ldotp\ldotp\ldotp}$\spacefactor=3000}
387 % @! is an end-of-sentence bang.
388 \gdef\!{!\spacefactor=3000 }
390 % @? is an end-of-sentence query.
391 \gdef\?{?\spacefactor=3000 }
393 % @w prevents a word break. Without the \leavevmode, @w at the
394 % beginning of a paragraph, when TeX is still in vertical mode, would
395 % produce a whole line of output instead of starting the paragraph.
396 \def\w#1{\leavevmode\hbox{#1}}
398 % @group ... @end group forces ... to be all on one page, by enclosing
399 % it in a TeX vbox. We use \vtop instead of \vbox to construct the box
400 % to keep its height that of a normal line. According to the rules for
401 % \topskip (p.114 of the TeXbook), the glue inserted is
402 % max (\topskip - \ht (first item), 0). If that height is large,
403 % therefore, no glue is inserted, and the space between the headline and
404 % the text is small, which looks bad.
406 \def\group{\begingroup
407 \ifnum\catcode13=\active \else
408 \errhelp = \groupinvalidhelp
409 \errmessage{@group invalid in context where filling is enabled}%
412 % The \vtop we start below produces a box with normal height and large
413 % depth; thus, TeX puts \baselineskip glue before it, and (when the
414 % next line of text is done) \lineskip glue after it. (See p.82 of
415 % the TeXbook.) Thus, space below is not quite equal to space
416 % above. But it's pretty close.
417 \def\Egroup{%
418 \egroup % End the \vtop.
419 \endgroup % End the \group.
422 \vtop\bgroup
423 % We have to put a strut on the last line in case the @group is in
424 % the midst of an example, rather than completely enclosing it.
425 % Otherwise, the interline space between the last line of the group
426 % and the first line afterwards is too small. But we can't put the
427 % strut in \Egroup, since there it would be on a line by itself.
428 % Hence this just inserts a strut at the beginning of each line.
429 \everypar = {\strut}%
431 % Since we have a strut on every line, we don't need any of TeX's
432 % normal interline spacing.
433 \offinterlineskip
435 % OK, but now we have to do something about blank
436 % lines in the input in @example-like environments, which normally
437 % just turn into \lisppar, which will insert no space now that we've
438 % turned off the interline space. Simplest is to make them be an
439 % empty paragraph.
440 \ifx\par\lisppar
441 \edef\par{\leavevmode \par}%
443 % Reset ^^M's definition to new definition of \par.
444 \obeylines
447 % Do @comment since we are called inside an environment such as
448 % @example, where each end-of-line in the input causes an
449 % end-of-line in the output. We don't want the end-of-line after
450 % the `@group' to put extra space in the output. Since @group
451 % should appear on a line by itself (according to the Texinfo
452 % manual), we don't worry about eating any user text.
453 \comment
456 % TeX puts in an \escapechar (i.e., `@') at the beginning of the help
457 % message, so this ends up printing `@group can only ...'.
459 \newhelp\groupinvalidhelp{%
460 group can only be used in environments such as @example,^^J%
461 where each line of input produces a line of output.}
463 % @need space-in-mils
464 % forces a page break if there is not space-in-mils remaining.
466 \newdimen\mil \mil=0.001in
468 \def\need{\parsearg\needx}
470 % Old definition--didn't work.
471 %\def\needx #1{\par %
472 %% This method tries to make TeX break the page naturally
473 %% if the depth of the box does not fit.
474 %{\baselineskip=0pt%
475 %\vtop to #1\mil{\vfil}\kern -#1\mil\penalty 10000
476 %\prevdepth=-1000pt
479 \def\needx#1{%
480 % Go into vertical mode, so we don't make a big box in the middle of a
481 % paragraph.
482 \par
484 % Don't add any leading before our big empty box, but allow a page
485 % break, since the best break might be right here.
486 \allowbreak
487 \nointerlineskip
488 \vtop to #1\mil{\vfil}%
490 % TeX does not even consider page breaks if a penalty added to the
491 % main vertical list is 10000 or more. But in order to see if the
492 % empty box we just added fits on the page, we must make it consider
493 % page breaks. On the other hand, we don't want to actually break the
494 % page after the empty box. So we use a penalty of 9999.
496 % There is an extremely small chance that TeX will actually break the
497 % page at this \penalty, if there are no other feasible breakpoints in
498 % sight. (If the user is using lots of big @group commands, which
499 % almost-but-not-quite fill up a page, TeX will have a hard time doing
500 % good page breaking, for example.) However, I could not construct an
501 % example where a page broke at this \penalty; if it happens in a real
502 % document, then we can reconsider our strategy.
503 \penalty9999
505 % Back up by the size of the box, whether we did a page break or not.
506 \kern -#1\mil
508 % Do not allow a page break right after this kern.
509 \nobreak
512 % @br forces paragraph break
514 \let\br = \par
516 % @dots{} output some dots
518 \def\dots{$\ldots$}
520 % @page forces the start of a new page
522 \def\page{\par\vfill\supereject}
524 % @exdent text....
525 % outputs text on separate line in roman font, starting at standard page margin
527 % This records the amount of indent in the innermost environment.
528 % That's how much \exdent should take out.
529 \newskip\exdentamount
531 % This defn is used inside fill environments such as @defun.
532 \def\exdent{\parsearg\exdentyyy}
533 \def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}}
535 % This defn is used inside nofill environments such as @example.
536 \def\nofillexdent{\parsearg\nofillexdentyyy}
537 \def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount
538 \leftline{\hskip\leftskip{\rm#1}}}}
540 % @inmargin{TEXT} puts TEXT in the margin next to the current paragraph.
542 \def\inmargin#1{%
543 \strut\vadjust{\nobreak\kern-\strutdepth
544 \vtop to \strutdepth{\baselineskip\strutdepth\vss
545 \llap{\rightskip=\inmarginspacing \vbox{\noindent #1}}\null}}}
546 \newskip\inmarginspacing \inmarginspacing=1cm
547 \def\strutdepth{\dp\strutbox}
549 %\hbox{{\rm#1}}\hfil\break}}
551 % @include file insert text of that file as input.
552 % Allow normal characters that we make active in the argument (a file name).
553 \def\include{\begingroup
554 \catcode`\\=12
555 \catcode`~=12
556 \catcode`^=12
557 \catcode`_=12
558 \catcode`|=12
559 \catcode`<=12
560 \catcode`>=12
561 \catcode`+=12
562 \parsearg\includezzz}
563 % Restore active chars for included file.
564 \def\includezzz#1{\endgroup\begingroup
565 % Read the included file in a group so nested @include's work.
566 \def\thisfile{#1}%
567 \input\thisfile
568 \endgroup}
570 \def\thisfile{}
572 % @center line outputs that line, centered
574 \def\center{\parsearg\centerzzz}
575 \def\centerzzz #1{{\advance\hsize by -\leftskip
576 \advance\hsize by -\rightskip
577 \centerline{#1}}}
579 % @sp n outputs n lines of vertical space
581 \def\sp{\parsearg\spxxx}
582 \def\spxxx #1{\par \vskip #1\baselineskip}
584 % @comment ...line which is ignored...
585 % @c is the same as @comment
586 % @ignore ... @end ignore is another way to write a comment
588 \def\comment{\catcode 64=\other \catcode 123=\other \catcode 125=\other%
589 \parsearg \commentxxx}
591 \def\commentxxx #1{\catcode 64=0 \catcode 123=1 \catcode 125=2 }
593 \let\c=\comment
595 % Prevent errors for section commands.
596 % Used in @ignore and in failing conditionals.
597 \def\ignoresections{%
598 \let\chapter=\relax
599 \let\unnumbered=\relax
600 \let\top=\relax
601 \let\unnumberedsec=\relax
602 \let\unnumberedsection=\relax
603 \let\unnumberedsubsec=\relax
604 \let\unnumberedsubsection=\relax
605 \let\unnumberedsubsubsec=\relax
606 \let\unnumberedsubsubsection=\relax
607 \let\section=\relax
608 \let\subsec=\relax
609 \let\subsubsec=\relax
610 \let\subsection=\relax
611 \let\subsubsection=\relax
612 \let\appendix=\relax
613 \let\appendixsec=\relax
614 \let\appendixsection=\relax
615 \let\appendixsubsec=\relax
616 \let\appendixsubsection=\relax
617 \let\appendixsubsubsec=\relax
618 \let\appendixsubsubsection=\relax
619 \let\contents=\relax
620 \let\smallbook=\relax
621 \let\titlepage=\relax
624 % Used in nested conditionals, where we have to parse the Texinfo source
625 % and so want to turn off most commands, in case they are used
626 % incorrectly.
628 \def\ignoremorecommands{%
629 \let\defcv = \relax
630 \let\deffn = \relax
631 \let\deffnx = \relax
632 \let\defindex = \relax
633 \let\defivar = \relax
634 \let\defmac = \relax
635 \let\defmethod = \relax
636 \let\defop = \relax
637 \let\defopt = \relax
638 \let\defspec = \relax
639 \let\deftp = \relax
640 \let\deftypefn = \relax
641 \let\deftypefun = \relax
642 \let\deftypevar = \relax
643 \let\deftypevr = \relax
644 \let\defun = \relax
645 \let\defvar = \relax
646 \let\defvr = \relax
647 \let\ref = \relax
648 \let\xref = \relax
649 \let\printindex = \relax
650 \let\pxref = \relax
651 \let\settitle = \relax
652 \let\setchapternewpage = \relax
653 \let\setchapterstyle = \relax
654 \let\everyheading = \relax
655 \let\evenheading = \relax
656 \let\oddheading = \relax
657 \let\everyfooting = \relax
658 \let\evenfooting = \relax
659 \let\oddfooting = \relax
660 \let\headings = \relax
661 \let\include = \relax
662 \let\lowersections = \relax
663 \let\down = \relax
664 \let\raisesections = \relax
665 \let\up = \relax
666 \let\set = \relax
667 \let\clear = \relax
668 \let\item = \relax
669 \let\message = \relax
672 % Ignore @ignore ... @end ignore.
674 \def\ignore{\doignore{ignore}}
676 % Also ignore @ifinfo, @ifhtml, @html, @menu, and @direntry text.
678 \def\ifinfo{\doignore{ifinfo}}
679 \def\ifhtml{\doignore{ifhtml}}
680 \def\html{\doignore{html}}
681 \def\menu{\doignore{menu}}
682 \def\direntry{\doignore{direntry}}
684 % @dircategory CATEGORY -- specify a category of the dir file
685 % which this file should belong to. Ignore this in TeX.
687 \def\dircategory{\comment}
689 % Ignore text until a line `@end #1'.
691 \def\doignore#1{\begingroup
692 % Don't complain about control sequences we have declared \outer.
693 \ignoresections
695 % Define a command to swallow text until we reach `@end #1'.
696 \long\def\doignoretext##1\end #1{\enddoignore}%
698 % Make sure that spaces turn into tokens that match what \doignoretext wants.
699 \catcode32 = 10
701 % And now expand that command.
702 \doignoretext
705 % What we do to finish off ignored text.
707 \def\enddoignore{\endgroup\ignorespaces}%
709 \newif\ifwarnedobs\warnedobsfalse
710 \def\obstexwarn{%
711 \ifwarnedobs\relax\else
712 % We need to warn folks that they may have trouble with TeX 3.0.
713 % This uses \immediate\write16 rather than \message to get newlines.
714 \immediate\write16{}
715 \immediate\write16{***WARNING*** for users of Unix TeX 3.0!}
716 \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).}
717 \immediate\write16{If you are running another version of TeX, relax.}
718 \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.}
719 \immediate\write16{ Then upgrade your TeX installation if you can.}
720 \immediate\write16{If you are stuck with version 3.0, run the}
721 \immediate\write16{ script ``tex3patch'' from the Texinfo distribution}
722 \immediate\write16{ to use a workaround.}
723 \immediate\write16{}
724 \global\warnedobstrue
728 % **In TeX 3.0, setting text in \nullfont hangs tex. For a
729 % workaround (which requires the file ``dummy.tfm'' to be installed),
730 % uncomment the following line:
731 %%%%%\font\nullfont=dummy\let\obstexwarn=\relax
733 % Ignore text, except that we keep track of conditional commands for
734 % purposes of nesting, up to an `@end #1' command.
736 \def\nestedignore#1{%
737 \obstexwarn
738 % We must actually expand the ignored text to look for the @end
739 % command, so that nested ignore constructs work. Thus, we put the
740 % text into a \vbox and then do nothing with the result. To minimize
741 % the change of memory overflow, we follow the approach outlined on
742 % page 401 of the TeXbook: make the current font be a dummy font.
744 \setbox0 = \vbox\bgroup
745 % Don't complain about control sequences we have declared \outer.
746 \ignoresections
748 % Define `@end #1' to end the box, which will in turn undefine the
749 % @end command again.
750 \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}%
752 % We are going to be parsing Texinfo commands. Most cause no
753 % trouble when they are used incorrectly, but some commands do
754 % complicated argument parsing or otherwise get confused, so we
755 % undefine them.
757 % We can't do anything about stray @-signs, unfortunately;
758 % they'll produce `undefined control sequence' errors.
759 \ignoremorecommands
761 % Set the current font to be \nullfont, a TeX primitive, and define
762 % all the font commands to also use \nullfont. We don't use
763 % dummy.tfm, as suggested in the TeXbook, because not all sites
764 % might have that installed. Therefore, math mode will still
765 % produce output, but that should be an extremely small amount of
766 % stuff compared to the main input.
768 \nullfont
769 \let\tenrm = \nullfont \let\tenit = \nullfont \let\tensl = \nullfont
770 \let\tenbf = \nullfont \let\tentt = \nullfont \let\smallcaps = \nullfont
771 \let\tensf = \nullfont
772 % Similarly for index fonts (mostly for their use in
773 % smallexample)
774 \let\indrm = \nullfont \let\indit = \nullfont \let\indsl = \nullfont
775 \let\indbf = \nullfont \let\indtt = \nullfont \let\indsc = \nullfont
776 \let\indsf = \nullfont
778 % Don't complain when characters are missing from the fonts.
779 \tracinglostchars = 0
781 % Don't bother to do space factor calculations.
782 \frenchspacing
784 % Don't report underfull hboxes.
785 \hbadness = 10000
787 % Do minimal line-breaking.
788 \pretolerance = 10000
790 % Do not execute instructions in @tex
791 \def\tex{\doignore{tex}}
794 % @set VAR sets the variable VAR to an empty value.
795 % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
797 % Since we want to separate VAR from REST-OF-LINE (which might be
798 % empty), we can't just use \parsearg; we have to insert a space of our
799 % own to delimit the rest of the line, and then take it out again if we
800 % didn't need it. Make sure the catcode of space is correct to avoid
801 % losing inside @example, for instance.
803 \def\set{\begingroup\catcode` =10 \parsearg\setxxx}
804 \def\setxxx#1{\setyyy#1 \endsetyyy}
805 \def\setyyy#1 #2\endsetyyy{%
806 \def\temp{#2}%
807 \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty
808 \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted.
810 \endgroup
812 % Can't use \xdef to pre-expand #2 and save some time, since \temp or
813 % \next or other control sequences that we've defined might get us into
814 % an infinite loop. Consider `@set foo @cite{bar}'.
815 \def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}}
817 % @clear VAR clears (i.e., unsets) the variable VAR.
819 \def\clear{\parsearg\clearxxx}
820 \def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax}
822 % @value{foo} gets the text saved in variable foo.
824 \def\value#1{\expandafter
825 \ifx\csname SET#1\endcsname\relax
826 {\{No value for ``#1''\}}
827 \else \csname SET#1\endcsname \fi}
829 % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
830 % with @set.
832 \def\ifset{\parsearg\ifsetxxx}
833 \def\ifsetxxx #1{%
834 \expandafter\ifx\csname SET#1\endcsname\relax
835 \expandafter\ifsetfail
836 \else
837 \expandafter\ifsetsucceed
840 \def\ifsetsucceed{\conditionalsucceed{ifset}}
841 \def\ifsetfail{\nestedignore{ifset}}
842 \defineunmatchedend{ifset}
844 % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
845 % defined with @set, or has been undefined with @clear.
847 \def\ifclear{\parsearg\ifclearxxx}
848 \def\ifclearxxx #1{%
849 \expandafter\ifx\csname SET#1\endcsname\relax
850 \expandafter\ifclearsucceed
851 \else
852 \expandafter\ifclearfail
855 \def\ifclearsucceed{\conditionalsucceed{ifclear}}
856 \def\ifclearfail{\nestedignore{ifclear}}
857 \defineunmatchedend{ifclear}
859 % @iftex always succeeds; we read the text following, through @end
860 % iftex). But `@end iftex' should be valid only after an @iftex.
862 \def\iftex{\conditionalsucceed{iftex}}
863 \defineunmatchedend{iftex}
865 % We can't just want to start a group at @iftex (for example) and end it
866 % at @end iftex, since then @set commands inside the conditional have no
867 % effect (they'd get reverted at the end of the group). So we must
868 % define \Eiftex to redefine itself to be its previous value. (We can't
869 % just define it to fail again with an ``unmatched end'' error, since
870 % the @ifset might be nested.)
872 \def\conditionalsucceed#1{%
873 \edef\temp{%
874 % Remember the current value of \E#1.
875 \let\nece{prevE#1} = \nece{E#1}%
877 % At the `@end #1', redefine \E#1 to be its previous value.
878 \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}%
880 \temp
883 % We need to expand lots of \csname's, but we don't want to expand the
884 % control sequences after we've constructed them.
886 \def\nece#1{\expandafter\noexpand\csname#1\endcsname}
888 % @asis just yields its argument. Used with @table, for example.
890 \def\asis#1{#1}
892 % @math means output in math mode.
893 % We don't use $'s directly in the definition of \math because control
894 % sequences like \math are expanded when the toc file is written. Then,
895 % we read the toc file back, the $'s will be normal characters (as they
896 % should be, according to the definition of Texinfo). So we must use a
897 % control sequence to switch into and out of math mode.
899 % This isn't quite enough for @math to work properly in indices, but it
900 % seems unlikely it will ever be needed there.
902 \let\implicitmath = $
903 \def\math#1{\implicitmath #1\implicitmath}
905 % @bullet and @minus need the same treatment as @math, just above.
906 \def\bullet{\implicitmath\ptexbullet\implicitmath}
907 \def\minus{\implicitmath-\implicitmath}
909 \def\node{\ENVcheck\parsearg\nodezzz}
910 \def\nodezzz#1{\nodexxx [#1,]}
911 \def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
912 \let\nwnode=\node
913 \let\lastnode=\relax
915 \def\donoderef{\ifx\lastnode\relax\else
916 \expandafter\expandafter\expandafter\setref{\lastnode}\fi
917 \global\let\lastnode=\relax}
919 \def\unnumbnoderef{\ifx\lastnode\relax\else
920 \expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi
921 \global\let\lastnode=\relax}
923 \def\appendixnoderef{\ifx\lastnode\relax\else
924 \expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi
925 \global\let\lastnode=\relax}
927 \let\refill=\relax
929 % @setfilename is done at the beginning of every texinfo file.
930 % So open here the files we need to have open while reading the input.
931 % This makes it possible to make a .fmt file for texinfo.
932 \def\setfilename{%
933 \readauxfile
934 \opencontents
935 \openindices
936 \fixbackslash % Turn off hack to swallow `\input texinfo'.
937 \global\let\setfilename=\comment % Ignore extra @setfilename cmds.
938 \comment % Ignore the actual filename.
941 \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
943 \def\inforef #1{\inforefzzz #1,,,,**}
944 \def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
945 node \samp{\ignorespaces#1{}}}
947 \def\macro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\macroxxx}
948 \def\macroxxx#1#2 \end macro{%
949 \expandafter\gdef\macrotemp#1{#2}%
950 \endgroup}
952 %\def\linemacro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\linemacroxxx}
953 %\def\linemacroxxx#1#2 \end linemacro{%
954 %\let\parsearg=\relax
955 %\edef\macrotempx{\csname M\butfirst\expandafter\string\macrotemp\endcsname}%
956 %\expandafter\xdef\macrotemp{\parsearg\macrotempx}%
957 %\expandafter\gdef\macrotempx#1{#2}%
958 %\endgroup}
960 %\def\butfirst#1{}
962 \message{fonts,}
964 % Font-change commands.
966 % Texinfo supports the sans serif font style, which plain TeX does not.
967 % So we set up a \sf analogous to plain's \rm, etc.
968 \newfam\sffam
969 \def\sf{\fam=\sffam \tensf}
970 \let\li = \sf % Sometimes we call it \li, not \sf.
972 % We don't need math for this one.
973 \def\ttsl{\tenttsl}
975 %% Try out Computer Modern fonts at \magstephalf
976 \let\mainmagstep=\magstephalf
978 % Set the font macro #1 to the font named #2, adding on the
979 % specified font prefix (normally `cm').
980 % #3 is the font's design size, #4 is a scale factor
981 \def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4}
983 % Use cm as the default font prefix.
984 % To specify the font prefix, you must define \fontprefix
985 % before you read in texinfo.tex.
986 \ifx\fontprefix\undefined
987 \def\fontprefix{cm}
989 % Support font families that don't use the same naming scheme as CM.
990 \def\rmshape{r}
991 \def\rmbshape{bx} %where the normal face is bold
992 \def\bfshape{b}
993 \def\bxshape{bx}
994 \def\ttshape{tt}
995 \def\ttbshape{tt}
996 \def\ttslshape{sltt}
997 \def\itshape{ti}
998 \def\itbshape{bxti}
999 \def\slshape{sl}
1000 \def\slbshape{bxsl}
1001 \def\sfshape{ss}
1002 \def\sfbshape{ss}
1003 \def\scshape{csc}
1004 \def\scbshape{csc}
1006 \ifx\bigger\relax
1007 \let\mainmagstep=\magstep1
1008 \setfont\textrm\rmshape{12}{1000}
1009 \setfont\texttt\ttshape{12}{1000}
1010 \else
1011 \setfont\textrm\rmshape{10}{\mainmagstep}
1012 \setfont\texttt\ttshape{10}{\mainmagstep}
1014 % Instead of cmb10, you many want to use cmbx10.
1015 % cmbx10 is a prettier font on its own, but cmb10
1016 % looks better when embedded in a line with cmr10.
1017 \setfont\textbf\bfshape{10}{\mainmagstep}
1018 \setfont\textit\itshape{10}{\mainmagstep}
1019 \setfont\textsl\slshape{10}{\mainmagstep}
1020 \setfont\textsf\sfshape{10}{\mainmagstep}
1021 \setfont\textsc\scshape{10}{\mainmagstep}
1022 \setfont\textttsl\ttslshape{10}{\mainmagstep}
1023 \font\texti=cmmi10 scaled \mainmagstep
1024 \font\textsy=cmsy10 scaled \mainmagstep
1026 % A few fonts for @defun, etc.
1027 \setfont\defbf\bxshape{10}{\magstep1} %was 1314
1028 \setfont\deftt\ttshape{10}{\magstep1}
1029 \def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf}
1031 % Fonts for indices and small examples.
1032 % We actually use the slanted font rather than the italic,
1033 % because texinfo normally uses the slanted fonts for that.
1034 % Do not make many font distinctions in general in the index, since they
1035 % aren't very useful.
1036 \setfont\ninett\ttshape{9}{1000}
1037 \setfont\indrm\rmshape{9}{1000}
1038 \setfont\indit\slshape{9}{1000}
1039 \let\indsl=\indit
1040 \let\indtt=\ninett
1041 \let\indttsl=\ninett
1042 \let\indsf=\indrm
1043 \let\indbf=\indrm
1044 \setfont\indsc\scshape{10}{900}
1045 \font\indi=cmmi9
1046 \font\indsy=cmsy9
1048 % Fonts for headings
1049 \setfont\chaprm\rmbshape{12}{\magstep2}
1050 \setfont\chapit\itbshape{10}{\magstep3}
1051 \setfont\chapsl\slbshape{10}{\magstep3}
1052 \setfont\chaptt\ttbshape{12}{\magstep2}
1053 \setfont\chapttsl\ttslshape{10}{\magstep3}
1054 \setfont\chapsf\sfbshape{12}{\magstep2}
1055 \let\chapbf=\chaprm
1056 \setfont\chapsc\scbshape{10}{\magstep3}
1057 \font\chapi=cmmi12 scaled \magstep2
1058 \font\chapsy=cmsy10 scaled \magstep3
1060 \setfont\secrm\rmbshape{12}{\magstep1}
1061 \setfont\secit\itbshape{10}{\magstep2}
1062 \setfont\secsl\slbshape{10}{\magstep2}
1063 \setfont\sectt\ttbshape{12}{\magstep1}
1064 \setfont\secttsl\ttslshape{10}{\magstep2}
1065 \setfont\secsf\sfbshape{12}{\magstep1}
1066 \let\secbf\secrm
1067 \setfont\secsc\scbshape{10}{\magstep2}
1068 \font\seci=cmmi12 scaled \magstep1
1069 \font\secsy=cmsy10 scaled \magstep2
1071 % \setfont\ssecrm\bxshape{10}{\magstep1} % This size an font looked bad.
1072 % \setfont\ssecit\itshape{10}{\magstep1} % The letters were too crowded.
1073 % \setfont\ssecsl\slshape{10}{\magstep1}
1074 % \setfont\ssectt\ttshape{10}{\magstep1}
1075 % \setfont\ssecsf\sfshape{10}{\magstep1}
1077 %\setfont\ssecrm\bfshape{10}{1315} % Note the use of cmb rather than cmbx.
1078 %\setfont\ssecit\itshape{10}{1315} % Also, the size is a little larger than
1079 %\setfont\ssecsl\slshape{10}{1315} % being scaled magstep1.
1080 %\setfont\ssectt\ttshape{10}{1315}
1081 %\setfont\ssecsf\sfshape{10}{1315}
1083 %\let\ssecbf=\ssecrm
1085 \setfont\ssecrm\rmbshape{12}{\magstephalf}
1086 \setfont\ssecit\itbshape{10}{1315}
1087 \setfont\ssecsl\slbshape{10}{1315}
1088 \setfont\ssectt\ttbshape{12}{\magstephalf}
1089 \setfont\ssecttsl\ttslshape{10}{\magstep1}
1090 \setfont\ssecsf\sfbshape{12}{\magstephalf}
1091 \let\ssecbf\ssecrm
1092 \setfont\ssecsc\scbshape{10}{\magstep1}
1093 \font\sseci=cmmi12 scaled \magstephalf
1094 \font\ssecsy=cmsy10 scaled \magstep1
1095 % The smallcaps and symbol fonts should actually be scaled \magstep1.5,
1096 % but that is not a standard magnification.
1098 % Fonts for title page:
1099 \setfont\titlerm\rmbshape{12}{\magstep3}
1100 \let\authorrm = \secrm
1102 % In order for the font changes to affect most math symbols and letters,
1103 % we have to define the \textfont of the standard families. Since
1104 % texinfo doesn't allow for producing subscripts and superscripts, we
1105 % don't bother to reset \scriptfont and \scriptscriptfont (which would
1106 % also require loading a lot more fonts).
1108 \def\resetmathfonts{%
1109 \textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy
1110 \textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf
1111 \textfont\ttfam = \tentt \textfont\sffam = \tensf
1115 % The font-changing commands redefine the meanings of \tenSTYLE, instead
1116 % of just \STYLE. We do this so that font changes will continue to work
1117 % in math mode, where it is the current \fam that is relevant in most
1118 % cases, not the current font. Plain TeX does \def\bf{\fam=\bffam
1119 % \tenbf}, for example. By redefining \tenbf, we obviate the need to
1120 % redefine \bf itself.
1121 \def\textfonts{%
1122 \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
1123 \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
1124 \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl
1125 \resetmathfonts}
1126 \def\chapfonts{%
1127 \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
1128 \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
1129 \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl
1130 \resetmathfonts}
1131 \def\secfonts{%
1132 \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
1133 \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
1134 \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl
1135 \resetmathfonts}
1136 \def\subsecfonts{%
1137 \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
1138 \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
1139 \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl
1140 \resetmathfonts}
1141 \def\indexfonts{%
1142 \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl
1143 \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc
1144 \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy \let\tenttsl=\indttsl
1145 \resetmathfonts}
1147 % Set up the default fonts, so we can use them for creating boxes.
1149 \textfonts
1151 % Count depth in font-changes, for error checks
1152 \newcount\fontdepth \fontdepth=0
1154 % Fonts for short table of contents.
1155 \setfont\shortcontrm\rmshape{12}{1000}
1156 \setfont\shortcontbf\bxshape{12}{1000}
1157 \setfont\shortcontsl\slshape{12}{1000}
1159 %% Add scribe-like font environments, plus @l for inline lisp (usually sans
1160 %% serif) and @ii for TeX italic
1162 % \smartitalic{ARG} outputs arg in italics, followed by an italic correction
1163 % unless the following character is such as not to need one.
1164 \def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
1165 \def\smartitalic#1{{\sl #1}\futurelet\next\smartitalicx}
1167 \let\i=\smartitalic
1168 \let\var=\smartitalic
1169 \let\dfn=\smartitalic
1170 \let\emph=\smartitalic
1171 \let\cite=\smartitalic
1173 \def\b#1{{\bf #1}}
1174 \let\strong=\b
1176 % We can't just use \exhyphenpenalty, because that only has effect at
1177 % the end of a paragraph. Restore normal hyphenation at the end of the
1178 % group within which \nohyphenation is presumably called.
1180 \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
1181 \def\restorehyphenation{\hyphenchar\font = `- }
1183 \def\t#1{%
1184 {\tt \rawbackslash \frenchspacing #1}%
1185 \null
1187 \let\ttfont=\t
1188 \def\samp #1{`\tclose{#1}'\null}
1189 \def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
1190 \def\ctrl #1{{\tt \rawbackslash \hat}#1}
1192 \let\file=\samp
1193 \let\url=\samp % perhaps include a hypertex \special eventually
1195 % @code is a modification of @t,
1196 % which makes spaces the same size as normal in the surrounding text.
1197 \def\tclose#1{%
1199 % Change normal interword space to be same as for the current font.
1200 \spaceskip = \fontdimen2\font
1202 % Switch to typewriter.
1205 % But `\ ' produces the large typewriter interword space.
1206 \def\ {{\spaceskip = 0pt{} }}%
1208 % Turn off hyphenation.
1209 \nohyphenation
1211 \rawbackslash
1212 \frenchspacing
1215 \null
1218 % We *must* turn on hyphenation at `-' and `_' in \code.
1219 % Otherwise, it is too hard to avoid overfull hboxes
1220 % in the Emacs manual, the Library manual, etc.
1222 % Unfortunately, TeX uses one parameter (\hyphenchar) to control
1223 % both hyphenation at - and hyphenation within words.
1224 % We must therefore turn them both off (\tclose does that)
1225 % and arrange explicitly to hyphenate an a dash.
1226 % -- rms.
1228 \catcode`\-=\active
1229 \catcode`\_=\active
1230 \global\def\code{\begingroup \catcode`\-=\active \let-\codedash \catcode`\_=\active \let_\codeunder \codex}
1231 % The following is used by \doprintindex to insure that long function names
1232 % wrap around. It is necessary for - and _ to be active before the index is
1233 % read from the file, as \entry parses the arguments long before \code is
1234 % ever called. -- mycroft
1235 \global\def\indexbreaks{\catcode`\-=\active \let-\realdash \catcode`\_=\active \let_\realunder}
1238 \def\realdash{-}
1239 \def\realunder{_}
1240 \def\codedash{-\discretionary{}{}{}}
1241 \def\codeunder{\normalunderscore\discretionary{}{}{}}
1242 \def\codex #1{\tclose{#1}\endgroup}
1244 %\let\exp=\tclose %Was temporary
1246 % @kbd is like @code, except that if the argument is just one @key command,
1247 % then @kbd has no effect.
1249 \def\xkey{\key}
1250 \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
1251 \ifx\one\xkey\ifx\threex\three \key{#2}%
1252 \else{\tclose{\ttsl\look}}\fi
1253 \else{\tclose{\ttsl\look}}\fi}
1255 % Check if we are currently using a typewriter font. Since all the
1256 % Computer Modern typewriter fonts have zero interword stretch (and
1257 % shrink), and it is reasonable to expect all typewriter fonts to have
1258 % this property, we can check that font parameter.
1260 \def\ifmonospace{\ifdim\fontdimen3\font=0pt }
1262 % Typeset a dimension, e.g., `in' or `pt'. The only reason for the
1263 % argument is to make the input look right: @dmn{pt} instead of
1264 % @dmn{}pt.
1266 \def\dmn#1{\thinspace #1}
1268 \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}
1270 \def\l#1{{\li #1}\null} %
1272 \def\r#1{{\rm #1}} % roman font
1273 % Use of \lowercase was suggested.
1274 \def\sc#1{{\smallcaps#1}} % smallcaps font
1275 \def\ii#1{{\it #1}} % italic font
1277 \message{page headings,}
1279 \newskip\titlepagetopglue \titlepagetopglue = 1.5in
1280 \newskip\titlepagebottomglue \titlepagebottomglue = 2pc
1282 % First the title page. Must do @settitle before @titlepage.
1283 \def\titlefont#1{{\titlerm #1}}
1285 \newif\ifseenauthor
1286 \newif\iffinishedtitlepage
1288 \def\shorttitlepage{\parsearg\shorttitlepagezzz}
1289 \def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
1290 \endgroup\page\hbox{}\page}
1292 \def\titlepage{\begingroup \parindent=0pt \textfonts
1293 \let\subtitlerm=\tenrm
1294 % I deinstalled the following change because \cmr12 is undefined.
1295 % This change was not in the ChangeLog anyway. --rms.
1296 % \let\subtitlerm=\cmr12
1297 \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
1299 \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}%
1301 % Leave some space at the very top of the page.
1302 \vglue\titlepagetopglue
1304 % Now you can print the title using @title.
1305 \def\title{\parsearg\titlezzz}%
1306 \def\titlezzz##1{\leftline{\titlefont{##1}}
1307 % print a rule at the page bottom also.
1308 \finishedtitlepagefalse
1309 \vskip4pt \hrule height 4pt width \hsize \vskip4pt}%
1310 % No rule at page bottom unless we print one at the top with @title.
1311 \finishedtitlepagetrue
1313 % Now you can put text using @subtitle.
1314 \def\subtitle{\parsearg\subtitlezzz}%
1315 \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}%
1317 % @author should come last, but may come many times.
1318 \def\author{\parsearg\authorzzz}%
1319 \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi
1320 {\authorfont \leftline{##1}}}%
1322 % Most title ``pages'' are actually two pages long, with space
1323 % at the top of the second. We don't want the ragged left on the second.
1324 \let\oldpage = \page
1325 \def\page{%
1326 \iffinishedtitlepage\else
1327 \finishtitlepage
1329 \oldpage
1330 \let\page = \oldpage
1331 \hbox{}}%
1332 % \def\page{\oldpage \hbox{}}
1335 \def\Etitlepage{%
1336 \iffinishedtitlepage\else
1337 \finishtitlepage
1339 % It is important to do the page break before ending the group,
1340 % because the headline and footline are only empty inside the group.
1341 % If we use the new definition of \page, we always get a blank page
1342 % after the title page, which we certainly don't want.
1343 \oldpage
1344 \endgroup
1345 \HEADINGSon
1348 \def\finishtitlepage{%
1349 \vskip4pt \hrule height 2pt width \hsize
1350 \vskip\titlepagebottomglue
1351 \finishedtitlepagetrue
1354 %%% Set up page headings and footings.
1356 \let\thispage=\folio
1358 \newtoks \evenheadline % Token sequence for heading line of even pages
1359 \newtoks \oddheadline % Token sequence for heading line of odd pages
1360 \newtoks \evenfootline % Token sequence for footing line of even pages
1361 \newtoks \oddfootline % Token sequence for footing line of odd pages
1363 % Now make Tex use those variables
1364 \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
1365 \else \the\evenheadline \fi}}
1366 \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
1367 \else \the\evenfootline \fi}\HEADINGShook}
1368 \let\HEADINGShook=\relax
1370 % Commands to set those variables.
1371 % For example, this is what @headings on does
1372 % @evenheading @thistitle|@thispage|@thischapter
1373 % @oddheading @thischapter|@thispage|@thistitle
1374 % @evenfooting @thisfile||
1375 % @oddfooting ||@thisfile
1377 \def\evenheading{\parsearg\evenheadingxxx}
1378 \def\oddheading{\parsearg\oddheadingxxx}
1379 \def\everyheading{\parsearg\everyheadingxxx}
1381 \def\evenfooting{\parsearg\evenfootingxxx}
1382 \def\oddfooting{\parsearg\oddfootingxxx}
1383 \def\everyfooting{\parsearg\everyfootingxxx}
1385 {\catcode`\@=0 %
1387 \gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish}
1388 \gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{%
1389 \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1391 \gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish}
1392 \gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{%
1393 \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1395 \gdef\everyheadingxxx #1{\everyheadingyyy #1@|@|@|@|\finish}
1396 \gdef\everyheadingyyy #1@|#2@|#3@|#4\finish{%
1397 \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
1398 \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1400 \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish}
1401 \gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{%
1402 \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1404 \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish}
1405 \gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{%
1406 \global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1408 \gdef\everyfootingxxx #1{\everyfootingyyy #1@|@|@|@|\finish}
1409 \gdef\everyfootingyyy #1@|#2@|#3@|#4\finish{%
1410 \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
1411 \global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1413 }% unbind the catcode of @.
1415 % @headings double turns headings on for double-sided printing.
1416 % @headings single turns headings on for single-sided printing.
1417 % @headings off turns them off.
1418 % @headings on same as @headings double, retained for compatibility.
1419 % @headings after turns on double-sided headings after this page.
1420 % @headings doubleafter turns on double-sided headings after this page.
1421 % @headings singleafter turns on single-sided headings after this page.
1422 % By default, they are off.
1424 \def\headings #1 {\csname HEADINGS#1\endcsname}
1426 \def\HEADINGSoff{
1427 \global\evenheadline={\hfil} \global\evenfootline={\hfil}
1428 \global\oddheadline={\hfil} \global\oddfootline={\hfil}}
1429 \HEADINGSoff
1430 % When we turn headings on, set the page number to 1.
1431 % For double-sided printing, put current file name in lower left corner,
1432 % chapter name on inside top of right hand pages, document
1433 % title on inside top of left hand pages, and page numbers on outside top
1434 % edge of all pages.
1435 \def\HEADINGSdouble{
1436 %\pagealignmacro
1437 \global\pageno=1
1438 \global\evenfootline={\hfil}
1439 \global\oddfootline={\hfil}
1440 \global\evenheadline={\line{\folio\hfil\thistitle}}
1441 \global\oddheadline={\line{\thischapter\hfil\folio}}
1443 % For single-sided printing, chapter title goes across top left of page,
1444 % page number on top right.
1445 \def\HEADINGSsingle{
1446 %\pagealignmacro
1447 \global\pageno=1
1448 \global\evenfootline={\hfil}
1449 \global\oddfootline={\hfil}
1450 \global\evenheadline={\line{\thischapter\hfil\folio}}
1451 \global\oddheadline={\line{\thischapter\hfil\folio}}
1453 \def\HEADINGSon{\HEADINGSdouble}
1455 \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
1456 \let\HEADINGSdoubleafter=\HEADINGSafter
1457 \def\HEADINGSdoublex{%
1458 \global\evenfootline={\hfil}
1459 \global\oddfootline={\hfil}
1460 \global\evenheadline={\line{\folio\hfil\thistitle}}
1461 \global\oddheadline={\line{\thischapter\hfil\folio}}
1464 \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
1465 \def\HEADINGSsinglex{%
1466 \global\evenfootline={\hfil}
1467 \global\oddfootline={\hfil}
1468 \global\evenheadline={\line{\thischapter\hfil\folio}}
1469 \global\oddheadline={\line{\thischapter\hfil\folio}}
1472 % Subroutines used in generating headings
1473 % Produces Day Month Year style of output.
1474 \def\today{\number\day\space
1475 \ifcase\month\or
1476 January\or February\or March\or April\or May\or June\or
1477 July\or August\or September\or October\or November\or December\fi
1478 \space\number\year}
1480 % Use this if you want the Month Day, Year style of output.
1481 %\def\today{\ifcase\month\or
1482 %January\or February\or March\or April\or May\or June\or
1483 %July\or August\or September\or October\or November\or December\fi
1484 %\space\number\day, \number\year}
1486 % @settitle line... specifies the title of the document, for headings
1487 % It generates no output of its own
1489 \def\thistitle{No Title}
1490 \def\settitle{\parsearg\settitlezzz}
1491 \def\settitlezzz #1{\gdef\thistitle{#1}}
1493 \message{tables,}
1495 % @tabs -- simple alignment
1497 % These don't work. For one thing, \+ is defined as outer.
1498 % So these macros cannot even be defined.
1500 %\def\tabs{\parsearg\tabszzz}
1501 %\def\tabszzz #1{\settabs\+#1\cr}
1502 %\def\tabline{\parsearg\tablinezzz}
1503 %\def\tablinezzz #1{\+#1\cr}
1504 %\def\&{&}
1506 % Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
1508 % default indentation of table text
1509 \newdimen\tableindent \tableindent=.8in
1510 % default indentation of @itemize and @enumerate text
1511 \newdimen\itemindent \itemindent=.3in
1512 % margin between end of table item and start of table text.
1513 \newdimen\itemmargin \itemmargin=.1in
1515 % used internally for \itemindent minus \itemmargin
1516 \newdimen\itemmax
1518 % Note @table, @vtable, and @vtable define @item, @itemx, etc., with
1519 % these defs.
1520 % They also define \itemindex
1521 % to index the item name in whatever manner is desired (perhaps none).
1523 \newif\ifitemxneedsnegativevskip
1525 \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
1527 \def\internalBitem{\smallbreak \parsearg\itemzzz}
1528 \def\internalBitemx{\itemxpar \parsearg\itemzzz}
1530 \def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
1531 \def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz}
1533 \def\internalBkitem{\smallbreak \parsearg\kitemzzz}
1534 \def\internalBkitemx{\itemxpar \parsearg\kitemzzz}
1536 \def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}%
1537 \itemzzz {#1}}
1539 \def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}%
1540 \itemzzz {#1}}
1542 \def\itemzzz #1{\begingroup %
1543 \advance\hsize by -\rightskip
1544 \advance\hsize by -\tableindent
1545 \setbox0=\hbox{\itemfont{#1}}%
1546 \itemindex{#1}%
1547 \nobreak % This prevents a break before @itemx.
1549 % Be sure we are not still in the middle of a paragraph.
1550 %{\parskip = 0in
1551 %\par
1554 % If the item text does not fit in the space we have, put it on a line
1555 % by itself, and do not allow a page break either before or after that
1556 % line. We do not start a paragraph here because then if the next
1557 % command is, e.g., @kindex, the whatsit would get put into the
1558 % horizontal list on a line by itself, resulting in extra blank space.
1559 \ifdim \wd0>\itemmax
1561 % Make this a paragraph so we get the \parskip glue and wrapping,
1562 % but leave it ragged-right.
1563 \begingroup
1564 \advance\leftskip by-\tableindent
1565 \advance\hsize by\tableindent
1566 \advance\rightskip by0pt plus1fil
1567 \leavevmode\unhbox0\par
1568 \endgroup
1570 % We're going to be starting a paragraph, but we don't want the
1571 % \parskip glue -- logically it's part of the @item we just started.
1572 \nobreak \vskip-\parskip
1574 % Stop a page break at the \parskip glue coming up. Unfortunately
1575 % we can't prevent a possible page break at the following
1576 % \baselineskip glue.
1577 \nobreak
1578 \endgroup
1579 \itemxneedsnegativevskipfalse
1580 \else
1581 % The item text fits into the space. Start a paragraph, so that the
1582 % following text (if any) will end up on the same line. Since that
1583 % text will be indented by \tableindent, we make the item text be in
1584 % a zero-width box.
1585 \noindent
1586 \rlap{\hskip -\tableindent\box0}\ignorespaces%
1587 \endgroup%
1588 \itemxneedsnegativevskiptrue%
1592 \def\item{\errmessage{@item while not in a table}}
1593 \def\itemx{\errmessage{@itemx while not in a table}}
1594 \def\kitem{\errmessage{@kitem while not in a table}}
1595 \def\kitemx{\errmessage{@kitemx while not in a table}}
1596 \def\xitem{\errmessage{@xitem while not in a table}}
1597 \def\xitemx{\errmessage{@xitemx while not in a table}}
1599 %% Contains a kludge to get @end[description] to work
1600 \def\description{\tablez{\dontindex}{1}{}{}{}{}}
1602 \def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
1603 {\obeylines\obeyspaces%
1604 \gdef\tablex #1^^M{%
1605 \tabley\dontindex#1 \endtabley}}
1607 \def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
1608 {\obeylines\obeyspaces%
1609 \gdef\ftablex #1^^M{%
1610 \tabley\fnitemindex#1 \endtabley
1611 \def\Eftable{\endgraf\afterenvbreak\endgroup}%
1612 \let\Etable=\relax}}
1614 \def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex}
1615 {\obeylines\obeyspaces%
1616 \gdef\vtablex #1^^M{%
1617 \tabley\vritemindex#1 \endtabley
1618 \def\Evtable{\endgraf\afterenvbreak\endgroup}%
1619 \let\Etable=\relax}}
1621 \def\dontindex #1{}
1622 \def\fnitemindex #1{\doind {fn}{\code{#1}}}%
1623 \def\vritemindex #1{\doind {vr}{\code{#1}}}%
1625 {\obeyspaces %
1626 \gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
1627 \tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
1629 \def\tablez #1#2#3#4#5#6{%
1630 \aboveenvbreak %
1631 \begingroup %
1632 \def\Edescription{\Etable}% Necessary kludge.
1633 \let\itemindex=#1%
1634 \ifnum 0#3>0 \advance \leftskip by #3\mil \fi %
1635 \ifnum 0#4>0 \tableindent=#4\mil \fi %
1636 \ifnum 0#5>0 \advance \rightskip by #5\mil \fi %
1637 \def\itemfont{#2}%
1638 \itemmax=\tableindent %
1639 \advance \itemmax by -\itemmargin %
1640 \advance \leftskip by \tableindent %
1641 \exdentamount=\tableindent
1642 \parindent = 0pt
1643 \parskip = \smallskipamount
1644 \ifdim \parskip=0pt \parskip=2pt \fi%
1645 \def\Etable{\endgraf\afterenvbreak\endgroup}%
1646 \let\item = \internalBitem %
1647 \let\itemx = \internalBitemx %
1648 \let\kitem = \internalBkitem %
1649 \let\kitemx = \internalBkitemx %
1650 \let\xitem = \internalBxitem %
1651 \let\xitemx = \internalBxitemx %
1654 % This is the counter used by @enumerate, which is really @itemize
1656 \newcount \itemno
1658 \def\itemize{\parsearg\itemizezzz}
1660 \def\itemizezzz #1{%
1661 \begingroup % ended by the @end itemsize
1662 \itemizey {#1}{\Eitemize}
1665 \def\itemizey #1#2{%
1666 \aboveenvbreak %
1667 \itemmax=\itemindent %
1668 \advance \itemmax by -\itemmargin %
1669 \advance \leftskip by \itemindent %
1670 \exdentamount=\itemindent
1671 \parindent = 0pt %
1672 \parskip = \smallskipamount %
1673 \ifdim \parskip=0pt \parskip=2pt \fi%
1674 \def#2{\endgraf\afterenvbreak\endgroup}%
1675 \def\itemcontents{#1}%
1676 \let\item=\itemizeitem}
1678 % Set sfcode to normal for the chars that usually have another value.
1679 % These are `.?!:;,'
1680 \def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000
1681 \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 }
1683 % \splitoff TOKENS\endmark defines \first to be the first token in
1684 % TOKENS, and \rest to be the remainder.
1686 \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
1688 % Allow an optional argument of an uppercase letter, lowercase letter,
1689 % or number, to specify the first label in the enumerated list. No
1690 % argument is the same as `1'.
1692 \def\enumerate{\parsearg\enumeratezzz}
1693 \def\enumeratezzz #1{\enumeratey #1 \endenumeratey}
1694 \def\enumeratey #1 #2\endenumeratey{%
1695 \begingroup % ended by the @end enumerate
1697 % If we were given no argument, pretend we were given `1'.
1698 \def\thearg{#1}%
1699 \ifx\thearg\empty \def\thearg{1}\fi
1701 % Detect if the argument is a single token. If so, it might be a
1702 % letter. Otherwise, the only valid thing it can be is a number.
1703 % (We will always have one token, because of the test we just made.
1704 % This is a good thing, since \splitoff doesn't work given nothing at
1705 % all -- the first parameter is undelimited.)
1706 \expandafter\splitoff\thearg\endmark
1707 \ifx\rest\empty
1708 % Only one token in the argument. It could still be anything.
1709 % A ``lowercase letter'' is one whose \lccode is nonzero.
1710 % An ``uppercase letter'' is one whose \lccode is both nonzero, and
1711 % not equal to itself.
1712 % Otherwise, we assume it's a number.
1714 % We need the \relax at the end of the \ifnum lines to stop TeX from
1715 % continuing to look for a <number>.
1717 \ifnum\lccode\expandafter`\thearg=0\relax
1718 \numericenumerate % a number (we hope)
1719 \else
1720 % It's a letter.
1721 \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
1722 \lowercaseenumerate % lowercase letter
1723 \else
1724 \uppercaseenumerate % uppercase letter
1727 \else
1728 % Multiple tokens in the argument. We hope it's a number.
1729 \numericenumerate
1733 % An @enumerate whose labels are integers. The starting integer is
1734 % given in \thearg.
1736 \def\numericenumerate{%
1737 \itemno = \thearg
1738 \startenumeration{\the\itemno}%
1741 % The starting (lowercase) letter is in \thearg.
1742 \def\lowercaseenumerate{%
1743 \itemno = \expandafter`\thearg
1744 \startenumeration{%
1745 % Be sure we're not beyond the end of the alphabet.
1746 \ifnum\itemno=0
1747 \errmessage{No more lowercase letters in @enumerate; get a bigger
1748 alphabet}%
1750 \char\lccode\itemno
1754 % The starting (uppercase) letter is in \thearg.
1755 \def\uppercaseenumerate{%
1756 \itemno = \expandafter`\thearg
1757 \startenumeration{%
1758 % Be sure we're not beyond the end of the alphabet.
1759 \ifnum\itemno=0
1760 \errmessage{No more uppercase letters in @enumerate; get a bigger
1761 alphabet}
1763 \char\uccode\itemno
1767 % Call itemizey, adding a period to the first argument and supplying the
1768 % common last two arguments. Also subtract one from the initial value in
1769 % \itemno, since @item increments \itemno.
1771 \def\startenumeration#1{%
1772 \advance\itemno by -1
1773 \itemizey{#1.}\Eenumerate\flushcr
1776 % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
1777 % to @enumerate.
1779 \def\alphaenumerate{\enumerate{a}}
1780 \def\capsenumerate{\enumerate{A}}
1781 \def\Ealphaenumerate{\Eenumerate}
1782 \def\Ecapsenumerate{\Eenumerate}
1784 % Definition of @item while inside @itemize.
1786 \def\itemizeitem{%
1787 \advance\itemno by 1
1788 {\let\par=\endgraf \smallbreak}%
1789 \ifhmode \errmessage{\in hmode at itemizeitem}\fi
1790 {\parskip=0in \hskip 0pt
1791 \hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
1792 \vadjust{\penalty 1200}}%
1793 \flushcr}
1795 % @multitable macros
1796 % Amy Hendrickson, 8/18/94, 3/6/96
1798 % @multitable ... @end multitable will make as many columns as desired.
1799 % Contents of each column will wrap at width given in preamble. Width
1800 % can be specified either with sample text given in a template line,
1801 % or in percent of \hsize, the current width of text on page.
1803 % Table can continue over pages but will only break between lines.
1805 % To make preamble:
1807 % Either define widths of columns in terms of percent of \hsize:
1808 % @multitable @columnfractions .25 .3 .45
1809 % @item ...
1811 % Numbers following @columnfractions are the percent of the total
1812 % current hsize to be used for each column. You may use as many
1813 % columns as desired.
1815 % Or use a template:
1816 % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
1817 % @item ...
1818 % using the widest term desired in each column.
1820 % For those who want to use more than one line's worth of words in
1821 % the preamble, break the line within one argument and it
1822 % will parse correctly, i.e.,
1824 % @multitable {Column 1 template} {Column 2 template} {Column 3
1825 % template}
1826 % Not:
1827 % @multitable {Column 1 template} {Column 2 template}
1828 % {Column 3 template}
1830 % Each new table line starts with @item, each subsequent new column
1831 % starts with @tab. Empty columns may be produced by supplying @tab's
1832 % with nothing between them for as many times as empty columns are needed,
1833 % ie, @tab@tab@tab will produce two empty columns.
1835 % @item, @tab, @multicolumn or @endmulticolumn do not need to be on their
1836 % own lines, but it will not hurt if they are.
1838 % Sample multitable:
1840 % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
1841 % @item first col stuff @tab second col stuff @tab third col
1842 % @item
1843 % first col stuff
1844 % @tab
1845 % second col stuff
1846 % @tab
1847 % third col
1848 % @item first col stuff @tab second col stuff
1849 % @tab Many paragraphs of text may be used in any column.
1851 % They will wrap at the width determined by the template.
1852 % @item@tab@tab This will be in third column.
1853 % @end multitable
1855 % Default dimensions may be reset by user.
1856 % @multitableparskip is vertical space between paragraphs in table.
1857 % @multitableparindent is paragraph indent in table.
1858 % @multitablecolmargin is horizontal space to be left between columns.
1859 % @multitablelinespace is space to leave between table items;
1860 % 0 means it depends on current normal line spacing.
1862 %%%%
1863 % Dimensions
1865 \newskip\multitableparskip
1866 \newskip\multitableparindent
1867 \newdimen\multitablecolspace
1868 \newskip\multitablelinespace
1869 \multitableparskip=0pt
1870 \multitableparindent=6pt
1871 \multitablecolspace=12pt
1872 \multitablelinespace=0pt
1874 %%%%
1875 % Macros used to set up halign preamble:
1876 \let\endsetuptable\relax
1877 \def\xendsetuptable{\endsetuptable}
1878 \let\columnfractions\relax
1879 \def\xcolumnfractions{\columnfractions}
1880 \newif\ifsetpercent
1882 %% 2/1/96, to allow fractions to be given with more than one digit.
1883 \def\pickupwholefraction#1 {\global\advance\colcount by1 %
1884 \expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}%
1885 \setuptable}
1887 \newcount\colcount
1888 \def\setuptable#1{\def\firstarg{#1}%
1889 \ifx\firstarg\xendsetuptable\let\go\relax%
1890 \else
1891 \ifx\firstarg\xcolumnfractions\global\setpercenttrue%
1892 \else
1893 \ifsetpercent
1894 \let\go\pickupwholefraction % In this case arg of setuptable
1895 % is the decimal point before the
1896 % number given in percent of hsize.
1897 % We don't need this so we don't use it.
1898 \else
1899 \global\advance\colcount by1
1900 \setbox0=\hbox{#1}%
1901 \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
1902 \fi%
1903 \fi%
1904 \ifx\go\pickupwholefraction\else\let\go\setuptable\fi%
1905 \fi\go}
1907 %%%%
1908 % multitable syntax
1909 \def\tab{&\hskip1sp\relax} % 2/2/96
1910 % tiny skip here makes sure this column space is
1911 % maintained, even if it is never used.
1914 %%%%
1915 % @multitable ... @end multitable definitions:
1917 \def\multitable{\parsearg\dotable}
1919 \def\dotable#1{\bgroup
1920 \let\item\cr
1921 \tolerance=9500
1922 \hbadness=9500
1923 \setmultitablespacing
1924 \parskip=\multitableparskip
1925 \parindent=\multitableparindent
1926 \overfullrule=0pt
1927 \global\colcount=0\relax%
1928 \def\Emultitable{\global\setpercentfalse\global\everycr{}\cr\egroup\egroup}%
1929 % To parse everything between @multitable and @item :
1930 \setuptable#1 \endsetuptable
1931 % Need to reset this to 0 after \setuptable.
1932 \global\colcount=0\relax%
1934 % This preamble sets up a generic column definition, which will
1935 % be used as many times as user calls for columns.
1936 % \vtop will set a single line and will also let text wrap and
1937 % continue for many paragraphs if desired.
1938 \halign\bgroup&\global\advance\colcount by 1\relax%
1939 \vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
1940 % In order to keep entries from bumping into each other
1941 % we will add a \leftskip of \multitablecolspace to all columns after
1942 % the first one.
1943 % If a template has been used, we will add \multitablecolspace
1944 % to the width of each template entry.
1945 % If user has set preamble in terms of percent of \hsize
1946 % we will use that dimension as the width of the column, and
1947 % the \leftskip will keep entries from bumping into each other.
1948 % Table will start at left margin and final column will justify at
1949 % right margin.
1950 \ifnum\colcount=1
1951 \else
1952 \ifsetpercent
1953 \else
1954 % If user has <not> set preamble in terms of percent of \hsize
1955 % we will advance \hsize by \multitablecolspace
1956 \advance\hsize by \multitablecolspace
1958 % In either case we will make \leftskip=\multitablecolspace:
1959 \leftskip=\multitablecolspace
1961 \noindent##%\par
1962 %\vskip\multitablelinespace
1963 }\cr%
1964 % \everycr will reset column counter, \colcount, at the end of
1965 % each line. Every column entry will cause \colcount to advance by one.
1966 % The table preamble
1967 % looks at the current \colcount to find the correct column width.
1968 \global\everycr{\noalign{\nointerlineskip\vskip\multitablelinespace
1969 \filbreak%% keeps underfull box messages off when table breaks over pages.
1970 \global\colcount=0\relax}}}
1972 \def\setmultitablespacing{% test to see if user has set \multitablelinespace.
1973 % If so, do nothing. If not, give it an appropriate dimension based on
1974 % current baselineskip.
1975 \ifdim\multitablelinespace=0pt
1976 \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
1977 \global\advance\multitablelinespace by-\ht0\fi
1978 %% Test to see if parskip is larger than space between lines of
1979 %% table. If not, do nothing.
1980 %% If so, set to same dimension as multitablelinespace.
1981 \ifdim\multitableparskip>\multitablelinespace
1982 \global\multitableparskip=\multitablelinespace
1983 \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
1984 %% than skip between lines in the table.
1985 \fi%
1986 \ifdim\multitableparskip=0pt
1987 \global\multitableparskip=\multitablelinespace
1988 \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
1989 %% than skip between lines in the table.
1990 \fi}
1991 \message{indexing,}
1992 % Index generation facilities
1994 % Define \newwrite to be identical to plain tex's \newwrite
1995 % except not \outer, so it can be used within \newindex.
1996 {\catcode`\@=11
1997 \gdef\newwrite{\alloc@7\write\chardef\sixt@@n}}
1999 % \newindex {foo} defines an index named foo.
2000 % It automatically defines \fooindex such that
2001 % \fooindex ...rest of line... puts an entry in the index foo.
2002 % It also defines \fooindfile to be the number of the output channel for
2003 % the file that accumulates this index. The file's extension is foo.
2004 % The name of an index should be no more than 2 characters long
2005 % for the sake of vms.
2007 \def\newindex #1{
2008 \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
2009 \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
2010 \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
2011 \noexpand\doindex {#1}}
2014 % @defindex foo == \newindex{foo}
2016 \def\defindex{\parsearg\newindex}
2018 % Define @defcodeindex, like @defindex except put all entries in @code.
2020 \def\newcodeindex #1{
2021 \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
2022 \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
2023 \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
2024 \noexpand\docodeindex {#1}}
2027 \def\defcodeindex{\parsearg\newcodeindex}
2029 % @synindex foo bar makes index foo feed into index bar.
2030 % Do this instead of @defindex foo if you don't want it as a separate index.
2031 \def\synindex #1 #2 {%
2032 \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
2033 \expandafter\let\csname#1indfile\endcsname=\synindexfoo
2034 \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
2035 \noexpand\doindex {#2}}%
2038 % @syncodeindex foo bar similar, but put all entries made for index foo
2039 % inside @code.
2040 \def\syncodeindex #1 #2 {%
2041 \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
2042 \expandafter\let\csname#1indfile\endcsname=\synindexfoo
2043 \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
2044 \noexpand\docodeindex {#2}}%
2047 % Define \doindex, the driver for all \fooindex macros.
2048 % Argument #1 is generated by the calling \fooindex macro,
2049 % and it is "foo", the name of the index.
2051 % \doindex just uses \parsearg; it calls \doind for the actual work.
2052 % This is because \doind is more useful to call from other macros.
2054 % There is also \dosubind {index}{topic}{subtopic}
2055 % which makes an entry in a two-level index such as the operation index.
2057 \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
2058 \def\singleindexer #1{\doind{\indexname}{#1}}
2060 % like the previous two, but they put @code around the argument.
2061 \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
2062 \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
2064 \def\indexdummies{%
2065 % Take care of the plain tex accent commands.
2066 \def\"{\realbackslash "}%
2067 \def\`{\realbackslash `}%
2068 \def\'{\realbackslash '}%
2069 \def\^{\realbackslash ^}%
2070 \def\~{\realbackslash ~}%
2071 \def\={\realbackslash =}%
2072 \def\b{\realbackslash b}%
2073 \def\c{\realbackslash c}%
2074 \def\d{\realbackslash d}%
2075 \def\u{\realbackslash u}%
2076 \def\v{\realbackslash v}%
2077 \def\H{\realbackslash H}%
2078 % Take care of the plain tex special European modified letters.
2079 \def\oe{\realbackslash oe}%
2080 \def\ae{\realbackslash ae}%
2081 \def\aa{\realbackslash aa}%
2082 \def\OE{\realbackslash OE}%
2083 \def\AE{\realbackslash AE}%
2084 \def\AA{\realbackslash AA}%
2085 \def\o{\realbackslash o}%
2086 \def\O{\realbackslash O}%
2087 \def\l{\realbackslash l}%
2088 \def\L{\realbackslash L}%
2089 \def\ss{\realbackslash ss}%
2090 % Take care of texinfo commands likely to appear in an index entry.
2091 \def\_{{\realbackslash _}}%
2092 \def\w{\realbackslash w }%
2093 \def\bf{\realbackslash bf }%
2094 \def\rm{\realbackslash rm }%
2095 \def\sl{\realbackslash sl }%
2096 \def\sf{\realbackslash sf}%
2097 \def\tt{\realbackslash tt}%
2098 \def\gtr{\realbackslash gtr}%
2099 \def\less{\realbackslash less}%
2100 \def\hat{\realbackslash hat}%
2101 \def\char{\realbackslash char}%
2102 \def\TeX{\realbackslash TeX}%
2103 \def\dots{\realbackslash dots }%
2104 \def\copyright{\realbackslash copyright }%
2105 \def\tclose##1{\realbackslash tclose {##1}}%
2106 \def\code##1{\realbackslash code {##1}}%
2107 \def\samp##1{\realbackslash samp {##1}}%
2108 \def\t##1{\realbackslash r {##1}}%
2109 \def\r##1{\realbackslash r {##1}}%
2110 \def\i##1{\realbackslash i {##1}}%
2111 \def\b##1{\realbackslash b {##1}}%
2112 \def\cite##1{\realbackslash cite {##1}}%
2113 \def\key##1{\realbackslash key {##1}}%
2114 \def\file##1{\realbackslash file {##1}}%
2115 \def\var##1{\realbackslash var {##1}}%
2116 \def\kbd##1{\realbackslash kbd {##1}}%
2117 \def\dfn##1{\realbackslash dfn {##1}}%
2118 \def\emph##1{\realbackslash emph {##1}}%
2119 \unsepspaces
2122 % If an index command is used in an @example environment, any spaces
2123 % therein should become regular spaces in the raw index file, not the
2124 % expansion of \tie (\\leavevmode \penalty \@M \ ).
2125 {\obeyspaces
2126 \gdef\unsepspaces{\obeyspaces\let =\space}}
2128 % \indexnofonts no-ops all font-change commands.
2129 % This is used when outputting the strings to sort the index by.
2130 \def\indexdummyfont#1{#1}
2131 \def\indexdummytex{TeX}
2132 \def\indexdummydots{...}
2134 \def\indexnofonts{%
2135 % Just ignore accents.
2136 \let\"=\indexdummyfont
2137 \let\`=\indexdummyfont
2138 \let\'=\indexdummyfont
2139 \let\^=\indexdummyfont
2140 \let\~=\indexdummyfont
2141 \let\==\indexdummyfont
2142 \let\b=\indexdummyfont
2143 \let\c=\indexdummyfont
2144 \let\d=\indexdummyfont
2145 \let\u=\indexdummyfont
2146 \let\v=\indexdummyfont
2147 \let\H=\indexdummyfont
2148 % Take care of the plain tex special European modified letters.
2149 \def\oe{oe}%
2150 \def\ae{ae}%
2151 \def\aa{aa}%
2152 \def\OE{OE}%
2153 \def\AE{AE}%
2154 \def\AA{AA}%
2155 \def\o{o}%
2156 \def\O{O}%
2157 \def\l{l}%
2158 \def\L{L}%
2159 \def\ss{ss}%
2160 \let\w=\indexdummyfont
2161 \let\t=\indexdummyfont
2162 \let\r=\indexdummyfont
2163 \let\i=\indexdummyfont
2164 \let\b=\indexdummyfont
2165 \let\emph=\indexdummyfont
2166 \let\strong=\indexdummyfont
2167 \let\cite=\indexdummyfont
2168 \let\sc=\indexdummyfont
2169 %Don't no-op \tt, since it isn't a user-level command
2170 % and is used in the definitions of the active chars like <, >, |...
2171 %\let\tt=\indexdummyfont
2172 \let\tclose=\indexdummyfont
2173 \let\code=\indexdummyfont
2174 \let\file=\indexdummyfont
2175 \let\samp=\indexdummyfont
2176 \let\kbd=\indexdummyfont
2177 \let\key=\indexdummyfont
2178 \let\var=\indexdummyfont
2179 \let\TeX=\indexdummytex
2180 \let\dots=\indexdummydots
2183 % To define \realbackslash, we must make \ not be an escape.
2184 % We must first make another character (@) an escape
2185 % so we do not become unable to do a definition.
2187 {\catcode`\@=0 \catcode`\\=\other
2188 @gdef@realbackslash{\}}
2190 \let\indexbackslash=0 %overridden during \printindex.
2192 \let\SETmarginindex=\relax %initialize!
2193 % workhorse for all \fooindexes
2194 % #1 is name of index, #2 is stuff to put there
2195 \def\doind #1#2{%
2196 % Put the index entry in the margin if desired.
2197 \ifx\SETmarginindex\relax\else%
2198 \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}%
2199 \fi%
2200 {\count10=\lastpenalty %
2201 {\indexdummies % Must do this here, since \bf, etc expand at this stage
2202 \escapechar=`\\%
2203 {\let\folio=0% Expand all macros now EXCEPT \folio
2204 \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
2205 % so it will be output as is; and it will print as backslash in the indx.
2207 % Now process the index-string once, with all font commands turned off,
2208 % to get the string to sort the index by.
2209 {\indexnofonts
2210 \xdef\temp1{#2}%
2212 % Now produce the complete index entry. We process the index-string again,
2213 % this time with font commands expanded, to get what to print in the index.
2214 \edef\temp{%
2215 \write \csname#1indfile\endcsname{%
2216 \realbackslash entry {\temp1}{\folio}{#2}}}%
2217 \temp }%
2218 }\penalty\count10}}
2220 \def\dosubind #1#2#3{%
2221 {\count10=\lastpenalty %
2222 {\indexdummies % Must do this here, since \bf, etc expand at this stage
2223 \escapechar=`\\%
2224 {\let\folio=0%
2225 \def\rawbackslashxx{\indexbackslash}%
2227 % Now process the index-string once, with all font commands turned off,
2228 % to get the string to sort the index by.
2229 {\indexnofonts
2230 \xdef\temp1{#2 #3}%
2232 % Now produce the complete index entry. We process the index-string again,
2233 % this time with font commands expanded, to get what to print in the index.
2234 \edef\temp{%
2235 \write \csname#1indfile\endcsname{%
2236 \realbackslash entry {\temp1}{\folio}{#2}{#3}}}%
2237 \temp }%
2238 }\penalty\count10}}
2240 % The index entry written in the file actually looks like
2241 % \entry {sortstring}{page}{topic}
2242 % or
2243 % \entry {sortstring}{page}{topic}{subtopic}
2244 % The texindex program reads in these files and writes files
2245 % containing these kinds of lines:
2246 % \initial {c}
2247 % before the first topic whose initial is c
2248 % \entry {topic}{pagelist}
2249 % for a topic that is used without subtopics
2250 % \primary {topic}
2251 % for the beginning of a topic that is used with subtopics
2252 % \secondary {subtopic}{pagelist}
2253 % for each subtopic.
2255 % Define the user-accessible indexing commands
2256 % @findex, @vindex, @kindex, @cindex.
2258 \def\findex {\fnindex}
2259 \def\kindex {\kyindex}
2260 \def\cindex {\cpindex}
2261 \def\vindex {\vrindex}
2262 \def\tindex {\tpindex}
2263 \def\pindex {\pgindex}
2265 \def\cindexsub {\begingroup\obeylines\cindexsub}
2266 {\obeylines %
2267 \gdef\cindexsub "#1" #2^^M{\endgroup %
2268 \dosubind{cp}{#2}{#1}}}
2270 % Define the macros used in formatting output of the sorted index material.
2272 % This is what you call to cause a particular index to get printed.
2273 % Write
2274 % @unnumbered Function Index
2275 % @printindex fn
2277 \def\printindex{\parsearg\doprintindex}
2279 \def\doprintindex#1{%
2280 \tex
2281 \dobreak \chapheadingskip {10000}
2282 \catcode`\%=\other\catcode`\&=\other\catcode`\#=\other
2283 \catcode`\$=\other
2284 \catcode`\~=\other
2285 \indexbreaks
2287 % The following don't help, since the chars were translated
2288 % when the raw index was written, and their fonts were discarded
2289 % due to \indexnofonts.
2290 %\catcode`\"=\active
2291 %\catcode`\^=\active
2292 %\catcode`\_=\active
2293 %\catcode`\|=\active
2294 %\catcode`\<=\active
2295 %\catcode`\>=\active
2297 \def\indexbackslash{\rawbackslashxx}
2298 \indexfonts\rm \tolerance=9500 \advance\baselineskip -1pt
2299 \begindoublecolumns
2301 % See if the index file exists and is nonempty.
2302 \openin 1 \jobname.#1s
2303 \ifeof 1
2304 % \enddoublecolumns gets confused if there is no text in the index,
2305 % and it loses the chapter title and the aux file entries for the
2306 % index. The easiest way to prevent this problem is to make sure
2307 % there is some text.
2308 (Index is nonexistent)
2309 \else
2311 % If the index file exists but is empty, then \openin leaves \ifeof
2312 % false. We have to make TeX try to read something from the file, so
2313 % it can discover if there is anything in it.
2314 \read 1 to \temp
2315 \ifeof 1
2316 (Index is empty)
2317 \else
2318 \input \jobname.#1s
2321 \closein 1
2322 \enddoublecolumns
2323 \Etex
2326 % These macros are used by the sorted index file itself.
2327 % Change them to control the appearance of the index.
2329 % Same as \bigskipamount except no shrink.
2330 % \balancecolumns gets confused if there is any shrink.
2331 \newskip\initialskipamount \initialskipamount 12pt plus4pt
2333 \def\initial #1{%
2334 {\let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
2335 \ifdim\lastskip<\initialskipamount
2336 \removelastskip \penalty-200 \vskip \initialskipamount\fi
2337 \line{\secbf#1\hfill}\kern 2pt\penalty10000}}
2339 % This typesets a paragraph consisting of #1, dot leaders, and then #2
2340 % flush to the right margin. It is used for index and table of contents
2341 % entries. The paragraph is indented by \leftskip.
2343 \def\entry #1#2{\begingroup
2345 % Start a new paragraph if necessary, so our assignments below can't
2346 % affect previous text.
2347 \par
2349 % Do not fill out the last line with white space.
2350 \parfillskip = 0in
2352 % No extra space above this paragraph.
2353 \parskip = 0in
2355 % Do not prefer a separate line ending with a hyphen to fewer lines.
2356 \finalhyphendemerits = 0
2358 % \hangindent is only relevant when the entry text and page number
2359 % don't both fit on one line. In that case, bob suggests starting the
2360 % dots pretty far over on the line. Unfortunately, a large
2361 % indentation looks wrong when the entry text itself is broken across
2362 % lines. So we use a small indentation and put up with long leaders.
2364 % \hangafter is reset to 1 (which is the value we want) at the start
2365 % of each paragraph, so we need not do anything with that.
2366 \hangindent=2em
2368 % When the entry text needs to be broken, just fill out the first line
2369 % with blank space.
2370 \rightskip = 0pt plus1fil
2372 % Start a ``paragraph'' for the index entry so the line breaking
2373 % parameters we've set above will have an effect.
2374 \noindent
2376 % Insert the text of the index entry. TeX will do line-breaking on it.
2378 % The following is kludged to not output a line of dots in the index if
2379 % there are no page numbers. The next person who breaks this will be
2380 % cursed by a Unix daemon.
2381 \def\tempa{{\rm }}%
2382 \def\tempb{#2}%
2383 \edef\tempc{\tempa}%
2384 \edef\tempd{\tempb}%
2385 \ifx\tempc\tempd\ \else%
2387 % If we must, put the page number on a line of its own, and fill out
2388 % this line with blank space. (The \hfil is overwhelmed with the
2389 % fill leaders glue in \indexdotfill if the page number does fit.)
2390 \hfil\penalty50
2391 \null\nobreak\indexdotfill % Have leaders before the page number.
2393 % The `\ ' here is removed by the implicit \unskip that TeX does as
2394 % part of (the primitive) \par. Without it, a spurious underfull
2395 % \hbox ensues.
2396 \ #2% The page number ends the paragraph.
2397 \fi%
2398 \par
2399 \endgroup}
2401 % Like \dotfill except takes at least 1 em.
2402 \def\indexdotfill{\cleaders
2403 \hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \mkern1.5mu$}\hskip 1em plus 1fill}
2405 \def\primary #1{\line{#1\hfil}}
2407 \newskip\secondaryindent \secondaryindent=0.5cm
2409 \def\secondary #1#2{
2410 {\parfillskip=0in \parskip=0in
2411 \hangindent =1in \hangafter=1
2412 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par
2415 %% Define two-column mode, which is used in indexes.
2416 %% Adapted from the TeXbook, page 416.
2417 \catcode `\@=11
2419 \newbox\partialpage
2421 \newdimen\doublecolumnhsize
2423 \def\begindoublecolumns{\begingroup
2424 % Grab any single-column material above us.
2425 \output = {\global\setbox\partialpage
2426 =\vbox{\unvbox255\kern -\topskip \kern \baselineskip}}%
2427 \eject
2429 % Now switch to the double-column output routine.
2430 \output={\doublecolumnout}%
2432 % Change the page size parameters. We could do this once outside this
2433 % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
2434 % format, but then we repeat the same computation. Repeating a couple
2435 % of assignments once per index is clearly meaningless for the
2436 % execution time, so we may as well do it once.
2438 % First we halve the line length, less a little for the gutter between
2439 % the columns. We compute the gutter based on the line length, so it
2440 % changes automatically with the paper format. The magic constant
2441 % below is chosen so that the gutter has the same value (well, +- <
2442 % 1pt) as it did when we hard-coded it.
2444 % We put the result in a separate register, \doublecolumhsize, so we
2445 % can restore it in \pagesofar, after \hsize itself has (potentially)
2446 % been clobbered.
2448 \doublecolumnhsize = \hsize
2449 \advance\doublecolumnhsize by -.04154\hsize
2450 \divide\doublecolumnhsize by 2
2451 \hsize = \doublecolumnhsize
2453 % Double the \vsize as well. (We don't need a separate register here,
2454 % since nobody clobbers \vsize.)
2455 \vsize = 2\vsize
2456 \doublecolumnpagegoal
2459 \def\enddoublecolumns{\eject \endgroup \pagegoal=\vsize \unvbox\partialpage}
2461 \def\doublecolumnsplit{\splittopskip=\topskip \splitmaxdepth=\maxdepth
2462 \global\dimen@=\pageheight \global\advance\dimen@ by-\ht\partialpage
2463 \global\setbox1=\vsplit255 to\dimen@ \global\setbox0=\vbox{\unvbox1}
2464 \global\setbox3=\vsplit255 to\dimen@ \global\setbox2=\vbox{\unvbox3}
2465 \ifdim\ht0>\dimen@ \setbox255=\vbox{\unvbox0\unvbox2} \global\setbox255=\copy5 \fi
2466 \ifdim\ht2>\dimen@ \setbox255=\vbox{\unvbox0\unvbox2} \global\setbox255=\copy5 \fi
2468 \def\doublecolumnpagegoal{%
2469 \dimen@=\vsize \advance\dimen@ by-2\ht\partialpage \global\pagegoal=\dimen@
2471 \def\pagesofar{\unvbox\partialpage %
2472 \hsize=\doublecolumnhsize % have to restore this since output routine
2473 \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}}
2474 \def\doublecolumnout{%
2475 \setbox5=\copy255
2476 {\vbadness=10000 \doublecolumnsplit}
2477 \ifvbox255
2478 \setbox0=\vtop to\dimen@{\unvbox0}
2479 \setbox2=\vtop to\dimen@{\unvbox2}
2480 \onepageout\pagesofar \unvbox255 \penalty\outputpenalty
2481 \else
2482 \setbox0=\vbox{\unvbox5}
2483 \ifvbox0
2484 \dimen@=\ht0 \advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip
2485 \divide\dimen@ by2 \splittopskip=\topskip \splitmaxdepth=\maxdepth
2486 {\vbadness=10000
2487 \loop \global\setbox5=\copy0
2488 \setbox1=\vsplit5 to\dimen@
2489 \setbox3=\vsplit5 to\dimen@
2490 \ifvbox5 \global\advance\dimen@ by1pt \repeat
2491 \setbox0=\vbox to\dimen@{\unvbox1}
2492 \setbox2=\vbox to\dimen@{\unvbox3}
2493 \global\setbox\partialpage=\vbox{\pagesofar}
2494 \doublecolumnpagegoal
2500 \catcode `\@=\other
2501 \message{sectioning,}
2502 % Define chapters, sections, etc.
2504 \newcount \chapno
2505 \newcount \secno \secno=0
2506 \newcount \subsecno \subsecno=0
2507 \newcount \subsubsecno \subsubsecno=0
2509 % This counter is funny since it counts through charcodes of letters A, B, ...
2510 \newcount \appendixno \appendixno = `\@
2511 \def\appendixletter{\char\the\appendixno}
2513 \newwrite \contentsfile
2514 % This is called from \setfilename.
2515 \def\opencontents{\openout \contentsfile = \jobname.toc}
2517 % Each @chapter defines this as the name of the chapter.
2518 % page headings and footings can use it. @section does likewise
2520 \def\thischapter{} \def\thissection{}
2521 \def\seccheck#1{\if \pageno<0 %
2522 \errmessage{@#1 not allowed after generating table of contents}\fi
2526 \def\chapternofonts{%
2527 \let\rawbackslash=\relax%
2528 \let\frenchspacing=\relax%
2529 \def\result{\realbackslash result}
2530 \def\equiv{\realbackslash equiv}
2531 \def\expansion{\realbackslash expansion}
2532 \def\print{\realbackslash print}
2533 \def\TeX{\realbackslash TeX}
2534 \def\dots{\realbackslash dots}
2535 \def\copyright{\realbackslash copyright}
2536 \def\tt{\realbackslash tt}
2537 \def\bf{\realbackslash bf }
2538 \def\w{\realbackslash w}
2539 \def\less{\realbackslash less}
2540 \def\gtr{\realbackslash gtr}
2541 \def\hat{\realbackslash hat}
2542 \def\char{\realbackslash char}
2543 \def\tclose##1{\realbackslash tclose {##1}}
2544 \def\code##1{\realbackslash code {##1}}
2545 \def\samp##1{\realbackslash samp {##1}}
2546 \def\r##1{\realbackslash r {##1}}
2547 \def\b##1{\realbackslash b {##1}}
2548 \def\key##1{\realbackslash key {##1}}
2549 \def\file##1{\realbackslash file {##1}}
2550 \def\kbd##1{\realbackslash kbd {##1}}
2551 % These are redefined because @smartitalic wouldn't work inside xdef.
2552 \def\i##1{\realbackslash i {##1}}
2553 \def\cite##1{\realbackslash cite {##1}}
2554 \def\var##1{\realbackslash var {##1}}
2555 \def\emph##1{\realbackslash emph {##1}}
2556 \def\dfn##1{\realbackslash dfn {##1}}
2559 \newcount\absseclevel % used to calculate proper heading level
2560 \newcount\secbase\secbase=0 % @raise/lowersections modify this count
2562 % @raisesections: treat @section as chapter, @subsection as section, etc.
2563 \def\raisesections{\global\advance\secbase by -1}
2564 \let\up=\raisesections % original BFox name
2566 % @lowersections: treat @chapter as section, @section as subsection, etc.
2567 \def\lowersections{\global\advance\secbase by 1}
2568 \let\down=\lowersections % original BFox name
2570 % Choose a numbered-heading macro
2571 % #1 is heading level if unmodified by @raisesections or @lowersections
2572 % #2 is text for heading
2573 \def\numhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
2574 \ifcase\absseclevel
2575 \chapterzzz{#2}
2577 \seczzz{#2}
2579 \numberedsubseczzz{#2}
2581 \numberedsubsubseczzz{#2}
2582 \else
2583 \ifnum \absseclevel<0
2584 \chapterzzz{#2}
2585 \else
2586 \numberedsubsubseczzz{#2}
2591 % like \numhead, but chooses appendix heading levels
2592 \def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
2593 \ifcase\absseclevel
2594 \appendixzzz{#2}
2596 \appendixsectionzzz{#2}
2598 \appendixsubseczzz{#2}
2600 \appendixsubsubseczzz{#2}
2601 \else
2602 \ifnum \absseclevel<0
2603 \appendixzzz{#2}
2604 \else
2605 \appendixsubsubseczzz{#2}
2610 % like \numhead, but chooses numberless heading levels
2611 \def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
2612 \ifcase\absseclevel
2613 \unnumberedzzz{#2}
2615 \unnumberedseczzz{#2}
2617 \unnumberedsubseczzz{#2}
2619 \unnumberedsubsubseczzz{#2}
2620 \else
2621 \ifnum \absseclevel<0
2622 \unnumberedzzz{#2}
2623 \else
2624 \unnumberedsubsubseczzz{#2}
2630 \def\thischaptername{No Chapter Title}
2631 \outer\def\chapter{\parsearg\chapteryyy}
2632 \def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz
2633 \def\chapterzzz #1{\seccheck{chapter}%
2634 \secno=0 \subsecno=0 \subsubsecno=0
2635 \global\advance \chapno by 1 \message{\putwordChapter \the\chapno}%
2636 \chapmacro {#1}{\the\chapno}%
2637 \gdef\thissection{#1}%
2638 \gdef\thischaptername{#1}%
2639 % We don't substitute the actual chapter name into \thischapter
2640 % because we don't want its macros evaluated now.
2641 \xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}%
2642 {\chapternofonts%
2643 \edef\temp{{\realbackslash chapentry {#1}{\the\chapno}{\noexpand\folio}}}%
2644 \escapechar=`\\%
2645 \write \contentsfile \temp %
2646 \donoderef %
2647 \global\let\section = \numberedsec
2648 \global\let\subsection = \numberedsubsec
2649 \global\let\subsubsection = \numberedsubsubsec
2652 \outer\def\appendix{\parsearg\appendixyyy}
2653 \def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz
2654 \def\appendixzzz #1{\seccheck{appendix}%
2655 \secno=0 \subsecno=0 \subsubsecno=0
2656 \global\advance \appendixno by 1 \message{Appendix \appendixletter}%
2657 \chapmacro {#1}{\putwordAppendix{} \appendixletter}%
2658 \gdef\thissection{#1}%
2659 \gdef\thischaptername{#1}%
2660 \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
2661 {\chapternofonts%
2662 \edef\temp{{\realbackslash chapentry
2663 {#1}{\putwordAppendix{} \appendixletter}{\noexpand\folio}}}%
2664 \escapechar=`\\%
2665 \write \contentsfile \temp %
2666 \appendixnoderef %
2667 \global\let\section = \appendixsec
2668 \global\let\subsection = \appendixsubsec
2669 \global\let\subsubsection = \appendixsubsubsec
2672 \outer\def\top{\parsearg\unnumberedyyy}
2673 \outer\def\unnumbered{\parsearg\unnumberedyyy}
2674 \def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
2675 \def\unnumberedzzz #1{\seccheck{unnumbered}%
2676 \secno=0 \subsecno=0 \subsubsecno=0
2678 % This used to be simply \message{#1}, but TeX fully expands the
2679 % argument to \message. Therefore, if #1 contained @-commands, TeX
2680 % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
2681 % expanded @cite (which turns out to cause errors because \cite is meant
2682 % to be executed, not expanded).
2684 % Anyway, we don't want the fully-expanded definition of @cite to appear
2685 % as a result of the \message, we just want `@cite' itself. We use
2686 % \the<toks register> to achieve this: TeX expands \the<toks> only once,
2687 % simply yielding the contents of the <toks register>.
2688 \toks0 = {#1}\message{(\the\toks0)}%
2690 \unnumbchapmacro {#1}%
2691 \gdef\thischapter{#1}\gdef\thissection{#1}%
2692 {\chapternofonts%
2693 \edef\temp{{\realbackslash unnumbchapentry {#1}{\noexpand\folio}}}%
2694 \escapechar=`\\%
2695 \write \contentsfile \temp %
2696 \unnumbnoderef %
2697 \global\let\section = \unnumberedsec
2698 \global\let\subsection = \unnumberedsubsec
2699 \global\let\subsubsection = \unnumberedsubsubsec
2702 \outer\def\numberedsec{\parsearg\secyyy}
2703 \def\secyyy #1{\numhead1{#1}} % normally calls seczzz
2704 \def\seczzz #1{\seccheck{section}%
2705 \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
2706 \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
2707 {\chapternofonts%
2708 \edef\temp{{\realbackslash secentry %
2709 {#1}{\the\chapno}{\the\secno}{\noexpand\folio}}}%
2710 \escapechar=`\\%
2711 \write \contentsfile \temp %
2712 \donoderef %
2713 \penalty 10000 %
2716 \outer\def\appendixsection{\parsearg\appendixsecyyy}
2717 \outer\def\appendixsec{\parsearg\appendixsecyyy}
2718 \def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz
2719 \def\appendixsectionzzz #1{\seccheck{appendixsection}%
2720 \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
2721 \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
2722 {\chapternofonts%
2723 \edef\temp{{\realbackslash secentry %
2724 {#1}{\appendixletter}{\the\secno}{\noexpand\folio}}}%
2725 \escapechar=`\\%
2726 \write \contentsfile \temp %
2727 \appendixnoderef %
2728 \penalty 10000 %
2731 \outer\def\unnumberedsec{\parsearg\unnumberedsecyyy}
2732 \def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz
2733 \def\unnumberedseczzz #1{\seccheck{unnumberedsec}%
2734 \plainsecheading {#1}\gdef\thissection{#1}%
2735 {\chapternofonts%
2736 \edef\temp{{\realbackslash unnumbsecentry{#1}{\noexpand\folio}}}%
2737 \escapechar=`\\%
2738 \write \contentsfile \temp %
2739 \unnumbnoderef %
2740 \penalty 10000 %
2743 \outer\def\numberedsubsec{\parsearg\numberedsubsecyyy}
2744 \def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz
2745 \def\numberedsubseczzz #1{\seccheck{subsection}%
2746 \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
2747 \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
2748 {\chapternofonts%
2749 \edef\temp{{\realbackslash subsecentry %
2750 {#1}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
2751 \escapechar=`\\%
2752 \write \contentsfile \temp %
2753 \donoderef %
2754 \penalty 10000 %
2757 \outer\def\appendixsubsec{\parsearg\appendixsubsecyyy}
2758 \def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz
2759 \def\appendixsubseczzz #1{\seccheck{appendixsubsec}%
2760 \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
2761 \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
2762 {\chapternofonts%
2763 \edef\temp{{\realbackslash subsecentry %
2764 {#1}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
2765 \escapechar=`\\%
2766 \write \contentsfile \temp %
2767 \appendixnoderef %
2768 \penalty 10000 %
2771 \outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy}
2772 \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
2773 \def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}%
2774 \plainsecheading {#1}\gdef\thissection{#1}%
2775 {\chapternofonts%
2776 \edef\temp{{\realbackslash unnumbsubsecentry{#1}{\noexpand\folio}}}%
2777 \escapechar=`\\%
2778 \write \contentsfile \temp %
2779 \unnumbnoderef %
2780 \penalty 10000 %
2783 \outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy}
2784 \def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz
2785 \def\numberedsubsubseczzz #1{\seccheck{subsubsection}%
2786 \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
2787 \subsubsecheading {#1}
2788 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
2789 {\chapternofonts%
2790 \edef\temp{{\realbackslash subsubsecentry %
2791 {#1}
2792 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}
2793 {\noexpand\folio}}}%
2794 \escapechar=`\\%
2795 \write \contentsfile \temp %
2796 \donoderef %
2797 \penalty 10000 %
2800 \outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy}
2801 \def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz
2802 \def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec}%
2803 \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
2804 \subsubsecheading {#1}
2805 {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
2806 {\chapternofonts%
2807 \edef\temp{{\realbackslash subsubsecentry{#1}%
2808 {\appendixletter}
2809 {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}%
2810 \escapechar=`\\%
2811 \write \contentsfile \temp %
2812 \appendixnoderef %
2813 \penalty 10000 %
2816 \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy}
2817 \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
2818 \def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}%
2819 \plainsecheading {#1}\gdef\thissection{#1}%
2820 {\chapternofonts%
2821 \edef\temp{{\realbackslash unnumbsubsubsecentry{#1}{\noexpand\folio}}}%
2822 \escapechar=`\\%
2823 \write \contentsfile \temp %
2824 \unnumbnoderef %
2825 \penalty 10000 %
2828 % These are variants which are not "outer", so they can appear in @ifinfo.
2829 % Actually, they should now be obsolete; ordinary section commands should work.
2830 \def\infotop{\parsearg\unnumberedzzz}
2831 \def\infounnumbered{\parsearg\unnumberedzzz}
2832 \def\infounnumberedsec{\parsearg\unnumberedseczzz}
2833 \def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz}
2834 \def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
2836 \def\infoappendix{\parsearg\appendixzzz}
2837 \def\infoappendixsec{\parsearg\appendixseczzz}
2838 \def\infoappendixsubsec{\parsearg\appendixsubseczzz}
2839 \def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz}
2841 \def\infochapter{\parsearg\chapterzzz}
2842 \def\infosection{\parsearg\sectionzzz}
2843 \def\infosubsection{\parsearg\subsectionzzz}
2844 \def\infosubsubsection{\parsearg\subsubsectionzzz}
2846 % These macros control what the section commands do, according
2847 % to what kind of chapter we are in (ordinary, appendix, or unnumbered).
2848 % Define them by default for a numbered chapter.
2849 \global\let\section = \numberedsec
2850 \global\let\subsection = \numberedsubsec
2851 \global\let\subsubsection = \numberedsubsubsec
2853 % Define @majorheading, @heading and @subheading
2855 % NOTE on use of \vbox for chapter headings, section headings, and
2856 % such:
2857 % 1) We use \vbox rather than the earlier \line to permit
2858 % overlong headings to fold.
2859 % 2) \hyphenpenalty is set to 10000 because hyphenation in a
2860 % heading is obnoxious; this forbids it.
2861 % 3) Likewise, headings look best if no \parindent is used, and
2862 % if justification is not attempted. Hence \raggedright.
2865 \def\majorheading{\parsearg\majorheadingzzz}
2866 \def\majorheadingzzz #1{%
2867 {\advance\chapheadingskip by 10pt \chapbreak }%
2868 {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
2869 \parindent=0pt\raggedright
2870 \rm #1\hfill}}\bigskip \par\penalty 200}
2872 \def\chapheading{\parsearg\chapheadingzzz}
2873 \def\chapheadingzzz #1{\chapbreak %
2874 {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
2875 \parindent=0pt\raggedright
2876 \rm #1\hfill}}\bigskip \par\penalty 200}
2878 \def\heading{\parsearg\secheadingi}
2880 \def\subheading{\parsearg\subsecheadingi}
2882 \def\subsubheading{\parsearg\subsubsecheadingi}
2884 % These macros generate a chapter, section, etc. heading only
2885 % (including whitespace, linebreaking, etc. around it),
2886 % given all the information in convenient, parsed form.
2888 %%% Args are the skip and penalty (usually negative)
2889 \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
2891 \def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
2893 %%% Define plain chapter starts, and page on/off switching for it
2894 % Parameter controlling skip before chapter headings (if needed)
2896 \newskip \chapheadingskip \chapheadingskip = 30pt plus 8pt minus 4pt
2898 \def\chapbreak{\dobreak \chapheadingskip {-4000}}
2899 \def\chappager{\par\vfill\supereject}
2900 \def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi}
2902 \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
2904 \def\CHAPPAGoff{
2905 \global\let\pchapsepmacro=\chapbreak
2906 \global\let\pagealignmacro=\chappager}
2908 \def\CHAPPAGon{
2909 \global\let\pchapsepmacro=\chappager
2910 \global\let\pagealignmacro=\chappager
2911 \global\def\HEADINGSon{\HEADINGSsingle}}
2913 \def\CHAPPAGodd{
2914 \global\let\pchapsepmacro=\chapoddpage
2915 \global\let\pagealignmacro=\chapoddpage
2916 \global\def\HEADINGSon{\HEADINGSdouble}}
2918 \CHAPPAGon
2920 \def\CHAPFplain{
2921 \global\let\chapmacro=\chfplain
2922 \global\let\unnumbchapmacro=\unnchfplain}
2924 \def\chfplain #1#2{%
2925 \pchapsepmacro
2927 \chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
2928 \parindent=0pt\raggedright
2929 \rm #2\enspace #1}%
2931 \bigskip
2932 \penalty5000
2935 \def\unnchfplain #1{%
2936 \pchapsepmacro %
2937 {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
2938 \parindent=0pt\raggedright
2939 \rm #1\hfill}}\bigskip \par\penalty 10000 %
2941 \CHAPFplain % The default
2943 \def\unnchfopen #1{%
2944 \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
2945 \parindent=0pt\raggedright
2946 \rm #1\hfill}}\bigskip \par\penalty 10000 %
2949 \def\chfopen #1#2{\chapoddpage {\chapfonts
2950 \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
2951 \par\penalty 5000 %
2954 \def\CHAPFopen{
2955 \global\let\chapmacro=\chfopen
2956 \global\let\unnumbchapmacro=\unnchfopen}
2958 % Parameter controlling skip before section headings.
2960 \newskip \subsecheadingskip \subsecheadingskip = 17pt plus 8pt minus 4pt
2961 \def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}}
2963 \newskip \secheadingskip \secheadingskip = 21pt plus 8pt minus 4pt
2964 \def\secheadingbreak{\dobreak \secheadingskip {-1000}}
2966 % @paragraphindent is defined for the Info formatting commands only.
2967 \let\paragraphindent=\comment
2969 % Section fonts are the base font at magstep2, which produces
2970 % a size a bit more than 14 points in the default situation.
2972 \def\secheading #1#2#3{\secheadingi {#2.#3\enspace #1}}
2973 \def\plainsecheading #1{\secheadingi {#1}}
2974 \def\secheadingi #1{{\advance \secheadingskip by \parskip %
2975 \secheadingbreak}%
2976 {\secfonts \vbox{\hyphenpenalty=10000\tolerance=5000
2977 \parindent=0pt\raggedright
2978 \rm #1\hfill}}%
2979 \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 }
2982 % Subsection fonts are the base font at magstep1,
2983 % which produces a size of 12 points.
2985 \def\subsecheading #1#2#3#4{\subsecheadingi {#2.#3.#4\enspace #1}}
2986 \def\subsecheadingi #1{{\advance \subsecheadingskip by \parskip %
2987 \subsecheadingbreak}%
2988 {\subsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000
2989 \parindent=0pt\raggedright
2990 \rm #1\hfill}}%
2991 \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 }
2993 \def\subsubsecfonts{\subsecfonts} % Maybe this should change:
2994 % Perhaps make sssec fonts scaled
2995 % magstep half
2996 \def\subsubsecheading #1#2#3#4#5{\subsubsecheadingi {#2.#3.#4.#5\enspace #1}}
2997 \def\subsubsecheadingi #1{{\advance \subsecheadingskip by \parskip %
2998 \subsecheadingbreak}%
2999 {\subsubsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000
3000 \parindent=0pt\raggedright
3001 \rm #1\hfill}}%
3002 \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000}
3005 \message{toc printing,}
3007 % Finish up the main text and prepare to read what we've written
3008 % to \contentsfile.
3010 \newskip\contentsrightmargin \contentsrightmargin=1in
3011 \def\startcontents#1{%
3012 \pagealignmacro
3013 \immediate\closeout \contentsfile
3014 \ifnum \pageno>0
3015 \pageno = -1 % Request roman numbered pages.
3017 % Don't need to put `Contents' or `Short Contents' in the headline.
3018 % It is abundantly clear what they are.
3019 \unnumbchapmacro{#1}\def\thischapter{}%
3020 \begingroup % Set up to handle contents files properly.
3021 \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11
3022 \catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
3023 \raggedbottom % Worry more about breakpoints than the bottom.
3024 \advance\hsize by -\contentsrightmargin % Don't use the full line length.
3028 % Normal (long) toc.
3029 \outer\def\contents{%
3030 \startcontents{\putwordTableofContents}%
3031 \input \jobname.toc
3032 \endgroup
3033 \vfill \eject
3036 % And just the chapters.
3037 \outer\def\summarycontents{%
3038 \startcontents{\putwordShortContents}%
3040 \let\chapentry = \shortchapentry
3041 \let\unnumbchapentry = \shortunnumberedentry
3042 % We want a true roman here for the page numbers.
3043 \secfonts
3044 \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl
3046 \advance\baselineskip by 1pt % Open it up a little.
3047 \def\secentry ##1##2##3##4{}
3048 \def\unnumbsecentry ##1##2{}
3049 \def\subsecentry ##1##2##3##4##5{}
3050 \def\unnumbsubsecentry ##1##2{}
3051 \def\subsubsecentry ##1##2##3##4##5##6{}
3052 \def\unnumbsubsubsecentry ##1##2{}
3053 \input \jobname.toc
3054 \endgroup
3055 \vfill \eject
3057 \let\shortcontents = \summarycontents
3059 % These macros generate individual entries in the table of contents.
3060 % The first argument is the chapter or section name.
3061 % The last argument is the page number.
3062 % The arguments in between are the chapter number, section number, ...
3064 % Chapter-level things, for both the long and short contents.
3065 \def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}
3067 % See comments in \dochapentry re vbox and related settings
3068 \def\shortchapentry#1#2#3{%
3069 \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno{#3}}%
3072 % Typeset the label for a chapter or appendix for the short contents.
3073 % The arg is, e.g. `Appendix A' for an appendix, or `3' for a chapter.
3074 % We could simplify the code here by writing out an \appendixentry
3075 % command in the toc file for appendices, instead of using \chapentry
3076 % for both, but it doesn't seem worth it.
3077 \setbox0 = \hbox{\shortcontrm \putwordAppendix }
3078 \newdimen\shortappendixwidth \shortappendixwidth = \wd0
3080 \def\shortchaplabel#1{%
3081 % We typeset #1 in a box of constant width, regardless of the text of
3082 % #1, so the chapter titles will come out aligned.
3083 \setbox0 = \hbox{#1}%
3084 \dimen0 = \ifdim\wd0 > \shortappendixwidth \shortappendixwidth \else 0pt \fi
3086 % This space should be plenty, since a single number is .5em, and the
3087 % widest letter (M) is 1em, at least in the Computer Modern fonts.
3088 % (This space doesn't include the extra space that gets added after
3089 % the label; that gets put in in \shortchapentry above.)
3090 \advance\dimen0 by 1.1em
3091 \hbox to \dimen0{#1\hfil}%
3094 \def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
3095 \def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno{#2}}}
3097 % Sections.
3098 \def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}}
3099 \def\unnumbsecentry#1#2{\dosecentry{#1}{#2}}
3101 % Subsections.
3102 \def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}}
3103 \def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}}
3105 % And subsubsections.
3106 \def\subsubsecentry#1#2#3#4#5#6{%
3107 \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}}
3108 \def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}}
3111 % This parameter controls the indentation of the various levels.
3112 \newdimen\tocindent \tocindent = 3pc
3114 % Now for the actual typesetting. In all these, #1 is the text and #2 is the
3115 % page number.
3117 % If the toc has to be broken over pages, we would want to be at chapters
3118 % if at all possible; hence the \penalty.
3119 \def\dochapentry#1#2{%
3120 \penalty-300 \vskip\baselineskip
3121 \begingroup
3122 \chapentryfonts
3123 \tocentry{#1}{\dopageno{#2}}%
3124 \endgroup
3125 \nobreak\vskip .25\baselineskip
3128 \def\dosecentry#1#2{\begingroup
3129 \secentryfonts \leftskip=\tocindent
3130 \tocentry{#1}{\dopageno{#2}}%
3131 \endgroup}
3133 \def\dosubsecentry#1#2{\begingroup
3134 \subsecentryfonts \leftskip=2\tocindent
3135 \tocentry{#1}{\dopageno{#2}}%
3136 \endgroup}
3138 \def\dosubsubsecentry#1#2{\begingroup
3139 \subsubsecentryfonts \leftskip=3\tocindent
3140 \tocentry{#1}{\dopageno{#2}}%
3141 \endgroup}
3143 % Final typesetting of a toc entry; we use the same \entry macro as for
3144 % the index entries, but we want to suppress hyphenation here. (We
3145 % can't do that in the \entry macro, since index entries might consist
3146 % of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.)
3148 % \turnoffactive is for the sake of @" used for umlauts.
3149 \def\tocentry#1#2{\begingroup
3150 \hyphenpenalty = 10000
3151 \entry{\turnoffactive #1}{\turnoffactive #2}%
3152 \endgroup}
3154 % Space between chapter (or whatever) number and the title.
3155 \def\labelspace{\hskip1em \relax}
3157 \def\dopageno#1{{\rm #1}}
3158 \def\doshortpageno#1{{\rm #1}}
3160 \def\chapentryfonts{\secfonts \rm}
3161 \def\secentryfonts{\textfonts}
3162 \let\subsecentryfonts = \textfonts
3163 \let\subsubsecentryfonts = \textfonts
3166 \message{environments,}
3168 % Since these characters are used in examples, it should be an even number of
3169 % \tt widths. Each \tt character is 1en, so two makes it 1em.
3170 % Furthermore, these definitions must come after we define our fonts.
3171 \newbox\dblarrowbox \newbox\longdblarrowbox
3172 \newbox\pushcharbox \newbox\bullbox
3173 \newbox\equivbox \newbox\errorbox
3175 \let\ptexequiv = \equiv
3177 %{\tentt
3178 %\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil}
3179 %\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil}
3180 %\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil}
3181 %\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil}
3182 % Adapted from the manmac format (p.420 of TeXbook)
3183 %\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex
3184 % depth .1ex\hfil}
3187 \def\point{$\star$}
3189 \def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
3190 \def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}}
3191 \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
3193 \def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}}
3195 % Adapted from the TeXbook's \boxit.
3196 {\tentt \global\dimen0 = 3em}% Width of the box.
3197 \dimen2 = .55pt % Thickness of rules
3198 % The text. (`r' is open on the right, `e' somewhat less so on the left.)
3199 \setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt}
3201 \global\setbox\errorbox=\hbox to \dimen0{\hfil
3202 \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
3203 \advance\hsize by -2\dimen2 % Rules.
3204 \vbox{
3205 \hrule height\dimen2
3206 \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
3207 \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
3208 \kern3pt\vrule width\dimen2}% Space to right.
3209 \hrule height\dimen2}
3210 \hfil}
3212 % The @error{} command.
3213 \def\error{\leavevmode\lower.7ex\copy\errorbox}
3215 % @tex ... @end tex escapes into raw Tex temporarily.
3216 % One exception: @ is still an escape character, so that @end tex works.
3217 % But \@ or @@ will get a plain tex @ character.
3219 \def\tex{\begingroup
3220 \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
3221 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
3222 \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
3223 \catcode `\%=14
3224 \catcode 43=12
3225 \catcode`\"=12
3226 \catcode`\==12
3227 \catcode`\|=12
3228 \catcode`\<=12
3229 \catcode`\>=12
3230 \escapechar=`\\
3232 \let\~=\ptextilde
3233 \let\{=\ptexlbrace
3234 \let\}=\ptexrbrace
3235 \let\.=\ptexdot
3236 \let\*=\ptexstar
3237 \let\dots=\ptexdots
3238 \def\@{@}%
3239 \let\bullet=\ptexbullet
3240 \let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext \let\l=\ptexl
3241 \let\L=\ptexL
3243 \let\Etex=\endgroup}
3245 % Define @lisp ... @endlisp.
3246 % @lisp does a \begingroup so it can rebind things,
3247 % including the definition of @endlisp (which normally is erroneous).
3249 % Amount to narrow the margins by for @lisp.
3250 \newskip\lispnarrowing \lispnarrowing=0.4in
3252 % This is the definition that ^^M gets inside @lisp, @example, and other
3253 % such environments. \null is better than a space, since it doesn't
3254 % have any width.
3255 \def\lisppar{\null\endgraf}
3257 % Make each space character in the input produce a normal interword
3258 % space in the output. Don't allow a line break at this space, as this
3259 % is used only in environments like @example, where each line of input
3260 % should produce a line of output anyway.
3262 {\obeyspaces %
3263 \gdef\sepspaces{\obeyspaces\let =\tie}}
3265 % Define \obeyedspace to be our active space, whatever it is. This is
3266 % for use in \parsearg.
3267 {\sepspaces%
3268 \global\let\obeyedspace= }
3270 % This space is always present above and below environments.
3271 \newskip\envskipamount \envskipamount = 0pt
3273 % Make spacing and below environment symmetrical. We use \parskip here
3274 % to help in doing that, since in @example-like environments \parskip
3275 % is reset to zero; thus the \afterenvbreak inserts no space -- but the
3276 % start of the next paragraph will insert \parskip
3278 \def\aboveenvbreak{{\advance\envskipamount by \parskip
3279 \endgraf \ifdim\lastskip<\envskipamount
3280 \removelastskip \penalty-50 \vskip\envskipamount \fi}}
3282 \let\afterenvbreak = \aboveenvbreak
3284 % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins.
3285 \let\nonarrowing=\relax
3287 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3288 % \cartouche: draw rectangle w/rounded corners around argument
3289 \font\circle=lcircle10
3290 \newdimen\circthick
3291 \newdimen\cartouter\newdimen\cartinner
3292 \newskip\normbskip\newskip\normpskip\newskip\normlskip
3293 \circthick=\fontdimen8\circle
3295 \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
3296 \def\ctr{{\hskip 6pt\circle\char'010}}
3297 \def\cbl{{\circle\char'012\hskip -6pt}}
3298 \def\cbr{{\hskip 6pt\circle\char'011}}
3299 \def\carttop{\hbox to \cartouter{\hskip\lskip
3300 \ctl\leaders\hrule height\circthick\hfil\ctr
3301 \hskip\rskip}}
3302 \def\cartbot{\hbox to \cartouter{\hskip\lskip
3303 \cbl\leaders\hrule height\circthick\hfil\cbr
3304 \hskip\rskip}}
3306 \newskip\lskip\newskip\rskip
3308 \long\def\cartouche{%
3309 \begingroup
3310 \lskip=\leftskip \rskip=\rightskip
3311 \leftskip=0pt\rightskip=0pt %we want these *outside*.
3312 \cartinner=\hsize \advance\cartinner by-\lskip
3313 \advance\cartinner by-\rskip
3314 \cartouter=\hsize
3315 \advance\cartouter by 18pt % allow for 3pt kerns on either
3316 % side, and for 6pt waste from
3317 % each corner char
3318 \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
3319 % Flag to tell @lisp, etc., not to narrow margin.
3320 \let\nonarrowing=\comment
3321 \vbox\bgroup
3322 \baselineskip=0pt\parskip=0pt\lineskip=0pt
3323 \carttop
3324 \hbox\bgroup
3325 \hskip\lskip
3326 \vrule\kern3pt
3327 \vbox\bgroup
3328 \hsize=\cartinner
3329 \kern3pt
3330 \begingroup
3331 \baselineskip=\normbskip
3332 \lineskip=\normlskip
3333 \parskip=\normpskip
3334 \vskip -\parskip
3335 \def\Ecartouche{%
3336 \endgroup
3337 \kern3pt
3338 \egroup
3339 \kern3pt\vrule
3340 \hskip\rskip
3341 \egroup
3342 \cartbot
3343 \egroup
3344 \endgroup
3348 % This macro is called at the beginning of all the @example variants,
3349 % inside a group.
3350 \def\nonfillstart{%
3351 \aboveenvbreak
3352 \inENV % This group ends at the end of the body
3353 \hfuzz = 12pt % Don't be fussy
3354 \sepspaces % Make spaces be word-separators rather than space tokens.
3355 \singlespace
3356 \let\par = \lisppar % don't ignore blank lines
3357 \obeylines % each line of input is a line of output
3358 \parskip = 0pt
3359 \parindent = 0pt
3360 \emergencystretch = 0pt % don't try to avoid overfull boxes
3361 % @cartouche defines \nonarrowing to inhibit narrowing
3362 % at next level down.
3363 \ifx\nonarrowing\relax
3364 \advance \leftskip by \lispnarrowing
3365 \exdentamount=\lispnarrowing
3366 \let\exdent=\nofillexdent
3367 \let\nonarrowing=\relax
3371 % To ending an @example-like environment, we first end the paragraph
3372 % (via \afterenvbreak's vertical glue), and then the group. That way we
3373 % keep the zero \parskip that the environments set -- \parskip glue
3374 % will be inserted at the beginning of the next paragraph in the
3375 % document, after the environment.
3377 \def\nonfillfinish{\afterenvbreak\endgroup}%
3379 % This macro is
3380 \def\lisp{\begingroup
3381 \nonfillstart
3382 \let\Elisp = \nonfillfinish
3384 \rawbackslash % have \ input char produce \ char from current font
3385 \gobble
3388 % Define the \E... control sequence only if we are inside the
3389 % environment, so the error checking in \end will work.
3391 % We must call \lisp last in the definition, since it reads the
3392 % return following the @example (or whatever) command.
3394 \def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp}
3395 \def\smallexample{\begingroup \def\Esmallexample{\nonfillfinish\endgroup}\lisp}
3396 \def\smalllisp{\begingroup \def\Esmalllisp{\nonfillfinish\endgroup}\lisp}
3398 % @smallexample and @smalllisp. This is not used unless the @smallbook
3399 % command is given. Originally contributed by Pavel@xerox.
3401 \def\smalllispx{\begingroup
3402 \nonfillstart
3403 \let\Esmalllisp = \nonfillfinish
3404 \let\Esmallexample = \nonfillfinish
3406 % Smaller interline space and fonts for small examples.
3407 \setleading{10pt}%
3408 \indexfonts \tt
3409 \rawbackslash % make \ output the \ character from the current font (tt)
3410 \gobble
3413 % This is @display; same as @lisp except use roman font.
3415 \def\display{\begingroup
3416 \nonfillstart
3417 \let\Edisplay = \nonfillfinish
3418 \gobble
3421 % This is @format; same as @display except don't narrow margins.
3423 \def\format{\begingroup
3424 \let\nonarrowing = t
3425 \nonfillstart
3426 \let\Eformat = \nonfillfinish
3427 \gobble
3430 % @flushleft (same as @format) and @flushright.
3432 \def\flushleft{\begingroup
3433 \let\nonarrowing = t
3434 \nonfillstart
3435 \let\Eflushleft = \nonfillfinish
3436 \gobble
3438 \def\flushright{\begingroup
3439 \let\nonarrowing = t
3440 \nonfillstart
3441 \let\Eflushright = \nonfillfinish
3442 \advance\leftskip by 0pt plus 1fill
3443 \gobble}
3445 % @quotation does normal linebreaking (hence we can't use \nonfillstart)
3446 % and narrows the margins.
3448 \def\quotation{%
3449 \begingroup\inENV %This group ends at the end of the @quotation body
3450 {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
3451 \singlespace
3452 \parindent=0pt
3453 % We have retained a nonzero parskip for the environment, since we're
3454 % doing normal filling. So to avoid extra space below the environment...
3455 \def\Equotation{\parskip = 0pt \nonfillfinish}%
3457 % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
3458 \ifx\nonarrowing\relax
3459 \advance\leftskip by \lispnarrowing
3460 \advance\rightskip by \lispnarrowing
3461 \exdentamount = \lispnarrowing
3462 \let\nonarrowing = \relax
3466 \message{defuns,}
3467 % Define formatter for defuns
3468 % First, allow user to change definition object font (\df) internally
3469 \def\setdeffont #1 {\csname DEF#1\endcsname}
3471 \newskip\defbodyindent \defbodyindent=.4in
3472 \newskip\defargsindent \defargsindent=50pt
3473 \newskip\deftypemargin \deftypemargin=12pt
3474 \newskip\deflastargmargin \deflastargmargin=18pt
3476 \newcount\parencount
3477 % define \functionparens, which makes ( and ) and & do special things.
3478 % \functionparens affects the group it is contained in.
3479 \def\activeparens{%
3480 \catcode`\(=\active \catcode`\)=\active \catcode`\&=\active
3481 \catcode`\[=\active \catcode`\]=\active}
3483 % Make control sequences which act like normal parenthesis chars.
3484 \let\lparen = ( \let\rparen = )
3486 {\activeparens % Now, smart parens don't turn on until &foo (see \amprm)
3488 % Be sure that we always have a definition for `(', etc. For example,
3489 % if the fn name has parens in it, \boldbrax will not be in effect yet,
3490 % so TeX would otherwise complain about undefined control sequence.
3491 \global\let(=\lparen \global\let)=\rparen
3492 \global\let[=\lbrack \global\let]=\rbrack
3494 \gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 }
3495 \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
3496 % This is used to turn on special parens
3497 % but make & act ordinary (given that it's active).
3498 \gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr}
3500 % Definitions of (, ) and & used in args for functions.
3501 % This is the definition of ( outside of all parentheses.
3502 \gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested %
3503 \global\advance\parencount by 1 }
3505 % This is the definition of ( when already inside a level of parens.
3506 \gdef\opnested{\char`\(\global\advance\parencount by 1 }
3508 \gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
3509 % also in that case restore the outer-level definition of (.
3510 \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi
3511 \global\advance \parencount by -1 }
3512 % If we encounter &foo, then turn on ()-hacking afterwards
3513 \gdef\amprm#1 {{\rm\&#1}\let(=\oprm \let)=\clrm\ }
3515 \gdef\normalparens{\boldbrax\let&=\ampnr}
3516 } % End of definition inside \activeparens
3517 %% These parens (in \boldbrax) actually are a little bolder than the
3518 %% contained text. This is especially needed for [ and ]
3519 \def\opnr{{\sf\char`\(}} \def\clnr{{\sf\char`\)}} \def\ampnr{\&}
3520 \def\lbrb{{\bf\char`\[}} \def\rbrb{{\bf\char`\]}}
3522 % First, defname, which formats the header line itself.
3523 % #1 should be the function name.
3524 % #2 should be the type of definition, such as "Function".
3526 \def\defname #1#2{%
3527 % Get the values of \leftskip and \rightskip as they were
3528 % outside the @def...
3529 \dimen2=\leftskip
3530 \advance\dimen2 by -\defbodyindent
3531 \dimen3=\rightskip
3532 \advance\dimen3 by -\defbodyindent
3533 \noindent %
3534 \setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
3535 \dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line
3536 \dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations
3537 \parshape 2 0in \dimen0 \defargsindent \dimen1 %
3538 % Now output arg 2 ("Function" or some such)
3539 % ending at \deftypemargin from the right margin,
3540 % but stuck inside a box of width 0 so it does not interfere with linebreaking
3541 {% Adjust \hsize to exclude the ambient margins,
3542 % so that \rightline will obey them.
3543 \advance \hsize by -\dimen2 \advance \hsize by -\dimen3
3544 \rlap{\rightline{{\rm #2}\hskip \deftypemargin}}}%
3545 % Make all lines underfull and no complaints:
3546 \tolerance=10000 \hbadness=10000
3547 \advance\leftskip by -\defbodyindent
3548 \exdentamount=\defbodyindent
3549 {\df #1}\enskip % Generate function name
3552 % Actually process the body of a definition
3553 % #1 should be the terminating control sequence, such as \Edefun.
3554 % #2 should be the "another name" control sequence, such as \defunx.
3555 % #3 should be the control sequence that actually processes the header,
3556 % such as \defunheader.
3558 \def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
3559 \medbreak %
3560 % Define the end token that this defining construct specifies
3561 % so that it will exit this group.
3562 \def#1{\endgraf\endgroup\medbreak}%
3563 \def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
3564 \parindent=0in
3565 \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
3566 \exdentamount=\defbodyindent
3567 \begingroup %
3568 \catcode 61=\active % 61 is `='
3569 \obeylines\activeparens\spacesplit#3}
3571 \def\defmethparsebody #1#2#3#4 {\begingroup\inENV %
3572 \medbreak %
3573 % Define the end token that this defining construct specifies
3574 % so that it will exit this group.
3575 \def#1{\endgraf\endgroup\medbreak}%
3576 \def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}%
3577 \parindent=0in
3578 \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
3579 \exdentamount=\defbodyindent
3580 \begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
3582 \def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
3583 \medbreak %
3584 % Define the end token that this defining construct specifies
3585 % so that it will exit this group.
3586 \def#1{\endgraf\endgroup\medbreak}%
3587 \def#2##1 ##2 {\def#4{##1}%
3588 \begingroup\obeylines\activeparens\spacesplit{#3{##2}}}%
3589 \parindent=0in
3590 \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
3591 \exdentamount=\defbodyindent
3592 \begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
3594 % These parsing functions are similar to the preceding ones
3595 % except that they do not make parens into active characters.
3596 % These are used for "variables" since they have no arguments.
3598 \def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
3599 \medbreak %
3600 % Define the end token that this defining construct specifies
3601 % so that it will exit this group.
3602 \def#1{\endgraf\endgroup\medbreak}%
3603 \def#2{\begingroup\obeylines\spacesplit#3}%
3604 \parindent=0in
3605 \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
3606 \exdentamount=\defbodyindent
3607 \begingroup %
3608 \catcode 61=\active %
3609 \obeylines\spacesplit#3}
3611 % This is used for \def{tp,vr}parsebody. It could probably be used for
3612 % some of the others, too, with some judicious conditionals.
3614 \def\parsebodycommon#1#2#3{%
3615 \begingroup\inENV %
3616 \medbreak %
3617 % Define the end token that this defining construct specifies
3618 % so that it will exit this group.
3619 \def#1{\endgraf\endgroup\medbreak}%
3620 \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}%
3621 \parindent=0in
3622 \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
3623 \exdentamount=\defbodyindent
3624 \begingroup\obeylines
3627 \def\defvrparsebody#1#2#3#4 {%
3628 \parsebodycommon{#1}{#2}{#3}%
3629 \spacesplit{#3{#4}}%
3632 % This loses on `@deftp {Data Type} {struct termios}' -- it thinks the
3633 % type is just `struct', because we lose the braces in `{struct
3634 % termios}' when \spacesplit reads its undelimited argument. Sigh.
3635 % \let\deftpparsebody=\defvrparsebody
3637 % So, to get around this, we put \empty in with the type name. That
3638 % way, TeX won't find exactly `{...}' as an undelimited argument, and
3639 % won't strip off the braces.
3641 \def\deftpparsebody #1#2#3#4 {%
3642 \parsebodycommon{#1}{#2}{#3}%
3643 \spacesplit{\parsetpheaderline{#3{#4}}}\empty
3646 % Fine, but then we have to eventually remove the \empty *and* the
3647 % braces (if any). That's what this does, putting the result in \tptemp.
3649 \def\removeemptybraces\empty#1\relax{\def\tptemp{#1}}%
3651 % After \spacesplit has done its work, this is called -- #1 is the final
3652 % thing to call, #2 the type name (which starts with \empty), and #3
3653 % (which might be empty) the arguments.
3655 \def\parsetpheaderline#1#2#3{%
3656 \removeemptybraces#2\relax
3657 #1{\tptemp}{#3}%
3660 \def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV %
3661 \medbreak %
3662 % Define the end token that this defining construct specifies
3663 % so that it will exit this group.
3664 \def#1{\endgraf\endgroup\medbreak}%
3665 \def#2##1 ##2 {\def#4{##1}%
3666 \begingroup\obeylines\spacesplit{#3{##2}}}%
3667 \parindent=0in
3668 \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
3669 \exdentamount=\defbodyindent
3670 \begingroup\obeylines\spacesplit{#3{#5}}}
3672 % Split up #2 at the first space token.
3673 % call #1 with two arguments:
3674 % the first is all of #2 before the space token,
3675 % the second is all of #2 after that space token.
3676 % If #2 contains no space token, all of it is passed as the first arg
3677 % and the second is passed as empty.
3679 {\obeylines
3680 \gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}%
3681 \long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{%
3682 \ifx\relax #3%
3683 #1{#2}{}\else #1{#2}{#3#4}\fi}}
3685 % So much for the things common to all kinds of definitions.
3687 % Define @defun.
3689 % First, define the processing that is wanted for arguments of \defun
3690 % Use this to expand the args and terminate the paragraph they make up
3692 \def\defunargs #1{\functionparens \sl
3693 % Expand, preventing hyphenation at `-' chars.
3694 % Note that groups don't affect changes in \hyphenchar.
3695 \hyphenchar\tensl=0
3697 \hyphenchar\tensl=45
3698 \ifnum\parencount=0 \else \errmessage{unbalanced parens in @def arguments}\fi%
3699 \interlinepenalty=10000
3700 \advance\rightskip by 0pt plus 1fil
3701 \endgraf\penalty 10000\vskip -\parskip\penalty 10000%
3704 \def\deftypefunargs #1{%
3705 % Expand, preventing hyphenation at `-' chars.
3706 % Note that groups don't affect changes in \hyphenchar.
3707 % Use \boldbraxnoamp, not \functionparens, so that & is not special.
3708 \boldbraxnoamp
3709 \tclose{#1}% avoid \code because of side effects on active chars
3710 \interlinepenalty=10000
3711 \advance\rightskip by 0pt plus 1fil
3712 \endgraf\penalty 10000\vskip -\parskip\penalty 10000%
3715 % Do complete processing of one @defun or @defunx line already parsed.
3717 % @deffn Command forward-char nchars
3719 \def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader}
3721 \def\deffnheader #1#2#3{\doind {fn}{\code{#2}}%
3722 \begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
3723 \catcode 61=\other % Turn off change made in \defparsebody
3726 % @defun == @deffn Function
3728 \def\defun{\defparsebody\Edefun\defunx\defunheader}
3730 \def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
3731 \begingroup\defname {#1}{Function}%
3732 \defunargs {#2}\endgroup %
3733 \catcode 61=\other % Turn off change made in \defparsebody
3736 % @deftypefun int foobar (int @var{foo}, float @var{bar})
3738 \def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader}
3740 % #1 is the data type. #2 is the name and args.
3741 \def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax}
3742 % #1 is the data type, #2 the name, #3 the args.
3743 \def\deftypefunheaderx #1#2 #3\relax{%
3744 \doind {fn}{\code{#2}}% Make entry in function index
3745 \begingroup\defname {\defheaderxcond#1\relax$$$#2}{Function}%
3746 \deftypefunargs {#3}\endgroup %
3747 \catcode 61=\other % Turn off change made in \defparsebody
3750 % @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
3752 \def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
3754 % \defheaderxcond#1\relax$$$
3755 % puts #1 in @code, followed by a space, but does nothing if #1 is null.
3756 \def\defheaderxcond#1#2$$${\ifx#1\relax\else\code{#1#2} \fi}
3758 % #1 is the classification. #2 is the data type. #3 is the name and args.
3759 \def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax}
3760 % #1 is the classification, #2 the data type, #3 the name, #4 the args.
3761 \def\deftypefnheaderx #1#2#3 #4\relax{%
3762 \doind {fn}{\code{#3}}% Make entry in function index
3763 \begingroup
3764 \normalparens % notably, turn off `&' magic, which prevents
3765 % at least some C++ text from working
3766 \defname {\defheaderxcond#2\relax$$$#3}{#1}%
3767 \deftypefunargs {#4}\endgroup %
3768 \catcode 61=\other % Turn off change made in \defparsebody
3771 % @defmac == @deffn Macro
3773 \def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
3775 \def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
3776 \begingroup\defname {#1}{Macro}%
3777 \defunargs {#2}\endgroup %
3778 \catcode 61=\other % Turn off change made in \defparsebody
3781 % @defspec == @deffn Special Form
3783 \def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
3785 \def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
3786 \begingroup\defname {#1}{Special Form}%
3787 \defunargs {#2}\endgroup %
3788 \catcode 61=\other % Turn off change made in \defparsebody
3791 % This definition is run if you use @defunx
3792 % anywhere other than immediately after a @defun or @defunx.
3794 \def\deffnx #1 {\errmessage{@deffnx in invalid context}}
3795 \def\defunx #1 {\errmessage{@defunx in invalid context}}
3796 \def\defmacx #1 {\errmessage{@defmacx in invalid context}}
3797 \def\defspecx #1 {\errmessage{@defspecx in invalid context}}
3798 \def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}}
3799 \def\deftypeunx #1 {\errmessage{@deftypeunx in invalid context}}
3801 % @defmethod, and so on
3803 % @defop {Funny Method} foo-class frobnicate argument
3805 \def\defop #1 {\def\defoptype{#1}%
3806 \defopparsebody\Edefop\defopx\defopheader\defoptype}
3808 \def\defopheader #1#2#3{%
3809 \dosubind {fn}{\code{#2}}{on #1}% Make entry in function index
3810 \begingroup\defname {#2}{\defoptype{} on #1}%
3811 \defunargs {#3}\endgroup %
3814 % @defmethod == @defop Method
3816 \def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
3818 \def\defmethodheader #1#2#3{%
3819 \dosubind {fn}{\code{#2}}{on #1}% entry in function index
3820 \begingroup\defname {#2}{Method on #1}%
3821 \defunargs {#3}\endgroup %
3824 % @defcv {Class Option} foo-class foo-flag
3826 \def\defcv #1 {\def\defcvtype{#1}%
3827 \defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
3829 \def\defcvarheader #1#2#3{%
3830 \dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
3831 \begingroup\defname {#2}{\defcvtype{} of #1}%
3832 \defvarargs {#3}\endgroup %
3835 % @defivar == @defcv {Instance Variable}
3837 \def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
3839 \def\defivarheader #1#2#3{%
3840 \dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
3841 \begingroup\defname {#2}{Instance Variable of #1}%
3842 \defvarargs {#3}\endgroup %
3845 % These definitions are run if you use @defmethodx, etc.,
3846 % anywhere other than immediately after a @defmethod, etc.
3848 \def\defopx #1 {\errmessage{@defopx in invalid context}}
3849 \def\defmethodx #1 {\errmessage{@defmethodx in invalid context}}
3850 \def\defcvx #1 {\errmessage{@defcvx in invalid context}}
3851 \def\defivarx #1 {\errmessage{@defivarx in invalid context}}
3853 % Now @defvar
3855 % First, define the processing that is wanted for arguments of @defvar.
3856 % This is actually simple: just print them in roman.
3857 % This must expand the args and terminate the paragraph they make up
3858 \def\defvarargs #1{\normalparens #1%
3859 \interlinepenalty=10000
3860 \endgraf\penalty 10000\vskip -\parskip\penalty 10000}
3862 % @defvr Counter foo-count
3864 \def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader}
3866 \def\defvrheader #1#2#3{\doind {vr}{\code{#2}}%
3867 \begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup}
3869 % @defvar == @defvr Variable
3871 \def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader}
3873 \def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
3874 \begingroup\defname {#1}{Variable}%
3875 \defvarargs {#2}\endgroup %
3878 % @defopt == @defvr {User Option}
3880 \def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader}
3882 \def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
3883 \begingroup\defname {#1}{User Option}%
3884 \defvarargs {#2}\endgroup %
3887 % @deftypevar int foobar
3889 \def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader}
3891 % #1 is the data type. #2 is the name.
3892 \def\deftypevarheader #1#2{%
3893 \doind {vr}{\code{#2}}% Make entry in variables index
3894 \begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}%
3895 \interlinepenalty=10000
3896 \endgraf\penalty 10000\vskip -\parskip\penalty 10000
3897 \endgroup}
3899 % @deftypevr {Global Flag} int enable
3901 \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
3903 \def\deftypevrheader #1#2#3{\doind {vr}{\code{#3}}%
3904 \begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1}
3905 \interlinepenalty=10000
3906 \endgraf\penalty 10000\vskip -\parskip\penalty 10000
3907 \endgroup}
3909 % This definition is run if you use @defvarx
3910 % anywhere other than immediately after a @defvar or @defvarx.
3912 \def\defvrx #1 {\errmessage{@defvrx in invalid context}}
3913 \def\defvarx #1 {\errmessage{@defvarx in invalid context}}
3914 \def\defoptx #1 {\errmessage{@defoptx in invalid context}}
3915 \def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context}}
3916 \def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context}}
3918 % Now define @deftp
3919 % Args are printed in bold, a slight difference from @defvar.
3921 \def\deftpargs #1{\bf \defvarargs{#1}}
3923 % @deftp Class window height width ...
3925 \def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader}
3927 \def\deftpheader #1#2#3{\doind {tp}{\code{#2}}%
3928 \begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
3930 % This definition is run if you use @deftpx, etc
3931 % anywhere other than immediately after a @deftp, etc.
3933 \def\deftpx #1 {\errmessage{@deftpx in invalid context}}
3935 \message{cross reference,}
3936 % Define cross-reference macros
3937 \newwrite \auxfile
3939 \newif\ifhavexrefs % True if xref values are known.
3940 \newif\ifwarnedxrefs % True if we warned once that they aren't known.
3942 % \setref{foo} defines a cross-reference point named foo.
3944 \def\setref#1{%
3945 \dosetq{#1-title}{Ytitle}%
3946 \dosetq{#1-pg}{Ypagenumber}%
3947 \dosetq{#1-snt}{Ysectionnumberandtype}}
3949 \def\unnumbsetref#1{%
3950 \dosetq{#1-title}{Ytitle}%
3951 \dosetq{#1-pg}{Ypagenumber}%
3952 \dosetq{#1-snt}{Ynothing}}
3954 \def\appendixsetref#1{%
3955 \dosetq{#1-title}{Ytitle}%
3956 \dosetq{#1-pg}{Ypagenumber}%
3957 \dosetq{#1-snt}{Yappendixletterandtype}}
3959 % \xref, \pxref, and \ref generate cross-references to specified points.
3960 % For \xrefX, #1 is the node name, #2 the name of the Info
3961 % cross-reference, #3 the printed node name, #4 the name of the Info
3962 % file, #5 the name of the printed manual. All but the node name can be
3963 % omitted.
3965 \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
3966 \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
3967 \def\ref#1{\xrefX[#1,,,,,,,]}
3968 \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
3969 \def\printedmanual{\ignorespaces #5}%
3970 \def\printednodename{\ignorespaces #3}%
3971 \setbox1=\hbox{\printedmanual}%
3972 \setbox0=\hbox{\printednodename}%
3973 \ifdim \wd0 = 0pt
3974 % No printed node name was explicitly given.
3975 \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax
3976 % Use the node name inside the square brackets.
3977 \def\printednodename{\ignorespaces #1}%
3978 \else
3979 % Use the actual chapter/section title appear inside
3980 % the square brackets. Use the real section title if we have it.
3981 \ifdim \wd1>0pt%
3982 % It is in another manual, so we don't have it.
3983 \def\printednodename{\ignorespaces #1}%
3984 \else
3985 \ifhavexrefs
3986 % We know the real title if we have the xref values.
3987 \def\printednodename{\refx{#1-title}{}}%
3988 \else
3989 % Otherwise just copy the Info node name.
3990 \def\printednodename{\ignorespaces #1}%
3991 \fi%
3996 % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
3997 % insert empty discretionaries after hyphens, which means that it will
3998 % not find a line break at a hyphen in a node names. Since some manuals
3999 % are best written with fairly long node names, containing hyphens, this
4000 % is a loss. Therefore, we give the text of the node name again, so it
4001 % is as if TeX is seeing it for the first time.
4002 \ifdim \wd1 > 0pt
4003 \putwordsection{} ``\printednodename'' in \cite{\printedmanual}%
4004 \else
4005 % _ (for example) has to be the character _ for the purposes of the
4006 % control sequence corresponding to the node, but it has to expand
4007 % into the usual \leavevmode...\vrule stuff for purposes of
4008 % printing. So we \turnoffactive for the \refx-snt, back on for the
4009 % printing, back off for the \refx-pg.
4010 {\turnoffactive \refx{#1-snt}{}}%
4011 \space [\printednodename],\space
4012 \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
4014 \endgroup}
4016 % \dosetq is the interface for calls from other macros
4018 % Use \turnoffactive so that punctuation chars such as underscore
4019 % work in node names.
4020 \def\dosetq #1#2{{\let\folio=0 \turnoffactive \auxhat%
4021 \edef\next{\write\auxfile{\internalsetq {#1}{#2}}}%
4022 \next}}
4024 % \internalsetq {foo}{page} expands into
4025 % CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
4026 % When the aux file is read, ' is the escape character
4028 \def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}}
4030 % Things to be expanded by \internalsetq
4032 \def\Ypagenumber{\folio}
4034 \def\Ytitle{\thissection}
4036 \def\Ynothing{}
4038 \def\Ysectionnumberandtype{%
4039 \ifnum\secno=0 \putwordChapter\xreftie\the\chapno %
4040 \else \ifnum \subsecno=0 \putwordSection\xreftie\the\chapno.\the\secno %
4041 \else \ifnum \subsubsecno=0 %
4042 \putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno %
4043 \else %
4044 \putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno %
4045 \fi \fi \fi }
4047 \def\Yappendixletterandtype{%
4048 \ifnum\secno=0 \putwordAppendix\xreftie'char\the\appendixno{}%
4049 \else \ifnum \subsecno=0 \putwordSection\xreftie'char\the\appendixno.\the\secno %
4050 \else \ifnum \subsubsecno=0 %
4051 \putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno %
4052 \else %
4053 \putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %
4054 \fi \fi \fi }
4056 \gdef\xreftie{'tie}
4058 % Use TeX 3.0's \inputlineno to get the line number, for better error
4059 % messages, but if we're using an old version of TeX, don't do anything.
4061 \ifx\inputlineno\thisisundefined
4062 \let\linenumber = \empty % Non-3.0.
4063 \else
4064 \def\linenumber{\the\inputlineno:\space}
4067 % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
4068 % If its value is nonempty, SUFFIX is output afterward.
4070 \def\refx#1#2{%
4071 \expandafter\ifx\csname X#1\endcsname\relax
4072 % If not defined, say something at least.
4073 $\langle$un\-de\-fined$\rangle$%
4074 \ifhavexrefs
4075 \message{\linenumber Undefined cross reference `#1'.}%
4076 \else
4077 \ifwarnedxrefs\else
4078 \global\warnedxrefstrue
4079 \message{Cross reference values unknown; you must run TeX again.}%
4082 \else
4083 % It's defined, so just use it.
4084 \csname X#1\endcsname
4086 #2% Output the suffix in any case.
4089 % Read the last existing aux file, if any. No error if none exists.
4091 % This is the macro invoked by entries in the aux file.
4092 \def\xrdef #1#2{
4093 {\catcode`\'=\other\expandafter \gdef \csname X#1\endcsname {#2}}}
4095 \def\readauxfile{%
4096 \begingroup
4097 \catcode `\^^@=\other
4098 \catcode `\\x01=\other
4099 \catcode `\\x02=\other
4100 \catcode `\^^C=\other
4101 \catcode `\^^D=\other
4102 \catcode `\^^E=\other
4103 \catcode `\^^F=\other
4104 \catcode `\^^G=\other
4105 \catcode `\^^H=\other
4106 \catcode `\\v=\other
4107 \catcode `\^^L=\other
4108 \catcode `\\x0e=\other
4109 \catcode `\\x0f=\other
4110 \catcode `\\x10=\other
4111 \catcode `\\x11=\other
4112 \catcode `\\x12=\other
4113 \catcode `\\x13=\other
4114 \catcode `\\x14=\other
4115 \catcode `\\x15=\other
4116 \catcode `\\x16=\other
4117 \catcode `\\x17=\other
4118 \catcode `\\x18=\other
4119 \catcode `\\x19=\other
4120 \catcode 26=\other
4121 \catcode `\^^[=\other
4122 \catcode `\^^\=\other
4123 \catcode `\^^]=\other
4124 \catcode `\^^^=\other
4125 \catcode `\^^_=\other
4126 \catcode `\@=\other
4127 \catcode `\^=\other
4128 \catcode `\~=\other
4129 \catcode `\[=\other
4130 \catcode `\]=\other
4131 \catcode`\"=\other
4132 \catcode`\_=\other
4133 \catcode`\|=\other
4134 \catcode`\<=\other
4135 \catcode`\>=\other
4136 \catcode `\$=\other
4137 \catcode `\#=\other
4138 \catcode `\&=\other
4139 % `\+ does not work, so use 43.
4140 \catcode 43=\other
4141 % Make the characters 128-255 be printing characters
4143 \count 1=128
4144 \def\loop{%
4145 \catcode\count 1=\other
4146 \advance\count 1 by 1
4147 \ifnum \count 1<256 \loop \fi
4150 % the aux file uses ' as the escape.
4151 % Turn off \ as an escape so we do not lose on
4152 % entries which were dumped with control sequences in their names.
4153 % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
4154 % Reference to such entries still does not work the way one would wish,
4155 % but at least they do not bomb out when the aux file is read in.
4156 \catcode `\{=1 \catcode `\}=2
4157 \catcode `\%=\other
4158 \catcode `\'=0
4159 \catcode`\^=7 % to make ^^e4 etc usable in xref tags
4160 \catcode `\\=\other
4161 \openin 1 \jobname.aux
4162 \ifeof 1 \else \closein 1 \input \jobname.aux \global\havexrefstrue
4163 \global\warnedobstrue
4165 % Open the new aux file. Tex will close it automatically at exit.
4166 \openout \auxfile=\jobname.aux
4167 \endgroup}
4170 % Footnotes.
4172 \newcount \footnoteno
4174 % The trailing space in the following definition for supereject is
4175 % vital for proper filling; pages come out unaligned when you do a
4176 % pagealignmacro call if that space before the closing brace is
4177 % removed.
4178 \def\supereject{\par\penalty -20000\footnoteno =0 }
4180 % @footnotestyle is meaningful for info output only..
4181 \let\footnotestyle=\comment
4183 \let\ptexfootnote=\footnote
4185 {\catcode `\@=11
4187 % Auto-number footnotes. Otherwise like plain.
4188 \gdef\footnote{%
4189 \global\advance\footnoteno by \@ne
4190 \edef\thisfootno{$^{\the\footnoteno}$}%
4192 % In case the footnote comes at the end of a sentence, preserve the
4193 % extra spacing after we do the footnote number.
4194 \let\@sf\empty
4195 \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
4197 % Remove inadvertent blank space before typesetting the footnote number.
4198 \unskip
4199 \thisfootno\@sf
4200 \footnotezzz
4203 % Don't bother with the trickery in plain.tex to not require the
4204 % footnote text as a parameter. Our footnotes don't need to be so general.
4206 \long\gdef\footnotezzz#1{\insert\footins{%
4207 % We want to typeset this text as a normal paragraph, even if the
4208 % footnote reference occurs in (for example) a display environment.
4209 % So reset some parameters.
4210 \interlinepenalty\interfootnotelinepenalty
4211 \splittopskip\ht\strutbox % top baseline for broken footnotes
4212 \splitmaxdepth\dp\strutbox
4213 \floatingpenalty\@MM
4214 \leftskip\z@skip
4215 \rightskip\z@skip
4216 \spaceskip\z@skip
4217 \xspaceskip\z@skip
4218 \parindent\defaultparindent
4220 % Hang the footnote text off the number.
4221 \hang
4222 \textindent{\thisfootno}%
4224 % Don't crash into the line above the footnote text. Since this
4225 % expands into a box, it must come within the paragraph, lest it
4226 % provide a place where TeX can split the footnote.
4227 \footstrut
4228 #1\strut}%
4231 }%end \catcode `\@=11
4233 % Set the baselineskip to #1, and the lineskip and strut size
4234 % correspondingly. There is no deep meaning behind these magic numbers
4235 % used as factors; they just match (closely enough) what Knuth defined.
4237 \def\lineskipfactor{.08333}
4238 \def\strutheightpercent{.70833}
4239 \def\strutdepthpercent {.29167}
4241 \def\setleading#1{%
4242 \normalbaselineskip = #1\relax
4243 \normallineskip = \lineskipfactor\normalbaselineskip
4244 \normalbaselines
4245 \setbox\strutbox =\hbox{%
4246 \vrule width0pt height\strutheightpercent\baselineskip
4247 depth \strutdepthpercent \baselineskip
4251 % @| inserts a changebar to the left of the current line. It should
4252 % surround any changed text. This approach does *not* work if the
4253 % change spans more than two lines of output. To handle that, we would
4254 % have adopt a much more difficult approach (putting marks into the main
4255 % vertical list for the beginning and end of each change).
4257 \def\|{%
4258 % \vadjust can only be used in horizontal mode.
4259 \leavevmode
4261 % Append this vertical mode material after the current line in the output.
4262 \vadjust{%
4263 % We want to insert a rule with the height and depth of the current
4264 % leading; that is exactly what \strutbox is supposed to record.
4265 \vskip-\baselineskip
4267 % \vadjust-items are inserted at the left edge of the type. So
4268 % the \llap here moves out into the left-hand margin.
4269 \llap{%
4271 % For a thicker or thinner bar, change the `1pt'.
4272 \vrule height\baselineskip width1pt
4274 % This is the space between the bar and the text.
4275 \hskip 12pt
4280 % For a final copy, take out the rectangles
4281 % that mark overfull boxes (in case you have decided
4282 % that the text looks ok even though it passes the margin).
4284 \def\finalout{\overfullrule=0pt}
4287 % End of control word definitions.
4289 \message{and turning on texinfo input format.}
4291 \def\openindices{%
4292 \newindex{cp}%
4293 \newcodeindex{fn}%
4294 \newcodeindex{vr}%
4295 \newcodeindex{tp}%
4296 \newcodeindex{ky}%
4297 \newcodeindex{pg}%
4300 % Set some numeric style parameters, for 8.5 x 11 format.
4302 %\hsize = 6.5in
4303 \newdimen\defaultparindent \defaultparindent = 15pt
4304 \parindent = \defaultparindent
4305 \parskip 18pt plus 1pt
4306 \setleading{15pt}
4307 \advance\topskip by 1.2cm
4309 % Prevent underfull vbox error messages.
4310 \vbadness=10000
4312 % Following George Bush, just get rid of widows and orphans.
4313 \widowpenalty=10000
4314 \clubpenalty=10000
4316 % Use TeX 3.0's \emergencystretch to help line breaking, but if we're
4317 % using an old version of TeX, don't do anything. We want the amount of
4318 % stretch added to depend on the line length, hence the dependence on
4319 % \hsize. This makes it come to about 9pt for the 8.5x11 format.
4321 \ifx\emergencystretch\thisisundefined
4322 % Allow us to assign to \emergencystretch anyway.
4323 \def\emergencystretch{\dimen0}%
4324 \else
4325 \emergencystretch = \hsize
4326 \divide\emergencystretch by 45
4329 % Use @smallbook to reset parameters for 7x9.5 format (or else 7x9.25)
4330 \def\smallbook{
4332 % These values for secheadingskip and subsecheadingskip are
4333 % experiments. RJC 7 Aug 1992
4334 \global\secheadingskip = 17pt plus 6pt minus 3pt
4335 \global\subsecheadingskip = 14pt plus 6pt minus 3pt
4337 \global\lispnarrowing = 0.3in
4338 \setleading{12pt}
4339 \advance\topskip by -1cm
4340 \global\parskip 3pt plus 1pt
4341 \global\hsize = 5in
4342 \global\vsize=7.5in
4343 \global\tolerance=700
4344 \global\hfuzz=1pt
4345 \global\contentsrightmargin=0pt
4346 \global\deftypemargin=0pt
4347 \global\defbodyindent=.5cm
4349 \global\pagewidth=\hsize
4350 \global\pageheight=\vsize
4352 \global\let\smalllisp=\smalllispx
4353 \global\let\smallexample=\smalllispx
4354 \global\def\Esmallexample{\Esmalllisp}
4357 % Use @afourpaper to print on European A4 paper.
4358 \def\afourpaper{
4359 \global\tolerance=700
4360 \global\hfuzz=1pt
4361 \setleading{12pt}
4362 \global\parskip 15pt plus 1pt
4364 \global\vsize= 53\baselineskip
4365 \advance\vsize by \topskip
4366 %\global\hsize= 5.85in % A4 wide 10pt
4367 \global\hsize= 6.5in
4368 \global\outerhsize=\hsize
4369 \global\advance\outerhsize by 0.5in
4370 \global\outervsize=\vsize
4371 \global\advance\outervsize by 0.6in
4373 \global\pagewidth=\hsize
4374 \global\pageheight=\vsize
4377 % Allow control of the text dimensions. Parameters in order: textheight;
4378 % textwidth; voffset; hoffset; binding offset; topskip.
4379 % All require a dimension;
4380 % header is additional; added length extends the bottom of the page.
4382 \def\changepagesizes#1#2#3#4#5#6{
4383 \global\vsize= #1
4384 \global\topskip= #6
4385 \advance\vsize by \topskip
4386 \global\voffset= #3
4387 \global\hsize= #2
4388 \global\outerhsize=\hsize
4389 \global\advance\outerhsize by 0.5in
4390 \global\outervsize=\vsize
4391 \global\advance\outervsize by 0.6in
4392 \global\pagewidth=\hsize
4393 \global\pageheight=\vsize
4394 \global\normaloffset= #4
4395 \global\bindingoffset= #5}
4397 % A specific text layout, 24x15cm overall, intended for A4 paper. Top margin
4398 % 29mm, hence bottom margin 28mm, nominal side margin 3cm.
4399 \def\afourlatex
4400 {\global\tolerance=700
4401 \global\hfuzz=1pt
4402 \setleading{12pt}
4403 \global\parskip 15pt plus 1pt
4404 \advance\baselineskip by 1.6pt
4405 \changepagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}
4408 % Use @afourwide to print on European A4 paper in wide format.
4409 \def\afourwide{\afourpaper
4410 \changepagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}}
4412 % Define macros to output various characters with catcode for normal text.
4413 \catcode`\"=\other
4414 \catcode`\~=\other
4415 \catcode`\^=\other
4416 \catcode`\_=\other
4417 \catcode`\|=\other
4418 \catcode`\<=\other
4419 \catcode`\>=\other
4420 \catcode`\+=\other
4421 \def\normaldoublequote{"}
4422 \def\normaltilde{~}
4423 \def\normalcaret{^}
4424 \def\normalunderscore{_}
4425 \def\normalverticalbar{|}
4426 \def\normalless{<}
4427 \def\normalgreater{>}
4428 \def\normalplus{+}
4430 % This macro is used to make a character print one way in ttfont
4431 % where it can probably just be output, and another way in other fonts,
4432 % where something hairier probably needs to be done.
4434 % #1 is what to print if we are indeed using \tt; #2 is what to print
4435 % otherwise. Since all the Computer Modern typewriter fonts have zero
4436 % interword stretch (and shrink), and it is reasonable to expect all
4437 % typewriter fonts to have this, we can check that font parameter.
4439 \def\ifusingtt#1#2{\ifdim \fontdimen3\the\font=0pt #1\else #2\fi}
4441 % Turn off all special characters except @
4442 % (and those which the user can use as if they were ordinary).
4443 % Most of these we simply print from the \tt font, but for some, we can
4444 % use math or other variants that look better in normal text.
4446 \catcode`\"=\active
4447 \def\activedoublequote{{\tt \char '042}}
4448 \let"=\activedoublequote
4449 \catcode`\~=\active
4450 \def~{{\tt \char '176}}
4451 \chardef\hat=`\^
4452 \catcode`\^=\active
4453 \def\auxhat{\def^{'hat}}
4454 \def^{{\tt \hat}}
4456 \catcode`\_=\active
4457 \def_{\ifusingtt\normalunderscore\_}
4458 % Subroutine for the previous macro.
4459 \def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}}
4461 \catcode`\|=\active
4462 \def|{{\tt \char '174}}
4463 \chardef \less=`\<
4464 \catcode`\<=\active
4465 \def<{{\tt \less}}
4466 \chardef \gtr=`\>
4467 \catcode`\>=\active
4468 \def>{{\tt \gtr}}
4469 \catcode`\+=\active
4470 \def+{{\tt \char 43}}
4471 %\catcode 27=\active
4472 %\def^^[{$\diamondsuit$}
4474 % Set up an active definition for =, but don't enable it most of the time.
4475 {\catcode`\==\active
4476 \global\def={{\tt \char 61}}}
4478 \catcode`+=\active
4479 \catcode`\_=\active
4481 % If a .fmt file is being used, characters that might appear in a file
4482 % name cannot be active until we have parsed the command line.
4483 % So turn them off again, and have \everyjob (or @setfilename) turn them on.
4484 % \otherifyactive is called near the end of this file.
4485 \def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
4487 \catcode`\@=0
4489 % \rawbackslashxx output one backslash character in current font
4490 \global\chardef\rawbackslashxx=`\\
4491 %{\catcode`\\=\other
4492 %@gdef@rawbackslashxx{\}}
4494 % \rawbackslash redefines \ as input to do \rawbackslashxx.
4495 {\catcode`\\=\active
4496 @gdef@rawbackslash{@let\=@rawbackslashxx }}
4498 % \normalbackslash outputs one backslash in fixed width font.
4499 \def\normalbackslash{{\tt\rawbackslashxx}}
4501 % Say @foo, not \foo, in error messages.
4502 \escapechar=`\@
4504 % \catcode 17=0 % Define control-q
4505 \catcode`\\=\active
4507 % Used sometimes to turn off (effectively) the active characters
4508 % even after parsing them.
4509 @def@turnoffactive{@let"=@normaldoublequote
4510 @let\=@realbackslash
4511 @let~=@normaltilde
4512 @let^=@normalcaret
4513 @let_=@normalunderscore
4514 @let|=@normalverticalbar
4515 @let<=@normalless
4516 @let>=@normalgreater
4517 @let+=@normalplus}
4519 @def@normalturnoffactive{@let"=@normaldoublequote
4520 @let\=@normalbackslash
4521 @let~=@normaltilde
4522 @let^=@normalcaret
4523 @let_=@normalunderscore
4524 @let|=@normalverticalbar
4525 @let<=@normalless
4526 @let>=@normalgreater
4527 @let+=@normalplus}
4529 % Make _ and + \other characters, temporarily.
4530 % This is canceled by @fixbackslash.
4531 @otherifyactive
4533 % If a .fmt file is being used, we don't want the `\input texinfo' to show up.
4534 % That is what \eatinput is for; after that, the `\' should revert to printing
4535 % a backslash.
4537 @gdef@eatinput input texinfo{@fixbackslash}
4538 @global@let\ = @eatinput
4540 % On the other hand, perhaps the file did not have a `\input texinfo'. Then
4541 % the first `\{ in the file would cause an error. This macro tries to fix
4542 % that, assuming it is called before the first `\' could plausibly occur.
4543 % Also back turn on active characters that might appear in the input
4544 % file name, in case not using a pre-dumped format.
4546 @gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi
4547 @catcode`+=@active @catcode`@_=@active}
4549 %% These look ok in all fonts, so just make them not special. The @rm below
4550 %% makes sure that the current font starts out as the newly loaded cmr10
4551 @catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other
4553 @textfonts
4556 @c Local variables:
4557 @c page-delimiter: "^\\\\message"
4558 @c End: