1 %% TeX macros to handle texinfo files
3 % Copyright (C) 1985, 1986, 1988, 1990, 1991 Free Software Foundation, Inc.
5 %This texinfo.tex file is free software; you can redistribute it and/or
6 %modify it under the terms of the GNU General Public License as
7 %published by the Free Software Foundation; either version 2, or (at
8 %your option) any later version.
10 %This texinfo.tex file is distributed in the hope that it will be
11 %useful, but WITHOUT ANY WARRANTY; without even the implied warranty
12 %of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 %General Public License for more details.
15 %You should have received a copy of the GNU General Public License
16 %along with this texinfo.tex file; see the file COPYING. If not, write
17 %to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139,
21 %In other words, you are welcome to use, share and improve this program.
22 %You are forbidden to forbid anyone else to use, share and improve
23 %what you give them. Help stamp out software-hoarding!
25 \def\texinfoversion{2.46}
26 \message{Loading texinfo package
[Version
\texinfoversion]:
}
29 % Print the version number if in a .fmt file.
30 \everyjob{\message{[Texinfo version
\texinfoversion]}\message{}}
32 % Save some parts of plain tex whose names we will redefine.
40 \let\ptexbullet=
\bullet
48 \def\tie{\penalty 10000\
} % Save plain tex definition of ~.
53 \hyphenation{ap-pen-dix
}
54 \hyphenation{mini-buf-fer mini-buf-fers
}
57 % Margin to add to right of even pages, to left of odd pages.
58 \newdimen \bindingoffset \bindingoffset=
0pt
59 \newdimen \normaloffset \normaloffset=
\hoffset
60 \newdimen\pagewidth \newdimen\pageheight
61 \pagewidth=
\hsize \pageheight=
\vsize
63 %---------------------Begin change-----------------------
65 % Dimensions to add cropmarks at corners Added by P. A. MacKay, 12 Nov. 1986
67 \newdimen\cornerlong \newdimen\cornerthick
68 \newdimen \topandbottommargin
69 \newdimen \outerhsize \newdimen \outervsize
70 \cornerlong=
1pc
\cornerthick=
.3pt
% These set size of cropmarks
73 \topandbottommargin=
.75in
75 %---------------------End change-----------------------
77 % \onepageout takes a vbox as an argument. Note that \pagecontents
78 % does insertions itself, but you have to call it yourself.
79 \chardef\PAGE=
255 \output=
{\onepageout{\pagecontents\PAGE}}
80 \def\onepageout#1{\hoffset=
\normaloffset
81 \ifodd\pageno \advance\hoffset by
\bindingoffset
82 \else \advance\hoffset by -
\bindingoffset\fi
83 {\escapechar=`\\
\relax % makes sure backslash is used in output files.
84 \shipout\vbox{{\let\hsize=
\pagewidth \makeheadline} \pagebody{#1}%
85 {\let\hsize=
\pagewidth \makefootline}}}%
86 \advancepageno \ifnum\outputpenalty>-
20000 \else\dosupereject\fi}
89 % Here is a modification of the main output routine for Near East Publications
90 % This provides right-angle cropmarks at all four corners.
91 % The contents of the page are centerlined into the cropmarks,
92 % and any desired binding offset is added as an \hskip on either
93 % site of the centerlined box. (P. A. MacKay, 12 November, 1986)
95 \def\croppageout#1{\hoffset=
0pt
% make sure this doesn't mess things up
97 \vbox to
\outervsize{\hsize=
\outerhsize
98 \vbox{\line{\ewtop\hfill\ewtop}}
100 \line{\vbox{\moveleft\cornerthick\nstop}
102 \vbox{\moveright\cornerthick\nstop}}
103 \vskip \topandbottommargin
104 \centerline{\ifodd\pageno\hskip\bindingoffset\fi
106 {\let\hsize=
\pagewidth \makeheadline}
108 {\let\hsize=
\pagewidth \makefootline}}
109 \ifodd\pageno\else\hskip\bindingoffset\fi}
110 \vskip \topandbottommargin plus1fill minus1fill
111 \boxmaxdepth\cornerthick
112 \line{\vbox{\moveleft\cornerthick\nsbot}
114 \vbox{\moveright\cornerthick\nsbot}}
116 \vbox{\line{\ewbot\hfill\ewbot}}
119 \ifnum\outputpenalty>-
20000 \else\dosupereject\fi}
121 % Do @cropmarks to get crop marks
122 \def\cropmarks{\let\onepageout=
\croppageout }
124 \def\pagebody#1{\vbox to
\pageheight{\boxmaxdepth=
\maxdepth #1}}
126 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
127 \dimen@=
\dp#1 \unvbox#1
128 \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
129 \ifr@ggedbottom
\kern-
\dimen@
\vfil \fi}
133 % Here are the rules for the cropmarks. Note that they are
134 % offset so that the space between them is truly \outerhsize or \outervsize
135 % (P. A. MacKay, 12 November, 1986)
137 \def\ewtop{\vrule height
\cornerthick depth0pt width
\cornerlong}
139 {\hrule height
\cornerthick depth
\cornerlong width
\cornerthick}}
140 \def\ewbot{\vrule height0pt depth
\cornerthick width
\cornerlong}
142 {\hrule height
\cornerlong depth
\cornerthick width
\cornerthick}}
144 % Parse an argument, then pass it to #1.
145 % The argument can be delimited with [...] or with "..." or braces
146 % or it can be a whole line.
147 % #1 should be a macro which expects
148 % an ordinary undelimited TeX argument.
150 \def\parsearg #1{\let\next=
#1\begingroup\obeylines\futurelet\temp\parseargx}
153 \ifx \obeyedspace\temp \aftergroup\parseargdiscardspace \else%
154 \aftergroup \parseargline %
158 \gdef\parseargdiscardspace {\begingroup\obeylines\futurelet\temp\parseargx}}
160 \gdef\obeyedspace{\
}
162 \def\parseargline{\begingroup \obeylines \parsearglinex}
164 \gdef\parsearglinex #1^^M
{\endgroup \next {#1}}}
166 \def\flushcr{\ifx\par\lisppar \def\next#
#1{}\else \let\next=
\relax \fi \next}
168 %% These are used to keep @begin/@end levels from running away
169 %% Call \inENV within environments (after a \begingroup)
170 \newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
172 \ifENV\errmessage{Still within an environment. Type Return to continue.
}
173 \endgroup\fi} % This is not perfect, but it should reduce lossage
175 % @begin foo is the same as @foo, for now.
176 \newhelp\EMsimple{Type <Return> to continue
}
178 \outer\def\begin{\parsearg\beginxxx}
181 \expandafter\ifx\csname #1\endcsname\relax
182 {\errhelp=
\EMsimple \errmessage{Undefined command @begin
#1}}\else
183 \csname #1\endcsname\fi}
185 %% @end foo executes the definition of \Efoo.
186 %% foo can be delimited by doublequotes or brackets.
188 \def\end{\parsearg\endxxx}
191 \expandafter\ifx\csname E
#1\endcsname\relax
192 \expandafter\ifx\csname #1\endcsname\relax
193 \errmessage{Undefined command @end
#1}\else
195 \csname E
#1\endcsname}
197 {\errhelp=
\EMsimple \errmessage{@end
#1 not within
#1 environment
}}}
199 % Single-spacing is done by various environments.
201 \newskip\singlespaceskip \singlespaceskip =
\baselineskip
203 {\advance \baselineskip by -
\singlespaceskip
204 \kern \baselineskip}%
205 \baselineskip=
\singlespaceskip
208 %% Simple single-character @ commands
211 % Kludge this until the fonts are right (grr).
212 \def\@
{{\tt \char '
100}}
214 % Define @` and @' to be the same as ` and '
215 % but suppressing ligatures.
219 % Used to generate quoted braces.
221 \def\mylbrace {{\tt \char '
173}}
222 \def\myrbrace {{\tt \char '
175}}
226 % @: forces normal size whitespace following.
227 \def\:
{\spacefactor=
1000 }
229 % @* forces a line break.
230 \def\*
{\hfil\break\hbox{}\ignorespaces}
232 % @. is an end-of-sentence period.
233 \def\.
{.
\spacefactor=
3000 }
235 % @w prevents a word break
238 % @group ... @end group forces ... to be all on one page.
240 \def\group{\begingroup% \inENV ???
241 \def \Egroup{\egroup\endgroup}
244 % @need space-in-mils
245 % forces a page break if there is not space-in-mils remaining.
247 \newdimen\mil \mil=
0.001in
249 \def\need{\parsearg\needx}
252 % This method tries to make TeX break the page naturally
253 % if the depth of the box does not fit.
255 \vtop to
#1\mil{\vfil}\kern -
#1\mil\penalty 10000
259 % @br forces paragraph break
263 % @dots{} output some dots
267 % @page forces the start of a new page
269 \def\page{\par\vfill\supereject}
272 % outputs text on separate line in roman font, starting at standard page margin
274 \def\exdent{\errmessage{@exdent in filled text
}}
275 % @lisp, etc, define \exdent locally from \internalexdent
278 \gdef\internalexdent{\parsearg\exdentzzz}}
280 \def\exdentzzz #1{{\advance \leftskip by -
\lispnarrowing
281 \advance \hsize by -
\leftskip
282 \advance \hsize by -
\rightskip
285 % @include file insert text of that file as input.
287 \def\include{\parsearg\includezzz}
288 \def\includezzz #1{{\def\thisfile{#1}\input #1
293 % @center line outputs that line, centered
295 \def\center{\parsearg\centerzzz}
296 \def\centerzzz #1{{\advance\hsize by -
\leftskip
297 \advance\hsize by -
\rightskip
300 % @sp n outputs n lines of vertical space
302 \def\sp{\parsearg\spxxx}
303 \def\spxxx #1{\par \vskip #1\baselineskip}
305 % @comment ...line which is ignored...
306 % @c is the same as @comment
307 % @ignore ... @end ignore is another way to write a comment
309 \def\comment{\catcode 64=
\other \catcode 123=
\other \catcode 125=
\other%
310 \parsearg \commentxxx}
312 \def\commentxxx #1{\catcode 64=
0 \catcode 123=
1 \catcode 125=
2 }
316 % Prevent errors for section commands.
317 % Used in @ignore and in failing conditionals.
318 \def\ignoresections{%
320 \let\unnumbered=
\relax
322 \let\unnumberedsec=
\relax
323 \let\unnumberedsection=
\relax
324 \let\unnumberedsubsec=
\relax
325 \let\unnumberedsubsection=
\relax
326 \let\unnumberedsubsubsec=
\relax
327 \let\unnumberedsubsubsection=
\relax
330 \let\subsubsec=
\relax
331 \let\subsection=
\relax
332 \let\subsubsection=
\relax
334 \let\appendixsec=
\relax
335 \let\appendixsection=
\relax
336 \let\appendixsubsec=
\relax
337 \let\appendixsubsection=
\relax
338 \let\appendixsubsubsec=
\relax
339 \let\appendixsubsubsection=
\relax
341 \let\smallbook=
\relax
342 \let\titlepage=
\relax
345 \def\ignore{\begingroup\ignoresections
346 % Make sure that spaces turn into tokens that match what \ignorexxx wants.
349 \long\def\ignorexxx #1\end ignore
{\endgroup\ignorespaces}
351 \def\direntry{\begingroup\direntryxxx}
352 \long\def\direntryxxx #1\end direntry
{\endgroup\ignorespaces}
354 % Conditionals to test whether a flag is set.
356 \outer\def\ifset{\begingroup\ignoresections\parsearg\ifsetxxx}
358 \def\ifsetxxx #1{\endgroup
359 \expandafter\ifx\csname IF
#1\endcsname\relax \let\temp=
\ifsetfail
360 \else \let\temp=
\relax \fi
363 \def\ifsetfail{\begingroup\ignoresections\ifsetfailxxx}
364 \long\def\ifsetfailxxx #1\end ifset
{\endgroup\ignorespaces}
366 \outer\def\ifclear{\begingroup\ignoresections\parsearg\ifclearxxx}
368 \def\ifclearxxx #1{\endgroup
369 \expandafter\ifx\csname IF
#1\endcsname\relax \let\temp=
\relax
370 \else \let\temp=
\ifclearfail \fi
373 \def\ifclearfail{\begingroup\ignoresections\ifclearfailxxx}
374 \long\def\ifclearfailxxx #1\end ifclear
{\endgroup\ignorespaces}
376 % Some texinfo constructs that are trivial in tex
380 \def\ifinfo{\begingroup\ignoresections\ifinfoxxx}
381 \long\def\ifinfoxxx #1\end ifinfo
{\endgroup\ignorespaces}
383 \long\def\menu #1\end menu
{}
386 % @math means output in math mode.
387 % We don't use $'s directly in the definition of \math because control
388 % sequences like \math are expanded when the toc file is written. Then,
389 % we read the toc file back, the $'s will be normal characters (as they
390 % should be, according to the definition of Texinfo). So we must use a
391 % control sequence to switch into and out of math mode.
393 % This isn't quite enough for @math to work properly in indices, but it
394 % seems unlikely it will ever be needed there.
396 \let\implicitmath = $
397 \def\math#1{\implicitmath #1\implicitmath}
399 \def\node{\ENVcheck\parsearg\nodezzz}
400 \def\nodezzz#1{\nodexxx [#1,
]}
401 \def\nodexxx[#1,
#2]{\gdef\lastnode{#1}}
404 \def\donoderef{\ifx\lastnode\relax\else
405 \expandafter\expandafter\expandafter\setref{\lastnode}\fi
406 \let\lastnode=
\relax}
408 \def\unnumbnoderef{\ifx\lastnode\relax\else
409 \expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi
410 \let\lastnode=
\relax}
412 \def\appendixnoderef{\ifx\lastnode\relax\else
413 \expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi
414 \let\lastnode=
\relax}
418 % @setfilename is done at the beginning of every texinfo file.
419 % So open here the files we need to have open while reading the input.
420 % This makes it possible to make a .fmt file for texinfo.
425 \fixbackslash % Turn off hack to swallow `\input texinfo'.
426 \global\let\setfilename=
\comment % Ignore extra @setfilename cmds.
427 \comment % Ignore the actual filename.
430 \outer\def\bye{\pagealignmacro\tracingstats=
1\ptexend}
432 \def\inforef #1{\inforefzzz #1,,,,**
}
433 \def\inforefzzz #1,
#2,
#3,
#4**
{See Info file
\file{\losespace#3{}},
434 node
\samp{\losespace#1{}}}
435 \def\losespace #1{#1}
439 % Font-change commands.
441 % Texinfo supports the sans serif font style, which plain TeX does not.
442 % So we set up a \sf analogous to plain's \rm, etc.
444 \def\sf{\fam=
\sffam \tensf}
445 \let\li =
\sf % Sometimes we call it \li, not \sf.
447 %% Try out Computer Modern fonts at \magstephalf
448 \font\textrm=cmr10 scaled
\magstephalf
449 \font\texttt=cmtt10 scaled
\magstephalf
450 % Instead of cmb10, you many want to use cmbx10.
451 % cmbx10 is a prettier font on its own, but cmb10
452 % looks better when embedded in a line with cmr10.
453 \font\textbf=cmb10 scaled
\magstephalf
454 \font\textit=cmti10 scaled
\magstephalf
455 \font\textsl=cmsl10 scaled
\magstephalf
456 \font\textsf=cmss10 scaled
\magstephalf
457 \font\textsc=cmcsc10 scaled
\magstephalf
458 \font\texti=cmmi10 scaled
\magstephalf
459 \font\textsy=cmsy10 scaled
\magstephalf
461 % A few fonts for @defun, etc.
462 \font\defbf=cmbx10 scaled
\magstep1 %was 1314
463 \font\deftt=cmtt10 scaled
\magstep1
464 \def\df{\let\tentt=
\deftt \let\tenbf =
\defbf \bf}
466 % Fonts for indices and small examples.
467 % We actually use the slanted font rather than the italic,
468 % because texinfo normally uses the slanted fonts for that.
469 % Do not make many font distinctions in general in the index, since they
470 % aren't very useful.
483 \font\chaprm=cmbx12 scaled
\magstep2
484 \font\chapit=cmti12 scaled
\magstep2
485 \font\chapsl=cmsl12 scaled
\magstep2
486 \font\chaptt=cmtt12 scaled
\magstep2
487 \font\chapsf=cmss12 scaled
\magstep2
489 \font\chapsc=cmcsc10 scaled
\magstep3
490 \font\chapi=cmmi12 scaled
\magstep2
491 \font\chapsy=cmsy10 scaled
\magstep3
493 \font\secrm=cmbx12 scaled
\magstep1
494 \font\secit=cmti12 scaled
\magstep1
495 \font\secsl=cmsl12 scaled
\magstep1
496 \font\sectt=cmtt12 scaled
\magstep1
497 \font\secsf=cmss12 scaled
\magstep1
498 \font\secbf=cmbx12 scaled
\magstep1
499 \font\secsc=cmcsc10 scaled
\magstep2
500 \font\seci=cmmi12 scaled
\magstep1
501 \font\secsy=cmsy10 scaled
\magstep2
503 % \font\ssecrm=cmbx10 scaled \magstep1 % This size an font looked bad.
504 % \font\ssecit=cmti10 scaled \magstep1 % The letters were too crowded.
505 % \font\ssecsl=cmsl10 scaled \magstep1
506 % \font\ssectt=cmtt10 scaled \magstep1
507 % \font\ssecsf=cmss10 scaled \magstep1
509 %\font\ssecrm=cmb10 scaled 1315 % Note the use of cmb rather than cmbx.
510 %\font\ssecit=cmti10 scaled 1315 % Also, the size is a little larger than
511 %\font\ssecsl=cmsl10 scaled 1315 % being scaled magstep1.
512 %\font\ssectt=cmtt10 scaled 1315
513 %\font\ssecsf=cmss10 scaled 1315
517 \font\ssecrm=cmbx12 scaled
\magstephalf
518 \font\ssecit=cmti12 scaled
\magstephalf
519 \font\ssecsl=cmsl12 scaled
\magstephalf
520 \font\ssectt=cmtt12 scaled
\magstephalf
521 \font\ssecsf=cmss12 scaled
\magstephalf
522 \font\ssecbf=cmbx12 scaled
\magstephalf
523 \font\ssecsc=cmcsc10 scaled
\magstep1
524 \font\sseci=cmmi12 scaled
\magstephalf
525 \font\ssecsy=cmsy10 scaled
\magstep1
526 % The smallcaps and symbol fonts should actually be scaled \magstep1.5,
527 % but that is not a standard magnification.
529 % Fonts for title page:
530 \font\titlerm = cmbx12 scaled
\magstep3
531 \let\authorrm =
\secrm
533 % In order for the font changes to affect most math symbols and letters,
534 % we have to define the \textfont of the standard families. Since
535 % texinfo doesn't allow for producing subscripts and superscripts, we
536 % don't bother to reset \scriptfont and \scriptscriptfont (which would
537 % also require loading a lot more fonts).
539 \def\resetmathfonts{%
540 \textfont0 =
\tenrm \textfont1 =
\teni \textfont2 =
\tensy
541 \textfont\itfam =
\tenit \textfont\slfam =
\tensl \textfont\bffam =
\tenbf
542 \textfont\ttfam =
\tentt \textfont\sffam =
\tensf
546 % The font-changing commands redefine the meanings of \tenSTYLE, instead
547 % of just \STYLE. We do this so that font changes will continue to work
548 % in math mode, where it is the current \fam that is relevant in most
549 % cases, not the current. Plain TeX does, for example,
550 % \def\bf{\fam=\bffam \tenbf} By redefining \tenbf, we obviate the need
551 % to redefine \bf itself.
553 \let\tenrm=
\textrm \let\tenit=
\textit \let\tensl=
\textsl
554 \let\tenbf=
\textbf \let\tentt=
\texttt \let\smallcaps=
\textsc
555 \let\tensf=
\textsf \let\teni=
\texti \let\tensy=
\textsy
558 \let\tenrm=
\chaprm \let\tenit=
\chapit \let\tensl=
\chapsl
559 \let\tenbf=
\chapbf \let\tentt=
\chaptt \let\smallcaps=
\chapsc
560 \let\tensf=
\chapsf \let\teni=
\chapi \let\tensy=
\chapsy
563 \let\tenrm=
\secrm \let\tenit=
\secit \let\tensl=
\secsl
564 \let\tenbf=
\secbf \let\tentt=
\sectt \let\smallcaps=
\sectt
565 \let\tensf=
\secsf \let\teni=
\seci \let\tensy=
\secsy
568 \let\tenrm=
\ssecrm \let\tenit=
\ssecit \let\tensl=
\ssecsl
569 \let\tenbf=
\ssecbf \let\tentt=
\ssectt \let\smallcaps=
\ssecsc
570 \let\tensf=
\ssecsf \let\teni=
\sseci \let\tensy=
\ssecsy
573 \let\tenrm=
\indrm \let\tenit=
\tenit \let\tensl=
\indsl
574 \let\tenbf=
\indbf \let\tentt=
\indtt \let\smallcaps=
\indsc
575 \let\tensf=
\indsf \let\teni=
\indi \let\tensy=
\indsy
578 % Set up the default fonts, so we can use them for creating boxes.
582 % Count depth in font-changes, for error checks
583 \newcount\fontdepth \fontdepth=
0
585 % Fonts for short table of contents.
586 \font\shortcontrm=cmr12
587 \font\shortcontbf=cmbx12
588 \font\shortcontsl=cmsl12
590 %% Add scribe-like font environments, plus @l for inline lisp (usually sans
591 %% serif) and @ii for TeX italic
593 % \smartitalic{ARG} outputs arg in italics, followed by an italic correction
594 % unless the following character is such as not to need one.
595 \def\smartitalicx{\ifx\next,
\else\ifx\next-
\else\ifx\next.
\else\/
\fi\fi\fi}
596 \def\smartitalic#1{{\sl #1}\futurelet\next\smartitalicx}
599 \let\var=
\smartitalic
600 \let\dfn=
\smartitalic
601 \let\emph=
\smartitalic
602 \let\cite=
\smartitalic
607 \def\t#1{{\tt \exhyphenpenalty=
10000\rawbackslash \frenchspacing #1}\null}
609 %\def\samp #1{`{\tt \rawbackslash \frenchspacing #1}'\null}
610 \def\samp #1{`
\tclose{#1}'
\null}
611 \def\key #1{{\tt \exhyphenpenalty=
10000\uppercase{#1}}\null}
612 \def\ctrl #1{{\tt \rawbackslash \hat}#1}
616 % @code is a modification of @t,
617 % which makes spaces the same size as normal in the surrounding text.
620 \def\tclose#1{{\rm \tcloserm=
\fontdimen2\font \tt \tclosesave=
\fontdimen2\font
621 \fontdimen2\font=
\tcloserm
622 % prevent breaking lines at hyphens.
623 \exhyphenpenalty=
10000
624 \def\
{{\fontdimen2\font=
\tclosesave{} }}%
625 \rawbackslash \frenchspacing #1\fontdimen2\font=
\tclosesave}\null}
627 %\let\exp=\tclose %Was temporary
629 % @kbd is like @code, except that if the argument is just one @key command,
630 % then @kbd has no effect.
633 \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??
}%
634 \ifx\one\xkey\ifx\threex\three \key{#2}%
635 \else\tclose{\look}\fi
636 \else\tclose{\look}\fi}
638 % Typeset a dimension, e.g., `in' or `pt'. The only reason for the
639 % argument is to make the input look right: @dmn{pt} instead of
642 \def\dmn#1{\thinspace #1}
644 \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??
\par}
646 \def\l#1{{\li #1}\null} %
648 \def\r#1{{\rm #1}} % roman font
649 % Use of \lowercase was suggested.
650 \def\sc#1{{\smallcaps#1}} % smallcaps font
651 \def\ii#1{{\it #1}} % italic font
653 \message{page headings,
}
655 \newskip\titlepagetopglue \titlepagetopglue =
1.5in
656 \newskip\titlepagebottomglue \titlepagebottomglue =
2pc
658 % First the title page. Must do @settitle before @titlepage.
659 \def\titlefont#1{{\titlerm #1}}
661 \newtoks\realeverypar
663 \newif\iffinishedtitlepage
665 \def\titlepage{\begingroup \parindent=
0pt
\textfonts
666 \let\subtitlerm=
\tenrm
667 % I deinstalled the following change because \cmr12 is undefined.
668 % This change was not in the ChangeLog anyway. --rms.
669 % \let\subtitlerm=\cmr12
670 \def\subtitlefont{\subtitlerm \normalbaselineskip =
13pt
\normalbaselines}%
672 \def\authorfont{\authorrm \normalbaselineskip =
16pt
\normalbaselines}%
674 % Leave some space at the very top of the page.
675 \vglue\titlepagetopglue
677 % Now you can print the title using @title.
678 \def\title{\parsearg\titlezzz}%
679 \def\titlezzz#
#1{\leftline{\titlefont{#
#1}}
680 % print a rule at the page bottom also.
681 \finishedtitlepagefalse
682 \vskip4pt \hrule height
4pt
\vskip4pt}%
683 % No rule at page bottom unless we print one at the top with @title.
684 \finishedtitlepagetrue
686 % Now you can put text using @subtitle.
687 \def\subtitle{\parsearg\subtitlezzz}%
688 \def\subtitlezzz#
#1{{\subtitlefont \rightline{#
#1}}}%
690 % @author should come last, but may come many times.
691 \def\author{\parsearg\authorzzz}%
692 \def\authorzzz#
#1{\ifseenauthor\else\vskip 0pt plus
1filll
\seenauthortrue\fi
693 {\authorfont \leftline{#
#1}}}%
695 % Most title ``pages'' are actually two pages long, with space
696 % at the top of the second. We don't want the ragged left on the second.
699 \iffinishedtitlepage\else
705 % \def\page{\oldpage \hbox{}}
709 \iffinishedtitlepage\else
712 % It is important to do the page break before ending the group,
713 % because the headline and footline are only empty inside the group.
714 % If we use the new definition of \page, we always get a blank page
715 % after the title page, which we certainly don't want.
721 \def\finishtitlepage{%
722 \vskip4pt \hrule height
2pt
723 \vskip\titlepagebottomglue
724 \finishedtitlepagetrue
727 %%% Set up page headings and footings.
731 \newtoks \evenheadline % Token sequence for heading line of even pages
732 \newtoks \oddheadline % Token sequence for heading line of odd pages
733 \newtoks \evenfootline % Token sequence for footing line of even pages
734 \newtoks \oddfootline % Token sequence for footing line of odd pages
736 % Now make Tex use those variables
737 \headline=
{{\textfonts\rm \ifodd\pageno \the\oddheadline
738 \else \the\evenheadline \fi}}
739 \footline=
{{\textfonts\rm \ifodd\pageno \the\oddfootline
740 \else \the\evenfootline \fi}\HEADINGShook}
741 \let\HEADINGShook=
\relax
743 % Commands to set those variables.
744 % For example, this is what @headings on does
745 % @evenheading @thistitle|@thispage|@thischapter
746 % @oddheading @thischapter|@thispage|@thistitle
747 % @evenfooting @thisfile||
748 % @oddfooting ||@thisfile
750 \def\evenheading{\parsearg\evenheadingxxx}
751 \def\oddheading{\parsearg\oddheadingxxx}
752 \def\everyheading{\parsearg\everyheadingxxx}
754 \def\evenfooting{\parsearg\evenfootingxxx}
755 \def\oddfooting{\parsearg\oddfootingxxx}
756 \def\everyfooting{\parsearg\everyfootingxxx}
760 \gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|
\finish}
761 \gdef\evenheadingyyy #1@|
#2@|
#3@|
#4\finish{%
762 \global\evenheadline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
764 \gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|
\finish}
765 \gdef\oddheadingyyy #1@|
#2@|
#3@|
#4\finish{%
766 \global\oddheadline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
768 \gdef\everyheadingxxx #1{\everyheadingyyy #1@|@|@|@|
\finish}
769 \gdef\everyheadingyyy #1@|
#2@|
#3@|
#4\finish{%
770 \global\evenheadline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}
771 \global\oddheadline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
773 \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|
\finish}
774 \gdef\evenfootingyyy #1@|
#2@|
#3@|
#4\finish{%
775 \global\evenfootline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
777 \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|
\finish}
778 \gdef\oddfootingyyy #1@|
#2@|
#3@|
#4\finish{%
779 \global\oddfootline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
781 \gdef\everyfootingxxx #1{\everyfootingyyy #1@|@|@|@|
\finish}
782 \gdef\everyfootingyyy #1@|
#2@|
#3@|
#4\finish{%
783 \global\evenfootline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}
784 \global\oddfootline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
786 }% unbind the catcode of @.
788 % @headings double turns headings on for double-sided printing.
789 % @headings single turns headings on for single-sided printing.
790 % @headings off turns them off.
791 % @headings on same as @headings double, retained for compatibility.
792 % @headings after turns on double-sided headings after this page.
793 % @headings doubleafter turns on double-sided headings after this page.
794 % @headings singleafter turns on single-sided headings after this page.
795 % By default, they are off.
797 \def\headings #1 {\csname HEADINGS
#1\endcsname}
800 \global\evenheadline=
{\hfil} \global\evenfootline=
{\hfil}
801 \global\oddheadline=
{\hfil} \global\oddfootline=
{\hfil}}
803 % When we turn headings on, set the page number to 1.
804 % For double-sided printing, put current file name in lower left corner,
805 % chapter name on inside top of right hand pages, document
806 % title on inside top of left hand pages, and page numbers on outside top
811 \global\evenfootline=
{\hfil}
812 \global\oddfootline=
{\hfil}
813 \global\evenheadline=
{\line{\folio\hfil\thistitle}}
814 \global\oddheadline=
{\line{\thischapter\hfil\folio}}
816 % For single-sided printing, chapter title goes across top left of page,
817 % page number on top right.
821 \global\evenfootline=
{\hfil}
822 \global\oddfootline=
{\hfil}
823 \global\evenheadline=
{\line{\thischapter\hfil\folio}}
824 \global\oddheadline=
{\line{\thischapter\hfil\folio}}
826 \def\HEADINGSon{\HEADINGSdouble}
828 \def\HEADINGSafter{\let\HEADINGShook=
\HEADINGSdoublex}
829 \let\HEADINGSdoubleafter=
\HEADINGSafter
830 \def\HEADINGSdoublex{%
831 \global\evenfootline=
{\hfil}
832 \global\oddfootline=
{\hfil}
833 \global\evenheadline=
{\line{\folio\hfil\thistitle}}
834 \global\oddheadline=
{\line{\thischapter\hfil\folio}}
837 \def\HEADINGSsingleafter{\let\HEADINGShook=
\HEADINGSsinglex}
838 \def\HEADINGSsinglex{%
839 \global\evenfootline=
{\hfil}
840 \global\oddfootline=
{\hfil}
841 \global\evenheadline=
{\line{\thischapter\hfil\folio}}
842 \global\oddheadline=
{\line{\thischapter\hfil\folio}}
845 % Subroutines used in generating headings
846 % Produces Day Month Year style of output.
847 \def\today{\number\day\space
849 January
\or February
\or March
\or April
\or May
\or June
\or
850 July
\or August
\or September
\or October
\or November
\or December
\fi
853 % Use this if you want the Month Day, Year style of output.
854 %\def\today{\ifcase\month\or
855 %January\or February\or March\or April\or May\or June\or
856 %July\or August\or September\or October\or November\or December\fi
857 %\space\number\day, \number\year}
859 % @settitle line... specifies the title of the document, for headings
860 % It generates no output of its own
862 \def\thistitle{No Title
}
863 \def\settitle{\parsearg\settitlezzz}
864 \def\settitlezzz #1{\gdef\thistitle{#1}}
868 % @tabs -- simple alignment
870 % These don't work. For one thing, \+ is defined as outer.
871 % So these macros cannot even be defined.
873 %\def\tabs{\parsearg\tabszzz}
874 %\def\tabszzz #1{\settabs\+#1\cr}
875 %\def\tabline{\parsearg\tablinezzz}
876 %\def\tablinezzz #1{\+#1\cr}
879 % Tables -- @table, @ftable, @item(x), @kitem(x), @xitem(x).
881 % default indentation of table text
882 \newdimen\tableindent \tableindent=
.8in
883 % default indentation of @itemize and @enumerate text
884 \newdimen\itemindent \itemindent=
.3in
885 % margin between end of table item and start of table text.
886 \newdimen\itemmargin \itemmargin=
.1in
888 % used internally for \itemindent minus \itemmargin
891 % Note @table and @ftable define @item, @itemx, etc., with these defs.
892 % They also define \itemindex
893 % to index the item name in whatever manner is desired (perhaps none).
895 \def\internalBitem{\smallbreak \parsearg\itemzzz}
896 \def\internalBitemx{\par \parsearg\itemzzz}
898 \def\internalBxitem "
#1"
{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
899 \def\internalBxitemx "
#1"
{\def\xitemsubtopix{#1} \par \parsearg\xitemzzz}
901 \def\internalBkitem{\smallbreak \parsearg\kitemzzz}
902 \def\internalBkitemx{\par \parsearg\kitemzzz}
904 \def\kitemzzz #1{\dosubind {kw
}{\code{#1}}{for
{\bf \lastfunction}}%
907 \def\xitemzzz #1{\dosubind {kw
}{\code{#1}}{for
{\bf \xitemsubtopic}}%
910 \def\itemzzz #1{\begingroup %
911 \advance \hsize by -
\rightskip %
912 \advance \hsize by -
\leftskip %
913 \setbox0=
\hbox{\itemfont{#1}}%
917 \ifdim \wd0>
\itemmax %
918 \vadjust{\penalty 10000}%
919 \hbox to
\hsize{\hskip -
\tableindent\box0\hss}\
%
921 \hbox to
0pt
{\hskip -
\tableindent\box0\hss}%
926 \def\item{\errmessage{@item while not in a table
}}
927 \def\itemx{\errmessage{@itemx while not in a table
}}
928 \def\kitem{\errmessage{@kitem while not in a table
}}
929 \def\kitemx{\errmessage{@kitemx while not in a table
}}
930 \def\xitem{\errmessage{@xitem while not in a table
}}
931 \def\xitemx{\errmessage{@xitemx while not in a table
}}
933 %% Contains a kludge to get @end[description] to work
934 \def\description{\tablez{\dontindex}{1}{}{}{}{}}
936 \def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
937 {\obeylines\obeyspaces%
939 \tabley\dontindex#1 \endtabley}}
941 \def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
942 {\obeylines\obeyspaces%
943 \gdef\ftablex #1^^M
{%
944 \tabley\fnitemindex#1 \endtabley
945 \def\Eftable{\endgraf\endgroup\afterenvbreak}%
949 \def\fnitemindex #1{\doind {fn
}{\code{#1}}}%
952 \gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
953 \tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
955 \def\tablez #1#2#3#4#5#6{%
958 \def\Edescription{\Etable}% Neccessary kludge.
960 \ifnum 0#3>
0 \advance \leftskip by
#3\mil \fi %
961 \ifnum 0#4>
0 \tableindent=
#4\mil \fi %
962 \ifnum 0#5>
0 \advance \rightskip by
#5\mil \fi %
964 \itemmax=
\tableindent %
965 \advance \itemmax by -
\itemmargin %
966 \advance \leftskip by
\tableindent %
968 \parskip =
\smallskipamount
969 \ifdim \parskip=
0pt
\parskip=
2pt
\fi%
970 \def\Etable{\endgraf\endgroup\afterenvbreak}%
971 \let\item =
\internalBitem %
972 \let\itemx =
\internalBitemx %
973 \let\kitem =
\internalBkitem %
974 \let\kitemx =
\internalBkitemx %
975 \let\xitem =
\internalBxitem %
976 \let\xitemx =
\internalBxitemx %
979 % This is the counter used by @enumerate, which is really @itemize
983 \def\itemize{\parsearg\itemizezzz}
985 \def\itemizezzz #1{\itemizey {#1}{\Eitemize}}
991 \itemmax=
\itemindent %
992 \advance \itemmax by -
\itemmargin %
993 \advance \leftskip by
\itemindent %
995 \parskip =
\smallskipamount
996 \ifdim \parskip=
0pt
\parskip=
2pt
\fi%
997 \def#2{\endgraf\endgroup\afterenvbreak}%
998 \def\itemcontents{#1}%
999 \let\item=
\itemizeitem}
1001 \def\bullet{$
\ptexbullet$
}
1004 % Set sfcode to normal for the chars that usually have another value.
1005 % These are `.?!:;,'
1006 \def\frenchspacing{\sfcode46=
1000 \sfcode63=
1000 \sfcode33=
1000
1007 \sfcode58=
1000 \sfcode59=
1000 \sfcode44=
1000 }
1009 \def\enumerate{\itemizey{\the\itemno.
}\Eenumerate\flushcr}
1011 \def\alphaenumerate{\itemizey{\ifcase\itemno\or
1012 a
\or b
\or c
\or d
\or e
\or f
\or g
\or h
\or i
\or j
\or k
\or l
\or m
\or n
\or o
\or
1013 p
\or q
\or r
\or s
\or t
\or u
\or v
\or w
\or x
\or y
\or z
\else
1014 \errmessage{More than
26 items in @ecapitate; get a bigger alphabet.
}\fi.
}%
1015 \Ealphaenumerate\flushcr}
1017 \def\capsenumerate{\itemizey{\ifcase\itemno\or
1018 A
\or B
\or C
\or D
\or E
\or F
\or G
\or H
\or I
\or J
\or K
\or L
\or M
\or N
\or O
\or
1019 P
\or Q
\or R
\or S
\or T
\or U
\or V
\or W
\or X
\or Y
\or Z
\else
1020 \errmessage{More than
26 items in @capsenumerate; get a bigger alphabet.
}\fi.
}%
1021 \Ecapsenumerate\flushcr}
1023 % Definition of @item while inside @itemize.
1026 \advance\itemno by
1
1027 {\let\par=
\endgraf \smallbreak}%
1028 \ifhmode \errmessage{\in hmode at itemizeitem
}\fi
1029 {\parskip=
0in
\hskip 0pt
1030 \hbox to
0pt
{\hss \itemcontents\hskip \itemmargin}%
1031 \vadjust{\penalty 300}}%
1035 % Index generation facilities
1037 % Define \newwrite to be identical to plain tex's \newwrite
1038 % except not \outer, so it can be used within \newindex.
1040 \gdef\newwrite{\alloc@
7\write\chardef\sixt@@n
}}
1042 % \newindex {foo} defines an index named foo.
1043 % It automatically defines \fooindex such that
1044 % \fooindex ...rest of line... puts an entry in the index foo.
1045 % It also defines \fooindfile to be the number of the output channel for
1046 % the file that accumulates this index. The file's extension is foo.
1047 % The name of an index should be no more than 2 characters long
1048 % for the sake of vms.
1051 \expandafter\newwrite \csname#1indfile
\endcsname% Define number for output file
1052 \openout \csname#1indfile
\endcsname \jobname.
#1 % Open the file
1053 \expandafter\xdef\csname#1index
\endcsname{% % Define \xxxindex
1054 \noexpand\doindex {#1}}
1057 % @defindex foo == \newindex{foo}
1059 \def\defindex{\parsearg\newindex}
1061 % Define @defcodeindex, like @defindex except put all entries in @code.
1063 \def\newcodeindex #1{
1064 \expandafter\newwrite \csname#1indfile
\endcsname% Define number for output file
1065 \openout \csname#1indfile
\endcsname \jobname.
#1 % Open the file
1066 \expandafter\xdef\csname#1index
\endcsname{% % Define \xxxindex
1067 \noexpand\docodeindex {#1}}
1070 \def\defcodeindex{\parsearg\newcodeindex}
1072 % @synindex foo bar makes index foo feed into index bar.
1073 % Do this instead of @defindex foo if you don't want it as a separate index.
1074 \def\synindex #1 #2 {%
1075 \expandafter\let\expandafter\synindexfoo\expandafter=
\csname#2indfile
\endcsname
1076 \expandafter\let\csname#1indfile
\endcsname=
\synindexfoo
1077 \expandafter\xdef\csname#1index
\endcsname{% % Define \xxxindex
1078 \noexpand\doindex {#2}}%
1081 % @syncodeindex foo bar similar, but put all entries made for index foo
1083 \def\syncodeindex #1 #2 {%
1084 \expandafter\let\expandafter\synindexfoo\expandafter=
\csname#2indfile
\endcsname
1085 \expandafter\let\csname#1indfile
\endcsname=
\synindexfoo
1086 \expandafter\xdef\csname#1index
\endcsname{% % Define \xxxindex
1087 \noexpand\docodeindex {#2}}%
1090 % Define \doindex, the driver for all \fooindex macros.
1091 % Argument #1 is generated by the calling \fooindex macro,
1092 % and it is "foo", the name of the index.
1094 % \doindex just uses \parsearg; it calls \doind for the actual work.
1095 % This is because \doind is more useful to call from other macros.
1097 % There is also \dosubind {index}{topic}{subtopic}
1098 % which makes an entry in a two-level index such as the operation index.
1100 \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
1101 \def\singleindexer #1{\doind{\indexname}{#1}}
1103 % like the previous two, but they put @code around the argument.
1104 \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
1105 \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
1108 \def\_{{\realbackslash _
}}%
1109 \def\w{\realbackslash w
}%
1110 \def\bf{\realbackslash bf
}%
1111 \def\rm{\realbackslash rm
}%
1112 \def\sl{\realbackslash sl
}%
1113 \def\sf{\realbackslash sf
}%
1114 \def\tt{\realbackslash tt
}%
1115 \def\gtr{\realbackslash gtr
}%
1116 \def\less{\realbackslash less
}%
1117 \def\hat{\realbackslash hat
}%
1118 \def\char{\realbackslash char
}%
1119 \def\TeX{\realbackslash TeX
}%
1120 \def\dots{\realbackslash dots
}%
1121 \def\copyright{\realbackslash copyright
}%
1122 \def\tclose#
#1{\realbackslash tclose
{#
#1}}%
1123 \def\code#
#1{\realbackslash code
{#
#1}}%
1124 \def\samp#
#1{\realbackslash samp
{#
#1}}%
1125 \def\t#
#1{\realbackslash r
{#
#1}}%
1126 \def\r#
#1{\realbackslash r
{#
#1}}%
1127 \def\i#
#1{\realbackslash i
{#
#1}}%
1128 \def\b#
#1{\realbackslash b
{#
#1}}%
1129 \def\cite#
#1{\realbackslash cite
{#
#1}}%
1130 \def\key#
#1{\realbackslash key
{#
#1}}%
1131 \def\file#
#1{\realbackslash file
{#
#1}}%
1132 \def\var#
#1{\realbackslash var
{#
#1}}%
1133 \def\kbd#
#1{\realbackslash kbd
{#
#1}}%
1136 % \indexnofonts no-ops all font-change commands.
1137 % This is used when outputting the strings to sort the index by.
1138 \def\indexdummyfont#1{#1}
1139 \def\indexdummytex{TeX
}
1140 \def\indexdummydots{...
}
1143 \let\w=
\indexdummyfont
1144 \let\t=
\indexdummyfont
1145 \let\r=
\indexdummyfont
1146 \let\i=
\indexdummyfont
1147 \let\b=
\indexdummyfont
1148 \let\emph=
\indexdummyfont
1149 \let\strong=
\indexdummyfont
1150 \let\cite=
\indexdummyfont
1151 \let\sc=
\indexdummyfont
1152 %Don't no-op \tt, since it isn't a user-level command
1153 % and is used in the definitions of the active chars like <, >, |...
1154 %\let\tt=\indexdummyfont
1155 \let\tclose=
\indexdummyfont
1156 \let\code=
\indexdummyfont
1157 \let\file=
\indexdummyfont
1158 \let\samp=
\indexdummyfont
1159 \let\kbd=
\indexdummyfont
1160 \let\key=
\indexdummyfont
1161 \let\var=
\indexdummyfont
1162 \let\TeX=
\indexdummytex
1163 \let\dots=
\indexdummydots
1166 % To define \realbackslash, we must make \ not be an escape.
1167 % We must first make another character (@) an escape
1168 % so we do not become unable to do a definition.
1170 {\catcode`\@=
0 \catcode`\\=
\other
1171 @gdef@realbackslash
{\
}}
1173 \let\indexbackslash=
0 %overridden during \printindex.
1176 {\count10=
\lastpenalty %
1177 {\indexdummies % Must do this here, since \bf, etc expand at this stage
1179 {\let\folio=
0% Expand all macros now EXCEPT \folio
1180 \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
1181 % so it will be output as is; and it will print as backslash in the indx.
1183 % Now process the index-string once, with all font commands turned off,
1184 % to get the string to sort the index by.
1188 % Now produce the complete index entry. We process the index-string again,
1189 % this time with font commands expanded, to get what to print in the index.
1191 \write \csname#1indfile
\endcsname{%
1192 \realbackslash entry
{\temp1}{\folio}{#2}}}%
1196 \def\dosubind #1#2#3{%
1197 {\count10=
\lastpenalty %
1198 {\indexdummies % Must do this here, since \bf, etc expand at this stage
1201 \def\rawbackslashxx{\indexbackslash}%
1203 % Now process the index-string once, with all font commands turned off,
1204 % to get the string to sort the index by.
1208 % Now produce the complete index entry. We process the index-string again,
1209 % this time with font commands expanded, to get what to print in the index.
1211 \write \csname#1indfile
\endcsname{%
1212 \realbackslash entry
{\temp1}{\folio}{#2}{#3}}}%
1216 % The index entry written in the file actually looks like
1217 % \entry {sortstring}{page}{topic}
1219 % \entry {sortstring}{page}{topic}{subtopic}
1220 % The texindex program reads in these files and writes files
1221 % containing these kinds of lines:
1223 % before the first topic whose initial is c
1224 % \entry {topic}{pagelist}
1225 % for a topic that is used without subtopics
1227 % for the beginning of a topic that is used with subtopics
1228 % \secondary {subtopic}{pagelist}
1229 % for each subtopic.
1231 % Define the user-accessible indexing commands
1232 % @findex, @vindex, @kindex, @cindex.
1234 \def\findex {\fnindex}
1235 \def\kindex {\kyindex}
1236 \def\cindex {\cpindex}
1237 \def\vindex {\vrindex}
1238 \def\tindex {\tpindex}
1239 \def\pindex {\pgindex}
1241 \def\cindexsub {\begingroup\obeylines\cindexsub}
1243 \gdef\cindexsub "
#1"
#2^^M
{\endgroup %
1244 \dosubind{cp
}{#2}{#1}}}
1246 % Define the macros used in formatting output of the sorted index material.
1248 % This is what you call to cause a particular index to get printed.
1250 % @unnumbered Function Index
1253 \def\printindex{\parsearg\doprintindex}
1255 \def\doprintindex#1{\tex %
1256 \dobreak \chapheadingskip {10000}
1257 \catcode`\%=
\other\catcode`\&=
\other\catcode`\#=
\other
1258 \catcode`\$=
\other\catcode`
\_=
\other
1260 % The following don't help, since the chars were translated
1261 % when the raw index was written, and their fonts were discarded
1262 % due to \indexnofonts.
1263 %\catcode`\"=\active
1264 %\catcode`\^=\active
1265 %\catcode`\_=\active
1266 %\catcode`\|=\active
1267 %\catcode`\<=\active
1268 %\catcode`\>=\active
1269 \def\indexbackslash{\rawbackslashxx}
1270 \indexfonts\rm \tolerance=
9500 \advance\baselineskip -
1pt
1272 \openin 1 \jobname.
#1s
1274 % \enddoublecolumns gets confused if there is no text in the index,
1275 % and it loses the chapter title and the aux file entries for the index.
1276 % The easiest way to prevent this problem is to make sure there is some text.
1278 \else \closein 1 \input \jobname.
#1s
1283 % These macros are used by the sorted index file itself.
1284 % Change them to control the appearance of the index.
1286 % Same as \bigskipamount except no shrink.
1287 % \balancecolumns gets confused if there is any shrink.
1288 \newskip\initialskipamount \initialskipamount 12pt plus4pt
1290 \outer\def\initial #1{%
1291 {\let\tentt=
\sectt \let\tt=
\sectt \let\sf=
\sectt
1292 \ifdim\lastskip<
\initialskipamount
1293 \removelastskip \penalty-
200 \vskip \initialskipamount\fi
1294 \line{\secbf#1\hfill}\kern 2pt
\penalty10000}}
1296 \outer\def\entry #1#2{
1297 {\parfillskip=
0in
\parskip=
0in
\parindent=
0in
1298 \hangindent=
1in
\hangafter=
1%
1299 \noindent\hbox{#1}\indexdotfill #2\par
1302 % Like \dotfill except takes at least 1 em.
1303 \def\indexdotfill{\cleaders
1304 \hbox{$
\mathsurround=
0pt
\mkern1.5mu .
\mkern1.5mu$
}\hskip 1em plus
1fill
}
1306 \def\primary #1{\line{#1\hfil}}
1308 \newskip\secondaryindent \secondaryindent=
0.5cm
1310 \def\secondary #1#2{
1311 {\parfillskip=
0in
\parskip=
0in
1312 \hangindent =
1in
\hangafter=
1
1313 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par
1316 %% Define two-column mode, which is used in indexes.
1317 %% Adapted from the TeXBook, page 416
1322 \newdimen\doublecolumnhsize \doublecolumnhsize =
3.11in
1323 \newdimen\doublecolumnvsize \doublecolumnvsize =
19.1in
1324 \newdimen\availdimen@
1326 \def\begindoublecolumns{\begingroup
1327 \output=
{\global\setbox\partialpage=
1328 \vbox{\unvbox255\kern -
\topskip \kern \baselineskip}}\eject
1329 \output=
{\doublecolumnout}%
1330 \hsize=
\doublecolumnhsize \vsize=
\doublecolumnvsize}
1331 \def\enddoublecolumns{\output=
{\balancecolumns}\eject
1332 \endgroup \pagegoal=
\vsize}
1334 \def\doublecolumnout{\splittopskip=
\topskip \splitmaxdepth=
\maxdepth
1335 \dimen@=
\pageheight \advance\dimen@ by-
\ht\partialpage
1336 \setbox0=
\vsplit255 to
\dimen@
\setbox2=
\vsplit255 to
\dimen@
1337 \onepageout\pagesofar \unvbox255 \penalty\outputpenalty}
1338 \def\pagesofar{\unvbox\partialpage %
1339 \hsize=
\doublecolumnhsize % have to restore this since output routine
1340 % changes it to set cropmarks (P. A. MacKay, 12 Nov. 1986)
1341 \wd0=
\hsize \wd2=
\hsize \hbox to
\pagewidth{\box0\hfil\box2}}
1342 \def\balancecolumns{%
1344 \setbox255=
\vbox{\unvbox255}
1346 \advance\dimen@ by
\topskip \advance\dimen@ by-
\baselineskip
1348 \availdimen@=
\pageheight \advance\availdimen@ by-
\ht\partialpage
1349 % If the remaining data is too big for one page,
1350 % output one page normally, then work with what remains.
1351 \ifdim \dimen@>
\availdimen@
1353 \splittopskip=
\topskip \splitmaxdepth=
\maxdepth
1354 \dimen@=
\pageheight \advance\dimen@ by-
\ht\partialpage
1355 \setbox0=
\vsplit255 to
\dimen@
\setbox2=
\vsplit255 to
\dimen@
1356 \onepageout\pagesofar
1358 % Recompute size of what remains, in case we just output some of it.
1360 \advance\dimen@ by
\topskip \advance\dimen@ by-
\baselineskip
1363 \setbox0=
\vbox{\unvbox255}
1364 \splittopskip=
\topskip
1365 {\vbadness=
10000 \loop \global\setbox3=
\copy0
1366 \global\setbox1=
\vsplit3 to
\dimen@
1367 \ifdim\ht3>
\dimen@
\global\advance\dimen@ by1pt
\repeat}
1368 \setbox0=
\vbox to
\dimen@
{\unvbox1} \setbox2=
\vbox to
\dimen@
{\unvbox3}
1372 \message{sectioning,
}
1373 % Define chapters, sections, etc.
1378 \newcount \subsubsecno
1380 % This counter is funny since it counts through charcodes of letters A, B, ...
1381 \newcount \appendixno \appendixno = `\@
1382 \def\appendixletter{\char\the\appendixno}
1384 \newwrite \contentsfile
1385 % This is called from \setfilename.
1386 \def\opencontents{\openout \contentsfile =
\jobname.toc
}
1388 % Each @chapter defines this as the name of the chapter.
1389 % page headings and footings can use it. @section does likewise
1391 \def\thischapter{} \def\thissection{}
1392 \def\seccheck#1{\if \pageno<
0 %
1393 \errmessage{@
#1 not allowed after generating table of contents
}\fi
1397 \def\chapternofonts{%
1398 \let\rawbackslash=
\relax%
1399 \let\frenchspacing=
\relax%
1400 \def\TeX{\realbackslash TeX
}
1401 \def\dots{\realbackslash dots
}
1402 \def\copyright{\realbackslash copyright
}
1403 \def\tt{\realbackslash tt
}
1404 \def\bf{\realbackslash bf
}
1405 \def\w{\realbackslash w
}
1406 \def\less{\realbackslash less
}
1407 \def\gtr{\realbackslash gtr
}
1408 \def\hat{\realbackslash hat
}
1409 \def\char{\realbackslash char
}
1410 \def\tclose#
#1{\realbackslash tclose
{#
#1}}
1411 \def\code#
#1{\realbackslash code
{#
#1}}
1412 \def\samp#
#1{\realbackslash samp
{#
#1}}
1413 \def\r#
#1{\realbackslash r
{#
#1}}
1414 \def\b#
#1{\realbackslash b
{#
#1}}
1415 \def\key#
#1{\realbackslash key
{#
#1}}
1416 \def\file#
#1{\realbackslash file
{#
#1}}
1417 \def\kbd#
#1{\realbackslash kbd
{#
#1}}
1418 % These are redefined because @smartitalic wouldn't work inside xdef.
1419 \def\i#
#1{\realbackslash i
{#
#1}}
1420 \def\cite#
#1{\realbackslash cite
{#
#1}}
1421 \def\var#
#1{\realbackslash var
{#
#1}}
1422 \def\emph#
#1{\realbackslash emph
{#
#1}}
1423 \def\dfn#
#1{\realbackslash dfn
{#
#1}}
1426 \outer\def\chapter{\parsearg\chapterzzz}
1427 \def\chapterzzz #1{\seccheck{chapter
}%
1428 \secno=
0 \subsecno=
0 \subsubsecno=
0
1429 \global\advance \chapno by
1 \message{Chapter
\the\chapno}%
1430 \chapmacro {#1}{\the\chapno}%
1431 \gdef\thissection{#1}%
1432 \gdef\thischaptername{#1}%
1433 % We don't substitute the actual chapter name into \thischapter
1434 % because we don't want its macros evaluated now.
1435 \xdef\thischapter{Chapter
\the\chapno:
\noexpand\thischaptername}%
1437 \edef\temp{{\realbackslash chapentry
{#1}{\the\chapno}{\noexpand\folio}}}%
1439 \write \contentsfile \temp %
1441 \global\let\section =
\numberedsection
1444 \outer\def\appendix{\parsearg\appendixzzz}
1445 \def\appendixzzz #1{\seccheck{appendix
}%
1446 \secno=
0 \subsecno=
0 \subsubsecno=
0
1447 \global\advance \appendixno by
1 \message{Appendix
\appendixletter}%
1448 \chapmacro {#1}{Appendix
\appendixletter}%
1449 \gdef\thissection{#1}%
1450 \gdef\thischaptername{#1}%
1451 \xdef\thischapter{Appendix
\appendixletter:
\noexpand\thischaptername}%
1453 \edef\temp{{\realbackslash chapentry
1454 {#1}{Appendix
\appendixletter}{\noexpand\folio}}}%
1456 \write \contentsfile \temp %
1458 \global\let\section =
\appendixsec
1461 \outer\def\top{\parsearg\unnumberedzzz}
1462 \outer\def\unnumbered{\parsearg\unnumberedzzz}
1463 \def\unnumberedzzz #1{\seccheck{unnumbered
}%
1464 \secno=
0 \subsecno=
0 \subsubsecno=
0 \message{(
#1)
}
1465 \unnumbchapmacro {#1}%
1466 \gdef\thischapter{#1}\gdef\thissection{#1}%
1468 \edef\temp{{\realbackslash unnumbchapentry
{#1}{\noexpand\folio}}}%
1470 \write \contentsfile \temp %
1472 \global\let\section =
\unnumberedsec
1475 \outer\def\numberedsection{\parsearg\sectionzzz}
1476 \def\sectionzzz #1{\seccheck{section
}%
1477 \subsecno=
0 \subsubsecno=
0 \global\advance \secno by
1 %
1478 \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
1480 \edef\temp{{\realbackslash secentry
%
1481 {#1}{\the\chapno}{\the\secno}{\noexpand\folio}}}%
1483 \write \contentsfile \temp %
1486 \global\let\subsection =
\numberedsubsection
1489 \outer\def\appendixsection{\parsearg\appendixsectionzzz}
1490 \outer\def\appendixsec{\parsearg\appendixsectionzzz}
1491 \def\appendixsectionzzz #1{\seccheck{appendixsection
}%
1492 \subsecno=
0 \subsubsecno=
0 \global\advance \secno by
1 %
1493 \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
1495 \edef\temp{{\realbackslash secentry
%
1496 {#1}{\appendixletter}{\the\secno}{\noexpand\folio}}}%
1498 \write \contentsfile \temp %
1501 \global\let\subsection =
\appendixsubsec
1504 \outer\def\unnumberedsec{\parsearg\unnumberedseczzz}
1505 \def\unnumberedseczzz #1{\seccheck{unnumberedsec
}%
1506 \plainsecheading {#1}\gdef\thissection{#1}%
1508 \edef\temp{{\realbackslash unnumbsecentry
{#1}{\noexpand\folio}}}%
1510 \write \contentsfile \temp %
1513 \global\let\subsection =
\unnumberedsubsec
1516 \outer\def\numberedsubsection{\parsearg\subsectionzzz}
1517 \def\subsectionzzz #1{\seccheck{subsection
}%
1518 \gdef\thissection{#1}\subsubsecno=
0 \global\advance \subsecno by
1 %
1519 \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
1521 \edef\temp{{\realbackslash subsecentry
%
1522 {#1}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
1524 \write \contentsfile \temp %
1527 \global\let\subsubsection =
\numberedsubsubsection
1530 \outer\def\appendixsubsec{\parsearg\appendixsubseczzz}
1531 \def\appendixsubseczzz #1{\seccheck{appendixsubsec
}%
1532 \gdef\thissection{#1}\subsubsecno=
0 \global\advance \subsecno by
1 %
1533 \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
1535 \edef\temp{{\realbackslash subsecentry
%
1536 {#1}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
1538 \write \contentsfile \temp %
1541 \global\let\subsubsection =
\appendixsubsubsec
1544 \outer\def\unnumberedsubsec{\parsearg\unnumberedsubseczzz}
1545 \def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec
}%
1546 \plainsecheading {#1}\gdef\thissection{#1}%
1548 \edef\temp{{\realbackslash unnumbsubsecentry
{#1}{\noexpand\folio}}}%
1550 \write \contentsfile \temp %
1553 \global\let\subsubsection =
\unnumberedsubsubsec
1556 \outer\def\numberedsubsubsection{\parsearg\subsubsectionzzz}
1557 \def\subsubsectionzzz #1{\seccheck{subsubsection
}%
1558 \gdef\thissection{#1}\global\advance \subsubsecno by
1 %
1559 \subsubsecheading {#1}
1560 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
1562 \edef\temp{{\realbackslash subsubsecentry
%
1564 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}
1565 {\noexpand\folio}}}%
1567 \write \contentsfile \temp %
1572 \outer\def\appendixsubsubsec{\parsearg\appendixsubsubseczzz}
1573 \def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec
}%
1574 \gdef\thissection{#1}\global\advance \subsubsecno by
1 %
1575 \subsubsecheading {#1}
1576 {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
1578 \edef\temp{{\realbackslash subsubsecentry
{#1}%
1580 {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}%
1582 \write \contentsfile \temp %
1587 \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
1588 \def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec
}%
1589 \plainsecheading {#1}\gdef\thissection{#1}%
1591 \edef\temp{{\realbackslash unnumbsubsubsecentry
{#1}{\noexpand\folio}}}%
1593 \write \contentsfile \temp %
1598 % These are variants which are not "outer", so they can appear in @ifinfo.
1599 \def\infotop{\parsearg\unnumberedzzz}
1600 \def\infounnumbered{\parsearg\unnumberedzzz}
1601 \def\infounnumberedsec{\parsearg\unnumberedseczzz}
1602 \def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz}
1603 \def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
1605 \def\infoappendix{\parsearg\appendixzzz}
1606 \def\infoappendixsec{\parsearg\appendixseczzz}
1607 \def\infoappendixsubsec{\parsearg\appendixsubseczzz}
1608 \def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz}
1610 \def\infochapter{\parsearg\chapterzzz}
1611 \def\infosection{\parsearg\sectionzzz}
1612 \def\infosubsection{\parsearg\subsectionzzz}
1613 \def\infosubsubsection{\parsearg\subsubsectionzzz}
1615 % Define @majorheading, @heading and @subheading
1617 \def\majorheading{\parsearg\majorheadingzzz}
1618 \def\majorheadingzzz #1{%
1619 {\advance\chapheadingskip by
10pt
\chapbreak }%
1620 {\chapfonts \line{\rm #1\hfill}}\bigskip \par\penalty 200}
1622 \def\chapheading{\parsearg\chapheadingzzz}
1623 \def\chapheadingzzz #1{\chapbreak %
1624 {\chapfonts \line{\rm #1\hfill}}\bigskip \par\penalty 200}
1626 \def\heading{\parsearg\secheadingi}
1628 \def\subheading{\parsearg\subsecheadingi}
1630 \def\subsubheading{\parsearg\subsubsecheadingi}
1632 % These macros generate a chapter, section, etc. heading only
1633 % (including whitespace, linebreaking, etc. around it),
1634 % given all the information in convenient, parsed form.
1636 %%% Args are the skip and penalty (usually negative)
1637 \def\dobreak#1#2{\par\ifdim\lastskip<
#1\removelastskip\penalty#2\vskip#1\fi}
1639 \def\setchapterstyle #1 {\csname CHAPF
#1\endcsname}
1641 %%% Define plain chapter starts, and page on/off switching for it
1642 % Parameter controlling skip before chapter headings (if needed)
1644 \newskip \chapheadingskip \chapheadingskip =
30pt plus
8pt minus
4pt
1646 \def\chapbreak{\dobreak \chapheadingskip {-
4000}}
1647 \def\chappager{\par\vfill\supereject}
1648 \def\chapoddpage{\chappager \ifodd\pageno \else \hbox to
0pt
{} \chappager\fi}
1650 \def\setchapternewpage #1 {\csname CHAPPAG
#1\endcsname}
1653 \global\let\pchapsepmacro=
\chapbreak
1654 \global\let\pagealignmacro=
\chappager}
1657 \global\let\pchapsepmacro=
\chappager
1658 \global\let\pagealignmacro=
\chappager
1659 \global\def\HEADINGSon{\HEADINGSsingle}}
1662 \global\let\pchapsepmacro=
\chapoddpage
1663 \global\let\pagealignmacro=
\chapoddpage
1664 \global\def\HEADINGSon{\HEADINGSdouble}}
1669 \global\let\chapmacro=
\chfplain
1670 \global\let\unnumbchapmacro=
\unnchfplain}
1672 \def\chfplain #1#2{%
1676 \leftline{\rm #2\enspace #1}%
1682 \def\unnchfplain #1{%
1684 {\chapfonts \line{\rm #1\hfill}}\bigskip \par\penalty 10000 %
1686 \CHAPFplain % The default
1688 \def\unnchfopen #1{%
1689 \chapoddpage {\chapfonts \line{\rm #1\hfill}}\bigskip \par\penalty 10000 %
1692 \def\chfopen #1#2{\chapoddpage {\chapfonts
1693 \vbox to
3in
{\vfil \hbox to
\hsize{\hfil #2} \hbox to
\hsize{\hfil #1} \vfil}}%
1698 \global\let\chapmacro=
\chfopen
1699 \global\let\unnumbchapmacro=
\unnchfopen}
1701 % Parameter controlling skip before section headings.
1703 \newskip \subsecheadingskip \subsecheadingskip =
17pt plus
8pt minus
4pt
1704 \def\subsecheadingbreak{\dobreak \subsecheadingskip {-
500}}
1706 \newskip \secheadingskip \secheadingskip =
21pt plus
8pt minus
4pt
1707 \def\secheadingbreak{\dobreak \secheadingskip {-
1000}}
1710 % Section fonts are the base font at magstep2, which produces
1711 % a size a bit more than 14 points in the default situation.
1713 \def\secheading #1#2#3{\secheadingi {#2.
#3\enspace #1}}
1714 \def\plainsecheading #1{\secheadingi {#1}}
1715 \def\secheadingi #1{{\advance \secheadingskip by
\parskip %
1717 {\secfonts \line{\rm #1\hfill}}%
1718 \ifdim \parskip<
10pt
\kern 10pt
\kern -
\parskip\fi \penalty 10000 }
1721 % Subsection fonts are the base font at magstep1,
1722 % which produces a size of 12 points.
1724 \def\subsecheading #1#2#3#4{\subsecheadingi {#2.
#3.
#4\enspace #1}}
1725 \def\subsecheadingi #1{{\advance \subsecheadingskip by
\parskip %
1726 \subsecheadingbreak}%
1727 {\subsecfonts \line{\rm #1\hfill}}%
1728 \ifdim \parskip<
10pt
\kern 10pt
\kern -
\parskip\fi \penalty 10000 }
1730 \def\subsubsecfonts{\subsecfonts} % Maybe this should change:
1731 % Perhaps make sssec fonts scaled
1733 \def\subsubsecheading #1#2#3#4#5{\subsubsecheadingi {#2.
#3.
#4.
#5\enspace #1}}
1734 \def\subsubsecheadingi #1{{\advance \subsecheadingskip by
\parskip %
1735 \subsecheadingbreak}%
1736 {\subsubsecfonts \line{\rm #1\hfill}}%
1737 \ifdim \parskip<
10pt
\kern 10pt
\kern -
\parskip\fi \penalty 10000}
1740 \message{toc printing,
}
1742 % Finish up the main text and prepare to read what we've written
1745 \def\startcontents#1{%
1748 \immediate\closeout \contentsfile
1749 \pageno = -
1 % Request roman numbered pages.
1751 % Don't need to put `Contents' or `Short Contents' in the headline.
1752 % It is abundantly clear what they are.
1753 \unnumbchapmacro{#1}\def\thischapter{}%
1754 \begingroup % Set up to handle contents files properly.
1755 \catcode`\\=
0 \catcode`\
{=
1 \catcode`\
}=
2 \catcode`\@=
11
1756 \raggedbottom % Worry more about breakpoints than the bottom.
1757 \advance\hsize by -
1in
% Don't use the full line length.
1761 % Normal (long) toc.
1762 \outer\def\contents{%
1763 \startcontents{Table of Contents
}%
1769 % And just the chapters.
1770 \outer\def\summarycontents{%
1771 \startcontents{Short Contents
}%
1773 \let\chapentry =
\shortchapentry
1774 \let\unnumbchapentry =
\shortunnumberedentry
1775 % We want a true roman here for the page numbers.
1777 \let\rm=
\shortcontrm \let\bf=
\shortcontbf \let\sl=
\shortcontsl
1779 \advance\baselineskip by
1pt
% Open it up a little.
1780 \def\secentry #
#1#
#2#
#3#
#4{}
1781 \def\unnumbsecentry #
#1#
#2{}
1782 \def\subsecentry #
#1#
#2#
#3#
#4#
#5{}
1783 \def\unnumbsubsecentry #
#1#
#2{}
1784 \def\subsubsecentry #
#1#
#2#
#3#
#4#
#5#
#6{}
1785 \def\unnumbsubsubsecentry #
#1#
#2{}
1790 \let\shortcontents =
\summarycontents
1792 % These macros generate individual entries in the table of contents.
1793 % The first argument is the chapter or section name.
1794 % The last argument is the page number.
1795 % The arguments in between are the chapter number, section number, ...
1797 % Chapter-level things, for both the long and short contents.
1798 \def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}
1799 \def\shortchapentry#1#2#3{%
1800 \line{{#2\labelspace #1}\dotfill\doshortpageno{#3}}%
1803 \def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
1804 \def\shortunnumberedentry#1#2{%
1805 \line{#1\dotfill\doshortpageno{#2}}%
1809 \def\secentry#1#2#3#4{\dosecentry{#2.
#3\labelspace#1}{#4}}
1810 \def\unnumbsecentry#1#2{\dosecentry{#1}{#2}}
1813 \def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.
#3.
#4\labelspace#1}{#5}}
1814 \def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}}
1816 % And subsubsections.
1817 \def\subsubsecentry#1#2#3#4#5#6{%
1818 \dosubsubsecentry{#2.
#3.
#4.
#5\labelspace#1}{#6}}
1819 \def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}}
1822 % This parameter controls the indentation of the various levels.
1823 \newdimen\tocindent \tocindent =
3pc
1825 % Now for the actual typesetting. In all these, #1 is the text and #2 is the
1828 % If the toc has to be broken over pages, we would want to be at chapters
1829 % if at all possible; hence the \penalty.
1830 \def\dochapentry#1#2{%
1831 \penalty-
300 \vskip\baselineskip
1832 \line{\chapentryfonts #1\dotfill \dopageno{#2}}%
1833 \nobreak\vskip .25\baselineskip
1836 \def\dosecentry#1#2{%
1837 \line{\secentryfonts \hskip\tocindent #1\dotfill \dopageno{#2}}%
1840 \def\dosubsecentry#1#2{%
1841 \line{\subsecentryfonts \hskip2\tocindent #1\dotfill \dopageno{#2}}%
1844 \def\dosubsubsecentry#1#2{%
1845 \line{\subsubsecentryfonts \hskip3\tocindent #1\dotfill \dopageno{#2}}%
1848 % Space between chapter (or whatever) number and the title.
1849 \def\labelspace{\hskip1em \relax}
1851 \def\dopageno#1{{\rm #1}}
1852 \def\doshortpageno#1{{\rm #1}}
1854 \def\chapentryfonts{\secfonts \rm}
1855 \def\secentryfonts{\textfonts}
1856 \let\subsecentryfonts =
\textfonts
1857 \let\subsubsecentryfonts =
\textfonts
1860 \message{environments,
}
1862 % Since these characters are used in examples, it should be an even number of
1863 % \tt widths. Each \tt character is 1en, so two makes it 1em.
1864 % Furthermore, these definitions must come after we define our fonts.
1865 \newbox\dblarrowbox \newbox\longdblarrowbox
1866 \newbox\pushcharbox \newbox\bullbox
1867 \newbox\equivbox \newbox\errorbox
1869 \let\ptexequiv =
\equiv
1872 \global\setbox\dblarrowbox =
\hbox to
1em
{\hfil$
\Rightarrow$
\hfil}
1873 \global\setbox\longdblarrowbox =
\hbox to
1em
{\hfil$
\mapsto$
\hfil}
1874 \global\setbox\pushcharbox =
\hbox to
1em
{\hfil$
\dashv$
\hfil}
1875 \global\setbox\equivbox =
\hbox to
1em
{\hfil$
\ptexequiv$
\hfil}
1876 % Adapted from the manmac format (p.420 of TeXbook)
1877 \global\setbox\bullbox =
\hbox to
1em
{\kern.15em
\vrule height
.75ex width
.85ex
1883 \def\result{\leavevmode\raise.15ex
\copy\dblarrowbox}
1884 \def\expansion{\leavevmode\raise.1ex
\copy\longdblarrowbox}
1885 \def\print{\leavevmode\lower.1ex
\copy\pushcharbox}
1887 \def\equiv{\leavevmode\lower.1ex
\copy\equivbox}
1889 % Does anyone really want this?
1890 % \def\bull{\leavevmode\copy\bullbox}
1892 % Adapted from the TeXbook's \boxit.
1893 {\tentt \global\dimen0 =
3em
}% Width of the box.
1894 \dimen2 =
.55pt
% Thickness of rules
1895 % The text. (`r' is open on the right, `e' somewhat less so on the left.)
1896 \setbox0 =
\hbox{\kern-
.75pt
\tensf error
\kern-
1.5pt
}
1898 \global\setbox\errorbox=
\hbox to
\dimen0{\hfil
1899 \hsize =
\dimen0 \advance\hsize by -
5.8pt
% Space to left+right.
1900 \advance\hsize by -
2\dimen2 % Rules.
1902 \hrule height
\dimen2
1903 \hbox{\vrule width
\dimen2 \kern3pt % Space to left of text.
1904 \vtop{\kern2.4pt
\box0 \kern2.4pt
}% Space above/below.
1905 \kern3pt\vrule width
\dimen2}% Space to right.
1906 \hrule height
\dimen2}
1909 % The @error{} command.
1910 \def\error{\leavevmode\lower.7ex
\copy\errorbox}
1912 % @tex ... @end tex escapes into raw Tex temporarily.
1913 % One exception: @ is still an escape character, so that @end tex works.
1914 % But \@ or @@ will get a plain tex @ character.
1916 \def\tex{\begingroup
1917 \catcode `\\=
0 \catcode `\
{=
1 \catcode `\
}=
2
1918 \catcode `\$=
3 \catcode `\&=
4 \catcode `\#=
6
1919 \catcode `\^=
7 \catcode `
\_=
8 \catcode `\~=
13 \let~=
\tie
1935 \let\bullet=
\ptexbullet
1936 \let\b=
\ptexb \let\c=
\ptexc \let\i=
\ptexi \let\t=
\ptext \let\l=
\ptexl
1939 \let\Etex=
\endgroup}
1941 % Define @lisp ... @endlisp.
1942 % @lisp does a \begingroup so it can rebind things,
1943 % including the definition of @endlisp (which normally is erroneous).
1945 % Amount to narrow the margins by for @lisp.
1946 \newskip\lispnarrowing \lispnarrowing=
0.4in
1948 % This is the definition that ^M gets inside @lisp
1949 % phr: changed space to \null, to avoid overfull hbox problems.
1951 \gdef\lisppar{\null\endgraf}}
1953 % Cause \obeyspaces to make each Space cause a word-separation
1954 % rather than the default which is that it acts punctuation.
1955 % This is because space in tt font looks funny.
1957 \gdef\sepspaces{\def {\
}}}
1959 \newskip\aboveenvskipamount \aboveenvskipamount=
0pt
1960 \def\aboveenvbreak{{\advance\aboveenvskipamount by
\parskip
1961 \endgraf \ifdim\lastskip<
\aboveenvskipamount
1962 \removelastskip \penalty-
50 \vskip\aboveenvskipamount \fi}}
1964 \def\afterenvbreak{\endgraf \ifdim\lastskip<
\aboveenvskipamount
1965 \removelastskip \penalty-
50 \vskip\aboveenvskipamount \fi}
1967 \def\lisp{\aboveenvbreak
1968 \begingroup\inENV % This group ends at the end of the @lisp body
1969 \hfuzz=
12truept
% Don't be fussy
1970 % Make spaces be word-separators rather than space tokens.
1972 % Single space lines
1974 % The following causes blank lines not to be ignored
1975 % by adding a space to the end of each line.
1977 \def\Elisp{\endgroup\afterenvbreak}%
1979 \advance \leftskip by
\lispnarrowing
1981 \let\exdent=
\internalexdent
1982 \obeyspaces \obeylines \tt \rawbackslash
1983 \def\next#
#1{}\next}
1987 \def\Eexample{\Elisp}
1989 \let\smallexample=
\lisp
1990 \def\Esmallexample{\Elisp}
1992 % Macro for 9 pt. examples, necessary to print with 5" lines.
1993 % From Pavel@xerox. This is not really used unless the
1994 % @smallbook command is given.
1996 \def\smalllispx{\aboveenvbreak\begingroup\inENV
1997 % This group ends at the end of the @lisp body
1998 \hfuzz=
12truept
% Don't be fussy
1999 % Make spaces be word-separators rather than space tokens.
2001 % Single space lines
2003 % The following causes blank lines not to be ignored
2004 % by adding a space to the end of each line.
2006 \def\Esmalllisp{\endgroup\afterenvbreak}%
2008 \advance \leftskip by
\lispnarrowing
2010 \let\exdent=
\internalexdent
2011 \obeyspaces \obeylines \ninett \indexfonts \rawbackslash
2012 \def\next#
#1{}\next}
2014 % This is @display; same as @lisp except use roman font.
2016 \def\display{\begingroup\inENV %This group ends at the end of the @display body
2018 % Make spaces be word-separators rather than space tokens.
2020 % Single space lines
2022 % The following causes blank lines not to be ignored
2023 % by adding a space to the end of each line.
2025 \def\Edisplay{\endgroup\afterenvbreak}%
2027 \advance \leftskip by
\lispnarrowing
2029 \let\exdent=
\internalexdent
2030 \obeyspaces \obeylines
2031 \def\next#
#1{}\next}
2033 % This is @format; same as @lisp except use roman font and don't narrow margins
2035 \def\format{\begingroup\inENV %This group ends at the end of the @format body
2037 % Make spaces be word-separators rather than space tokens.
2040 % The following causes blank lines not to be ignored
2041 % by adding a space to the end of each line.
2043 \def\Eformat{\endgroup\afterenvbreak}
2044 \parskip=
0pt
\parindent=
0pt
2045 \obeyspaces \obeylines
2046 \def\next#
#1{}\next}
2048 % @flushleft and @flushright
2051 \begingroup\inENV %This group ends at the end of the @format body
2053 % Make spaces be word-separators rather than space tokens.
2055 % The following causes blank lines not to be ignored
2056 % by adding a space to the end of each line.
2057 % This also causes @ to work when the directive name
2058 % is terminated by end of line.
2060 \def\Eflushleft{\endgroup\afterenvbreak}%
2061 \parskip=
0pt
\parindent=
0pt
2062 \obeyspaces \obeylines
2063 \def\next#
#1{}\next}
2066 \begingroup\inENV %This group ends at the end of the @format body
2068 % Make spaces be word-separators rather than space tokens.
2070 % The following causes blank lines not to be ignored
2071 % by adding a space to the end of each line.
2072 % This also causes @ to work when the directive name
2073 % is terminated by end of line.
2075 \def\Eflushright{\endgroup\afterenvbreak}%
2076 \parskip=
0pt
\parindent=
0pt
2077 \advance \leftskip by
0pt plus
1fill
2078 \obeyspaces \obeylines
2079 \def\next#
#1{}\next}
2081 % @quotation - narrow the margins.
2084 \begingroup\inENV %This group ends at the end of the @quotation body
2085 {\parskip=
0pt
% because we will skip by \parskip too, later
2089 \def\Equotation{\par\endgroup\afterenvbreak}%
2090 \advance \rightskip by
\lispnarrowing
2091 \advance \leftskip by
\lispnarrowing}
2094 % Define formatter for defuns
2095 % First, allow user to change definition object font (\df) internally
2096 \def\setdeffont #1 {\csname DEF
#1\endcsname}
2098 \newskip\defbodyindent \defbodyindent=
.4in
2099 \newskip\defargsindent \defargsindent=
50pt
2100 \newskip\deftypemargin \deftypemargin=
12pt
2101 \newskip\deflastargmargin \deflastargmargin=
18pt
2103 \newcount\parencount
2104 % define \functionparens, which makes ( and ) and & do special things.
2105 % \functionparens affects the group it is contained in.
2107 \catcode`\(=
\active \catcode`\)=
\active \catcode`\&=
\active
2108 \catcode`\
[=
\active \catcode`\
]=
\active}
2109 {\activeparens % Now, smart parens don't turn on until &foo (see \amprm)
2110 \gdef\functionparens{\boldbrax\let&=
\amprm\parencount=
0 }
2111 \gdef\boldbrax{\let(=
\opnr\let)=
\clnr\let[=
\lbrb\let]=
\rbrb}
2113 % Definitions of (, ) and & used in args for functions.
2114 % This is the definition of ( outside of all parentheses.
2115 \gdef\oprm#1 {{\rm\char`\(
}#1 \bf \let(=
\opnested %
2116 \global\advance\parencount by
1 }
2118 % This is the definition of ( when already inside a level of parens.
2119 \gdef\opnested{\char`\(
\global\advance\parencount by
1 }
2121 \gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
2122 % also in that case restore the outer-level definition of (.
2123 \ifnum \parencount=
1 {\rm \char `\)
}\sl \let(=
\oprm \else \char `\)
\fi
2124 \global\advance \parencount by -
1 }
2125 % If we encounter &foo, then turn on ()-hacking afterwards
2126 \gdef\amprm#1 {{\rm\&
#1}\let(=
\oprm \let)=
\clrm\
}
2128 \gdef\normalparens{\boldbrax\let&=
\ampnr}
2129 } % End of definition inside \activeparens
2130 %% These parens (in \boldbrax) actually are a little bolder than the
2131 %% contained text. This is especially needed for [ and ]
2132 \def\opnr{{\sf\char`\(
}} \def\clnr{{\sf\char`\)
}} \def\ampnr{\&
}
2133 \def\lbrb{{\bf\char`\
[}} \def\rbrb{{\bf\char`\
]}}
2135 % First, defname, which formats the header line itself.
2136 % #1 should be the function name.
2137 % #2 should be the type of definition, such as "Function".
2140 % Get the values of \leftskip and \rightskip as they were
2141 % outside the @def...
2143 \advance\dimen2 by -
\defbodyindent
2145 \advance\dimen3 by -
\defbodyindent
2147 \setbox0=
\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
2148 \dimen0=
\hsize \advance \dimen0 by -
\wd0 % compute size for first line
2149 \dimen1=
\hsize \advance \dimen1 by -
\defargsindent %size for continuations
2150 \parshape 2 0in
\dimen0 \defargsindent \dimen1 %
2151 % Now output arg 2 ("Function" or some such)
2152 % ending at \deftypemargin from the right margin,
2153 % but stuck inside a box of width 0 so it does not interfere with linebreaking
2154 {% Adjust \hsize to exclude the ambient margins,
2155 % so that \rightline will obey them.
2156 \advance \hsize by -
\dimen2 \advance \hsize by -
\dimen3
2157 \rlap{\rightline{{\rm #2}\hskip \deftypemargin}}}%
2158 % Make all lines underfull and no complaints:
2159 \tolerance=
10000 \hbadness=
10000
2160 {\df #1}\enskip % Generate function name
2163 % Actually process the body of a definition
2164 % #1 should be the terminating control sequence, such as \Edefun.
2165 % #2 should be the "another name" control sequence, such as \defunx.
2166 % #3 should be the control sequence that actually processes the header,
2167 % such as \defunheader.
2169 \def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
2171 % Define the end token that this defining construct specifies
2172 % so that it will exit this group.
2173 \def#1{\endgraf\endgroup\medbreak}%
2174 \def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
2176 \advance\leftskip by
\defbodyindent \advance \rightskip by
\defbodyindent
2178 \catcode 61=
\active %
2179 \obeylines\activeparens\spacesplit#3}
2181 \def\defmethparsebody #1#2#3#4 {\begingroup\inENV %
2183 % Define the end token that this defining construct specifies
2184 % so that it will exit this group.
2185 \def#1{\endgraf\endgroup\medbreak}%
2186 \def#2#
#1 {\begingroup\obeylines\activeparens\spacesplit{#3{#
#1}}}%
2188 \advance\leftskip by
\defbodyindent \advance \rightskip by
\defbodyindent
2189 \begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
2191 \def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
2193 % Define the end token that this defining construct specifies
2194 % so that it will exit this group.
2195 \def#1{\endgraf\endgroup\medbreak}%
2196 \def#2#
#1 #
#2 {\def#4{#
#1}%
2197 \begingroup\obeylines\activeparens\spacesplit{#3{#
#2}}}%
2199 \advance\leftskip by
\defbodyindent \advance \rightskip by
\defbodyindent
2200 \begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
2202 % Split up #2 at the first space token.
2203 % call #1 with two arguments:
2204 % the first is all of #2 before the space token,
2205 % the second is all of #2 after that space token.
2206 % If #2 contains no space token, all of it is passed as the first arg
2207 % and the second is passed as empty.
2210 \gdef\spacesplit#1#2^^M
{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}%
2211 \long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{%
2213 #1{#2}{}\else #1{#2}{#3#4}\fi}}
2215 % So much for the things common to all kinds of definitions.
2219 % First, define the processing that is wanted for arguments of \defun
2220 % Use this to expand the args and terminate the paragraph they make up
2222 \def\defunargs #1{\functionparens \sl
2223 % Expand, preventing hyphenation at `-' chars.
2224 % Note that groups don't affect changes in \hyphenchar.
2227 \hyphenchar\tensl=
45
2228 \ifnum\parencount=
0 \else \errmessage{unbalanced parens in @def arguments
}\fi%
2229 \interlinepenalty=
10000
2230 \advance\rightskip by
0pt plus
1fil
2231 \endgraf\penalty 10000\vskip -
\parskip\penalty 10000%
2234 \def\deftypefunargs #1{%
2235 % Expand, preventing hyphenation at `-' chars.
2236 % Note that groups don't affect changes in \hyphenchar.
2239 \interlinepenalty=
10000
2240 \advance\rightskip by
0pt plus
1fil
2241 \endgraf\penalty 10000\vskip -
\parskip\penalty 10000%
2244 % Do complete processing of one @defun or @defunx line already parsed.
2246 % @deffn Command forward-char nchars
2248 \def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader}
2250 \def\deffnheader #1#2#3{\doind {fn
}{\code{#2}}%
2251 \begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
2252 \catcode 61=
\other % Turn off change made in \defparsebody
2255 % @defun == @deffn Function
2257 \def\defun{\defparsebody\Edefun\defunx\defunheader}
2259 \def\defunheader #1#2{\doind {fn
}{\code{#1}}% Make entry in function index
2260 \begingroup\defname {#1}{Function
}%
2261 \defunargs {#2}\endgroup %
2262 \catcode 61=
\other % Turn off change made in \defparsebody
2265 % @deftypefun int foobar (int @var{foo}, float @var{bar})
2267 \def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader}
2269 % #1 is the data type. #2 is the name and args.
2270 \def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax}
2271 % #1 is the data type, #2 the name, #3 the args.
2272 \def\deftypefunheaderx #1#2 #3\relax{%
2273 \doind {fn
}{\code{#2}}% Make entry in function index
2274 \begingroup\defname {\code{#1} #2}{Function
}%
2275 \deftypefunargs {#3}\endgroup %
2276 \catcode 61=
\other % Turn off change made in \defparsebody
2279 % @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
2281 \def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
2283 % #1 is the classification. #2 is the data type. #3 is the name and args.
2284 \def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax}
2285 % #1 is the classification, #2 the data type, #3 the name, #4 the args.
2286 \def\deftypefnheaderx #1#2#3 #4\relax{%
2287 \doind {fn
}{\code{#3}}% Make entry in function index
2288 \begingroup\defname {\code{#2} #3}{#1}%
2289 \deftypefunargs {#4}\endgroup %
2290 \catcode 61=
\other % Turn off change made in \defparsebody
2293 % @defmac == @deffn Macro
2295 \def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
2297 \def\defmacheader #1#2{\doind {fn
}{\code{#1}}% Make entry in function index
2298 \begingroup\defname {#1}{Macro
}%
2299 \defunargs {#2}\endgroup %
2300 \catcode 61=
\other % Turn off change made in \defparsebody
2303 % @defspec == @deffn Special Form
2305 \def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
2307 \def\defspecheader #1#2{\doind {fn
}{\code{#1}}% Make entry in function index
2308 \begingroup\defname {#1}{Special Form
}%
2309 \defunargs {#2}\endgroup %
2310 \catcode 61=
\other % Turn off change made in \defparsebody
2313 % This definition is run if you use @defunx
2314 % anywhere other than immediately after a @defun or @defunx.
2316 \def\deffnx #1 {\errmessage{@deffnx in invalid context
}}
2317 \def\defunx #1 {\errmessage{@defunx in invalid context
}}
2318 \def\defmacx #1 {\errmessage{@defmacx in invalid context
}}
2319 \def\defspecx #1 {\errmessage{@defspecx in invalid context
}}
2320 \def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context
}}
2321 \def\deftypeunx #1 {\errmessage{@deftypeunx in invalid context
}}
2323 % @defmethod, and so on
2325 % @defop {Funny Method} foo-class frobnicate argument
2327 \def\defop #1 {\def\defoptype{#1}%
2328 \defopparsebody\Edefop\defopx\defopheader\defoptype}
2330 \def\defopheader #1#2#3{%
2331 \dosubind {fn
}{\code{#2}}{on
#1}% Make entry in function index
2332 \begingroup\defname {#2}{\defoptype{} on
#1}%
2333 \defunargs {#3}\endgroup %
2336 % @defmethod == @defop Method
2338 \def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
2340 \def\defmethodheader #1#2#3{%
2341 \dosubind {fn
}{\code{#2}}{on
#1}% entry in function index
2342 \begingroup\defname {#2}{Method on
#1}%
2343 \defunargs {#3}\endgroup %
2346 % @deftypemethod class type frobnicate argument
2348 \def\deftypemethod{\defmethparsebody\Edeftypemethod\deftypemethodx%
2349 \deftypemethodheader}
2351 % #1 is the class. #2 is the data type. #3 is the name and args.
2352 \def\deftypemethodheader #1#2#3{\deftypemethodheaderx{#1}{#2}#3 \relax}
2353 % #1 is the class, #2 the data type, #3 then name , #4 the args.
2354 \def\deftypemethodheaderx #1#2#3 #4\relax{\dosubind {fn
}{\code{#3}}{on
#1}%
2355 \begingroup\defname {\code{#2} #3}{Method on
#1}%
2356 \deftypefunargs {#4}\endgroup
2359 % @defcv {Class Option} foo-class foo-flag
2361 \def\defcv #1 {\def\defcvtype{#1}%
2362 \defopparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
2364 \def\defcvarheader #1#2#3{%
2365 \dosubind {vr
}{\code{#2}}{of
#1}% Make entry in var index
2366 \begingroup\defname {#2}{\defcvtype{} of
#1}%
2367 \defvarargs {#3}\endgroup %
2370 % @defivar == @defcv {Instance Variable}
2372 \def\defivar{\defmethparsebody\Edefivar\defivarx\defivarheader}
2374 \def\defivarheader #1#2#3{%
2375 \dosubind {vr
}{\code{#2}}{of
#1}% Make entry in var index
2376 \begingroup\defname {#2}{Instance Variable of
#1}%
2377 \defvarargs {#3}\endgroup %
2380 % These definitions are run if you use @defmethodx, etc.,
2381 % anywhere other than immediately after a @defmethod, etc.
2383 \def\defopx #1 {\errmessage{@defopx in invalid context
}}
2384 \def\defmethodx #1 {\errmessage{@defmethodx in invalid context
}}
2385 \def\defcvx #1 {\errmessage{@defcvx in invalid context
}}
2386 \def\defivarx #1 {\errmessage{@defivarx in invalid context
}}
2390 % First, define the processing that is wanted for arguments of @defvar.
2391 % This is actually simple: just print them in roman.
2392 % This must expand the args and terminate the paragraph they make up
2393 \def\defvarargs #1{\normalparens #1%
2394 \interlinepenalty=
10000
2395 \endgraf\penalty 10000\vskip -
\parskip\penalty 10000}
2397 % @defvr Counter foo-count
2399 \def\defvr{\defmethparsebody\Edefvr\defvrx\defvrheader}
2401 \def\defvrheader #1#2#3{\doind {vr
}{\code{#2}}%
2402 \begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup}
2404 % @defvar == @defvr Variable
2406 \def\defvar{\defparsebody\Edefvar\defvarx\defvarheader}
2408 \def\defvarheader #1#2{\doind {vr
}{\code{#1}}% Make entry in var index
2409 \begingroup\defname {#1}{Variable
}%
2410 \defvarargs {#2}\endgroup %
2413 % @defopt == @defvr {User Option}
2415 \def\defopt{\defparsebody\Edefopt\defoptx\defoptheader}
2417 \def\defoptheader #1#2{\doind {vr
}{\code{#1}}% Make entry in var index
2418 \begingroup\defname {#1}{User Option
}%
2419 \defvarargs {#2}\endgroup %
2422 % @deftypevar int foobar
2424 \def\deftypevar{\defparsebody\Edeftypevar\deftypevarx\deftypevarheader}
2426 % #1 is the data type. #2 is the name.
2427 \def\deftypevarheader #1#2{%
2428 \doind {vr
}{\code{#2}}% Make entry in variables index
2429 \begingroup\defname {\code{#1} #2}{Variable
}%
2430 \interlinepenalty=
10000
2431 \endgraf\penalty 10000\vskip -
\parskip\penalty 10000
2434 % @deftypevr {Global Flag} int enable
2436 \def\deftypevr{\defmethparsebody\Edeftypevr\deftypevrx\deftypevrheader}
2438 \def\deftypevrheader #1#2#3{\doind {vr
}{\code{#3}}%
2439 \begingroup\defname {\code{#2} #3}{#1}
2440 \interlinepenalty=
10000
2441 \endgraf\penalty 10000\vskip -
\parskip\penalty 10000
2444 % This definition is run if you use @defvarx
2445 % anywhere other than immediately after a @defvar or @defvarx.
2447 \def\defvrx #1 {\errmessage{@defvrx in invalid context
}}
2448 \def\defvarx #1 {\errmessage{@defvarx in invalid context
}}
2449 \def\defoptx #1 {\errmessage{@defoptx in invalid context
}}
2450 \def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context
}}
2451 \def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context
}}
2454 % Args are printed in bold, a slight difference from @defvar.
2456 \def\deftpargs #1{\bf \defvarargs{#1}}
2458 % @deftp Class window height width ...
2460 \def\deftp{\defmethparsebody\Edeftp\deftpx\deftpheader}
2462 \def\deftpheader #1#2#3{\doind {tp
}{\code{#2}}%
2463 \begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
2465 % This definition is run if you use @deftpx, etc
2466 % anywhere other than immediately after a @deftp, etc.
2468 \def\deftpx #1 {\errmessage{@deftpx in invalid context
}}
2470 \message{cross reference,
}
2471 % Define cross-reference macros
2474 \newif\ifhavexrefs % True if xref values are known.
2475 \newif\ifwarnedxrefs % True if we warned once that they aren't known.
2477 % \setref{foo} defines a cross-reference point named foo.
2480 %\dosetq{#1-title}{Ytitle}%
2481 \dosetq{#1-pg
}{Ypagenumber
}%
2482 \dosetq{#1-snt
}{Ysectionnumberandtype
}}
2484 \def\unnumbsetref#1{%
2485 %\dosetq{#1-title}{Ytitle}%
2486 \dosetq{#1-pg
}{Ypagenumber
}%
2487 \dosetq{#1-snt
}{Ynothing
}}
2489 \def\appendixsetref#1{%
2490 %\dosetq{#1-title}{Ytitle}%
2491 \dosetq{#1-pg
}{Ypagenumber
}%
2492 \dosetq{#1-snt
}{Yappendixletterandtype
}}
2494 % \xref, \pxref, and \ref generate cross-references to specified points.
2495 % For \xrefX, #1 is the node name, #2 the name of the Info
2496 % cross-reference, #3 the printed node name, #4 the name of the Info
2497 % file, #5 the name of the printed manual. All but the node name can be
2500 \def\pxref#1{see
\xrefX[#1,,,,,,,
]}
2501 \def\xref#1{See
\xrefX[#1,,,,,,,
]}
2502 \def\ref#1{\xrefX[#1,,,,,,,
]}
2503 \def\xrefX[#1,
#2,
#3,
#4,
#5,
#6]{\begingroup%
2504 \def\printedmanual{\ignorespaces #5}%
2505 \def\printednodename{\ignorespaces #3}%
2507 \setbox1=
\hbox{\printedmanual}%
2508 \setbox0=
\hbox{\printednodename}%
2510 \def\printednodename{\ignorespaces #1}%
2511 %%% Uncommment the following line to make the actual chapter or section title
2512 %%% appear inside the square brackets.
2513 %\def\printednodename{#1-title}%
2517 % If we use \unhbox0 and \unhbox1 to print the node names, TeX does
2518 % not insert empty discretionaries after hyphens, which means that it
2519 % will not find a line break at a hyphen in a node names. Since some
2520 % manuals are best written with fairly long node names, containing
2521 % hyphens, this is a loss. Therefore, we simply give the text of
2522 % the node name again, so it is as if TeX is seeing it for the first
2525 section ``
\printednodename'' in
\cite{\printedmanual}%
2528 \refx{#1-snt
}{} [\printednodename], page
\tie\refx{#1-pg
}{}%
2532 % \dosetq is the interface for calls from other macros
2534 % Use \turnoffactive so that punctuation chars such as underscore
2535 % work in node names.
2536 \def\dosetq #1#2{{\let\folio=
0 \turnoffactive%
2537 \edef\next{\write\auxfile{\internalsetq {#1}{#2}}}%
2540 % \internalsetq {foo}{page} expands into
2541 % CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
2542 % When the aux file is read, ' is the escape character
2544 \def\internalsetq #1#2{'xrdef
{#1}{\csname #2\endcsname}}
2546 % Things to be expanded by \internalsetq
2548 \def\Ypagenumber{\folio}
2550 \def\Ytitle{\thischapter}
2554 \def\Ysectionnumberandtype{%
2555 \ifnum\secno=
0 Chapter
\xreftie\the\chapno %
2556 \else \ifnum \subsecno=
0 Section
\xreftie\the\chapno.
\the\secno %
2557 \else \ifnum \subsubsecno=
0 %
2558 Section
\xreftie\the\chapno.
\the\secno.
\the\subsecno %
2560 Section
\xreftie\the\chapno.
\the\secno.
\the\subsecno.
\the\subsubsecno %
2563 \def\Yappendixletterandtype{%
2564 \ifnum\secno=
0 Appendix
\xreftie'char
\the\appendixno{}%
2565 \else \ifnum \subsecno=
0 Section
\xreftie'char
\the\appendixno.
\the\secno %
2566 \else \ifnum \subsubsecno=
0 %
2567 Section
\xreftie'char
\the\appendixno.
\the\secno.
\the\subsecno %
2569 Section
\xreftie'char
\the\appendixno.
\the\secno.
\the\subsecno.
\the\subsubsecno %
2574 % Use TeX 3.0's \inputlineno to get the line number, for better error
2575 % messages, but if we're using an old version of TeX, don't do anything.
2577 \ifx\inputlineno\thisisundefined
2578 \let\linenumber =
\empty % Non-3.0.
2580 \def\linenumber{\the\inputlineno:
\space}
2583 % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
2584 % If its value is nonempty, SUFFIX is output afterward.
2587 \expandafter\ifx\csname X
#1\endcsname\relax
2588 % If not defined, say something at least.
2589 $
\langle$un\-de\-fined$
\rangle$
%
2591 \message{\linenumber Undefined cross reference `
#1'.
}%
2594 \global\warnedxrefstrue
2595 \message{Cross reference values unknown; you must run TeX again.
}%
2599 % It's defined, so just use it.
2600 \csname X
#1\endcsname
2602 #2% Output the suffix in any case.
2605 % Read the last existing aux file, if any. No error if none exists.
2607 % This is the macro invoked by entries in the aux file.
2609 {\catcode`\'=
\other\expandafter \gdef \csname X
#1\endcsname {#2}}}
2613 \catcode `\^^@=
\other
2614 \catcode `\
\ 1=
\other
2615 \catcode `\
\ 2=
\other
2616 \catcode `\^^C=
\other
2617 \catcode `\^^D=
\other
2618 \catcode `\^^E=
\other
2619 \catcode `\^^F=
\other
2620 \catcode `\^^G=
\other
2621 \catcode `\^^H=
\other
2622 \catcode `\
\v=
\other
2623 \catcode `\^^L=
\other
2624 \catcode `\
\ e=
\other
2625 \catcode `\
\ f=
\other
2626 \catcode `\
\10=
\other
2627 \catcode `\
\11=
\other
2628 \catcode `\
\12=
\other
2629 \catcode `\
\13=
\other
2630 \catcode `\
\14=
\other
2631 \catcode `\
\15=
\other
2632 \catcode `\
\16=
\other
2633 \catcode `\
\17=
\other
2634 \catcode `\
\18=
\other
2635 \catcode `\
\19=
\other
2636 \catcode `\
\1a=
\other
2637 \catcode `\^^
[=
\other
2638 \catcode `\^^\=
\other
2639 \catcode `\^^
]=
\other
2640 \catcode `\^^^=
\other
2641 \catcode `\^^_=
\other
2655 % the aux file uses ' as the escape.
2656 % Turn off \ as an escape so we do not lose on
2657 % entries which were dumped with control sequences in their names.
2658 % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
2659 % Reference to such entries still does not work the way one would wish,
2660 % but at least they do not bomb out when the aux file is read in.
2661 \catcode `\
{=
1 \catcode `\
}=
2
2665 \openin 1 \jobname.aux
2666 \ifeof 1 \else \closein 1 \input \jobname.aux
\global\havexrefstrue
2668 % Open the new aux file. Tex will close it automatically at exit.
2669 \openout \auxfile=
\jobname.aux
2675 \newcount \footnoteno
2677 \def\supereject{\par\penalty -
20000\footnoteno =
0 }
2679 \let\ptexfootnote=
\footnote
2682 \long\gdef\footnote #1{\global\advance \footnoteno by \@ne
2684 \edef\thisfootno{$^
{\the\footnoteno}$
}%
2686 \ifhmode\edef\@sf
{\spacefactor\the\spacefactor}\/
\fi
2687 \thisfootno\@sf
\footnotezzz{#1}}
2688 % \parsearg\footnotezzz}
2690 \long\gdef\footnotezzz #1{\insert\footins{
2691 \interlinepenalty\interfootnotelinepenalty
2692 \splittopskip\ht\strutbox % top baseline for broken footnotes
2693 \splitmaxdepth\dp\strutbox \floatingpenalty\@MM
2694 \leftskip\z@skip
\rightskip\z@skip
\spaceskip\z@skip
\xspaceskip\z@skip
2695 \footstrut\parindent=
\defaultparindent\hang\textindent{\thisfootno}#1\strut}}
2697 }%end \catcode `\@=11
2699 % End of control word definitions.
2701 \message{and turning on texinfo input format.
}
2712 % Set some numeric style parameters, for 8.5 x 11 format.
2715 \newdimen\defaultparindent \defaultparindent =
15pt
2716 \parindent =
\defaultparindent
2717 \parskip 18pt plus
1pt
2719 \advance\topskip by
1.2cm
2721 % Prevent underfull vbox error messages.
2724 % Use TeX 3.0's \emergencystretch to help line breaking, but if we're
2725 % using an old version of TeX, don't do anything. We want the amount of
2726 % stretch added to depend on the line length, hence the dependence on
2727 % \hsize. This makes it come to about 9pt for the 8.5x11 format.
2729 \ifx\emergencystretch\thisisundefined \else
2730 \emergencystretch =
\hsize
2731 \divide\emergencystretch by
45
2734 % Use @smallbook to reset parameters for 7x9.5 format
2736 \global\lispnarrowing =
0.3in
2737 \global\baselineskip 12pt
2738 \global\parskip 3pt plus
1pt
2740 \global\doublecolumnhsize=
2.4in
\global\doublecolumnvsize=
15.0in
2742 \global\tolerance=
700
2745 \global\pagewidth=
\hsize
2746 \global\pageheight=
\vsize
2748 \global\let\smalllisp=
\smalllispx
2749 \global\let\smallexample=
\smalllispx
2750 \global\def\Esmallexample{\Esmalllisp}
2753 %% For a final copy, take out the rectangles
2754 %% that mark overfull boxes (in case you have decided
2755 %% that the text looks ok even though it passes the margin).
2756 \def\finalout{\hfuzz=
\maxdimen}
2758 % Define macros to output various characters with catcode for normal text.
2767 \def\normaldoublequote{"
}
2770 \def\normalunderscore{_
}
2771 \def\normalverticalbar{|
}
2773 \def\normalgreater{>
}
2776 % This macro is used to make a character print one way in ttfont
2777 % where it can probably just be output, and another way in other fonts,
2778 % where something hairier probably needs to be done.
2780 % #1 is what to print if we are indeed using \tt; #2 is what to print
2781 % otherwise. Since all the Computer Modern typewriter fonts have zero
2782 % interword stretch (and shrink), and it is reasonable to expect all
2783 % typewriter fonts to have this, we can check that font parameter.
2785 \def\ifusingtt#1#2{\ifdim \fontdimen3\the\font=
0pt
#1\else #2\fi}
2787 % Turn off all special characters except @
2788 % (and those which the user can use as if they were ordinary).
2789 % Most of these we simply print from the \tt font, but for some, we can
2790 % use math or other variants that look better in normal text.
2793 \def\activedoublequote{{\tt \char '
042}}
2794 \let"=
\activedoublequote
2796 \def~
{{\tt \char '
176}}
2802 \def_{\ifusingtt\normalunderscore\_}
2803 % Subroutine for the previous macro.
2804 \def\_{\lvvmode \kern.06em
\vbox{\hrule width
.3em height
.1ex
}}
2806 % \lvvmode is equivalent in function to \leavevmode.
2807 % Using \leavevmode runs into trouble when written out to
2808 % an index file due to the expansion of \leavevmode into ``\unhbox
2809 % \voidb@x'' ---which looks to TeX like ``\unhbox \voidb\x'' due to our
2810 % magic tricks with @.
2811 \def\lvvmode{\vbox to
0pt
{}}
2814 \def|
{{\tt \char '
174}}
2822 \def+
{{\tt \char 43}}
2823 %\catcode 27=\active
2824 %\def^^[{$\diamondsuit$}
2826 % Used sometimes to turn off (effectively) the active characters
2827 % even after parsing them.
2828 \def\turnoffactive{\let"=
\normaldoublequote
2831 \let_=
\normalunderscore
2832 \let|=
\normalverticalbar
2834 \let>=
\normalgreater
2837 % Set up an active definition for =, but don't enable it most of the time.
2838 {\catcode`\==
\active
2839 \global\def=
{{\tt \char 61}}}
2843 % \rawbackslashxx output one backslash character in current font
2844 \global\chardef\rawbackslashxx=`\\
2845 %{\catcode`\\=\other
2846 %@gdef@rawbackslashxx{\}}
2848 % \rawbackslash redefines \ as input to do \rawbackslashxx.
2849 {\catcode`\\=
\active
2850 @gdef@rawbackslash
{@let\=@rawbackslashxx
}}
2852 % \normalbackslash outputs one backslash in fixed width font.
2853 \def\normalbackslash{{\tt\rawbackslashxx}}
2855 % Say @foo, not \foo, in error messages.
2858 % \catcode 17=0 % Define control-q
2861 % If a .fmt file is being used, we don't want the `\input texinfo' to show up.
2862 % That is what \eatinput is for; after that, the `\' should revert to printing
2865 @gdef@eatinput input texinfo
{@fixbackslash
}
2866 @global@let\ = @eatinput
2868 % On the other hand, perhaps the file did not have a `\input texinfo'. Then
2869 % the first `\{ in the file would cause an error. This macro tries to fix
2870 % that, assuming it is called before the first `\' could plausibly occur.
2872 @gdef@fixbackslash
{@ifx\@eatinput @let\ = @normalbackslash @fi
}
2874 %% These look ok in all fonts, so just make them not special. The @rm below
2875 %% makes sure that the current font starts out as the newly loaded cmr10
2876 @catcode`@$=@other @catcode`@
%=@other @catcode`@&=@other @catcode`@#=@other
2882 @c page-delimiter: "^\\\
\message"