1 %% TeX macros to handle texinfo files
3 % Copyright (C) 1985-1986, 1988, 1990-1991, 2016 Free Software
6 %This texinfo.tex file is free software; you can redistribute it and/or
7 %modify it under the terms of the GNU General Public License as
8 %published by the Free Software Foundation; either version 2, or (at
9 %your option) any later version.
11 %This texinfo.tex file is distributed in the hope that it will be
12 %useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 %of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 %General Public License for more details.
16 %You should have received a copy of the GNU General Public License
17 %along with this texinfo.tex file; see the file COPYING. If not, write
18 %to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139,
22 %In other words, you are welcome to use, share and improve this program.
23 %You are forbidden to forbid anyone else to use, share and improve
24 %what you give them. Help stamp out software-hoarding!
26 \def\texinfoversion{2.73}
27 \message{Loading texinfo package
[Version
\texinfoversion]:
}
30 % Print the version number if in a .fmt file.
31 \everyjob{\message{[Texinfo version
\texinfoversion]}\message{}}
33 % Save some parts of plain tex whose names we will redefine.
41 \let\ptexbullet=
\bullet
49 \def\tie{\penalty 10000\
} % Save plain tex definition of ~.
54 % If this character appears in an error message or help string, it
55 % starts a new line in the output.
58 \hyphenation{ap-pen-dix
}
59 \hyphenation{mini-buf-fer mini-buf-fers
}
62 % Margin to add to right of even pages, to left of odd pages.
63 \newdimen \bindingoffset \bindingoffset=
0pt
64 \newdimen \normaloffset \normaloffset=
\hoffset
65 \newdimen\pagewidth \newdimen\pageheight
66 \pagewidth=
\hsize \pageheight=
\vsize
68 % Sometimes it is convenient to have everything in the transcript file
69 % and nothing on the terminal. We don't just call \tracingall here,
70 % since that produces some useless output on the terminal.
72 \def\gloggingall{\begingroup \globaldefs =
1 \loggingall \endgroup}%
73 \def\loggingall{\tracingcommands2 \tracingstats2
74 \tracingpages1 \tracingoutput1 \tracinglostchars1
75 \tracingmacros2 \tracingparagraphs1 \tracingrestores1
76 \showboxbreadth\maxdimen\showboxdepth\maxdimen
79 %---------------------Begin change-----------------------
81 %%%% For @cropmarks command.
82 % Dimensions to add cropmarks at corners Added by P. A. MacKay, 12 Nov. 1986
84 \newdimen\cornerlong \newdimen\cornerthick
85 \newdimen \topandbottommargin
86 \newdimen \outerhsize \newdimen \outervsize
87 \cornerlong=
1pc
\cornerthick=
.3pt
% These set size of cropmarks
90 % Alternative @smallbook page size is 9.25in
92 \topandbottommargin=
.75in
94 %---------------------End change-----------------------
96 % \onepageout takes a vbox as an argument. Note that \pagecontents
97 % does insertions itself, but you have to call it yourself.
98 \chardef\PAGE=
255 \output=
{\onepageout{\pagecontents\PAGE}}
99 \def\onepageout#1{\hoffset=
\normaloffset
100 \ifodd\pageno \advance\hoffset by
\bindingoffset
101 \else \advance\hoffset by -
\bindingoffset\fi
102 {\escapechar=`\\
\relax % makes sure backslash is used in output files.
103 \shipout\vbox{{\let\hsize=
\pagewidth \makeheadline} \pagebody{#1}%
104 {\let\hsize=
\pagewidth \makefootline}}}%
105 \advancepageno \ifnum\outputpenalty>-
20000 \else\dosupereject\fi}
107 %%%% For @cropmarks command %%%%
109 % Here is a modification of the main output routine for Near East Publications
110 % This provides right-angle cropmarks at all four corners.
111 % The contents of the page are centerlined into the cropmarks,
112 % and any desired binding offset is added as an \hskip on either
113 % site of the centerlined box. (P. A. MacKay, 12 November, 1986)
115 \def\croppageout#1{\hoffset=
0pt
% make sure this doesn't mess things up
117 \vbox to
\outervsize{\hsize=
\outerhsize
118 \vbox{\line{\ewtop\hfill\ewtop}}
120 \line{\vbox{\moveleft\cornerthick\nstop}
122 \vbox{\moveright\cornerthick\nstop}}
123 \vskip \topandbottommargin
124 \centerline{\ifodd\pageno\hskip\bindingoffset\fi
126 {\let\hsize=
\pagewidth \makeheadline}
128 {\let\hsize=
\pagewidth \makefootline}}
129 \ifodd\pageno\else\hskip\bindingoffset\fi}
130 \vskip \topandbottommargin plus1fill minus1fill
131 \boxmaxdepth\cornerthick
132 \line{\vbox{\moveleft\cornerthick\nsbot}
134 \vbox{\moveright\cornerthick\nsbot}}
136 \vbox{\line{\ewbot\hfill\ewbot}}
139 \ifnum\outputpenalty>-
20000 \else\dosupereject\fi}
141 % Do @cropmarks to get crop marks
142 \def\cropmarks{\let\onepageout=
\croppageout }
144 \def\pagebody#1{\vbox to
\pageheight{\boxmaxdepth=
\maxdepth #1}}
146 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
147 \dimen@=
\dp#1 \unvbox#1
148 \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
149 \ifr@ggedbottom
\kern-
\dimen@
\vfil \fi}
153 % Here are the rules for the cropmarks. Note that they are
154 % offset so that the space between them is truly \outerhsize or \outervsize
155 % (P. A. MacKay, 12 November, 1986)
157 \def\ewtop{\vrule height
\cornerthick depth0pt width
\cornerlong}
159 {\hrule height
\cornerthick depth
\cornerlong width
\cornerthick}}
160 \def\ewbot{\vrule height0pt depth
\cornerthick width
\cornerlong}
162 {\hrule height
\cornerlong depth
\cornerthick width
\cornerthick}}
164 % Parse an argument, then pass it to #1.
165 % The argument can be delimited with [...] or with "..." or braces
166 % or it can be a whole line.
167 % #1 should be a macro which expects
168 % an ordinary undelimited TeX argument.
170 \def\parsearg #1{\let\next=
#1\begingroup\obeylines\futurelet\temp\parseargx}
173 \ifx \obeyedspace\temp \aftergroup\parseargdiscardspace \else%
174 \aftergroup \parseargline %
178 \gdef\parseargdiscardspace {\begingroup\obeylines\futurelet\temp\parseargx}}
180 \gdef\obeyedspace{\
}
182 \def\parseargline{\begingroup \obeylines \parsearglinex}
184 \gdef\parsearglinex #1^^M
{\endgroup \next {#1}}}
186 \def\flushcr{\ifx\par\lisppar \def\next#
#1{}\else \let\next=
\relax \fi \next}
188 %% These are used to keep @begin/@end levels from running away
189 %% Call \inENV within environments (after a \begingroup)
190 \newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
192 \ifENV\errmessage{Still within an environment. Type Return to continue.
}
193 \endgroup\fi} % This is not perfect, but it should reduce lossage
195 % @begin foo is the same as @foo, for now.
196 \newhelp\EMsimple{Type <Return> to continue
}
198 \outer\def\begin{\parsearg\beginxxx}
201 \expandafter\ifx\csname #1\endcsname\relax
202 {\errhelp=
\EMsimple \errmessage{Undefined command @begin
#1}}\else
203 \csname #1\endcsname\fi}
205 %% @end foo executes the definition of \Efoo.
206 %% foo can be delimited by doublequotes or brackets.
208 \def\end{\parsearg\endxxx}
211 \expandafter\ifx\csname E
#1\endcsname\relax
212 \expandafter\ifx\csname #1\endcsname\relax
213 \errmessage{Undefined command @end
#1}\else
215 \csname E
#1\endcsname}
217 {\errhelp=
\EMsimple \errmessage{@end
#1 not within
#1 environment
}}}
219 % Single-spacing is done by various environments.
221 \newskip\singlespaceskip \singlespaceskip =
\baselineskip
223 {\advance \baselineskip by -
\singlespaceskip
224 \kern \baselineskip}%
225 \baselineskip=
\singlespaceskip
228 %% Simple single-character @ commands
231 % Kludge this until the fonts are right (grr).
232 \def\@
{{\tt \char '
100}}
234 % Define @` and @' to be the same as ` and '
235 % but suppressing ligatures.
239 % Used to generate quoted braces.
241 \def\mylbrace {{\tt \char '
173}}
242 \def\myrbrace {{\tt \char '
175}}
246 % @: forces normal size whitespace following.
247 \def\:
{\spacefactor=
1000 }
249 % @* forces a line break.
250 \def\*
{\hfil\break\hbox{}\ignorespaces}
252 % @. is an end-of-sentence period.
253 \def\.
{.
\spacefactor=
3000 }
255 % @w prevents a word break. Without the \leavevmode, @w at the
256 % beginning of a paragraph, when TeX is still in vertical mode, would
257 % produce a whole line of output instead of starting the paragraph.
258 \def\w#1{\leavevmode\hbox{#1}}
260 % @group ... @end group forces ... to be all on one page, by enclosing
261 % it in a TeX vbox. We use \vtop instead of \vbox to construct the box
262 % to keep its height that of a normal line. According to the rules for
263 % \topskip (p.114 of the TeXbook), the glue inserted is
264 % max (\topskip - \ht (first item), 0). If that height is large,
265 % therefore, no glue is inserted, and the space between the headline and
266 % the text is small, which looks bad.
268 \def\group{\begingroup
269 \ifnum\catcode13=
\active \else
270 \errhelp =
\groupinvalidhelp
271 \errmessage{@group invalid in context where filling is enabled
}%
273 \def\Egroup{\egroup\endgroup}%
277 % TeX puts in an \escapechar (i.e., `@') at the beginning of the help
278 % message, so this ends up printing `@group can only ...'.
280 \newhelp\groupinvalidhelp{%
281 group can only be used in environments such as @example,^^J
%
282 where each line of input produces a line of output.
}
284 % @need space-in-mils
285 % forces a page break if there is not space-in-mils remaining.
287 \newdimen\mil \mil=
0.001in
289 \def\need{\parsearg\needx}
291 % Old definition--didn't work.
292 %\def\needx #1{\par %
293 %% This method tries to make TeX break the page naturally
294 %% if the depth of the box does not fit.
296 %\vtop to #1\mil{\vfil}\kern -#1\mil\penalty 10000
301 % Go into vertical mode, so we don't make a big box in the middle of a
305 % Don't add any leading before our big empty box, but allow a page
306 % break, since the best break might be right here.
309 \vtop to
#1\mil{\vfil}%
311 % TeX does not even consider page breaks if a penalty added to the
312 % main vertical list is 10000 or more. But in order to see if the
313 % empty box we just added fits on the page, we must make it consider
314 % page breaks. On the other hand, we don't want to actually break the
315 % page after the empty box. So we use a penalty of 9999.
317 % There is an extremely small chance that TeX will actually break the
318 % page at this \penalty, if there are no other feasible breakpoints in
319 % sight. (If the user is using lots of big @group commands, which
320 % almost-but-not-quite fill up a page, TeX will have a hard time doing
321 % good page breaking, for example.) However, I could not construct an
322 % example where a page broke at this \penalty; if it happens in a real
323 % document, then we can reconsider our strategy.
326 % Back up by the size of the box, whether we did a page break or not.
329 % Do not allow a page break right after this kern.
333 % @br forces paragraph break
337 % @dots{} output some dots
341 % @page forces the start of a new page
343 \def\page{\par\vfill\supereject}
346 % outputs text on separate line in roman font, starting at standard page margin
348 % This records the amount of indent in the innermost environment.
349 % That's how much \exdent should take out.
350 \newskip\exdentamount
352 % This defn is used inside fill environments such as @defun.
353 \def\exdent{\parsearg\exdentyyy}
354 \def\exdentyyy #1{{\hfil\break\hbox{\kern -
\exdentamount{\rm#1}}\hfil\break}}
356 % This defn is used inside nofill environments such as @example.
357 \def\nofillexdent{\parsearg\nofillexdentyyy}
358 \def\nofillexdentyyy #1{{\advance \leftskip by -
\exdentamount
359 \leftline{\hskip\leftskip{\rm#1}}}}
361 %\hbox{{\rm#1}}\hfil\break}}
363 % @include file insert text of that file as input.
365 \def\include{\parsearg\includezzz}
366 \def\includezzz #1{{\def\thisfile{#1}\input #1
371 % @center line outputs that line, centered
373 \def\center{\parsearg\centerzzz}
374 \def\centerzzz #1{{\advance\hsize by -
\leftskip
375 \advance\hsize by -
\rightskip
378 % @sp n outputs n lines of vertical space
380 \def\sp{\parsearg\spxxx}
381 \def\spxxx #1{\par \vskip #1\baselineskip}
383 % @comment ...line which is ignored...
384 % @c is the same as @comment
385 % @ignore ... @end ignore is another way to write a comment
387 \def\comment{\catcode 64=
\other \catcode 123=
\other \catcode 125=
\other%
388 \parsearg \commentxxx}
390 \def\commentxxx #1{\catcode 64=
0 \catcode 123=
1 \catcode 125=
2 }
394 % Prevent errors for section commands.
395 % Used in @ignore and in failing conditionals.
396 \def\ignoresections{%
398 \let\unnumbered=
\relax
400 \let\unnumberedsec=
\relax
401 \let\unnumberedsection=
\relax
402 \let\unnumberedsubsec=
\relax
403 \let\unnumberedsubsection=
\relax
404 \let\unnumberedsubsubsec=
\relax
405 \let\unnumberedsubsubsection=
\relax
408 \let\subsubsec=
\relax
409 \let\subsection=
\relax
410 \let\subsubsection=
\relax
412 \let\appendixsec=
\relax
413 \let\appendixsection=
\relax
414 \let\appendixsubsec=
\relax
415 \let\appendixsubsection=
\relax
416 \let\appendixsubsubsec=
\relax
417 \let\appendixsubsubsection=
\relax
419 \let\smallbook=
\relax
420 \let\titlepage=
\relax
423 \def\ignore{\begingroup\ignoresections
424 % Make sure that spaces turn into tokens that match what \ignorexxx wants.
427 \long\def\ignorexxx #1\end ignore
{\endgroup\ignorespaces}
429 \def\direntry{\begingroup\direntryxxx}
430 \long\def\direntryxxx #1\end direntry
{\endgroup\ignorespaces}
432 % Conditionals to test whether a flag is set.
434 \def\ifset{\begingroup\ignoresections\parsearg\ifsetxxx}
436 \def\ifsetxxx #1{\endgroup
437 \expandafter\ifx\csname IF
#1\endcsname\relax \let\temp=
\ifsetfail
438 \else \let\temp=
\relax \fi
441 \def\ifsetfail{\begingroup\ignoresections\ifsetfailxxx}
442 \long\def\ifsetfailxxx #1\end ifset
{\endgroup\ignorespaces}
444 \def\ifclear{\begingroup\ignoresections\parsearg\ifclearxxx}
446 \def\ifclearxxx #1{\endgroup
447 \expandafter\ifx\csname IF
#1\endcsname\relax \let\temp=
\relax
448 \else \let\temp=
\ifclearfail \fi
451 \def\ifclearfail{\begingroup\ignoresections\ifclearfailxxx}
452 \long\def\ifclearfailxxx #1\end ifclear
{\endgroup\ignorespaces}
454 % @set foo to set the flag named foo.
455 % @clear foo to clear the flag named foo.
456 \def\set{\parsearg\setxxx}
458 \expandafter\let\csname IF
#1\endcsname=
\set}
460 \def\clear{\parsearg\clearxxx}
462 \expandafter\let\csname IF
#1\endcsname=
\relax}
464 % Some texinfo constructs that are trivial in tex
468 \def\ifinfo{\begingroup\ignoresections\ifinfoxxx}
469 \long\def\ifinfoxxx #1\end ifinfo
{\endgroup\ignorespaces}
471 \long\def\menu #1\end menu
{}
474 % @math means output in math mode.
475 % We don't use $'s directly in the definition of \math because control
476 % sequences like \math are expanded when the toc file is written. Then,
477 % we read the toc file back, the $'s will be normal characters (as they
478 % should be, according to the definition of Texinfo). So we must use a
479 % control sequence to switch into and out of math mode.
481 % This isn't quite enough for @math to work properly in indices, but it
482 % seems unlikely it will ever be needed there.
484 \let\implicitmath = $
485 \def\math#1{\implicitmath #1\implicitmath}
487 \def\node{\ENVcheck\parsearg\nodezzz}
488 \def\nodezzz#1{\nodexxx [#1,
]}
489 \def\nodexxx[#1,
#2]{\gdef\lastnode{#1}}
492 \def\donoderef{\ifx\lastnode\relax\else
493 \expandafter\expandafter\expandafter\setref{\lastnode}\fi
494 \let\lastnode=
\relax}
496 \def\unnumbnoderef{\ifx\lastnode\relax\else
497 \expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi
498 \let\lastnode=
\relax}
500 \def\appendixnoderef{\ifx\lastnode\relax\else
501 \expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi
502 \let\lastnode=
\relax}
506 % @setfilename is done at the beginning of every texinfo file.
507 % So open here the files we need to have open while reading the input.
508 % This makes it possible to make a .fmt file for texinfo.
513 \fixbackslash % Turn off hack to swallow `\input texinfo'.
514 \global\let\setfilename=
\comment % Ignore extra @setfilename cmds.
515 \comment % Ignore the actual filename.
518 \outer\def\bye{\pagealignmacro\tracingstats=
1\ptexend}
520 \def\inforef #1{\inforefzzz #1,,,,**
}
521 \def\inforefzzz #1,
#2,
#3,
#4**
{See Info file
\file{\losespace#3{}},
522 node
\samp{\losespace#1{}}}
523 \def\losespace #1{#1}
527 % Font-change commands.
529 % Texinfo supports the sans serif font style, which plain TeX does not.
530 % So we set up a \sf analogous to plain's \rm, etc.
532 \def\sf{\fam=
\sffam \tensf}
533 \let\li =
\sf % Sometimes we call it \li, not \sf.
535 %% Try out Computer Modern fonts at \magstephalf
536 \let\mainmagstep=
\magstephalf
539 \let\mainmagstep=
\magstep1
543 \font\textrm=cmr10 scaled
\mainmagstep
544 \font\texttt=cmtt10 scaled
\mainmagstep
546 % Instead of cmb10, you many want to use cmbx10.
547 % cmbx10 is a prettier font on its own, but cmb10
548 % looks better when embedded in a line with cmr10.
549 \font\textbf=cmb10 scaled
\mainmagstep
550 \font\textit=cmti10 scaled
\mainmagstep
551 \font\textsl=cmsl10 scaled
\mainmagstep
552 \font\textsf=cmss10 scaled
\mainmagstep
553 \font\textsc=cmcsc10 scaled
\mainmagstep
554 \font\texti=cmmi10 scaled
\mainmagstep
555 \font\textsy=cmsy10 scaled
\mainmagstep
557 % A few fonts for @defun, etc.
558 \font\defbf=cmbx10 scaled
\magstep1 %was 1314
559 \font\deftt=cmtt10 scaled
\magstep1
560 \def\df{\let\tentt=
\deftt \let\tenbf =
\defbf \bf}
562 % Fonts for indices and small examples.
563 % We actually use the slanted font rather than the italic,
564 % because texinfo normally uses the slanted fonts for that.
565 % Do not make many font distinctions in general in the index, since they
566 % aren't very useful.
579 \font\chaprm=cmbx12 scaled
\magstep2
580 \font\chapit=cmti12 scaled
\magstep2
581 \font\chapsl=cmsl12 scaled
\magstep2
582 \font\chaptt=cmtt12 scaled
\magstep2
583 \font\chapsf=cmss12 scaled
\magstep2
585 \font\chapsc=cmcsc10 scaled
\magstep3
586 \font\chapi=cmmi12 scaled
\magstep2
587 \font\chapsy=cmsy10 scaled
\magstep3
589 \font\secrm=cmbx12 scaled
\magstep1
590 \font\secit=cmti12 scaled
\magstep1
591 \font\secsl=cmsl12 scaled
\magstep1
592 \font\sectt=cmtt12 scaled
\magstep1
593 \font\secsf=cmss12 scaled
\magstep1
594 \font\secbf=cmbx12 scaled
\magstep1
595 \font\secsc=cmcsc10 scaled
\magstep2
596 \font\seci=cmmi12 scaled
\magstep1
597 \font\secsy=cmsy10 scaled
\magstep2
599 % \font\ssecrm=cmbx10 scaled \magstep1 % This size an font looked bad.
600 % \font\ssecit=cmti10 scaled \magstep1 % The letters were too crowded.
601 % \font\ssecsl=cmsl10 scaled \magstep1
602 % \font\ssectt=cmtt10 scaled \magstep1
603 % \font\ssecsf=cmss10 scaled \magstep1
605 %\font\ssecrm=cmb10 scaled 1315 % Note the use of cmb rather than cmbx.
606 %\font\ssecit=cmti10 scaled 1315 % Also, the size is a little larger than
607 %\font\ssecsl=cmsl10 scaled 1315 % being scaled magstep1.
608 %\font\ssectt=cmtt10 scaled 1315
609 %\font\ssecsf=cmss10 scaled 1315
613 \font\ssecrm=cmbx12 scaled
\magstephalf
614 \font\ssecit=cmti12 scaled
\magstephalf
615 \font\ssecsl=cmsl12 scaled
\magstephalf
616 \font\ssectt=cmtt12 scaled
\magstephalf
617 \font\ssecsf=cmss12 scaled
\magstephalf
618 \font\ssecbf=cmbx12 scaled
\magstephalf
619 \font\ssecsc=cmcsc10 scaled
\magstep1
620 \font\sseci=cmmi12 scaled
\magstephalf
621 \font\ssecsy=cmsy10 scaled
\magstep1
622 % The smallcaps and symbol fonts should actually be scaled \magstep1.5,
623 % but that is not a standard magnification.
625 % Fonts for title page:
626 \font\titlerm = cmbx12 scaled
\magstep3
627 \let\authorrm =
\secrm
629 % In order for the font changes to affect most math symbols and letters,
630 % we have to define the \textfont of the standard families. Since
631 % texinfo doesn't allow for producing subscripts and superscripts, we
632 % don't bother to reset \scriptfont and \scriptscriptfont (which would
633 % also require loading a lot more fonts).
635 \def\resetmathfonts{%
636 \textfont0 =
\tenrm \textfont1 =
\teni \textfont2 =
\tensy
637 \textfont\itfam =
\tenit \textfont\slfam =
\tensl \textfont\bffam =
\tenbf
638 \textfont\ttfam =
\tentt \textfont\sffam =
\tensf
642 % The font-changing commands redefine the meanings of \tenSTYLE, instead
643 % of just \STYLE. We do this so that font changes will continue to work
644 % in math mode, where it is the current \fam that is relevant in most
645 % cases, not the current. Plain TeX does, for example,
646 % \def\bf{\fam=\bffam \tenbf} By redefining \tenbf, we obviate the need
647 % to redefine \bf itself.
649 \let\tenrm=
\textrm \let\tenit=
\textit \let\tensl=
\textsl
650 \let\tenbf=
\textbf \let\tentt=
\texttt \let\smallcaps=
\textsc
651 \let\tensf=
\textsf \let\teni=
\texti \let\tensy=
\textsy
654 \let\tenrm=
\chaprm \let\tenit=
\chapit \let\tensl=
\chapsl
655 \let\tenbf=
\chapbf \let\tentt=
\chaptt \let\smallcaps=
\chapsc
656 \let\tensf=
\chapsf \let\teni=
\chapi \let\tensy=
\chapsy
659 \let\tenrm=
\secrm \let\tenit=
\secit \let\tensl=
\secsl
660 \let\tenbf=
\secbf \let\tentt=
\sectt \let\smallcaps=
\secsc
661 \let\tensf=
\secsf \let\teni=
\seci \let\tensy=
\secsy
664 \let\tenrm=
\ssecrm \let\tenit=
\ssecit \let\tensl=
\ssecsl
665 \let\tenbf=
\ssecbf \let\tentt=
\ssectt \let\smallcaps=
\ssecsc
666 \let\tensf=
\ssecsf \let\teni=
\sseci \let\tensy=
\ssecsy
669 \let\tenrm=
\indrm \let\tenit=
\indit \let\tensl=
\indsl
670 \let\tenbf=
\indbf \let\tentt=
\indtt \let\smallcaps=
\indsc
671 \let\tensf=
\indsf \let\teni=
\indi \let\tensy=
\indsy
674 % Set up the default fonts, so we can use them for creating boxes.
678 % Count depth in font-changes, for error checks
679 \newcount\fontdepth \fontdepth=
0
681 % Fonts for short table of contents.
682 \font\shortcontrm=cmr12
683 \font\shortcontbf=cmbx12
684 \font\shortcontsl=cmsl12
686 %% Add scribe-like font environments, plus @l for inline lisp (usually sans
687 %% serif) and @ii for TeX italic
689 % \smartitalic{ARG} outputs arg in italics, followed by an italic correction
690 % unless the following character is such as not to need one.
691 \def\smartitalicx{\ifx\next,
\else\ifx\next-
\else\ifx\next.
\else\/
\fi\fi\fi}
692 \def\smartitalic#1{{\sl #1}\futurelet\next\smartitalicx}
695 \let\var=
\smartitalic
696 \let\dfn=
\smartitalic
697 \let\emph=
\smartitalic
698 \let\cite=
\smartitalic
703 \def\t#1{{\tt \exhyphenpenalty=
10000\rawbackslash \frenchspacing #1}\null}
705 %\def\samp #1{`{\tt \rawbackslash \frenchspacing #1}'\null}
706 \def\samp #1{`
\tclose{#1}'
\null}
707 \def\key #1{{\tt \exhyphenpenalty=
10000\uppercase{#1}}\null}
708 \def\ctrl #1{{\tt \rawbackslash \hat}#1}
712 % @code is a modification of @t,
713 % which makes spaces the same size as normal in the surrounding text.
716 \def\tclose#1{{\rm \tcloserm=
\fontdimen2\font \tt \tclosesave=
\fontdimen2\font
717 \fontdimen2\font=
\tcloserm
718 % prevent breaking lines at hyphens.
719 \exhyphenpenalty=
10000
720 \def\
{{\fontdimen2\font=
\tclosesave{} }}%
721 \rawbackslash \frenchspacing #1\fontdimen2\font=
\tclosesave}\null}
723 %\let\exp=\tclose %Was temporary
725 % @kbd is like @code, except that if the argument is just one @key command,
726 % then @kbd has no effect.
729 \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??
}%
730 \ifx\one\xkey\ifx\threex\three \key{#2}%
731 \else\tclose{\look}\fi
732 \else\tclose{\look}\fi}
734 % Typeset a dimension, e.g., `in' or `pt'. The only reason for the
735 % argument is to make the input look right: @dmn{pt} instead of
738 \def\dmn#1{\thinspace #1}
740 \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??
\par}
742 \def\l#1{{\li #1}\null} %
744 \def\r#1{{\rm #1}} % roman font
745 % Use of \lowercase was suggested.
746 \def\sc#1{{\smallcaps#1}} % smallcaps font
747 \def\ii#1{{\it #1}} % italic font
749 \message{page headings,
}
751 \newskip\titlepagetopglue \titlepagetopglue =
1.5in
752 \newskip\titlepagebottomglue \titlepagebottomglue =
2pc
754 % First the title page. Must do @settitle before @titlepage.
755 \def\titlefont#1{{\titlerm #1}}
757 \newtoks\realeverypar
759 \newif\iffinishedtitlepage
761 \def\titlepage{\begingroup \parindent=
0pt
\textfonts
762 \let\subtitlerm=
\tenrm
763 % I deinstalled the following change because \cmr12 is undefined.
764 % This change was not in the ChangeLog anyway. --rms.
765 % \let\subtitlerm=\cmr12
766 \def\subtitlefont{\subtitlerm \normalbaselineskip =
13pt
\normalbaselines}%
768 \def\authorfont{\authorrm \normalbaselineskip =
16pt
\normalbaselines}%
770 % Leave some space at the very top of the page.
771 \vglue\titlepagetopglue
773 % Now you can print the title using @title.
774 \def\title{\parsearg\titlezzz}%
775 \def\titlezzz#
#1{\leftline{\titlefont{#
#1}}
776 % print a rule at the page bottom also.
777 \finishedtitlepagefalse
778 \vskip4pt \hrule height
4pt
\vskip4pt}%
779 % No rule at page bottom unless we print one at the top with @title.
780 \finishedtitlepagetrue
782 % Now you can put text using @subtitle.
783 \def\subtitle{\parsearg\subtitlezzz}%
784 \def\subtitlezzz#
#1{{\subtitlefont \rightline{#
#1}}}%
786 % @author should come last, but may come many times.
787 \def\author{\parsearg\authorzzz}%
788 \def\authorzzz#
#1{\ifseenauthor\else\vskip 0pt plus
1filll
\seenauthortrue\fi
789 {\authorfont \leftline{#
#1}}}%
791 % Most title ``pages'' are actually two pages long, with space
792 % at the top of the second. We don't want the ragged left on the second.
795 \iffinishedtitlepage\else
801 % \def\page{\oldpage \hbox{}}
805 \iffinishedtitlepage\else
808 % It is important to do the page break before ending the group,
809 % because the headline and footline are only empty inside the group.
810 % If we use the new definition of \page, we always get a blank page
811 % after the title page, which we certainly don't want.
817 \def\finishtitlepage{%
818 \vskip4pt \hrule height
2pt
819 \vskip\titlepagebottomglue
820 \finishedtitlepagetrue
823 %%% Set up page headings and footings.
827 \newtoks \evenheadline % Token sequence for heading line of even pages
828 \newtoks \oddheadline % Token sequence for heading line of odd pages
829 \newtoks \evenfootline % Token sequence for footing line of even pages
830 \newtoks \oddfootline % Token sequence for footing line of odd pages
832 % Now make Tex use those variables
833 \headline=
{{\textfonts\rm \ifodd\pageno \the\oddheadline
834 \else \the\evenheadline \fi}}
835 \footline=
{{\textfonts\rm \ifodd\pageno \the\oddfootline
836 \else \the\evenfootline \fi}\HEADINGShook}
837 \let\HEADINGShook=
\relax
839 % Commands to set those variables.
840 % For example, this is what @headings on does
841 % @evenheading @thistitle|@thispage|@thischapter
842 % @oddheading @thischapter|@thispage|@thistitle
843 % @evenfooting @thisfile||
844 % @oddfooting ||@thisfile
846 \def\evenheading{\parsearg\evenheadingxxx}
847 \def\oddheading{\parsearg\oddheadingxxx}
848 \def\everyheading{\parsearg\everyheadingxxx}
850 \def\evenfooting{\parsearg\evenfootingxxx}
851 \def\oddfooting{\parsearg\oddfootingxxx}
852 \def\everyfooting{\parsearg\everyfootingxxx}
856 \gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|
\finish}
857 \gdef\evenheadingyyy #1@|
#2@|
#3@|
#4\finish{%
858 \global\evenheadline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
860 \gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|
\finish}
861 \gdef\oddheadingyyy #1@|
#2@|
#3@|
#4\finish{%
862 \global\oddheadline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
864 \gdef\everyheadingxxx #1{\everyheadingyyy #1@|@|@|@|
\finish}
865 \gdef\everyheadingyyy #1@|
#2@|
#3@|
#4\finish{%
866 \global\evenheadline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}
867 \global\oddheadline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
869 \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|
\finish}
870 \gdef\evenfootingyyy #1@|
#2@|
#3@|
#4\finish{%
871 \global\evenfootline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
873 \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|
\finish}
874 \gdef\oddfootingyyy #1@|
#2@|
#3@|
#4\finish{%
875 \global\oddfootline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
877 \gdef\everyfootingxxx #1{\everyfootingyyy #1@|@|@|@|
\finish}
878 \gdef\everyfootingyyy #1@|
#2@|
#3@|
#4\finish{%
879 \global\evenfootline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}
880 \global\oddfootline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
882 }% unbind the catcode of @.
884 % @headings double turns headings on for double-sided printing.
885 % @headings single turns headings on for single-sided printing.
886 % @headings off turns them off.
887 % @headings on same as @headings double, retained for compatibility.
888 % @headings after turns on double-sided headings after this page.
889 % @headings doubleafter turns on double-sided headings after this page.
890 % @headings singleafter turns on single-sided headings after this page.
891 % By default, they are off.
893 \def\headings #1 {\csname HEADINGS
#1\endcsname}
896 \global\evenheadline=
{\hfil} \global\evenfootline=
{\hfil}
897 \global\oddheadline=
{\hfil} \global\oddfootline=
{\hfil}}
899 % When we turn headings on, set the page number to 1.
900 % For double-sided printing, put current file name in lower left corner,
901 % chapter name on inside top of right hand pages, document
902 % title on inside top of left hand pages, and page numbers on outside top
907 \global\evenfootline=
{\hfil}
908 \global\oddfootline=
{\hfil}
909 \global\evenheadline=
{\line{\folio\hfil\thistitle}}
910 \global\oddheadline=
{\line{\thischapter\hfil\folio}}
912 % For single-sided printing, chapter title goes across top left of page,
913 % page number on top right.
917 \global\evenfootline=
{\hfil}
918 \global\oddfootline=
{\hfil}
919 \global\evenheadline=
{\line{\thischapter\hfil\folio}}
920 \global\oddheadline=
{\line{\thischapter\hfil\folio}}
922 \def\HEADINGSon{\HEADINGSdouble}
924 \def\HEADINGSafter{\let\HEADINGShook=
\HEADINGSdoublex}
925 \let\HEADINGSdoubleafter=
\HEADINGSafter
926 \def\HEADINGSdoublex{%
927 \global\evenfootline=
{\hfil}
928 \global\oddfootline=
{\hfil}
929 \global\evenheadline=
{\line{\folio\hfil\thistitle}}
930 \global\oddheadline=
{\line{\thischapter\hfil\folio}}
933 \def\HEADINGSsingleafter{\let\HEADINGShook=
\HEADINGSsinglex}
934 \def\HEADINGSsinglex{%
935 \global\evenfootline=
{\hfil}
936 \global\oddfootline=
{\hfil}
937 \global\evenheadline=
{\line{\thischapter\hfil\folio}}
938 \global\oddheadline=
{\line{\thischapter\hfil\folio}}
941 % Subroutines used in generating headings
942 % Produces Day Month Year style of output.
943 \def\today{\number\day\space
945 January
\or February
\or March
\or April
\or May
\or June
\or
946 July
\or August
\or September
\or October
\or November
\or December
\fi
949 % Use this if you want the Month Day, Year style of output.
950 %\def\today{\ifcase\month\or
951 %January\or February\or March\or April\or May\or June\or
952 %July\or August\or September\or October\or November\or December\fi
953 %\space\number\day, \number\year}
955 % @settitle line... specifies the title of the document, for headings
956 % It generates no output of its own
958 \def\thistitle{No Title
}
959 \def\settitle{\parsearg\settitlezzz}
960 \def\settitlezzz #1{\gdef\thistitle{#1}}
964 % @tabs -- simple alignment
966 % These don't work. For one thing, \+ is defined as outer.
967 % So these macros cannot even be defined.
969 %\def\tabs{\parsearg\tabszzz}
970 %\def\tabszzz #1{\settabs\+#1\cr}
971 %\def\tabline{\parsearg\tablinezzz}
972 %\def\tablinezzz #1{\+#1\cr}
975 % Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
977 % default indentation of table text
978 \newdimen\tableindent \tableindent=
.8in
979 % default indentation of @itemize and @enumerate text
980 \newdimen\itemindent \itemindent=
.3in
981 % margin between end of table item and start of table text.
982 \newdimen\itemmargin \itemmargin=
.1in
984 % used internally for \itemindent minus \itemmargin
987 % Note @table, @vtable, and @vtable define @item, @itemx, etc., with
989 % They also define \itemindex
990 % to index the item name in whatever manner is desired (perhaps none).
992 \def\internalBitem{\smallbreak \parsearg\itemzzz}
993 \def\internalBitemx{\par \parsearg\itemzzz}
995 \def\internalBxitem "
#1"
{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
996 \def\internalBxitemx "
#1"
{\def\xitemsubtopix{#1} \par \parsearg\xitemzzz}
998 \def\internalBkitem{\smallbreak \parsearg\kitemzzz}
999 \def\internalBkitemx{\par \parsearg\kitemzzz}
1001 \def\kitemzzz #1{\dosubind {kw
}{\code{#1}}{for
{\bf \lastfunction}}%
1004 \def\xitemzzz #1{\dosubind {kw
}{\code{#1}}{for
{\bf \xitemsubtopic}}%
1007 \def\itemzzz #1{\begingroup %
1008 \advance\hsize by -
\rightskip
1009 \advance\hsize by -
\tableindent
1010 \setbox0=
\hbox{\itemfont{#1}}%
1012 \nobreak % This prevents a break before @itemx.
1014 % Be sure we are not still in the middle of a paragraph.
1018 % If the item text does not fit in the space we have, put it on a line
1019 % by itself, and do not allow a page break either before or after that
1020 % line. We do not start a paragraph here because then if the next
1021 % command is, e.g., @kindex, the whatsit would get put into the
1022 % horizontal list on a line by itself, resulting in extra blank space.
1023 \ifdim \wd0>
\itemmax
1024 \setbox0=
\hbox{\hskip \leftskip \hskip -
\tableindent \unhbox0}\box0
1027 % The item text fits into the space. Start a paragraph, so that the
1028 % following text (if any) will end up on the same line. Since that
1029 % text will be indented by \tableindent, we make the item text be in
1032 \rlap{\hskip -
\tableindent\box0}%
1037 \def\item{\errmessage{@item while not in a table
}}
1038 \def\itemx{\errmessage{@itemx while not in a table
}}
1039 \def\kitem{\errmessage{@kitem while not in a table
}}
1040 \def\kitemx{\errmessage{@kitemx while not in a table
}}
1041 \def\xitem{\errmessage{@xitem while not in a table
}}
1042 \def\xitemx{\errmessage{@xitemx while not in a table
}}
1044 %% Contains a kludge to get @end[description] to work
1045 \def\description{\tablez{\dontindex}{1}{}{}{}{}}
1047 \def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
1048 {\obeylines\obeyspaces%
1049 \gdef\tablex #1^^M
{%
1050 \tabley\dontindex#1 \endtabley}}
1052 \def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
1053 {\obeylines\obeyspaces%
1054 \gdef\ftablex #1^^M
{%
1055 \tabley\fnitemindex#1 \endtabley
1056 \def\Eftable{\endgraf\endgroup\afterenvbreak}%
1057 \let\Etable=
\relax}}
1059 \def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex}
1060 {\obeylines\obeyspaces%
1061 \gdef\vtablex #1^^M
{%
1062 \tabley\vritemindex#1 \endtabley
1063 \def\Evtable{\endgraf\endgroup\afterenvbreak}%
1064 \let\Etable=
\relax}}
1067 \def\fnitemindex #1{\doind {fn
}{\code{#1}}}%
1068 \def\vritemindex #1{\doind {vr
}{\code{#1}}}%
1071 \gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
1072 \tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
1074 \def\tablez #1#2#3#4#5#6{%
1077 \def\Edescription{\Etable}% Neccessary kludge.
1079 \ifnum 0#3>
0 \advance \leftskip by
#3\mil \fi %
1080 \ifnum 0#4>
0 \tableindent=
#4\mil \fi %
1081 \ifnum 0#5>
0 \advance \rightskip by
#5\mil \fi %
1083 \itemmax=
\tableindent %
1084 \advance \itemmax by -
\itemmargin %
1085 \advance \leftskip by
\tableindent %
1086 \exdentamount=
\tableindent
1088 \parskip =
\smallskipamount
1089 \ifdim \parskip=
0pt
\parskip=
2pt
\fi%
1090 \def\Etable{\endgraf\endgroup\afterenvbreak}%
1091 \let\item =
\internalBitem %
1092 \let\itemx =
\internalBitemx %
1093 \let\kitem =
\internalBkitem %
1094 \let\kitemx =
\internalBkitemx %
1095 \let\xitem =
\internalBxitem %
1096 \let\xitemx =
\internalBxitemx %
1099 % This is the counter used by @enumerate, which is really @itemize
1103 \def\itemize{\parsearg\itemizezzz}
1105 \def\itemizezzz #1{%
1106 \begingroup % ended by the @end itemsize
1107 \itemizey {#1}{\Eitemize}
1110 \def\itemizey #1#2{%
1112 \itemmax=
\itemindent %
1113 \advance \itemmax by -
\itemmargin %
1114 \advance \leftskip by
\itemindent %
1115 \exdentamount=
\itemindent
1117 \parskip =
\smallskipamount %
1118 \ifdim \parskip=
0pt
\parskip=
2pt
\fi%
1119 \def#2{\endgraf\endgroup\afterenvbreak}%
1120 \def\itemcontents{#1}%
1121 \let\item=
\itemizeitem}
1123 \def\bullet{$
\ptexbullet$
}
1126 % Set sfcode to normal for the chars that usually have another value.
1127 % These are `.?!:;,'
1128 \def\frenchspacing{\sfcode46=
1000 \sfcode63=
1000 \sfcode33=
1000
1129 \sfcode58=
1000 \sfcode59=
1000 \sfcode44=
1000 }
1131 % \splitoff TOKENS\endmark defines \first to be the first token in
1132 % TOKENS, and \rest to be the remainder.
1134 \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
1136 % Allow an optional argument of an uppercase letter, lowercase letter,
1137 % or number, to specify the first label in the enumerated list. No
1138 % argument is the same as `1'.
1140 \def\enumerate{\parsearg\enumeratezzz}
1141 \def\enumeratezzz #1{\enumeratey #1 \endenumeratey}
1142 \def\enumeratey #1 #2\endenumeratey{%
1143 \begingroup % ended by the @end enumerate
1145 % If we were given no argument, pretend we were given `1'.
1147 \ifx\thearg\empty \def\thearg{1}\fi
1149 % Detect if the argument is a single token. If so, it might be a
1150 % letter. Otherwise, the only valid thing it can be is a number.
1151 % (We will always have one token, because of the test we just made.
1152 % This is a good thing, since \splitoff doesn't work given nothing at
1153 % all -- the first parameter is undelimited.)
1154 \expandafter\splitoff\thearg\endmark
1156 % Only one token in the argument. It could still be anything.
1157 % A ``lowercase letter'' is one whose \lccode is nonzero.
1158 % An ``uppercase letter'' is one whose \lccode is both nonzero, and
1159 % not equal to itself.
1160 % Otherwise, we assume it's a number.
1162 % We need the \relax at the end of the \ifnum lines to stop TeX from
1163 % continuing to look for a <number>.
1165 \ifnum\lccode\expandafter`
\thearg=
0\relax
1166 \numericenumerate % a number (we hope)
1169 \ifnum\lccode\expandafter`
\thearg=
\expandafter`
\thearg\relax
1170 \lowercaseenumerate % lowercase letter
1172 \uppercaseenumerate % uppercase letter
1176 % Multiple tokens in the argument. We hope it's a number.
1181 % An @enumerate whose labels are integers. The starting integer is
1184 \def\numericenumerate{%
1186 \startenumeration{\the\itemno}%
1189 % The starting (lowercase) letter is in \thearg.
1190 \def\lowercaseenumerate{%
1191 \itemno =
\expandafter`
\thearg
1193 % Be sure we're not beyond the end of the alphabet.
1195 \errmessage{No more lowercase letters in @enumerate; get a bigger
1202 % The starting (uppercase) letter is in \thearg.
1203 \def\uppercaseenumerate{%
1204 \itemno =
\expandafter`
\thearg
1206 % Be sure we're not beyond the end of the alphabet.
1208 \errmessage{No more uppercase letters in @enumerate; get a bigger
1215 % Call itemizey, adding a period to the first argument and supplying the
1216 % common last two arguments. Also subtract one from the initial value in
1217 % \itemno, since @item increments \itemno.
1219 \def\startenumeration#1{%
1220 \advance\itemno by -
1
1221 \itemizey{#1.
}\Eenumerate\flushcr
1224 % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
1227 \def\alphaenumerate{\enumerate{a
}}
1228 \def\capsenumerate{\enumerate{A
}}
1229 \def\Ealphaenumerate{\Eenumerate}
1230 \def\Ecapsenumerate{\Eenumerate}
1232 % Definition of @item while inside @itemize.
1235 \advance\itemno by
1
1236 {\let\par=
\endgraf \smallbreak}%
1237 \ifhmode \errmessage{\in hmode at itemizeitem
}\fi
1238 {\parskip=
0in
\hskip 0pt
1239 \hbox to
0pt
{\hss \itemcontents\hskip \itemmargin}%
1240 \vadjust{\penalty 1200}}%
1244 % Index generation facilities
1246 % Define \newwrite to be identical to plain tex's \newwrite
1247 % except not \outer, so it can be used within \newindex.
1249 \gdef\newwrite{\alloc@
7\write\chardef\sixt@@n
}}
1251 % \newindex {foo} defines an index named foo.
1252 % It automatically defines \fooindex such that
1253 % \fooindex ...rest of line... puts an entry in the index foo.
1254 % It also defines \fooindfile to be the number of the output channel for
1255 % the file that accumulates this index. The file's extension is foo.
1256 % The name of an index should be no more than 2 characters long
1257 % for the sake of vms.
1260 \expandafter\newwrite \csname#1indfile
\endcsname% Define number for output file
1261 \openout \csname#1indfile
\endcsname \jobname.
#1 % Open the file
1262 \expandafter\xdef\csname#1index
\endcsname{% % Define \xxxindex
1263 \noexpand\doindex {#1}}
1266 % @defindex foo == \newindex{foo}
1268 \def\defindex{\parsearg\newindex}
1270 % Define @defcodeindex, like @defindex except put all entries in @code.
1272 \def\newcodeindex #1{
1273 \expandafter\newwrite \csname#1indfile
\endcsname% Define number for output file
1274 \openout \csname#1indfile
\endcsname \jobname.
#1 % Open the file
1275 \expandafter\xdef\csname#1index
\endcsname{% % Define \xxxindex
1276 \noexpand\docodeindex {#1}}
1279 \def\defcodeindex{\parsearg\newcodeindex}
1281 % @synindex foo bar makes index foo feed into index bar.
1282 % Do this instead of @defindex foo if you don't want it as a separate index.
1283 \def\synindex #1 #2 {%
1284 \expandafter\let\expandafter\synindexfoo\expandafter=
\csname#2indfile
\endcsname
1285 \expandafter\let\csname#1indfile
\endcsname=
\synindexfoo
1286 \expandafter\xdef\csname#1index
\endcsname{% % Define \xxxindex
1287 \noexpand\doindex {#2}}%
1290 % @syncodeindex foo bar similar, but put all entries made for index foo
1292 \def\syncodeindex #1 #2 {%
1293 \expandafter\let\expandafter\synindexfoo\expandafter=
\csname#2indfile
\endcsname
1294 \expandafter\let\csname#1indfile
\endcsname=
\synindexfoo
1295 \expandafter\xdef\csname#1index
\endcsname{% % Define \xxxindex
1296 \noexpand\docodeindex {#2}}%
1299 % Define \doindex, the driver for all \fooindex macros.
1300 % Argument #1 is generated by the calling \fooindex macro,
1301 % and it is "foo", the name of the index.
1303 % \doindex just uses \parsearg; it calls \doind for the actual work.
1304 % This is because \doind is more useful to call from other macros.
1306 % There is also \dosubind {index}{topic}{subtopic}
1307 % which makes an entry in a two-level index such as the operation index.
1309 \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
1310 \def\singleindexer #1{\doind{\indexname}{#1}}
1312 % like the previous two, but they put @code around the argument.
1313 \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
1314 \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
1317 \def\_{{\realbackslash _
}}%
1318 \def\w{\realbackslash w
}%
1319 \def\bf{\realbackslash bf
}%
1320 \def\rm{\realbackslash rm
}%
1321 \def\sl{\realbackslash sl
}%
1322 \def\sf{\realbackslash sf
}%
1323 \def\tt{\realbackslash tt
}%
1324 \def\gtr{\realbackslash gtr
}%
1325 \def\less{\realbackslash less
}%
1326 \def\hat{\realbackslash hat
}%
1327 \def\char{\realbackslash char
}%
1328 \def\TeX{\realbackslash TeX
}%
1329 \def\dots{\realbackslash dots
}%
1330 \def\copyright{\realbackslash copyright
}%
1331 \def\tclose#
#1{\realbackslash tclose
{#
#1}}%
1332 \def\code#
#1{\realbackslash code
{#
#1}}%
1333 \def\samp#
#1{\realbackslash samp
{#
#1}}%
1334 \def\t#
#1{\realbackslash r
{#
#1}}%
1335 \def\r#
#1{\realbackslash r
{#
#1}}%
1336 \def\i#
#1{\realbackslash i
{#
#1}}%
1337 \def\b#
#1{\realbackslash b
{#
#1}}%
1338 \def\cite#
#1{\realbackslash cite
{#
#1}}%
1339 \def\key#
#1{\realbackslash key
{#
#1}}%
1340 \def\file#
#1{\realbackslash file
{#
#1}}%
1341 \def\var#
#1{\realbackslash var
{#
#1}}%
1342 \def\kbd#
#1{\realbackslash kbd
{#
#1}}%
1345 % \indexnofonts no-ops all font-change commands.
1346 % This is used when outputting the strings to sort the index by.
1347 \def\indexdummyfont#1{#1}
1348 \def\indexdummytex{TeX
}
1349 \def\indexdummydots{...
}
1352 \let\w=
\indexdummyfont
1353 \let\t=
\indexdummyfont
1354 \let\r=
\indexdummyfont
1355 \let\i=
\indexdummyfont
1356 \let\b=
\indexdummyfont
1357 \let\emph=
\indexdummyfont
1358 \let\strong=
\indexdummyfont
1359 \let\cite=
\indexdummyfont
1360 \let\sc=
\indexdummyfont
1361 %Don't no-op \tt, since it isn't a user-level command
1362 % and is used in the definitions of the active chars like <, >, |...
1363 %\let\tt=\indexdummyfont
1364 \let\tclose=
\indexdummyfont
1365 \let\code=
\indexdummyfont
1366 \let\file=
\indexdummyfont
1367 \let\samp=
\indexdummyfont
1368 \let\kbd=
\indexdummyfont
1369 \let\key=
\indexdummyfont
1370 \let\var=
\indexdummyfont
1371 \let\TeX=
\indexdummytex
1372 \let\dots=
\indexdummydots
1375 % To define \realbackslash, we must make \ not be an escape.
1376 % We must first make another character (@) an escape
1377 % so we do not become unable to do a definition.
1379 {\catcode`\@=
0 \catcode`\\=
\other
1380 @gdef@realbackslash
{\
}}
1382 \let\indexbackslash=
0 %overridden during \printindex.
1385 {\count10=
\lastpenalty %
1386 {\indexdummies % Must do this here, since \bf, etc expand at this stage
1388 {\let\folio=
0% Expand all macros now EXCEPT \folio
1389 \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
1390 % so it will be output as is; and it will print as backslash in the indx.
1392 % Now process the index-string once, with all font commands turned off,
1393 % to get the string to sort the index by.
1397 % Now produce the complete index entry. We process the index-string again,
1398 % this time with font commands expanded, to get what to print in the index.
1400 \write \csname#1indfile
\endcsname{%
1401 \realbackslash entry
{\temp1}{\folio}{#2}}}%
1405 \def\dosubind #1#2#3{%
1406 {\count10=
\lastpenalty %
1407 {\indexdummies % Must do this here, since \bf, etc expand at this stage
1410 \def\rawbackslashxx{\indexbackslash}%
1412 % Now process the index-string once, with all font commands turned off,
1413 % to get the string to sort the index by.
1417 % Now produce the complete index entry. We process the index-string again,
1418 % this time with font commands expanded, to get what to print in the index.
1420 \write \csname#1indfile
\endcsname{%
1421 \realbackslash entry
{\temp1}{\folio}{#2}{#3}}}%
1425 % The index entry written in the file actually looks like
1426 % \entry {sortstring}{page}{topic}
1428 % \entry {sortstring}{page}{topic}{subtopic}
1429 % The texindex program reads in these files and writes files
1430 % containing these kinds of lines:
1432 % before the first topic whose initial is c
1433 % \entry {topic}{pagelist}
1434 % for a topic that is used without subtopics
1436 % for the beginning of a topic that is used with subtopics
1437 % \secondary {subtopic}{pagelist}
1438 % for each subtopic.
1440 % Define the user-accessible indexing commands
1441 % @findex, @vindex, @kindex, @cindex.
1443 \def\findex {\fnindex}
1444 \def\kindex {\kyindex}
1445 \def\cindex {\cpindex}
1446 \def\vindex {\vrindex}
1447 \def\tindex {\tpindex}
1448 \def\pindex {\pgindex}
1450 \def\cindexsub {\begingroup\obeylines\cindexsub}
1452 \gdef\cindexsub "
#1"
#2^^M
{\endgroup %
1453 \dosubind{cp
}{#2}{#1}}}
1455 % Define the macros used in formatting output of the sorted index material.
1457 % This is what you call to cause a particular index to get printed.
1459 % @unnumbered Function Index
1462 \def\printindex{\parsearg\doprintindex}
1464 \def\doprintindex#1{%
1466 \dobreak \chapheadingskip {10000}
1467 \catcode`\%=
\other\catcode`\&=
\other\catcode`\#=
\other
1468 \catcode`\$=
\other\catcode`
\_=
\other
1471 % The following don't help, since the chars were translated
1472 % when the raw index was written, and their fonts were discarded
1473 % due to \indexnofonts.
1474 %\catcode`\"=\active
1475 %\catcode`\^=\active
1476 %\catcode`\_=\active
1477 %\catcode`\|=\active
1478 %\catcode`\<=\active
1479 %\catcode`\>=\active
1481 \def\indexbackslash{\rawbackslashxx}
1482 \indexfonts\rm \tolerance=
9500 \advance\baselineskip -
1pt
1485 % See if the index file exists and is nonempty.
1486 \openin 1 \jobname.
#1s
1488 % \enddoublecolumns gets confused if there is no text in the index,
1489 % and it loses the chapter title and the aux file entries for the
1490 % index. The easiest way to prevent this problem is to make sure
1491 % there is some text.
1492 (Index is nonexistent)
1495 % If the index file exists but is empty, then \openin leaves \ifeof
1496 % false. We have to make TeX try to read something from the file, so
1497 % it can discover if there is anything in it.
1510 % These macros are used by the sorted index file itself.
1511 % Change them to control the appearance of the index.
1513 % Same as \bigskipamount except no shrink.
1514 % \balancecolumns gets confused if there is any shrink.
1515 \newskip\initialskipamount \initialskipamount 12pt plus4pt
1518 {\let\tentt=
\sectt \let\tt=
\sectt \let\sf=
\sectt
1519 \ifdim\lastskip<
\initialskipamount
1520 \removelastskip \penalty-
200 \vskip \initialskipamount\fi
1521 \line{\secbf#1\hfill}\kern 2pt
\penalty10000}}
1523 \def\entry #1#2{\begingroup
1524 \parfillskip=
0in
\parskip=
0in
\parindent=
0in
1526 % \hangindent is only relevant when the page number and the entry text
1527 % don't fit on one line. In that case, bob suggests starting the dots
1528 % pretty far over on the line.
1529 % \hangafter is reset to 1 at the start of each paragraph.
1530 \hangindent=
.75\hsize
1533 % Don't break the text of the index entry.
1536 % If we must, put the page number on a line of its own, and fill out
1537 % this line with blank space. (The \hfil is overwhelmed with the
1538 % fill leaders glue in \indexdotfill if the page number does fit.)
1540 \null\nobreak\indexdotfill % Have leaders before the page number.
1542 % The `\ ' here is removed by the implicit \unskip that TeX does as
1543 % part of (the primitive) \par. Without, a spurious underfull \hbox ensues.
1544 \
#2% The page number ends the paragraph.
1548 % Like \dotfill except takes at least 1 em.
1549 \def\indexdotfill{\cleaders
1550 \hbox{$
\mathsurround=
0pt
\mkern1.5mu .
\mkern1.5mu$
}\hskip 1em plus
1fill
}
1552 \def\primary #1{\line{#1\hfil}}
1554 \newskip\secondaryindent \secondaryindent=
0.5cm
1556 \def\secondary #1#2{
1557 {\parfillskip=
0in
\parskip=
0in
1558 \hangindent =
1in
\hangafter=
1
1559 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par
1562 %% Define two-column mode, which is used in indexes.
1563 %% Adapted from the TeXBook, page 416
1568 \newdimen\doublecolumnhsize \doublecolumnhsize =
3.11in
1569 \newdimen\doublecolumnvsize \doublecolumnvsize =
19.1in
1570 \newdimen\availdimen@
1572 \def\begindoublecolumns{\begingroup
1573 \output=
{\global\setbox\partialpage=
1574 \vbox{\unvbox255\kern -
\topskip \kern \baselineskip}}\eject
1575 \output=
{\doublecolumnout}%
1576 \hsize=
\doublecolumnhsize \vsize=
\doublecolumnvsize}
1577 \def\enddoublecolumns{\output=
{\balancecolumns}\eject
1578 \endgroup \pagegoal=
\vsize}
1580 \def\doublecolumnout{\splittopskip=
\topskip \splitmaxdepth=
\maxdepth
1581 \dimen@=
\pageheight \advance\dimen@ by-
\ht\partialpage
1582 \setbox0=
\vsplit255 to
\dimen@
\setbox2=
\vsplit255 to
\dimen@
1583 \onepageout\pagesofar \unvbox255 \penalty\outputpenalty}
1584 \def\pagesofar{\unvbox\partialpage %
1585 \hsize=
\doublecolumnhsize % have to restore this since output routine
1586 % changes it to set cropmarks (P. A. MacKay, 12 Nov. 1986)
1587 \wd0=
\hsize \wd2=
\hsize \hbox to
\pagewidth{\box0\hfil\box2}}
1588 \def\balancecolumns{%
1590 \setbox255=
\vbox{\unvbox255}
1592 \advance\dimen@ by
\topskip \advance\dimen@ by-
\baselineskip
1594 \availdimen@=
\pageheight \advance\availdimen@ by-
\ht\partialpage
1595 % If the remaining data is too big for one page,
1596 % output one page normally, then work with what remains.
1597 \ifdim \dimen@>
\availdimen@
1599 \splittopskip=
\topskip \splitmaxdepth=
\maxdepth
1600 \dimen@=
\pageheight \advance\dimen@ by-
\ht\partialpage
1601 \setbox0=
\vsplit255 to
\dimen@
\setbox2=
\vsplit255 to
\dimen@
1602 \onepageout\pagesofar
1604 % Recompute size of what remains, in case we just output some of it.
1606 \advance\dimen@ by
\topskip \advance\dimen@ by-
\baselineskip
1609 \setbox0=
\vbox{\unvbox255}
1610 \splittopskip=
\topskip
1611 {\vbadness=
10000 \loop \global\setbox3=
\copy0
1612 \global\setbox1=
\vsplit3 to
\dimen@
1613 \ifdim\ht3>
\dimen@
\global\advance\dimen@ by1pt
\repeat}
1614 \setbox0=
\vbox to
\dimen@
{\unvbox1} \setbox2=
\vbox to
\dimen@
{\unvbox3}
1618 \message{sectioning,
}
1619 % Define chapters, sections, etc.
1622 \newcount \secno \secno=
0
1623 \newcount \subsecno \subsecno=
0
1624 \newcount \subsubsecno \subsubsecno=
0
1626 % This counter is funny since it counts through charcodes of letters A, B, ...
1627 \newcount \appendixno \appendixno = `\@
1628 \def\appendixletter{\char\the\appendixno}
1630 \newwrite \contentsfile
1631 % This is called from \setfilename.
1632 \def\opencontents{\openout \contentsfile =
\jobname.toc
}
1634 % Each @chapter defines this as the name of the chapter.
1635 % page headings and footings can use it. @section does likewise
1637 \def\thischapter{} \def\thissection{}
1638 \def\seccheck#1{\if \pageno<
0 %
1639 \errmessage{@
#1 not allowed after generating table of contents
}\fi
1643 \def\chapternofonts{%
1644 \let\rawbackslash=
\relax%
1645 \let\frenchspacing=
\relax%
1646 \def\result{\realbackslash result
}
1647 \def\equiv{\realbackslash equiv
}
1648 \def\expansion{\realbackslash expansion
}
1649 \def\print{\realbackslash print
}
1650 \def\TeX{\realbackslash TeX
}
1651 \def\dots{\realbackslash dots
}
1652 \def\copyright{\realbackslash copyright
}
1653 \def\tt{\realbackslash tt
}
1654 \def\bf{\realbackslash bf
}
1655 \def\w{\realbackslash w
}
1656 \def\less{\realbackslash less
}
1657 \def\gtr{\realbackslash gtr
}
1658 \def\hat{\realbackslash hat
}
1659 \def\char{\realbackslash char
}
1660 \def\tclose#
#1{\realbackslash tclose
{#
#1}}
1661 \def\code#
#1{\realbackslash code
{#
#1}}
1662 \def\samp#
#1{\realbackslash samp
{#
#1}}
1663 \def\r#
#1{\realbackslash r
{#
#1}}
1664 \def\b#
#1{\realbackslash b
{#
#1}}
1665 \def\key#
#1{\realbackslash key
{#
#1}}
1666 \def\file#
#1{\realbackslash file
{#
#1}}
1667 \def\kbd#
#1{\realbackslash kbd
{#
#1}}
1668 % These are redefined because @smartitalic wouldn't work inside xdef.
1669 \def\i#
#1{\realbackslash i
{#
#1}}
1670 \def\cite#
#1{\realbackslash cite
{#
#1}}
1671 \def\var#
#1{\realbackslash var
{#
#1}}
1672 \def\emph#
#1{\realbackslash emph
{#
#1}}
1673 \def\dfn#
#1{\realbackslash dfn
{#
#1}}
1676 \def\thischaptername{No Chapter Title
}
1677 \outer\def\chapter{\parsearg\chapterzzz}
1678 \def\chapterzzz #1{\seccheck{chapter
}%
1679 \secno=
0 \subsecno=
0 \subsubsecno=
0
1680 \global\advance \chapno by
1 \message{Chapter
\the\chapno}%
1681 \chapmacro {#1}{\the\chapno}%
1682 \gdef\thissection{#1}%
1683 \gdef\thischaptername{#1}%
1684 % We don't substitute the actual chapter name into \thischapter
1685 % because we don't want its macros evaluated now.
1686 \xdef\thischapter{Chapter
\the\chapno:
\noexpand\thischaptername}%
1688 \edef\temp{{\realbackslash chapentry
{#1}{\the\chapno}{\noexpand\folio}}}%
1690 \write \contentsfile \temp %
1692 \global\let\section =
\numberedsec
1693 \global\let\subsection =
\numberedsubsec
1694 \global\let\subsubsection =
\numberedsubsubsec
1697 \outer\def\appendix{\parsearg\appendixzzz}
1698 \def\appendixzzz #1{\seccheck{appendix
}%
1699 \secno=
0 \subsecno=
0 \subsubsecno=
0
1700 \global\advance \appendixno by
1 \message{Appendix
\appendixletter}%
1701 \chapmacro {#1}{Appendix
\appendixletter}%
1702 \gdef\thissection{#1}%
1703 \gdef\thischaptername{#1}%
1704 \xdef\thischapter{Appendix
\appendixletter:
\noexpand\thischaptername}%
1706 \edef\temp{{\realbackslash chapentry
1707 {#1}{Appendix
\appendixletter}{\noexpand\folio}}}%
1709 \write \contentsfile \temp %
1711 \global\let\section =
\appendixsec
1712 \global\let\subsection =
\appendixsubsec
1713 \global\let\subsubsection =
\appendixsubsubsec
1716 \outer\def\top{\parsearg\unnumberedzzz}
1717 \outer\def\unnumbered{\parsearg\unnumberedzzz}
1718 \def\unnumberedzzz #1{\seccheck{unnumbered
}%
1719 \secno=
0 \subsecno=
0 \subsubsecno=
0 \message{(
#1)
}
1720 \unnumbchapmacro {#1}%
1721 \gdef\thischapter{#1}\gdef\thissection{#1}%
1723 \edef\temp{{\realbackslash unnumbchapentry
{#1}{\noexpand\folio}}}%
1725 \write \contentsfile \temp %
1727 \global\let\section =
\unnumberedsec
1728 \global\let\subsection =
\unnumberedsubsec
1729 \global\let\subsubsection =
\unnumberedsubsubsec
1732 \outer\def\numberedsec{\parsearg\seczzz}
1733 \def\seczzz #1{\seccheck{section
}%
1734 \subsecno=
0 \subsubsecno=
0 \global\advance \secno by
1 %
1735 \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
1737 \edef\temp{{\realbackslash secentry
%
1738 {#1}{\the\chapno}{\the\secno}{\noexpand\folio}}}%
1740 \write \contentsfile \temp %
1745 \outer\def\appendixsection{\parsearg\appendixsectionzzz}
1746 \outer\def\appendixsec{\parsearg\appendixsectionzzz}
1747 \def\appendixsectionzzz #1{\seccheck{appendixsection
}%
1748 \subsecno=
0 \subsubsecno=
0 \global\advance \secno by
1 %
1749 \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
1751 \edef\temp{{\realbackslash secentry
%
1752 {#1}{\appendixletter}{\the\secno}{\noexpand\folio}}}%
1754 \write \contentsfile \temp %
1759 \outer\def\unnumberedsec{\parsearg\unnumberedseczzz}
1760 \def\unnumberedseczzz #1{\seccheck{unnumberedsec
}%
1761 \plainsecheading {#1}\gdef\thissection{#1}%
1763 \edef\temp{{\realbackslash unnumbsecentry
{#1}{\noexpand\folio}}}%
1765 \write \contentsfile \temp %
1770 \outer\def\numberedsubsec{\parsearg\numberedsubseczzz}
1771 \def\numberedsubseczzz #1{\seccheck{subsection
}%
1772 \gdef\thissection{#1}\subsubsecno=
0 \global\advance \subsecno by
1 %
1773 \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
1775 \edef\temp{{\realbackslash subsecentry
%
1776 {#1}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
1778 \write \contentsfile \temp %
1783 \outer\def\appendixsubsec{\parsearg\appendixsubseczzz}
1784 \def\appendixsubseczzz #1{\seccheck{appendixsubsec
}%
1785 \gdef\thissection{#1}\subsubsecno=
0 \global\advance \subsecno by
1 %
1786 \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
1788 \edef\temp{{\realbackslash subsecentry
%
1789 {#1}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
1791 \write \contentsfile \temp %
1796 \outer\def\unnumberedsubsec{\parsearg\unnumberedsubseczzz}
1797 \def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec
}%
1798 \plainsecheading {#1}\gdef\thissection{#1}%
1800 \edef\temp{{\realbackslash unnumbsubsecentry
{#1}{\noexpand\folio}}}%
1802 \write \contentsfile \temp %
1807 \outer\def\numberedsubsubsec{\parsearg\numberedsubsubseczzz}
1808 \def\numberedsubsubseczzz #1{\seccheck{subsubsection
}%
1809 \gdef\thissection{#1}\global\advance \subsubsecno by
1 %
1810 \subsubsecheading {#1}
1811 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
1813 \edef\temp{{\realbackslash subsubsecentry
%
1815 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}
1816 {\noexpand\folio}}}%
1818 \write \contentsfile \temp %
1823 \outer\def\appendixsubsubsec{\parsearg\appendixsubsubseczzz}
1824 \def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec
}%
1825 \gdef\thissection{#1}\global\advance \subsubsecno by
1 %
1826 \subsubsecheading {#1}
1827 {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
1829 \edef\temp{{\realbackslash subsubsecentry
{#1}%
1831 {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}%
1833 \write \contentsfile \temp %
1838 \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
1839 \def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec
}%
1840 \plainsecheading {#1}\gdef\thissection{#1}%
1842 \edef\temp{{\realbackslash unnumbsubsubsecentry
{#1}{\noexpand\folio}}}%
1844 \write \contentsfile \temp %
1849 % These are variants which are not "outer", so they can appear in @ifinfo.
1850 % Actually, they should now be obsolete; ordinary section commands should work.
1851 \def\infotop{\parsearg\unnumberedzzz}
1852 \def\infounnumbered{\parsearg\unnumberedzzz}
1853 \def\infounnumberedsec{\parsearg\unnumberedseczzz}
1854 \def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz}
1855 \def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
1857 \def\infoappendix{\parsearg\appendixzzz}
1858 \def\infoappendixsec{\parsearg\appendixseczzz}
1859 \def\infoappendixsubsec{\parsearg\appendixsubseczzz}
1860 \def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz}
1862 \def\infochapter{\parsearg\chapterzzz}
1863 \def\infosection{\parsearg\sectionzzz}
1864 \def\infosubsection{\parsearg\subsectionzzz}
1865 \def\infosubsubsection{\parsearg\subsubsectionzzz}
1867 % These macros control what the section commands do, according
1868 % to what kind of chapter we are in (ordinary, appendix, or unnumbered).
1869 % Define them by default for a numbered chapter.
1870 \global\let\section =
\numberedsec
1871 \global\let\subsection =
\numberedsubsec
1872 \global\let\subsubsection =
\numberedsubsubsec
1874 % Define @majorheading, @heading and @subheading
1876 % NOTE on use of \vbox for chapter headings, section headings, and
1878 % 1) We use \vbox rather than the earlier \line to permit
1879 % overlong headings to fold.
1880 % 2) \hyphenpenalty is set to 10000 because hyphenation in a
1881 % heading is obnoxious; this forbids it.
1882 % 3) Likewise, headings look best if no \parindent is used, and
1883 % if justification is not attempted. Hence \raggedright.
1886 \def\majorheading{\parsearg\majorheadingzzz}
1887 \def\majorheadingzzz #1{%
1888 {\advance\chapheadingskip by
10pt
\chapbreak }%
1889 {\chapfonts \vbox{\hyphenpenalty=
10000\tolerance=
5000
1890 \parindent=
0pt
\raggedright
1891 \rm #1\hfill}}\bigskip \par\penalty 200}
1893 \def\chapheading{\parsearg\chapheadingzzz}
1894 \def\chapheadingzzz #1{\chapbreak %
1895 {\chapfonts \vbox{\hyphenpenalty=
10000\tolerance=
5000
1896 \parindent=
0pt
\raggedright
1897 \rm #1\hfill}}\bigskip \par\penalty 200}
1899 \def\heading{\parsearg\secheadingi}
1901 \def\subheading{\parsearg\subsecheadingi}
1903 \def\subsubheading{\parsearg\subsubsecheadingi}
1905 % These macros generate a chapter, section, etc. heading only
1906 % (including whitespace, linebreaking, etc. around it),
1907 % given all the information in convenient, parsed form.
1909 %%% Args are the skip and penalty (usually negative)
1910 \def\dobreak#1#2{\par\ifdim\lastskip<
#1\removelastskip\penalty#2\vskip#1\fi}
1912 \def\setchapterstyle #1 {\csname CHAPF
#1\endcsname}
1914 %%% Define plain chapter starts, and page on/off switching for it
1915 % Parameter controlling skip before chapter headings (if needed)
1917 \newskip \chapheadingskip \chapheadingskip =
30pt plus
8pt minus
4pt
1919 \def\chapbreak{\dobreak \chapheadingskip {-
4000}}
1920 \def\chappager{\par\vfill\supereject}
1921 \def\chapoddpage{\chappager \ifodd\pageno \else \hbox to
0pt
{} \chappager\fi}
1923 \def\setchapternewpage #1 {\csname CHAPPAG
#1\endcsname}
1926 \global\let\pchapsepmacro=
\chapbreak
1927 \global\let\pagealignmacro=
\chappager}
1930 \global\let\pchapsepmacro=
\chappager
1931 \global\let\pagealignmacro=
\chappager
1932 \global\def\HEADINGSon{\HEADINGSsingle}}
1935 \global\let\pchapsepmacro=
\chapoddpage
1936 \global\let\pagealignmacro=
\chapoddpage
1937 \global\def\HEADINGSon{\HEADINGSdouble}}
1942 \global\let\chapmacro=
\chfplain
1943 \global\let\unnumbchapmacro=
\unnchfplain}
1945 \def\chfplain #1#2{%
1948 \chapfonts \vbox{\hyphenpenalty=
10000\tolerance=
5000
1949 \parindent=
0pt
\raggedright
1956 \def\unnchfplain #1{%
1958 {\chapfonts \vbox{\hyphenpenalty=
10000\tolerance=
5000
1959 \parindent=
0pt
\raggedright
1960 \rm #1\hfill}}\bigskip \par\penalty 10000 %
1962 \CHAPFplain % The default
1964 \def\unnchfopen #1{%
1965 \chapoddpage {\chapfonts \vbox{\hyphenpenalty=
10000\tolerance=
5000
1966 \parindent=
0pt
\raggedright
1967 \rm #1\hfill}}\bigskip \par\penalty 10000 %
1970 \def\chfopen #1#2{\chapoddpage {\chapfonts
1971 \vbox to
3in
{\vfil \hbox to
\hsize{\hfil #2} \hbox to
\hsize{\hfil #1} \vfil}}%
1976 \global\let\chapmacro=
\chfopen
1977 \global\let\unnumbchapmacro=
\unnchfopen}
1979 % Parameter controlling skip before section headings.
1981 \newskip \subsecheadingskip \subsecheadingskip =
17pt plus
8pt minus
4pt
1982 \def\subsecheadingbreak{\dobreak \subsecheadingskip {-
500}}
1984 \newskip \secheadingskip \secheadingskip =
21pt plus
8pt minus
4pt
1985 \def\secheadingbreak{\dobreak \secheadingskip {-
1000}}
1987 % @paragraphindent is defined for the Info formatting commands only.
1988 \let\paragraphindent=
\comment
1990 % Section fonts are the base font at magstep2, which produces
1991 % a size a bit more than 14 points in the default situation.
1993 \def\secheading #1#2#3{\secheadingi {#2.
#3\enspace #1}}
1994 \def\plainsecheading #1{\secheadingi {#1}}
1995 \def\secheadingi #1{{\advance \secheadingskip by
\parskip %
1997 {\secfonts \vbox{\hyphenpenalty=
10000\tolerance=
5000
1998 \parindent=
0pt
\raggedright
2000 \ifdim \parskip<
10pt
\kern 10pt
\kern -
\parskip\fi \penalty 10000 }
2003 % Subsection fonts are the base font at magstep1,
2004 % which produces a size of 12 points.
2006 \def\subsecheading #1#2#3#4{\subsecheadingi {#2.
#3.
#4\enspace #1}}
2007 \def\subsecheadingi #1{{\advance \subsecheadingskip by
\parskip %
2008 \subsecheadingbreak}%
2009 {\subsecfonts \vbox{\hyphenpenalty=
10000\tolerance=
5000
2010 \parindent=
0pt
\raggedright
2012 \ifdim \parskip<
10pt
\kern 10pt
\kern -
\parskip\fi \penalty 10000 }
2014 \def\subsubsecfonts{\subsecfonts} % Maybe this should change:
2015 % Perhaps make sssec fonts scaled
2017 \def\subsubsecheading #1#2#3#4#5{\subsubsecheadingi {#2.
#3.
#4.
#5\enspace #1}}
2018 \def\subsubsecheadingi #1{{\advance \subsecheadingskip by
\parskip %
2019 \subsecheadingbreak}%
2020 {\subsubsecfonts \vbox{\hyphenpenalty=
10000\tolerance=
5000
2021 \parindent=
0pt
\raggedright
2023 \ifdim \parskip<
10pt
\kern 10pt
\kern -
\parskip\fi \penalty 10000}
2026 \message{toc printing,
}
2028 % Finish up the main text and prepare to read what we've written
2031 \newskip\contentsrightmargin \contentsrightmargin=
1in
2032 \def\startcontents#1{%
2034 \immediate\closeout \contentsfile
2036 \pageno = -
1 % Request roman numbered pages.
2038 % Don't need to put `Contents' or `Short Contents' in the headline.
2039 % It is abundantly clear what they are.
2040 \unnumbchapmacro{#1}\def\thischapter{}%
2041 \begingroup % Set up to handle contents files properly.
2042 \catcode`\\=
0 \catcode`\
{=
1 \catcode`\
}=
2 \catcode`\@=
11
2043 \raggedbottom % Worry more about breakpoints than the bottom.
2044 \advance\hsize by -
\contentsrightmargin % Don't use the full line length.
2048 % Normal (long) toc.
2049 \outer\def\contents{%
2050 \startcontents{Table of Contents
}%
2056 % And just the chapters.
2057 \outer\def\summarycontents{%
2058 \startcontents{Short Contents
}%
2060 \let\chapentry =
\shortchapentry
2061 \let\unnumbchapentry =
\shortunnumberedentry
2062 % We want a true roman here for the page numbers.
2064 \let\rm=
\shortcontrm \let\bf=
\shortcontbf \let\sl=
\shortcontsl
2066 \advance\baselineskip by
1pt
% Open it up a little.
2067 \def\secentry #
#1#
#2#
#3#
#4{}
2068 \def\unnumbsecentry #
#1#
#2{}
2069 \def\subsecentry #
#1#
#2#
#3#
#4#
#5{}
2070 \def\unnumbsubsecentry #
#1#
#2{}
2071 \def\subsubsecentry #
#1#
#2#
#3#
#4#
#5#
#6{}
2072 \def\unnumbsubsubsecentry #
#1#
#2{}
2077 \let\shortcontents =
\summarycontents
2079 % These macros generate individual entries in the table of contents.
2080 % The first argument is the chapter or section name.
2081 % The last argument is the page number.
2082 % The arguments in between are the chapter number, section number, ...
2084 % Chapter-level things, for both the long and short contents.
2085 \def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}
2087 % See comments in \dochapentry re vbox and related settings
2088 \def\shortchapentry#1#2#3{%
2089 \vbox{\hyphenpenalty=
10000\tolerance=
5000
2090 \parindent=
0pt
\strut\raggedright
2091 {#2\labelspace #1}\dotfill\doshortpageno{#3}}%
2094 \def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
2095 \def\shortunnumberedentry#1#2{%
2096 \vbox{\hyphenpenalty=
10000\tolerance=
5000
2097 \parindent=
0pt
\strut\raggedright
2098 #1\dotfill\doshortpageno{#2}}%
2102 \def\secentry#1#2#3#4{\dosecentry{#2.
#3\labelspace#1}{#4}}
2103 \def\unnumbsecentry#1#2{\dosecentry{#1}{#2}}
2106 \def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.
#3.
#4\labelspace#1}{#5}}
2107 \def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}}
2109 % And subsubsections.
2110 \def\subsubsecentry#1#2#3#4#5#6{%
2111 \dosubsubsecentry{#2.
#3.
#4.
#5\labelspace#1}{#6}}
2112 \def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}}
2115 % This parameter controls the indentation of the various levels.
2116 \newdimen\tocindent \tocindent =
3pc
2118 % Now for the actual typesetting. In all these, #1 is the text and #2 is the
2121 % If the toc has to be broken over pages, we would want to be at chapters
2122 % if at all possible; hence the \penalty.
2123 \def\dochapentry#1#2{%
2124 \penalty-
300 \vskip\baselineskip
2125 % This \vbox (and similar ones in dosecentry etc.) used to be a
2126 % \line; changed to permit linebreaks for long headings. See
2127 % comments above \majorheading. Here we also use \strut to
2128 % keep the top end of the vbox from jamming up against the previous
2129 % entry in the table of contents.
2130 \vbox{\chapentryfonts
2131 \hyphenpenalty=
10000\tolerance=
5000 % this line and next introduced
2132 \parindent=
0pt
\strut\raggedright % with \line -> \vbox change
2135 \nobreak\vskip .25\baselineskip
2138 \def\dosecentry#1#2{%
2139 \vbox{\secentryfonts \leftskip=
\tocindent
2140 \hyphenpenalty=
10000\tolerance=
5000
2141 \parindent=
0pt
\strut\raggedright #1\dotfill
2145 \def\dosubsecentry#1#2{%
2146 \vbox{\subsecentryfonts \leftskip=
2\tocindent
2147 \hyphenpenalty=
10000\tolerance=
5000
2148 \parindent=
0pt
\strut\raggedright #1\dotfill
2152 \def\dosubsubsecentry#1#2{%
2153 \vbox{\subsubsecentryfonts \leftskip=
3\tocindent
2154 \hyphenpenalty=
10000\tolerance=
5000
2155 \parindent=
0pt
\strut\raggedright #1\dotfill
2159 % Space between chapter (or whatever) number and the title.
2160 \def\labelspace{\hskip1em \relax}
2162 \def\dopageno#1{{\rm #1}}
2163 \def\doshortpageno#1{{\rm #1}}
2165 \def\chapentryfonts{\secfonts \rm}
2166 \def\secentryfonts{\textfonts}
2167 \let\subsecentryfonts =
\textfonts
2168 \let\subsubsecentryfonts =
\textfonts
2171 \message{environments,
}
2173 % Since these characters are used in examples, it should be an even number of
2174 % \tt widths. Each \tt character is 1en, so two makes it 1em.
2175 % Furthermore, these definitions must come after we define our fonts.
2176 \newbox\dblarrowbox \newbox\longdblarrowbox
2177 \newbox\pushcharbox \newbox\bullbox
2178 \newbox\equivbox \newbox\errorbox
2180 \let\ptexequiv =
\equiv
2183 %\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil}
2184 %\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil}
2185 %\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil}
2186 %\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil}
2187 % Adapted from the manmac format (p.420 of TeXbook)
2188 %\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex
2194 \def\result{\leavevmode\raise.15ex
\hbox to
1em
{\hfil$
\Rightarrow$
\hfil}}
2195 \def\expansion{\leavevmode\raise.1ex
\hbox to
1em
{\hfil$
\mapsto$
\hfil}}
2196 \def\print{\leavevmode\lower.1ex
\hbox to
1em
{\hfil$
\dashv$
\hfil}}
2198 \def\equiv{\leavevmode\lower.1ex
\hbox to
1em
{\hfil$
\ptexequiv$
\hfil}}
2200 % Adapted from the TeXbook's \boxit.
2201 {\tentt \global\dimen0 =
3em
}% Width of the box.
2202 \dimen2 =
.55pt
% Thickness of rules
2203 % The text. (`r' is open on the right, `e' somewhat less so on the left.)
2204 \setbox0 =
\hbox{\kern-
.75pt
\tensf error
\kern-
1.5pt
}
2206 \global\setbox\errorbox=
\hbox to
\dimen0{\hfil
2207 \hsize =
\dimen0 \advance\hsize by -
5.8pt
% Space to left+right.
2208 \advance\hsize by -
2\dimen2 % Rules.
2210 \hrule height
\dimen2
2211 \hbox{\vrule width
\dimen2 \kern3pt % Space to left of text.
2212 \vtop{\kern2.4pt
\box0 \kern2.4pt
}% Space above/below.
2213 \kern3pt\vrule width
\dimen2}% Space to right.
2214 \hrule height
\dimen2}
2217 % The @error{} command.
2218 \def\error{\leavevmode\lower.7ex
\copy\errorbox}
2220 % @tex ... @end tex escapes into raw Tex temporarily.
2221 % One exception: @ is still an escape character, so that @end tex works.
2222 % But \@ or @@ will get a plain tex @ character.
2224 \def\tex{\begingroup
2225 \catcode `\\=
0 \catcode `\
{=
1 \catcode `\
}=
2
2226 \catcode `\$=
3 \catcode `\&=
4 \catcode `\#=
6
2227 \catcode `\^=
7 \catcode `
\_=
8 \catcode `\~=
13 \let~=
\tie
2243 \let\bullet=
\ptexbullet
2244 \let\b=
\ptexb \let\c=
\ptexc \let\i=
\ptexi \let\t=
\ptext \let\l=
\ptexl
2247 \let\Etex=
\endgroup}
2249 % Define @lisp ... @endlisp.
2250 % @lisp does a \begingroup so it can rebind things,
2251 % including the definition of @endlisp (which normally is erroneous).
2253 % Amount to narrow the margins by for @lisp.
2254 \newskip\lispnarrowing \lispnarrowing=
0.4in
2256 % This is the definition that ^M gets inside @lisp
2257 % phr: changed space to \null, to avoid overfull hbox problems.
2259 \gdef\lisppar{\null\endgraf}}
2261 % Cause \obeyspaces to make each Space cause a word-separation
2262 % rather than the default which is that it acts punctuation.
2263 % This is because space in tt font looks funny.
2265 \gdef\sepspaces{\def {\
}}}
2267 \newskip\aboveenvskipamount \aboveenvskipamount=
0pt
2268 \def\aboveenvbreak{{\advance\aboveenvskipamount by
\parskip
2269 \endgraf \ifdim\lastskip<
\aboveenvskipamount
2270 \removelastskip \penalty-
50 \vskip\aboveenvskipamount \fi}}
2272 \def\afterenvbreak{\endgraf \ifdim\lastskip<
\aboveenvskipamount
2273 \removelastskip \penalty-
50 \vskip\aboveenvskipamount \fi}
2275 % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins.
2276 \let\nonarrowing=
\relax
2278 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2279 % \cartouche: draw rectangle w/rounded corners around argument
2280 \font\circle=lcircle10
2282 \newdimen\cartouter\newdimen\cartinner
2283 \newskip\normbskip\newskip\normpskip\newskip\normlskip
2284 \circthick=
\fontdimen8\circle
2286 \def\ctl{{\circle\char'
013\hskip -
6pt
}}% 6pt from pl file: 1/2charwidth
2287 \def\ctr{{\hskip 6pt
\circle\char'
010}}
2288 \def\cbl{{\circle\char'
012\hskip -
6pt
}}
2289 \def\cbr{{\hskip 6pt
\circle\char'
011}}
2290 \def\carttop{\hbox to
\cartouter{\hskip\lskip
2291 \ctl\leaders\hrule height
\circthick\hfil\ctr
2293 \def\cartbot{\hbox to
\cartouter{\hskip\lskip
2294 \cbl\leaders\hrule height
\circthick\hfil\cbr
2297 \newskip\lskip\newskip\rskip
2299 \long\def\cartouche{%
2301 \lskip=
\leftskip \rskip=
\rightskip
2302 \leftskip=
0pt
\rightskip=
0pt
%we want these *outside*.
2303 \cartinner=
\hsize \advance\cartinner by-
\lskip
2304 \advance\cartinner by-
\rskip
2306 \advance\cartouter by
18pt
% allow for 3pt kerns on either
2307 % side, and for 6pt waste from
2309 \normbskip=
\baselineskip \normpskip=
\parskip \normlskip=
\lineskip
2310 % Flag to tell @lisp, etc., not to narrow margin.
2311 \let\nonarrowing=
\comment
2313 \baselineskip=
0pt
\parskip=
0pt
\lineskip=
0pt
2322 \baselineskip=
\normbskip
2323 \lineskip=
\normlskip
2338 \def\lisp{\aboveenvbreak
2339 \begingroup\inENV % This group ends at the end of the @lisp body
2340 \hfuzz=
12truept
% Don't be fussy
2341 % Make spaces be word-separators rather than space tokens.
2343 % Single space lines
2345 % The following causes blank lines not to be ignored
2346 % by adding a space to the end of each line.
2348 \def\Elisp{\endgroup\afterenvbreak}%
2350 % @cartouche defines \nonarrowing to inhibit narrowing
2351 % at next level down.
2352 \ifx\nonarrowing\relax
2353 \advance \leftskip by
\lispnarrowing
2354 \exdentamount=
\lispnarrowing
2355 \let\exdent=
\nofillexdent
2356 \let\nonarrowing=
\relax
2359 \obeyspaces \obeylines \tt \rawbackslash
2360 \def\next#
#1{}\next}
2364 \def\Eexample{\Elisp}
2366 \let\smallexample=
\lisp
2367 \def\Esmallexample{\Elisp}
2369 % Macro for 9 pt. examples, necessary to print with 5" lines.
2370 % From Pavel@xerox. This is not really used unless the
2371 % @smallbook command is given.
2373 \def\smalllispx{\aboveenvbreak\begingroup\inENV
2374 % This group ends at the end of the @lisp body
2375 \hfuzz=
12truept
% Don't be fussy
2376 % Make spaces be word-separators rather than space tokens.
2378 % Single space lines
2380 % The following causes blank lines not to be ignored
2381 % by adding a space to the end of each line.
2383 \def\Esmalllisp{\endgroup\afterenvbreak}%
2384 %%%% Smaller baseline skip for small examples.
2387 % @cartouche defines \nonarrowing to inhibit narrowing
2388 % at next level down.
2389 \ifx\nonarrowing\relax
2390 \advance \leftskip by
\lispnarrowing
2391 \exdentamount=
\lispnarrowing
2392 \let\exdent=
\nofillexdent
2393 \let\nonarrowing=
\relax
2396 \obeyspaces \obeylines \ninett \indexfonts \rawbackslash
2397 \def\next#
#1{}\next}
2399 % This is @display; same as @lisp except use roman font.
2401 \def\display{\begingroup\inENV %This group ends at the end of the @display body
2403 % Make spaces be word-separators rather than space tokens.
2405 % Single space lines
2407 % The following causes blank lines not to be ignored
2408 % by adding a space to the end of each line.
2410 \def\Edisplay{\endgroup\afterenvbreak}%
2412 % @cartouche defines \nonarrowing to inhibit narrowing
2413 % at next level down.
2414 \ifx\nonarrowing\relax
2415 \advance \leftskip by
\lispnarrowing
2416 \exdentamount=
\lispnarrowing
2417 \let\exdent=
\nofillexdent
2418 \let\nonarrowing=
\relax
2421 \obeyspaces \obeylines
2422 \def\next#
#1{}\next}
2424 % This is @format; same as @lisp except use roman font and don't narrow margins
2426 \def\format{\begingroup\inENV %This group ends at the end of the @format body
2428 % Make spaces be word-separators rather than space tokens.
2431 % The following causes blank lines not to be ignored
2432 % by adding a space to the end of each line.
2434 \def\Eformat{\endgroup\afterenvbreak}
2435 \parskip=
0pt
\parindent=
0pt
2436 \obeyspaces \obeylines
2437 \def\next#
#1{}\next}
2439 % @flushleft and @flushright
2442 \begingroup\inENV %This group ends at the end of the @format body
2444 % Make spaces be word-separators rather than space tokens.
2446 % The following causes blank lines not to be ignored
2447 % by adding a space to the end of each line.
2448 % This also causes @ to work when the directive name
2449 % is terminated by end of line.
2451 \def\Eflushleft{\endgroup\afterenvbreak}%
2452 \parskip=
0pt
\parindent=
0pt
2453 \obeyspaces \obeylines
2454 \def\next#
#1{}\next}
2457 \begingroup\inENV %This group ends at the end of the @format body
2459 % Make spaces be word-separators rather than space tokens.
2461 % The following causes blank lines not to be ignored
2462 % by adding a space to the end of each line.
2463 % This also causes @ to work when the directive name
2464 % is terminated by end of line.
2466 \def\Eflushright{\endgroup\afterenvbreak}%
2467 \parskip=
0pt
\parindent=
0pt
2468 \advance \leftskip by
0pt plus
1fill
2469 \obeyspaces \obeylines
2470 \def\next#
#1{}\next}
2472 % @quotation - narrow the margins.
2475 \begingroup\inENV %This group ends at the end of the @quotation body
2476 {\parskip=
0pt
% because we will skip by \parskip too, later
2480 \def\Equotation{\par\endgroup\afterenvbreak}%
2481 % @cartouche defines \nonarrowing to inhibit narrowing
2482 % at next level down.
2483 \ifx\nonarrowing\relax
2484 \advance \leftskip by
\lispnarrowing
2485 \advance \rightskip by
\lispnarrowing
2486 \exdentamount=
\lispnarrowing
2487 \let\nonarrowing=
\relax
2491 % Define formatter for defuns
2492 % First, allow user to change definition object font (\df) internally
2493 \def\setdeffont #1 {\csname DEF
#1\endcsname}
2495 \newskip\defbodyindent \defbodyindent=
.4in
2496 \newskip\defargsindent \defargsindent=
50pt
2497 \newskip\deftypemargin \deftypemargin=
12pt
2498 \newskip\deflastargmargin \deflastargmargin=
18pt
2500 \newcount\parencount
2501 % define \functionparens, which makes ( and ) and & do special things.
2502 % \functionparens affects the group it is contained in.
2504 \catcode`\(=
\active \catcode`\)=
\active \catcode`\&=
\active
2505 \catcode`\
[=
\active \catcode`\
]=
\active}
2506 {\activeparens % Now, smart parens don't turn on until &foo (see \amprm)
2507 \gdef\functionparens{\boldbrax\let&=
\amprm\parencount=
0 }
2508 \gdef\boldbrax{\let(=
\opnr\let)=
\clnr\let[=
\lbrb\let]=
\rbrb}
2510 % Definitions of (, ) and & used in args for functions.
2511 % This is the definition of ( outside of all parentheses.
2512 \gdef\oprm#1 {{\rm\char`\(
}#1 \bf \let(=
\opnested %
2513 \global\advance\parencount by
1 }
2515 % This is the definition of ( when already inside a level of parens.
2516 \gdef\opnested{\char`\(
\global\advance\parencount by
1 }
2518 \gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
2519 % also in that case restore the outer-level definition of (.
2520 \ifnum \parencount=
1 {\rm \char `\)
}\sl \let(=
\oprm \else \char `\)
\fi
2521 \global\advance \parencount by -
1 }
2522 % If we encounter &foo, then turn on ()-hacking afterwards
2523 \gdef\amprm#1 {{\rm\&
#1}\let(=
\oprm \let)=
\clrm\
}
2525 \gdef\normalparens{\boldbrax\let&=
\ampnr}
2526 } % End of definition inside \activeparens
2527 %% These parens (in \boldbrax) actually are a little bolder than the
2528 %% contained text. This is especially needed for [ and ]
2529 \def\opnr{{\sf\char`\(
}} \def\clnr{{\sf\char`\)
}} \def\ampnr{\&
}
2530 \def\lbrb{{\bf\char`\
[}} \def\rbrb{{\bf\char`\
]}}
2532 % First, defname, which formats the header line itself.
2533 % #1 should be the function name.
2534 % #2 should be the type of definition, such as "Function".
2537 % Get the values of \leftskip and \rightskip as they were
2538 % outside the @def...
2540 \advance\dimen2 by -
\defbodyindent
2542 \advance\dimen3 by -
\defbodyindent
2544 \setbox0=
\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
2545 \dimen0=
\hsize \advance \dimen0 by -
\wd0 % compute size for first line
2546 \dimen1=
\hsize \advance \dimen1 by -
\defargsindent %size for continuations
2547 \parshape 2 0in
\dimen0 \defargsindent \dimen1 %
2548 % Now output arg 2 ("Function" or some such)
2549 % ending at \deftypemargin from the right margin,
2550 % but stuck inside a box of width 0 so it does not interfere with linebreaking
2551 {% Adjust \hsize to exclude the ambient margins,
2552 % so that \rightline will obey them.
2553 \advance \hsize by -
\dimen2 \advance \hsize by -
\dimen3
2554 \rlap{\rightline{{\rm #2}\hskip \deftypemargin}}}%
2555 % Make all lines underfull and no complaints:
2556 \tolerance=
10000 \hbadness=
10000
2557 \advance\leftskip by -
\defbodyindent
2558 \exdentamount=
\defbodyindent
2559 {\df #1}\enskip % Generate function name
2562 % Actually process the body of a definition
2563 % #1 should be the terminating control sequence, such as \Edefun.
2564 % #2 should be the "another name" control sequence, such as \defunx.
2565 % #3 should be the control sequence that actually processes the header,
2566 % such as \defunheader.
2568 \def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
2570 % Define the end token that this defining construct specifies
2571 % so that it will exit this group.
2572 \def#1{\endgraf\endgroup\medbreak}%
2573 \def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
2575 \advance\leftskip by
\defbodyindent \advance \rightskip by
\defbodyindent
2576 \exdentamount=
\defbodyindent
2578 \catcode 61=
\active %
2579 \obeylines\activeparens\spacesplit#3}
2581 \def\defmethparsebody #1#2#3#4 {\begingroup\inENV %
2583 % Define the end token that this defining construct specifies
2584 % so that it will exit this group.
2585 \def#1{\endgraf\endgroup\medbreak}%
2586 \def#2#
#1 {\begingroup\obeylines\activeparens\spacesplit{#3{#
#1}}}%
2588 \advance\leftskip by
\defbodyindent \advance \rightskip by
\defbodyindent
2589 \exdentamount=
\defbodyindent
2590 \begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
2592 \def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
2594 % Define the end token that this defining construct specifies
2595 % so that it will exit this group.
2596 \def#1{\endgraf\endgroup\medbreak}%
2597 \def#2#
#1 #
#2 {\def#4{#
#1}%
2598 \begingroup\obeylines\activeparens\spacesplit{#3{#
#2}}}%
2600 \advance\leftskip by
\defbodyindent \advance \rightskip by
\defbodyindent
2601 \exdentamount=
\defbodyindent
2602 \begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
2604 % These parsing functions are similar to the preceding ones
2605 % except that they do not make parens into active characters.
2606 % These are used for "variables" since they have no arguments.
2608 \def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
2610 % Define the end token that this defining construct specifies
2611 % so that it will exit this group.
2612 \def#1{\endgraf\endgroup\medbreak}%
2613 \def#2{\begingroup\obeylines\spacesplit#3}%
2615 \advance\leftskip by
\defbodyindent \advance \rightskip by
\defbodyindent
2616 \exdentamount=
\defbodyindent
2618 \catcode 61=
\active %
2619 \obeylines\spacesplit#3}
2621 \def\defvrparsebody #1#2#3#4 {\begingroup\inENV %
2623 % Define the end token that this defining construct specifies
2624 % so that it will exit this group.
2625 \def#1{\endgraf\endgroup\medbreak}%
2626 \def#2#
#1 {\begingroup\obeylines\spacesplit{#3{#
#1}}}%
2628 \advance\leftskip by
\defbodyindent \advance \rightskip by
\defbodyindent
2629 \exdentamount=
\defbodyindent
2630 \begingroup\obeylines\spacesplit{#3{#4}}}
2632 \def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV %
2634 % Define the end token that this defining construct specifies
2635 % so that it will exit this group.
2636 \def#1{\endgraf\endgroup\medbreak}%
2637 \def#2#
#1 #
#2 {\def#4{#
#1}%
2638 \begingroup\obeylines\spacesplit{#3{#
#2}}}%
2640 \advance\leftskip by
\defbodyindent \advance \rightskip by
\defbodyindent
2641 \exdentamount=
\defbodyindent
2642 \begingroup\obeylines\spacesplit{#3{#5}}}
2644 % Split up #2 at the first space token.
2645 % call #1 with two arguments:
2646 % the first is all of #2 before the space token,
2647 % the second is all of #2 after that space token.
2648 % If #2 contains no space token, all of it is passed as the first arg
2649 % and the second is passed as empty.
2652 \gdef\spacesplit#1#2^^M
{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}%
2653 \long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{%
2655 #1{#2}{}\else #1{#2}{#3#4}\fi}}
2657 % So much for the things common to all kinds of definitions.
2661 % First, define the processing that is wanted for arguments of \defun
2662 % Use this to expand the args and terminate the paragraph they make up
2664 \def\defunargs #1{\functionparens \sl
2665 % Expand, preventing hyphenation at `-' chars.
2666 % Note that groups don't affect changes in \hyphenchar.
2669 \hyphenchar\tensl=
45
2670 \ifnum\parencount=
0 \else \errmessage{unbalanced parens in @def arguments
}\fi%
2671 \interlinepenalty=
10000
2672 \advance\rightskip by
0pt plus
1fil
2673 \endgraf\penalty 10000\vskip -
\parskip\penalty 10000%
2676 \def\deftypefunargs #1{%
2677 % Expand, preventing hyphenation at `-' chars.
2678 % Note that groups don't affect changes in \hyphenchar.
2681 \interlinepenalty=
10000
2682 \advance\rightskip by
0pt plus
1fil
2683 \endgraf\penalty 10000\vskip -
\parskip\penalty 10000%
2686 % Do complete processing of one @defun or @defunx line already parsed.
2688 % @deffn Command forward-char nchars
2690 \def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader}
2692 \def\deffnheader #1#2#3{\doind {fn
}{\code{#2}}%
2693 \begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
2694 \catcode 61=
\other % Turn off change made in \defparsebody
2697 % @defun == @deffn Function
2699 \def\defun{\defparsebody\Edefun\defunx\defunheader}
2701 \def\defunheader #1#2{\doind {fn
}{\code{#1}}% Make entry in function index
2702 \begingroup\defname {#1}{Function
}%
2703 \defunargs {#2}\endgroup %
2704 \catcode 61=
\other % Turn off change made in \defparsebody
2707 % @deftypefun int foobar (int @var{foo}, float @var{bar})
2709 \def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader}
2711 % #1 is the data type. #2 is the name and args.
2712 \def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax}
2713 % #1 is the data type, #2 the name, #3 the args.
2714 \def\deftypefunheaderx #1#2 #3\relax{%
2715 \doind {fn
}{\code{#2}}% Make entry in function index
2716 \begingroup\defname {\code{#1} #2}{Function
}%
2717 \deftypefunargs {#3}\endgroup %
2718 \catcode 61=
\other % Turn off change made in \defparsebody
2721 % @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
2723 \def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
2725 % #1 is the classification. #2 is the data type. #3 is the name and args.
2726 \def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax}
2727 % #1 is the classification, #2 the data type, #3 the name, #4 the args.
2728 \def\deftypefnheaderx #1#2#3 #4\relax{%
2729 \doind {fn
}{\code{#3}}% Make entry in function index
2730 \begingroup\defname {\code{#2} #3}{#1}%
2731 \deftypefunargs {#4}\endgroup %
2732 \catcode 61=
\other % Turn off change made in \defparsebody
2735 % @defmac == @deffn Macro
2737 \def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
2739 \def\defmacheader #1#2{\doind {fn
}{\code{#1}}% Make entry in function index
2740 \begingroup\defname {#1}{Macro
}%
2741 \defunargs {#2}\endgroup %
2742 \catcode 61=
\other % Turn off change made in \defparsebody
2745 % @defspec == @deffn Special Form
2747 \def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
2749 \def\defspecheader #1#2{\doind {fn
}{\code{#1}}% Make entry in function index
2750 \begingroup\defname {#1}{Special Form
}%
2751 \defunargs {#2}\endgroup %
2752 \catcode 61=
\other % Turn off change made in \defparsebody
2755 % This definition is run if you use @defunx
2756 % anywhere other than immediately after a @defun or @defunx.
2758 \def\deffnx #1 {\errmessage{@deffnx in invalid context
}}
2759 \def\defunx #1 {\errmessage{@defunx in invalid context
}}
2760 \def\defmacx #1 {\errmessage{@defmacx in invalid context
}}
2761 \def\defspecx #1 {\errmessage{@defspecx in invalid context
}}
2762 \def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context
}}
2763 \def\deftypeunx #1 {\errmessage{@deftypeunx in invalid context
}}
2765 % @defmethod, and so on
2767 % @defop {Funny Method} foo-class frobnicate argument
2769 \def\defop #1 {\def\defoptype{#1}%
2770 \defopparsebody\Edefop\defopx\defopheader\defoptype}
2772 \def\defopheader #1#2#3{%
2773 \dosubind {fn
}{\code{#2}}{on
#1}% Make entry in function index
2774 \begingroup\defname {#2}{\defoptype{} on
#1}%
2775 \defunargs {#3}\endgroup %
2778 % @defmethod == @defop Method
2780 \def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
2782 \def\defmethodheader #1#2#3{%
2783 \dosubind {fn
}{\code{#2}}{on
#1}% entry in function index
2784 \begingroup\defname {#2}{Method on
#1}%
2785 \defunargs {#3}\endgroup %
2788 % @defcv {Class Option} foo-class foo-flag
2790 \def\defcv #1 {\def\defcvtype{#1}%
2791 \defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
2793 \def\defcvarheader #1#2#3{%
2794 \dosubind {vr
}{\code{#2}}{of
#1}% Make entry in var index
2795 \begingroup\defname {#2}{\defcvtype{} of
#1}%
2796 \defvarargs {#3}\endgroup %
2799 % @defivar == @defcv {Instance Variable}
2801 \def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
2803 \def\defivarheader #1#2#3{%
2804 \dosubind {vr
}{\code{#2}}{of
#1}% Make entry in var index
2805 \begingroup\defname {#2}{Instance Variable of
#1}%
2806 \defvarargs {#3}\endgroup %
2809 % These definitions are run if you use @defmethodx, etc.,
2810 % anywhere other than immediately after a @defmethod, etc.
2812 \def\defopx #1 {\errmessage{@defopx in invalid context
}}
2813 \def\defmethodx #1 {\errmessage{@defmethodx in invalid context
}}
2814 \def\defcvx #1 {\errmessage{@defcvx in invalid context
}}
2815 \def\defivarx #1 {\errmessage{@defivarx in invalid context
}}
2819 % First, define the processing that is wanted for arguments of @defvar.
2820 % This is actually simple: just print them in roman.
2821 % This must expand the args and terminate the paragraph they make up
2822 \def\defvarargs #1{\normalparens #1%
2823 \interlinepenalty=
10000
2824 \endgraf\penalty 10000\vskip -
\parskip\penalty 10000}
2826 % @defvr Counter foo-count
2828 \def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader}
2830 \def\defvrheader #1#2#3{\doind {vr
}{\code{#2}}%
2831 \begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup}
2833 % @defvar == @defvr Variable
2835 \def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader}
2837 \def\defvarheader #1#2{\doind {vr
}{\code{#1}}% Make entry in var index
2838 \begingroup\defname {#1}{Variable
}%
2839 \defvarargs {#2}\endgroup %
2842 % @defopt == @defvr {User Option}
2844 \def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader}
2846 \def\defoptheader #1#2{\doind {vr
}{\code{#1}}% Make entry in var index
2847 \begingroup\defname {#1}{User Option
}%
2848 \defvarargs {#2}\endgroup %
2851 % @deftypevar int foobar
2853 \def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader}
2855 % #1 is the data type. #2 is the name.
2856 \def\deftypevarheader #1#2{%
2857 \doind {vr
}{\code{#2}}% Make entry in variables index
2858 \begingroup\defname {\code{#1} #2}{Variable
}%
2859 \interlinepenalty=
10000
2860 \endgraf\penalty 10000\vskip -
\parskip\penalty 10000
2863 % @deftypevr {Global Flag} int enable
2865 \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
2867 \def\deftypevrheader #1#2#3{\doind {vr
}{\code{#3}}%
2868 \begingroup\defname {\code{#2} #3}{#1}
2869 \interlinepenalty=
10000
2870 \endgraf\penalty 10000\vskip -
\parskip\penalty 10000
2873 % This definition is run if you use @defvarx
2874 % anywhere other than immediately after a @defvar or @defvarx.
2876 \def\defvrx #1 {\errmessage{@defvrx in invalid context
}}
2877 \def\defvarx #1 {\errmessage{@defvarx in invalid context
}}
2878 \def\defoptx #1 {\errmessage{@defoptx in invalid context
}}
2879 \def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context
}}
2880 \def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context
}}
2883 % Args are printed in bold, a slight difference from @defvar.
2885 \def\deftpargs #1{\bf \defvarargs{#1}}
2887 % @deftp Class window height width ...
2889 \def\deftp{\defvrparsebody\Edeftp\deftpx\deftpheader}
2891 \def\deftpheader #1#2#3{\doind {tp
}{\code{#2}}%
2892 \begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
2894 % This definition is run if you use @deftpx, etc
2895 % anywhere other than immediately after a @deftp, etc.
2897 \def\deftpx #1 {\errmessage{@deftpx in invalid context
}}
2899 \message{cross reference,
}
2900 % Define cross-reference macros
2903 \newif\ifhavexrefs % True if xref values are known.
2904 \newif\ifwarnedxrefs % True if we warned once that they aren't known.
2906 % \setref{foo} defines a cross-reference point named foo.
2909 %\dosetq{#1-title}{Ytitle}%
2910 \dosetq{#1-pg
}{Ypagenumber
}%
2911 \dosetq{#1-snt
}{Ysectionnumberandtype
}}
2913 \def\unnumbsetref#1{%
2914 %\dosetq{#1-title}{Ytitle}%
2915 \dosetq{#1-pg
}{Ypagenumber
}%
2916 \dosetq{#1-snt
}{Ynothing
}}
2918 \def\appendixsetref#1{%
2919 %\dosetq{#1-title}{Ytitle}%
2920 \dosetq{#1-pg
}{Ypagenumber
}%
2921 \dosetq{#1-snt
}{Yappendixletterandtype
}}
2923 % \xref, \pxref, and \ref generate cross-references to specified points.
2924 % For \xrefX, #1 is the node name, #2 the name of the Info
2925 % cross-reference, #3 the printed node name, #4 the name of the Info
2926 % file, #5 the name of the printed manual. All but the node name can be
2929 \def\pxref#1{see
\xrefX[#1,,,,,,,
]}
2930 \def\xref#1{See
\xrefX[#1,,,,,,,
]}
2931 \def\ref#1{\xrefX[#1,,,,,,,
]}
2932 \def\xrefX[#1,
#2,
#3,
#4,
#5,
#6]{\begingroup%
2933 \def\printedmanual{\ignorespaces #5}%
2934 \def\printednodename{\ignorespaces #3}%
2936 \setbox1=
\hbox{\printedmanual}%
2937 \setbox0=
\hbox{\printednodename}%
2939 \def\printednodename{\ignorespaces #1}%
2940 %%% Uncommment the following line to make the actual chapter or section title
2941 %%% appear inside the square brackets.
2942 %\def\printednodename{#1-title}%
2946 % If we use \unhbox0 and \unhbox1 to print the node names, TeX does
2947 % not insert empty discretionaries after hyphens, which means that it
2948 % will not find a line break at a hyphen in a node names. Since some
2949 % manuals are best written with fairly long node names, containing
2950 % hyphens, this is a loss. Therefore, we simply give the text of
2951 % the node name again, so it is as if TeX is seeing it for the first
2954 section ``
\printednodename'' in
\cite{\printedmanual}%
2957 \refx{#1-snt
}{} [\printednodename], page
\tie\refx{#1-pg
}{}%
2961 % \dosetq is the interface for calls from other macros
2963 % Use \turnoffactive so that punctuation chars such as underscore
2964 % work in node names.
2965 \def\dosetq #1#2{{\let\folio=
0 \turnoffactive%
2966 \edef\next{\write\auxfile{\internalsetq {#1}{#2}}}%
2969 % \internalsetq {foo}{page} expands into
2970 % CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
2971 % When the aux file is read, ' is the escape character
2973 \def\internalsetq #1#2{'xrdef
{#1}{\csname #2\endcsname}}
2975 % Things to be expanded by \internalsetq
2977 \def\Ypagenumber{\folio}
2979 \def\Ytitle{\thischapter}
2983 \def\Ysectionnumberandtype{%
2984 \ifnum\secno=
0 Chapter
\xreftie\the\chapno %
2985 \else \ifnum \subsecno=
0 Section
\xreftie\the\chapno.
\the\secno %
2986 \else \ifnum \subsubsecno=
0 %
2987 Section
\xreftie\the\chapno.
\the\secno.
\the\subsecno %
2989 Section
\xreftie\the\chapno.
\the\secno.
\the\subsecno.
\the\subsubsecno %
2992 \def\Yappendixletterandtype{%
2993 \ifnum\secno=
0 Appendix
\xreftie'char
\the\appendixno{}%
2994 \else \ifnum \subsecno=
0 Section
\xreftie'char
\the\appendixno.
\the\secno %
2995 \else \ifnum \subsubsecno=
0 %
2996 Section
\xreftie'char
\the\appendixno.
\the\secno.
\the\subsecno %
2998 Section
\xreftie'char
\the\appendixno.
\the\secno.
\the\subsecno.
\the\subsubsecno %
3003 % Use TeX 3.0's \inputlineno to get the line number, for better error
3004 % messages, but if we're using an old version of TeX, don't do anything.
3006 \ifx\inputlineno\thisisundefined
3007 \let\linenumber =
\empty % Non-3.0.
3009 \def\linenumber{\the\inputlineno:
\space}
3012 % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
3013 % If its value is nonempty, SUFFIX is output afterward.
3016 \expandafter\ifx\csname X
#1\endcsname\relax
3017 % If not defined, say something at least.
3018 $
\langle$un\-de\-fined$
\rangle$
%
3020 \message{\linenumber Undefined cross reference `
#1'.
}%
3023 \global\warnedxrefstrue
3024 \message{Cross reference values unknown; you must run TeX again.
}%
3028 % It's defined, so just use it.
3029 \csname X
#1\endcsname
3031 #2% Output the suffix in any case.
3034 % Read the last existing aux file, if any. No error if none exists.
3036 % This is the macro invoked by entries in the aux file.
3038 {\catcode`\'=
\other\expandafter \gdef \csname X
#1\endcsname {#2}}}
3042 \catcode `\^^@=
\other
3043 \catcode `\
\ 1=
\other
3044 \catcode `\
\ 2=
\other
3045 \catcode `\^^C=
\other
3046 \catcode `\^^D=
\other
3047 \catcode `\^^E=
\other
3048 \catcode `\^^F=
\other
3049 \catcode `\^^G=
\other
3050 \catcode `\^^H=
\other
3051 \catcode `\
\v=
\other
3052 \catcode `\^^L=
\other
3053 \catcode `\
\ e=
\other
3054 \catcode `\
\ f=
\other
3055 \catcode `\
\10=
\other
3056 \catcode `\
\11=
\other
3057 \catcode `\
\12=
\other
3058 \catcode `\
\13=
\other
3059 \catcode `\
\14=
\other
3060 \catcode `\
\15=
\other
3061 \catcode `\
\16=
\other
3062 \catcode `\
\17=
\other
3063 \catcode `\
\18=
\other
3064 \catcode `\
\19=
\other
3066 \catcode `\^^
[=
\other
3067 \catcode `\^^\=
\other
3068 \catcode `\^^
]=
\other
3069 \catcode `\^^^=
\other
3070 \catcode `\^^_=
\other
3084 % the aux file uses ' as the escape.
3085 % Turn off \ as an escape so we do not lose on
3086 % entries which were dumped with control sequences in their names.
3087 % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
3088 % Reference to such entries still does not work the way one would wish,
3089 % but at least they do not bomb out when the aux file is read in.
3090 \catcode `\
{=
1 \catcode `\
}=
2
3094 \openin 1 \jobname.aux
3095 \ifeof 1 \else \closein 1 \input \jobname.aux
\global\havexrefstrue
3097 % Open the new aux file. Tex will close it automatically at exit.
3098 \openout \auxfile=
\jobname.aux
3104 \newcount \footnoteno
3106 % The trailing space in the following definition for supereject is
3107 % vital for proper filling; pages come out unaligned when you do a
3108 % pagealignmacro call if that space before the closing brace is
3110 \def\supereject{\par\penalty -
20000\footnoteno =
0 }
3112 % @footnotestyle is meaningful for info output only..
3113 \let\footnotestyle=
\comment
3115 \let\ptexfootnote=
\footnote
3118 \long\gdef\footnote #1{\global\advance \footnoteno by \@ne
3120 \edef\thisfootno{$^
{\the\footnoteno}$
}%
3122 \ifhmode\edef\@sf
{\spacefactor\the\spacefactor}\/
\fi
3123 \thisfootno\@sf
\footnotezzz{#1}}
3124 % \parsearg\footnotezzz}
3126 \long\gdef\footnotezzz #1{\insert\footins{
3127 \interlinepenalty\interfootnotelinepenalty
3128 \splittopskip\ht\strutbox % top baseline for broken footnotes
3129 \splitmaxdepth\dp\strutbox \floatingpenalty\@MM
3130 \leftskip\z@skip
\rightskip\z@skip
\spaceskip\z@skip
\xspaceskip\z@skip
3131 \footstrut\parindent=
\defaultparindent\hang\textindent{\thisfootno}#1\strut}}
3133 }%end \catcode `\@=11
3135 % End of control word definitions.
3137 \message{and turning on texinfo input format.
}
3148 % Set some numeric style parameters, for 8.5 x 11 format.
3151 \newdimen\defaultparindent \defaultparindent =
15pt
3152 \parindent =
\defaultparindent
3153 \parskip 18pt plus
1pt
3155 \advance\topskip by
1.2cm
3157 % Prevent underfull vbox error messages.
3160 % Following George Bush, just get rid of widows and orphans.
3164 % Use TeX 3.0's \emergencystretch to help line breaking, but if we're
3165 % using an old version of TeX, don't do anything. We want the amount of
3166 % stretch added to depend on the line length, hence the dependence on
3167 % \hsize. This makes it come to about 9pt for the 8.5x11 format.
3169 \ifx\emergencystretch\thisisundefined \else
3170 \emergencystretch =
\hsize
3171 \divide\emergencystretch by
45
3174 % Use @smallbook to reset parameters for 7x9.5 format (or else 7x9.25)
3176 \global\lispnarrowing =
0.3in
3177 \global\baselineskip 12pt
3178 \advance\topskip by -
1cm
3179 \global\parskip 3pt plus
1pt
3181 \global\doublecolumnhsize=
2.4in
\global\doublecolumnvsize=
15.0in
3183 \global\tolerance=
700
3185 \global\contentsrightmargin=
0pt
3187 \global\pagewidth=
\hsize
3188 \global\pageheight=
\vsize
3190 \global\let\smalllisp=
\smalllispx
3191 \global\let\smallexample=
\smalllispx
3192 \global\def\Esmallexample{\Esmalllisp}
3195 % Use @afourpaper to print on European A4 paper.
3197 \global\tolerance=
700
3199 \global\baselineskip=
12pt
3200 \global\parskip 15pt plus
1pt
3202 \global\vsize=
53\baselineskip
3203 \advance\vsize by
\topskip
3204 %\global\hsize= 5.85in % A4 wide 10pt
3205 \global\hsize=
6.5in
3206 \global\outerhsize=
\hsize
3207 \global\advance\outerhsize by
0.5in
3208 \global\outervsize=
\vsize
3209 \global\advance\outervsize by
0.6in
3210 \global\doublecolumnhsize=
\hsize
3211 \global\divide\doublecolumnhsize by
2
3212 \global\advance\doublecolumnhsize by -
0.1in
3213 \global\doublecolumnvsize=
\vsize
3214 \global\multiply\doublecolumnvsize by
2
3215 \global\advance\doublecolumnvsize by
0.1in
3217 \global\pagewidth=
\hsize
3218 \global\pageheight=
\vsize
3221 %% For a final copy, take out the rectangles
3222 %% that mark overfull boxes (in case you have decided
3223 %% that the text looks ok even though it passes the margin).
3224 \def\finalout{\overfullrule=
0pt
}
3226 % Define macros to output various characters with catcode for normal text.
3235 \def\normaldoublequote{"
}
3238 \def\normalunderscore{_
}
3239 \def\normalverticalbar{|
}
3241 \def\normalgreater{>
}
3244 % This macro is used to make a character print one way in ttfont
3245 % where it can probably just be output, and another way in other fonts,
3246 % where something hairier probably needs to be done.
3248 % #1 is what to print if we are indeed using \tt; #2 is what to print
3249 % otherwise. Since all the Computer Modern typewriter fonts have zero
3250 % interword stretch (and shrink), and it is reasonable to expect all
3251 % typewriter fonts to have this, we can check that font parameter.
3253 \def\ifusingtt#1#2{\ifdim \fontdimen3\the\font=
0pt
#1\else #2\fi}
3255 % Turn off all special characters except @
3256 % (and those which the user can use as if they were ordinary).
3257 % Most of these we simply print from the \tt font, but for some, we can
3258 % use math or other variants that look better in normal text.
3261 \def\activedoublequote{{\tt \char '
042}}
3262 \let"=
\activedoublequote
3264 \def~
{{\tt \char '
176}}
3270 \def_{\ifusingtt\normalunderscore\_}
3271 % Subroutine for the previous macro.
3272 \def\_{\lvvmode \kern.06em
\vbox{\hrule width
.3em height
.1ex
}}
3274 % \lvvmode is equivalent in function to \leavevmode.
3275 % Using \leavevmode runs into trouble when written out to
3276 % an index file due to the expansion of \leavevmode into ``\unhbox
3277 % \voidb@x'' ---which looks to TeX like ``\unhbox \voidb\x'' due to our
3278 % magic tricks with @.
3279 \def\lvvmode{\vbox to
0pt
{}}
3282 \def|
{{\tt \char '
174}}
3290 \def+
{{\tt \char 43}}
3291 %\catcode 27=\active
3292 %\def^^[{$\diamondsuit$}
3294 % Used sometimes to turn off (effectively) the active characters
3295 % even after parsing them.
3296 \def\turnoffactive{\let"=
\normaldoublequote
3299 \let_=
\normalunderscore
3300 \let|=
\normalverticalbar
3302 \let>=
\normalgreater
3305 % Set up an active definition for =, but don't enable it most of the time.
3306 {\catcode`\==
\active
3307 \global\def=
{{\tt \char 61}}}
3311 % \rawbackslashxx output one backslash character in current font
3312 \global\chardef\rawbackslashxx=`\\
3313 %{\catcode`\\=\other
3314 %@gdef@rawbackslashxx{\}}
3316 % \rawbackslash redefines \ as input to do \rawbackslashxx.
3317 {\catcode`\\=
\active
3318 @gdef@rawbackslash
{@let\=@rawbackslashxx
}}
3320 % \normalbackslash outputs one backslash in fixed width font.
3321 \def\normalbackslash{{\tt\rawbackslashxx}}
3323 % Say @foo, not \foo, in error messages.
3326 % \catcode 17=0 % Define control-q
3329 % If a .fmt file is being used, we don't want the `\input texinfo' to show up.
3330 % That is what \eatinput is for; after that, the `\' should revert to printing
3333 @gdef@eatinput input texinfo
{@fixbackslash
}
3334 @global@let\ = @eatinput
3336 % On the other hand, perhaps the file did not have a `\input texinfo'. Then
3337 % the first `\{ in the file would cause an error. This macro tries to fix
3338 % that, assuming it is called before the first `\' could plausibly occur.
3340 @gdef@fixbackslash
{@ifx\@eatinput @let\ = @normalbackslash @fi
}
3342 %% These look ok in all fonts, so just make them not special. The @rm below
3343 %% makes sure that the current font starts out as the newly loaded cmr10
3344 @catcode`@$=@other @catcode`@
%=@other @catcode`@&=@other @catcode`@#=@other
3350 @c page-delimiter: "^\\\
\message"