1 %% TeX macros to handle texinfo files
3 % Copyright (C) 1985, 1986, 1988, 1990, 1991 Free Software Foundation, Inc.
5 %This texinfo.tex file is free software; you can redistribute it and/or
6 %modify it under the terms of the GNU General Public License as
7 %published by the Free Software Foundation; either version 2, or (at
8 %your option) any later version.
10 %This texinfo.tex file is distributed in the hope that it will be
11 %useful, but WITHOUT ANY WARRANTY; without even the implied warranty
12 %of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 %General Public License for more details.
15 %You should have received a copy of the GNU General Public License
16 %along with this texinfo.tex file; see the file COPYING. If not, write
17 %to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139,
21 %In other words, you are welcome to use, share and improve this program.
22 %You are forbidden to forbid anyone else to use, share and improve
23 %what you give them. Help stamp out software-hoarding!
25 \def\texinfoversion{2.73}
26 \message{Loading texinfo package
[Version
\texinfoversion]:
}
29 % Print the version number if in a .fmt file.
30 \everyjob{\message{[Texinfo version
\texinfoversion]}\message{}}
32 % Save some parts of plain tex whose names we will redefine.
40 \let\ptexbullet=
\bullet
48 \def\tie{\penalty 10000\
} % Save plain tex definition of ~.
53 % If this character appears in an error message or help string, it
54 % starts a new line in the output.
57 \hyphenation{ap-pen-dix
}
58 \hyphenation{mini-buf-fer mini-buf-fers
}
61 % Margin to add to right of even pages, to left of odd pages.
62 \newdimen \bindingoffset \bindingoffset=
0pt
63 \newdimen \normaloffset \normaloffset=
\hoffset
64 \newdimen\pagewidth \newdimen\pageheight
65 \pagewidth=
\hsize \pageheight=
\vsize
67 % Sometimes it is convenient to have everything in the transcript file
68 % and nothing on the terminal. We don't just call \tracingall here,
69 % since that produces some useless output on the terminal.
71 \def\gloggingall{\begingroup \globaldefs =
1 \loggingall \endgroup}%
72 \def\loggingall{\tracingcommands2 \tracingstats2
73 \tracingpages1 \tracingoutput1 \tracinglostchars1
74 \tracingmacros2 \tracingparagraphs1 \tracingrestores1
75 \showboxbreadth\maxdimen\showboxdepth\maxdimen
78 %---------------------Begin change-----------------------
80 %%%% For @cropmarks command.
81 % Dimensions to add cropmarks at corners Added by P. A. MacKay, 12 Nov. 1986
83 \newdimen\cornerlong \newdimen\cornerthick
84 \newdimen \topandbottommargin
85 \newdimen \outerhsize \newdimen \outervsize
86 \cornerlong=
1pc
\cornerthick=
.3pt
% These set size of cropmarks
89 % Alternative @smallbook page size is 9.25in
91 \topandbottommargin=
.75in
93 %---------------------End change-----------------------
95 % \onepageout takes a vbox as an argument. Note that \pagecontents
96 % does insertions itself, but you have to call it yourself.
97 \chardef\PAGE=
255 \output=
{\onepageout{\pagecontents\PAGE}}
98 \def\onepageout#1{\hoffset=
\normaloffset
99 \ifodd\pageno \advance\hoffset by
\bindingoffset
100 \else \advance\hoffset by -
\bindingoffset\fi
101 {\escapechar=`\\
\relax % makes sure backslash is used in output files.
102 \shipout\vbox{{\let\hsize=
\pagewidth \makeheadline} \pagebody{#1}%
103 {\let\hsize=
\pagewidth \makefootline}}}%
104 \advancepageno \ifnum\outputpenalty>-
20000 \else\dosupereject\fi}
106 %%%% For @cropmarks command %%%%
108 % Here is a modification of the main output routine for Near East Publications
109 % This provides right-angle cropmarks at all four corners.
110 % The contents of the page are centerlined into the cropmarks,
111 % and any desired binding offset is added as an \hskip on either
112 % site of the centerlined box. (P. A. MacKay, 12 November, 1986)
114 \def\croppageout#1{\hoffset=
0pt
% make sure this doesn't mess things up
116 \vbox to
\outervsize{\hsize=
\outerhsize
117 \vbox{\line{\ewtop\hfill\ewtop}}
119 \line{\vbox{\moveleft\cornerthick\nstop}
121 \vbox{\moveright\cornerthick\nstop}}
122 \vskip \topandbottommargin
123 \centerline{\ifodd\pageno\hskip\bindingoffset\fi
125 {\let\hsize=
\pagewidth \makeheadline}
127 {\let\hsize=
\pagewidth \makefootline}}
128 \ifodd\pageno\else\hskip\bindingoffset\fi}
129 \vskip \topandbottommargin plus1fill minus1fill
130 \boxmaxdepth\cornerthick
131 \line{\vbox{\moveleft\cornerthick\nsbot}
133 \vbox{\moveright\cornerthick\nsbot}}
135 \vbox{\line{\ewbot\hfill\ewbot}}
138 \ifnum\outputpenalty>-
20000 \else\dosupereject\fi}
140 % Do @cropmarks to get crop marks
141 \def\cropmarks{\let\onepageout=
\croppageout }
143 \def\pagebody#1{\vbox to
\pageheight{\boxmaxdepth=
\maxdepth #1}}
145 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
146 \dimen@=
\dp#1 \unvbox#1
147 \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
148 \ifr@ggedbottom
\kern-
\dimen@
\vfil \fi}
152 % Here are the rules for the cropmarks. Note that they are
153 % offset so that the space between them is truly \outerhsize or \outervsize
154 % (P. A. MacKay, 12 November, 1986)
156 \def\ewtop{\vrule height
\cornerthick depth0pt width
\cornerlong}
158 {\hrule height
\cornerthick depth
\cornerlong width
\cornerthick}}
159 \def\ewbot{\vrule height0pt depth
\cornerthick width
\cornerlong}
161 {\hrule height
\cornerlong depth
\cornerthick width
\cornerthick}}
163 % Parse an argument, then pass it to #1.
164 % The argument can be delimited with [...] or with "..." or braces
165 % or it can be a whole line.
166 % #1 should be a macro which expects
167 % an ordinary undelimited TeX argument.
169 \def\parsearg #1{\let\next=
#1\begingroup\obeylines\futurelet\temp\parseargx}
172 \ifx \obeyedspace\temp \aftergroup\parseargdiscardspace \else%
173 \aftergroup \parseargline %
177 \gdef\parseargdiscardspace {\begingroup\obeylines\futurelet\temp\parseargx}}
179 \gdef\obeyedspace{\
}
181 \def\parseargline{\begingroup \obeylines \parsearglinex}
183 \gdef\parsearglinex #1^^M
{\endgroup \next {#1}}}
185 \def\flushcr{\ifx\par\lisppar \def\next#
#1{}\else \let\next=
\relax \fi \next}
187 %% These are used to keep @begin/@end levels from running away
188 %% Call \inENV within environments (after a \begingroup)
189 \newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
191 \ifENV\errmessage{Still within an environment. Type Return to continue.
}
192 \endgroup\fi} % This is not perfect, but it should reduce lossage
194 % @begin foo is the same as @foo, for now.
195 \newhelp\EMsimple{Type <Return> to continue
}
197 \outer\def\begin{\parsearg\beginxxx}
200 \expandafter\ifx\csname #1\endcsname\relax
201 {\errhelp=
\EMsimple \errmessage{Undefined command @begin
#1}}\else
202 \csname #1\endcsname\fi}
204 %% @end foo executes the definition of \Efoo.
205 %% foo can be delimited by doublequotes or brackets.
207 \def\end{\parsearg\endxxx}
210 \expandafter\ifx\csname E
#1\endcsname\relax
211 \expandafter\ifx\csname #1\endcsname\relax
212 \errmessage{Undefined command @end
#1}\else
214 \csname E
#1\endcsname}
216 {\errhelp=
\EMsimple \errmessage{@end
#1 not within
#1 environment
}}}
218 % Single-spacing is done by various environments.
220 \newskip\singlespaceskip \singlespaceskip =
\baselineskip
222 {\advance \baselineskip by -
\singlespaceskip
223 \kern \baselineskip}%
224 \baselineskip=
\singlespaceskip
227 %% Simple single-character @ commands
230 % Kludge this until the fonts are right (grr).
231 \def\@
{{\tt \char '
100}}
233 % Define @` and @' to be the same as ` and '
234 % but suppressing ligatures.
238 % Used to generate quoted braces.
240 \def\mylbrace {{\tt \char '
173}}
241 \def\myrbrace {{\tt \char '
175}}
245 % @: forces normal size whitespace following.
246 \def\:
{\spacefactor=
1000 }
248 % @* forces a line break.
249 \def\*
{\hfil\break\hbox{}\ignorespaces}
251 % @. is an end-of-sentence period.
252 \def\.
{.
\spacefactor=
3000 }
254 % @w prevents a word break. Without the \leavevmode, @w at the
255 % beginning of a paragraph, when TeX is still in vertical mode, would
256 % produce a whole line of output instead of starting the paragraph.
257 \def\w#1{\leavevmode\hbox{#1}}
259 % @group ... @end group forces ... to be all on one page, by enclosing
260 % it in a TeX vbox. We use \vtop instead of \vbox to construct the box
261 % to keep its height that of a normal line. According to the rules for
262 % \topskip (p.114 of the TeXbook), the glue inserted is
263 % max (\topskip - \ht (first item), 0). If that height is large,
264 % therefore, no glue is inserted, and the space between the headline and
265 % the text is small, which looks bad.
267 \def\group{\begingroup
268 \ifnum\catcode13=
\active \else
269 \errhelp =
\groupinvalidhelp
270 \errmessage{@group invalid in context where filling is enabled
}%
272 \def\Egroup{\egroup\endgroup}%
276 % TeX puts in an \escapechar (i.e., `@') at the beginning of the help
277 % message, so this ends up printing `@group can only ...'.
279 \newhelp\groupinvalidhelp{%
280 group can only be used in environments such as @example,^^J
%
281 where each line of input produces a line of output.
}
283 % @need space-in-mils
284 % forces a page break if there is not space-in-mils remaining.
286 \newdimen\mil \mil=
0.001in
288 \def\need{\parsearg\needx}
290 % Old definition--didn't work.
291 %\def\needx #1{\par %
292 %% This method tries to make TeX break the page naturally
293 %% if the depth of the box does not fit.
295 %\vtop to #1\mil{\vfil}\kern -#1\mil\penalty 10000
300 % Go into vertical mode, so we don't make a big box in the middle of a
304 % Don't add any leading before our big empty box, but allow a page
305 % break, since the best break might be right here.
308 \vtop to
#1\mil{\vfil}%
310 % TeX does not even consider page breaks if a penalty added to the
311 % main vertical list is 10000 or more. But in order to see if the
312 % empty box we just added fits on the page, we must make it consider
313 % page breaks. On the other hand, we don't want to actually break the
314 % page after the empty box. So we use a penalty of 9999.
316 % There is an extremely small chance that TeX will actually break the
317 % page at this \penalty, if there are no other feasible breakpoints in
318 % sight. (If the user is using lots of big @group commands, which
319 % almost-but-not-quite fill up a page, TeX will have a hard time doing
320 % good page breaking, for example.) However, I could not construct an
321 % example where a page broke at this \penalty; if it happens in a real
322 % document, then we can reconsider our strategy.
325 % Back up by the size of the box, whether we did a page break or not.
328 % Do not allow a page break right after this kern.
332 % @br forces paragraph break
336 % @dots{} output some dots
340 % @page forces the start of a new page
342 \def\page{\par\vfill\supereject}
345 % outputs text on separate line in roman font, starting at standard page margin
347 % This records the amount of indent in the innermost environment.
348 % That's how much \exdent should take out.
349 \newskip\exdentamount
351 % This defn is used inside fill environments such as @defun.
352 \def\exdent{\parsearg\exdentyyy}
353 \def\exdentyyy #1{{\hfil\break\hbox{\kern -
\exdentamount{\rm#1}}\hfil\break}}
355 % This defn is used inside nofill environments such as @example.
356 \def\nofillexdent{\parsearg\nofillexdentyyy}
357 \def\nofillexdentyyy #1{{\advance \leftskip by -
\exdentamount
358 \leftline{\hskip\leftskip{\rm#1}}}}
360 %\hbox{{\rm#1}}\hfil\break}}
362 % @include file insert text of that file as input.
364 \def\include{\parsearg\includezzz}
365 \def\includezzz #1{{\def\thisfile{#1}\input #1
370 % @center line outputs that line, centered
372 \def\center{\parsearg\centerzzz}
373 \def\centerzzz #1{{\advance\hsize by -
\leftskip
374 \advance\hsize by -
\rightskip
377 % @sp n outputs n lines of vertical space
379 \def\sp{\parsearg\spxxx}
380 \def\spxxx #1{\par \vskip #1\baselineskip}
382 % @comment ...line which is ignored...
383 % @c is the same as @comment
384 % @ignore ... @end ignore is another way to write a comment
386 \def\comment{\catcode 64=
\other \catcode 123=
\other \catcode 125=
\other%
387 \parsearg \commentxxx}
389 \def\commentxxx #1{\catcode 64=
0 \catcode 123=
1 \catcode 125=
2 }
393 % Prevent errors for section commands.
394 % Used in @ignore and in failing conditionals.
395 \def\ignoresections{%
397 \let\unnumbered=
\relax
399 \let\unnumberedsec=
\relax
400 \let\unnumberedsection=
\relax
401 \let\unnumberedsubsec=
\relax
402 \let\unnumberedsubsection=
\relax
403 \let\unnumberedsubsubsec=
\relax
404 \let\unnumberedsubsubsection=
\relax
407 \let\subsubsec=
\relax
408 \let\subsection=
\relax
409 \let\subsubsection=
\relax
411 \let\appendixsec=
\relax
412 \let\appendixsection=
\relax
413 \let\appendixsubsec=
\relax
414 \let\appendixsubsection=
\relax
415 \let\appendixsubsubsec=
\relax
416 \let\appendixsubsubsection=
\relax
418 \let\smallbook=
\relax
419 \let\titlepage=
\relax
422 \def\ignore{\begingroup\ignoresections
423 % Make sure that spaces turn into tokens that match what \ignorexxx wants.
426 \long\def\ignorexxx #1\end ignore
{\endgroup\ignorespaces}
428 \def\direntry{\begingroup\direntryxxx}
429 \long\def\direntryxxx #1\end direntry
{\endgroup\ignorespaces}
431 % Conditionals to test whether a flag is set.
433 \def\ifset{\begingroup\ignoresections\parsearg\ifsetxxx}
435 \def\ifsetxxx #1{\endgroup
436 \expandafter\ifx\csname IF
#1\endcsname\relax \let\temp=
\ifsetfail
437 \else \let\temp=
\relax \fi
440 \def\ifsetfail{\begingroup\ignoresections\ifsetfailxxx}
441 \long\def\ifsetfailxxx #1\end ifset
{\endgroup\ignorespaces}
443 \def\ifclear{\begingroup\ignoresections\parsearg\ifclearxxx}
445 \def\ifclearxxx #1{\endgroup
446 \expandafter\ifx\csname IF
#1\endcsname\relax \let\temp=
\relax
447 \else \let\temp=
\ifclearfail \fi
450 \def\ifclearfail{\begingroup\ignoresections\ifclearfailxxx}
451 \long\def\ifclearfailxxx #1\end ifclear
{\endgroup\ignorespaces}
453 % @set foo to set the flag named foo.
454 % @clear foo to clear the flag named foo.
455 \def\set{\parsearg\setxxx}
457 \expandafter\let\csname IF
#1\endcsname=
\set}
459 \def\clear{\parsearg\clearxxx}
461 \expandafter\let\csname IF
#1\endcsname=
\relax}
463 % Some texinfo constructs that are trivial in tex
467 \def\ifinfo{\begingroup\ignoresections\ifinfoxxx}
468 \long\def\ifinfoxxx #1\end ifinfo
{\endgroup\ignorespaces}
470 \long\def\menu #1\end menu
{}
473 % @math means output in math mode.
474 % We don't use $'s directly in the definition of \math because control
475 % sequences like \math are expanded when the toc file is written. Then,
476 % we read the toc file back, the $'s will be normal characters (as they
477 % should be, according to the definition of Texinfo). So we must use a
478 % control sequence to switch into and out of math mode.
480 % This isn't quite enough for @math to work properly in indices, but it
481 % seems unlikely it will ever be needed there.
483 \let\implicitmath = $
484 \def\math#1{\implicitmath #1\implicitmath}
486 \def\node{\ENVcheck\parsearg\nodezzz}
487 \def\nodezzz#1{\nodexxx [#1,
]}
488 \def\nodexxx[#1,
#2]{\gdef\lastnode{#1}}
491 \def\donoderef{\ifx\lastnode\relax\else
492 \expandafter\expandafter\expandafter\setref{\lastnode}\fi
493 \let\lastnode=
\relax}
495 \def\unnumbnoderef{\ifx\lastnode\relax\else
496 \expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi
497 \let\lastnode=
\relax}
499 \def\appendixnoderef{\ifx\lastnode\relax\else
500 \expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi
501 \let\lastnode=
\relax}
505 % @setfilename is done at the beginning of every texinfo file.
506 % So open here the files we need to have open while reading the input.
507 % This makes it possible to make a .fmt file for texinfo.
512 \fixbackslash % Turn off hack to swallow `\input texinfo'.
513 \global\let\setfilename=
\comment % Ignore extra @setfilename cmds.
514 \comment % Ignore the actual filename.
517 \outer\def\bye{\pagealignmacro\tracingstats=
1\ptexend}
519 \def\inforef #1{\inforefzzz #1,,,,**
}
520 \def\inforefzzz #1,
#2,
#3,
#4**
{See Info file
\file{\losespace#3{}},
521 node
\samp{\losespace#1{}}}
522 \def\losespace #1{#1}
526 % Font-change commands.
528 % Texinfo supports the sans serif font style, which plain TeX does not.
529 % So we set up a \sf analogous to plain's \rm, etc.
531 \def\sf{\fam=
\sffam \tensf}
532 \let\li =
\sf % Sometimes we call it \li, not \sf.
534 %% Try out Computer Modern fonts at \magstephalf
535 \let\mainmagstep=
\magstephalf
538 \let\mainmagstep=
\magstep1
542 \font\textrm=cmr10 scaled
\mainmagstep
543 \font\texttt=cmtt10 scaled
\mainmagstep
545 % Instead of cmb10, you many want to use cmbx10.
546 % cmbx10 is a prettier font on its own, but cmb10
547 % looks better when embedded in a line with cmr10.
548 \font\textbf=cmb10 scaled
\mainmagstep
549 \font\textit=cmti10 scaled
\mainmagstep
550 \font\textsl=cmsl10 scaled
\mainmagstep
551 \font\textsf=cmss10 scaled
\mainmagstep
552 \font\textsc=cmcsc10 scaled
\mainmagstep
553 \font\texti=cmmi10 scaled
\mainmagstep
554 \font\textsy=cmsy10 scaled
\mainmagstep
556 % A few fonts for @defun, etc.
557 \font\defbf=cmbx10 scaled
\magstep1 %was 1314
558 \font\deftt=cmtt10 scaled
\magstep1
559 \def\df{\let\tentt=
\deftt \let\tenbf =
\defbf \bf}
561 % Fonts for indices and small examples.
562 % We actually use the slanted font rather than the italic,
563 % because texinfo normally uses the slanted fonts for that.
564 % Do not make many font distinctions in general in the index, since they
565 % aren't very useful.
578 \font\chaprm=cmbx12 scaled
\magstep2
579 \font\chapit=cmti12 scaled
\magstep2
580 \font\chapsl=cmsl12 scaled
\magstep2
581 \font\chaptt=cmtt12 scaled
\magstep2
582 \font\chapsf=cmss12 scaled
\magstep2
584 \font\chapsc=cmcsc10 scaled
\magstep3
585 \font\chapi=cmmi12 scaled
\magstep2
586 \font\chapsy=cmsy10 scaled
\magstep3
588 \font\secrm=cmbx12 scaled
\magstep1
589 \font\secit=cmti12 scaled
\magstep1
590 \font\secsl=cmsl12 scaled
\magstep1
591 \font\sectt=cmtt12 scaled
\magstep1
592 \font\secsf=cmss12 scaled
\magstep1
593 \font\secbf=cmbx12 scaled
\magstep1
594 \font\secsc=cmcsc10 scaled
\magstep2
595 \font\seci=cmmi12 scaled
\magstep1
596 \font\secsy=cmsy10 scaled
\magstep2
598 % \font\ssecrm=cmbx10 scaled \magstep1 % This size an font looked bad.
599 % \font\ssecit=cmti10 scaled \magstep1 % The letters were too crowded.
600 % \font\ssecsl=cmsl10 scaled \magstep1
601 % \font\ssectt=cmtt10 scaled \magstep1
602 % \font\ssecsf=cmss10 scaled \magstep1
604 %\font\ssecrm=cmb10 scaled 1315 % Note the use of cmb rather than cmbx.
605 %\font\ssecit=cmti10 scaled 1315 % Also, the size is a little larger than
606 %\font\ssecsl=cmsl10 scaled 1315 % being scaled magstep1.
607 %\font\ssectt=cmtt10 scaled 1315
608 %\font\ssecsf=cmss10 scaled 1315
612 \font\ssecrm=cmbx12 scaled
\magstephalf
613 \font\ssecit=cmti12 scaled
\magstephalf
614 \font\ssecsl=cmsl12 scaled
\magstephalf
615 \font\ssectt=cmtt12 scaled
\magstephalf
616 \font\ssecsf=cmss12 scaled
\magstephalf
617 \font\ssecbf=cmbx12 scaled
\magstephalf
618 \font\ssecsc=cmcsc10 scaled
\magstep1
619 \font\sseci=cmmi12 scaled
\magstephalf
620 \font\ssecsy=cmsy10 scaled
\magstep1
621 % The smallcaps and symbol fonts should actually be scaled \magstep1.5,
622 % but that is not a standard magnification.
624 % Fonts for title page:
625 \font\titlerm = cmbx12 scaled
\magstep3
626 \let\authorrm =
\secrm
628 % In order for the font changes to affect most math symbols and letters,
629 % we have to define the \textfont of the standard families. Since
630 % texinfo doesn't allow for producing subscripts and superscripts, we
631 % don't bother to reset \scriptfont and \scriptscriptfont (which would
632 % also require loading a lot more fonts).
634 \def\resetmathfonts{%
635 \textfont0 =
\tenrm \textfont1 =
\teni \textfont2 =
\tensy
636 \textfont\itfam =
\tenit \textfont\slfam =
\tensl \textfont\bffam =
\tenbf
637 \textfont\ttfam =
\tentt \textfont\sffam =
\tensf
641 % The font-changing commands redefine the meanings of \tenSTYLE, instead
642 % of just \STYLE. We do this so that font changes will continue to work
643 % in math mode, where it is the current \fam that is relevant in most
644 % cases, not the current. Plain TeX does, for example,
645 % \def\bf{\fam=\bffam \tenbf} By redefining \tenbf, we obviate the need
646 % to redefine \bf itself.
648 \let\tenrm=
\textrm \let\tenit=
\textit \let\tensl=
\textsl
649 \let\tenbf=
\textbf \let\tentt=
\texttt \let\smallcaps=
\textsc
650 \let\tensf=
\textsf \let\teni=
\texti \let\tensy=
\textsy
653 \let\tenrm=
\chaprm \let\tenit=
\chapit \let\tensl=
\chapsl
654 \let\tenbf=
\chapbf \let\tentt=
\chaptt \let\smallcaps=
\chapsc
655 \let\tensf=
\chapsf \let\teni=
\chapi \let\tensy=
\chapsy
658 \let\tenrm=
\secrm \let\tenit=
\secit \let\tensl=
\secsl
659 \let\tenbf=
\secbf \let\tentt=
\sectt \let\smallcaps=
\secsc
660 \let\tensf=
\secsf \let\teni=
\seci \let\tensy=
\secsy
663 \let\tenrm=
\ssecrm \let\tenit=
\ssecit \let\tensl=
\ssecsl
664 \let\tenbf=
\ssecbf \let\tentt=
\ssectt \let\smallcaps=
\ssecsc
665 \let\tensf=
\ssecsf \let\teni=
\sseci \let\tensy=
\ssecsy
668 \let\tenrm=
\indrm \let\tenit=
\indit \let\tensl=
\indsl
669 \let\tenbf=
\indbf \let\tentt=
\indtt \let\smallcaps=
\indsc
670 \let\tensf=
\indsf \let\teni=
\indi \let\tensy=
\indsy
673 % Set up the default fonts, so we can use them for creating boxes.
677 % Count depth in font-changes, for error checks
678 \newcount\fontdepth \fontdepth=
0
680 % Fonts for short table of contents.
681 \font\shortcontrm=cmr12
682 \font\shortcontbf=cmbx12
683 \font\shortcontsl=cmsl12
685 %% Add scribe-like font environments, plus @l for inline lisp (usually sans
686 %% serif) and @ii for TeX italic
688 % \smartitalic{ARG} outputs arg in italics, followed by an italic correction
689 % unless the following character is such as not to need one.
690 \def\smartitalicx{\ifx\next,
\else\ifx\next-
\else\ifx\next.
\else\/
\fi\fi\fi}
691 \def\smartitalic#1{{\sl #1}\futurelet\next\smartitalicx}
694 \let\var=
\smartitalic
695 \let\dfn=
\smartitalic
696 \let\emph=
\smartitalic
697 \let\cite=
\smartitalic
702 \def\t#1{{\tt \exhyphenpenalty=
10000\rawbackslash \frenchspacing #1}\null}
704 %\def\samp #1{`{\tt \rawbackslash \frenchspacing #1}'\null}
705 \def\samp #1{`
\tclose{#1}'
\null}
706 \def\key #1{{\tt \exhyphenpenalty=
10000\uppercase{#1}}\null}
707 \def\ctrl #1{{\tt \rawbackslash \hat}#1}
711 % @code is a modification of @t,
712 % which makes spaces the same size as normal in the surrounding text.
715 \def\tclose#1{{\rm \tcloserm=
\fontdimen2\font \tt \tclosesave=
\fontdimen2\font
716 \fontdimen2\font=
\tcloserm
717 % prevent breaking lines at hyphens.
718 \exhyphenpenalty=
10000
719 \def\
{{\fontdimen2\font=
\tclosesave{} }}%
720 \rawbackslash \frenchspacing #1\fontdimen2\font=
\tclosesave}\null}
722 %\let\exp=\tclose %Was temporary
724 % @kbd is like @code, except that if the argument is just one @key command,
725 % then @kbd has no effect.
728 \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??
}%
729 \ifx\one\xkey\ifx\threex\three \key{#2}%
730 \else\tclose{\look}\fi
731 \else\tclose{\look}\fi}
733 % Typeset a dimension, e.g., `in' or `pt'. The only reason for the
734 % argument is to make the input look right: @dmn{pt} instead of
737 \def\dmn#1{\thinspace #1}
739 \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??
\par}
741 \def\l#1{{\li #1}\null} %
743 \def\r#1{{\rm #1}} % roman font
744 % Use of \lowercase was suggested.
745 \def\sc#1{{\smallcaps#1}} % smallcaps font
746 \def\ii#1{{\it #1}} % italic font
748 \message{page headings,
}
750 \newskip\titlepagetopglue \titlepagetopglue =
1.5in
751 \newskip\titlepagebottomglue \titlepagebottomglue =
2pc
753 % First the title page. Must do @settitle before @titlepage.
754 \def\titlefont#1{{\titlerm #1}}
756 \newtoks\realeverypar
758 \newif\iffinishedtitlepage
760 \def\titlepage{\begingroup \parindent=
0pt
\textfonts
761 \let\subtitlerm=
\tenrm
762 % I deinstalled the following change because \cmr12 is undefined.
763 % This change was not in the ChangeLog anyway. --rms.
764 % \let\subtitlerm=\cmr12
765 \def\subtitlefont{\subtitlerm \normalbaselineskip =
13pt
\normalbaselines}%
767 \def\authorfont{\authorrm \normalbaselineskip =
16pt
\normalbaselines}%
769 % Leave some space at the very top of the page.
770 \vglue\titlepagetopglue
772 % Now you can print the title using @title.
773 \def\title{\parsearg\titlezzz}%
774 \def\titlezzz#
#1{\leftline{\titlefont{#
#1}}
775 % print a rule at the page bottom also.
776 \finishedtitlepagefalse
777 \vskip4pt \hrule height
4pt
\vskip4pt}%
778 % No rule at page bottom unless we print one at the top with @title.
779 \finishedtitlepagetrue
781 % Now you can put text using @subtitle.
782 \def\subtitle{\parsearg\subtitlezzz}%
783 \def\subtitlezzz#
#1{{\subtitlefont \rightline{#
#1}}}%
785 % @author should come last, but may come many times.
786 \def\author{\parsearg\authorzzz}%
787 \def\authorzzz#
#1{\ifseenauthor\else\vskip 0pt plus
1filll
\seenauthortrue\fi
788 {\authorfont \leftline{#
#1}}}%
790 % Most title ``pages'' are actually two pages long, with space
791 % at the top of the second. We don't want the ragged left on the second.
794 \iffinishedtitlepage\else
800 % \def\page{\oldpage \hbox{}}
804 \iffinishedtitlepage\else
807 % It is important to do the page break before ending the group,
808 % because the headline and footline are only empty inside the group.
809 % If we use the new definition of \page, we always get a blank page
810 % after the title page, which we certainly don't want.
816 \def\finishtitlepage{%
817 \vskip4pt \hrule height
2pt
818 \vskip\titlepagebottomglue
819 \finishedtitlepagetrue
822 %%% Set up page headings and footings.
826 \newtoks \evenheadline % Token sequence for heading line of even pages
827 \newtoks \oddheadline % Token sequence for heading line of odd pages
828 \newtoks \evenfootline % Token sequence for footing line of even pages
829 \newtoks \oddfootline % Token sequence for footing line of odd pages
831 % Now make Tex use those variables
832 \headline=
{{\textfonts\rm \ifodd\pageno \the\oddheadline
833 \else \the\evenheadline \fi}}
834 \footline=
{{\textfonts\rm \ifodd\pageno \the\oddfootline
835 \else \the\evenfootline \fi}\HEADINGShook}
836 \let\HEADINGShook=
\relax
838 % Commands to set those variables.
839 % For example, this is what @headings on does
840 % @evenheading @thistitle|@thispage|@thischapter
841 % @oddheading @thischapter|@thispage|@thistitle
842 % @evenfooting @thisfile||
843 % @oddfooting ||@thisfile
845 \def\evenheading{\parsearg\evenheadingxxx}
846 \def\oddheading{\parsearg\oddheadingxxx}
847 \def\everyheading{\parsearg\everyheadingxxx}
849 \def\evenfooting{\parsearg\evenfootingxxx}
850 \def\oddfooting{\parsearg\oddfootingxxx}
851 \def\everyfooting{\parsearg\everyfootingxxx}
855 \gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|
\finish}
856 \gdef\evenheadingyyy #1@|
#2@|
#3@|
#4\finish{%
857 \global\evenheadline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
859 \gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|
\finish}
860 \gdef\oddheadingyyy #1@|
#2@|
#3@|
#4\finish{%
861 \global\oddheadline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
863 \gdef\everyheadingxxx #1{\everyheadingyyy #1@|@|@|@|
\finish}
864 \gdef\everyheadingyyy #1@|
#2@|
#3@|
#4\finish{%
865 \global\evenheadline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}
866 \global\oddheadline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
868 \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|
\finish}
869 \gdef\evenfootingyyy #1@|
#2@|
#3@|
#4\finish{%
870 \global\evenfootline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
872 \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|
\finish}
873 \gdef\oddfootingyyy #1@|
#2@|
#3@|
#4\finish{%
874 \global\oddfootline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
876 \gdef\everyfootingxxx #1{\everyfootingyyy #1@|@|@|@|
\finish}
877 \gdef\everyfootingyyy #1@|
#2@|
#3@|
#4\finish{%
878 \global\evenfootline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}
879 \global\oddfootline=
{\rlap{\centerline{#2}}\line{#1\hfil#3}}}
881 }% unbind the catcode of @.
883 % @headings double turns headings on for double-sided printing.
884 % @headings single turns headings on for single-sided printing.
885 % @headings off turns them off.
886 % @headings on same as @headings double, retained for compatibility.
887 % @headings after turns on double-sided headings after this page.
888 % @headings doubleafter turns on double-sided headings after this page.
889 % @headings singleafter turns on single-sided headings after this page.
890 % By default, they are off.
892 \def\headings #1 {\csname HEADINGS
#1\endcsname}
895 \global\evenheadline=
{\hfil} \global\evenfootline=
{\hfil}
896 \global\oddheadline=
{\hfil} \global\oddfootline=
{\hfil}}
898 % When we turn headings on, set the page number to 1.
899 % For double-sided printing, put current file name in lower left corner,
900 % chapter name on inside top of right hand pages, document
901 % title on inside top of left hand pages, and page numbers on outside top
906 \global\evenfootline=
{\hfil}
907 \global\oddfootline=
{\hfil}
908 \global\evenheadline=
{\line{\folio\hfil\thistitle}}
909 \global\oddheadline=
{\line{\thischapter\hfil\folio}}
911 % For single-sided printing, chapter title goes across top left of page,
912 % page number on top right.
916 \global\evenfootline=
{\hfil}
917 \global\oddfootline=
{\hfil}
918 \global\evenheadline=
{\line{\thischapter\hfil\folio}}
919 \global\oddheadline=
{\line{\thischapter\hfil\folio}}
921 \def\HEADINGSon{\HEADINGSdouble}
923 \def\HEADINGSafter{\let\HEADINGShook=
\HEADINGSdoublex}
924 \let\HEADINGSdoubleafter=
\HEADINGSafter
925 \def\HEADINGSdoublex{%
926 \global\evenfootline=
{\hfil}
927 \global\oddfootline=
{\hfil}
928 \global\evenheadline=
{\line{\folio\hfil\thistitle}}
929 \global\oddheadline=
{\line{\thischapter\hfil\folio}}
932 \def\HEADINGSsingleafter{\let\HEADINGShook=
\HEADINGSsinglex}
933 \def\HEADINGSsinglex{%
934 \global\evenfootline=
{\hfil}
935 \global\oddfootline=
{\hfil}
936 \global\evenheadline=
{\line{\thischapter\hfil\folio}}
937 \global\oddheadline=
{\line{\thischapter\hfil\folio}}
940 % Subroutines used in generating headings
941 % Produces Day Month Year style of output.
942 \def\today{\number\day\space
944 January
\or February
\or March
\or April
\or May
\or June
\or
945 July
\or August
\or September
\or October
\or November
\or December
\fi
948 % Use this if you want the Month Day, Year style of output.
949 %\def\today{\ifcase\month\or
950 %January\or February\or March\or April\or May\or June\or
951 %July\or August\or September\or October\or November\or December\fi
952 %\space\number\day, \number\year}
954 % @settitle line... specifies the title of the document, for headings
955 % It generates no output of its own
957 \def\thistitle{No Title
}
958 \def\settitle{\parsearg\settitlezzz}
959 \def\settitlezzz #1{\gdef\thistitle{#1}}
963 % @tabs -- simple alignment
965 % These don't work. For one thing, \+ is defined as outer.
966 % So these macros cannot even be defined.
968 %\def\tabs{\parsearg\tabszzz}
969 %\def\tabszzz #1{\settabs\+#1\cr}
970 %\def\tabline{\parsearg\tablinezzz}
971 %\def\tablinezzz #1{\+#1\cr}
974 % Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
976 % default indentation of table text
977 \newdimen\tableindent \tableindent=
.8in
978 % default indentation of @itemize and @enumerate text
979 \newdimen\itemindent \itemindent=
.3in
980 % margin between end of table item and start of table text.
981 \newdimen\itemmargin \itemmargin=
.1in
983 % used internally for \itemindent minus \itemmargin
986 % Note @table, @vtable, and @vtable define @item, @itemx, etc., with
988 % They also define \itemindex
989 % to index the item name in whatever manner is desired (perhaps none).
991 \def\internalBitem{\smallbreak \parsearg\itemzzz}
992 \def\internalBitemx{\par \parsearg\itemzzz}
994 \def\internalBxitem "
#1"
{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
995 \def\internalBxitemx "
#1"
{\def\xitemsubtopix{#1} \par \parsearg\xitemzzz}
997 \def\internalBkitem{\smallbreak \parsearg\kitemzzz}
998 \def\internalBkitemx{\par \parsearg\kitemzzz}
1000 \def\kitemzzz #1{\dosubind {kw
}{\code{#1}}{for
{\bf \lastfunction}}%
1003 \def\xitemzzz #1{\dosubind {kw
}{\code{#1}}{for
{\bf \xitemsubtopic}}%
1006 \def\itemzzz #1{\begingroup %
1007 \advance\hsize by -
\rightskip
1008 \advance\hsize by -
\tableindent
1009 \setbox0=
\hbox{\itemfont{#1}}%
1011 \nobreak % This prevents a break before @itemx.
1013 % Be sure we are not still in the middle of a paragraph.
1017 % If the item text does not fit in the space we have, put it on a line
1018 % by itself, and do not allow a page break either before or after that
1019 % line. We do not start a paragraph here because then if the next
1020 % command is, e.g., @kindex, the whatsit would get put into the
1021 % horizontal list on a line by itself, resulting in extra blank space.
1022 \ifdim \wd0>
\itemmax
1023 \setbox0=
\hbox{\hskip \leftskip \hskip -
\tableindent \unhbox0}\box0
1026 % The item text fits into the space. Start a paragraph, so that the
1027 % following text (if any) will end up on the same line. Since that
1028 % text will be indented by \tableindent, we make the item text be in
1031 \rlap{\hskip -
\tableindent\box0}%
1036 \def\item{\errmessage{@item while not in a table
}}
1037 \def\itemx{\errmessage{@itemx while not in a table
}}
1038 \def\kitem{\errmessage{@kitem while not in a table
}}
1039 \def\kitemx{\errmessage{@kitemx while not in a table
}}
1040 \def\xitem{\errmessage{@xitem while not in a table
}}
1041 \def\xitemx{\errmessage{@xitemx while not in a table
}}
1043 %% Contains a kludge to get @end[description] to work
1044 \def\description{\tablez{\dontindex}{1}{}{}{}{}}
1046 \def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
1047 {\obeylines\obeyspaces%
1048 \gdef\tablex #1^^M
{%
1049 \tabley\dontindex#1 \endtabley}}
1051 \def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
1052 {\obeylines\obeyspaces%
1053 \gdef\ftablex #1^^M
{%
1054 \tabley\fnitemindex#1 \endtabley
1055 \def\Eftable{\endgraf\endgroup\afterenvbreak}%
1056 \let\Etable=
\relax}}
1058 \def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex}
1059 {\obeylines\obeyspaces%
1060 \gdef\vtablex #1^^M
{%
1061 \tabley\vritemindex#1 \endtabley
1062 \def\Evtable{\endgraf\endgroup\afterenvbreak}%
1063 \let\Etable=
\relax}}
1066 \def\fnitemindex #1{\doind {fn
}{\code{#1}}}%
1067 \def\vritemindex #1{\doind {vr
}{\code{#1}}}%
1070 \gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
1071 \tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
1073 \def\tablez #1#2#3#4#5#6{%
1076 \def\Edescription{\Etable}% Neccessary kludge.
1078 \ifnum 0#3>
0 \advance \leftskip by
#3\mil \fi %
1079 \ifnum 0#4>
0 \tableindent=
#4\mil \fi %
1080 \ifnum 0#5>
0 \advance \rightskip by
#5\mil \fi %
1082 \itemmax=
\tableindent %
1083 \advance \itemmax by -
\itemmargin %
1084 \advance \leftskip by
\tableindent %
1085 \exdentamount=
\tableindent
1087 \parskip =
\smallskipamount
1088 \ifdim \parskip=
0pt
\parskip=
2pt
\fi%
1089 \def\Etable{\endgraf\endgroup\afterenvbreak}%
1090 \let\item =
\internalBitem %
1091 \let\itemx =
\internalBitemx %
1092 \let\kitem =
\internalBkitem %
1093 \let\kitemx =
\internalBkitemx %
1094 \let\xitem =
\internalBxitem %
1095 \let\xitemx =
\internalBxitemx %
1098 % This is the counter used by @enumerate, which is really @itemize
1102 \def\itemize{\parsearg\itemizezzz}
1104 \def\itemizezzz #1{%
1105 \begingroup % ended by the @end itemsize
1106 \itemizey {#1}{\Eitemize}
1109 \def\itemizey #1#2{%
1111 \itemmax=
\itemindent %
1112 \advance \itemmax by -
\itemmargin %
1113 \advance \leftskip by
\itemindent %
1114 \exdentamount=
\itemindent
1116 \parskip =
\smallskipamount %
1117 \ifdim \parskip=
0pt
\parskip=
2pt
\fi%
1118 \def#2{\endgraf\endgroup\afterenvbreak}%
1119 \def\itemcontents{#1}%
1120 \let\item=
\itemizeitem}
1122 \def\bullet{$
\ptexbullet$
}
1125 % Set sfcode to normal for the chars that usually have another value.
1126 % These are `.?!:;,'
1127 \def\frenchspacing{\sfcode46=
1000 \sfcode63=
1000 \sfcode33=
1000
1128 \sfcode58=
1000 \sfcode59=
1000 \sfcode44=
1000 }
1130 % \splitoff TOKENS\endmark defines \first to be the first token in
1131 % TOKENS, and \rest to be the remainder.
1133 \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
1135 % Allow an optional argument of an uppercase letter, lowercase letter,
1136 % or number, to specify the first label in the enumerated list. No
1137 % argument is the same as `1'.
1139 \def\enumerate{\parsearg\enumeratezzz}
1140 \def\enumeratezzz #1{\enumeratey #1 \endenumeratey}
1141 \def\enumeratey #1 #2\endenumeratey{%
1142 \begingroup % ended by the @end enumerate
1144 % If we were given no argument, pretend we were given `1'.
1146 \ifx\thearg\empty \def\thearg{1}\fi
1148 % Detect if the argument is a single token. If so, it might be a
1149 % letter. Otherwise, the only valid thing it can be is a number.
1150 % (We will always have one token, because of the test we just made.
1151 % This is a good thing, since \splitoff doesn't work given nothing at
1152 % all -- the first parameter is undelimited.)
1153 \expandafter\splitoff\thearg\endmark
1155 % Only one token in the argument. It could still be anything.
1156 % A ``lowercase letter'' is one whose \lccode is nonzero.
1157 % An ``uppercase letter'' is one whose \lccode is both nonzero, and
1158 % not equal to itself.
1159 % Otherwise, we assume it's a number.
1161 % We need the \relax at the end of the \ifnum lines to stop TeX from
1162 % continuing to look for a <number>.
1164 \ifnum\lccode\expandafter`
\thearg=
0\relax
1165 \numericenumerate % a number (we hope)
1168 \ifnum\lccode\expandafter`
\thearg=
\expandafter`
\thearg\relax
1169 \lowercaseenumerate % lowercase letter
1171 \uppercaseenumerate % uppercase letter
1175 % Multiple tokens in the argument. We hope it's a number.
1180 % An @enumerate whose labels are integers. The starting integer is
1183 \def\numericenumerate{%
1185 \startenumeration{\the\itemno}%
1188 % The starting (lowercase) letter is in \thearg.
1189 \def\lowercaseenumerate{%
1190 \itemno =
\expandafter`
\thearg
1192 % Be sure we're not beyond the end of the alphabet.
1194 \errmessage{No more lowercase letters in @enumerate; get a bigger
1201 % The starting (uppercase) letter is in \thearg.
1202 \def\uppercaseenumerate{%
1203 \itemno =
\expandafter`
\thearg
1205 % Be sure we're not beyond the end of the alphabet.
1207 \errmessage{No more uppercase letters in @enumerate; get a bigger
1214 % Call itemizey, adding a period to the first argument and supplying the
1215 % common last two arguments. Also subtract one from the initial value in
1216 % \itemno, since @item increments \itemno.
1218 \def\startenumeration#1{%
1219 \advance\itemno by -
1
1220 \itemizey{#1.
}\Eenumerate\flushcr
1223 % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
1226 \def\alphaenumerate{\enumerate{a
}}
1227 \def\capsenumerate{\enumerate{A
}}
1228 \def\Ealphaenumerate{\Eenumerate}
1229 \def\Ecapsenumerate{\Eenumerate}
1231 % Definition of @item while inside @itemize.
1234 \advance\itemno by
1
1235 {\let\par=
\endgraf \smallbreak}%
1236 \ifhmode \errmessage{\in hmode at itemizeitem
}\fi
1237 {\parskip=
0in
\hskip 0pt
1238 \hbox to
0pt
{\hss \itemcontents\hskip \itemmargin}%
1239 \vadjust{\penalty 1200}}%
1243 % Index generation facilities
1245 % Define \newwrite to be identical to plain tex's \newwrite
1246 % except not \outer, so it can be used within \newindex.
1248 \gdef\newwrite{\alloc@
7\write\chardef\sixt@@n
}}
1250 % \newindex {foo} defines an index named foo.
1251 % It automatically defines \fooindex such that
1252 % \fooindex ...rest of line... puts an entry in the index foo.
1253 % It also defines \fooindfile to be the number of the output channel for
1254 % the file that accumulates this index. The file's extension is foo.
1255 % The name of an index should be no more than 2 characters long
1256 % for the sake of vms.
1259 \expandafter\newwrite \csname#1indfile
\endcsname% Define number for output file
1260 \openout \csname#1indfile
\endcsname \jobname.
#1 % Open the file
1261 \expandafter\xdef\csname#1index
\endcsname{% % Define \xxxindex
1262 \noexpand\doindex {#1}}
1265 % @defindex foo == \newindex{foo}
1267 \def\defindex{\parsearg\newindex}
1269 % Define @defcodeindex, like @defindex except put all entries in @code.
1271 \def\newcodeindex #1{
1272 \expandafter\newwrite \csname#1indfile
\endcsname% Define number for output file
1273 \openout \csname#1indfile
\endcsname \jobname.
#1 % Open the file
1274 \expandafter\xdef\csname#1index
\endcsname{% % Define \xxxindex
1275 \noexpand\docodeindex {#1}}
1278 \def\defcodeindex{\parsearg\newcodeindex}
1280 % @synindex foo bar makes index foo feed into index bar.
1281 % Do this instead of @defindex foo if you don't want it as a separate index.
1282 \def\synindex #1 #2 {%
1283 \expandafter\let\expandafter\synindexfoo\expandafter=
\csname#2indfile
\endcsname
1284 \expandafter\let\csname#1indfile
\endcsname=
\synindexfoo
1285 \expandafter\xdef\csname#1index
\endcsname{% % Define \xxxindex
1286 \noexpand\doindex {#2}}%
1289 % @syncodeindex foo bar similar, but put all entries made for index foo
1291 \def\syncodeindex #1 #2 {%
1292 \expandafter\let\expandafter\synindexfoo\expandafter=
\csname#2indfile
\endcsname
1293 \expandafter\let\csname#1indfile
\endcsname=
\synindexfoo
1294 \expandafter\xdef\csname#1index
\endcsname{% % Define \xxxindex
1295 \noexpand\docodeindex {#2}}%
1298 % Define \doindex, the driver for all \fooindex macros.
1299 % Argument #1 is generated by the calling \fooindex macro,
1300 % and it is "foo", the name of the index.
1302 % \doindex just uses \parsearg; it calls \doind for the actual work.
1303 % This is because \doind is more useful to call from other macros.
1305 % There is also \dosubind {index}{topic}{subtopic}
1306 % which makes an entry in a two-level index such as the operation index.
1308 \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
1309 \def\singleindexer #1{\doind{\indexname}{#1}}
1311 % like the previous two, but they put @code around the argument.
1312 \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
1313 \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
1316 \def\_{{\realbackslash _
}}%
1317 \def\w{\realbackslash w
}%
1318 \def\bf{\realbackslash bf
}%
1319 \def\rm{\realbackslash rm
}%
1320 \def\sl{\realbackslash sl
}%
1321 \def\sf{\realbackslash sf
}%
1322 \def\tt{\realbackslash tt
}%
1323 \def\gtr{\realbackslash gtr
}%
1324 \def\less{\realbackslash less
}%
1325 \def\hat{\realbackslash hat
}%
1326 \def\char{\realbackslash char
}%
1327 \def\TeX{\realbackslash TeX
}%
1328 \def\dots{\realbackslash dots
}%
1329 \def\copyright{\realbackslash copyright
}%
1330 \def\tclose#
#1{\realbackslash tclose
{#
#1}}%
1331 \def\code#
#1{\realbackslash code
{#
#1}}%
1332 \def\samp#
#1{\realbackslash samp
{#
#1}}%
1333 \def\t#
#1{\realbackslash r
{#
#1}}%
1334 \def\r#
#1{\realbackslash r
{#
#1}}%
1335 \def\i#
#1{\realbackslash i
{#
#1}}%
1336 \def\b#
#1{\realbackslash b
{#
#1}}%
1337 \def\cite#
#1{\realbackslash cite
{#
#1}}%
1338 \def\key#
#1{\realbackslash key
{#
#1}}%
1339 \def\file#
#1{\realbackslash file
{#
#1}}%
1340 \def\var#
#1{\realbackslash var
{#
#1}}%
1341 \def\kbd#
#1{\realbackslash kbd
{#
#1}}%
1344 % \indexnofonts no-ops all font-change commands.
1345 % This is used when outputting the strings to sort the index by.
1346 \def\indexdummyfont#1{#1}
1347 \def\indexdummytex{TeX
}
1348 \def\indexdummydots{...
}
1351 \let\w=
\indexdummyfont
1352 \let\t=
\indexdummyfont
1353 \let\r=
\indexdummyfont
1354 \let\i=
\indexdummyfont
1355 \let\b=
\indexdummyfont
1356 \let\emph=
\indexdummyfont
1357 \let\strong=
\indexdummyfont
1358 \let\cite=
\indexdummyfont
1359 \let\sc=
\indexdummyfont
1360 %Don't no-op \tt, since it isn't a user-level command
1361 % and is used in the definitions of the active chars like <, >, |...
1362 %\let\tt=\indexdummyfont
1363 \let\tclose=
\indexdummyfont
1364 \let\code=
\indexdummyfont
1365 \let\file=
\indexdummyfont
1366 \let\samp=
\indexdummyfont
1367 \let\kbd=
\indexdummyfont
1368 \let\key=
\indexdummyfont
1369 \let\var=
\indexdummyfont
1370 \let\TeX=
\indexdummytex
1371 \let\dots=
\indexdummydots
1374 % To define \realbackslash, we must make \ not be an escape.
1375 % We must first make another character (@) an escape
1376 % so we do not become unable to do a definition.
1378 {\catcode`\@=
0 \catcode`\\=
\other
1379 @gdef@realbackslash
{\
}}
1381 \let\indexbackslash=
0 %overridden during \printindex.
1384 {\count10=
\lastpenalty %
1385 {\indexdummies % Must do this here, since \bf, etc expand at this stage
1387 {\let\folio=
0% Expand all macros now EXCEPT \folio
1388 \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
1389 % so it will be output as is; and it will print as backslash in the indx.
1391 % Now process the index-string once, with all font commands turned off,
1392 % to get the string to sort the index by.
1396 % Now produce the complete index entry. We process the index-string again,
1397 % this time with font commands expanded, to get what to print in the index.
1399 \write \csname#1indfile
\endcsname{%
1400 \realbackslash entry
{\temp1}{\folio}{#2}}}%
1404 \def\dosubind #1#2#3{%
1405 {\count10=
\lastpenalty %
1406 {\indexdummies % Must do this here, since \bf, etc expand at this stage
1409 \def\rawbackslashxx{\indexbackslash}%
1411 % Now process the index-string once, with all font commands turned off,
1412 % to get the string to sort the index by.
1416 % Now produce the complete index entry. We process the index-string again,
1417 % this time with font commands expanded, to get what to print in the index.
1419 \write \csname#1indfile
\endcsname{%
1420 \realbackslash entry
{\temp1}{\folio}{#2}{#3}}}%
1424 % The index entry written in the file actually looks like
1425 % \entry {sortstring}{page}{topic}
1427 % \entry {sortstring}{page}{topic}{subtopic}
1428 % The texindex program reads in these files and writes files
1429 % containing these kinds of lines:
1431 % before the first topic whose initial is c
1432 % \entry {topic}{pagelist}
1433 % for a topic that is used without subtopics
1435 % for the beginning of a topic that is used with subtopics
1436 % \secondary {subtopic}{pagelist}
1437 % for each subtopic.
1439 % Define the user-accessible indexing commands
1440 % @findex, @vindex, @kindex, @cindex.
1442 \def\findex {\fnindex}
1443 \def\kindex {\kyindex}
1444 \def\cindex {\cpindex}
1445 \def\vindex {\vrindex}
1446 \def\tindex {\tpindex}
1447 \def\pindex {\pgindex}
1449 \def\cindexsub {\begingroup\obeylines\cindexsub}
1451 \gdef\cindexsub "
#1"
#2^^M
{\endgroup %
1452 \dosubind{cp
}{#2}{#1}}}
1454 % Define the macros used in formatting output of the sorted index material.
1456 % This is what you call to cause a particular index to get printed.
1458 % @unnumbered Function Index
1461 \def\printindex{\parsearg\doprintindex}
1463 \def\doprintindex#1{%
1465 \dobreak \chapheadingskip {10000}
1466 \catcode`\%=
\other\catcode`\&=
\other\catcode`\#=
\other
1467 \catcode`\$=
\other\catcode`
\_=
\other
1470 % The following don't help, since the chars were translated
1471 % when the raw index was written, and their fonts were discarded
1472 % due to \indexnofonts.
1473 %\catcode`\"=\active
1474 %\catcode`\^=\active
1475 %\catcode`\_=\active
1476 %\catcode`\|=\active
1477 %\catcode`\<=\active
1478 %\catcode`\>=\active
1480 \def\indexbackslash{\rawbackslashxx}
1481 \indexfonts\rm \tolerance=
9500 \advance\baselineskip -
1pt
1484 % See if the index file exists and is nonempty.
1485 \openin 1 \jobname.
#1s
1487 % \enddoublecolumns gets confused if there is no text in the index,
1488 % and it loses the chapter title and the aux file entries for the
1489 % index. The easiest way to prevent this problem is to make sure
1490 % there is some text.
1491 (Index is nonexistent)
1494 % If the index file exists but is empty, then \openin leaves \ifeof
1495 % false. We have to make TeX try to read something from the file, so
1496 % it can discover if there is anything in it.
1509 % These macros are used by the sorted index file itself.
1510 % Change them to control the appearance of the index.
1512 % Same as \bigskipamount except no shrink.
1513 % \balancecolumns gets confused if there is any shrink.
1514 \newskip\initialskipamount \initialskipamount 12pt plus4pt
1517 {\let\tentt=
\sectt \let\tt=
\sectt \let\sf=
\sectt
1518 \ifdim\lastskip<
\initialskipamount
1519 \removelastskip \penalty-
200 \vskip \initialskipamount\fi
1520 \line{\secbf#1\hfill}\kern 2pt
\penalty10000}}
1522 \def\entry #1#2{\begingroup
1523 \parfillskip=
0in
\parskip=
0in
\parindent=
0in
1525 % \hangindent is only relevant when the page number and the entry text
1526 % don't fit on one line. In that case, bob suggests starting the dots
1527 % pretty far over on the line.
1528 % \hangafter is reset to 1 at the start of each paragraph.
1529 \hangindent=
.75\hsize
1532 % Don't break the text of the index entry.
1535 % If we must, put the page number on a line of its own, and fill out
1536 % this line with blank space. (The \hfil is overwhelmed with the
1537 % fill leaders glue in \indexdotfill if the page number does fit.)
1539 \null\nobreak\indexdotfill % Have leaders before the page number.
1541 % The `\ ' here is removed by the implicit \unskip that TeX does as
1542 % part of (the primitive) \par. Without, a spurious underfull \hbox ensues.
1543 \
#2% The page number ends the paragraph.
1547 % Like \dotfill except takes at least 1 em.
1548 \def\indexdotfill{\cleaders
1549 \hbox{$
\mathsurround=
0pt
\mkern1.5mu .
\mkern1.5mu$
}\hskip 1em plus
1fill
}
1551 \def\primary #1{\line{#1\hfil}}
1553 \newskip\secondaryindent \secondaryindent=
0.5cm
1555 \def\secondary #1#2{
1556 {\parfillskip=
0in
\parskip=
0in
1557 \hangindent =
1in
\hangafter=
1
1558 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par
1561 %% Define two-column mode, which is used in indexes.
1562 %% Adapted from the TeXBook, page 416
1567 \newdimen\doublecolumnhsize \doublecolumnhsize =
3.11in
1568 \newdimen\doublecolumnvsize \doublecolumnvsize =
19.1in
1569 \newdimen\availdimen@
1571 \def\begindoublecolumns{\begingroup
1572 \output=
{\global\setbox\partialpage=
1573 \vbox{\unvbox255\kern -
\topskip \kern \baselineskip}}\eject
1574 \output=
{\doublecolumnout}%
1575 \hsize=
\doublecolumnhsize \vsize=
\doublecolumnvsize}
1576 \def\enddoublecolumns{\output=
{\balancecolumns}\eject
1577 \endgroup \pagegoal=
\vsize}
1579 \def\doublecolumnout{\splittopskip=
\topskip \splitmaxdepth=
\maxdepth
1580 \dimen@=
\pageheight \advance\dimen@ by-
\ht\partialpage
1581 \setbox0=
\vsplit255 to
\dimen@
\setbox2=
\vsplit255 to
\dimen@
1582 \onepageout\pagesofar \unvbox255 \penalty\outputpenalty}
1583 \def\pagesofar{\unvbox\partialpage %
1584 \hsize=
\doublecolumnhsize % have to restore this since output routine
1585 % changes it to set cropmarks (P. A. MacKay, 12 Nov. 1986)
1586 \wd0=
\hsize \wd2=
\hsize \hbox to
\pagewidth{\box0\hfil\box2}}
1587 \def\balancecolumns{%
1589 \setbox255=
\vbox{\unvbox255}
1591 \advance\dimen@ by
\topskip \advance\dimen@ by-
\baselineskip
1593 \availdimen@=
\pageheight \advance\availdimen@ by-
\ht\partialpage
1594 % If the remaining data is too big for one page,
1595 % output one page normally, then work with what remains.
1596 \ifdim \dimen@>
\availdimen@
1598 \splittopskip=
\topskip \splitmaxdepth=
\maxdepth
1599 \dimen@=
\pageheight \advance\dimen@ by-
\ht\partialpage
1600 \setbox0=
\vsplit255 to
\dimen@
\setbox2=
\vsplit255 to
\dimen@
1601 \onepageout\pagesofar
1603 % Recompute size of what remains, in case we just output some of it.
1605 \advance\dimen@ by
\topskip \advance\dimen@ by-
\baselineskip
1608 \setbox0=
\vbox{\unvbox255}
1609 \splittopskip=
\topskip
1610 {\vbadness=
10000 \loop \global\setbox3=
\copy0
1611 \global\setbox1=
\vsplit3 to
\dimen@
1612 \ifdim\ht3>
\dimen@
\global\advance\dimen@ by1pt
\repeat}
1613 \setbox0=
\vbox to
\dimen@
{\unvbox1} \setbox2=
\vbox to
\dimen@
{\unvbox3}
1617 \message{sectioning,
}
1618 % Define chapters, sections, etc.
1621 \newcount \secno \secno=
0
1622 \newcount \subsecno \subsecno=
0
1623 \newcount \subsubsecno \subsubsecno=
0
1625 % This counter is funny since it counts through charcodes of letters A, B, ...
1626 \newcount \appendixno \appendixno = `\@
1627 \def\appendixletter{\char\the\appendixno}
1629 \newwrite \contentsfile
1630 % This is called from \setfilename.
1631 \def\opencontents{\openout \contentsfile =
\jobname.toc
}
1633 % Each @chapter defines this as the name of the chapter.
1634 % page headings and footings can use it. @section does likewise
1636 \def\thischapter{} \def\thissection{}
1637 \def\seccheck#1{\if \pageno<
0 %
1638 \errmessage{@
#1 not allowed after generating table of contents
}\fi
1642 \def\chapternofonts{%
1643 \let\rawbackslash=
\relax%
1644 \let\frenchspacing=
\relax%
1645 \def\result{\realbackslash result
}
1646 \def\equiv{\realbackslash equiv
}
1647 \def\expansion{\realbackslash expansion
}
1648 \def\print{\realbackslash print
}
1649 \def\TeX{\realbackslash TeX
}
1650 \def\dots{\realbackslash dots
}
1651 \def\copyright{\realbackslash copyright
}
1652 \def\tt{\realbackslash tt
}
1653 \def\bf{\realbackslash bf
}
1654 \def\w{\realbackslash w
}
1655 \def\less{\realbackslash less
}
1656 \def\gtr{\realbackslash gtr
}
1657 \def\hat{\realbackslash hat
}
1658 \def\char{\realbackslash char
}
1659 \def\tclose#
#1{\realbackslash tclose
{#
#1}}
1660 \def\code#
#1{\realbackslash code
{#
#1}}
1661 \def\samp#
#1{\realbackslash samp
{#
#1}}
1662 \def\r#
#1{\realbackslash r
{#
#1}}
1663 \def\b#
#1{\realbackslash b
{#
#1}}
1664 \def\key#
#1{\realbackslash key
{#
#1}}
1665 \def\file#
#1{\realbackslash file
{#
#1}}
1666 \def\kbd#
#1{\realbackslash kbd
{#
#1}}
1667 % These are redefined because @smartitalic wouldn't work inside xdef.
1668 \def\i#
#1{\realbackslash i
{#
#1}}
1669 \def\cite#
#1{\realbackslash cite
{#
#1}}
1670 \def\var#
#1{\realbackslash var
{#
#1}}
1671 \def\emph#
#1{\realbackslash emph
{#
#1}}
1672 \def\dfn#
#1{\realbackslash dfn
{#
#1}}
1675 \def\thischaptername{No Chapter Title
}
1676 \outer\def\chapter{\parsearg\chapterzzz}
1677 \def\chapterzzz #1{\seccheck{chapter
}%
1678 \secno=
0 \subsecno=
0 \subsubsecno=
0
1679 \global\advance \chapno by
1 \message{Chapter
\the\chapno}%
1680 \chapmacro {#1}{\the\chapno}%
1681 \gdef\thissection{#1}%
1682 \gdef\thischaptername{#1}%
1683 % We don't substitute the actual chapter name into \thischapter
1684 % because we don't want its macros evaluated now.
1685 \xdef\thischapter{Chapter
\the\chapno:
\noexpand\thischaptername}%
1687 \edef\temp{{\realbackslash chapentry
{#1}{\the\chapno}{\noexpand\folio}}}%
1689 \write \contentsfile \temp %
1691 \global\let\section =
\numberedsec
1692 \global\let\subsection =
\numberedsubsec
1693 \global\let\subsubsection =
\numberedsubsubsec
1696 \outer\def\appendix{\parsearg\appendixzzz}
1697 \def\appendixzzz #1{\seccheck{appendix
}%
1698 \secno=
0 \subsecno=
0 \subsubsecno=
0
1699 \global\advance \appendixno by
1 \message{Appendix
\appendixletter}%
1700 \chapmacro {#1}{Appendix
\appendixletter}%
1701 \gdef\thissection{#1}%
1702 \gdef\thischaptername{#1}%
1703 \xdef\thischapter{Appendix
\appendixletter:
\noexpand\thischaptername}%
1705 \edef\temp{{\realbackslash chapentry
1706 {#1}{Appendix
\appendixletter}{\noexpand\folio}}}%
1708 \write \contentsfile \temp %
1710 \global\let\section =
\appendixsec
1711 \global\let\subsection =
\appendixsubsec
1712 \global\let\subsubsection =
\appendixsubsubsec
1715 \outer\def\top{\parsearg\unnumberedzzz}
1716 \outer\def\unnumbered{\parsearg\unnumberedzzz}
1717 \def\unnumberedzzz #1{\seccheck{unnumbered
}%
1718 \secno=
0 \subsecno=
0 \subsubsecno=
0 \message{(
#1)
}
1719 \unnumbchapmacro {#1}%
1720 \gdef\thischapter{#1}\gdef\thissection{#1}%
1722 \edef\temp{{\realbackslash unnumbchapentry
{#1}{\noexpand\folio}}}%
1724 \write \contentsfile \temp %
1726 \global\let\section =
\unnumberedsec
1727 \global\let\subsection =
\unnumberedsubsec
1728 \global\let\subsubsection =
\unnumberedsubsubsec
1731 \outer\def\numberedsec{\parsearg\seczzz}
1732 \def\seczzz #1{\seccheck{section
}%
1733 \subsecno=
0 \subsubsecno=
0 \global\advance \secno by
1 %
1734 \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
1736 \edef\temp{{\realbackslash secentry
%
1737 {#1}{\the\chapno}{\the\secno}{\noexpand\folio}}}%
1739 \write \contentsfile \temp %
1744 \outer\def\appendixsection{\parsearg\appendixsectionzzz}
1745 \outer\def\appendixsec{\parsearg\appendixsectionzzz}
1746 \def\appendixsectionzzz #1{\seccheck{appendixsection
}%
1747 \subsecno=
0 \subsubsecno=
0 \global\advance \secno by
1 %
1748 \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
1750 \edef\temp{{\realbackslash secentry
%
1751 {#1}{\appendixletter}{\the\secno}{\noexpand\folio}}}%
1753 \write \contentsfile \temp %
1758 \outer\def\unnumberedsec{\parsearg\unnumberedseczzz}
1759 \def\unnumberedseczzz #1{\seccheck{unnumberedsec
}%
1760 \plainsecheading {#1}\gdef\thissection{#1}%
1762 \edef\temp{{\realbackslash unnumbsecentry
{#1}{\noexpand\folio}}}%
1764 \write \contentsfile \temp %
1769 \outer\def\numberedsubsec{\parsearg\numberedsubseczzz}
1770 \def\numberedsubseczzz #1{\seccheck{subsection
}%
1771 \gdef\thissection{#1}\subsubsecno=
0 \global\advance \subsecno by
1 %
1772 \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
1774 \edef\temp{{\realbackslash subsecentry
%
1775 {#1}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
1777 \write \contentsfile \temp %
1782 \outer\def\appendixsubsec{\parsearg\appendixsubseczzz}
1783 \def\appendixsubseczzz #1{\seccheck{appendixsubsec
}%
1784 \gdef\thissection{#1}\subsubsecno=
0 \global\advance \subsecno by
1 %
1785 \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
1787 \edef\temp{{\realbackslash subsecentry
%
1788 {#1}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
1790 \write \contentsfile \temp %
1795 \outer\def\unnumberedsubsec{\parsearg\unnumberedsubseczzz}
1796 \def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec
}%
1797 \plainsecheading {#1}\gdef\thissection{#1}%
1799 \edef\temp{{\realbackslash unnumbsubsecentry
{#1}{\noexpand\folio}}}%
1801 \write \contentsfile \temp %
1806 \outer\def\numberedsubsubsec{\parsearg\numberedsubsubseczzz}
1807 \def\numberedsubsubseczzz #1{\seccheck{subsubsection
}%
1808 \gdef\thissection{#1}\global\advance \subsubsecno by
1 %
1809 \subsubsecheading {#1}
1810 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
1812 \edef\temp{{\realbackslash subsubsecentry
%
1814 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}
1815 {\noexpand\folio}}}%
1817 \write \contentsfile \temp %
1822 \outer\def\appendixsubsubsec{\parsearg\appendixsubsubseczzz}
1823 \def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec
}%
1824 \gdef\thissection{#1}\global\advance \subsubsecno by
1 %
1825 \subsubsecheading {#1}
1826 {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
1828 \edef\temp{{\realbackslash subsubsecentry
{#1}%
1830 {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}%
1832 \write \contentsfile \temp %
1837 \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
1838 \def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec
}%
1839 \plainsecheading {#1}\gdef\thissection{#1}%
1841 \edef\temp{{\realbackslash unnumbsubsubsecentry
{#1}{\noexpand\folio}}}%
1843 \write \contentsfile \temp %
1848 % These are variants which are not "outer", so they can appear in @ifinfo.
1849 % Actually, they should now be obsolete; ordinary section commands should work.
1850 \def\infotop{\parsearg\unnumberedzzz}
1851 \def\infounnumbered{\parsearg\unnumberedzzz}
1852 \def\infounnumberedsec{\parsearg\unnumberedseczzz}
1853 \def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz}
1854 \def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
1856 \def\infoappendix{\parsearg\appendixzzz}
1857 \def\infoappendixsec{\parsearg\appendixseczzz}
1858 \def\infoappendixsubsec{\parsearg\appendixsubseczzz}
1859 \def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz}
1861 \def\infochapter{\parsearg\chapterzzz}
1862 \def\infosection{\parsearg\sectionzzz}
1863 \def\infosubsection{\parsearg\subsectionzzz}
1864 \def\infosubsubsection{\parsearg\subsubsectionzzz}
1866 % These macros control what the section commands do, according
1867 % to what kind of chapter we are in (ordinary, appendix, or unnumbered).
1868 % Define them by default for a numbered chapter.
1869 \global\let\section =
\numberedsec
1870 \global\let\subsection =
\numberedsubsec
1871 \global\let\subsubsection =
\numberedsubsubsec
1873 % Define @majorheading, @heading and @subheading
1875 % NOTE on use of \vbox for chapter headings, section headings, and
1877 % 1) We use \vbox rather than the earlier \line to permit
1878 % overlong headings to fold.
1879 % 2) \hyphenpenalty is set to 10000 because hyphenation in a
1880 % heading is obnoxious; this forbids it.
1881 % 3) Likewise, headings look best if no \parindent is used, and
1882 % if justification is not attempted. Hence \raggedright.
1885 \def\majorheading{\parsearg\majorheadingzzz}
1886 \def\majorheadingzzz #1{%
1887 {\advance\chapheadingskip by
10pt
\chapbreak }%
1888 {\chapfonts \vbox{\hyphenpenalty=
10000\tolerance=
5000
1889 \parindent=
0pt
\raggedright
1890 \rm #1\hfill}}\bigskip \par\penalty 200}
1892 \def\chapheading{\parsearg\chapheadingzzz}
1893 \def\chapheadingzzz #1{\chapbreak %
1894 {\chapfonts \vbox{\hyphenpenalty=
10000\tolerance=
5000
1895 \parindent=
0pt
\raggedright
1896 \rm #1\hfill}}\bigskip \par\penalty 200}
1898 \def\heading{\parsearg\secheadingi}
1900 \def\subheading{\parsearg\subsecheadingi}
1902 \def\subsubheading{\parsearg\subsubsecheadingi}
1904 % These macros generate a chapter, section, etc. heading only
1905 % (including whitespace, linebreaking, etc. around it),
1906 % given all the information in convenient, parsed form.
1908 %%% Args are the skip and penalty (usually negative)
1909 \def\dobreak#1#2{\par\ifdim\lastskip<
#1\removelastskip\penalty#2\vskip#1\fi}
1911 \def\setchapterstyle #1 {\csname CHAPF
#1\endcsname}
1913 %%% Define plain chapter starts, and page on/off switching for it
1914 % Parameter controlling skip before chapter headings (if needed)
1916 \newskip \chapheadingskip \chapheadingskip =
30pt plus
8pt minus
4pt
1918 \def\chapbreak{\dobreak \chapheadingskip {-
4000}}
1919 \def\chappager{\par\vfill\supereject}
1920 \def\chapoddpage{\chappager \ifodd\pageno \else \hbox to
0pt
{} \chappager\fi}
1922 \def\setchapternewpage #1 {\csname CHAPPAG
#1\endcsname}
1925 \global\let\pchapsepmacro=
\chapbreak
1926 \global\let\pagealignmacro=
\chappager}
1929 \global\let\pchapsepmacro=
\chappager
1930 \global\let\pagealignmacro=
\chappager
1931 \global\def\HEADINGSon{\HEADINGSsingle}}
1934 \global\let\pchapsepmacro=
\chapoddpage
1935 \global\let\pagealignmacro=
\chapoddpage
1936 \global\def\HEADINGSon{\HEADINGSdouble}}
1941 \global\let\chapmacro=
\chfplain
1942 \global\let\unnumbchapmacro=
\unnchfplain}
1944 \def\chfplain #1#2{%
1947 \chapfonts \vbox{\hyphenpenalty=
10000\tolerance=
5000
1948 \parindent=
0pt
\raggedright
1955 \def\unnchfplain #1{%
1957 {\chapfonts \vbox{\hyphenpenalty=
10000\tolerance=
5000
1958 \parindent=
0pt
\raggedright
1959 \rm #1\hfill}}\bigskip \par\penalty 10000 %
1961 \CHAPFplain % The default
1963 \def\unnchfopen #1{%
1964 \chapoddpage {\chapfonts \vbox{\hyphenpenalty=
10000\tolerance=
5000
1965 \parindent=
0pt
\raggedright
1966 \rm #1\hfill}}\bigskip \par\penalty 10000 %
1969 \def\chfopen #1#2{\chapoddpage {\chapfonts
1970 \vbox to
3in
{\vfil \hbox to
\hsize{\hfil #2} \hbox to
\hsize{\hfil #1} \vfil}}%
1975 \global\let\chapmacro=
\chfopen
1976 \global\let\unnumbchapmacro=
\unnchfopen}
1978 % Parameter controlling skip before section headings.
1980 \newskip \subsecheadingskip \subsecheadingskip =
17pt plus
8pt minus
4pt
1981 \def\subsecheadingbreak{\dobreak \subsecheadingskip {-
500}}
1983 \newskip \secheadingskip \secheadingskip =
21pt plus
8pt minus
4pt
1984 \def\secheadingbreak{\dobreak \secheadingskip {-
1000}}
1986 % @paragraphindent is defined for the Info formatting commands only.
1987 \let\paragraphindent=
\comment
1989 % Section fonts are the base font at magstep2, which produces
1990 % a size a bit more than 14 points in the default situation.
1992 \def\secheading #1#2#3{\secheadingi {#2.
#3\enspace #1}}
1993 \def\plainsecheading #1{\secheadingi {#1}}
1994 \def\secheadingi #1{{\advance \secheadingskip by
\parskip %
1996 {\secfonts \vbox{\hyphenpenalty=
10000\tolerance=
5000
1997 \parindent=
0pt
\raggedright
1999 \ifdim \parskip<
10pt
\kern 10pt
\kern -
\parskip\fi \penalty 10000 }
2002 % Subsection fonts are the base font at magstep1,
2003 % which produces a size of 12 points.
2005 \def\subsecheading #1#2#3#4{\subsecheadingi {#2.
#3.
#4\enspace #1}}
2006 \def\subsecheadingi #1{{\advance \subsecheadingskip by
\parskip %
2007 \subsecheadingbreak}%
2008 {\subsecfonts \vbox{\hyphenpenalty=
10000\tolerance=
5000
2009 \parindent=
0pt
\raggedright
2011 \ifdim \parskip<
10pt
\kern 10pt
\kern -
\parskip\fi \penalty 10000 }
2013 \def\subsubsecfonts{\subsecfonts} % Maybe this should change:
2014 % Perhaps make sssec fonts scaled
2016 \def\subsubsecheading #1#2#3#4#5{\subsubsecheadingi {#2.
#3.
#4.
#5\enspace #1}}
2017 \def\subsubsecheadingi #1{{\advance \subsecheadingskip by
\parskip %
2018 \subsecheadingbreak}%
2019 {\subsubsecfonts \vbox{\hyphenpenalty=
10000\tolerance=
5000
2020 \parindent=
0pt
\raggedright
2022 \ifdim \parskip<
10pt
\kern 10pt
\kern -
\parskip\fi \penalty 10000}
2025 \message{toc printing,
}
2027 % Finish up the main text and prepare to read what we've written
2030 \newskip\contentsrightmargin \contentsrightmargin=
1in
2031 \def\startcontents#1{%
2033 \immediate\closeout \contentsfile
2035 \pageno = -
1 % Request roman numbered pages.
2037 % Don't need to put `Contents' or `Short Contents' in the headline.
2038 % It is abundantly clear what they are.
2039 \unnumbchapmacro{#1}\def\thischapter{}%
2040 \begingroup % Set up to handle contents files properly.
2041 \catcode`\\=
0 \catcode`\
{=
1 \catcode`\
}=
2 \catcode`\@=
11
2042 \raggedbottom % Worry more about breakpoints than the bottom.
2043 \advance\hsize by -
\contentsrightmargin % Don't use the full line length.
2047 % Normal (long) toc.
2048 \outer\def\contents{%
2049 \startcontents{Table of Contents
}%
2055 % And just the chapters.
2056 \outer\def\summarycontents{%
2057 \startcontents{Short Contents
}%
2059 \let\chapentry =
\shortchapentry
2060 \let\unnumbchapentry =
\shortunnumberedentry
2061 % We want a true roman here for the page numbers.
2063 \let\rm=
\shortcontrm \let\bf=
\shortcontbf \let\sl=
\shortcontsl
2065 \advance\baselineskip by
1pt
% Open it up a little.
2066 \def\secentry #
#1#
#2#
#3#
#4{}
2067 \def\unnumbsecentry #
#1#
#2{}
2068 \def\subsecentry #
#1#
#2#
#3#
#4#
#5{}
2069 \def\unnumbsubsecentry #
#1#
#2{}
2070 \def\subsubsecentry #
#1#
#2#
#3#
#4#
#5#
#6{}
2071 \def\unnumbsubsubsecentry #
#1#
#2{}
2076 \let\shortcontents =
\summarycontents
2078 % These macros generate individual entries in the table of contents.
2079 % The first argument is the chapter or section name.
2080 % The last argument is the page number.
2081 % The arguments in between are the chapter number, section number, ...
2083 % Chapter-level things, for both the long and short contents.
2084 \def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}
2086 % See comments in \dochapentry re vbox and related settings
2087 \def\shortchapentry#1#2#3{%
2088 \vbox{\hyphenpenalty=
10000\tolerance=
5000
2089 \parindent=
0pt
\strut\raggedright
2090 {#2\labelspace #1}\dotfill\doshortpageno{#3}}%
2093 \def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
2094 \def\shortunnumberedentry#1#2{%
2095 \vbox{\hyphenpenalty=
10000\tolerance=
5000
2096 \parindent=
0pt
\strut\raggedright
2097 #1\dotfill\doshortpageno{#2}}%
2101 \def\secentry#1#2#3#4{\dosecentry{#2.
#3\labelspace#1}{#4}}
2102 \def\unnumbsecentry#1#2{\dosecentry{#1}{#2}}
2105 \def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.
#3.
#4\labelspace#1}{#5}}
2106 \def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}}
2108 % And subsubsections.
2109 \def\subsubsecentry#1#2#3#4#5#6{%
2110 \dosubsubsecentry{#2.
#3.
#4.
#5\labelspace#1}{#6}}
2111 \def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}}
2114 % This parameter controls the indentation of the various levels.
2115 \newdimen\tocindent \tocindent =
3pc
2117 % Now for the actual typesetting. In all these, #1 is the text and #2 is the
2120 % If the toc has to be broken over pages, we would want to be at chapters
2121 % if at all possible; hence the \penalty.
2122 \def\dochapentry#1#2{%
2123 \penalty-
300 \vskip\baselineskip
2124 % This \vbox (and similar ones in dosecentry etc.) used to be a
2125 % \line; changed to permit linebreaks for long headings. See
2126 % comments above \majorheading. Here we also use \strut to
2127 % keep the top end of the vbox from jamming up against the previous
2128 % entry in the table of contents.
2129 \vbox{\chapentryfonts
2130 \hyphenpenalty=
10000\tolerance=
5000 % this line and next introduced
2131 \parindent=
0pt
\strut\raggedright % with \line -> \vbox change
2134 \nobreak\vskip .25\baselineskip
2137 \def\dosecentry#1#2{%
2138 \vbox{\secentryfonts \leftskip=
\tocindent
2139 \hyphenpenalty=
10000\tolerance=
5000
2140 \parindent=
0pt
\strut\raggedright #1\dotfill
2144 \def\dosubsecentry#1#2{%
2145 \vbox{\subsecentryfonts \leftskip=
2\tocindent
2146 \hyphenpenalty=
10000\tolerance=
5000
2147 \parindent=
0pt
\strut\raggedright #1\dotfill
2151 \def\dosubsubsecentry#1#2{%
2152 \vbox{\subsubsecentryfonts \leftskip=
3\tocindent
2153 \hyphenpenalty=
10000\tolerance=
5000
2154 \parindent=
0pt
\strut\raggedright #1\dotfill
2158 % Space between chapter (or whatever) number and the title.
2159 \def\labelspace{\hskip1em \relax}
2161 \def\dopageno#1{{\rm #1}}
2162 \def\doshortpageno#1{{\rm #1}}
2164 \def\chapentryfonts{\secfonts \rm}
2165 \def\secentryfonts{\textfonts}
2166 \let\subsecentryfonts =
\textfonts
2167 \let\subsubsecentryfonts =
\textfonts
2170 \message{environments,
}
2172 % Since these characters are used in examples, it should be an even number of
2173 % \tt widths. Each \tt character is 1en, so two makes it 1em.
2174 % Furthermore, these definitions must come after we define our fonts.
2175 \newbox\dblarrowbox \newbox\longdblarrowbox
2176 \newbox\pushcharbox \newbox\bullbox
2177 \newbox\equivbox \newbox\errorbox
2179 \let\ptexequiv =
\equiv
2182 %\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil}
2183 %\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil}
2184 %\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil}
2185 %\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil}
2186 % Adapted from the manmac format (p.420 of TeXbook)
2187 %\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex
2193 \def\result{\leavevmode\raise.15ex
\hbox to
1em
{\hfil$
\Rightarrow$
\hfil}}
2194 \def\expansion{\leavevmode\raise.1ex
\hbox to
1em
{\hfil$
\mapsto$
\hfil}}
2195 \def\print{\leavevmode\lower.1ex
\hbox to
1em
{\hfil$
\dashv$
\hfil}}
2197 \def\equiv{\leavevmode\lower.1ex
\hbox to
1em
{\hfil$
\ptexequiv$
\hfil}}
2199 % Adapted from the TeXbook's \boxit.
2200 {\tentt \global\dimen0 =
3em
}% Width of the box.
2201 \dimen2 =
.55pt
% Thickness of rules
2202 % The text. (`r' is open on the right, `e' somewhat less so on the left.)
2203 \setbox0 =
\hbox{\kern-
.75pt
\tensf error
\kern-
1.5pt
}
2205 \global\setbox\errorbox=
\hbox to
\dimen0{\hfil
2206 \hsize =
\dimen0 \advance\hsize by -
5.8pt
% Space to left+right.
2207 \advance\hsize by -
2\dimen2 % Rules.
2209 \hrule height
\dimen2
2210 \hbox{\vrule width
\dimen2 \kern3pt % Space to left of text.
2211 \vtop{\kern2.4pt
\box0 \kern2.4pt
}% Space above/below.
2212 \kern3pt\vrule width
\dimen2}% Space to right.
2213 \hrule height
\dimen2}
2216 % The @error{} command.
2217 \def\error{\leavevmode\lower.7ex
\copy\errorbox}
2219 % @tex ... @end tex escapes into raw Tex temporarily.
2220 % One exception: @ is still an escape character, so that @end tex works.
2221 % But \@ or @@ will get a plain tex @ character.
2223 \def\tex{\begingroup
2224 \catcode `\\=
0 \catcode `\
{=
1 \catcode `\
}=
2
2225 \catcode `\$=
3 \catcode `\&=
4 \catcode `\#=
6
2226 \catcode `\^=
7 \catcode `
\_=
8 \catcode `\~=
13 \let~=
\tie
2242 \let\bullet=
\ptexbullet
2243 \let\b=
\ptexb \let\c=
\ptexc \let\i=
\ptexi \let\t=
\ptext \let\l=
\ptexl
2246 \let\Etex=
\endgroup}
2248 % Define @lisp ... @endlisp.
2249 % @lisp does a \begingroup so it can rebind things,
2250 % including the definition of @endlisp (which normally is erroneous).
2252 % Amount to narrow the margins by for @lisp.
2253 \newskip\lispnarrowing \lispnarrowing=
0.4in
2255 % This is the definition that ^M gets inside @lisp
2256 % phr: changed space to \null, to avoid overfull hbox problems.
2258 \gdef\lisppar{\null\endgraf}}
2260 % Cause \obeyspaces to make each Space cause a word-separation
2261 % rather than the default which is that it acts punctuation.
2262 % This is because space in tt font looks funny.
2264 \gdef\sepspaces{\def {\
}}}
2266 \newskip\aboveenvskipamount \aboveenvskipamount=
0pt
2267 \def\aboveenvbreak{{\advance\aboveenvskipamount by
\parskip
2268 \endgraf \ifdim\lastskip<
\aboveenvskipamount
2269 \removelastskip \penalty-
50 \vskip\aboveenvskipamount \fi}}
2271 \def\afterenvbreak{\endgraf \ifdim\lastskip<
\aboveenvskipamount
2272 \removelastskip \penalty-
50 \vskip\aboveenvskipamount \fi}
2274 % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins.
2275 \let\nonarrowing=
\relax
2277 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2278 % \cartouche: draw rectangle w/rounded corners around argument
2279 \font\circle=lcircle10
2281 \newdimen\cartouter\newdimen\cartinner
2282 \newskip\normbskip\newskip\normpskip\newskip\normlskip
2283 \circthick=
\fontdimen8\circle
2285 \def\ctl{{\circle\char'
013\hskip -
6pt
}}% 6pt from pl file: 1/2charwidth
2286 \def\ctr{{\hskip 6pt
\circle\char'
010}}
2287 \def\cbl{{\circle\char'
012\hskip -
6pt
}}
2288 \def\cbr{{\hskip 6pt
\circle\char'
011}}
2289 \def\carttop{\hbox to
\cartouter{\hskip\lskip
2290 \ctl\leaders\hrule height
\circthick\hfil\ctr
2292 \def\cartbot{\hbox to
\cartouter{\hskip\lskip
2293 \cbl\leaders\hrule height
\circthick\hfil\cbr
2296 \newskip\lskip\newskip\rskip
2298 \long\def\cartouche{%
2300 \lskip=
\leftskip \rskip=
\rightskip
2301 \leftskip=
0pt
\rightskip=
0pt
%we want these *outside*.
2302 \cartinner=
\hsize \advance\cartinner by-
\lskip
2303 \advance\cartinner by-
\rskip
2305 \advance\cartouter by
18pt
% allow for 3pt kerns on either
2306 % side, and for 6pt waste from
2308 \normbskip=
\baselineskip \normpskip=
\parskip \normlskip=
\lineskip
2309 % Flag to tell @lisp, etc., not to narrow margin.
2310 \let\nonarrowing=
\comment
2312 \baselineskip=
0pt
\parskip=
0pt
\lineskip=
0pt
2321 \baselineskip=
\normbskip
2322 \lineskip=
\normlskip
2337 \def\lisp{\aboveenvbreak
2338 \begingroup\inENV % This group ends at the end of the @lisp body
2339 \hfuzz=
12truept
% Don't be fussy
2340 % Make spaces be word-separators rather than space tokens.
2342 % Single space lines
2344 % The following causes blank lines not to be ignored
2345 % by adding a space to the end of each line.
2347 \def\Elisp{\endgroup\afterenvbreak}%
2349 % @cartouche defines \nonarrowing to inhibit narrowing
2350 % at next level down.
2351 \ifx\nonarrowing\relax
2352 \advance \leftskip by
\lispnarrowing
2353 \exdentamount=
\lispnarrowing
2354 \let\exdent=
\nofillexdent
2355 \let\nonarrowing=
\relax
2358 \obeyspaces \obeylines \tt \rawbackslash
2359 \def\next#
#1{}\next}
2363 \def\Eexample{\Elisp}
2365 \let\smallexample=
\lisp
2366 \def\Esmallexample{\Elisp}
2368 % Macro for 9 pt. examples, necessary to print with 5" lines.
2369 % From Pavel@xerox. This is not really used unless the
2370 % @smallbook command is given.
2372 \def\smalllispx{\aboveenvbreak\begingroup\inENV
2373 % This group ends at the end of the @lisp body
2374 \hfuzz=
12truept
% Don't be fussy
2375 % Make spaces be word-separators rather than space tokens.
2377 % Single space lines
2379 % The following causes blank lines not to be ignored
2380 % by adding a space to the end of each line.
2382 \def\Esmalllisp{\endgroup\afterenvbreak}%
2383 %%%% Smaller baseline skip for small examples.
2386 % @cartouche defines \nonarrowing to inhibit narrowing
2387 % at next level down.
2388 \ifx\nonarrowing\relax
2389 \advance \leftskip by
\lispnarrowing
2390 \exdentamount=
\lispnarrowing
2391 \let\exdent=
\nofillexdent
2392 \let\nonarrowing=
\relax
2395 \obeyspaces \obeylines \ninett \indexfonts \rawbackslash
2396 \def\next#
#1{}\next}
2398 % This is @display; same as @lisp except use roman font.
2400 \def\display{\begingroup\inENV %This group ends at the end of the @display body
2402 % Make spaces be word-separators rather than space tokens.
2404 % Single space lines
2406 % The following causes blank lines not to be ignored
2407 % by adding a space to the end of each line.
2409 \def\Edisplay{\endgroup\afterenvbreak}%
2411 % @cartouche defines \nonarrowing to inhibit narrowing
2412 % at next level down.
2413 \ifx\nonarrowing\relax
2414 \advance \leftskip by
\lispnarrowing
2415 \exdentamount=
\lispnarrowing
2416 \let\exdent=
\nofillexdent
2417 \let\nonarrowing=
\relax
2420 \obeyspaces \obeylines
2421 \def\next#
#1{}\next}
2423 % This is @format; same as @lisp except use roman font and don't narrow margins
2425 \def\format{\begingroup\inENV %This group ends at the end of the @format body
2427 % Make spaces be word-separators rather than space tokens.
2430 % The following causes blank lines not to be ignored
2431 % by adding a space to the end of each line.
2433 \def\Eformat{\endgroup\afterenvbreak}
2434 \parskip=
0pt
\parindent=
0pt
2435 \obeyspaces \obeylines
2436 \def\next#
#1{}\next}
2438 % @flushleft and @flushright
2441 \begingroup\inENV %This group ends at the end of the @format body
2443 % Make spaces be word-separators rather than space tokens.
2445 % The following causes blank lines not to be ignored
2446 % by adding a space to the end of each line.
2447 % This also causes @ to work when the directive name
2448 % is terminated by end of line.
2450 \def\Eflushleft{\endgroup\afterenvbreak}%
2451 \parskip=
0pt
\parindent=
0pt
2452 \obeyspaces \obeylines
2453 \def\next#
#1{}\next}
2456 \begingroup\inENV %This group ends at the end of the @format body
2458 % Make spaces be word-separators rather than space tokens.
2460 % The following causes blank lines not to be ignored
2461 % by adding a space to the end of each line.
2462 % This also causes @ to work when the directive name
2463 % is terminated by end of line.
2465 \def\Eflushright{\endgroup\afterenvbreak}%
2466 \parskip=
0pt
\parindent=
0pt
2467 \advance \leftskip by
0pt plus
1fill
2468 \obeyspaces \obeylines
2469 \def\next#
#1{}\next}
2471 % @quotation - narrow the margins.
2474 \begingroup\inENV %This group ends at the end of the @quotation body
2475 {\parskip=
0pt
% because we will skip by \parskip too, later
2479 \def\Equotation{\par\endgroup\afterenvbreak}%
2480 % @cartouche defines \nonarrowing to inhibit narrowing
2481 % at next level down.
2482 \ifx\nonarrowing\relax
2483 \advance \leftskip by
\lispnarrowing
2484 \advance \rightskip by
\lispnarrowing
2485 \exdentamount=
\lispnarrowing
2486 \let\nonarrowing=
\relax
2490 % Define formatter for defuns
2491 % First, allow user to change definition object font (\df) internally
2492 \def\setdeffont #1 {\csname DEF
#1\endcsname}
2494 \newskip\defbodyindent \defbodyindent=
.4in
2495 \newskip\defargsindent \defargsindent=
50pt
2496 \newskip\deftypemargin \deftypemargin=
12pt
2497 \newskip\deflastargmargin \deflastargmargin=
18pt
2499 \newcount\parencount
2500 % define \functionparens, which makes ( and ) and & do special things.
2501 % \functionparens affects the group it is contained in.
2503 \catcode`\(=
\active \catcode`\)=
\active \catcode`\&=
\active
2504 \catcode`\
[=
\active \catcode`\
]=
\active}
2505 {\activeparens % Now, smart parens don't turn on until &foo (see \amprm)
2506 \gdef\functionparens{\boldbrax\let&=
\amprm\parencount=
0 }
2507 \gdef\boldbrax{\let(=
\opnr\let)=
\clnr\let[=
\lbrb\let]=
\rbrb}
2509 % Definitions of (, ) and & used in args for functions.
2510 % This is the definition of ( outside of all parentheses.
2511 \gdef\oprm#1 {{\rm\char`\(
}#1 \bf \let(=
\opnested %
2512 \global\advance\parencount by
1 }
2514 % This is the definition of ( when already inside a level of parens.
2515 \gdef\opnested{\char`\(
\global\advance\parencount by
1 }
2517 \gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
2518 % also in that case restore the outer-level definition of (.
2519 \ifnum \parencount=
1 {\rm \char `\)
}\sl \let(=
\oprm \else \char `\)
\fi
2520 \global\advance \parencount by -
1 }
2521 % If we encounter &foo, then turn on ()-hacking afterwards
2522 \gdef\amprm#1 {{\rm\&
#1}\let(=
\oprm \let)=
\clrm\
}
2524 \gdef\normalparens{\boldbrax\let&=
\ampnr}
2525 } % End of definition inside \activeparens
2526 %% These parens (in \boldbrax) actually are a little bolder than the
2527 %% contained text. This is especially needed for [ and ]
2528 \def\opnr{{\sf\char`\(
}} \def\clnr{{\sf\char`\)
}} \def\ampnr{\&
}
2529 \def\lbrb{{\bf\char`\
[}} \def\rbrb{{\bf\char`\
]}}
2531 % First, defname, which formats the header line itself.
2532 % #1 should be the function name.
2533 % #2 should be the type of definition, such as "Function".
2536 % Get the values of \leftskip and \rightskip as they were
2537 % outside the @def...
2539 \advance\dimen2 by -
\defbodyindent
2541 \advance\dimen3 by -
\defbodyindent
2543 \setbox0=
\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
2544 \dimen0=
\hsize \advance \dimen0 by -
\wd0 % compute size for first line
2545 \dimen1=
\hsize \advance \dimen1 by -
\defargsindent %size for continuations
2546 \parshape 2 0in
\dimen0 \defargsindent \dimen1 %
2547 % Now output arg 2 ("Function" or some such)
2548 % ending at \deftypemargin from the right margin,
2549 % but stuck inside a box of width 0 so it does not interfere with linebreaking
2550 {% Adjust \hsize to exclude the ambient margins,
2551 % so that \rightline will obey them.
2552 \advance \hsize by -
\dimen2 \advance \hsize by -
\dimen3
2553 \rlap{\rightline{{\rm #2}\hskip \deftypemargin}}}%
2554 % Make all lines underfull and no complaints:
2555 \tolerance=
10000 \hbadness=
10000
2556 \advance\leftskip by -
\defbodyindent
2557 \exdentamount=
\defbodyindent
2558 {\df #1}\enskip % Generate function name
2561 % Actually process the body of a definition
2562 % #1 should be the terminating control sequence, such as \Edefun.
2563 % #2 should be the "another name" control sequence, such as \defunx.
2564 % #3 should be the control sequence that actually processes the header,
2565 % such as \defunheader.
2567 \def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
2569 % Define the end token that this defining construct specifies
2570 % so that it will exit this group.
2571 \def#1{\endgraf\endgroup\medbreak}%
2572 \def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
2574 \advance\leftskip by
\defbodyindent \advance \rightskip by
\defbodyindent
2575 \exdentamount=
\defbodyindent
2577 \catcode 61=
\active %
2578 \obeylines\activeparens\spacesplit#3}
2580 \def\defmethparsebody #1#2#3#4 {\begingroup\inENV %
2582 % Define the end token that this defining construct specifies
2583 % so that it will exit this group.
2584 \def#1{\endgraf\endgroup\medbreak}%
2585 \def#2#
#1 {\begingroup\obeylines\activeparens\spacesplit{#3{#
#1}}}%
2587 \advance\leftskip by
\defbodyindent \advance \rightskip by
\defbodyindent
2588 \exdentamount=
\defbodyindent
2589 \begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
2591 \def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
2593 % Define the end token that this defining construct specifies
2594 % so that it will exit this group.
2595 \def#1{\endgraf\endgroup\medbreak}%
2596 \def#2#
#1 #
#2 {\def#4{#
#1}%
2597 \begingroup\obeylines\activeparens\spacesplit{#3{#
#2}}}%
2599 \advance\leftskip by
\defbodyindent \advance \rightskip by
\defbodyindent
2600 \exdentamount=
\defbodyindent
2601 \begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
2603 % These parsing functions are similar to the preceding ones
2604 % except that they do not make parens into active characters.
2605 % These are used for "variables" since they have no arguments.
2607 \def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
2609 % Define the end token that this defining construct specifies
2610 % so that it will exit this group.
2611 \def#1{\endgraf\endgroup\medbreak}%
2612 \def#2{\begingroup\obeylines\spacesplit#3}%
2614 \advance\leftskip by
\defbodyindent \advance \rightskip by
\defbodyindent
2615 \exdentamount=
\defbodyindent
2617 \catcode 61=
\active %
2618 \obeylines\spacesplit#3}
2620 \def\defvrparsebody #1#2#3#4 {\begingroup\inENV %
2622 % Define the end token that this defining construct specifies
2623 % so that it will exit this group.
2624 \def#1{\endgraf\endgroup\medbreak}%
2625 \def#2#
#1 {\begingroup\obeylines\spacesplit{#3{#
#1}}}%
2627 \advance\leftskip by
\defbodyindent \advance \rightskip by
\defbodyindent
2628 \exdentamount=
\defbodyindent
2629 \begingroup\obeylines\spacesplit{#3{#4}}}
2631 \def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV %
2633 % Define the end token that this defining construct specifies
2634 % so that it will exit this group.
2635 \def#1{\endgraf\endgroup\medbreak}%
2636 \def#2#
#1 #
#2 {\def#4{#
#1}%
2637 \begingroup\obeylines\spacesplit{#3{#
#2}}}%
2639 \advance\leftskip by
\defbodyindent \advance \rightskip by
\defbodyindent
2640 \exdentamount=
\defbodyindent
2641 \begingroup\obeylines\spacesplit{#3{#5}}}
2643 % Split up #2 at the first space token.
2644 % call #1 with two arguments:
2645 % the first is all of #2 before the space token,
2646 % the second is all of #2 after that space token.
2647 % If #2 contains no space token, all of it is passed as the first arg
2648 % and the second is passed as empty.
2651 \gdef\spacesplit#1#2^^M
{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}%
2652 \long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{%
2654 #1{#2}{}\else #1{#2}{#3#4}\fi}}
2656 % So much for the things common to all kinds of definitions.
2660 % First, define the processing that is wanted for arguments of \defun
2661 % Use this to expand the args and terminate the paragraph they make up
2663 \def\defunargs #1{\functionparens \sl
2664 % Expand, preventing hyphenation at `-' chars.
2665 % Note that groups don't affect changes in \hyphenchar.
2668 \hyphenchar\tensl=
45
2669 \ifnum\parencount=
0 \else \errmessage{unbalanced parens in @def arguments
}\fi%
2670 \interlinepenalty=
10000
2671 \advance\rightskip by
0pt plus
1fil
2672 \endgraf\penalty 10000\vskip -
\parskip\penalty 10000%
2675 \def\deftypefunargs #1{%
2676 % Expand, preventing hyphenation at `-' chars.
2677 % Note that groups don't affect changes in \hyphenchar.
2680 \interlinepenalty=
10000
2681 \advance\rightskip by
0pt plus
1fil
2682 \endgraf\penalty 10000\vskip -
\parskip\penalty 10000%
2685 % Do complete processing of one @defun or @defunx line already parsed.
2687 % @deffn Command forward-char nchars
2689 \def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader}
2691 \def\deffnheader #1#2#3{\doind {fn
}{\code{#2}}%
2692 \begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
2693 \catcode 61=
\other % Turn off change made in \defparsebody
2696 % @defun == @deffn Function
2698 \def\defun{\defparsebody\Edefun\defunx\defunheader}
2700 \def\defunheader #1#2{\doind {fn
}{\code{#1}}% Make entry in function index
2701 \begingroup\defname {#1}{Function
}%
2702 \defunargs {#2}\endgroup %
2703 \catcode 61=
\other % Turn off change made in \defparsebody
2706 % @deftypefun int foobar (int @var{foo}, float @var{bar})
2708 \def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader}
2710 % #1 is the data type. #2 is the name and args.
2711 \def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax}
2712 % #1 is the data type, #2 the name, #3 the args.
2713 \def\deftypefunheaderx #1#2 #3\relax{%
2714 \doind {fn
}{\code{#2}}% Make entry in function index
2715 \begingroup\defname {\code{#1} #2}{Function
}%
2716 \deftypefunargs {#3}\endgroup %
2717 \catcode 61=
\other % Turn off change made in \defparsebody
2720 % @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
2722 \def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
2724 % #1 is the classification. #2 is the data type. #3 is the name and args.
2725 \def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax}
2726 % #1 is the classification, #2 the data type, #3 the name, #4 the args.
2727 \def\deftypefnheaderx #1#2#3 #4\relax{%
2728 \doind {fn
}{\code{#3}}% Make entry in function index
2729 \begingroup\defname {\code{#2} #3}{#1}%
2730 \deftypefunargs {#4}\endgroup %
2731 \catcode 61=
\other % Turn off change made in \defparsebody
2734 % @defmac == @deffn Macro
2736 \def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
2738 \def\defmacheader #1#2{\doind {fn
}{\code{#1}}% Make entry in function index
2739 \begingroup\defname {#1}{Macro
}%
2740 \defunargs {#2}\endgroup %
2741 \catcode 61=
\other % Turn off change made in \defparsebody
2744 % @defspec == @deffn Special Form
2746 \def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
2748 \def\defspecheader #1#2{\doind {fn
}{\code{#1}}% Make entry in function index
2749 \begingroup\defname {#1}{Special Form
}%
2750 \defunargs {#2}\endgroup %
2751 \catcode 61=
\other % Turn off change made in \defparsebody
2754 % This definition is run if you use @defunx
2755 % anywhere other than immediately after a @defun or @defunx.
2757 \def\deffnx #1 {\errmessage{@deffnx in invalid context
}}
2758 \def\defunx #1 {\errmessage{@defunx in invalid context
}}
2759 \def\defmacx #1 {\errmessage{@defmacx in invalid context
}}
2760 \def\defspecx #1 {\errmessage{@defspecx in invalid context
}}
2761 \def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context
}}
2762 \def\deftypeunx #1 {\errmessage{@deftypeunx in invalid context
}}
2764 % @defmethod, and so on
2766 % @defop {Funny Method} foo-class frobnicate argument
2768 \def\defop #1 {\def\defoptype{#1}%
2769 \defopparsebody\Edefop\defopx\defopheader\defoptype}
2771 \def\defopheader #1#2#3{%
2772 \dosubind {fn
}{\code{#2}}{on
#1}% Make entry in function index
2773 \begingroup\defname {#2}{\defoptype{} on
#1}%
2774 \defunargs {#3}\endgroup %
2777 % @defmethod == @defop Method
2779 \def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
2781 \def\defmethodheader #1#2#3{%
2782 \dosubind {fn
}{\code{#2}}{on
#1}% entry in function index
2783 \begingroup\defname {#2}{Method on
#1}%
2784 \defunargs {#3}\endgroup %
2787 % @defcv {Class Option} foo-class foo-flag
2789 \def\defcv #1 {\def\defcvtype{#1}%
2790 \defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
2792 \def\defcvarheader #1#2#3{%
2793 \dosubind {vr
}{\code{#2}}{of
#1}% Make entry in var index
2794 \begingroup\defname {#2}{\defcvtype{} of
#1}%
2795 \defvarargs {#3}\endgroup %
2798 % @defivar == @defcv {Instance Variable}
2800 \def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
2802 \def\defivarheader #1#2#3{%
2803 \dosubind {vr
}{\code{#2}}{of
#1}% Make entry in var index
2804 \begingroup\defname {#2}{Instance Variable of
#1}%
2805 \defvarargs {#3}\endgroup %
2808 % These definitions are run if you use @defmethodx, etc.,
2809 % anywhere other than immediately after a @defmethod, etc.
2811 \def\defopx #1 {\errmessage{@defopx in invalid context
}}
2812 \def\defmethodx #1 {\errmessage{@defmethodx in invalid context
}}
2813 \def\defcvx #1 {\errmessage{@defcvx in invalid context
}}
2814 \def\defivarx #1 {\errmessage{@defivarx in invalid context
}}
2818 % First, define the processing that is wanted for arguments of @defvar.
2819 % This is actually simple: just print them in roman.
2820 % This must expand the args and terminate the paragraph they make up
2821 \def\defvarargs #1{\normalparens #1%
2822 \interlinepenalty=
10000
2823 \endgraf\penalty 10000\vskip -
\parskip\penalty 10000}
2825 % @defvr Counter foo-count
2827 \def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader}
2829 \def\defvrheader #1#2#3{\doind {vr
}{\code{#2}}%
2830 \begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup}
2832 % @defvar == @defvr Variable
2834 \def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader}
2836 \def\defvarheader #1#2{\doind {vr
}{\code{#1}}% Make entry in var index
2837 \begingroup\defname {#1}{Variable
}%
2838 \defvarargs {#2}\endgroup %
2841 % @defopt == @defvr {User Option}
2843 \def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader}
2845 \def\defoptheader #1#2{\doind {vr
}{\code{#1}}% Make entry in var index
2846 \begingroup\defname {#1}{User Option
}%
2847 \defvarargs {#2}\endgroup %
2850 % @deftypevar int foobar
2852 \def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader}
2854 % #1 is the data type. #2 is the name.
2855 \def\deftypevarheader #1#2{%
2856 \doind {vr
}{\code{#2}}% Make entry in variables index
2857 \begingroup\defname {\code{#1} #2}{Variable
}%
2858 \interlinepenalty=
10000
2859 \endgraf\penalty 10000\vskip -
\parskip\penalty 10000
2862 % @deftypevr {Global Flag} int enable
2864 \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
2866 \def\deftypevrheader #1#2#3{\doind {vr
}{\code{#3}}%
2867 \begingroup\defname {\code{#2} #3}{#1}
2868 \interlinepenalty=
10000
2869 \endgraf\penalty 10000\vskip -
\parskip\penalty 10000
2872 % This definition is run if you use @defvarx
2873 % anywhere other than immediately after a @defvar or @defvarx.
2875 \def\defvrx #1 {\errmessage{@defvrx in invalid context
}}
2876 \def\defvarx #1 {\errmessage{@defvarx in invalid context
}}
2877 \def\defoptx #1 {\errmessage{@defoptx in invalid context
}}
2878 \def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context
}}
2879 \def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context
}}
2882 % Args are printed in bold, a slight difference from @defvar.
2884 \def\deftpargs #1{\bf \defvarargs{#1}}
2886 % @deftp Class window height width ...
2888 \def\deftp{\defvrparsebody\Edeftp\deftpx\deftpheader}
2890 \def\deftpheader #1#2#3{\doind {tp
}{\code{#2}}%
2891 \begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
2893 % This definition is run if you use @deftpx, etc
2894 % anywhere other than immediately after a @deftp, etc.
2896 \def\deftpx #1 {\errmessage{@deftpx in invalid context
}}
2898 \message{cross reference,
}
2899 % Define cross-reference macros
2902 \newif\ifhavexrefs % True if xref values are known.
2903 \newif\ifwarnedxrefs % True if we warned once that they aren't known.
2905 % \setref{foo} defines a cross-reference point named foo.
2908 %\dosetq{#1-title}{Ytitle}%
2909 \dosetq{#1-pg
}{Ypagenumber
}%
2910 \dosetq{#1-snt
}{Ysectionnumberandtype
}}
2912 \def\unnumbsetref#1{%
2913 %\dosetq{#1-title}{Ytitle}%
2914 \dosetq{#1-pg
}{Ypagenumber
}%
2915 \dosetq{#1-snt
}{Ynothing
}}
2917 \def\appendixsetref#1{%
2918 %\dosetq{#1-title}{Ytitle}%
2919 \dosetq{#1-pg
}{Ypagenumber
}%
2920 \dosetq{#1-snt
}{Yappendixletterandtype
}}
2922 % \xref, \pxref, and \ref generate cross-references to specified points.
2923 % For \xrefX, #1 is the node name, #2 the name of the Info
2924 % cross-reference, #3 the printed node name, #4 the name of the Info
2925 % file, #5 the name of the printed manual. All but the node name can be
2928 \def\pxref#1{see
\xrefX[#1,,,,,,,
]}
2929 \def\xref#1{See
\xrefX[#1,,,,,,,
]}
2930 \def\ref#1{\xrefX[#1,,,,,,,
]}
2931 \def\xrefX[#1,
#2,
#3,
#4,
#5,
#6]{\begingroup%
2932 \def\printedmanual{\ignorespaces #5}%
2933 \def\printednodename{\ignorespaces #3}%
2935 \setbox1=
\hbox{\printedmanual}%
2936 \setbox0=
\hbox{\printednodename}%
2938 \def\printednodename{\ignorespaces #1}%
2939 %%% Uncommment the following line to make the actual chapter or section title
2940 %%% appear inside the square brackets.
2941 %\def\printednodename{#1-title}%
2945 % If we use \unhbox0 and \unhbox1 to print the node names, TeX does
2946 % not insert empty discretionaries after hyphens, which means that it
2947 % will not find a line break at a hyphen in a node names. Since some
2948 % manuals are best written with fairly long node names, containing
2949 % hyphens, this is a loss. Therefore, we simply give the text of
2950 % the node name again, so it is as if TeX is seeing it for the first
2953 section ``
\printednodename'' in
\cite{\printedmanual}%
2956 \refx{#1-snt
}{} [\printednodename], page
\tie\refx{#1-pg
}{}%
2960 % \dosetq is the interface for calls from other macros
2962 % Use \turnoffactive so that punctuation chars such as underscore
2963 % work in node names.
2964 \def\dosetq #1#2{{\let\folio=
0 \turnoffactive%
2965 \edef\next{\write\auxfile{\internalsetq {#1}{#2}}}%
2968 % \internalsetq {foo}{page} expands into
2969 % CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
2970 % When the aux file is read, ' is the escape character
2972 \def\internalsetq #1#2{'xrdef
{#1}{\csname #2\endcsname}}
2974 % Things to be expanded by \internalsetq
2976 \def\Ypagenumber{\folio}
2978 \def\Ytitle{\thischapter}
2982 \def\Ysectionnumberandtype{%
2983 \ifnum\secno=
0 Chapter
\xreftie\the\chapno %
2984 \else \ifnum \subsecno=
0 Section
\xreftie\the\chapno.
\the\secno %
2985 \else \ifnum \subsubsecno=
0 %
2986 Section
\xreftie\the\chapno.
\the\secno.
\the\subsecno %
2988 Section
\xreftie\the\chapno.
\the\secno.
\the\subsecno.
\the\subsubsecno %
2991 \def\Yappendixletterandtype{%
2992 \ifnum\secno=
0 Appendix
\xreftie'char
\the\appendixno{}%
2993 \else \ifnum \subsecno=
0 Section
\xreftie'char
\the\appendixno.
\the\secno %
2994 \else \ifnum \subsubsecno=
0 %
2995 Section
\xreftie'char
\the\appendixno.
\the\secno.
\the\subsecno %
2997 Section
\xreftie'char
\the\appendixno.
\the\secno.
\the\subsecno.
\the\subsubsecno %
3002 % Use TeX 3.0's \inputlineno to get the line number, for better error
3003 % messages, but if we're using an old version of TeX, don't do anything.
3005 \ifx\inputlineno\thisisundefined
3006 \let\linenumber =
\empty % Non-3.0.
3008 \def\linenumber{\the\inputlineno:
\space}
3011 % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
3012 % If its value is nonempty, SUFFIX is output afterward.
3015 \expandafter\ifx\csname X
#1\endcsname\relax
3016 % If not defined, say something at least.
3017 $
\langle$un\-de\-fined$
\rangle$
%
3019 \message{\linenumber Undefined cross reference `
#1'.
}%
3022 \global\warnedxrefstrue
3023 \message{Cross reference values unknown; you must run TeX again.
}%
3027 % It's defined, so just use it.
3028 \csname X
#1\endcsname
3030 #2% Output the suffix in any case.
3033 % Read the last existing aux file, if any. No error if none exists.
3035 % This is the macro invoked by entries in the aux file.
3037 {\catcode`\'=
\other\expandafter \gdef \csname X
#1\endcsname {#2}}}
3041 \catcode `\^^@=
\other
3042 \catcode `\
\ 1=
\other
3043 \catcode `\
\ 2=
\other
3044 \catcode `\^^C=
\other
3045 \catcode `\^^D=
\other
3046 \catcode `\^^E=
\other
3047 \catcode `\^^F=
\other
3048 \catcode `\^^G=
\other
3049 \catcode `\^^H=
\other
3050 \catcode `\
\v=
\other
3051 \catcode `\^^L=
\other
3052 \catcode `\
\ e=
\other
3053 \catcode `\
\ f=
\other
3054 \catcode `\
\10=
\other
3055 \catcode `\
\11=
\other
3056 \catcode `\
\12=
\other
3057 \catcode `\
\13=
\other
3058 \catcode `\
\14=
\other
3059 \catcode `\
\15=
\other
3060 \catcode `\
\16=
\other
3061 \catcode `\
\17=
\other
3062 \catcode `\
\18=
\other
3063 \catcode `\
\19=
\other
3065 \catcode `\^^
[=
\other
3066 \catcode `\^^\=
\other
3067 \catcode `\^^
]=
\other
3068 \catcode `\^^^=
\other
3069 \catcode `\^^_=
\other
3083 % the aux file uses ' as the escape.
3084 % Turn off \ as an escape so we do not lose on
3085 % entries which were dumped with control sequences in their names.
3086 % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
3087 % Reference to such entries still does not work the way one would wish,
3088 % but at least they do not bomb out when the aux file is read in.
3089 \catcode `\
{=
1 \catcode `\
}=
2
3093 \openin 1 \jobname.aux
3094 \ifeof 1 \else \closein 1 \input \jobname.aux
\global\havexrefstrue
3096 % Open the new aux file. Tex will close it automatically at exit.
3097 \openout \auxfile=
\jobname.aux
3103 \newcount \footnoteno
3105 % The trailing space in the following definition for supereject is
3106 % vital for proper filling; pages come out unaligned when you do a
3107 % pagealignmacro call if that space before the closing brace is
3109 \def\supereject{\par\penalty -
20000\footnoteno =
0 }
3111 % @footnotestyle is meaningful for info output only..
3112 \let\footnotestyle=
\comment
3114 \let\ptexfootnote=
\footnote
3117 \long\gdef\footnote #1{\global\advance \footnoteno by \@ne
3119 \edef\thisfootno{$^
{\the\footnoteno}$
}%
3121 \ifhmode\edef\@sf
{\spacefactor\the\spacefactor}\/
\fi
3122 \thisfootno\@sf
\footnotezzz{#1}}
3123 % \parsearg\footnotezzz}
3125 \long\gdef\footnotezzz #1{\insert\footins{
3126 \interlinepenalty\interfootnotelinepenalty
3127 \splittopskip\ht\strutbox % top baseline for broken footnotes
3128 \splitmaxdepth\dp\strutbox \floatingpenalty\@MM
3129 \leftskip\z@skip
\rightskip\z@skip
\spaceskip\z@skip
\xspaceskip\z@skip
3130 \footstrut\parindent=
\defaultparindent\hang\textindent{\thisfootno}#1\strut}}
3132 }%end \catcode `\@=11
3134 % End of control word definitions.
3136 \message{and turning on texinfo input format.
}
3147 % Set some numeric style parameters, for 8.5 x 11 format.
3150 \newdimen\defaultparindent \defaultparindent =
15pt
3151 \parindent =
\defaultparindent
3152 \parskip 18pt plus
1pt
3154 \advance\topskip by
1.2cm
3156 % Prevent underfull vbox error messages.
3159 % Following George Bush, just get rid of widows and orphans.
3163 % Use TeX 3.0's \emergencystretch to help line breaking, but if we're
3164 % using an old version of TeX, don't do anything. We want the amount of
3165 % stretch added to depend on the line length, hence the dependence on
3166 % \hsize. This makes it come to about 9pt for the 8.5x11 format.
3168 \ifx\emergencystretch\thisisundefined \else
3169 \emergencystretch =
\hsize
3170 \divide\emergencystretch by
45
3173 % Use @smallbook to reset parameters for 7x9.5 format (or else 7x9.25)
3175 \global\lispnarrowing =
0.3in
3176 \global\baselineskip 12pt
3177 \advance\topskip by -
1cm
3178 \global\parskip 3pt plus
1pt
3180 \global\doublecolumnhsize=
2.4in
\global\doublecolumnvsize=
15.0in
3182 \global\tolerance=
700
3184 \global\contentsrightmargin=
0pt
3186 \global\pagewidth=
\hsize
3187 \global\pageheight=
\vsize
3189 \global\let\smalllisp=
\smalllispx
3190 \global\let\smallexample=
\smalllispx
3191 \global\def\Esmallexample{\Esmalllisp}
3194 % Use @afourpaper to print on European A4 paper.
3196 \global\tolerance=
700
3198 \global\baselineskip=
12pt
3199 \global\parskip 15pt plus
1pt
3201 \global\vsize=
53\baselineskip
3202 \advance\vsize by
\topskip
3203 %\global\hsize= 5.85in % A4 wide 10pt
3204 \global\hsize=
6.5in
3205 \global\outerhsize=
\hsize
3206 \global\advance\outerhsize by
0.5in
3207 \global\outervsize=
\vsize
3208 \global\advance\outervsize by
0.6in
3209 \global\doublecolumnhsize=
\hsize
3210 \global\divide\doublecolumnhsize by
2
3211 \global\advance\doublecolumnhsize by -
0.1in
3212 \global\doublecolumnvsize=
\vsize
3213 \global\multiply\doublecolumnvsize by
2
3214 \global\advance\doublecolumnvsize by
0.1in
3216 \global\pagewidth=
\hsize
3217 \global\pageheight=
\vsize
3220 %% For a final copy, take out the rectangles
3221 %% that mark overfull boxes (in case you have decided
3222 %% that the text looks ok even though it passes the margin).
3223 \def\finalout{\overfullrule=
0pt
}
3225 % Define macros to output various characters with catcode for normal text.
3234 \def\normaldoublequote{"
}
3237 \def\normalunderscore{_
}
3238 \def\normalverticalbar{|
}
3240 \def\normalgreater{>
}
3243 % This macro is used to make a character print one way in ttfont
3244 % where it can probably just be output, and another way in other fonts,
3245 % where something hairier probably needs to be done.
3247 % #1 is what to print if we are indeed using \tt; #2 is what to print
3248 % otherwise. Since all the Computer Modern typewriter fonts have zero
3249 % interword stretch (and shrink), and it is reasonable to expect all
3250 % typewriter fonts to have this, we can check that font parameter.
3252 \def\ifusingtt#1#2{\ifdim \fontdimen3\the\font=
0pt
#1\else #2\fi}
3254 % Turn off all special characters except @
3255 % (and those which the user can use as if they were ordinary).
3256 % Most of these we simply print from the \tt font, but for some, we can
3257 % use math or other variants that look better in normal text.
3260 \def\activedoublequote{{\tt \char '
042}}
3261 \let"=
\activedoublequote
3263 \def~
{{\tt \char '
176}}
3269 \def_{\ifusingtt\normalunderscore\_}
3270 % Subroutine for the previous macro.
3271 \def\_{\lvvmode \kern.06em
\vbox{\hrule width
.3em height
.1ex
}}
3273 % \lvvmode is equivalent in function to \leavevmode.
3274 % Using \leavevmode runs into trouble when written out to
3275 % an index file due to the expansion of \leavevmode into ``\unhbox
3276 % \voidb@x'' ---which looks to TeX like ``\unhbox \voidb\x'' due to our
3277 % magic tricks with @.
3278 \def\lvvmode{\vbox to
0pt
{}}
3281 \def|
{{\tt \char '
174}}
3289 \def+
{{\tt \char 43}}
3290 %\catcode 27=\active
3291 %\def^^[{$\diamondsuit$}
3293 % Used sometimes to turn off (effectively) the active characters
3294 % even after parsing them.
3295 \def\turnoffactive{\let"=
\normaldoublequote
3298 \let_=
\normalunderscore
3299 \let|=
\normalverticalbar
3301 \let>=
\normalgreater
3304 % Set up an active definition for =, but don't enable it most of the time.
3305 {\catcode`\==
\active
3306 \global\def=
{{\tt \char 61}}}
3310 % \rawbackslashxx output one backslash character in current font
3311 \global\chardef\rawbackslashxx=`\\
3312 %{\catcode`\\=\other
3313 %@gdef@rawbackslashxx{\}}
3315 % \rawbackslash redefines \ as input to do \rawbackslashxx.
3316 {\catcode`\\=
\active
3317 @gdef@rawbackslash
{@let\=@rawbackslashxx
}}
3319 % \normalbackslash outputs one backslash in fixed width font.
3320 \def\normalbackslash{{\tt\rawbackslashxx}}
3322 % Say @foo, not \foo, in error messages.
3325 % \catcode 17=0 % Define control-q
3328 % If a .fmt file is being used, we don't want the `\input texinfo' to show up.
3329 % That is what \eatinput is for; after that, the `\' should revert to printing
3332 @gdef@eatinput input texinfo
{@fixbackslash
}
3333 @global@let\ = @eatinput
3335 % On the other hand, perhaps the file did not have a `\input texinfo'. Then
3336 % the first `\{ in the file would cause an error. This macro tries to fix
3337 % that, assuming it is called before the first `\' could plausibly occur.
3339 @gdef@fixbackslash
{@ifx\@eatinput @let\ = @normalbackslash @fi
}
3341 %% These look ok in all fonts, so just make them not special. The @rm below
3342 %% makes sure that the current font starts out as the newly loaded cmr10
3343 @catcode`@$=@other @catcode`@
%=@other @catcode`@&=@other @catcode`@#=@other
3349 @c page-delimiter: "^\\\
\message"