1 %% TeX macros to handle texinfo files
3 % Copyright (C) 1985, 1986, 1988 Free Software Foundation, Inc.
5 %GNU CC is free software; you can redistribute it and/or modify
6 %it under the terms of the GNU General Public License as published by
7 %the Free Software Foundation; either version 1, or (at your option)
10 %GNU CC is distributed in the hope that it will be useful,
11 %but WITHOUT ANY WARRANTY; without even the implied warranty of
12 %MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 %GNU General Public License for more details.
15 %You should have received a copy of the GNU General Public License
16 %along with GNU CC; see the file COPYING. If not, write to
17 %the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
20 %In other words, you are welcome to use, share and improve this program.
21 %You are forbidden to forbid anyone else to use, share and improve
22 %what you give them. Help stamp out software-hoarding!
24 \def\texinfoversion{2.1}
25 \message{Loading texinfo package [Version \texinfoversion]:}
28 % Save some parts of plain tex whose names we will redefine.
35 \let\ptexbullet=\bullet
43 \def\tie{\penalty 10000\ } % Save plain tex definition of ~.
48 \hyphenation{ap-pen-dix}
49 \hyphenation{mini-buf-fer mini-buf-fers}
52 % Margin to add to right of even pages, to left of odd pages.
53 \newdimen \bindingoffset \bindingoffset=0pt
54 \newdimen \normaloffset \normaloffset=\hoffset
55 \newdimen\pagewidth \newdimen\pageheight
56 \pagewidth=\hsize \pageheight=\vsize
58 %---------------------Begin change-----------------------
60 % Dimensions to add cropmarks at corners Added by P. A. MacKay, 12 Nov. 1986
62 \newdimen\cornerlong \newdimen\cornerthick
63 \newdimen \topandbottommargin
64 \newdimen \outerhsize \newdimen \outervsize
65 \cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks
68 \topandbottommargin=.75in
70 %---------------------End change-----------------------
72 % \onepageout takes a vbox as an argument. Note that \pagecontents
73 % does insertions itself, but you have to call it yourself.
74 \chardef\PAGE=255 \output={\onepageout{\pagecontents\PAGE}}
75 \def\onepageout#1{\hoffset=\normaloffset
76 \ifodd\pageno \advance\hoffset by \bindingoffset
77 \else \advance\hoffset by -\bindingoffset\fi
78 \shipout\vbox{{\let\hsize=\pagewidth \makeheadline} \pagebody{#1}%
79 {\let\hsize=\pagewidth \makefootline}}
80 \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi}
83 % Here is a modification of the main output routine for Near East Publications
84 % This provides right-angle cropmarks at all four corners.
85 % The contents of the page are centerlined into the cropmarks,
86 % and any desired binding offset is added as an \hskip on either
87 % site of the centerlined box. (P. A. MacKay, 12 November, 1986)
89 \def\croppageout#1{\hoffset=0pt % make sure this doesn't mess things up
91 \vbox to \outervsize{\hsize=\outerhsize
92 \vbox{\line{\ewtop\hfill\ewtop}}
94 \line{\vbox{\moveleft\cornerthick\nstop}
96 \vbox{\moveright\cornerthick\nstop}}
97 \vskip \topandbottommargin
98 \centerline{\ifodd\pageno\hskip\bindingoffset\fi
100 {\let\hsize=\pagewidth \makeheadline}
102 {\let\hsize=\pagewidth \makefootline}}
103 \ifodd\pageno\else\hskip\bindingoffset\fi}
104 \vskip \topandbottommargin plus1fill minus1fill
105 \boxmaxdepth\cornerthick
106 \line{\vbox{\moveleft\cornerthick\nsbot}
108 \vbox{\moveright\cornerthick\nsbot}}
110 \vbox{\line{\ewbot\hfill\ewbot}}
113 \ifnum\outputpenalty>-20000 \else\dosupereject\fi}
115 % Do @cropmarks to get crop marks
116 \def\cropmarks{\let\onepageout=\croppageout }
118 \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
120 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
121 \dimen@=\dp#1 \unvbox#1
122 \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
123 \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
127 % Here are the rules for the cropmarks. Note that they are
128 % offset so that the space between them is truly \outerhsize or \outervsize
129 % (P. A. MacKay, 12 November, 1986)
131 \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
133 {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
134 \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
136 {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
138 % Parse an argument, then pass it to #1.
139 % The argument can be delimited with [...] or with "..." or braces
140 % or it can be a whole line.
141 % #1 should be a macro which expects
142 % an ordinary undelimited TeX argument.
144 \def\parsearg #1{\let\next=#1\begingroup\obeylines\futurelet\temp\parseargx}
147 \ifx \obeyedspace\temp \aftergroup\parseargdiscardspace \else%
148 \aftergroup \parseargline %
152 \gdef\parseargdiscardspace {\begingroup\obeylines\futurelet\temp\parseargx}}
154 \gdef\obeyedspace{\ }
156 \def\parseargline{\begingroup \obeylines \parsearglinex}
158 \gdef\parsearglinex #1^^M{\endgroup \next {#1}}}
160 \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
162 %% These are used to keep @begin/@end levels from running away
163 %% Call \inENV within environments (after a \begingroup)
164 \newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
166 \ifENV\errmessage{Still within an environment. Type Return to continue.}
167 \endgroup\fi} % This is not perfect, but it should reduce lossage
169 % @begin foo is the same as @foo, for now.
170 \newhelp\EMsimple{Type <Return> to continue}
172 \outer\def\begin{\parsearg\beginxxx}
175 \expandafter\ifx\csname #1\endcsname\relax
176 {\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else
177 \csname #1\endcsname\fi}
179 %% @end foo executes the definition of \Efoo.
180 %% foo can be delimited by doublequotes or brackets.
182 \def\end{\parsearg\endxxx}
185 \expandafter\ifx\csname E#1\endcsname\relax
186 \expandafter\ifx\csname #1\endcsname\relax
187 \errmessage{Undefined command @end #1}\else
189 \csname E#1\endcsname}
191 {\errhelp=\EMsimple \errmessage{@end #1 not within #1 environment}}}
193 % Single-spacing is done by various environments.
195 \newskip\singlespaceskip \singlespaceskip = \baselineskip
197 {\advance \baselineskip by -\singlespaceskip
198 \kern \baselineskip}%
199 \baselineskip=\singlespaceskip
202 %% Simple single-character @ commands
205 % Kludge this until the fonts are right (grr).
206 \def\@{{\sf \char '100}}
208 % Define @` and @' to be the same as ` and '
209 % but suppressing ligatures.
213 % Used to generate quoted braces.
215 \def\mylbrace {{\tt \char '173}}
216 \def\myrbrace {{\tt \char '175}}
220 % @: forces normal size whitespace following.
221 \def\:{\spacefactor=1000 }
223 % @* forces a line break.
226 % @. is an end-of-sentence period.
227 \def\.{.\spacefactor=3000 }
229 % @w prevents a word break
232 % @group ... @end group forces ... to be all on one page.
234 \def\group{\begingroup% \inENV ???
235 \def \Egroup{\egroup\endgroup}
238 % @br forces paragraph break
242 % @dots{} output some dots
246 % @page forces the start of a new page
248 \def\page{\par\vfill\supereject}
251 % outputs text on separate line in roman font, starting at standard page margin
253 \def\exdent{\errmessage{@exdent in filled text}}
254 % @lisp, etc, define \exdent locally from \internalexdent
257 \gdef\internalexdent{\parsearg\exdentzzz}}
259 \def\exdentzzz #1{{\advance \leftskip by -\lispnarrowing
260 \advance \hsize by -\leftskip
261 \advance \hsize by -\rightskip
264 % @include file insert text of that file as input.
266 \def\include{\parsearg\includezzz}
267 \def\includezzz #1{{\def\thisfile{#1}\input #1
272 % @center line outputs that line, centered
274 \def\center{\parsearg\centerzzz}
275 \def\centerzzz #1{{\advance\hsize by -\leftskip
276 \advance\hsize by -\rightskip
279 % @sp n outputs n lines of vertical space
281 \def\sp{\parsearg\spxxx}
282 \def\spxxx #1{\par \vskip #1\baselineskip}
284 % @comment ...line which is ignored...
285 % @c is the same as @comment
286 % @ignore ... @end ignore is another way to write a comment
288 \def\comment{\parsearg \commentxxx}
294 % Prevent errors for section commands.
295 % Used in @ignore and in failing conditionals.
296 \def\ignoresections{%
298 \let\unnumbered=\relax
299 \let\unnumberedsec=\relax
300 \let\unnumberedsection=\relax
301 \let\unnumberedsubsec=\relax
302 \let\unnumberedsubsection=\relax
303 \let\unnumberedsubsubsec=\relax
304 \let\unnumberedsubsubsection=\relax
307 \let\subsubsec=\relax
308 \let\subsection=\relax
309 \let\subsubsection=\relax
311 \let\appendixsec=\relax
312 \let\appendixsection=\relax
313 \let\appendixsubsec=\relax
314 \let\appendixsubsection=\relax
315 \let\appendixsubsubsec=\relax
316 \let\appendixsubsubsection=\relax
319 \def\ignore{\begingroup\ignoresections\ignorexxx}
320 \long\def\ignorexxx #1\end ignore{\endgroup}
322 % Conditionals to test whether a flag is set.
324 \outer\def\ifset{\begingroup\ignoresections\parsearg\ifsetxxx}
326 \def\ifsetxxx #1{\endgroup
327 \expandafter\ifx\csname IF#1\endcsname\relax \let\temp=\ifsetfail
328 \else \let\temp=\relax \fi
331 \def\ifsetfail{\begingroup\ignoresections\ifsetfailxxx}
332 \long\def\ifsetfailxxx #1\end ifset{\endgroup}
334 \outer\def\ifclear{\begingroup\ignoresections\parsearg\ifclearxxx}
336 \def\ifclearxxx #1{\endgroup
337 \expandafter\ifx\csname IF#1\endcsname\relax \let\temp=\relax
338 \else \let\temp=\ifclearfail \fi
341 \def\ifclearfail{\begingroup\ignoresections\ifclearfailxxx}
342 \long\def\ifclearfailxxx #1\end ifclear{\endgroup}
344 % Some texinfo constructs that are trivial in tex
348 \def\ifinfo{\begingroup\ignoresections\ifinfoxxx}
349 \long\def\ifinfoxxx #1\end ifinfo{\endgroup}
351 \long\def\menu #1\end menu{}
354 \def\node{\ENVcheck\parsearg\nodezzz}
355 \def\nodezzz#1{\nodexxx [#1,]}
356 \def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
359 \def\donoderef{\ifx\lastnode\relax\else
360 \expandafter\expandafter\expandafter\setref{\lastnode}\fi
361 \let\lastnode=\relax}
363 \def\unnumbnoderef{\ifx\lastnode\relax\else
364 \expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi
365 \let\lastnode=\relax}
367 \def\appendixnoderef{\ifx\lastnode\relax\else
368 \expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi
369 \let\lastnode=\relax}
373 % @setfilename is done at the beginning of every texinfo file.
374 % So open here the files we need to have open while reading the input.
375 % This makes it possible to make a .fmt file for texinfo.
380 \fixbackslash % Turn off hack to swallow `\input texinfo'.
381 \comment % Ignore the actual filename.
384 \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
386 \def\inforef #1{\inforefzzz #1,,,,**}
387 \def\inforefzzz #1,#2,#3,#4**{See Info file \file{\losespace#3{}}, node `\losespace#1{}'}
388 \def\losespace #1{#1}
392 % Font-change commands.
394 %% Try out Computer Modern fonts at \magstephalf
395 \font\tenrm=cmr10 scaled \magstephalf
396 \font\tentt=cmtt10 scaled \magstephalf
397 % Instead of cmb10, you many want to use cmbx10.
398 % cmbx10 is a prettier font on its own, but cmb10
399 % looks better when embedded in a line with cmr10.
400 \font\tenbf=cmb10 scaled \magstephalf
401 \font\tenit=cmti10 scaled \magstephalf
402 \font\tensl=cmsl10 scaled \magstephalf
403 \font\tensf=cmss10 scaled \magstephalf
405 \font\tensc=cmcsc10 scaled \magstephalf
407 % Fonts for @defun, etc.
408 \font\defbf=cmbx10 scaled \magstep1 %was 1314
410 \def\df{\let\tt=\deftt \defbf}
413 \font\titlerm = cmbx10 scaled \magstep5
416 \font\indit=cmti9 \font\indrm=cmr9
418 \def\indbf{\indrm} \def\indsl{\indit}
419 \def\indexfonts{\let\it=\indit \let\sl=\indsl \let\bf=\indbf \let\rm=\indrm
423 \font\chaprm=cmbx10 scaled \magstep3
424 \font\chapit=cmti10 scaled \magstep3
425 \font\chapsl=cmsl10 scaled \magstep3
426 \font\chaptt=cmtt10 scaled \magstep3
427 \font\chapsf=cmss10 scaled \magstep3
430 \font\secrm=cmbx10 scaled \magstep2
431 \font\secit=cmti10 scaled \magstep2
432 \font\secsl=cmsl10 scaled \magstep2
433 \font\sectt=cmtt10 scaled \magstep2
434 \font\secsf=cmss10 scaled \magstep2
437 % \font\ssecrm=cmbx10 scaled \magstep1 % This size an fontlooked bad.
438 % \font\ssecit=cmti10 scaled \magstep1 % The letters were too crowded.
439 % \font\ssecsl=cmsl10 scaled \magstep1
440 % \font\ssectt=cmtt10 scaled \magstep1
441 % \font\ssecsf=cmss10 scaled \magstep1
443 \font\ssecrm=cmb10 at 13pt % Note the use of cmb rather than cmbx.
444 \font\ssecit=cmti10 at 13pt % Also, the size is a little larger than
445 \font\ssecsl=cmsl10 at 13pt % being scaled magstep1.
446 \font\ssectt=cmtt10 at 13pt
447 \font\ssecsf=cmss10 at 13pt
451 \def\textfonts{\let\rm=\tenrm\let\it=\tenit\let\sl=\tensl\let\bf=\tenbf%
452 \let\smallcaps=\tensc\let\sf=\tensf}
453 \def\chapfonts{\let\rm=\chaprm\let\it=\chapit\let\sl=\chapsl\let\bf=\chapbf\let\tt=\chaptt\let\sf=\chapsf}
454 \def\secfonts{\let\rm=\secrm\let\it=\secit\let\sl=\secsl\let\bf=\secbf\let\tt=\sectt\let\sf=\secsf}
455 \def\subsecfonts{\let\rm=\ssecrm\let\it=\ssecit\let\sl=\ssecsl\let\bf=\ssecbf\let\tt=\ssectt\let\sf=\ssecsf}
456 % Count depth in font-changes, for error checks
457 \newcount\fontdepth \fontdepth=0
459 % Font for table of contents.
460 \font\truesecrm=cmr12
462 %% Add scribe-like font environments, plus @l for inline lisp (usually sans
463 %% serif) and @ii for TeX italic
465 % \smartitalic{ARG} outputs arg in italics, followed by an italic correction
466 % unless the following character is such as not to need one.
467 \def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
468 \def\smartitalic#1{{\sl #1}\futurelet\next\smartitalicx}
471 \let\var=\smartitalic
472 \let\dfn=\smartitalic
473 \let\emph=\smartitalic
474 \let\cite=\smartitalic
479 \def\t#1{{\tt \rawbackslash \frenchspacing #1}\null}
481 %\def\samp #1{`{\tt \rawbackslash \frenchspacing #1}'\null}
482 \def\samp #1{`\tclose{#1}'\null}
483 \def\key #1{{\tt \uppercase{#1}}\null}
484 \def\ctrl #1{{\tt \rawbackslash \hat}#1}
488 % @code is a modification of @t,
489 % which makes spaces the same size as normal in the surrounding text.
492 \def\tclose#1{{\rm \tcloserm=\fontdimen2\font \tt \tclosesave=\fontdimen2\font
493 \fontdimen2\font=\tcloserm
494 \def\ {{\fontdimen2\font=\tclosesave{} }}%
495 \rawbackslash \frenchspacing #1\fontdimen2\font=\tclosesave}\null}
497 %\let\exp=\tclose %Was temporary
499 % @kbd is like @code, except that if the argument is just one @key command,
500 % then @kbd has no effect.
503 \def\kbdfoo#1#2#3*{\def\one{#1}\def\three{#3}\def\threex{??}%
504 \ifx\one\xkey\ifx\threex\three \key{#2}
505 \else\tclose{\look}\fi
506 \else\tclose{\look}\fi}
508 \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??*}
510 \def\l#1{{\li #1}\null} %
512 \def\r#1{{\rm #1}} % roman font
513 \def\sc#1{{\smallcaps #1}} % smallcaps font
514 \def\ii#1{{\it #1}} % italic font
516 \message{page headings,}
518 \newskip\titlepagetopglue \titlepagetopglue = 1.5in
519 \newskip\titlepagebottomglue \titlepagebottomglue = 2pc
521 % First the title page. Must do @settitle before @titlepage.
522 \font\titlerm = cmbx12 scaled \magstep2
523 \def\titlefont#1{{\titlerm #1}}
525 \newtoks\realeverypar
528 \def\titlepage{\begingroup \parindent=0pt \textfonts
529 \font\subtitlerm = cmr10 scaled \magstephalf
530 \def\subtitlefont{\subtitlerm \normalbaselineskip = 12pt \normalbaselines}%
532 \font\authorrm = cmbx12 scaled \magstep1
533 \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}%
535 % The first subtitle should have some space before it, but not the
536 % others. They all should be ragged left.
537 % This code caused a bug, since two groups were started, but only
538 % one was ended. Also, I can't see the point of this code.
539 % \begingroup \realeverypar = {\leftskip = 2in plus 3em minus 1em
540 % \parfillskip = 0pt}%
541 % \everypar = {\vglue \baselineskip \the\realeverypar
542 % \everypar={\the\realeverypar}}%
544 % Now you can print the title using @title.
545 \def\title{\parsearg\titlezzz}%
546 \def\titlezzz##1{\leftline{\titlefont{##1}
547 \vskip4pt \hrule height 4pt \vskip4pt}}%
548 \vglue\titlepagetopglue
550 % Now you can put text using @subtitle.
551 \def\subtitle{\parsearg\subtitlezzz}%
552 \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}%
554 % @author should come last, but may come many times.
555 \def\author{\parsearg\authorzzz}%
556 \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi
557 {\authorfont \leftline{##1}}}%
559 % Most title ``pages'' are actually two pages long, with space
560 % at the top of the second. We don't want the ragged left on the second.
562 % \def\page{\vskip4pt \hrule height 2pt \vskip\titlepagebottomglue
563 % \oldpage \endgroup\hrule height0pt\relax}%
564 \def\page{\oldpage \hbox{}}
567 \def\Etitlepage{\endgroup\page\HEADINGSon}
569 %%% Set up page headings and footings.
573 \newtoks \evenheadline % Token sequence for heading line of even pages
574 \newtoks \oddheadline % Token sequence for heading line of odd pages
575 \newtoks \evenfootline % Token sequence for footing line of even pages
576 \newtoks \oddfootline % Token sequence for footing line of odd pages
578 % Now make Tex use those variables
579 \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline \else \the\evenheadline \fi}}
580 \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline \else \the\evenfootline \fi}}
582 % Commands to set those variables.
583 % For example, this is what @headings on does
584 % @evenheading @thistitle|@thispage|@thischapter
585 % @oddheading @thischapter|@thispage|@thistitle
586 % @evenfooting @thisfile||
587 % @oddfooting ||@thisfile
589 \def\evenheading{\parsearg\evenheadingxxx}
590 \def\oddheading{\parsearg\oddheadingxxx}
591 \def\everyheading{\parsearg\everyheadingxxx}
593 \def\evenfooting{\parsearg\evenfootingxxx}
594 \def\oddfooting{\parsearg\oddfootingxxx}
595 \def\everyfooting{\parsearg\everyfootingxxx}
599 \gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish}
600 \gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{%
601 \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
603 \gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish}
604 \gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{%
605 \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
607 \gdef\everyheadingxxx #1{\everyheadingyyy #1@|@|@|@|\finish}
608 \gdef\everyheadingyyy #1@|#2@|#3@|#4\finish{%
609 \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
610 \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
612 \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish}
613 \gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{%
614 \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
616 \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish}
617 \gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{%
618 \global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
620 \gdef\everyfootingxxx #1{\everyfootingyyy #1@|@|@|@|\finish}
621 \gdef\everyfootingyyy #1@|#2@|#3@|#4\finish{%
622 \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
623 \global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
625 }% unbind the catcode of @.
627 % @headings double turns headings on for double-sided printing.
628 % @headings single turns headings on for single-sided printing.
629 % @headings off turns them off.
630 % @headings on same as @headings double, retained for compatibility.
631 % By default, they are off.
633 \def\headings #1 {\csname HEADINGS#1\endcsname}
636 \global\evenheadline={\hfil} \global\evenfootline={\hfil}
637 \global\oddheadline={\hfil} \global\oddfootline={\hfil}}
639 % When we turn headings on, set the page number to 1.
640 % For double-sided printing, put current file name in lower left corner,
641 % chapter name on inside top of right hand pages, document
642 % title on inside top of left hand pages, and page numbers on outside top
647 \global\evenfootline={\hfil}
648 \global\oddfootline={\hfil}
649 \global\evenheadline={\line{\folio\hfil\thistitle}}
650 \global\oddheadline={\line{\thischapter\hfil\folio}}
652 % For single-sided printing, chapter title goes across top left of page,
653 % page number on top right.
657 \global\evenfootline={\hfil}
658 \global\oddfootline={\hfil}
659 \global\evenheadline={\line{\thischapter\hfil\folio}}
660 \global\oddheadline={\line{\thischapter\hfil\folio}}
662 \def\HEADINGSon{\HEADINGSdouble}
664 % Subroutines used in generating headings
665 % Produces Day Month Year style of output.
666 \def\today{\number\day\space
668 January\or February\or March\or April\or May\or June\or
669 July\or August\or September\or October\or November\or December\fi
672 % Use this if you want the Month Day, Year style of output.
673 %\def\today{\ifcase\month\or
674 %January\or February\or March\or April\or May\or June\or
675 %July\or August\or September\or October\or November\or December\fi
676 %\space\number\day, \number\year}
678 % @settitle line... specifies the title of the document, for headings
679 % It generates no output of its own
681 \def\thistitle{No Title}
682 \def\settitle{\parsearg\settitlezzz}
683 \def\settitlezzz #1{\gdef\thistitle{#1}}
687 % Tables -- @table, @ftable, @item(x), @kitem(x), @xitem(x).
689 % default indentation of table text
690 \newdimen\tableindent \tableindent=.8in
691 % default indentation of @itemize and @enumerate text
692 \newdimen\itemindent \itemindent=.3in
693 % margin between end of table item and start of table text.
694 \newdimen\itemmargin \itemmargin=.1in
696 % used internally for \itemindent minus \itemmargin
699 % Note @table and @ftable define @item, @itemx, etc., with these defs.
700 % They also define \itemindex
701 % to index the item name in whatever manner is desired (perhaps none).
703 \def\internalBitem{\smallbreak \parsearg\itemzzz}
704 \def\internalBitemx{\par \parsearg\itemzzz}
706 \def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
707 \def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \par \parsearg\xitemzzz}
709 \def\internalBkitem{\smallbreak \parsearg\kitemzzz}
710 \def\internalBkitemx{\par \parsearg\kitemzzz}
712 \def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}\itemzzz {#1}}
714 \def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}\itemzzz {#1}}
716 \def\itemzzz #1{\begingroup %
717 \advance \hsize by -\rightskip %
718 \advance \hsize by -\leftskip %
719 \setbox0=\hbox{\itemfont{#1}}%
723 \ifdim \wd0>\itemmax %
724 \vadjust{\penalty 10000}%
725 \hbox to \hsize{\hskip -\tableindent\box0\hss}\ %
727 \hbox to 0pt{\hskip -\tableindent\box0\hss}%
732 \def\item{\errmessage{@item while not in a table}}
733 \def\itemx{\errmessage{@itemx while not in a table}}
734 \def\kitem{\errmessage{@kitem while not in a table}}
735 \def\kitemx{\errmessage{@kitemx while not in a table}}
736 \def\xitem{\errmessage{@xitem while not in a table}}
737 \def\xitemx{\errmessage{@xitemx while not in a table}}
739 %% Contains a kludge to get @end[description] to work
740 \def\description{\tablez{\dontindex}{1}{}{}{}{}}
742 \def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
743 {\obeylines\obeyspaces%
745 \tabley\dontindex#1 \endtabley}}
747 \def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
748 {\obeylines\obeyspaces%
749 \gdef\ftablex #1^^M{%
750 \tabley\fnitemindex#1 \endtabley}}
753 \def\fnitemindex #1{\doind {fn}{\code{#1}}}%
756 \gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
757 \tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
759 \def\tablez #1#2#3#4#5#6{%
762 \def\Edescription{\Etable}% Neccessary kludge.
764 \ifnum 0#3>0 \advance \leftskip by #3\mil \fi %
765 \ifnum 0#4>0 \tableindent=#4\mil \fi %
766 \ifnum 0#5>0 \advance \rightskip by #5\mil \fi %
768 \itemmax=\tableindent %
769 \advance \itemmax by -\itemmargin %
770 \advance \leftskip by \tableindent %
772 \parskip = \smallskipamount
773 \ifdim \parskip=0pt \parskip=2pt \fi%
774 \def\Etable{\endgraf\endgroup\afterenvbreak}%
775 \let\item = \internalBitem %
776 \let\itemx = \internalBitemx %
777 \let\kitem = \internalBkitem %
778 \let\kitemx = \internalBkitemx %
779 \let\xitem = \internalBxitem %
780 \let\xitemx = \internalBxitemx %
783 % This is the counter used by @enumerate, which is really @itemize
787 \def\itemize{\parsearg\itemizezzz}
789 \def\itemizezzz #1{\itemizey {#1}{\Eitemize}}
795 \itemmax=\itemindent %
796 \advance \itemmax by -\itemmargin %
797 \advance \leftskip by \itemindent %
799 \parskip = \smallskipamount
800 \ifdim \parskip=0pt \parskip=2pt \fi%
801 \def#2{\endgraf\endgroup\afterenvbreak}%
802 \def\itemcontents{#1}%
803 \let\item=\itemizeitem}
805 \def\bullet{$\ptexbullet$}
808 % Set sfcode to normal for the chars that usually have another value.
810 \def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000
811 \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 }
813 \def\enumerate{\itemizey{\the\itemno.}\Eenumerate\flushcr}
815 % Definition of @item while inside @itemize.
819 {\let\par=\endgraf \smallbreak}%
820 \ifhmode \errmessage{\in hmode at itemizeitem}\fi
821 {\parskip=0in \hskip 0pt
822 \hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
823 \vadjust{\penalty 300}}%
827 % Index generation facilities
829 % Define \newwrite to be identical to plain tex's \newwrite
830 % except not \outer, so it can be used within \newindex.
832 \gdef\newwrite{\alloc@7\write\chardef\sixt@@n}}
834 % \newindex {foo} defines an index named foo.
835 % It automatically defines \fooindex such that
836 % \fooindex ...rest of line... puts an entry in the index foo.
837 % It also defines \fooindfile to be the number of the output channel for
838 % the file that accumulates this index. The file's extension is foo.
839 % The name of an index should be no more than 2 characters long
840 % for the sake of vms.
843 \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
844 \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
845 \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
846 \noexpand\doindex {#1}}
849 % @defindex foo == \newindex{foo}
851 \def\defindex{\parsearg\newindex}
853 % Define @defcodeindex, like @defindex except put all entries in @code.
855 \def\newcodeindex #1{
856 \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
857 \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
858 \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
859 \noexpand\docodeindex {#1}}
862 \def\defcodeindex{\parsearg\newcodeindex}
864 % @synindex foo bar makes index foo feed into index bar.
865 % Do this instead of @defindex foo if you don't want it as a separate index.
866 \def\synindex #1 #2 {%
867 \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
868 \noexpand\doindex {#2}}%
871 % @syncodeindex foo bar similar, but put all entries made for index foo
873 \def\syncodeindex #1 #2 {%
874 \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
875 \noexpand\docodeindex {#2}}%
878 % Define \doindex, the driver for all \fooindex macros.
879 % Argument #1 is generated by the calling \fooindex macro,
880 % and it is "foo", the name of the index.
882 % \doindex just uses \parsearg; it calls \doind for the actual work.
883 % This is because \doind is more useful to call from other macros.
885 % There is also \dosubind {index}{topic}{subtopic}
886 % which makes an entry in a two-level index such as the operation index.
888 \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
889 \def\singleindexer #1{\doind{\indexname}{#1}}
891 % like the previous two, but they put @code around the argument.
892 \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
893 \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
896 \def\bf{\realbackslash bf }%
897 \def\rm{\realbackslash rm }%
898 \def\sl{\realbackslash sl }%
899 \def\dots{\realbackslash dots }%
900 \def\copyright{\realbackslash copyright }%
901 \def\tclose##1{\realbackslash tclose {##1}}%
902 \def\code##1{\realbackslash code {##1}}%
903 \def\samp##1{\realbackslash samp {##1}}%
904 \def\r##1{\realbackslash r {##1}}%
905 \def\i##1{\realbackslash i {##1}}%
906 \def\b##1{\realbackslash b {##1}}%
907 \def\cite##1{\realbackslash cite {##1}}%
908 \def\key##1{\realbackslash key {##1}}%
909 \def\file##1{\realbackslash file {##1}}%
910 \def\var##1{\realbackslash var {##1}}%
911 \def\kbd##1{\realbackslash kbd {##1}}%
914 % \indexnofonts no-ops all font-change commands.
915 % This is used when outputting the strings to sort the index by.
916 \def\indexdummyfont#1{#1}
918 \let\r=\indexdummyfont
919 \let\i=\indexdummyfont
920 \let\b=\indexdummyfont
921 \let\emph=\indexdummyfont
922 \let\strong=\indexdummyfont
923 \let\cite=\indexdummyfont
924 \let\sc=\indexdummyfont
925 %Don't no-op \tt, since it isn't a user-level command
926 % and is used in the definitions of the actuve chars like <, >, |...
927 %\let\tt=\indexdummyfont
928 \let\tclose=\indexdummyfont
929 \let\code=\indexdummyfont
930 \let\file=\indexdummyfont
931 \let\samp=\indexdummyfont
932 \let\kbd=\indexdummyfont
933 \let\key=\indexdummyfont
934 \let\var=\indexdummyfont
937 % To define \realbackslash, we must make \ not be an escape.
938 % We must first make another character (@) an escape
939 % so we do not become unable to do a definition.
941 {\catcode`\@=0 \catcode`\\=\other
942 @gdef@realbackslash{\}}
944 \let\indexbackslash=0 %overridden during \printindex.
947 {\indexdummies % Must do this here, since \bf, etc expand at this stage
948 \count10=\lastpenalty %
950 {\let\folio=0% Expand all macros now EXCEPT \folio
951 \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
952 % so it will be output as is; and it will print as backslash in the indx.
954 % Now process the index-string once, with all font commands turned off,
955 % to get the string to sort the index by.
959 % Now produce the complete index entry. We process the index-string again,
960 % this time with font commands expanded, to get what to print in the index.
962 \write \csname#1indfile\endcsname{%
963 \realbackslash entry {\temp1}{\folio}{#2}}}%
967 \def\dosubind #1#2#3{%
968 {\indexdummies % Must do this here, since \bf, etc expand at this stage
969 \count10=\lastpenalty %
972 \def\rawbackslashxx{\indexbackslash}%
974 % Now process the index-string once, with all font commands turned off,
975 % to get the string to sort the index by.
979 % Now produce the complete index entry. We process the index-string again,
980 % this time with font commands expanded, to get what to print in the index.
982 \write \csname#1indfile\endcsname{%
983 \realbackslash entry {\temp1}{\folio}{#2}{#3}}}%
987 % The index entry written in the file actually looks like
988 % \entry {sortstring}{page}{topic}
990 % \entry {sortstring}{page}{topic}{subtopic}
991 % The texindex program reads in these files and writes files
992 % containing these kinds of lines:
994 % before the first topic whose initial is c
995 % \entry {topic}{pagelist}
996 % for a topic that is used without subtopics
998 % for the beginning of a topic that is used with subtopics
999 % \secondary {subtopic}{pagelist}
1000 % for each subtopic.
1002 % Define the user-accessible indexing commands
1003 % @findex, @vindex, @kindex, @cindex.
1005 \def\findex {\fnindex}
1006 \def\kindex {\kyindex}
1007 \def\cindex {\cpindex}
1008 \def\vindex {\vrindex}
1009 \def\tindex {\tpindex}
1010 \def\pindex {\pgindex}
1012 \def\cindexsub {\begingroup\obeylines\cindexsub}
1014 \gdef\cindexsub "#1" #2^^M{\endgroup %
1015 \dosubind{cp}{#2}{#1}}}
1017 % Define the macros used in formatting output of the sorted index material.
1019 % This is what you call to cause a particular index to get printed.
1021 % @unnumbered Function Index
1024 \def\printindex{\parsearg\doprintindex}
1026 \def\doprintindex#1{\tex %
1027 \catcode`\%=\other\catcode`\&=\other\catcode`\#=\other
1028 \catcode`\$=\other\catcode`\_=\other
1030 % The following don't help, since the chars were translated
1031 % when the raw index was written, and their fonts were discarded
1032 % due to \indexnofonts.
1033 %\catcode`\"=\active
1034 %\catcode`\^=\active
1035 %\catcode`\_=\active
1036 %\catcode`\|=\active
1037 %\catcode`\<=\active
1038 %\catcode`\>=\active
1039 \def\indexbackslash{\rawbackslashxx}
1040 \indexfonts\rm \tolerance=9500 \advance\baselineskip -1pt
1042 \openin 1 \jobname.#1s
1043 \ifeof 1 \else \closein 1 \input \jobname.#1s
1048 % These macros are used by the sorted index file itself.
1049 % Change them to control the appearance of the index.
1051 % Same as \bigskipamount except no shrink.
1052 % \balancecolumns gets confused if there is any shrink.
1053 \newskip\initialskipamount \initialskipamount 12pt plus4pt
1055 \outer\def\initial #1{%
1056 {\let\tentt=\sectt \let\sf=\sectt
1057 \ifdim\lastskip<\initialskipamount
1058 \removelastskip \penalty-200 \vskip \initialskipamount\fi
1059 \line{\secbf#1\hfill}\kern 2pt\penalty10000}}
1061 \outer\def\entry #1#2{
1062 {\parfillskip=0in \parskip=0in \parindent=0in
1063 \hangindent=1in \hangafter=1%
1064 \noindent\hbox{#1}\dotfill #2\par
1067 \def\primary #1{\line{#1\hfil}}
1069 \newskip\secondaryindent \secondaryindent=0.5cm
1071 \def\secondary #1#2{
1072 {\parfillskip=0in \parskip=0in
1073 \hangindent =1in \hangafter=1
1074 \noindent\hskip\secondaryindent\hbox{#1}\dotfill #2\par
1077 %% Define two-column mode, which is used in indexes.
1078 %% Adapted from the TeXBook, page 416
1083 \newdimen\doublecolumnhsize \doublecolumnhsize = 3.11in
1084 \newdimen\doublecolumnvsize \doublecolumnvsize = 19.1in
1085 \newdimen\availdimen@
1087 \def\begindoublecolumns{\begingroup
1088 \output={\global\setbox\partialpage=\vbox{\unvbox255\kern -\topskip \kern \baselineskip}}\eject
1089 \output={\doublecolumnout} \hsize=\doublecolumnhsize \vsize=\doublecolumnvsize}
1090 \def\enddoublecolumns{\output={\balancecolumns}\eject
1091 \endgroup \pagegoal=\vsize}
1093 \def\doublecolumnout{\splittopskip=\topskip \splitmaxdepth=\maxdepth
1094 \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage
1095 \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
1096 \onepageout\pagesofar \unvbox255 \penalty\outputpenalty}
1097 \def\pagesofar{\unvbox\partialpage %
1098 \hsize=\doublecolumnhsize % have to restore this since output routine
1099 % changes it to set cropmarks (P. A. MacKay, 12 Nov. 1986)
1100 \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}}
1101 \def\balancecolumns{%
1103 \setbox255=\vbox{\unvbox255}
1105 \advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip
1107 \availdimen@=\pageheight \advance\availdimen@ by-\ht\partialpage
1108 % If the remaining data is too big for one page,
1109 % output one page normally, then work with what remains.
1110 \ifdim \dimen@>\availdimen@
1112 \splittopskip=\topskip \splitmaxdepth=\maxdepth
1113 \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage
1114 \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
1115 \onepageout\pagesofar
1117 % Recompute size of what remains, in case we just output some of it.
1119 \advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip
1122 \setbox0=\vbox{\unvbox255}
1123 \splittopskip=\topskip
1124 {\vbadness=10000 \loop \global\setbox3=\copy0
1125 \global\setbox1=\vsplit3 to\dimen@
1126 \ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt \repeat}
1127 \setbox0=\vbox to\dimen@{\unvbox1} \setbox2=\vbox to\dimen@{\unvbox3}
1131 \message{sectioning,}
1132 % Define chapters, sections, etc.
1137 \newcount \subsubsecno
1139 % This counter is funny since it counts through charcodes of letters A, B, ...
1140 \newcount \appendixno \appendixno = `\@
1141 \def\appendixletter{\char\the\appendixno}
1143 \newwrite \contentsfile
1144 % This is called from \setfilename.
1145 \def\opencontents{\openout \contentsfile = \jobname.toc}
1147 % Each @chapter defines this as the name of the chapter.
1148 % page headings and footings can use it. @section does likewise
1150 \def\thischapter{} \def\thissection{}
1151 \def\seccheck#1{\if \pageno<0 %
1152 \errmessage{@#1 not allowed after generating table of contents}\fi
1156 \def\chapternofonts{%
1157 \let\rawbackslash=\relax%
1158 \let\frenchspacing=\relax%
1159 \def\char{\realbackslash char}
1160 \def\tclose##1{\realbackslash tclose {##1}}
1161 \def\code##1{\realbackslash code {##1}}
1162 \def\samp##1{\realbackslash samp {##1}}
1163 \def\r##1{\realbackslash r {##1}}
1164 \def\i##1{\realbackslash i {##1}}
1165 \def\b##1{\realbackslash b {##1}}
1166 \def\cite##1{\realbackslash cite {##1}}
1167 \def\key##1{\realbackslash key {##1}}
1168 \def\file##1{\realbackslash file {##1}}
1169 \def\var##1{\realbackslash var {##1}}
1170 \def\kbd##1{\realbackslash kbd {##1}}
1173 \outer\def\chapter{\parsearg\chapterzzz}
1174 \def\chapterzzz #1{\seccheck{chapter}%
1175 \secno=0 \subsecno=0 \subsubsecno=0 \global\advance \chapno by 1 \message{Chapter \the\chapno}%
1176 \chapmacro {#1}{\the\chapno}%
1177 \gdef\thissection{#1}\gdef\thischapter{#1}%
1179 \edef\temp{{\realbackslash chapentry {#1}{\the\chapno}{\noexpand\folio}}}%
1181 \write \contentsfile \temp %
1185 \outer\def\appendix{\parsearg\appendixzzz}
1186 \def\appendixzzz #1{\seccheck{appendix}%
1187 \secno=0 \subsecno=0 \subsubsecno=0 \global\advance \appendixno by 1 \message{Appendix \appendixletter}%
1188 \chapmacro {#1}{Appendix \appendixletter}%
1189 \gdef\thischapter{#1}\gdef\thissection{#1}%
1191 \edef\temp{{\realbackslash chapentry {#1}{Appendix \appendixletter}{\noexpand\folio}}}%
1193 \write \contentsfile \temp %
1197 \outer\def\unnumbered{\parsearg\unnumberedzzz}
1198 \def\unnumberedzzz #1{\seccheck{unnumbered}%
1199 \secno=0 \subsecno=0 \subsubsecno=0 \message{(#1)}
1200 \unnumbchapmacro {#1}%
1201 \gdef\thischapter{#1}\gdef\thissection{#1}%
1203 \edef\temp{{\realbackslash unnumbchapentry {#1}{\noexpand\folio}}}%
1205 \write \contentsfile \temp %
1209 \outer\def\section{\parsearg\sectionzzz}
1210 \def\sectionzzz #1{\seccheck{section}%
1211 \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
1212 \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
1214 \edef\temp{{\realbackslash secentry %
1215 {#1}{\the\chapno}{\the\secno}{\noexpand\folio}}}%
1217 \write \contentsfile \temp %
1222 \outer\def\appendixsection{\parsearg\appendixsectionzzz}
1223 \outer\def\appendixsec{\parsearg\appendixsectionzzz}
1224 \def\appendixsectionzzz #1{\seccheck{appendixsection}%
1225 \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
1226 \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
1228 \edef\temp{{\realbackslash secentry %
1229 {#1}{\appendixletter}{\the\secno}{\noexpand\folio}}}%
1231 \write \contentsfile \temp %
1236 \outer\def\unnumberedsec{\parsearg\unnumberedseczzz}
1237 \def\unnumberedseczzz #1{\seccheck{unnumberedsec}%
1238 \plainsecheading {#1}\gdef\thissection{#1}%
1240 \edef\temp{{\realbackslash unnumbsecentry{#1}{\noexpand\folio}}}%
1242 \write \contentsfile \temp %
1247 \outer\def\subsection{\parsearg\subsectionzzz}
1248 \def\subsectionzzz #1{\seccheck{subsection}%
1249 \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
1250 \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
1252 \edef\temp{{\realbackslash subsecentry %
1253 {#1}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
1255 \write \contentsfile \temp %
1260 \outer\def\appendixsubsec{\parsearg\appendixsubseczzz}
1261 \def\appendixsubseczzz #1{\seccheck{appendixsubsec}%
1262 \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
1263 \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
1265 \edef\temp{{\realbackslash subsecentry %
1266 {#1}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
1268 \write \contentsfile \temp %
1273 \outer\def\unnumberedsubsec{\parsearg\unnumberedsubseczzz}
1274 \def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}%
1275 \plainsecheading {#1}\gdef\thissection{#1}%
1277 \edef\temp{{\realbackslash unnumbsubsecentry{#1}{\noexpand\folio}}}%
1279 \write \contentsfile \temp %
1284 \outer\def\subsubsection{\parsearg\subsubsectionzzz}
1285 \def\subsubsectionzzz #1{\seccheck{subsubsection}%
1286 \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
1287 \subsubsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
1289 \edef\temp{{\realbackslash subsubsecentry %
1290 {#1}{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}%\
1292 \write \contentsfile \temp %
1297 \outer\def\appendixsubsubsec{\parsearg\appendixsubsubseczzz}
1298 \def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec}%
1299 \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
1300 \subsubsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
1302 \edef\temp{{\realbackslash subsubsecentry{#1}%
1303 {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}%\
1305 \write \contentsfile \temp %
1310 \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
1311 \def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}%
1312 \plainsecheading {#1}\gdef\thissection{#1}%
1314 \edef\temp{{\realbackslash unnumbsubsubsecentry{#1}{\noexpand\folio}}}%
1316 \write \contentsfile \temp %
1321 % These are variants which are not "outer", so they can appear in @ifinfo.
1322 \def\infounnumbered{\parsearg\unnumberedzzz}
1323 \def\infounnumberedsec{\parsearg\unnumberedseczzz}
1324 \def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz}
1325 \def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
1327 \def\infoappendix{\parsearg\appendixzzz}
1328 \def\infoappendixsec{\parsearg\appendixseczzz}
1329 \def\infoappendixsubsec{\parsearg\appendixsubseczzz}
1330 \def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz}
1332 \def\infochapter{\parsearg\chapterzzz}
1333 \def\infosection{\parsearg\sectionzzz}
1334 \def\infosubsection{\parsearg\subsectionzzz}
1335 \def\infosubsubsection{\parsearg\subsubsectionzzz}
1337 % Define @majorheading, @heading and @subheading
1339 \def\majorheading #1{%
1340 {\advance\chapheadingskip by 10pt \chapbreak }%
1341 {\chapfonts \line{\rm #1\hfill}}\bigskip \par\penalty 200}
1343 \def\chapheading #1{\chapbreak %
1344 {\chapfonts \line{\rm #1\hfill}}\bigskip \par\penalty 200}
1346 \def\heading{\parsearg\secheadingi}
1348 % These macros generate a chapter, section, etc. heading only
1349 % (including whitespace, linebreaking, etc. around it),
1350 % given all the information in convenient, parsed form.
1352 %%% Args are the skip and penalty (usually negative)
1353 \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
1355 \def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
1357 %%% Define plain chapter starts, and page on/off switching for it
1358 % Parameter controlling skip before chapter headings (if needed)
1360 \newskip \chapheadingskip \chapheadingskip = 30pt plus 8pt minus 4pt
1362 \def\chapbreak{\dobreak \chapheadingskip {-4000}}
1363 \def\chappager{\par\vfill\supereject}
1364 \def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi}
1366 \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
1369 \global\let\pchapsepmacro=\chapbreak
1370 \global\let\pagealignmacro=\chappager}
1373 \global\let\pchapsepmacro=\chappager
1374 \global\let\pagealignmacro=\chappager
1375 \global\def\HEADINGSon{\HEADINGSsingle}}
1378 \global\let\pchapsepmacro=\chapoddpage
1379 \global\let\pagealignmacro=\chapoddpage
1380 \global\def\HEADINGSon{\HEADINGSdouble}}
1385 \global\let\chapmacro=\chfplain
1386 \global\let\unnumbchapmacro=\unnchfplain}
1388 \def\chfplain #1#2{%
1390 {\chapfonts \line{\rm #2.\enspace #1\hfill}}\bigskip \par\penalty 5000 %
1393 \def\unnchfplain #1{%
1395 {\chapfonts \line{\rm #1\hfill}}\bigskip \par\penalty 10000 %
1397 \CHAPFplain % The default
1399 \def\unnchfopen #1{%
1400 \chapoddpage {\chapfonts \line{\rm #1\hfill}}\bigskip \par\penalty 10000 %
1403 \def\chfopen #1#2{\chapoddpage {\chapfonts
1404 \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
1409 \global\let\chapmacro=\chfopen
1410 \global\let\unnumbchapmacro=\unnchfopen}
1412 % Parameter controlling skip before section headings.
1414 \newskip \subsecheadingskip \subsecheadingskip = 17pt plus 8pt minus 4pt
1415 \def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}}
1417 \newskip \secheadingskip \secheadingskip = 21pt plus 8pt minus 4pt
1418 \def\secheadingbreak{\dobreak \secheadingskip {-1000}}
1421 % Section fonts are the base font at magstep2, which produces
1422 % a size a bit more than 14 points in the default situation.
1424 \def\secheading #1#2#3{\secheadingi {#2.#3\enspace #1}}
1425 \def\plainsecheading #1{\secheadingi {#1}}
1426 \def\secheadingi #1{{\advance \secheadingskip by \parskip %
1428 {\secfonts \line{\rm #1\hfill}}%
1429 \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 }
1432 % Subsection fonts are the base font at magstep1,
1433 % which produces a size of 12 points.
1435 \def\subsecheading #1#2#3#4{{\advance \subsecheadingskip by \parskip %
1436 \subsecheadingbreak}%
1437 {\subsecfonts \line{\rm#2.#3.#4\enspace #1\hfill}}%
1438 \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 }
1440 \def\subsubsecfonts{\subsecfonts} % Maybe this should change:
1441 % Perhaps make sssec fonts scaled
1443 \def\subsubsecheading #1#2#3#4#5{{\advance \subsecheadingskip by \parskip %
1444 \subsecheadingbreak}%
1445 {\subsubsecfonts \line{\rm#2.#3.#4.#5\enspace #1\hfill}}%
1446 \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000}
1449 \message{toc printing,}
1451 % Finish up the main text and prepare to read what we've written
1454 \def\startcontents#1{%
1457 \immediate\closeout \contentsfile
1458 \pageno = -1 % Request roman numbered pages.
1460 \unnumbchapmacro{#1}\def\thischapter{#1}%
1461 \begingroup % Set up to handle contents files properly.
1462 \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11
1463 \raggedbottom % Worry more about breakpoints than the bottom.
1464 \advance\hsize by -1in % Don't use the full line length.
1468 % Normal (long) toc.
1469 \outer\def\contents{%
1470 \startcontents{Table of Contents}%
1476 % And just the chapters.
1477 \outer\def\summarycontents{%
1478 \startcontents{Short Contents}%
1480 \let\chapentry = \shortchapentry
1481 \let\unnumbchapentry = \shortunnumberedentry
1482 % We want a true roman here for the page numbers.
1483 \secfonts \let\rm = \truesecrm \rm
1484 \advance\baselineskip by 1pt % Open it up a little.
1485 \def\secentry ##1##2##3##4{}
1486 \def\unnumbsecentry ##1##2{}
1487 \def\subsecentry ##1##2##3##4##5{}
1488 \def\unnumbsubsecentry ##1##2{}
1489 \def\subsubsecentry ##1##2##3##4##5##6{}
1490 \def\unnumbsubsubsecentry ##1##2{}
1495 \let\shortcontents = \summarycontents
1497 % These macros generate individual entries in the table of contents.
1498 % The first argument is the chapter or section name.
1499 % The last argument is the page number.
1500 % The arguments in between are the chapter number, section number, ...
1502 % Chapter-level things, for both the long and short contents.
1503 \def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}
1504 \def\shortchapentry#1#2#3{%
1505 \line{{#2\labelspace #1}\dotfill\doshortpageno{#3}}%
1508 \def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
1509 \def\shortunnumberedentry#1#2{%
1510 \line{#1\dotfill\doshortpageno{#2}}%
1514 \def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}}
1515 \def\unnumbsecentry#1#2{\dosecentry{#1}{#2}}
1518 \def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}}
1519 \def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}}
1521 % And subsubsections.
1522 \def\subsubsecentry#1#2#3#4#5#6{\dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}}
1523 \def\unnumbsubsecentry#1#2{\dosubsubsecentry{#1}{#2}}
1526 % This parameter controls the indentation of the various levels.
1527 \newdimen\tocindent \tocindent = 3pc
1529 % Now for the actual typesetting. In all these, #1 is the text and #2 is the
1532 % If the toc has to be broken over pages, we would want to be at chapters
1533 % if at all possible; hence the \penalty.
1534 \def\dochapentry#1#2{%
1535 \penalty-300 \vskip\baselineskip
1536 \line{\chapentryfonts #1\dotfill \dopageno{#2}}%
1537 \nobreak\vskip .25\baselineskip
1540 \def\dosecentry#1#2{%
1541 \line{\secentryfonts \hskip\tocindent #1\dotfill \dopageno{#2}}%
1544 \def\dosubsecentry#1#2{%
1545 \line{\subsecentryfonts \hskip2\tocindent #1\dotfill \dopageno{#2}}%
1548 \def\dosubsubsecentry#1#2{%
1549 \line{\subsubsecentryfonts \hskip3\tocindent #1\dotfill \dopageno{#2}}%
1552 % Space between chapter (or whatever) number and the title.
1553 \def\labelspace{\hskip1em \relax}
1555 \def\dopageno#1{{\rm #1}}
1556 \def\doshortpageno#1{{\rm #1}}
1558 \def\chapentryfonts{\secfonts \rm}
1559 \def\secentryfonts{\textfonts}
1560 \let\subsecentryfonts = \textfonts
1561 \let\subsubsecentryfonts = \textfonts
1564 \message{environments,}
1566 % Since these characters are used in examples, it should be an even number of
1567 % \tt widths. Each \tt character is 1en, so two makes it 1em.
1568 % Furthermore, these definitions must come after we define our fonts.
1569 \newbox\dblarrowbox \newbox\longdblarrowbox
1570 \newbox\pushcharbox \newbox\bullbox
1571 \newbox\equivbox \newbox\errorbox
1573 \let\ptexequiv = \equiv
1576 \global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil}
1577 \global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil}
1578 \global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil}
1579 \global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil}
1580 % Adapted from the manmac format (p.420 of TeXbook)
1581 \global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex
1587 \def\result{\leavevmode\raise.15ex\copy\dblarrowbox}
1588 \def\expansion{\leavevmode\raise.1ex\copy\longdblarrowbox}
1589 \def\print{\leavevmode\lower.1ex\copy\pushcharbox}
1591 \def\equiv{\leavevmode\lower.1ex\copy\equivbox}
1593 % Does anyone really want this?
1594 % \def\bull{\leavevmode\copy\bullbox}
1596 % Adapted from the TeXbook's \boxit.
1597 \dimen0 = 3em % Width of the box.
1598 \dimen2 = .55pt % Thickness of rules
1599 % The text. (`r' is open on the right, `e' somewhat less so on the left.)
1600 \setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt}
1602 \global\setbox\errorbox=\hbox to \dimen0{\hfil
1603 \vbox{\hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
1604 \advance\hsize by -2\dimen2 % Rules.
1605 \hrule height\dimen2
1606 \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
1607 \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
1608 \kern3pt\vrule width\dimen2}% Space to right.
1609 \hrule height\dimen2}
1612 % The @error{} command.
1613 \def\error{\leavevmode\lower.7ex\copy\errorbox}
1615 % @tex ... @end tex escapes into raw Tex temporarily.
1616 % One exception: @ is still an escape character, so that @end tex works.
1617 % But \@ or @@ will get a plain tex @ character.
1619 \def\tex{\begingroup
1620 \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
1621 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
1622 \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
1636 \let\bullet=\ptexbullet
1637 \let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext \let\l=\ptexl
1640 \let\Etex=\endgroup}
1642 % Define @lisp ... @endlisp.
1643 % @lisp does a \begingroup so it can rebind things,
1644 % including the definition of @endlisp (which normally is erroneous).
1646 % Amount to narrow the margins by for @lisp.
1647 \newskip\lispnarrowing \lispnarrowing=0.4in
1649 % This is the definition that ^M gets inside @lisp
1650 % phr: changed space to \null, to avoid overfull hbox problems.
1652 \gdef\lisppar{\null\endgraf}}
1654 % Cause \obeyspaces to make each Space cause a word-separation
1655 % rather than the default which is that it acts punctuation.
1656 % This is because space in tt font looks funny.
1658 \gdef\sepspaces{\def {\ }}}
1660 \newskip\aboveenvskipamount \aboveenvskipamount= 0pt
1661 \def\aboveenvbreak{{\advance\aboveenvskipamount by \parskip
1662 \endgraf \ifdim\lastskip<\aboveenvskipamount
1663 \removelastskip \penalty-50 \vskip\aboveenvskipamount \fi}}
1665 \def\afterenvbreak{\endgraf \ifdim\lastskip<\aboveenvskipamount
1666 \removelastskip \penalty-50 \vskip\aboveenvskipamount \fi}
1668 \def\lisp{\aboveenvbreak\begingroup\inENV %This group ends at the end of the @lisp body
1669 \hfuzz=12truept % Don't be fussy
1670 % Make spaces be word-separators rather than space tokens.
1672 % Single space lines
1674 % The following causes blank lines not to be ignored
1675 % by adding a space to the end of each line.
1677 \def\Elisp{\endgroup\afterenvbreak}%
1679 \advance \leftskip by \lispnarrowing
1681 \let\exdent=\internalexdent
1682 \obeyspaces \obeylines \tt \rawbackslash
1683 \def\next##1{}\next}
1687 \def\Eexample{\Elisp}
1689 \let\smallexample=\lisp
1690 \def\Esmallexample{\Elisp}
1692 % Macro for 9 pt. examples, necessary to print with 5" lines.
1693 % From Pavel@xerox. This is not really used unless the
1694 % @smallbook command is given.
1696 \def\smalllispx{\aboveenvbreak\begingroup\inENV
1697 % This group ends at the end of the @lisp body
1698 \hfuzz=12truept % Don't be fussy
1699 % Make spaces be word-separators rather than space tokens.
1701 % Single space lines
1703 % The following causes blank lines not to be ignored
1704 % by adding a space to the end of each line.
1706 \def\Esmalllisp{\endgroup\afterenvbreak}%
1708 \advance \leftskip by \lispnarrowing
1710 \let\exdent=\internalexdent
1711 \obeyspaces \obeylines \ninett \rawbackslash
1712 \def\next##1{}\next}
1714 % This is @display; same as @lisp except use roman font.
1716 \def\display{\begingroup\inENV %This group ends at the end of the @display body
1718 % Make spaces be word-separators rather than space tokens.
1720 % Single space lines
1722 % The following causes blank lines not to be ignored
1723 % by adding a space to the end of each line.
1725 \def\Edisplay{\endgroup\afterenvbreak}%
1727 \advance \leftskip by \lispnarrowing
1729 \let\exdent=\internalexdent
1730 \obeyspaces \obeylines
1731 \def\next##1{}\next}
1733 % This is @format; same as @lisp except use roman font and don't narrow margins
1735 \def\format{\begingroup\inENV %This group ends at the end of the @format body
1737 % Make spaces be word-separators rather than space tokens.
1740 % The following causes blank lines not to be ignored
1741 % by adding a space to the end of each line.
1743 \def\Eformat{\endgroup\afterenvbreak}
1744 \parskip=0pt \parindent=0pt
1745 \obeyspaces \obeylines
1746 \def\next##1{}\next}
1748 % @flushleft and @flushright
1750 \def\flushleft{\begingroup\inENV %This group ends at the end of the @format body
1752 % Make spaces be word-separators rather than space tokens.
1754 % The following causes blank lines not to be ignored
1755 % by adding a space to the end of each line.
1756 % This also causes @ to work when the directive name
1757 % is terminated by end of line.
1759 \def\Eflushleft{\endgroup\afterenvbreak}%
1760 \parskip=0pt \parindent=0pt
1761 \obeyspaces \obeylines
1762 \def\next##1{}\next}
1764 \def\flushright{\begingroup\inENV %This group ends at the end of the @format body
1766 % Make spaces be word-separators rather than space tokens.
1768 % The following causes blank lines not to be ignored
1769 % by adding a space to the end of each line.
1770 % This also causes @ to work when the directive name
1771 % is terminated by end of line.
1773 \def\Eflushright{\endgroup\afterenvbreak}%
1774 \parskip=0pt \parindent=0pt
1775 \advance \leftskip by 0pt plus 1fill
1776 \obeyspaces \obeylines
1777 \def\next##1{}\next}
1779 % @quotation - narrow the margins.
1781 \def\quotation{\begingroup\inENV %This group ends at the end of the @quotation body
1782 {\parskip=0pt % because we will skip by \parskip too, later
1786 \def\Equotation{\par\endgroup\afterenvbreak}%
1787 \advance \rightskip by \lispnarrowing
1788 \advance \leftskip by \lispnarrowing}
1791 % Define formatter for defuns
1792 % First, allow user to change definition object font (\df) internally
1793 \def\setdeffont #1 {\csname DEF#1\endcsname}
1795 \newskip\defbodyindent \defbodyindent=.4in
1796 \newskip\defargsindent \defargsindent=50pt
1797 \newskip\deftypemargin \deftypemargin=12pt
1798 \newskip\deflastargmargin \deflastargmargin=18pt
1800 \newcount\parencount
1801 % define \functionparens, which makes ( and ) and & do special things.
1802 % \functionparens affects the group it is contained in.
1804 \catcode`\(=\active \catcode`\)=\active \catcode`\&=\active
1805 \catcode`\[=\active \catcode`\]=\active}
1806 {\activeparens % Now, smart parens don't turn on until &foo (see \amprm)
1807 \gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 }
1808 \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
1810 % Definitions of (, ) and & used in args for functions.
1811 % This is the definition of ( outside of all parentheses.
1812 \gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested %
1813 \global\advance\parencount by 1 }
1815 % This is the definition of ( when already inside a level of parens.
1816 \gdef\opnested{\char`\(\global\advance\parencount by 1 }
1818 \gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
1819 % also in that case restore the outer-level definition of (.
1820 \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi
1821 \global\advance \parencount by -1 }
1822 % If we encounter &foo, then turn on ()-hacking afterwards
1823 \gdef\amprm#1 {{\rm\}\let(=\oprm \let)=\clrm\ }
1825 \gdef\normalparens{\boldbrax\let&=\ampnr}
1826 } % End of definition inside \activeparens
1827 %% These parens (in \boldbrax) actually are a little bolder than the
1828 %% contained text. This is especially needed for [ and ]
1829 \def\opnr{{\sf\char`\(}} \def\clnr{{\sf\char`\)}} \def\ampnr{\&}
1830 \def\lbrb{{\tt\char`\[}} \def\rbrb{{\tt\char`\]}}
1832 % First, defname, which formats the header line itself.
1833 % #1 should be the function name.
1834 % #2 should be the type of definition, such as "Function".
1839 \setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
1840 \dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line
1841 \dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations
1842 \parshape 2 0in \dimen0 \defargsindent \dimen1 %
1843 % Now output arg 2 ("Function" or some such)
1844 % ending at \deftypemargin from the right margin,
1845 % but stuck inside a box of width 0 so it does not interfere with linebreaking
1846 \rlap{\rightline{{\rm #2}\hskip \deftypemargin}}%
1847 \tolerance=10000 \hbadness=10000 % Make all lines underfull and no complaints
1848 {\df #1}\enskip % Generate function name
1851 % Actually process the body of a definition
1852 % #1 should be the terminating control sequence, such as \Edefun.
1853 % #2 should be the "another name" control sequence, such as \defunx.
1854 % #3 should be the control sequence that actually processes the header,
1855 % such as \defunheader.
1857 \def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
1859 % Define the end token that this defining construct specifies
1860 % so that it will exit this group.
1861 \def#1{\endgraf\endgroup\medbreak}%
1862 \def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
1863 \parindent=0in \leftskip=\defbodyindent \rightskip=\defbodyindent %
1864 \begingroup\obeylines\activeparens\spacesplit#3}
1866 \def\defmethparsebody #1#2#3#4 {\begingroup\inENV %
1868 % Define the end token that this defining construct specifies
1869 % so that it will exit this group.
1870 \def#1{\endgraf\endgroup\medbreak}%
1871 \def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}%
1872 \parindent=0in \leftskip=\defbodyindent \rightskip=\defbodyindent %
1873 \begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
1875 \def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
1877 % Define the end token that this defining construct specifies
1878 % so that it will exit this group.
1879 \def#1{\endgraf\endgroup\medbreak}%
1880 \def#2##1 ##2 {\def#4{##1}%
1881 \begingroup\obeylines\activeparens\spacesplit{#3{##2}}}%
1882 \parindent=0in \leftskip=\defbodyindent %
1883 \begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
1885 % Split up #2 at the first space token.
1886 % call #1 with two arguments:
1887 % the first is all of #2 before the space token,
1888 % the second is all of #2 after that space token.
1889 % If #2 contains no space token, all of it is passed as the first arg
1890 % and the second is passed as empty.
1893 \gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}%
1894 \long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{%
1896 #1{#2}{}\else #1{#2}{#3#4}\fi}}
1898 % So much for the things common to all kinds of definitions.
1902 % First, define the processing that is wanted for arguments of \defun
1903 % Use this to expand the args and terminate the paragraph they make up
1905 \def\defunargs #1{\functionparens \sl
1906 % Expand, preventing hyphenation at `-' chars.
1907 % Note that groups don't affect changes in \hyphenchar.
1911 \ifnum\parencount=0 \else \errmessage{unbalanced parens in @def arguments}\fi%
1912 \interlinepenalty=10000
1913 \endgraf\penalty10000\vskip -\parskip }
1915 % Do complete processing of one @defun or @defunx line already parsed.
1917 % @deffn Command forward-char nchars
1919 \def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader}
1921 \def\deffnheader #1#2#3{\doind {fn}{\code{#2}}%
1922 \begingroup\defname {#2}{#1}\defunargs{#3}\endgroup}
1924 % @defun == @deffn Function
1926 \def\defun{\defparsebody\Edefun\defunx\defunheader}
1928 \def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
1929 \begingroup\defname {#1}{Function}%
1930 \defunargs {#2}\endgroup %
1933 % @defmac == @deffn Macro
1935 \def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
1937 \def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
1938 \begingroup\defname {#1}{Macro}%
1939 \defunargs {#2}\endgroup %
1942 % @defspec == @deffn Special Form
1944 \def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
1946 \def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
1947 \begingroup\defname {#1}{Special form}%
1948 \defunargs {#2}\endgroup %
1951 % This definition is run if you use @defunx
1952 % anywhere other than immediately after a @defun or @defunx.
1954 \def\deffnx #1 {\errmessage{@deffnx in invalid context}}
1955 \def\defunx #1 {\errmessage{@defunx in invalid context}}
1956 \def\defmacx #1 {\errmessage{@defmacx in invalid context}}
1957 \def\defspecx #1 {\errmessage{@defspecx in invalid context}}
1959 % @defmethod, and so on
1961 % @defop {Funny Method} foo-class frobnicate argument
1963 \def\defop #1 {\def\defoptype{#1}%
1964 \defopparsebody\Edefop\defopx\defopheader\defoptype}
1966 \def\defopheader #1#2#3{\dosubind {fn}{\code{#2}}{on #1}% Make entry in function index
1967 \begingroup\defname {#2}{\defoptype{} on #1}%
1968 \defunargs {#3}\endgroup %
1971 % @defmethod == @defop Method
1973 \def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
1975 \def\defmethodheader #1#2#3{\dosubind {fn}{\code{#2}}{on #1}% entry in function index
1976 \begingroup\defname {#2}{Operation on #1}%
1977 \defunargs {#3}\endgroup %
1980 % @defcv {Class Option} foo-class foo-flag
1982 \def\defcv #1 {\def\defcvtype{#1}%
1983 \defopparsebody\Edefcv\defcvx\defcvheader\defcvtype}
1985 \def\defcvarheader #1#2#3{%
1986 \dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
1987 \begingroup\defname {#2}{\defcvtype of #1}%
1988 \defvarargs {#3}\endgroup %
1991 % @defivar == @defcv {Instance Variable}
1993 \def\defivar{\defmethparsebody\Edefivar\defivarx\defivarheader}
1995 \def\defivarheader #1#2#3{%
1996 \dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
1997 \begingroup\defname {#2}{Instance variable of #1}%
1998 \defvarargs {#3}\endgroup %
2001 % These definitions are run if you use @defmethodx, etc.,
2002 % anywhere other than immediately after a @defmethod, etc.
2004 \def\defopx #1 {\errmessage{@defopx in invalid context}}
2005 \def\defmethodx #1 {\errmessage{@defmethodx in invalid context}}
2006 \def\defcvx #1 {\errmessage{@defcvx in invalid context}}
2007 \def\defivarx #1 {\errmessage{@defivarx in invalid context}}
2011 % First, define the processing that is wanted for arguments of @defvar.
2012 % This is actually simple: just print them in roman.
2013 % This must expand the args and terminate the paragraph they make up
2014 \def\defvarargs #1{\normalparens #1%
2015 \interlinepenalty=10000
2016 \endgraf\penalty 10000\vskip -\parskip}
2018 % @defvr Counter foo-count
2020 \def\defvr{\defmethparsebody\Edefvr\defvrx\defvrheader}
2022 \def\defvrheader #1#2#3{\doind {vr}{\code{#2}}%
2023 \begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup}
2025 % @defvar == @defvr Variable
2027 \def\defvar{\defparsebody\Edefvar\defvarx\defvarheader}
2029 \def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
2030 \begingroup\defname {#1}{Variable}%
2031 \defvarargs {#2}\endgroup %
2034 % @defopt == @defvr {User Option}
2036 \def\defopt{\defparsebody\Edefopt\defoptx\defoptheader}
2038 \def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
2039 \begingroup\defname {#1}{User Option}%
2040 \defvarargs {#2}\endgroup %
2043 % This definition is run if you use @defvarx
2044 % anywhere other than immediately after a @defvar or @defvarx.
2046 \def\defvrx #1 {\errmessage{@defvrx in invalid context}}
2047 \def\defvarx #1 {\errmessage{@defvarx in invalid context}}
2048 \def\defoptx #1 {\errmessage{@defoptx in invalid context}}
2051 % Args are printed in bold, a slight difference from @defvar.
2053 \def\deftpargs #1{\bf \defvarargs{#1}}
2055 % @deftp Class window height width ...
2057 \def\deftp{\defmethparsebody\Edeftp\deftpx\deftpheader}
2059 \def\deftpheader #1#2#3{\doind {tp}{\code{#2}}%
2060 \begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
2062 % This definition is run if you use @deftpx, etc
2063 % anywhere other than immediately after a @deftp, etc.
2065 \def\deftpx #1 {\errmessage{@deftpx in invalid context}}
2067 \message{cross reference,}
2068 % Define cross-reference macros
2071 % \setref{foo} defines a cross-reference point named foo.
2074 \dosetq{#1-pg}{Ypagenumber}%
2075 \dosetq{#1-snt}{Ysectionnumberandtype}}
2077 \def\unnumbsetref#1{%
2078 \dosetq{#1-pg}{Ypagenumber}%
2079 \dosetq{#1-snt}{Ynothing}}
2081 \def\appendixsetref#1{%
2082 \dosetq{#1-pg}{Ypagenumber}%
2083 \dosetq{#1-snt}{Yappendixletterandtype}}
2085 % \xref and \pxref generate cross references to specified points.
2087 \def\pxref #1{see \xrefX [#1,,,,,,,]}
2088 \def\xref #1{See \xrefX [#1,,,,,,,]}
2089 \def\ref #1{\xrefX [#1,,,,,,,]}
2090 \def\xrefX [#1,#2,#3,#4,#5,#6]{%
2091 \setbox1=\hbox{\i{\losespace#5{}}}%
2092 \setbox0=\hbox{\losespace#3{}}%
2093 \ifdim \wd0 =0pt \setbox0=\hbox{\losespace#1{}}\fi%
2095 section `\unhbox0' in \unhbox1%
2097 \refx{#1-snt}{} [\unhbox0], page\tie \refx{#1-pg}{}%
2100 % \dosetq is the interface for calls from other macros
2102 \def\dosetq #1#2{{\let\folio=0%
2103 \edef\next{\write\auxfile{\internalsetq {#1}{#2}}}%
2106 % \internalsetq {foo}{page} expands into CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
2107 % When the aux file is read, ' is the escape character
2109 \def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}}
2111 % Things to be expanded by \internalsetq
2113 \def\Ypagenumber{\folio}
2117 \def\Ysectionnumberandtype{%
2118 \ifnum\secno=0 chapter\xreftie\the\chapno %
2119 \else \ifnum \subsecno=0 section\xreftie\the\chapno.\the\secno %
2120 \else \ifnum \subsubsecno=0 %
2121 section\xreftie\the\chapno.\the\secno.\the\subsecno %
2123 section\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno %
2126 \def\Yappendixletterandtype{%
2127 \ifnum\secno=0 appendix\xreftie'char\the\appendixno %
2128 \else \ifnum \subsecno=0 section\xreftie'char\the\appendixno.\the\secno %
2129 \else \ifnum \subsubsecno=0 %
2130 section\xreftie'char\the\appendixno.\the\secno.\the\subsecno %
2132 section\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %
2137 % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
2138 % If its value is nonempty, SUFFIX is output afterward.
2142 \expandafter\ifx\csname X#1\endcsname\relax
2143 % If not defined, say something at least.
2144 \expandafter\gdef\csname X#1\endcsname {$\langle$un\-def\-in\-ed$\rangle$}#2%
2145 \message {WARNING: Cross-reference "#1" used but not yet defined}%
2148 \setbox0=\hbox{\csname X#1\endcsname}%It's defined, so just use it.
2149 \ifdim\wd0>0pt \unhbox0{}#2\fi
2152 % Read the last existing aux file, if any. No error if none exists.
2154 % This is the macro invoked by entries in the aux file.
2156 {\catcode`\'=\other\expandafter \gdef \csname X#1\endcsname {#2}}}
2160 \catcode `\^^@=\other
2161 \catcode `\
\ 1=\other
2162 \catcode `\
\ 2=\other
2163 \catcode `\^^C=\other
2164 \catcode `\^^D=\other
2165 \catcode `\^^E=\other
2166 \catcode `\^^F=\other
2167 \catcode `\^^G=\other
2168 \catcode `\^^H=\other
2169 \catcode `\
\v=\other
2170 \catcode `\^^L=\other
2171 \catcode `\
\ e=\other
2172 \catcode `\
\ f=\other
2173 \catcode `\
\10=\other
2174 \catcode `\
\11=\other
2175 \catcode `\
\12=\other
2176 \catcode `\
\13=\other
2177 \catcode `\
\14=\other
2178 \catcode `\
\15=\other
2179 \catcode `\
\16=\other
2180 \catcode `\
\17=\other
2181 \catcode `\
\18=\other
2182 \catcode `\
\19=\other
2183 \catcode `\
\1a=\other
2184 \catcode `\^^[=\other
2185 \catcode `\^^\=\other
2186 \catcode `\^^]=\other
2187 \catcode `\^^^=\other
2188 \catcode `\^^_=\other
2202 % the aux file uses ' as the escape.
2203 % Turn off \ as an escape so we do not lose on
2204 % entries which were dumped with control sequences in their names.
2205 % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
2206 % Reference to such entries still does not work the way one would wish,
2207 % but at least they do not bomb out when the aux file is read in.
2208 \catcode `\{=1 \catcode `\}=2
2212 \openin 1 \jobname.aux
2213 \ifeof 1 \else \closein 1 \input \jobname.aux
2215 % Open the new aux file. Tex will close it automatically at exit.
2216 \openout \auxfile=\jobname.aux
2222 \newcount \footnoteno
2224 \def\supereject{\par\penalty -20000\footnoteno =0 }
2226 \let\ptexfootnote=\footnote
2229 \gdef\footnote{\global\advance \footnoteno by \@ne
2230 \edef\thisfootno{$^{\the\footnoteno}$}%
2232 \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
2233 \thisfootno\@sf\parsearg\footnotezzz}
2235 \gdef\footnotezzz #1{\insert\footins{
2236 \interlinepenalty\interfootnotelinepenalty
2237 \splittopskip\ht\strutbox % top baseline for broken footnotes
2238 \splitmaxdepth\dp\strutbox \floatingpenalty\@MM
2239 \leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip
2240 \footstrut\hang\textindent{\thisfootno}#1\strut}}
2242 }%end \catcode `\@=11
2244 % End of control word definitions.
2246 \message{and turning on texinfo input format.}
2257 % Set some numeric style parameters, for 8.5 x 11 format.
2261 \parskip 18pt plus 1pt
2263 \advance\topskip by 1.2cm
2265 % Prevent underfull vbox error messages.
2268 % Use @smallbook to reset parameters for 7x9.5 format
2270 \global\lispnarrowing = 0.3in
2271 \global\baselineskip 12pt
2272 \global\parskip 3pt plus 1pt
2274 \global\doublecolumnhsize=2.4in \global\doublecolumnvsize=15.0in
2276 \global\tolerance=700
2279 \global\pagewidth=\hsize
2280 \global\pageheight=\vsize
2281 \global\font\ninett=cmtt9
2283 \global\let\smalllisp=\smalllispx
2284 \global\let\smallexample=\smalllispx
2285 \global\def\Esmallexample{\Esmalllisp}
2288 %% For a final copy, take out the rectangles
2289 %% that mark overfull boxes (in case you have decided
2290 %% that the text looks ok even though it passes the margin).
2291 \def\finalout{\overfullrule=0pt}
2293 % Turn off all special characters except @
2294 % (and those which the user can use as if they were ordinary)
2295 % Define certain chars to be always in tt font.
2298 \def\activedoublequote{{\tt \char '042}}
2299 \let"=\activedoublequote
2301 \def~{{\tt \char '176}}
2306 \def_{{\tt \char '137}}
2308 \def|{{\tt \char '174}}
2316 \def+{{\tt \char 43}}
2317 %\catcode 27=\active
2318 %\def^^[{$\diamondsuit$}
2322 % \rawbackslashxx output one backslash character in current font
2324 @gdef@rawbackslashxx{\}}
2326 % \rawbackslash redefines \ as input to do \rawbackslashxx.
2327 {\catcode`\\=\active
2328 @gdef@rawbackslash{@let\=@rawbackslashxx }}
2330 % \normalbackslash outputs one backslash in fixed width font.
2331 \def\normalbackslash{{\tt\rawbackslashxx}}
2333 % Say @foo, not \foo, in error messages.
2336 @c \catcode 17=0 @c Define control-q
2339 % If a .fmt file is being used, we don't want the `\input texinfo' to show up.
2340 % That is what \eatinput is for; after that, the `\' should revert to printing
2343 @gdef@eatinput input texinfo{@fixbackslash}
2344 @global@let\ = @eatinput
2346 % On the other hand, perhaps the file did not have a `\input texinfo'. Then
2347 % the first `\{ in the file would cause an error. This macro tries to fix
2348 % that, assuming it is called before the first `\' could plausibly occur.
2350 @gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi}
2352 %% These look ok in all fonts, so just make them not special. The @rm below
2353 %% makes sure that the current font starts out as the newly loaded cmr10
2354 @catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other