*** empty log message ***
[glibc/history.git] / manual / texinfo.tex
blob48d294d6f49cd75cf9d0cb02bc880331c20d5848
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: 2.182 $
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 % @paragraphindent is defined for the Info formatting commands only.
596 \let\paragraphindent=\comment
598 % Prevent errors for section commands.
599 % Used in @ignore and in failing conditionals.
600 \def\ignoresections{%
601 \let\chapter=\relax
602 \let\unnumbered=\relax
603 \let\top=\relax
604 \let\unnumberedsec=\relax
605 \let\unnumberedsection=\relax
606 \let\unnumberedsubsec=\relax
607 \let\unnumberedsubsection=\relax
608 \let\unnumberedsubsubsec=\relax
609 \let\unnumberedsubsubsection=\relax
610 \let\section=\relax
611 \let\subsec=\relax
612 \let\subsubsec=\relax
613 \let\subsection=\relax
614 \let\subsubsection=\relax
615 \let\appendix=\relax
616 \let\appendixsec=\relax
617 \let\appendixsection=\relax
618 \let\appendixsubsec=\relax
619 \let\appendixsubsection=\relax
620 \let\appendixsubsubsec=\relax
621 \let\appendixsubsubsection=\relax
622 \let\contents=\relax
623 \let\smallbook=\relax
624 \let\titlepage=\relax
627 % Used in nested conditionals, where we have to parse the Texinfo source
628 % and so want to turn off most commands, in case they are used
629 % incorrectly.
631 \def\ignoremorecommands{%
632 \let\defcodeindex = \relax
633 \let\defcv = \relax
634 \let\deffn = \relax
635 \let\deffnx = \relax
636 \let\defindex = \relax
637 \let\defivar = \relax
638 \let\defmac = \relax
639 \let\defmethod = \relax
640 \let\defop = \relax
641 \let\defopt = \relax
642 \let\defspec = \relax
643 \let\deftp = \relax
644 \let\deftypefn = \relax
645 \let\deftypefun = \relax
646 \let\deftypevar = \relax
647 \let\deftypevr = \relax
648 \let\defun = \relax
649 \let\defvar = \relax
650 \let\defvr = \relax
651 \let\ref = \relax
652 \let\xref = \relax
653 \let\printindex = \relax
654 \let\pxref = \relax
655 \let\settitle = \relax
656 \let\setchapternewpage = \relax
657 \let\setchapterstyle = \relax
658 \let\everyheading = \relax
659 \let\evenheading = \relax
660 \let\oddheading = \relax
661 \let\everyfooting = \relax
662 \let\evenfooting = \relax
663 \let\oddfooting = \relax
664 \let\headings = \relax
665 \let\include = \relax
666 \let\lowersections = \relax
667 \let\down = \relax
668 \let\raisesections = \relax
669 \let\up = \relax
670 \let\set = \relax
671 \let\clear = \relax
672 \let\item = \relax
675 % Ignore @ignore ... @end ignore.
677 \def\ignore{\doignore{ignore}}
679 % Also ignore @ifinfo, @ifhtml, @html, @menu, and @direntry text.
681 \def\ifinfo{\doignore{ifinfo}}
682 \def\ifhtml{\doignore{ifhtml}}
683 \def\html{\doignore{html}}
684 \def\menu{\doignore{menu}}
685 \def\direntry{\doignore{direntry}}
687 % @dircategory CATEGORY -- specify a category of the dir file
688 % which this file should belong to. Ignore this in TeX.
690 \def\dircategory{\comment}
692 % Ignore text until a line `@end #1'.
694 \def\doignore#1{\begingroup
695 % Don't complain about control sequences we have declared \outer.
696 \ignoresections
698 % Define a command to swallow text until we reach `@end #1'.
699 \long\def\doignoretext##1\end #1{\enddoignore}%
701 % Make sure that spaces turn into tokens that match what \doignoretext wants.
702 \catcode32 = 10
704 % And now expand that command.
705 \doignoretext
708 % What we do to finish off ignored text.
710 \def\enddoignore{\endgroup\ignorespaces}%
712 \newif\ifwarnedobs\warnedobsfalse
713 \def\obstexwarn{%
714 \ifwarnedobs\relax\else
715 % We need to warn folks that they may have trouble with TeX 3.0.
716 % This uses \immediate\write16 rather than \message to get newlines.
717 \immediate\write16{}
718 \immediate\write16{***WARNING*** for users of Unix TeX 3.0!}
719 \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).}
720 \immediate\write16{If you are running another version of TeX, relax.}
721 \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.}
722 \immediate\write16{ Then upgrade your TeX installation if you can.}
723 \immediate\write16{If you are stuck with version 3.0, run the}
724 \immediate\write16{ script ``tex3patch'' from the Texinfo distribution}
725 \immediate\write16{ to use a workaround.}
726 \immediate\write16{}
727 \global\warnedobstrue
731 % **In TeX 3.0, setting text in \nullfont hangs tex. For a
732 % workaround (which requires the file ``dummy.tfm'' to be installed),
733 % uncomment the following line:
734 %%%%%\font\nullfont=dummy\let\obstexwarn=\relax
736 % Ignore text, except that we keep track of conditional commands for
737 % purposes of nesting, up to an `@end #1' command.
739 \def\nestedignore#1{%
740 \obstexwarn
741 % We must actually expand the ignored text to look for the @end
742 % command, so that nested ignore constructs work. Thus, we put the
743 % text into a \vbox and then do nothing with the result. To minimize
744 % the change of memory overflow, we follow the approach outlined on
745 % page 401 of the TeXbook: make the current font be a dummy font.
747 \setbox0 = \vbox\bgroup
748 % Don't complain about control sequences we have declared \outer.
749 \ignoresections
751 % Define `@end #1' to end the box, which will in turn undefine the
752 % @end command again.
753 \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}%
755 % We are going to be parsing Texinfo commands. Most cause no
756 % trouble when they are used incorrectly, but some commands do
757 % complicated argument parsing or otherwise get confused, so we
758 % undefine them.
760 % We can't do anything about stray @-signs, unfortunately;
761 % they'll produce `undefined control sequence' errors.
762 \ignoremorecommands
764 % Set the current font to be \nullfont, a TeX primitive, and define
765 % all the font commands to also use \nullfont. We don't use
766 % dummy.tfm, as suggested in the TeXbook, because not all sites
767 % might have that installed. Therefore, math mode will still
768 % produce output, but that should be an extremely small amount of
769 % stuff compared to the main input.
771 \nullfont
772 \let\tenrm = \nullfont \let\tenit = \nullfont \let\tensl = \nullfont
773 \let\tenbf = \nullfont \let\tentt = \nullfont \let\smallcaps = \nullfont
774 \let\tensf = \nullfont
775 % Similarly for index fonts (mostly for their use in
776 % smallexample)
777 \let\indrm = \nullfont \let\indit = \nullfont \let\indsl = \nullfont
778 \let\indbf = \nullfont \let\indtt = \nullfont \let\indsc = \nullfont
779 \let\indsf = \nullfont
781 % Don't complain when characters are missing from the fonts.
782 \tracinglostchars = 0
784 % Don't bother to do space factor calculations.
785 \frenchspacing
787 % Don't report underfull hboxes.
788 \hbadness = 10000
790 % Do minimal line-breaking.
791 \pretolerance = 10000
793 % Do not execute instructions in @tex
794 \def\tex{\doignore{tex}}
797 % @set VAR sets the variable VAR to an empty value.
798 % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
800 % Since we want to separate VAR from REST-OF-LINE (which might be
801 % empty), we can't just use \parsearg; we have to insert a space of our
802 % own to delimit the rest of the line, and then take it out again if we
803 % didn't need it. Make sure the catcode of space is correct to avoid
804 % losing inside @example, for instance.
806 \def\set{\begingroup\catcode` =10 \parsearg\setxxx}
807 \def\setxxx#1{\setyyy#1 \endsetyyy}
808 \def\setyyy#1 #2\endsetyyy{%
809 \def\temp{#2}%
810 \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty
811 \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted.
813 \endgroup
815 % Can't use \xdef to pre-expand #2 and save some time, since \temp or
816 % \next or other control sequences that we've defined might get us into
817 % an infinite loop. Consider `@set foo @cite{bar}'.
818 \def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}}
820 % @clear VAR clears (i.e., unsets) the variable VAR.
822 \def\clear{\parsearg\clearxxx}
823 \def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax}
825 % @value{foo} gets the text saved in variable foo.
827 \def\value#1{\expandafter
828 \ifx\csname SET#1\endcsname\relax
829 {\{No value for ``#1''\}}
830 \else \csname SET#1\endcsname \fi}
832 % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
833 % with @set.
835 \def\ifset{\parsearg\ifsetxxx}
836 \def\ifsetxxx #1{%
837 \expandafter\ifx\csname SET#1\endcsname\relax
838 \expandafter\ifsetfail
839 \else
840 \expandafter\ifsetsucceed
843 \def\ifsetsucceed{\conditionalsucceed{ifset}}
844 \def\ifsetfail{\nestedignore{ifset}}
845 \defineunmatchedend{ifset}
847 % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
848 % defined with @set, or has been undefined with @clear.
850 \def\ifclear{\parsearg\ifclearxxx}
851 \def\ifclearxxx #1{%
852 \expandafter\ifx\csname SET#1\endcsname\relax
853 \expandafter\ifclearsucceed
854 \else
855 \expandafter\ifclearfail
858 \def\ifclearsucceed{\conditionalsucceed{ifclear}}
859 \def\ifclearfail{\nestedignore{ifclear}}
860 \defineunmatchedend{ifclear}
862 % @iftex always succeeds; we read the text following, through @end
863 % iftex). But `@end iftex' should be valid only after an @iftex.
865 \def\iftex{\conditionalsucceed{iftex}}
866 \defineunmatchedend{iftex}
868 % We can't just want to start a group at @iftex (for example) and end it
869 % at @end iftex, since then @set commands inside the conditional have no
870 % effect (they'd get reverted at the end of the group). So we must
871 % define \Eiftex to redefine itself to be its previous value. (We can't
872 % just define it to fail again with an ``unmatched end'' error, since
873 % the @ifset might be nested.)
875 \def\conditionalsucceed#1{%
876 \edef\temp{%
877 % Remember the current value of \E#1.
878 \let\nece{prevE#1} = \nece{E#1}%
880 % At the `@end #1', redefine \E#1 to be its previous value.
881 \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}%
883 \temp
886 % We need to expand lots of \csname's, but we don't want to expand the
887 % control sequences after we've constructed them.
889 \def\nece#1{\expandafter\noexpand\csname#1\endcsname}
891 % @asis just yields its argument. Used with @table, for example.
893 \def\asis#1{#1}
895 % @math means output in math mode.
896 % We don't use $'s directly in the definition of \math because control
897 % sequences like \math are expanded when the toc file is written. Then,
898 % we read the toc file back, the $'s will be normal characters (as they
899 % should be, according to the definition of Texinfo). So we must use a
900 % control sequence to switch into and out of math mode.
902 % This isn't quite enough for @math to work properly in indices, but it
903 % seems unlikely it will ever be needed there.
905 \let\implicitmath = $
906 \def\math#1{\implicitmath #1\implicitmath}
908 % @bullet and @minus need the same treatment as @math, just above.
909 \def\bullet{\implicitmath\ptexbullet\implicitmath}
910 \def\minus{\implicitmath-\implicitmath}
912 \def\node{\ENVcheck\parsearg\nodezzz}
913 \def\nodezzz#1{\nodexxx [#1,]}
914 \def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
915 \let\nwnode=\node
916 \let\lastnode=\relax
918 \def\donoderef{\ifx\lastnode\relax\else
919 \expandafter\expandafter\expandafter\setref{\lastnode}\fi
920 \global\let\lastnode=\relax}
922 \def\unnumbnoderef{\ifx\lastnode\relax\else
923 \expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi
924 \global\let\lastnode=\relax}
926 \def\appendixnoderef{\ifx\lastnode\relax\else
927 \expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi
928 \global\let\lastnode=\relax}
930 \let\refill=\relax
932 % @setfilename is done at the beginning of every texinfo file.
933 % So open here the files we need to have open while reading the input.
934 % This makes it possible to make a .fmt file for texinfo.
935 \def\setfilename{%
936 \readauxfile
937 \opencontents
938 \openindices
939 \fixbackslash % Turn off hack to swallow `\input texinfo'.
940 \global\let\setfilename=\comment % Ignore extra @setfilename cmds.
941 \comment % Ignore the actual filename.
944 \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
946 \def\inforef #1{\inforefzzz #1,,,,**}
947 \def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
948 node \samp{\ignorespaces#1{}}}
950 \def\macro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\macroxxx}
951 \def\macroxxx#1#2 \end macro{%
952 \expandafter\gdef\macrotemp#1{#2}%
953 \endgroup}
955 %\def\linemacro#1{\begingroup\ignoresections\catcode`\#=6\def\macrotemp{#1}\parsearg\linemacroxxx}
956 %\def\linemacroxxx#1#2 \end linemacro{%
957 %\let\parsearg=\relax
958 %\edef\macrotempx{\csname M\butfirst\expandafter\string\macrotemp\endcsname}%
959 %\expandafter\xdef\macrotemp{\parsearg\macrotempx}%
960 %\expandafter\gdef\macrotempx#1{#2}%
961 %\endgroup}
963 %\def\butfirst#1{}
965 \message{fonts,}
967 % Font-change commands.
969 % Texinfo supports the sans serif font style, which plain TeX does not.
970 % So we set up a \sf analogous to plain's \rm, etc.
971 \newfam\sffam
972 \def\sf{\fam=\sffam \tensf}
973 \let\li = \sf % Sometimes we call it \li, not \sf.
975 % We don't need math for this one.
976 \def\ttsl{\tenttsl}
978 %% Try out Computer Modern fonts at \magstephalf
979 \let\mainmagstep=\magstephalf
981 % Set the font macro #1 to the font named #2, adding on the
982 % specified font prefix (normally `cm').
983 % #3 is the font's design size, #4 is a scale factor
984 \def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4}
986 % Use cm as the default font prefix.
987 % To specify the font prefix, you must define \fontprefix
988 % before you read in texinfo.tex.
989 \ifx\fontprefix\undefined
990 \def\fontprefix{cm}
992 % Support font families that don't use the same naming scheme as CM.
993 \def\rmshape{r}
994 \def\rmbshape{bx} %where the normal face is bold
995 \def\bfshape{b}
996 \def\bxshape{bx}
997 \def\ttshape{tt}
998 \def\ttbshape{tt}
999 \def\ttslshape{sltt}
1000 \def\itshape{ti}
1001 \def\itbshape{bxti}
1002 \def\slshape{sl}
1003 \def\slbshape{bxsl}
1004 \def\sfshape{ss}
1005 \def\sfbshape{ss}
1006 \def\scshape{csc}
1007 \def\scbshape{csc}
1009 \ifx\bigger\relax
1010 \let\mainmagstep=\magstep1
1011 \setfont\textrm\rmshape{12}{1000}
1012 \setfont\texttt\ttshape{12}{1000}
1013 \else
1014 \setfont\textrm\rmshape{10}{\mainmagstep}
1015 \setfont\texttt\ttshape{10}{\mainmagstep}
1017 % Instead of cmb10, you many want to use cmbx10.
1018 % cmbx10 is a prettier font on its own, but cmb10
1019 % looks better when embedded in a line with cmr10.
1020 \setfont\textbf\bfshape{10}{\mainmagstep}
1021 \setfont\textit\itshape{10}{\mainmagstep}
1022 \setfont\textsl\slshape{10}{\mainmagstep}
1023 \setfont\textsf\sfshape{10}{\mainmagstep}
1024 \setfont\textsc\scshape{10}{\mainmagstep}
1025 \setfont\textttsl\ttslshape{10}{\mainmagstep}
1026 \font\texti=cmmi10 scaled \mainmagstep
1027 \font\textsy=cmsy10 scaled \mainmagstep
1029 % A few fonts for @defun, etc.
1030 \setfont\defbf\bxshape{10}{\magstep1} %was 1314
1031 \setfont\deftt\ttshape{10}{\magstep1}
1032 \def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf}
1034 % Fonts for indices and small examples (9pt).
1035 % We actually use the slanted font rather than the italic,
1036 % because texinfo normally uses the slanted fonts for that.
1037 % Do not make many font distinctions in general in the index, since they
1038 % aren't very useful.
1039 \setfont\ninett\ttshape{9}{1000}
1040 \setfont\indrm\rmshape{9}{1000}
1041 \setfont\indit\slshape{9}{1000}
1042 \let\indsl=\indit
1043 \let\indtt=\ninett
1044 \let\indttsl=\ninett
1045 \let\indsf=\indrm
1046 \let\indbf=\indrm
1047 \setfont\indsc\scshape{10}{900}
1048 \font\indi=cmmi9
1049 \font\indsy=cmsy9
1051 % Chapter (and unnumbered) fonts (17.28pt).
1052 \setfont\chaprm\rmbshape{12}{\magstep2}
1053 \setfont\chapit\itbshape{10}{\magstep3}
1054 \setfont\chapsl\slbshape{10}{\magstep3}
1055 \setfont\chaptt\ttbshape{12}{\magstep2}
1056 \setfont\chapttsl\ttslshape{10}{\magstep3}
1057 \setfont\chapsf\sfbshape{12}{\magstep2}
1058 \let\chapbf=\chaprm
1059 \setfont\chapsc\scbshape{10}{\magstep3}
1060 \font\chapi=cmmi12 scaled \magstep2
1061 \font\chapsy=cmsy10 scaled \magstep3
1063 % Section fonts (14.4pt).
1064 \setfont\secrm\rmbshape{12}{\magstep1}
1065 \setfont\secit\itbshape{10}{\magstep2}
1066 \setfont\secsl\slbshape{10}{\magstep2}
1067 \setfont\sectt\ttbshape{12}{\magstep1}
1068 \setfont\secttsl\ttslshape{10}{\magstep2}
1069 \setfont\secsf\sfbshape{12}{\magstep1}
1070 \let\secbf\secrm
1071 \setfont\secsc\scbshape{10}{\magstep2}
1072 \font\seci=cmmi12 scaled \magstep1
1073 \font\secsy=cmsy10 scaled \magstep2
1075 % \setfont\ssecrm\bxshape{10}{\magstep1} % This size an font looked bad.
1076 % \setfont\ssecit\itshape{10}{\magstep1} % The letters were too crowded.
1077 % \setfont\ssecsl\slshape{10}{\magstep1}
1078 % \setfont\ssectt\ttshape{10}{\magstep1}
1079 % \setfont\ssecsf\sfshape{10}{\magstep1}
1081 %\setfont\ssecrm\bfshape{10}{1315} % Note the use of cmb rather than cmbx.
1082 %\setfont\ssecit\itshape{10}{1315} % Also, the size is a little larger than
1083 %\setfont\ssecsl\slshape{10}{1315} % being scaled magstep1.
1084 %\setfont\ssectt\ttshape{10}{1315}
1085 %\setfont\ssecsf\sfshape{10}{1315}
1087 %\let\ssecbf=\ssecrm
1089 % Subsection fonts (13.15pt).
1090 \setfont\ssecrm\rmbshape{12}{\magstephalf}
1091 \setfont\ssecit\itbshape{10}{1315}
1092 \setfont\ssecsl\slbshape{10}{1315}
1093 \setfont\ssectt\ttbshape{12}{\magstephalf}
1094 \setfont\ssecttsl\ttslshape{10}{\magstep1}
1095 \setfont\ssecsf\sfbshape{12}{\magstephalf}
1096 \let\ssecbf\ssecrm
1097 \setfont\ssecsc\scbshape{10}{\magstep1}
1098 \font\sseci=cmmi12 scaled \magstephalf
1099 \font\ssecsy=cmsy10 scaled \magstep1
1100 % The smallcaps and symbol fonts should actually be scaled \magstep1.5,
1101 % but that is not a standard magnification.
1103 % Fonts for title page:
1104 \setfont\titlerm\rmbshape{12}{\magstep3}
1105 \let\authorrm = \secrm
1107 % In order for the font changes to affect most math symbols and letters,
1108 % we have to define the \textfont of the standard families. Since
1109 % texinfo doesn't allow for producing subscripts and superscripts, we
1110 % don't bother to reset \scriptfont and \scriptscriptfont (which would
1111 % also require loading a lot more fonts).
1113 \def\resetmathfonts{%
1114 \textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy
1115 \textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf
1116 \textfont\ttfam = \tentt \textfont\sffam = \tensf
1120 % The font-changing commands redefine the meanings of \tenSTYLE, instead
1121 % of just \STYLE. We do this so that font changes will continue to work
1122 % in math mode, where it is the current \fam that is relevant in most
1123 % cases, not the current font. Plain TeX does \def\bf{\fam=\bffam
1124 % \tenbf}, for example. By redefining \tenbf, we obviate the need to
1125 % redefine \bf itself.
1126 \def\textfonts{%
1127 \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
1128 \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
1129 \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl
1130 \resetmathfonts}
1131 \def\chapfonts{%
1132 \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
1133 \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
1134 \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl
1135 \resetmathfonts \setleading{19pt}}
1136 \def\secfonts{%
1137 \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
1138 \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
1139 \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl
1140 \resetmathfonts \setleading{16pt}}
1141 \def\subsecfonts{%
1142 \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
1143 \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
1144 \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl
1145 \resetmathfonts \setleading{15pt}}
1146 \let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf?
1147 \def\indexfonts{%
1148 \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl
1149 \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc
1150 \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy \let\tenttsl=\indttsl
1151 \resetmathfonts \setleading{12pt}}
1153 % Set up the default fonts, so we can use them for creating boxes.
1155 \textfonts
1157 % Count depth in font-changes, for error checks
1158 \newcount\fontdepth \fontdepth=0
1160 % Fonts for short table of contents.
1161 \setfont\shortcontrm\rmshape{12}{1000}
1162 \setfont\shortcontbf\bxshape{12}{1000}
1163 \setfont\shortcontsl\slshape{12}{1000}
1165 %% Add scribe-like font environments, plus @l for inline lisp (usually sans
1166 %% serif) and @ii for TeX italic
1168 % \smartitalic{ARG} outputs arg in italics, followed by an italic correction
1169 % unless the following character is such as not to need one.
1170 \def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
1171 \def\smartitalic#1{{\sl #1}\futurelet\next\smartitalicx}
1173 \let\i=\smartitalic
1174 \let\var=\smartitalic
1175 \let\dfn=\smartitalic
1176 \let\emph=\smartitalic
1177 \let\cite=\smartitalic
1179 \def\b#1{{\bf #1}}
1180 \let\strong=\b
1182 % We can't just use \exhyphenpenalty, because that only has effect at
1183 % the end of a paragraph. Restore normal hyphenation at the end of the
1184 % group within which \nohyphenation is presumably called.
1186 \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
1187 \def\restorehyphenation{\hyphenchar\font = `- }
1189 \def\t#1{%
1190 {\tt \rawbackslash \frenchspacing #1}%
1191 \null
1193 \let\ttfont=\t
1194 \def\samp #1{`\tclose{#1}'\null}
1195 \setfont\smallrm\rmshape{8}{1000}
1196 \font\smallsy=cmsy9
1197 \def\key#1{{\smallrm\textfont2=\smallsy \leavevmode\hbox{%
1198 \raise0.4pt\hbox{$\langle$}\kern-.08em\vtop{%
1199 \vbox{\hrule\kern-0.4pt
1200 \hbox{\raise0.4pt\hbox{\vphantom{$\langle$}}#1}}%
1201 \kern-0.4pt\hrule}%
1202 \kern-.06em\raise0.4pt\hbox{$\rangle$}}}}
1203 % The old definition, with no lozenge:
1204 %\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
1205 \def\ctrl #1{{\tt \rawbackslash \hat}#1}
1207 \let\file=\samp
1208 \let\email=\samp
1209 \let\url=\samp % perhaps include a hypertex \special eventually
1211 % @code is a modification of @t,
1212 % which makes spaces the same size as normal in the surrounding text.
1213 \def\tclose#1{%
1215 % Change normal interword space to be same as for the current font.
1216 \spaceskip = \fontdimen2\font
1218 % Switch to typewriter.
1221 % But `\ ' produces the large typewriter interword space.
1222 \def\ {{\spaceskip = 0pt{} }}%
1224 % Turn off hyphenation.
1225 \nohyphenation
1227 \rawbackslash
1228 \frenchspacing
1231 \null
1234 % We *must* turn on hyphenation at `-' and `_' in \code.
1235 % Otherwise, it is too hard to avoid overfull hboxes
1236 % in the Emacs manual, the Library manual, etc.
1238 % Unfortunately, TeX uses one parameter (\hyphenchar) to control
1239 % both hyphenation at - and hyphenation within words.
1240 % We must therefore turn them both off (\tclose does that)
1241 % and arrange explicitly to hyphenate an a dash.
1242 % -- rms.
1244 \catcode`\-=\active
1245 \catcode`\_=\active
1246 \global\def\code{\begingroup \catcode`\-=\active \let-\codedash \catcode`\_=\active \let_\codeunder \codex}
1247 % The following is used by \doprintindex to insure that long function names
1248 % wrap around. It is necessary for - and _ to be active before the index is
1249 % read from the file, as \entry parses the arguments long before \code is
1250 % ever called. -- mycroft
1251 \global\def\indexbreaks{\catcode`\-=\active \let-\realdash \catcode`\_=\active \let_\realunder}
1254 \def\realdash{-}
1255 \def\realunder{_}
1256 \def\codedash{-\discretionary{}{}{}}
1257 \def\codeunder{\normalunderscore\discretionary{}{}{}}
1258 \def\codex #1{\tclose{#1}\endgroup}
1260 %\let\exp=\tclose %Was temporary
1262 % @kbd is like @code, except that if the argument is just one @key command,
1263 % then @kbd has no effect.
1265 \def\xkey{\key}
1266 \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
1267 \ifx\one\xkey\ifx\threex\three \key{#2}%
1268 \else{\tclose{\ttsl\look}}\fi
1269 \else{\tclose{\ttsl\look}}\fi}
1271 % Check if we are currently using a typewriter font. Since all the
1272 % Computer Modern typewriter fonts have zero interword stretch (and
1273 % shrink), and it is reasonable to expect all typewriter fonts to have
1274 % this property, we can check that font parameter.
1276 \def\ifmonospace{\ifdim\fontdimen3\font=0pt }
1278 % Typeset a dimension, e.g., `in' or `pt'. The only reason for the
1279 % argument is to make the input look right: @dmn{pt} instead of
1280 % @dmn{}pt.
1282 \def\dmn#1{\thinspace #1}
1284 \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}
1286 \def\l#1{{\li #1}\null} %
1288 \def\r#1{{\rm #1}} % roman font
1289 % Use of \lowercase was suggested.
1290 \def\sc#1{{\smallcaps#1}} % smallcaps font
1291 \def\ii#1{{\it #1}} % italic font
1293 % @pounds{} is a sterling sign.
1294 \def\pounds{{\it \$$}}
1296 \message{page headings,}
1298 \newskip\titlepagetopglue \titlepagetopglue = 1.5in
1299 \newskip\titlepagebottomglue \titlepagebottomglue = 2pc
1301 % First the title page. Must do @settitle before @titlepage.
1302 \def\titlefont#1{{\titlerm #1}}
1304 \newif\ifseenauthor
1305 \newif\iffinishedtitlepage
1307 \def\shorttitlepage{\parsearg\shorttitlepagezzz}
1308 \def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
1309 \endgroup\page\hbox{}\page}
1311 \def\titlepage{\begingroup \parindent=0pt \textfonts
1312 \let\subtitlerm=\tenrm
1313 % I deinstalled the following change because \cmr12 is undefined.
1314 % This change was not in the ChangeLog anyway. --rms.
1315 % \let\subtitlerm=\cmr12
1316 \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
1318 \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}%
1320 % Leave some space at the very top of the page.
1321 \vglue\titlepagetopglue
1323 % Now you can print the title using @title.
1324 \def\title{\parsearg\titlezzz}%
1325 \def\titlezzz##1{\leftline{\titlefont{##1}}
1326 % print a rule at the page bottom also.
1327 \finishedtitlepagefalse
1328 \vskip4pt \hrule height 4pt width \hsize \vskip4pt}%
1329 % No rule at page bottom unless we print one at the top with @title.
1330 \finishedtitlepagetrue
1332 % Now you can put text using @subtitle.
1333 \def\subtitle{\parsearg\subtitlezzz}%
1334 \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}%
1336 % @author should come last, but may come many times.
1337 \def\author{\parsearg\authorzzz}%
1338 \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi
1339 {\authorfont \leftline{##1}}}%
1341 % Most title ``pages'' are actually two pages long, with space
1342 % at the top of the second. We don't want the ragged left on the second.
1343 \let\oldpage = \page
1344 \def\page{%
1345 \iffinishedtitlepage\else
1346 \finishtitlepage
1348 \oldpage
1349 \let\page = \oldpage
1350 \hbox{}}%
1351 % \def\page{\oldpage \hbox{}}
1354 \def\Etitlepage{%
1355 \iffinishedtitlepage\else
1356 \finishtitlepage
1358 % It is important to do the page break before ending the group,
1359 % because the headline and footline are only empty inside the group.
1360 % If we use the new definition of \page, we always get a blank page
1361 % after the title page, which we certainly don't want.
1362 \oldpage
1363 \endgroup
1364 \HEADINGSon
1367 \def\finishtitlepage{%
1368 \vskip4pt \hrule height 2pt width \hsize
1369 \vskip\titlepagebottomglue
1370 \finishedtitlepagetrue
1373 %%% Set up page headings and footings.
1375 \let\thispage=\folio
1377 \newtoks \evenheadline % Token sequence for heading line of even pages
1378 \newtoks \oddheadline % Token sequence for heading line of odd pages
1379 \newtoks \evenfootline % Token sequence for footing line of even pages
1380 \newtoks \oddfootline % Token sequence for footing line of odd pages
1382 % Now make Tex use those variables
1383 \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
1384 \else \the\evenheadline \fi}}
1385 \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
1386 \else \the\evenfootline \fi}\HEADINGShook}
1387 \let\HEADINGShook=\relax
1389 % Commands to set those variables.
1390 % For example, this is what @headings on does
1391 % @evenheading @thistitle|@thispage|@thischapter
1392 % @oddheading @thischapter|@thispage|@thistitle
1393 % @evenfooting @thisfile||
1394 % @oddfooting ||@thisfile
1396 \def\evenheading{\parsearg\evenheadingxxx}
1397 \def\oddheading{\parsearg\oddheadingxxx}
1398 \def\everyheading{\parsearg\everyheadingxxx}
1400 \def\evenfooting{\parsearg\evenfootingxxx}
1401 \def\oddfooting{\parsearg\oddfootingxxx}
1402 \def\everyfooting{\parsearg\everyfootingxxx}
1404 {\catcode`\@=0 %
1406 \gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish}
1407 \gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{%
1408 \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1410 \gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish}
1411 \gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{%
1412 \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1414 \gdef\everyheadingxxx #1{\everyheadingyyy #1@|@|@|@|\finish}
1415 \gdef\everyheadingyyy #1@|#2@|#3@|#4\finish{%
1416 \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
1417 \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1419 \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish}
1420 \gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{%
1421 \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1423 \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish}
1424 \gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{%
1425 \global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1427 \gdef\everyfootingxxx #1{\everyfootingyyy #1@|@|@|@|\finish}
1428 \gdef\everyfootingyyy #1@|#2@|#3@|#4\finish{%
1429 \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
1430 \global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1432 }% unbind the catcode of @.
1434 % @headings double turns headings on for double-sided printing.
1435 % @headings single turns headings on for single-sided printing.
1436 % @headings off turns them off.
1437 % @headings on same as @headings double, retained for compatibility.
1438 % @headings after turns on double-sided headings after this page.
1439 % @headings doubleafter turns on double-sided headings after this page.
1440 % @headings singleafter turns on single-sided headings after this page.
1441 % By default, they are off at the start of a document,
1442 % and turned `on' after @end titlepage.
1444 \def\headings #1 {\csname HEADINGS#1\endcsname}
1446 \def\HEADINGSoff{
1447 \global\evenheadline={\hfil} \global\evenfootline={\hfil}
1448 \global\oddheadline={\hfil} \global\oddfootline={\hfil}}
1449 \HEADINGSoff
1450 % When we turn headings on, set the page number to 1.
1451 % For double-sided printing, put current file name in lower left corner,
1452 % chapter name on inside top of right hand pages, document
1453 % title on inside top of left hand pages, and page numbers on outside top
1454 % edge of all pages.
1455 \def\HEADINGSdouble{
1456 \global\pageno=1
1457 \global\evenfootline={\hfil}
1458 \global\oddfootline={\hfil}
1459 \global\evenheadline={\line{\folio\hfil\thistitle}}
1460 \global\oddheadline={\line{\thischapter\hfil\folio}}
1461 \global\let\contentsalignmacro = \chapoddpage
1463 \let\contentsalignmacro = \chappager
1465 % For single-sided printing, chapter title goes across top left of page,
1466 % page number on top right.
1467 \def\HEADINGSsingle{
1468 \global\pageno=1
1469 \global\evenfootline={\hfil}
1470 \global\oddfootline={\hfil}
1471 \global\evenheadline={\line{\thischapter\hfil\folio}}
1472 \global\oddheadline={\line{\thischapter\hfil\folio}}
1473 \global\let\contentsalignmacro = \chappager
1475 \def\HEADINGSon{\HEADINGSdouble}
1477 \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
1478 \let\HEADINGSdoubleafter=\HEADINGSafter
1479 \def\HEADINGSdoublex{%
1480 \global\evenfootline={\hfil}
1481 \global\oddfootline={\hfil}
1482 \global\evenheadline={\line{\folio\hfil\thistitle}}
1483 \global\oddheadline={\line{\thischapter\hfil\folio}}
1484 \global\let\contentsalignmacro = \chapoddpage
1487 \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
1488 \def\HEADINGSsinglex{%
1489 \global\evenfootline={\hfil}
1490 \global\oddfootline={\hfil}
1491 \global\evenheadline={\line{\thischapter\hfil\folio}}
1492 \global\oddheadline={\line{\thischapter\hfil\folio}}
1493 \global\let\contentsalignmacro = \chappager
1496 % Subroutines used in generating headings
1497 % Produces Day Month Year style of output.
1498 \def\today{\number\day\space
1499 \ifcase\month\or
1500 January\or February\or March\or April\or May\or June\or
1501 July\or August\or September\or October\or November\or December\fi
1502 \space\number\year}
1504 % Use this if you want the Month Day, Year style of output.
1505 %\def\today{\ifcase\month\or
1506 %January\or February\or March\or April\or May\or June\or
1507 %July\or August\or September\or October\or November\or December\fi
1508 %\space\number\day, \number\year}
1510 % @settitle line... specifies the title of the document, for headings
1511 % It generates no output of its own
1513 \def\thistitle{No Title}
1514 \def\settitle{\parsearg\settitlezzz}
1515 \def\settitlezzz #1{\gdef\thistitle{#1}}
1517 \message{tables,}
1519 % @tabs -- simple alignment
1521 % These don't work. For one thing, \+ is defined as outer.
1522 % So these macros cannot even be defined.
1524 %\def\tabs{\parsearg\tabszzz}
1525 %\def\tabszzz #1{\settabs\+#1\cr}
1526 %\def\tabline{\parsearg\tablinezzz}
1527 %\def\tablinezzz #1{\+#1\cr}
1528 %\def\&{&}
1530 % Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
1532 % default indentation of table text
1533 \newdimen\tableindent \tableindent=.8in
1534 % default indentation of @itemize and @enumerate text
1535 \newdimen\itemindent \itemindent=.3in
1536 % margin between end of table item and start of table text.
1537 \newdimen\itemmargin \itemmargin=.1in
1539 % used internally for \itemindent minus \itemmargin
1540 \newdimen\itemmax
1542 % Note @table, @vtable, and @vtable define @item, @itemx, etc., with
1543 % these defs.
1544 % They also define \itemindex
1545 % to index the item name in whatever manner is desired (perhaps none).
1547 \newif\ifitemxneedsnegativevskip
1549 \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
1551 \def\internalBitem{\smallbreak \parsearg\itemzzz}
1552 \def\internalBitemx{\itemxpar \parsearg\itemzzz}
1554 \def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
1555 \def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz}
1557 \def\internalBkitem{\smallbreak \parsearg\kitemzzz}
1558 \def\internalBkitemx{\itemxpar \parsearg\kitemzzz}
1560 \def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}%
1561 \itemzzz {#1}}
1563 \def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}%
1564 \itemzzz {#1}}
1566 \def\itemzzz #1{\begingroup %
1567 \advance\hsize by -\rightskip
1568 \advance\hsize by -\tableindent
1569 \setbox0=\hbox{\itemfont{#1}}%
1570 \itemindex{#1}%
1571 \nobreak % This prevents a break before @itemx.
1573 % Be sure we are not still in the middle of a paragraph.
1574 %{\parskip = 0in
1575 %\par
1578 % If the item text does not fit in the space we have, put it on a line
1579 % by itself, and do not allow a page break either before or after that
1580 % line. We do not start a paragraph here because then if the next
1581 % command is, e.g., @kindex, the whatsit would get put into the
1582 % horizontal list on a line by itself, resulting in extra blank space.
1583 \ifdim \wd0>\itemmax
1585 % Make this a paragraph so we get the \parskip glue and wrapping,
1586 % but leave it ragged-right.
1587 \begingroup
1588 \advance\leftskip by-\tableindent
1589 \advance\hsize by\tableindent
1590 \advance\rightskip by0pt plus1fil
1591 \leavevmode\unhbox0\par
1592 \endgroup
1594 % We're going to be starting a paragraph, but we don't want the
1595 % \parskip glue -- logically it's part of the @item we just started.
1596 \nobreak \vskip-\parskip
1598 % Stop a page break at the \parskip glue coming up. Unfortunately
1599 % we can't prevent a possible page break at the following
1600 % \baselineskip glue.
1601 \nobreak
1602 \endgroup
1603 \itemxneedsnegativevskipfalse
1604 \else
1605 % The item text fits into the space. Start a paragraph, so that the
1606 % following text (if any) will end up on the same line. Since that
1607 % text will be indented by \tableindent, we make the item text be in
1608 % a zero-width box.
1609 \noindent
1610 \rlap{\hskip -\tableindent\box0}\ignorespaces%
1611 \endgroup%
1612 \itemxneedsnegativevskiptrue%
1616 \def\item{\errmessage{@item while not in a table}}
1617 \def\itemx{\errmessage{@itemx while not in a table}}
1618 \def\kitem{\errmessage{@kitem while not in a table}}
1619 \def\kitemx{\errmessage{@kitemx while not in a table}}
1620 \def\xitem{\errmessage{@xitem while not in a table}}
1621 \def\xitemx{\errmessage{@xitemx while not in a table}}
1623 %% Contains a kludge to get @end[description] to work
1624 \def\description{\tablez{\dontindex}{1}{}{}{}{}}
1626 \def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
1627 {\obeylines\obeyspaces%
1628 \gdef\tablex #1^^M{%
1629 \tabley\dontindex#1 \endtabley}}
1631 \def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
1632 {\obeylines\obeyspaces%
1633 \gdef\ftablex #1^^M{%
1634 \tabley\fnitemindex#1 \endtabley
1635 \def\Eftable{\endgraf\afterenvbreak\endgroup}%
1636 \let\Etable=\relax}}
1638 \def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex}
1639 {\obeylines\obeyspaces%
1640 \gdef\vtablex #1^^M{%
1641 \tabley\vritemindex#1 \endtabley
1642 \def\Evtable{\endgraf\afterenvbreak\endgroup}%
1643 \let\Etable=\relax}}
1645 \def\dontindex #1{}
1646 \def\fnitemindex #1{\doind {fn}{\code{#1}}}%
1647 \def\vritemindex #1{\doind {vr}{\code{#1}}}%
1649 {\obeyspaces %
1650 \gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
1651 \tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
1653 \def\tablez #1#2#3#4#5#6{%
1654 \aboveenvbreak %
1655 \begingroup %
1656 \def\Edescription{\Etable}% Necessary kludge.
1657 \let\itemindex=#1%
1658 \ifnum 0#3>0 \advance \leftskip by #3\mil \fi %
1659 \ifnum 0#4>0 \tableindent=#4\mil \fi %
1660 \ifnum 0#5>0 \advance \rightskip by #5\mil \fi %
1661 \def\itemfont{#2}%
1662 \itemmax=\tableindent %
1663 \advance \itemmax by -\itemmargin %
1664 \advance \leftskip by \tableindent %
1665 \exdentamount=\tableindent
1666 \parindent = 0pt
1667 \parskip = \smallskipamount
1668 \ifdim \parskip=0pt \parskip=2pt \fi%
1669 \def\Etable{\endgraf\afterenvbreak\endgroup}%
1670 \let\item = \internalBitem %
1671 \let\itemx = \internalBitemx %
1672 \let\kitem = \internalBkitem %
1673 \let\kitemx = \internalBkitemx %
1674 \let\xitem = \internalBxitem %
1675 \let\xitemx = \internalBxitemx %
1678 % This is the counter used by @enumerate, which is really @itemize
1680 \newcount \itemno
1682 \def\itemize{\parsearg\itemizezzz}
1684 \def\itemizezzz #1{%
1685 \begingroup % ended by the @end itemsize
1686 \itemizey {#1}{\Eitemize}
1689 \def\itemizey #1#2{%
1690 \aboveenvbreak %
1691 \itemmax=\itemindent %
1692 \advance \itemmax by -\itemmargin %
1693 \advance \leftskip by \itemindent %
1694 \exdentamount=\itemindent
1695 \parindent = 0pt %
1696 \parskip = \smallskipamount %
1697 \ifdim \parskip=0pt \parskip=2pt \fi%
1698 \def#2{\endgraf\afterenvbreak\endgroup}%
1699 \def\itemcontents{#1}%
1700 \let\item=\itemizeitem}
1702 % Set sfcode to normal for the chars that usually have another value.
1703 % These are `.?!:;,'
1704 \def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000
1705 \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 }
1707 % \splitoff TOKENS\endmark defines \first to be the first token in
1708 % TOKENS, and \rest to be the remainder.
1710 \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
1712 % Allow an optional argument of an uppercase letter, lowercase letter,
1713 % or number, to specify the first label in the enumerated list. No
1714 % argument is the same as `1'.
1716 \def\enumerate{\parsearg\enumeratezzz}
1717 \def\enumeratezzz #1{\enumeratey #1 \endenumeratey}
1718 \def\enumeratey #1 #2\endenumeratey{%
1719 \begingroup % ended by the @end enumerate
1721 % If we were given no argument, pretend we were given `1'.
1722 \def\thearg{#1}%
1723 \ifx\thearg\empty \def\thearg{1}\fi
1725 % Detect if the argument is a single token. If so, it might be a
1726 % letter. Otherwise, the only valid thing it can be is a number.
1727 % (We will always have one token, because of the test we just made.
1728 % This is a good thing, since \splitoff doesn't work given nothing at
1729 % all -- the first parameter is undelimited.)
1730 \expandafter\splitoff\thearg\endmark
1731 \ifx\rest\empty
1732 % Only one token in the argument. It could still be anything.
1733 % A ``lowercase letter'' is one whose \lccode is nonzero.
1734 % An ``uppercase letter'' is one whose \lccode is both nonzero, and
1735 % not equal to itself.
1736 % Otherwise, we assume it's a number.
1738 % We need the \relax at the end of the \ifnum lines to stop TeX from
1739 % continuing to look for a <number>.
1741 \ifnum\lccode\expandafter`\thearg=0\relax
1742 \numericenumerate % a number (we hope)
1743 \else
1744 % It's a letter.
1745 \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
1746 \lowercaseenumerate % lowercase letter
1747 \else
1748 \uppercaseenumerate % uppercase letter
1751 \else
1752 % Multiple tokens in the argument. We hope it's a number.
1753 \numericenumerate
1757 % An @enumerate whose labels are integers. The starting integer is
1758 % given in \thearg.
1760 \def\numericenumerate{%
1761 \itemno = \thearg
1762 \startenumeration{\the\itemno}%
1765 % The starting (lowercase) letter is in \thearg.
1766 \def\lowercaseenumerate{%
1767 \itemno = \expandafter`\thearg
1768 \startenumeration{%
1769 % Be sure we're not beyond the end of the alphabet.
1770 \ifnum\itemno=0
1771 \errmessage{No more lowercase letters in @enumerate; get a bigger
1772 alphabet}%
1774 \char\lccode\itemno
1778 % The starting (uppercase) letter is in \thearg.
1779 \def\uppercaseenumerate{%
1780 \itemno = \expandafter`\thearg
1781 \startenumeration{%
1782 % Be sure we're not beyond the end of the alphabet.
1783 \ifnum\itemno=0
1784 \errmessage{No more uppercase letters in @enumerate; get a bigger
1785 alphabet}
1787 \char\uccode\itemno
1791 % Call itemizey, adding a period to the first argument and supplying the
1792 % common last two arguments. Also subtract one from the initial value in
1793 % \itemno, since @item increments \itemno.
1795 \def\startenumeration#1{%
1796 \advance\itemno by -1
1797 \itemizey{#1.}\Eenumerate\flushcr
1800 % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
1801 % to @enumerate.
1803 \def\alphaenumerate{\enumerate{a}}
1804 \def\capsenumerate{\enumerate{A}}
1805 \def\Ealphaenumerate{\Eenumerate}
1806 \def\Ecapsenumerate{\Eenumerate}
1808 % Definition of @item while inside @itemize.
1810 \def\itemizeitem{%
1811 \advance\itemno by 1
1812 {\let\par=\endgraf \smallbreak}%
1813 \ifhmode \errmessage{\in hmode at itemizeitem}\fi
1814 {\parskip=0in \hskip 0pt
1815 \hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
1816 \vadjust{\penalty 1200}}%
1817 \flushcr}
1819 % @multitable macros
1820 % Amy Hendrickson, 8/18/94, 3/6/96
1822 % @multitable ... @end multitable will make as many columns as desired.
1823 % Contents of each column will wrap at width given in preamble. Width
1824 % can be specified either with sample text given in a template line,
1825 % or in percent of \hsize, the current width of text on page.
1827 % Table can continue over pages but will only break between lines.
1829 % To make preamble:
1831 % Either define widths of columns in terms of percent of \hsize:
1832 % @multitable @columnfractions .25 .3 .45
1833 % @item ...
1835 % Numbers following @columnfractions are the percent of the total
1836 % current hsize to be used for each column. You may use as many
1837 % columns as desired.
1839 % Or use a template:
1840 % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
1841 % @item ...
1842 % using the widest term desired in each column.
1844 % For those who want to use more than one line's worth of words in
1845 % the preamble, break the line within one argument and it
1846 % will parse correctly, i.e.,
1848 % @multitable {Column 1 template} {Column 2 template} {Column 3
1849 % template}
1850 % Not:
1851 % @multitable {Column 1 template} {Column 2 template}
1852 % {Column 3 template}
1854 % Each new table line starts with @item, each subsequent new column
1855 % starts with @tab. Empty columns may be produced by supplying @tab's
1856 % with nothing between them for as many times as empty columns are needed,
1857 % ie, @tab@tab@tab will produce two empty columns.
1859 % @item, @tab, @multicolumn or @endmulticolumn do not need to be on their
1860 % own lines, but it will not hurt if they are.
1862 % Sample multitable:
1864 % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
1865 % @item first col stuff @tab second col stuff @tab third col
1866 % @item
1867 % first col stuff
1868 % @tab
1869 % second col stuff
1870 % @tab
1871 % third col
1872 % @item first col stuff @tab second col stuff
1873 % @tab Many paragraphs of text may be used in any column.
1875 % They will wrap at the width determined by the template.
1876 % @item@tab@tab This will be in third column.
1877 % @end multitable
1879 % Default dimensions may be reset by user.
1880 % @multitableparskip is vertical space between paragraphs in table.
1881 % @multitableparindent is paragraph indent in table.
1882 % @multitablecolmargin is horizontal space to be left between columns.
1883 % @multitablelinespace is space to leave between table items, baseline
1884 % to baseline.
1885 % 0pt means it depends on current normal line spacing.
1887 %%%%
1888 % Dimensions
1890 \newskip\multitableparskip
1891 \newskip\multitableparindent
1892 \newdimen\multitablecolspace
1893 \newskip\multitablelinespace
1894 \multitableparskip=0pt
1895 \multitableparindent=6pt
1896 \multitablecolspace=12pt
1897 \multitablelinespace=0pt
1899 %%%%
1900 % Macros used to set up halign preamble:
1901 \let\endsetuptable\relax
1902 \def\xendsetuptable{\endsetuptable}
1903 \let\columnfractions\relax
1904 \def\xcolumnfractions{\columnfractions}
1905 \newif\ifsetpercent
1907 %% 2/1/96, to allow fractions to be given with more than one digit.
1908 \def\pickupwholefraction#1 {\global\advance\colcount by1 %
1909 \expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}%
1910 \setuptable}
1912 \newcount\colcount
1913 \def\setuptable#1{\def\firstarg{#1}%
1914 \ifx\firstarg\xendsetuptable\let\go\relax%
1915 \else
1916 \ifx\firstarg\xcolumnfractions\global\setpercenttrue%
1917 \else
1918 \ifsetpercent
1919 \let\go\pickupwholefraction % In this case arg of setuptable
1920 % is the decimal point before the
1921 % number given in percent of hsize.
1922 % We don't need this so we don't use it.
1923 \else
1924 \global\advance\colcount by1
1925 \setbox0=\hbox{#1}%
1926 \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
1927 \fi%
1928 \fi%
1929 \ifx\go\pickupwholefraction\else\let\go\setuptable\fi%
1930 \fi\go}
1932 %%%%
1933 % multitable syntax
1934 \def\tab{&\hskip1sp\relax} % 2/2/96
1935 % tiny skip here makes sure this column space is
1936 % maintained, even if it is never used.
1939 %%%%
1940 % @multitable ... @end multitable definitions:
1942 \def\multitable{\parsearg\dotable}
1944 \def\dotable#1{\bgroup
1945 \let\item\cr
1946 \tolerance=9500
1947 \hbadness=9500
1948 \setmultitablespacing
1949 \parskip=\multitableparskip
1950 \parindent=\multitableparindent
1951 \overfullrule=0pt
1952 \global\colcount=0\relax%
1953 \def\Emultitable{\global\setpercentfalse\global\everycr{}\cr\egroup\egroup}%
1954 % To parse everything between @multitable and @item :
1955 \setuptable#1 \endsetuptable
1956 % Need to reset this to 0 after \setuptable.
1957 \global\colcount=0\relax%
1959 % This preamble sets up a generic column definition, which will
1960 % be used as many times as user calls for columns.
1961 % \vtop will set a single line and will also let text wrap and
1962 % continue for many paragraphs if desired.
1963 \halign\bgroup&\global\advance\colcount by 1\relax%
1964 \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
1965 % In order to keep entries from bumping into each other
1966 % we will add a \leftskip of \multitablecolspace to all columns after
1967 % the first one.
1968 % If a template has been used, we will add \multitablecolspace
1969 % to the width of each template entry.
1970 % If user has set preamble in terms of percent of \hsize
1971 % we will use that dimension as the width of the column, and
1972 % the \leftskip will keep entries from bumping into each other.
1973 % Table will start at left margin and final column will justify at
1974 % right margin.
1975 \ifnum\colcount=1
1976 \else
1977 \ifsetpercent
1978 \else
1979 % If user has <not> set preamble in terms of percent of \hsize
1980 % we will advance \hsize by \multitablecolspace
1981 \advance\hsize by \multitablecolspace
1983 % In either case we will make \leftskip=\multitablecolspace:
1984 \leftskip=\multitablecolspace
1986 \noindent##}\cr%
1987 % \everycr will reset column counter, \colcount, at the end of
1988 % each line. Every column entry will cause \colcount to advance by one.
1989 % The table preamble
1990 % looks at the current \colcount to find the correct column width.
1991 \global\everycr{\noalign{%
1992 \filbreak%% keeps underfull box messages off when table breaks over pages.
1993 \global\colcount=0\relax}}
1996 \def\setmultitablespacing{% test to see if user has set \multitablelinespace.
1997 % If so, do nothing. If not, give it an appropriate dimension based on
1998 % current baselineskip.
1999 \setbox0=\vbox{Xy}
2000 \ifdim\multitablelinespace=0pt
2001 %% strut to put in table in case some entry doesn't have descenders,
2002 %% to keep lines equally spaced
2003 \gdef\multistrut{\vrule height\ht0 depth\dp0 width0pt\relax}
2004 %% Test to see if parskip is larger than space between lines of
2005 %% table. If not, do nothing.
2006 %% If so, set to same dimension as multitablelinespace.
2007 \else
2008 \gdef\multistrut{\vrule height\multitablelinespace depth\dp0
2009 width0pt\relax} \fi
2010 \ifdim\multitableparskip>\multitablelinespace
2011 \global\multitableparskip=\multitablelinespace
2012 \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
2013 %% than skip between lines in the table.
2014 \fi%
2015 \ifdim\multitableparskip=0pt
2016 \global\multitableparskip=\multitablelinespace
2017 \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
2018 %% than skip between lines in the table.
2019 \fi}
2020 \message{indexing,}
2021 % Index generation facilities
2023 % Define \newwrite to be identical to plain tex's \newwrite
2024 % except not \outer, so it can be used within \newindex.
2025 {\catcode`\@=11
2026 \gdef\newwrite{\alloc@7\write\chardef\sixt@@n}}
2028 % \newindex {foo} defines an index named foo.
2029 % It automatically defines \fooindex such that
2030 % \fooindex ...rest of line... puts an entry in the index foo.
2031 % It also defines \fooindfile to be the number of the output channel for
2032 % the file that accumulates this index. The file's extension is foo.
2033 % The name of an index should be no more than 2 characters long
2034 % for the sake of vms.
2036 \def\newindex #1{
2037 \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
2038 \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
2039 \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
2040 \noexpand\doindex {#1}}
2043 % @defindex foo == \newindex{foo}
2045 \def\defindex{\parsearg\newindex}
2047 % Define @defcodeindex, like @defindex except put all entries in @code.
2049 \def\newcodeindex #1{
2050 \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
2051 \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
2052 \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
2053 \noexpand\docodeindex {#1}}
2056 \def\defcodeindex{\parsearg\newcodeindex}
2058 % @synindex foo bar makes index foo feed into index bar.
2059 % Do this instead of @defindex foo if you don't want it as a separate index.
2060 \def\synindex #1 #2 {%
2061 \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
2062 \expandafter\let\csname#1indfile\endcsname=\synindexfoo
2063 \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
2064 \noexpand\doindex {#2}}%
2067 % @syncodeindex foo bar similar, but put all entries made for index foo
2068 % inside @code.
2069 \def\syncodeindex #1 #2 {%
2070 \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
2071 \expandafter\let\csname#1indfile\endcsname=\synindexfoo
2072 \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
2073 \noexpand\docodeindex {#2}}%
2076 % Define \doindex, the driver for all \fooindex macros.
2077 % Argument #1 is generated by the calling \fooindex macro,
2078 % and it is "foo", the name of the index.
2080 % \doindex just uses \parsearg; it calls \doind for the actual work.
2081 % This is because \doind is more useful to call from other macros.
2083 % There is also \dosubind {index}{topic}{subtopic}
2084 % which makes an entry in a two-level index such as the operation index.
2086 \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
2087 \def\singleindexer #1{\doind{\indexname}{#1}}
2089 % like the previous two, but they put @code around the argument.
2090 \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
2091 \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
2093 \def\indexdummies{%
2094 % Take care of the plain tex accent commands.
2095 \def\"{\realbackslash "}%
2096 \def\`{\realbackslash `}%
2097 \def\'{\realbackslash '}%
2098 \def\^{\realbackslash ^}%
2099 \def\~{\realbackslash ~}%
2100 \def\={\realbackslash =}%
2101 \def\b{\realbackslash b}%
2102 \def\c{\realbackslash c}%
2103 \def\d{\realbackslash d}%
2104 \def\u{\realbackslash u}%
2105 \def\v{\realbackslash v}%
2106 \def\H{\realbackslash H}%
2107 % Take care of the plain tex special European modified letters.
2108 \def\oe{\realbackslash oe}%
2109 \def\ae{\realbackslash ae}%
2110 \def\aa{\realbackslash aa}%
2111 \def\OE{\realbackslash OE}%
2112 \def\AE{\realbackslash AE}%
2113 \def\AA{\realbackslash AA}%
2114 \def\o{\realbackslash o}%
2115 \def\O{\realbackslash O}%
2116 \def\l{\realbackslash l}%
2117 \def\L{\realbackslash L}%
2118 \def\ss{\realbackslash ss}%
2119 % Take care of texinfo commands likely to appear in an index entry.
2120 \def\_{{\realbackslash _}}%
2121 \def\w{\realbackslash w }%
2122 \def\bf{\realbackslash bf }%
2123 \def\rm{\realbackslash rm }%
2124 \def\sl{\realbackslash sl }%
2125 \def\sf{\realbackslash sf}%
2126 \def\tt{\realbackslash tt}%
2127 \def\gtr{\realbackslash gtr}%
2128 \def\less{\realbackslash less}%
2129 \def\hat{\realbackslash hat}%
2130 \def\char{\realbackslash char}%
2131 \def\TeX{\realbackslash TeX}%
2132 \def\dots{\realbackslash dots }%
2133 \def\copyright{\realbackslash copyright }%
2134 \def\tclose##1{\realbackslash tclose {##1}}%
2135 \def\code##1{\realbackslash code {##1}}%
2136 \def\samp##1{\realbackslash samp {##1}}%
2137 \def\t##1{\realbackslash r {##1}}%
2138 \def\r##1{\realbackslash r {##1}}%
2139 \def\i##1{\realbackslash i {##1}}%
2140 \def\b##1{\realbackslash b {##1}}%
2141 \def\cite##1{\realbackslash cite {##1}}%
2142 \def\key##1{\realbackslash key {##1}}%
2143 \def\file##1{\realbackslash file {##1}}%
2144 \def\var##1{\realbackslash var {##1}}%
2145 \def\kbd##1{\realbackslash kbd {##1}}%
2146 \def\dfn##1{\realbackslash dfn {##1}}%
2147 \def\emph##1{\realbackslash emph {##1}}%
2148 \unsepspaces
2151 % If an index command is used in an @example environment, any spaces
2152 % therein should become regular spaces in the raw index file, not the
2153 % expansion of \tie (\\leavevmode \penalty \@M \ ).
2154 {\obeyspaces
2155 \gdef\unsepspaces{\obeyspaces\let =\space}}
2157 % \indexnofonts no-ops all font-change commands.
2158 % This is used when outputting the strings to sort the index by.
2159 \def\indexdummyfont#1{#1}
2160 \def\indexdummytex{TeX}
2161 \def\indexdummydots{...}
2163 \def\indexnofonts{%
2164 % Just ignore accents.
2165 \let\"=\indexdummyfont
2166 \let\`=\indexdummyfont
2167 \let\'=\indexdummyfont
2168 \let\^=\indexdummyfont
2169 \let\~=\indexdummyfont
2170 \let\==\indexdummyfont
2171 \let\b=\indexdummyfont
2172 \let\c=\indexdummyfont
2173 \let\d=\indexdummyfont
2174 \let\u=\indexdummyfont
2175 \let\v=\indexdummyfont
2176 \let\H=\indexdummyfont
2177 % Take care of the plain tex special European modified letters.
2178 \def\oe{oe}%
2179 \def\ae{ae}%
2180 \def\aa{aa}%
2181 \def\OE{OE}%
2182 \def\AE{AE}%
2183 \def\AA{AA}%
2184 \def\o{o}%
2185 \def\O{O}%
2186 \def\l{l}%
2187 \def\L{L}%
2188 \def\ss{ss}%
2189 \let\w=\indexdummyfont
2190 \let\t=\indexdummyfont
2191 \let\r=\indexdummyfont
2192 \let\i=\indexdummyfont
2193 \let\b=\indexdummyfont
2194 \let\emph=\indexdummyfont
2195 \let\strong=\indexdummyfont
2196 \let\cite=\indexdummyfont
2197 \let\sc=\indexdummyfont
2198 %Don't no-op \tt, since it isn't a user-level command
2199 % and is used in the definitions of the active chars like <, >, |...
2200 %\let\tt=\indexdummyfont
2201 \let\tclose=\indexdummyfont
2202 \let\code=\indexdummyfont
2203 \let\file=\indexdummyfont
2204 \let\samp=\indexdummyfont
2205 \let\kbd=\indexdummyfont
2206 \let\key=\indexdummyfont
2207 \let\var=\indexdummyfont
2208 \let\TeX=\indexdummytex
2209 \let\dots=\indexdummydots
2212 % To define \realbackslash, we must make \ not be an escape.
2213 % We must first make another character (@) an escape
2214 % so we do not become unable to do a definition.
2216 {\catcode`\@=0 \catcode`\\=\other
2217 @gdef@realbackslash{\}}
2219 \let\indexbackslash=0 %overridden during \printindex.
2221 \let\SETmarginindex=\relax %initialize!
2222 % workhorse for all \fooindexes
2223 % #1 is name of index, #2 is stuff to put there
2224 \def\doind #1#2{%
2225 % Put the index entry in the margin if desired.
2226 \ifx\SETmarginindex\relax\else%
2227 \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}%
2228 \fi%
2229 {\count10=\lastpenalty %
2230 {\indexdummies % Must do this here, since \bf, etc expand at this stage
2231 \escapechar=`\\%
2232 {\let\folio=0% Expand all macros now EXCEPT \folio
2233 \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
2234 % so it will be output as is; and it will print as backslash in the indx.
2236 % Now process the index-string once, with all font commands turned off,
2237 % to get the string to sort the index by.
2238 {\indexnofonts
2239 \xdef\temp1{#2}%
2241 % Now produce the complete index entry. We process the index-string again,
2242 % this time with font commands expanded, to get what to print in the index.
2243 \edef\temp{%
2244 \write \csname#1indfile\endcsname{%
2245 \realbackslash entry {\temp1}{\folio}{#2}}}%
2246 \temp }%
2247 }\penalty\count10}}
2249 \def\dosubind #1#2#3{%
2250 {\count10=\lastpenalty %
2251 {\indexdummies % Must do this here, since \bf, etc expand at this stage
2252 \escapechar=`\\%
2253 {\let\folio=0%
2254 \def\rawbackslashxx{\indexbackslash}%
2256 % Now process the index-string once, with all font commands turned off,
2257 % to get the string to sort the index by.
2258 {\indexnofonts
2259 \xdef\temp1{#2 #3}%
2261 % Now produce the complete index entry. We process the index-string again,
2262 % this time with font commands expanded, to get what to print in the index.
2263 \edef\temp{%
2264 \write \csname#1indfile\endcsname{%
2265 \realbackslash entry {\temp1}{\folio}{#2}{#3}}}%
2266 \temp }%
2267 }\penalty\count10}}
2269 % The index entry written in the file actually looks like
2270 % \entry {sortstring}{page}{topic}
2271 % or
2272 % \entry {sortstring}{page}{topic}{subtopic}
2273 % The texindex program reads in these files and writes files
2274 % containing these kinds of lines:
2275 % \initial {c}
2276 % before the first topic whose initial is c
2277 % \entry {topic}{pagelist}
2278 % for a topic that is used without subtopics
2279 % \primary {topic}
2280 % for the beginning of a topic that is used with subtopics
2281 % \secondary {subtopic}{pagelist}
2282 % for each subtopic.
2284 % Define the user-accessible indexing commands
2285 % @findex, @vindex, @kindex, @cindex.
2287 \def\findex {\fnindex}
2288 \def\kindex {\kyindex}
2289 \def\cindex {\cpindex}
2290 \def\vindex {\vrindex}
2291 \def\tindex {\tpindex}
2292 \def\pindex {\pgindex}
2294 \def\cindexsub {\begingroup\obeylines\cindexsub}
2295 {\obeylines %
2296 \gdef\cindexsub "#1" #2^^M{\endgroup %
2297 \dosubind{cp}{#2}{#1}}}
2299 % Define the macros used in formatting output of the sorted index material.
2301 % This is what you call to cause a particular index to get printed.
2302 % Write
2303 % @unnumbered Function Index
2304 % @printindex fn
2306 \def\printindex{\parsearg\doprintindex}
2308 \def\doprintindex#1{\begingroup
2309 \dobreak \chapheadingskip{10000}%
2311 \indexfonts \rm
2312 \tolerance = 9500
2313 \indexbreaks
2314 \def\indexbackslash{\rawbackslashxx}%
2315 % Index files are almost Texinfo source, but we use \ as the escape
2316 % character. It would be better to use @, but that's too big a change
2317 % to make right now.
2318 \catcode`\\ = 0
2319 \begindoublecolumns
2321 % See if the index file exists and is nonempty.
2322 \openin 1 \jobname.#1s
2323 \ifeof 1
2324 % \enddoublecolumns gets confused if there is no text in the index,
2325 % and it loses the chapter title and the aux file entries for the
2326 % index. The easiest way to prevent this problem is to make sure
2327 % there is some text.
2328 (Index is nonexistent)
2329 \else
2331 % If the index file exists but is empty, then \openin leaves \ifeof
2332 % false. We have to make TeX try to read something from the file, so
2333 % it can discover if there is anything in it.
2334 \read 1 to \temp
2335 \ifeof 1
2336 (Index is empty)
2337 \else
2338 \input \jobname.#1s
2341 \closein 1
2342 \enddoublecolumns
2343 \endgroup}
2345 % These macros are used by the sorted index file itself.
2346 % Change them to control the appearance of the index.
2348 % Same as \bigskipamount except no shrink.
2349 % \balancecolumns gets confused if there is any shrink.
2350 \newskip\initialskipamount \initialskipamount 12pt plus4pt
2352 \def\initial #1{%
2353 {\let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
2354 \ifdim\lastskip<\initialskipamount
2355 \removelastskip \penalty-200 \vskip \initialskipamount\fi
2356 \line{\secbf#1\hfill}\kern 2pt\penalty10000}}
2358 % This typesets a paragraph consisting of #1, dot leaders, and then #2
2359 % flush to the right margin. It is used for index and table of contents
2360 % entries. The paragraph is indented by \leftskip.
2362 \def\entry #1#2{\begingroup
2364 % Start a new paragraph if necessary, so our assignments below can't
2365 % affect previous text.
2366 \par
2368 % Do not fill out the last line with white space.
2369 \parfillskip = 0in
2371 % No extra space above this paragraph.
2372 \parskip = 0in
2374 % Do not prefer a separate line ending with a hyphen to fewer lines.
2375 \finalhyphendemerits = 0
2377 % \hangindent is only relevant when the entry text and page number
2378 % don't both fit on one line. In that case, bob suggests starting the
2379 % dots pretty far over on the line. Unfortunately, a large
2380 % indentation looks wrong when the entry text itself is broken across
2381 % lines. So we use a small indentation and put up with long leaders.
2383 % \hangafter is reset to 1 (which is the value we want) at the start
2384 % of each paragraph, so we need not do anything with that.
2385 \hangindent=2em
2387 % When the entry text needs to be broken, just fill out the first line
2388 % with blank space.
2389 \rightskip = 0pt plus1fil
2391 % Start a ``paragraph'' for the index entry so the line breaking
2392 % parameters we've set above will have an effect.
2393 \noindent
2395 % Insert the text of the index entry. TeX will do line-breaking on it.
2397 % The following is kludged to not output a line of dots in the index if
2398 % there are no page numbers. The next person who breaks this will be
2399 % cursed by a Unix daemon.
2400 \def\tempa{{\rm }}%
2401 \def\tempb{#2}%
2402 \edef\tempc{\tempa}%
2403 \edef\tempd{\tempb}%
2404 \ifx\tempc\tempd\ \else%
2406 % If we must, put the page number on a line of its own, and fill out
2407 % this line with blank space. (The \hfil is overwhelmed with the
2408 % fill leaders glue in \indexdotfill if the page number does fit.)
2409 \hfil\penalty50
2410 \null\nobreak\indexdotfill % Have leaders before the page number.
2412 % The `\ ' here is removed by the implicit \unskip that TeX does as
2413 % part of (the primitive) \par. Without it, a spurious underfull
2414 % \hbox ensues.
2415 \ #2% The page number ends the paragraph.
2416 \fi%
2417 \par
2418 \endgroup}
2420 % Like \dotfill except takes at least 1 em.
2421 \def\indexdotfill{\cleaders
2422 \hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \mkern1.5mu$}\hskip 1em plus 1fill}
2424 \def\primary #1{\line{#1\hfil}}
2426 \newskip\secondaryindent \secondaryindent=0.5cm
2428 \def\secondary #1#2{
2429 {\parfillskip=0in \parskip=0in
2430 \hangindent =1in \hangafter=1
2431 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par
2434 %% Define two-column mode, which is used in indexes.
2435 %% Adapted from the TeXbook, page 416.
2436 \catcode `\@=11
2438 \newbox\partialpage
2440 \newdimen\doublecolumnhsize
2442 \def\begindoublecolumns{\begingroup
2443 % Grab any single-column material above us.
2444 \output = {\global\setbox\partialpage
2445 =\vbox{\unvbox255\kern -\topskip \kern \baselineskip}}%
2446 \eject
2448 % Now switch to the double-column output routine.
2449 \output={\doublecolumnout}%
2451 % Change the page size parameters. We could do this once outside this
2452 % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
2453 % format, but then we repeat the same computation. Repeating a couple
2454 % of assignments once per index is clearly meaningless for the
2455 % execution time, so we may as well do it once.
2457 % First we halve the line length, less a little for the gutter between
2458 % the columns. We compute the gutter based on the line length, so it
2459 % changes automatically with the paper format. The magic constant
2460 % below is chosen so that the gutter has the same value (well, +- <
2461 % 1pt) as it did when we hard-coded it.
2463 % We put the result in a separate register, \doublecolumhsize, so we
2464 % can restore it in \pagesofar, after \hsize itself has (potentially)
2465 % been clobbered.
2467 \doublecolumnhsize = \hsize
2468 \advance\doublecolumnhsize by -.04154\hsize
2469 \divide\doublecolumnhsize by 2
2470 \hsize = \doublecolumnhsize
2472 % Double the \vsize as well. (We don't need a separate register here,
2473 % since nobody clobbers \vsize.)
2474 \vsize = 2\vsize
2475 \doublecolumnpagegoal
2478 \def\enddoublecolumns{\eject \endgroup \pagegoal=\vsize \unvbox\partialpage}
2480 \def\doublecolumnsplit{\splittopskip=\topskip \splitmaxdepth=\maxdepth
2481 \global\dimen@=\pageheight \global\advance\dimen@ by-\ht\partialpage
2482 \global\setbox1=\vsplit255 to\dimen@ \global\setbox0=\vbox{\unvbox1}
2483 \global\setbox3=\vsplit255 to\dimen@ \global\setbox2=\vbox{\unvbox3}
2484 \ifdim\ht0>\dimen@ \setbox255=\vbox{\unvbox0\unvbox2} \global\setbox255=\copy5 \fi
2485 \ifdim\ht2>\dimen@ \setbox255=\vbox{\unvbox0\unvbox2} \global\setbox255=\copy5 \fi
2487 \def\doublecolumnpagegoal{%
2488 \dimen@=\vsize \advance\dimen@ by-2\ht\partialpage \global\pagegoal=\dimen@
2490 \def\pagesofar{\unvbox\partialpage %
2491 \hsize=\doublecolumnhsize % have to restore this since output routine
2492 \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}}
2493 \def\doublecolumnout{%
2494 \setbox5=\copy255
2495 {\vbadness=10000 \doublecolumnsplit}
2496 \ifvbox255
2497 \setbox0=\vtop to\dimen@{\unvbox0}
2498 \setbox2=\vtop to\dimen@{\unvbox2}
2499 \onepageout\pagesofar \unvbox255 \penalty\outputpenalty
2500 \else
2501 \setbox0=\vbox{\unvbox5}
2502 \ifvbox0
2503 \dimen@=\ht0 \advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip
2504 \divide\dimen@ by2 \splittopskip=\topskip \splitmaxdepth=\maxdepth
2505 {\vbadness=10000
2506 \loop \global\setbox5=\copy0
2507 \setbox1=\vsplit5 to\dimen@
2508 \setbox3=\vsplit5 to\dimen@
2509 \ifvbox5 \global\advance\dimen@ by1pt \repeat
2510 \setbox0=\vbox to\dimen@{\unvbox1}
2511 \setbox2=\vbox to\dimen@{\unvbox3}
2512 \global\setbox\partialpage=\vbox{\pagesofar}
2513 \doublecolumnpagegoal
2519 \catcode `\@=\other
2520 \message{sectioning,}
2521 % Define chapters, sections, etc.
2523 \newcount \chapno
2524 \newcount \secno \secno=0
2525 \newcount \subsecno \subsecno=0
2526 \newcount \subsubsecno \subsubsecno=0
2528 % This counter is funny since it counts through charcodes of letters A, B, ...
2529 \newcount \appendixno \appendixno = `\@
2530 \def\appendixletter{\char\the\appendixno}
2532 \newwrite \contentsfile
2533 % This is called from \setfilename.
2534 \def\opencontents{\openout \contentsfile = \jobname.toc}
2536 % Each @chapter defines this as the name of the chapter.
2537 % page headings and footings can use it. @section does likewise
2539 \def\thischapter{} \def\thissection{}
2540 \def\seccheck#1{\if \pageno<0 %
2541 \errmessage{@#1 not allowed after generating table of contents}\fi
2545 \def\chapternofonts{%
2546 \let\rawbackslash=\relax%
2547 \let\frenchspacing=\relax%
2548 \def\result{\realbackslash result}
2549 \def\equiv{\realbackslash equiv}
2550 \def\expansion{\realbackslash expansion}
2551 \def\print{\realbackslash print}
2552 \def\TeX{\realbackslash TeX}
2553 \def\dots{\realbackslash dots}
2554 \def\copyright{\realbackslash copyright}
2555 \def\tt{\realbackslash tt}
2556 \def\bf{\realbackslash bf }
2557 \def\w{\realbackslash w}
2558 \def\less{\realbackslash less}
2559 \def\gtr{\realbackslash gtr}
2560 \def\hat{\realbackslash hat}
2561 \def\char{\realbackslash char}
2562 \def\tclose##1{\realbackslash tclose {##1}}
2563 \def\code##1{\realbackslash code {##1}}
2564 \def\samp##1{\realbackslash samp {##1}}
2565 \def\r##1{\realbackslash r {##1}}
2566 \def\b##1{\realbackslash b {##1}}
2567 \def\key##1{\realbackslash key {##1}}
2568 \def\file##1{\realbackslash file {##1}}
2569 \def\kbd##1{\realbackslash kbd {##1}}
2570 % These are redefined because @smartitalic wouldn't work inside xdef.
2571 \def\i##1{\realbackslash i {##1}}
2572 \def\cite##1{\realbackslash cite {##1}}
2573 \def\var##1{\realbackslash var {##1}}
2574 \def\emph##1{\realbackslash emph {##1}}
2575 \def\dfn##1{\realbackslash dfn {##1}}
2578 \newcount\absseclevel % used to calculate proper heading level
2579 \newcount\secbase\secbase=0 % @raise/lowersections modify this count
2581 % @raisesections: treat @section as chapter, @subsection as section, etc.
2582 \def\raisesections{\global\advance\secbase by -1}
2583 \let\up=\raisesections % original BFox name
2585 % @lowersections: treat @chapter as section, @section as subsection, etc.
2586 \def\lowersections{\global\advance\secbase by 1}
2587 \let\down=\lowersections % original BFox name
2589 % Choose a numbered-heading macro
2590 % #1 is heading level if unmodified by @raisesections or @lowersections
2591 % #2 is text for heading
2592 \def\numhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
2593 \ifcase\absseclevel
2594 \chapterzzz{#2}
2596 \seczzz{#2}
2598 \numberedsubseczzz{#2}
2600 \numberedsubsubseczzz{#2}
2601 \else
2602 \ifnum \absseclevel<0
2603 \chapterzzz{#2}
2604 \else
2605 \numberedsubsubseczzz{#2}
2610 % like \numhead, but chooses appendix heading levels
2611 \def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
2612 \ifcase\absseclevel
2613 \appendixzzz{#2}
2615 \appendixsectionzzz{#2}
2617 \appendixsubseczzz{#2}
2619 \appendixsubsubseczzz{#2}
2620 \else
2621 \ifnum \absseclevel<0
2622 \appendixzzz{#2}
2623 \else
2624 \appendixsubsubseczzz{#2}
2629 % like \numhead, but chooses numberless heading levels
2630 \def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1
2631 \ifcase\absseclevel
2632 \unnumberedzzz{#2}
2634 \unnumberedseczzz{#2}
2636 \unnumberedsubseczzz{#2}
2638 \unnumberedsubsubseczzz{#2}
2639 \else
2640 \ifnum \absseclevel<0
2641 \unnumberedzzz{#2}
2642 \else
2643 \unnumberedsubsubseczzz{#2}
2649 \def\thischaptername{No Chapter Title}
2650 \outer\def\chapter{\parsearg\chapteryyy}
2651 \def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz
2652 \def\chapterzzz #1{\seccheck{chapter}%
2653 \secno=0 \subsecno=0 \subsubsecno=0
2654 \global\advance \chapno by 1 \message{\putwordChapter \the\chapno}%
2655 \chapmacro {#1}{\the\chapno}%
2656 \gdef\thissection{#1}%
2657 \gdef\thischaptername{#1}%
2658 % We don't substitute the actual chapter name into \thischapter
2659 % because we don't want its macros evaluated now.
2660 \xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}%
2661 {\chapternofonts%
2662 \edef\temp{{\realbackslash chapentry {#1}{\the\chapno}{\noexpand\folio}}}%
2663 \escapechar=`\\%
2664 \write \contentsfile \temp %
2665 \donoderef %
2666 \global\let\section = \numberedsec
2667 \global\let\subsection = \numberedsubsec
2668 \global\let\subsubsection = \numberedsubsubsec
2671 \outer\def\appendix{\parsearg\appendixyyy}
2672 \def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz
2673 \def\appendixzzz #1{\seccheck{appendix}%
2674 \secno=0 \subsecno=0 \subsubsecno=0
2675 \global\advance \appendixno by 1 \message{Appendix \appendixletter}%
2676 \chapmacro {#1}{\putwordAppendix{} \appendixletter}%
2677 \gdef\thissection{#1}%
2678 \gdef\thischaptername{#1}%
2679 \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
2680 {\chapternofonts%
2681 \edef\temp{{\realbackslash chapentry
2682 {#1}{\putwordAppendix{} \appendixletter}{\noexpand\folio}}}%
2683 \escapechar=`\\%
2684 \write \contentsfile \temp %
2685 \appendixnoderef %
2686 \global\let\section = \appendixsec
2687 \global\let\subsection = \appendixsubsec
2688 \global\let\subsubsection = \appendixsubsubsec
2691 % @centerchap is like @unnumbered, but the heading is centered.
2692 \outer\def\centerchap{\parsearg\centerchapyyy}
2693 \def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}}
2695 \outer\def\top{\parsearg\unnumberedyyy}
2696 \outer\def\unnumbered{\parsearg\unnumberedyyy}
2697 \def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
2698 \def\unnumberedzzz #1{\seccheck{unnumbered}%
2699 \secno=0 \subsecno=0 \subsubsecno=0
2701 % This used to be simply \message{#1}, but TeX fully expands the
2702 % argument to \message. Therefore, if #1 contained @-commands, TeX
2703 % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
2704 % expanded @cite (which turns out to cause errors because \cite is meant
2705 % to be executed, not expanded).
2707 % Anyway, we don't want the fully-expanded definition of @cite to appear
2708 % as a result of the \message, we just want `@cite' itself. We use
2709 % \the<toks register> to achieve this: TeX expands \the<toks> only once,
2710 % simply yielding the contents of the <toks register>.
2711 \toks0 = {#1}\message{(\the\toks0)}%
2713 \unnumbchapmacro {#1}%
2714 \gdef\thischapter{#1}\gdef\thissection{#1}%
2715 {\chapternofonts%
2716 \edef\temp{{\realbackslash unnumbchapentry {#1}{\noexpand\folio}}}%
2717 \escapechar=`\\%
2718 \write \contentsfile \temp %
2719 \unnumbnoderef %
2720 \global\let\section = \unnumberedsec
2721 \global\let\subsection = \unnumberedsubsec
2722 \global\let\subsubsection = \unnumberedsubsubsec
2725 \outer\def\numberedsec{\parsearg\secyyy}
2726 \def\secyyy #1{\numhead1{#1}} % normally calls seczzz
2727 \def\seczzz #1{\seccheck{section}%
2728 \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
2729 \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
2730 {\chapternofonts%
2731 \edef\temp{{\realbackslash secentry %
2732 {#1}{\the\chapno}{\the\secno}{\noexpand\folio}}}%
2733 \escapechar=`\\%
2734 \write \contentsfile \temp %
2735 \donoderef %
2736 \penalty 10000 %
2739 \outer\def\appendixsection{\parsearg\appendixsecyyy}
2740 \outer\def\appendixsec{\parsearg\appendixsecyyy}
2741 \def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz
2742 \def\appendixsectionzzz #1{\seccheck{appendixsection}%
2743 \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
2744 \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
2745 {\chapternofonts%
2746 \edef\temp{{\realbackslash secentry %
2747 {#1}{\appendixletter}{\the\secno}{\noexpand\folio}}}%
2748 \escapechar=`\\%
2749 \write \contentsfile \temp %
2750 \appendixnoderef %
2751 \penalty 10000 %
2754 \outer\def\unnumberedsec{\parsearg\unnumberedsecyyy}
2755 \def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz
2756 \def\unnumberedseczzz #1{\seccheck{unnumberedsec}%
2757 \plainsecheading {#1}\gdef\thissection{#1}%
2758 {\chapternofonts%
2759 \edef\temp{{\realbackslash unnumbsecentry{#1}{\noexpand\folio}}}%
2760 \escapechar=`\\%
2761 \write \contentsfile \temp %
2762 \unnumbnoderef %
2763 \penalty 10000 %
2766 \outer\def\numberedsubsec{\parsearg\numberedsubsecyyy}
2767 \def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz
2768 \def\numberedsubseczzz #1{\seccheck{subsection}%
2769 \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
2770 \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
2771 {\chapternofonts%
2772 \edef\temp{{\realbackslash subsecentry %
2773 {#1}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
2774 \escapechar=`\\%
2775 \write \contentsfile \temp %
2776 \donoderef %
2777 \penalty 10000 %
2780 \outer\def\appendixsubsec{\parsearg\appendixsubsecyyy}
2781 \def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz
2782 \def\appendixsubseczzz #1{\seccheck{appendixsubsec}%
2783 \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
2784 \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
2785 {\chapternofonts%
2786 \edef\temp{{\realbackslash subsecentry %
2787 {#1}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
2788 \escapechar=`\\%
2789 \write \contentsfile \temp %
2790 \appendixnoderef %
2791 \penalty 10000 %
2794 \outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy}
2795 \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
2796 \def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}%
2797 \plainsubsecheading {#1}\gdef\thissection{#1}%
2798 {\chapternofonts%
2799 \edef\temp{{\realbackslash unnumbsubsecentry{#1}{\noexpand\folio}}}%
2800 \escapechar=`\\%
2801 \write \contentsfile \temp %
2802 \unnumbnoderef %
2803 \penalty 10000 %
2806 \outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy}
2807 \def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz
2808 \def\numberedsubsubseczzz #1{\seccheck{subsubsection}%
2809 \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
2810 \subsubsecheading {#1}
2811 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
2812 {\chapternofonts%
2813 \edef\temp{{\realbackslash subsubsecentry %
2814 {#1}
2815 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}
2816 {\noexpand\folio}}}%
2817 \escapechar=`\\%
2818 \write \contentsfile \temp %
2819 \donoderef %
2820 \penalty 10000 %
2823 \outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy}
2824 \def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz
2825 \def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec}%
2826 \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
2827 \subsubsecheading {#1}
2828 {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
2829 {\chapternofonts%
2830 \edef\temp{{\realbackslash subsubsecentry{#1}%
2831 {\appendixletter}
2832 {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}%
2833 \escapechar=`\\%
2834 \write \contentsfile \temp %
2835 \appendixnoderef %
2836 \penalty 10000 %
2839 \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy}
2840 \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
2841 \def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}%
2842 \plainsubsubsecheading {#1}\gdef\thissection{#1}%
2843 {\chapternofonts%
2844 \edef\temp{{\realbackslash unnumbsubsubsecentry{#1}{\noexpand\folio}}}%
2845 \escapechar=`\\%
2846 \write \contentsfile \temp %
2847 \unnumbnoderef %
2848 \penalty 10000 %
2851 % These are variants which are not "outer", so they can appear in @ifinfo.
2852 % Actually, they should now be obsolete; ordinary section commands should work.
2853 \def\infotop{\parsearg\unnumberedzzz}
2854 \def\infounnumbered{\parsearg\unnumberedzzz}
2855 \def\infounnumberedsec{\parsearg\unnumberedseczzz}
2856 \def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz}
2857 \def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
2859 \def\infoappendix{\parsearg\appendixzzz}
2860 \def\infoappendixsec{\parsearg\appendixseczzz}
2861 \def\infoappendixsubsec{\parsearg\appendixsubseczzz}
2862 \def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz}
2864 \def\infochapter{\parsearg\chapterzzz}
2865 \def\infosection{\parsearg\sectionzzz}
2866 \def\infosubsection{\parsearg\subsectionzzz}
2867 \def\infosubsubsection{\parsearg\subsubsectionzzz}
2869 % These macros control what the section commands do, according
2870 % to what kind of chapter we are in (ordinary, appendix, or unnumbered).
2871 % Define them by default for a numbered chapter.
2872 \global\let\section = \numberedsec
2873 \global\let\subsection = \numberedsubsec
2874 \global\let\subsubsection = \numberedsubsubsec
2876 % Define @majorheading, @heading and @subheading
2878 % NOTE on use of \vbox for chapter headings, section headings, and
2879 % such:
2880 % 1) We use \vbox rather than the earlier \line to permit
2881 % overlong headings to fold.
2882 % 2) \hyphenpenalty is set to 10000 because hyphenation in a
2883 % heading is obnoxious; this forbids it.
2884 % 3) Likewise, headings look best if no \parindent is used, and
2885 % if justification is not attempted. Hence \raggedright.
2888 \def\majorheading{\parsearg\majorheadingzzz}
2889 \def\majorheadingzzz #1{%
2890 {\advance\chapheadingskip by 10pt \chapbreak }%
2891 {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
2892 \parindent=0pt\raggedright
2893 \rm #1\hfill}}\bigskip \par\penalty 200}
2895 \def\chapheading{\parsearg\chapheadingzzz}
2896 \def\chapheadingzzz #1{\chapbreak %
2897 {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
2898 \parindent=0pt\raggedright
2899 \rm #1\hfill}}\bigskip \par\penalty 200}
2901 % @heading, @subheading, @subsubheading.
2902 \def\heading{\parsearg\plainsecheading}
2903 \def\subheading{\parsearg\plainsubsecheading}
2904 \def\subsubheading{\parsearg\plainsubsubsecheading}
2906 % These macros generate a chapter, section, etc. heading only
2907 % (including whitespace, linebreaking, etc. around it),
2908 % given all the information in convenient, parsed form.
2910 %%% Args are the skip and penalty (usually negative)
2911 \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
2913 \def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
2915 %%% Define plain chapter starts, and page on/off switching for it
2916 % Parameter controlling skip before chapter headings (if needed)
2918 \newskip\chapheadingskip
2920 \def\chapbreak{\dobreak \chapheadingskip {-4000}}
2921 \def\chappager{\par\vfill\supereject}
2922 \def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi}
2924 \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
2926 \def\CHAPPAGoff{
2927 \global\let\contentsalignmacro = \chappager
2928 \global\let\pchapsepmacro=\chapbreak
2929 \global\let\pagealignmacro=\chappager}
2931 \def\CHAPPAGon{
2932 \global\let\contentsalignmacro = \chappager
2933 \global\let\pchapsepmacro=\chappager
2934 \global\let\pagealignmacro=\chappager
2935 \global\def\HEADINGSon{\HEADINGSsingle}}
2937 \def\CHAPPAGodd{
2938 \global\let\contentsalignmacro = \chapoddpage
2939 \global\let\pchapsepmacro=\chapoddpage
2940 \global\let\pagealignmacro=\chapoddpage
2941 \global\def\HEADINGSon{\HEADINGSdouble}}
2943 \CHAPPAGon
2945 \def\CHAPFplain{
2946 \global\let\chapmacro=\chfplain
2947 \global\let\unnumbchapmacro=\unnchfplain
2948 \global\let\centerchapmacro=\centerchfplain}
2950 % Plain chapter opening.
2951 % #1 is the text, #2 the chapter number or empty if unnumbered.
2952 \def\chfplain#1#2{%
2953 \pchapsepmacro
2955 \chapfonts \rm
2956 \def\chapnum{#2}%
2957 \setbox0 = \hbox{#2\ifx\chapnum\empty\else\enspace\fi}%
2958 \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
2959 \hangindent = \wd0 \centerparametersmaybe
2960 \unhbox0 #1\par}%
2962 \nobreak\bigskip % no page break after a chapter title
2963 \nobreak
2966 % Plain opening for unnumbered.
2967 \def\unnchfplain#1{\chfplain{#1}{}}
2969 % @centerchap -- centered and unnumbered.
2970 \let\centerparametersmaybe = \relax
2971 \def\centerchfplain#1{{%
2972 \def\centerparametersmaybe{%
2973 \advance\rightskip by 3\rightskip
2974 \leftskip = \rightskip
2975 \parfillskip = 0pt
2977 \chfplain{#1}{}%
2980 \CHAPFplain % The default
2982 \def\unnchfopen #1{%
2983 \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
2984 \parindent=0pt\raggedright
2985 \rm #1\hfill}}\bigskip \par\penalty 10000 %
2988 \def\chfopen #1#2{\chapoddpage {\chapfonts
2989 \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
2990 \par\penalty 5000 %
2993 \def\centerchfopen #1{%
2994 \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
2995 \parindent=0pt
2996 \hfill {\rm #1}\hfill}}\bigskip \par\penalty 10000 %
2999 \def\CHAPFopen{
3000 \global\let\chapmacro=\chfopen
3001 \global\let\unnumbchapmacro=\unnchfopen
3002 \global\let\centerchapmacro=\centerchfopen}
3005 % Section titles.
3006 \newskip\secheadingskip
3007 \def\secheadingbreak{\dobreak \secheadingskip {-1000}}
3008 \def\secheading#1#2#3{\sectionheading{sec}{#2.#3}{#1}}
3009 \def\plainsecheading#1{\sectionheading{sec}{}{#1}}
3011 % Subsection titles.
3012 \newskip \subsecheadingskip
3013 \def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}}
3014 \def\subsecheading#1#2#3#4{\sectionheading{subsec}{#2.#3.#4}{#1}}
3015 \def\plainsubsecheading#1{\sectionheading{subsec}{}{#1}}
3017 % Subsubsection titles.
3018 \let\subsubsecheadingskip = \subsecheadingskip
3019 \let\subsubsecheadingbreak = \subsecheadingbreak
3020 \def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}}
3021 \def\plainsubsubsecheading#1{\sectionheading{subsubsec}{}{#1}}
3024 % Print any size section title.
3026 % #1 is the section type (sec/subsec/subsubsec), #2 is the section
3027 % number (maybe empty), #3 the text.
3028 \def\sectionheading#1#2#3{%
3030 \expandafter\advance\csname #1headingskip\endcsname by \parskip
3031 \csname #1headingbreak\endcsname
3034 % Switch to the right set of fonts.
3035 \csname #1fonts\endcsname \rm
3037 % Only insert the separating space if we have a section number.
3038 \def\secnum{#2}%
3039 \setbox0 = \hbox{#2\ifx\secnum\empty\else\enspace\fi}%
3041 \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright
3042 \hangindent = \wd0 % zero if no section number
3043 \unhbox0 #3}%
3045 \ifdim\parskip<10pt \nobreak\kern10pt\nobreak\kern-\parskip\fi \nobreak
3049 \message{toc printing,}
3051 % Finish up the main text and prepare to read what we've written
3052 % to \contentsfile.
3054 \newskip\contentsrightmargin \contentsrightmargin=1in
3055 \def\startcontents#1{%
3056 % If @setchapternewpage on, and @headings double, the contents should
3057 % start on an odd page, unlike chapters. Thus, we maintain
3058 % \contentsalignmacro in parallel with \pagealignmacro.
3059 % From: Torbjorn Granlund <tege@matematik.su.se>
3060 \contentsalignmacro
3061 \immediate\closeout \contentsfile
3062 \ifnum \pageno>0
3063 \pageno = -1 % Request roman numbered pages.
3065 % Don't need to put `Contents' or `Short Contents' in the headline.
3066 % It is abundantly clear what they are.
3067 \unnumbchapmacro{#1}\def\thischapter{}%
3068 \begingroup % Set up to handle contents files properly.
3069 \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11
3070 \catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
3071 \raggedbottom % Worry more about breakpoints than the bottom.
3072 \advance\hsize by -\contentsrightmargin % Don't use the full line length.
3076 % Normal (long) toc.
3077 \outer\def\contents{%
3078 \startcontents{\putwordTableofContents}%
3079 \input \jobname.toc
3080 \endgroup
3081 \vfill \eject
3084 % And just the chapters.
3085 \outer\def\summarycontents{%
3086 \startcontents{\putwordShortContents}%
3088 \let\chapentry = \shortchapentry
3089 \let\unnumbchapentry = \shortunnumberedentry
3090 % We want a true roman here for the page numbers.
3091 \secfonts
3092 \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl
3094 \advance\baselineskip by 1pt % Open it up a little.
3095 \def\secentry ##1##2##3##4{}
3096 \def\unnumbsecentry ##1##2{}
3097 \def\subsecentry ##1##2##3##4##5{}
3098 \def\unnumbsubsecentry ##1##2{}
3099 \def\subsubsecentry ##1##2##3##4##5##6{}
3100 \def\unnumbsubsubsecentry ##1##2{}
3101 \input \jobname.toc
3102 \endgroup
3103 \vfill \eject
3105 \let\shortcontents = \summarycontents
3107 % These macros generate individual entries in the table of contents.
3108 % The first argument is the chapter or section name.
3109 % The last argument is the page number.
3110 % The arguments in between are the chapter number, section number, ...
3112 % Chapter-level things, for both the long and short contents.
3113 \def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}
3115 % See comments in \dochapentry re vbox and related settings
3116 \def\shortchapentry#1#2#3{%
3117 \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno{#3}}%
3120 % Typeset the label for a chapter or appendix for the short contents.
3121 % The arg is, e.g. `Appendix A' for an appendix, or `3' for a chapter.
3122 % We could simplify the code here by writing out an \appendixentry
3123 % command in the toc file for appendices, instead of using \chapentry
3124 % for both, but it doesn't seem worth it.
3125 \setbox0 = \hbox{\shortcontrm \putwordAppendix }
3126 \newdimen\shortappendixwidth \shortappendixwidth = \wd0
3128 \def\shortchaplabel#1{%
3129 % We typeset #1 in a box of constant width, regardless of the text of
3130 % #1, so the chapter titles will come out aligned.
3131 \setbox0 = \hbox{#1}%
3132 \dimen0 = \ifdim\wd0 > \shortappendixwidth \shortappendixwidth \else 0pt \fi
3134 % This space should be plenty, since a single number is .5em, and the
3135 % widest letter (M) is 1em, at least in the Computer Modern fonts.
3136 % (This space doesn't include the extra space that gets added after
3137 % the label; that gets put in in \shortchapentry above.)
3138 \advance\dimen0 by 1.1em
3139 \hbox to \dimen0{#1\hfil}%
3142 \def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
3143 \def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno{#2}}}
3145 % Sections.
3146 \def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}}
3147 \def\unnumbsecentry#1#2{\dosecentry{#1}{#2}}
3149 % Subsections.
3150 \def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}}
3151 \def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}}
3153 % And subsubsections.
3154 \def\subsubsecentry#1#2#3#4#5#6{%
3155 \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}}
3156 \def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}}
3159 % This parameter controls the indentation of the various levels.
3160 \newdimen\tocindent \tocindent = 3pc
3162 % Now for the actual typesetting. In all these, #1 is the text and #2 is the
3163 % page number.
3165 % If the toc has to be broken over pages, we would want to be at chapters
3166 % if at all possible; hence the \penalty.
3167 \def\dochapentry#1#2{%
3168 \penalty-300 \vskip\baselineskip
3169 \begingroup
3170 \chapentryfonts
3171 \tocentry{#1}{\dopageno{#2}}%
3172 \endgroup
3173 \nobreak\vskip .25\baselineskip
3176 \def\dosecentry#1#2{\begingroup
3177 \secentryfonts \leftskip=\tocindent
3178 \tocentry{#1}{\dopageno{#2}}%
3179 \endgroup}
3181 \def\dosubsecentry#1#2{\begingroup
3182 \subsecentryfonts \leftskip=2\tocindent
3183 \tocentry{#1}{\dopageno{#2}}%
3184 \endgroup}
3186 \def\dosubsubsecentry#1#2{\begingroup
3187 \subsubsecentryfonts \leftskip=3\tocindent
3188 \tocentry{#1}{\dopageno{#2}}%
3189 \endgroup}
3191 % Final typesetting of a toc entry; we use the same \entry macro as for
3192 % the index entries, but we want to suppress hyphenation here. (We
3193 % can't do that in the \entry macro, since index entries might consist
3194 % of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.)
3196 % \turnoffactive is for the sake of @" used for umlauts.
3197 \def\tocentry#1#2{\begingroup
3198 \hyphenpenalty = 10000
3199 \entry{\turnoffactive #1}{\turnoffactive #2}%
3200 \endgroup}
3202 % Space between chapter (or whatever) number and the title.
3203 \def\labelspace{\hskip1em \relax}
3205 \def\dopageno#1{{\rm #1}}
3206 \def\doshortpageno#1{{\rm #1}}
3208 \def\chapentryfonts{\secfonts \rm}
3209 \def\secentryfonts{\textfonts}
3210 \let\subsecentryfonts = \textfonts
3211 \let\subsubsecentryfonts = \textfonts
3214 \message{environments,}
3216 % Since these characters are used in examples, it should be an even number of
3217 % \tt widths. Each \tt character is 1en, so two makes it 1em.
3218 % Furthermore, these definitions must come after we define our fonts.
3219 \newbox\dblarrowbox \newbox\longdblarrowbox
3220 \newbox\pushcharbox \newbox\bullbox
3221 \newbox\equivbox \newbox\errorbox
3223 \let\ptexequiv = \equiv
3225 %{\tentt
3226 %\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil}
3227 %\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil}
3228 %\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil}
3229 %\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil}
3230 % Adapted from the manmac format (p.420 of TeXbook)
3231 %\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex
3232 % depth .1ex\hfil}
3235 % @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
3236 \def\point{$\star$}
3237 \def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
3238 \def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}}
3239 \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
3240 \def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}}
3242 % Adapted from the TeXbook's \boxit.
3243 {\tentt \global\dimen0 = 3em}% Width of the box.
3244 \dimen2 = .55pt % Thickness of rules
3245 % The text. (`r' is open on the right, `e' somewhat less so on the left.)
3246 \setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt}
3248 \global\setbox\errorbox=\hbox to \dimen0{\hfil
3249 \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
3250 \advance\hsize by -2\dimen2 % Rules.
3251 \vbox{
3252 \hrule height\dimen2
3253 \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
3254 \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
3255 \kern3pt\vrule width\dimen2}% Space to right.
3256 \hrule height\dimen2}
3257 \hfil}
3259 % The @error{} command.
3260 \def\error{\leavevmode\lower.7ex\copy\errorbox}
3262 % @tex ... @end tex escapes into raw Tex temporarily.
3263 % One exception: @ is still an escape character, so that @end tex works.
3264 % But \@ or @@ will get a plain tex @ character.
3266 \def\tex{\begingroup
3267 \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
3268 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
3269 \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
3270 \catcode `\%=14
3271 \catcode 43=12
3272 \catcode`\"=12
3273 \catcode`\==12
3274 \catcode`\|=12
3275 \catcode`\<=12
3276 \catcode`\>=12
3277 \escapechar=`\\
3279 \let\~=\ptextilde
3280 \let\{=\ptexlbrace
3281 \let\}=\ptexrbrace
3282 \let\.=\ptexdot
3283 \let\*=\ptexstar
3284 \let\dots=\ptexdots
3285 \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}
3286 \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}
3287 \def\@{@}%
3288 \let\bullet=\ptexbullet
3289 \let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext \let\l=\ptexl
3290 \let\L=\ptexL
3292 \let\Etex=\endgroup}
3294 % Define @lisp ... @endlisp.
3295 % @lisp does a \begingroup so it can rebind things,
3296 % including the definition of @endlisp (which normally is erroneous).
3298 % Amount to narrow the margins by for @lisp.
3299 \newskip\lispnarrowing \lispnarrowing=0.4in
3301 % This is the definition that ^^M gets inside @lisp, @example, and other
3302 % such environments. \null is better than a space, since it doesn't
3303 % have any width.
3304 \def\lisppar{\null\endgraf}
3306 % Make each space character in the input produce a normal interword
3307 % space in the output. Don't allow a line break at this space, as this
3308 % is used only in environments like @example, where each line of input
3309 % should produce a line of output anyway.
3311 {\obeyspaces %
3312 \gdef\sepspaces{\obeyspaces\let =\tie}}
3314 % Define \obeyedspace to be our active space, whatever it is. This is
3315 % for use in \parsearg.
3316 {\sepspaces%
3317 \global\let\obeyedspace= }
3319 % This space is always present above and below environments.
3320 \newskip\envskipamount \envskipamount = 0pt
3322 % Make spacing and below environment symmetrical. We use \parskip here
3323 % to help in doing that, since in @example-like environments \parskip
3324 % is reset to zero; thus the \afterenvbreak inserts no space -- but the
3325 % start of the next paragraph will insert \parskip
3327 \def\aboveenvbreak{{\advance\envskipamount by \parskip
3328 \endgraf \ifdim\lastskip<\envskipamount
3329 \removelastskip \penalty-50 \vskip\envskipamount \fi}}
3331 \let\afterenvbreak = \aboveenvbreak
3333 % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins.
3334 \let\nonarrowing=\relax
3336 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3337 % \cartouche: draw rectangle w/rounded corners around argument
3338 \font\circle=lcircle10
3339 \newdimen\circthick
3340 \newdimen\cartouter\newdimen\cartinner
3341 \newskip\normbskip\newskip\normpskip\newskip\normlskip
3342 \circthick=\fontdimen8\circle
3344 \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
3345 \def\ctr{{\hskip 6pt\circle\char'010}}
3346 \def\cbl{{\circle\char'012\hskip -6pt}}
3347 \def\cbr{{\hskip 6pt\circle\char'011}}
3348 \def\carttop{\hbox to \cartouter{\hskip\lskip
3349 \ctl\leaders\hrule height\circthick\hfil\ctr
3350 \hskip\rskip}}
3351 \def\cartbot{\hbox to \cartouter{\hskip\lskip
3352 \cbl\leaders\hrule height\circthick\hfil\cbr
3353 \hskip\rskip}}
3355 \newskip\lskip\newskip\rskip
3357 \long\def\cartouche{%
3358 \begingroup
3359 \lskip=\leftskip \rskip=\rightskip
3360 \leftskip=0pt\rightskip=0pt %we want these *outside*.
3361 \cartinner=\hsize \advance\cartinner by-\lskip
3362 \advance\cartinner by-\rskip
3363 \cartouter=\hsize
3364 \advance\cartouter by 18pt % allow for 3pt kerns on either
3365 % side, and for 6pt waste from
3366 % each corner char
3367 \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
3368 % Flag to tell @lisp, etc., not to narrow margin.
3369 \let\nonarrowing=\comment
3370 \vbox\bgroup
3371 \baselineskip=0pt\parskip=0pt\lineskip=0pt
3372 \carttop
3373 \hbox\bgroup
3374 \hskip\lskip
3375 \vrule\kern3pt
3376 \vbox\bgroup
3377 \hsize=\cartinner
3378 \kern3pt
3379 \begingroup
3380 \baselineskip=\normbskip
3381 \lineskip=\normlskip
3382 \parskip=\normpskip
3383 \vskip -\parskip
3384 \def\Ecartouche{%
3385 \endgroup
3386 \kern3pt
3387 \egroup
3388 \kern3pt\vrule
3389 \hskip\rskip
3390 \egroup
3391 \cartbot
3392 \egroup
3393 \endgroup
3397 % This macro is called at the beginning of all the @example variants,
3398 % inside a group.
3399 \def\nonfillstart{%
3400 \aboveenvbreak
3401 \inENV % This group ends at the end of the body
3402 \hfuzz = 12pt % Don't be fussy
3403 \sepspaces % Make spaces be word-separators rather than space tokens.
3404 \singlespace
3405 \let\par = \lisppar % don't ignore blank lines
3406 \obeylines % each line of input is a line of output
3407 \parskip = 0pt
3408 \parindent = 0pt
3409 \emergencystretch = 0pt % don't try to avoid overfull boxes
3410 % @cartouche defines \nonarrowing to inhibit narrowing
3411 % at next level down.
3412 \ifx\nonarrowing\relax
3413 \advance \leftskip by \lispnarrowing
3414 \exdentamount=\lispnarrowing
3415 \let\exdent=\nofillexdent
3416 \let\nonarrowing=\relax
3420 % To ending an @example-like environment, we first end the paragraph
3421 % (via \afterenvbreak's vertical glue), and then the group. That way we
3422 % keep the zero \parskip that the environments set -- \parskip glue
3423 % will be inserted at the beginning of the next paragraph in the
3424 % document, after the environment.
3426 \def\nonfillfinish{\afterenvbreak\endgroup}%
3428 % This macro is
3429 \def\lisp{\begingroup
3430 \nonfillstart
3431 \let\Elisp = \nonfillfinish
3433 \rawbackslash % have \ input char produce \ char from current font
3434 \gobble
3437 % Define the \E... control sequence only if we are inside the
3438 % environment, so the error checking in \end will work.
3440 % We must call \lisp last in the definition, since it reads the
3441 % return following the @example (or whatever) command.
3443 \def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp}
3444 \def\smallexample{\begingroup \def\Esmallexample{\nonfillfinish\endgroup}\lisp}
3445 \def\smalllisp{\begingroup \def\Esmalllisp{\nonfillfinish\endgroup}\lisp}
3447 % @smallexample and @smalllisp. This is not used unless the @smallbook
3448 % command is given. Originally contributed by Pavel@xerox.
3450 \def\smalllispx{\begingroup
3451 \nonfillstart
3452 \let\Esmalllisp = \nonfillfinish
3453 \let\Esmallexample = \nonfillfinish
3455 % Smaller fonts for small examples.
3456 \indexfonts \tt
3457 \rawbackslash % make \ output the \ character from the current font (tt)
3458 \gobble
3461 % This is @display; same as @lisp except use roman font.
3463 \def\display{\begingroup
3464 \nonfillstart
3465 \let\Edisplay = \nonfillfinish
3466 \gobble
3469 % This is @format; same as @display except don't narrow margins.
3471 \def\format{\begingroup
3472 \let\nonarrowing = t
3473 \nonfillstart
3474 \let\Eformat = \nonfillfinish
3475 \gobble
3478 % @flushleft (same as @format) and @flushright.
3480 \def\flushleft{\begingroup
3481 \let\nonarrowing = t
3482 \nonfillstart
3483 \let\Eflushleft = \nonfillfinish
3484 \gobble
3486 \def\flushright{\begingroup
3487 \let\nonarrowing = t
3488 \nonfillstart
3489 \let\Eflushright = \nonfillfinish
3490 \advance\leftskip by 0pt plus 1fill
3491 \gobble}
3493 % @quotation does normal linebreaking (hence we can't use \nonfillstart)
3494 % and narrows the margins.
3496 \def\quotation{%
3497 \begingroup\inENV %This group ends at the end of the @quotation body
3498 {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
3499 \singlespace
3500 \parindent=0pt
3501 % We have retained a nonzero parskip for the environment, since we're
3502 % doing normal filling. So to avoid extra space below the environment...
3503 \def\Equotation{\parskip = 0pt \nonfillfinish}%
3505 % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
3506 \ifx\nonarrowing\relax
3507 \advance\leftskip by \lispnarrowing
3508 \advance\rightskip by \lispnarrowing
3509 \exdentamount = \lispnarrowing
3510 \let\nonarrowing = \relax
3514 \message{defuns,}
3515 % Define formatter for defuns
3516 % First, allow user to change definition object font (\df) internally
3517 \def\setdeffont #1 {\csname DEF#1\endcsname}
3519 \newskip\defbodyindent \defbodyindent=.4in
3520 \newskip\defargsindent \defargsindent=50pt
3521 \newskip\deftypemargin \deftypemargin=12pt
3522 \newskip\deflastargmargin \deflastargmargin=18pt
3524 \newcount\parencount
3525 % define \functionparens, which makes ( and ) and & do special things.
3526 % \functionparens affects the group it is contained in.
3527 \def\activeparens{%
3528 \catcode`\(=\active \catcode`\)=\active \catcode`\&=\active
3529 \catcode`\[=\active \catcode`\]=\active}
3531 % Make control sequences which act like normal parenthesis chars.
3532 \let\lparen = ( \let\rparen = )
3534 {\activeparens % Now, smart parens don't turn on until &foo (see \amprm)
3536 % Be sure that we always have a definition for `(', etc. For example,
3537 % if the fn name has parens in it, \boldbrax will not be in effect yet,
3538 % so TeX would otherwise complain about undefined control sequence.
3539 \global\let(=\lparen \global\let)=\rparen
3540 \global\let[=\lbrack \global\let]=\rbrack
3542 \gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 }
3543 \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
3544 % This is used to turn on special parens
3545 % but make & act ordinary (given that it's active).
3546 \gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr}
3548 % Definitions of (, ) and & used in args for functions.
3549 % This is the definition of ( outside of all parentheses.
3550 \gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested %
3551 \global\advance\parencount by 1 }
3553 % This is the definition of ( when already inside a level of parens.
3554 \gdef\opnested{\char`\(\global\advance\parencount by 1 }
3556 \gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
3557 % also in that case restore the outer-level definition of (.
3558 \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi
3559 \global\advance \parencount by -1 }
3560 % If we encounter &foo, then turn on ()-hacking afterwards
3561 \gdef\amprm#1 {{\rm\&#1}\let(=\oprm \let)=\clrm\ }
3563 \gdef\normalparens{\boldbrax\let&=\ampnr}
3564 } % End of definition inside \activeparens
3565 %% These parens (in \boldbrax) actually are a little bolder than the
3566 %% contained text. This is especially needed for [ and ]
3567 \def\opnr{{\sf\char`\(}} \def\clnr{{\sf\char`\)}} \def\ampnr{\&}
3568 \def\lbrb{{\bf\char`\[}} \def\rbrb{{\bf\char`\]}}
3570 % First, defname, which formats the header line itself.
3571 % #1 should be the function name.
3572 % #2 should be the type of definition, such as "Function".
3574 \def\defname #1#2{%
3575 % Get the values of \leftskip and \rightskip as they were
3576 % outside the @def...
3577 \dimen2=\leftskip
3578 \advance\dimen2 by -\defbodyindent
3579 \dimen3=\rightskip
3580 \advance\dimen3 by -\defbodyindent
3581 \noindent %
3582 \setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
3583 \dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line
3584 \dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations
3585 \parshape 2 0in \dimen0 \defargsindent \dimen1 %
3586 % Now output arg 2 ("Function" or some such)
3587 % ending at \deftypemargin from the right margin,
3588 % but stuck inside a box of width 0 so it does not interfere with linebreaking
3589 {% Adjust \hsize to exclude the ambient margins,
3590 % so that \rightline will obey them.
3591 \advance \hsize by -\dimen2 \advance \hsize by -\dimen3
3592 \rlap{\rightline{{\rm #2}\hskip \deftypemargin}}}%
3593 % Make all lines underfull and no complaints:
3594 \tolerance=10000 \hbadness=10000
3595 \advance\leftskip by -\defbodyindent
3596 \exdentamount=\defbodyindent
3597 {\df #1}\enskip % Generate function name
3600 % Actually process the body of a definition
3601 % #1 should be the terminating control sequence, such as \Edefun.
3602 % #2 should be the "another name" control sequence, such as \defunx.
3603 % #3 should be the control sequence that actually processes the header,
3604 % such as \defunheader.
3606 \def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
3607 \medbreak %
3608 % Define the end token that this defining construct specifies
3609 % so that it will exit this group.
3610 \def#1{\endgraf\endgroup\medbreak}%
3611 \def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
3612 \parindent=0in
3613 \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
3614 \exdentamount=\defbodyindent
3615 \begingroup %
3616 \catcode 61=\active % 61 is `='
3617 \obeylines\activeparens\spacesplit#3}
3619 \def\defmethparsebody #1#2#3#4 {\begingroup\inENV %
3620 \medbreak %
3621 % Define the end token that this defining construct specifies
3622 % so that it will exit this group.
3623 \def#1{\endgraf\endgroup\medbreak}%
3624 \def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}%
3625 \parindent=0in
3626 \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
3627 \exdentamount=\defbodyindent
3628 \begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
3630 \def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
3631 \medbreak %
3632 % Define the end token that this defining construct specifies
3633 % so that it will exit this group.
3634 \def#1{\endgraf\endgroup\medbreak}%
3635 \def#2##1 ##2 {\def#4{##1}%
3636 \begingroup\obeylines\activeparens\spacesplit{#3{##2}}}%
3637 \parindent=0in
3638 \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
3639 \exdentamount=\defbodyindent
3640 \begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
3642 % These parsing functions are similar to the preceding ones
3643 % except that they do not make parens into active characters.
3644 % These are used for "variables" since they have no arguments.
3646 \def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
3647 \medbreak %
3648 % Define the end token that this defining construct specifies
3649 % so that it will exit this group.
3650 \def#1{\endgraf\endgroup\medbreak}%
3651 \def#2{\begingroup\obeylines\spacesplit#3}%
3652 \parindent=0in
3653 \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
3654 \exdentamount=\defbodyindent
3655 \begingroup %
3656 \catcode 61=\active %
3657 \obeylines\spacesplit#3}
3659 % This is used for \def{tp,vr}parsebody. It could probably be used for
3660 % some of the others, too, with some judicious conditionals.
3662 \def\parsebodycommon#1#2#3{%
3663 \begingroup\inENV %
3664 \medbreak %
3665 % Define the end token that this defining construct specifies
3666 % so that it will exit this group.
3667 \def#1{\endgraf\endgroup\medbreak}%
3668 \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}%
3669 \parindent=0in
3670 \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
3671 \exdentamount=\defbodyindent
3672 \begingroup\obeylines
3675 \def\defvrparsebody#1#2#3#4 {%
3676 \parsebodycommon{#1}{#2}{#3}%
3677 \spacesplit{#3{#4}}%
3680 % This loses on `@deftp {Data Type} {struct termios}' -- it thinks the
3681 % type is just `struct', because we lose the braces in `{struct
3682 % termios}' when \spacesplit reads its undelimited argument. Sigh.
3683 % \let\deftpparsebody=\defvrparsebody
3685 % So, to get around this, we put \empty in with the type name. That
3686 % way, TeX won't find exactly `{...}' as an undelimited argument, and
3687 % won't strip off the braces.
3689 \def\deftpparsebody #1#2#3#4 {%
3690 \parsebodycommon{#1}{#2}{#3}%
3691 \spacesplit{\parsetpheaderline{#3{#4}}}\empty
3694 % Fine, but then we have to eventually remove the \empty *and* the
3695 % braces (if any). That's what this does, putting the result in \tptemp.
3697 \def\removeemptybraces\empty#1\relax{\def\tptemp{#1}}%
3699 % After \spacesplit has done its work, this is called -- #1 is the final
3700 % thing to call, #2 the type name (which starts with \empty), and #3
3701 % (which might be empty) the arguments.
3703 \def\parsetpheaderline#1#2#3{%
3704 \removeemptybraces#2\relax
3705 #1{\tptemp}{#3}%
3708 \def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV %
3709 \medbreak %
3710 % Define the end token that this defining construct specifies
3711 % so that it will exit this group.
3712 \def#1{\endgraf\endgroup\medbreak}%
3713 \def#2##1 ##2 {\def#4{##1}%
3714 \begingroup\obeylines\spacesplit{#3{##2}}}%
3715 \parindent=0in
3716 \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
3717 \exdentamount=\defbodyindent
3718 \begingroup\obeylines\spacesplit{#3{#5}}}
3720 % Split up #2 at the first space token.
3721 % call #1 with two arguments:
3722 % the first is all of #2 before the space token,
3723 % the second is all of #2 after that space token.
3724 % If #2 contains no space token, all of it is passed as the first arg
3725 % and the second is passed as empty.
3727 {\obeylines
3728 \gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}%
3729 \long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{%
3730 \ifx\relax #3%
3731 #1{#2}{}\else #1{#2}{#3#4}\fi}}
3733 % So much for the things common to all kinds of definitions.
3735 % Define @defun.
3737 % First, define the processing that is wanted for arguments of \defun
3738 % Use this to expand the args and terminate the paragraph they make up
3740 \def\defunargs #1{\functionparens \sl
3741 % Expand, preventing hyphenation at `-' chars.
3742 % Note that groups don't affect changes in \hyphenchar.
3743 \hyphenchar\tensl=0
3745 \hyphenchar\tensl=45
3746 \ifnum\parencount=0 \else \errmessage{unbalanced parens in @def arguments}\fi%
3747 \interlinepenalty=10000
3748 \advance\rightskip by 0pt plus 1fil
3749 \endgraf\penalty 10000\vskip -\parskip\penalty 10000%
3752 \def\deftypefunargs #1{%
3753 % Expand, preventing hyphenation at `-' chars.
3754 % Note that groups don't affect changes in \hyphenchar.
3755 % Use \boldbraxnoamp, not \functionparens, so that & is not special.
3756 \boldbraxnoamp
3757 \tclose{#1}% avoid \code because of side effects on active chars
3758 \interlinepenalty=10000
3759 \advance\rightskip by 0pt plus 1fil
3760 \endgraf\penalty 10000\vskip -\parskip\penalty 10000%
3763 % Do complete processing of one @defun or @defunx line already parsed.
3765 % @deffn Command forward-char nchars
3767 \def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader}
3769 \def\deffnheader #1#2#3{\doind {fn}{\code{#2}}%
3770 \begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
3771 \catcode 61=\other % Turn off change made in \defparsebody
3774 % @defun == @deffn Function
3776 \def\defun{\defparsebody\Edefun\defunx\defunheader}
3778 \def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
3779 \begingroup\defname {#1}{Function}%
3780 \defunargs {#2}\endgroup %
3781 \catcode 61=\other % Turn off change made in \defparsebody
3784 % @deftypefun int foobar (int @var{foo}, float @var{bar})
3786 \def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader}
3788 % #1 is the data type. #2 is the name and args.
3789 \def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax}
3790 % #1 is the data type, #2 the name, #3 the args.
3791 \def\deftypefunheaderx #1#2 #3\relax{%
3792 \doind {fn}{\code{#2}}% Make entry in function index
3793 \begingroup\defname {\defheaderxcond#1\relax$$$#2}{Function}%
3794 \deftypefunargs {#3}\endgroup %
3795 \catcode 61=\other % Turn off change made in \defparsebody
3798 % @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
3800 \def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
3802 % \defheaderxcond#1\relax$$$
3803 % puts #1 in @code, followed by a space, but does nothing if #1 is null.
3804 \def\defheaderxcond#1#2$$${\ifx#1\relax\else\code{#1#2} \fi}
3806 % #1 is the classification. #2 is the data type. #3 is the name and args.
3807 \def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax}
3808 % #1 is the classification, #2 the data type, #3 the name, #4 the args.
3809 \def\deftypefnheaderx #1#2#3 #4\relax{%
3810 \doind {fn}{\code{#3}}% Make entry in function index
3811 \begingroup
3812 \normalparens % notably, turn off `&' magic, which prevents
3813 % at least some C++ text from working
3814 \defname {\defheaderxcond#2\relax$$$#3}{#1}%
3815 \deftypefunargs {#4}\endgroup %
3816 \catcode 61=\other % Turn off change made in \defparsebody
3819 % @defmac == @deffn Macro
3821 \def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
3823 \def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
3824 \begingroup\defname {#1}{Macro}%
3825 \defunargs {#2}\endgroup %
3826 \catcode 61=\other % Turn off change made in \defparsebody
3829 % @defspec == @deffn Special Form
3831 \def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
3833 \def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
3834 \begingroup\defname {#1}{Special Form}%
3835 \defunargs {#2}\endgroup %
3836 \catcode 61=\other % Turn off change made in \defparsebody
3839 % This definition is run if you use @defunx
3840 % anywhere other than immediately after a @defun or @defunx.
3842 \def\deffnx #1 {\errmessage{@deffnx in invalid context}}
3843 \def\defunx #1 {\errmessage{@defunx in invalid context}}
3844 \def\defmacx #1 {\errmessage{@defmacx in invalid context}}
3845 \def\defspecx #1 {\errmessage{@defspecx in invalid context}}
3846 \def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}}
3847 \def\deftypeunx #1 {\errmessage{@deftypeunx in invalid context}}
3849 % @defmethod, and so on
3851 % @defop {Funny Method} foo-class frobnicate argument
3853 \def\defop #1 {\def\defoptype{#1}%
3854 \defopparsebody\Edefop\defopx\defopheader\defoptype}
3856 \def\defopheader #1#2#3{%
3857 \dosubind {fn}{\code{#2}}{on #1}% Make entry in function index
3858 \begingroup\defname {#2}{\defoptype{} on #1}%
3859 \defunargs {#3}\endgroup %
3862 % @defmethod == @defop Method
3864 \def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
3866 \def\defmethodheader #1#2#3{%
3867 \dosubind {fn}{\code{#2}}{on #1}% entry in function index
3868 \begingroup\defname {#2}{Method on #1}%
3869 \defunargs {#3}\endgroup %
3872 % @defcv {Class Option} foo-class foo-flag
3874 \def\defcv #1 {\def\defcvtype{#1}%
3875 \defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
3877 \def\defcvarheader #1#2#3{%
3878 \dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
3879 \begingroup\defname {#2}{\defcvtype{} of #1}%
3880 \defvarargs {#3}\endgroup %
3883 % @defivar == @defcv {Instance Variable}
3885 \def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
3887 \def\defivarheader #1#2#3{%
3888 \dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
3889 \begingroup\defname {#2}{Instance Variable of #1}%
3890 \defvarargs {#3}\endgroup %
3893 % These definitions are run if you use @defmethodx, etc.,
3894 % anywhere other than immediately after a @defmethod, etc.
3896 \def\defopx #1 {\errmessage{@defopx in invalid context}}
3897 \def\defmethodx #1 {\errmessage{@defmethodx in invalid context}}
3898 \def\defcvx #1 {\errmessage{@defcvx in invalid context}}
3899 \def\defivarx #1 {\errmessage{@defivarx in invalid context}}
3901 % Now @defvar
3903 % First, define the processing that is wanted for arguments of @defvar.
3904 % This is actually simple: just print them in roman.
3905 % This must expand the args and terminate the paragraph they make up
3906 \def\defvarargs #1{\normalparens #1%
3907 \interlinepenalty=10000
3908 \endgraf\penalty 10000\vskip -\parskip\penalty 10000}
3910 % @defvr Counter foo-count
3912 \def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader}
3914 \def\defvrheader #1#2#3{\doind {vr}{\code{#2}}%
3915 \begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup}
3917 % @defvar == @defvr Variable
3919 \def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader}
3921 \def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
3922 \begingroup\defname {#1}{Variable}%
3923 \defvarargs {#2}\endgroup %
3926 % @defopt == @defvr {User Option}
3928 \def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader}
3930 \def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
3931 \begingroup\defname {#1}{User Option}%
3932 \defvarargs {#2}\endgroup %
3935 % @deftypevar int foobar
3937 \def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader}
3939 % #1 is the data type. #2 is the name.
3940 \def\deftypevarheader #1#2{%
3941 \doind {vr}{\code{#2}}% Make entry in variables index
3942 \begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}%
3943 \interlinepenalty=10000
3944 \endgraf\penalty 10000\vskip -\parskip\penalty 10000
3945 \endgroup}
3947 % @deftypevr {Global Flag} int enable
3949 \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
3951 \def\deftypevrheader #1#2#3{\doind {vr}{\code{#3}}%
3952 \begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1}
3953 \interlinepenalty=10000
3954 \endgraf\penalty 10000\vskip -\parskip\penalty 10000
3955 \endgroup}
3957 % This definition is run if you use @defvarx
3958 % anywhere other than immediately after a @defvar or @defvarx.
3960 \def\defvrx #1 {\errmessage{@defvrx in invalid context}}
3961 \def\defvarx #1 {\errmessage{@defvarx in invalid context}}
3962 \def\defoptx #1 {\errmessage{@defoptx in invalid context}}
3963 \def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context}}
3964 \def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context}}
3966 % Now define @deftp
3967 % Args are printed in bold, a slight difference from @defvar.
3969 \def\deftpargs #1{\bf \defvarargs{#1}}
3971 % @deftp Class window height width ...
3973 \def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader}
3975 \def\deftpheader #1#2#3{\doind {tp}{\code{#2}}%
3976 \begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
3978 % This definition is run if you use @deftpx, etc
3979 % anywhere other than immediately after a @deftp, etc.
3981 \def\deftpx #1 {\errmessage{@deftpx in invalid context}}
3983 \message{cross reference,}
3984 % Define cross-reference macros
3985 \newwrite \auxfile
3987 \newif\ifhavexrefs % True if xref values are known.
3988 \newif\ifwarnedxrefs % True if we warned once that they aren't known.
3990 % \setref{foo} defines a cross-reference point named foo.
3992 \def\setref#1{%
3993 \dosetq{#1-title}{Ytitle}%
3994 \dosetq{#1-pg}{Ypagenumber}%
3995 \dosetq{#1-snt}{Ysectionnumberandtype}}
3997 \def\unnumbsetref#1{%
3998 \dosetq{#1-title}{Ytitle}%
3999 \dosetq{#1-pg}{Ypagenumber}%
4000 \dosetq{#1-snt}{Ynothing}}
4002 \def\appendixsetref#1{%
4003 \dosetq{#1-title}{Ytitle}%
4004 \dosetq{#1-pg}{Ypagenumber}%
4005 \dosetq{#1-snt}{Yappendixletterandtype}}
4007 % \xref, \pxref, and \ref generate cross-references to specified points.
4008 % For \xrefX, #1 is the node name, #2 the name of the Info
4009 % cross-reference, #3 the printed node name, #4 the name of the Info
4010 % file, #5 the name of the printed manual. All but the node name can be
4011 % omitted.
4013 \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
4014 \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
4015 \def\ref#1{\xrefX[#1,,,,,,,]}
4016 \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
4017 \def\printedmanual{\ignorespaces #5}%
4018 \def\printednodename{\ignorespaces #3}%
4019 \setbox1=\hbox{\printedmanual}%
4020 \setbox0=\hbox{\printednodename}%
4021 \ifdim \wd0 = 0pt
4022 % No printed node name was explicitly given.
4023 \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax
4024 % Use the node name inside the square brackets.
4025 \def\printednodename{\ignorespaces #1}%
4026 \else
4027 % Use the actual chapter/section title appear inside
4028 % the square brackets. Use the real section title if we have it.
4029 \ifdim \wd1>0pt%
4030 % It is in another manual, so we don't have it.
4031 \def\printednodename{\ignorespaces #1}%
4032 \else
4033 \ifhavexrefs
4034 % We know the real title if we have the xref values.
4035 \def\printednodename{\refx{#1-title}{}}%
4036 \else
4037 % Otherwise just copy the Info node name.
4038 \def\printednodename{\ignorespaces #1}%
4039 \fi%
4044 % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
4045 % insert empty discretionaries after hyphens, which means that it will
4046 % not find a line break at a hyphen in a node names. Since some manuals
4047 % are best written with fairly long node names, containing hyphens, this
4048 % is a loss. Therefore, we give the text of the node name again, so it
4049 % is as if TeX is seeing it for the first time.
4050 \ifdim \wd1 > 0pt
4051 \putwordsection{} ``\printednodename'' in \cite{\printedmanual}%
4052 \else
4053 % _ (for example) has to be the character _ for the purposes of the
4054 % control sequence corresponding to the node, but it has to expand
4055 % into the usual \leavevmode...\vrule stuff for purposes of
4056 % printing. So we \turnoffactive for the \refx-snt, back on for the
4057 % printing, back off for the \refx-pg.
4058 {\turnoffactive \refx{#1-snt}{}}%
4059 \space [\printednodename],\space
4060 \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
4062 \endgroup}
4064 % \dosetq is the interface for calls from other macros
4066 % Use \turnoffactive so that punctuation chars such as underscore
4067 % work in node names.
4068 \def\dosetq #1#2{{\let\folio=0 \turnoffactive \auxhat%
4069 \edef\next{\write\auxfile{\internalsetq {#1}{#2}}}%
4070 \next}}
4072 % \internalsetq {foo}{page} expands into
4073 % CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
4074 % When the aux file is read, ' is the escape character
4076 \def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}}
4078 % Things to be expanded by \internalsetq
4080 \def\Ypagenumber{\folio}
4082 \def\Ytitle{\thissection}
4084 \def\Ynothing{}
4086 \def\Ysectionnumberandtype{%
4087 \ifnum\secno=0 \putwordChapter\xreftie\the\chapno %
4088 \else \ifnum \subsecno=0 \putwordSection\xreftie\the\chapno.\the\secno %
4089 \else \ifnum \subsubsecno=0 %
4090 \putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno %
4091 \else %
4092 \putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno %
4093 \fi \fi \fi }
4095 \def\Yappendixletterandtype{%
4096 \ifnum\secno=0 \putwordAppendix\xreftie'char\the\appendixno{}%
4097 \else \ifnum \subsecno=0 \putwordSection\xreftie'char\the\appendixno.\the\secno %
4098 \else \ifnum \subsubsecno=0 %
4099 \putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno %
4100 \else %
4101 \putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %
4102 \fi \fi \fi }
4104 \gdef\xreftie{'tie}
4106 % Use TeX 3.0's \inputlineno to get the line number, for better error
4107 % messages, but if we're using an old version of TeX, don't do anything.
4109 \ifx\inputlineno\thisisundefined
4110 \let\linenumber = \empty % Non-3.0.
4111 \else
4112 \def\linenumber{\the\inputlineno:\space}
4115 % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
4116 % If its value is nonempty, SUFFIX is output afterward.
4118 \def\refx#1#2{%
4119 \expandafter\ifx\csname X#1\endcsname\relax
4120 % If not defined, say something at least.
4121 $\langle$un\-de\-fined$\rangle$%
4122 \ifhavexrefs
4123 \message{\linenumber Undefined cross reference `#1'.}%
4124 \else
4125 \ifwarnedxrefs\else
4126 \global\warnedxrefstrue
4127 \message{Cross reference values unknown; you must run TeX again.}%
4130 \else
4131 % It's defined, so just use it.
4132 \csname X#1\endcsname
4134 #2% Output the suffix in any case.
4137 % Read the last existing aux file, if any. No error if none exists.
4139 % This is the macro invoked by entries in the aux file.
4140 \def\xrdef #1#2{
4141 {\catcode`\'=\other\expandafter \gdef \csname X#1\endcsname {#2}}}
4143 \def\readauxfile{%
4144 \begingroup
4145 \catcode `\^^@=\other
4146 \catcode `\\x01=\other
4147 \catcode `\\x02=\other
4148 \catcode `\^^C=\other
4149 \catcode `\^^D=\other
4150 \catcode `\^^E=\other
4151 \catcode `\^^F=\other
4152 \catcode `\^^G=\other
4153 \catcode `\^^H=\other
4154 \catcode `\\v=\other
4155 \catcode `\^^L=\other
4156 \catcode `\\x0e=\other
4157 \catcode `\\x0f=\other
4158 \catcode `\\x10=\other
4159 \catcode `\\x11=\other
4160 \catcode `\\x12=\other
4161 \catcode `\\x13=\other
4162 \catcode `\\x14=\other
4163 \catcode `\\x15=\other
4164 \catcode `\\x16=\other
4165 \catcode `\\x17=\other
4166 \catcode `\\x18=\other
4167 \catcode `\\x19=\other
4168 \catcode 26=\other
4169 \catcode `\^^[=\other
4170 \catcode `\^^\=\other
4171 \catcode `\^^]=\other
4172 \catcode `\^^^=\other
4173 \catcode `\^^_=\other
4174 \catcode `\@=\other
4175 \catcode `\^=\other
4176 \catcode `\~=\other
4177 \catcode `\[=\other
4178 \catcode `\]=\other
4179 \catcode`\"=\other
4180 \catcode`\_=\other
4181 \catcode`\|=\other
4182 \catcode`\<=\other
4183 \catcode`\>=\other
4184 \catcode `\$=\other
4185 \catcode `\#=\other
4186 \catcode `\&=\other
4187 % `\+ does not work, so use 43.
4188 \catcode 43=\other
4189 % Make the characters 128-255 be printing characters
4191 \count 1=128
4192 \def\loop{%
4193 \catcode\count 1=\other
4194 \advance\count 1 by 1
4195 \ifnum \count 1<256 \loop \fi
4198 % the aux file uses ' as the escape.
4199 % Turn off \ as an escape so we do not lose on
4200 % entries which were dumped with control sequences in their names.
4201 % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
4202 % Reference to such entries still does not work the way one would wish,
4203 % but at least they do not bomb out when the aux file is read in.
4204 \catcode `\{=1 \catcode `\}=2
4205 \catcode `\%=\other
4206 \catcode `\'=0
4207 \catcode`\^=7 % to make ^^e4 etc usable in xref tags
4208 \catcode `\\=\other
4209 \openin 1 \jobname.aux
4210 \ifeof 1 \else \closein 1 \input \jobname.aux \global\havexrefstrue
4211 \global\warnedobstrue
4213 % Open the new aux file. Tex will close it automatically at exit.
4214 \openout \auxfile=\jobname.aux
4215 \endgroup}
4218 % Footnotes.
4220 \newcount \footnoteno
4222 % The trailing space in the following definition for supereject is
4223 % vital for proper filling; pages come out unaligned when you do a
4224 % pagealignmacro call if that space before the closing brace is
4225 % removed. (Generally, numeric constants should always be followed by a
4226 % space to prevent strange expansion errors.)
4227 \def\supereject{\par\penalty -20000\footnoteno =0 }
4229 % @footnotestyle is meaningful for info output only..
4230 \let\footnotestyle=\comment
4232 \let\ptexfootnote=\footnote
4234 {\catcode `\@=11
4236 % Auto-number footnotes. Otherwise like plain.
4237 \gdef\footnote{%
4238 \global\advance\footnoteno by \@ne
4239 \edef\thisfootno{$^{\the\footnoteno}$}%
4241 % In case the footnote comes at the end of a sentence, preserve the
4242 % extra spacing after we do the footnote number.
4243 \let\@sf\empty
4244 \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
4246 % Remove inadvertent blank space before typesetting the footnote number.
4247 \unskip
4248 \thisfootno\@sf
4249 \footnotezzz
4252 % Don't bother with the trickery in plain.tex to not require the
4253 % footnote text as a parameter. Our footnotes don't need to be so general.
4255 \long\gdef\footnotezzz#1{\insert\footins{%
4256 % We want to typeset this text as a normal paragraph, even if the
4257 % footnote reference occurs in (for example) a display environment.
4258 % So reset some parameters.
4259 \interlinepenalty\interfootnotelinepenalty
4260 \splittopskip\ht\strutbox % top baseline for broken footnotes
4261 \splitmaxdepth\dp\strutbox
4262 \floatingpenalty\@MM
4263 \leftskip\z@skip
4264 \rightskip\z@skip
4265 \spaceskip\z@skip
4266 \xspaceskip\z@skip
4267 \parindent\defaultparindent
4269 % Hang the footnote text off the number.
4270 \hang
4271 \textindent{\thisfootno}%
4273 % Don't crash into the line above the footnote text. Since this
4274 % expands into a box, it must come within the paragraph, lest it
4275 % provide a place where TeX can split the footnote.
4276 \footstrut
4277 #1\strut}%
4280 }%end \catcode `\@=11
4282 % Set the baselineskip to #1, and the lineskip and strut size
4283 % correspondingly. There is no deep meaning behind these magic numbers
4284 % used as factors; they just match (closely enough) what Knuth defined.
4286 \def\lineskipfactor{.08333}
4287 \def\strutheightpercent{.70833}
4288 \def\strutdepthpercent {.29167}
4290 \def\setleading#1{%
4291 \normalbaselineskip = #1\relax
4292 \normallineskip = \lineskipfactor\normalbaselineskip
4293 \normalbaselines
4294 \setbox\strutbox =\hbox{%
4295 \vrule width0pt height\strutheightpercent\baselineskip
4296 depth \strutdepthpercent \baselineskip
4300 % @| inserts a changebar to the left of the current line. It should
4301 % surround any changed text. This approach does *not* work if the
4302 % change spans more than two lines of output. To handle that, we would
4303 % have adopt a much more difficult approach (putting marks into the main
4304 % vertical list for the beginning and end of each change).
4306 \def\|{%
4307 % \vadjust can only be used in horizontal mode.
4308 \leavevmode
4310 % Append this vertical mode material after the current line in the output.
4311 \vadjust{%
4312 % We want to insert a rule with the height and depth of the current
4313 % leading; that is exactly what \strutbox is supposed to record.
4314 \vskip-\baselineskip
4316 % \vadjust-items are inserted at the left edge of the type. So
4317 % the \llap here moves out into the left-hand margin.
4318 \llap{%
4320 % For a thicker or thinner bar, change the `1pt'.
4321 \vrule height\baselineskip width1pt
4323 % This is the space between the bar and the text.
4324 \hskip 12pt
4329 % For a final copy, take out the rectangles
4330 % that mark overfull boxes (in case you have decided
4331 % that the text looks ok even though it passes the margin).
4333 \def\finalout{\overfullrule=0pt}
4336 % End of control word definitions.
4338 \message{and turning on texinfo input format.}
4340 \def\openindices{%
4341 \newindex{cp}%
4342 \newcodeindex{fn}%
4343 \newcodeindex{vr}%
4344 \newcodeindex{tp}%
4345 \newcodeindex{ky}%
4346 \newcodeindex{pg}%
4349 % Set some numeric style parameters, for 8.5 x 11 format.
4351 \hsize = 6in
4352 \hoffset = .25in
4353 \newdimen\defaultparindent \defaultparindent = 15pt
4354 \parindent = \defaultparindent
4355 \parskip 3pt plus 2pt minus 1pt
4356 \setleading{13.2pt}
4357 \advance\topskip by 1.2cm
4359 \chapheadingskip = 15pt plus 4pt minus 2pt
4360 \secheadingskip = 12pt plus 3pt minus 2pt
4361 \subsecheadingskip = 9pt plus 2pt minus 2pt
4363 % Prevent underfull vbox error messages.
4364 \vbadness=10000
4366 % Following George Bush, just get rid of widows and orphans.
4367 \widowpenalty=10000
4368 \clubpenalty=10000
4370 % Use TeX 3.0's \emergencystretch to help line breaking, but if we're
4371 % using an old version of TeX, don't do anything. We want the amount of
4372 % stretch added to depend on the line length, hence the dependence on
4373 % \hsize. This makes it come to about 9pt for the 8.5x11 format.
4375 \ifx\emergencystretch\thisisundefined
4376 % Allow us to assign to \emergencystretch anyway.
4377 \def\emergencystretch{\dimen0}%
4378 \else
4379 \emergencystretch = \hsize
4380 \divide\emergencystretch by 45
4383 % Use @smallbook to reset parameters for 7x9.5 format (or else 7x9.25)
4384 \def\smallbook{
4385 \global\chapheadingskip = 15pt plus 4pt minus 2pt
4386 \global\secheadingskip = 12pt plus 3pt minus 2pt
4387 \global\subsecheadingskip = 9pt plus 2pt minus 2pt
4389 \global\lispnarrowing = 0.3in
4390 \setleading{12pt}
4391 \advance\topskip by -1cm
4392 \global\parskip 2pt plus 1pt
4393 \global\hsize = 5in
4394 \global\vsize=7.5in
4395 \global\tolerance=700
4396 \global\hfuzz=1pt
4397 \global\contentsrightmargin=0pt
4398 \global\deftypemargin=0pt
4399 \global\defbodyindent=.5cm
4401 \global\pagewidth=\hsize
4402 \global\pageheight=\vsize
4404 \global\let\smalllisp=\smalllispx
4405 \global\let\smallexample=\smalllispx
4406 \global\def\Esmallexample{\Esmalllisp}
4409 % Use @afourpaper to print on European A4 paper.
4410 \def\afourpaper{
4411 \global\tolerance=700
4412 \global\hfuzz=1pt
4413 \setleading{12pt}
4414 \global\parskip 15pt plus 1pt
4416 \global\vsize= 53\baselineskip
4417 \advance\vsize by \topskip
4418 %\global\hsize= 5.85in % A4 wide 10pt
4419 \global\hsize= 6.5in
4420 \global\outerhsize=\hsize
4421 \global\advance\outerhsize by 0.5in
4422 \global\outervsize=\vsize
4423 \global\advance\outervsize by 0.6in
4425 \global\pagewidth=\hsize
4426 \global\pageheight=\vsize
4429 % Allow control of the text dimensions. Parameters in order: textheight;
4430 % textwidth; voffset; hoffset; binding offset; topskip.
4431 % All require a dimension;
4432 % header is additional; added length extends the bottom of the page.
4434 \def\changepagesizes#1#2#3#4#5#6{
4435 \global\vsize= #1
4436 \global\topskip= #6
4437 \advance\vsize by \topskip
4438 \global\voffset= #3
4439 \global\hsize= #2
4440 \global\outerhsize=\hsize
4441 \global\advance\outerhsize by 0.5in
4442 \global\outervsize=\vsize
4443 \global\advance\outervsize by 0.6in
4444 \global\pagewidth=\hsize
4445 \global\pageheight=\vsize
4446 \global\normaloffset= #4
4447 \global\bindingoffset= #5}
4449 % A specific text layout, 24x15cm overall, intended for A4 paper. Top margin
4450 % 29mm, hence bottom margin 28mm, nominal side margin 3cm.
4451 \def\afourlatex
4452 {\global\tolerance=700
4453 \global\hfuzz=1pt
4454 \setleading{12pt}
4455 \global\parskip 15pt plus 1pt
4456 \advance\baselineskip by 1.6pt
4457 \changepagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}
4460 % Use @afourwide to print on European A4 paper in wide format.
4461 \def\afourwide{\afourpaper
4462 \changepagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}}
4464 % Define macros to output various characters with catcode for normal text.
4465 \catcode`\"=\other
4466 \catcode`\~=\other
4467 \catcode`\^=\other
4468 \catcode`\_=\other
4469 \catcode`\|=\other
4470 \catcode`\<=\other
4471 \catcode`\>=\other
4472 \catcode`\+=\other
4473 \def\normaldoublequote{"}
4474 \def\normaltilde{~}
4475 \def\normalcaret{^}
4476 \def\normalunderscore{_}
4477 \def\normalverticalbar{|}
4478 \def\normalless{<}
4479 \def\normalgreater{>}
4480 \def\normalplus{+}
4482 % This macro is used to make a character print one way in ttfont
4483 % where it can probably just be output, and another way in other fonts,
4484 % where something hairier probably needs to be done.
4486 % #1 is what to print if we are indeed using \tt; #2 is what to print
4487 % otherwise. Since all the Computer Modern typewriter fonts have zero
4488 % interword stretch (and shrink), and it is reasonable to expect all
4489 % typewriter fonts to have this, we can check that font parameter.
4491 \def\ifusingtt#1#2{\ifdim \fontdimen3\the\font=0pt #1\else #2\fi}
4493 % Turn off all special characters except @
4494 % (and those which the user can use as if they were ordinary).
4495 % Most of these we simply print from the \tt font, but for some, we can
4496 % use math or other variants that look better in normal text.
4498 \catcode`\"=\active
4499 \def\activedoublequote{{\tt \char '042}}
4500 \let"=\activedoublequote
4501 \catcode`\~=\active
4502 \def~{{\tt \char '176}}
4503 \chardef\hat=`\^
4504 \catcode`\^=\active
4505 \def\auxhat{\def^{'hat}}
4506 \def^{{\tt \hat}}
4508 \catcode`\_=\active
4509 \def_{\ifusingtt\normalunderscore\_}
4510 % Subroutine for the previous macro.
4511 \def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}}
4513 \catcode`\|=\active
4514 \def|{{\tt \char '174}}
4515 \chardef \less=`\<
4516 \catcode`\<=\active
4517 \def<{{\tt \less}}
4518 \chardef \gtr=`\>
4519 \catcode`\>=\active
4520 \def>{{\tt \gtr}}
4521 \catcode`\+=\active
4522 \def+{{\tt \char 43}}
4523 %\catcode 27=\active
4524 %\def^^[{$\diamondsuit$}
4526 % Set up an active definition for =, but don't enable it most of the time.
4527 {\catcode`\==\active
4528 \global\def={{\tt \char 61}}}
4530 \catcode`+=\active
4531 \catcode`\_=\active
4533 % If a .fmt file is being used, characters that might appear in a file
4534 % name cannot be active until we have parsed the command line.
4535 % So turn them off again, and have \everyjob (or @setfilename) turn them on.
4536 % \otherifyactive is called near the end of this file.
4537 \def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
4539 \catcode`\@=0
4541 % \rawbackslashxx output one backslash character in current font
4542 \global\chardef\rawbackslashxx=`\\
4543 %{\catcode`\\=\other
4544 %@gdef@rawbackslashxx{\}}
4546 % \rawbackslash redefines \ as input to do \rawbackslashxx.
4547 {\catcode`\\=\active
4548 @gdef@rawbackslash{@let\=@rawbackslashxx }}
4550 % \normalbackslash outputs one backslash in fixed width font.
4551 \def\normalbackslash{{\tt\rawbackslashxx}}
4553 % Say @foo, not \foo, in error messages.
4554 \escapechar=`\@
4556 % \catcode 17=0 % Define control-q
4557 \catcode`\\=\active
4559 % Used sometimes to turn off (effectively) the active characters
4560 % even after parsing them.
4561 @def@turnoffactive{@let"=@normaldoublequote
4562 @let\=@realbackslash
4563 @let~=@normaltilde
4564 @let^=@normalcaret
4565 @let_=@normalunderscore
4566 @let|=@normalverticalbar
4567 @let<=@normalless
4568 @let>=@normalgreater
4569 @let+=@normalplus}
4571 @def@normalturnoffactive{@let"=@normaldoublequote
4572 @let\=@normalbackslash
4573 @let~=@normaltilde
4574 @let^=@normalcaret
4575 @let_=@normalunderscore
4576 @let|=@normalverticalbar
4577 @let<=@normalless
4578 @let>=@normalgreater
4579 @let+=@normalplus}
4581 % Make _ and + \other characters, temporarily.
4582 % This is canceled by @fixbackslash.
4583 @otherifyactive
4585 % If a .fmt file is being used, we don't want the `\input texinfo' to show up.
4586 % That is what \eatinput is for; after that, the `\' should revert to printing
4587 % a backslash.
4589 @gdef@eatinput input texinfo{@fixbackslash}
4590 @global@let\ = @eatinput
4592 % On the other hand, perhaps the file did not have a `\input texinfo'. Then
4593 % the first `\{ in the file would cause an error. This macro tries to fix
4594 % that, assuming it is called before the first `\' could plausibly occur.
4595 % Also back turn on active characters that might appear in the input
4596 % file name, in case not using a pre-dumped format.
4598 @gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi
4599 @catcode`+=@active @catcode`@_=@active}
4601 %% These look ok in all fonts, so just make them not special. The @rm below
4602 %% makes sure that the current font starts out as the newly loaded cmr10
4603 @catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other
4605 @textfonts
4608 @c Local variables:
4609 @c page-delimiter: "^\\\\message"
4610 @c End: