|
|
1.1 ! root 1: %% TeX macros to handle texinfo files ! 2: ! 3: % Copyright (C) 1985, 1986 Richard M. Stallman ! 4: ! 5: % NO WARRANTY ! 6: ! 7: % BECAUSE THIS PROGRAM IS LICENSED FREE OF CHARGE, WE PROVIDE ABSOLUTELY ! 8: %NO WARRANTY, TO THE EXTENT PERMITTED BY APPLICABLE STATE LAW. EXCEPT ! 9: %WHEN OTHERWISE STATED IN WRITING, FREE SOFTWARE FOUNDATION, INC, ! 10: %RICHARD M. STALLMAN AND/OR OTHER PARTIES PROVIDE THIS PROGRAM "AS IS" ! 11: %WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, ! 12: %BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND ! 13: %FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY ! 14: %AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE ! 15: %DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR ! 16: %CORRECTION. ! 17: ! 18: % IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL RICHARD M. ! 19: %STALLMAN, THE FREE SOFTWARE FOUNDATION, INC., AND/OR ANY OTHER PARTY ! 20: %WHO MAY MODIFY AND REDISTRIBUTE THIS PROGRAM AS PERMITTED BELOW, BE ! 21: %LIABLE TO YOU FOR DAMAGES, INCLUDING ANY LOST PROFITS, LOST MONIES, OR ! 22: %OTHER SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE ! 23: %USE OR INABILITY TO USE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR ! 24: %DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY THIRD PARTIES OR ! 25: %A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS) THIS ! 26: %PROGRAM, EVEN IF YOU HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH ! 27: %DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY. ! 28: ! 29: % GENERAL PUBLIC LICENSE TO COPY ! 30: ! 31: % 1. You may copy and distribute verbatim copies of this source file ! 32: %as you receive it, in any medium, provided that you conspicuously ! 33: %and appropriately publish on each copy a valid copyright notice ! 34: %"Copyright (C) 1986 Richard M. Stallman"; and include ! 35: %following the copyright notice a verbatim copy of the above disclaimer ! 36: %of warranty and of this License. ! 37: ! 38: % 2. You may modify your copy or copies of this source file or ! 39: %any portion of it, and copy and distribute such modifications under ! 40: %the terms of Paragraph 1 above, provided that you also do the following: ! 41: ! 42: % a) cause the modified files to carry prominent notices stating ! 43: % that you changed the files and the date of any change; and ! 44: ! 45: % b) cause the whole of any work that you distribute or publish, ! 46: % that in whole or in part contains or is a derivative of this ! 47: % program or any part thereof, to be licensed at no charge to all ! 48: % third parties on terms identical to those contained in this ! 49: % License Agreement (except that you may choose to grant more extensive ! 50: % warranty protection to some or all third parties, at your option). ! 51: ! 52: % c) You may charge a distribution fee for the physical act of ! 53: % transferring a copy, and you may at your option offer warranty ! 54: % protection in exchange for a fee. ! 55: ! 56: %Mere aggregation of another unrelated program with this program (or its ! 57: %derivative) on a volume of a storage or distribution medium does not bring ! 58: %the other program under the scope of these terms. ! 59: ! 60: % 3. You may copy and distribute this program (or a portion or derivative ! 61: %of it, under Paragraph 2) in object code or executable form under the terms ! 62: %of Paragraphs 1 and 2 above provided that you also do one of the following: ! 63: ! 64: % a) accompany it with the complete corresponding machine-readable ! 65: % source code, which must be distributed under the terms of ! 66: % Paragraphs 1 and 2 above; or, ! 67: ! 68: % b) accompany it with a written offer, valid for at least three ! 69: % years, to give any third party free (except for a nominal ! 70: % shipping charge) a complete machine-readable copy of the ! 71: % corresponding source code, to be distributed under the terms of ! 72: % Paragraphs 1 and 2 above; or, ! 73: ! 74: % c) accompany it with the information you received as to where the ! 75: % corresponding source code may be obtained. (This alternative is ! 76: % allowed only for noncommercial distribution and only if you ! 77: % received the program in object code or executable form alone.) ! 78: ! 79: %For an executable file, complete source code means all the source code for ! 80: %all modules it contains; but, as a special exception, it need not include ! 81: %source code for modules which are standard libraries that accompany the ! 82: %operating system on which the executable file runs. ! 83: ! 84: % 4. You may not copy, sublicense, distribute or transfer this program ! 85: %except as expressly provided under this License Agreement. Any attempt ! 86: %otherwise to copy, sublicense, distribute or transfer this program is void and ! 87: %your rights to use the program under this License agreement shall be ! 88: %automatically terminated. However, parties who have received computer ! 89: %software programs from you with this License Agreement will not have ! 90: %their licenses terminated so long as such parties remain in full compliance. ! 91: ! 92: % 5. If you wish to incorporate parts of this program into other free ! 93: %programs whose distribution conditions are different, write to the Free ! 94: %Software Foundation at 675 Mass Ave, Cambridge, MA 02139. We have not yet ! 95: %worked out a simple rule that can be stated here, but we will often permit ! 96: %this. We will be guided by the two goals of preserving the free status of ! 97: %all derivatives of our free software and of promoting the sharing and reuse of ! 98: %software. ! 99: ! 100: %In other words, you are welcome to use, share and improve this program. ! 101: %You are forbidden to forbid anyone else to use, share and improve ! 102: %what you give them. Help stamp out software-hoarding! ! 103: ! 104: \def\texinfoversion{1.02} ! 105: \message{Loading texinfo package [Version \texinfoversion]:} ! 106: \message{} ! 107: ! 108: % Save some parts of plain tex whose names we will redefine. ! 109: ! 110: \let\ptexlbrace=\{ ! 111: \let\ptexrbrace=\} ! 112: \let\ptexdot=\. ! 113: \let\ptexstar=\* ! 114: \let\ptexend=\end ! 115: \let\ptexbullet=\bullet ! 116: \let\ptexb=\b ! 117: \let\ptexc=\c ! 118: \let\ptexi=\i ! 119: \let\ptext=\t ! 120: \let\ptexl=\l ! 121: \let\ptexL=\L ! 122: ! 123: \def\tie{\penalty 10000\ } % Save plain tex definition of ~. ! 124: ! 125: \message{Basics,} ! 126: \chardef\other=12 ! 127: ! 128: \hyphenation{ap-pen-dix} ! 129: \hyphenation{mini-buf-fer mini-buf-fers} ! 130: \hyphenation{eshell} ! 131: ! 132: % Margin to add to right of even pages, to left of odd pages. ! 133: \newdimen \bindingoffset \bindingoffset=0pt ! 134: \newdimen \normaloffset \normaloffset=\hoffset ! 135: \newdimen\pagewidth \newdimen\pageheight ! 136: \pagewidth=\hsize \pageheight=\vsize ! 137: ! 138: %---------------------Begin change----------------------- ! 139: % ! 140: % Dimensions to add cropmarks at corners Added by P. A. MacKay, 12 Nov. 1986 ! 141: % ! 142: \newdimen\cornerlong \newdimen\cornerthick ! 143: \newdimen \topandbottommargin ! 144: \newdimen \outerhsize \newdimen \outervsize ! 145: \cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks ! 146: \outerhsize=7in ! 147: \outervsize=9.5in ! 148: \topandbottommargin=.75in ! 149: % ! 150: %---------------------End change----------------------- ! 151: ! 152: % \onepageout takes a vbox as an argument. Note that \pagecontents ! 153: % does insertions itself, but you have to call it yourself. ! 154: \chardef\PAGE=255 \output={\onepageout{\pagecontents\PAGE}} ! 155: \def\onepageout#1{\hoffset=\normaloffset ! 156: \ifodd\pageno \advance\hoffset by \bindingoffset ! 157: \else \advance\hoffset by -\bindingoffset\fi ! 158: \shipout\vbox{{\let\hsize=\pagewidth \makeheadline} \pagebody{#1}% ! 159: {\let\hsize=\pagewidth \makefootline}} ! 160: \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi} ! 161: ! 162: ! 163: % Here is a modification of the main output routine for Near East Publications ! 164: % This provides right-angle cropmarks at all four corners. ! 165: % The contents of the page are centerlined into the cropmarks, ! 166: % and any desired binding offset is added as an \hskip on either ! 167: % site of the centerlined box. (P. A. MacKay, 12 November, 1986) ! 168: % ! 169: \def\croppageout#1{\hoffset=0pt % make sure this doesn't mess things up ! 170: \shipout ! 171: \vbox to \outervsize{\hsize=\outerhsize ! 172: \vbox{\line{\ewtop\hfill\ewtop}} ! 173: \nointerlineskip ! 174: \line{\vbox{\moveleft\cornerthick\nstop} ! 175: \hfill ! 176: \vbox{\moveright\cornerthick\nstop}} ! 177: \vskip \topandbottommargin ! 178: \centerline{\ifodd\pageno\hskip\bindingoffset\fi ! 179: \vbox{ ! 180: {\let\hsize=\pagewidth \makeheadline} ! 181: \pagebody{#1} ! 182: {\let\hsize=\pagewidth \makefootline}} ! 183: \ifodd\pageno\else\hskip\bindingoffset\fi} ! 184: \vskip \topandbottommargin plus1fill minus1fill ! 185: \boxmaxdepth\cornerthick ! 186: \line{\vbox{\moveleft\cornerthick\nsbot} ! 187: \hfill ! 188: \vbox{\moveright\cornerthick\nsbot}} ! 189: \nointerlineskip ! 190: \vbox{\line{\ewbot\hfill\ewbot}} ! 191: } ! 192: \advancepageno ! 193: \ifnum\outputpenalty>-20000 \else\dosupereject\fi} ! 194: % ! 195: % Do @cropmarks to get crop marks ! 196: \def\cropmarks{\let\onepageout=\croppageout } ! 197: ! 198: \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}} ! 199: {\catcode`\@ =11 ! 200: \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi ! 201: \dimen@=\dp#1 \unvbox#1 ! 202: \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi ! 203: \ifr@ggedbottom \kern-\dimen@ \vfil \fi} ! 204: } ! 205: ! 206: % ! 207: % Here are the rules for the cropmarks. Note that they are ! 208: % offset so that the space between them is truly \outerhsize or \outervsize ! 209: % (P. A. MacKay, 12 November, 1986) ! 210: % ! 211: \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} ! 212: \def\nstop{\vbox ! 213: {\hrule height\cornerthick depth\cornerlong width\cornerthick}} ! 214: \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong} ! 215: \def\nsbot{\vbox ! 216: {\hrule height\cornerlong depth\cornerthick width\cornerthick}} ! 217: ! 218: % Parse an argument, then pass it to #1. ! 219: % The argument can be delimited with [...] or with "..." or braces ! 220: % or it can be a whole line. ! 221: % #1 should be a macro which expects ! 222: % an ordinary undelimited TeX argument. ! 223: ! 224: \def\parsearg #1{\let\next=#1\begingroup\obeylines\futurelet\temp\parseargx} ! 225: ! 226: \def\parseargx{% ! 227: \ifx \obeyedspace\temp \aftergroup\parseargdiscardspace \else% ! 228: \aftergroup \parseargline % ! 229: \fi \endgroup} ! 230: ! 231: {\obeyspaces % ! 232: \gdef\parseargdiscardspace {\begingroup\obeylines\futurelet\temp\parseargx}} ! 233: ! 234: \gdef\obeyedspace{\ } ! 235: ! 236: \def\parseargline{\begingroup \obeylines \parsearglinex} ! 237: {\obeylines % ! 238: \gdef\parsearglinex #1^^M{\endgroup \next {#1}}} ! 239: ! 240: \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} ! 241: ! 242: %% These are used to keep @begin/@end levels from running away ! 243: %% Call \inENV within environments (after a \begingroup) ! 244: \newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi} ! 245: \def\ENVcheck{% ! 246: \ifENV\errmessage{Still within an environment. Type Return to continue.} ! 247: \endgroup\fi} % This is not perfect, but it should reduce lossage ! 248: ! 249: % @begin foo is the same as @foo, for now. ! 250: \newhelp\EMsimple{Type <Return> to continue} ! 251: ! 252: \outer\def\begin{\parsearg\beginxxx} ! 253: ! 254: \def\beginxxx #1{% ! 255: \expandafter\ifx\csname #1\endcsname\relax ! 256: {\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else ! 257: \csname #1\endcsname\fi} ! 258: ! 259: %% @end foo executes the definition of \Efoo. ! 260: %% foo can be delimited by doublequotes or brackets. ! 261: ! 262: \def\end{\parsearg\endxxx} ! 263: ! 264: \def\endxxx #1{% ! 265: \expandafter\ifx\csname E#1\endcsname\relax ! 266: \expandafter\ifx\csname #1\endcsname\relax ! 267: \errmessage{Undefined command @end #1}\else ! 268: \errorE{#1}\fi\fi ! 269: \csname E#1\endcsname} ! 270: \def\errorE#1{ ! 271: {\errhelp=\EMsimple \errmessage{@end #1 not within #1 environment}}} ! 272: ! 273: % Single-spacing is done by various environments. ! 274: ! 275: \newskip\singlespaceskip \singlespaceskip = \baselineskip ! 276: \def\singlespace{% ! 277: {\advance \baselineskip by -\singlespaceskip ! 278: \kern \baselineskip}% ! 279: \baselineskip=\singlespaceskip ! 280: } ! 281: ! 282: %% Simple single-character @ commands ! 283: ! 284: % @@ prints an @ ! 285: % Kludge this until the fonts are right (grr). ! 286: \def\@{{\sf @}} ! 287: ! 288: % Define @` and @' to be the same as ` and ' ! 289: % but suppressing ligatures. ! 290: \def\`{{`}} ! 291: \def\'{{'}} ! 292: ! 293: % Used to generate quoted braces. ! 294: ! 295: \def\mylbrace {{\tt \char '173}} ! 296: \def\myrbrace {{\tt \char '175}} ! 297: \let\{=\mylbrace ! 298: \let\}=\myrbrace ! 299: ! 300: % @: forces normal size whitespace following. ! 301: \def\:{\spacefactor=1000 } ! 302: ! 303: % @* forces a line break. ! 304: \def\*{\hfil\break} ! 305: ! 306: % @. is an end-of-sentence period. ! 307: \def\.{.\spacefactor=3000 } ! 308: ! 309: % @w prevents a word break ! 310: \def\w #1{\hbox{#1}} ! 311: ! 312: % @group ... @end group forces ... to be all on one page. ! 313: ! 314: \def\group{\begingroup% \inENV ??? ! 315: \def \Egroup{\egroup\endgroup} ! 316: \vbox\bgroup} ! 317: ! 318: % @br forces paragraph break ! 319: ! 320: \let\br = \par ! 321: ! 322: % @dots{} output some dots ! 323: ! 324: \def\dots{$\ldots$} ! 325: ! 326: % @page forces the start of a new page ! 327: ! 328: \def\page{\par\vfill\supereject} ! 329: ! 330: % @exdent text.... ! 331: % outputs text on separate line in roman font, starting at standard page margin ! 332: ! 333: \def\exdent{\errmessage{@exdent in filled text}} ! 334: % @lisp, etc, define \exdent locally from \internalexdent ! 335: ! 336: {\obeyspaces ! 337: \gdef\internalexdent{\parsearg\exdentzzz}} ! 338: ! 339: \def\exdentzzz #1{{\advance \leftskip by -\lispnarrowing ! 340: \advance \hsize by -\leftskip ! 341: \advance \hsize by -\rightskip ! 342: \leftline{{\rm#1}}}} ! 343: ! 344: % @include file insert text of that file as input. ! 345: ! 346: \def\include{\parsearg\includezzz} ! 347: \def\includezzz #1{{\def\thisfile{#1}\input #1 ! 348: }} ! 349: ! 350: \def\thisfile{} ! 351: ! 352: % @center line outputs that line, centered ! 353: ! 354: \def\center{\parsearg\centerzzz} ! 355: \def\centerzzz #1{{\advance\hsize by -\leftskip ! 356: \advance\hsize by -\rightskip ! 357: \centerline{#1}}} ! 358: ! 359: % @sp n outputs n lines of vertical space ! 360: ! 361: \def\sp{\parsearg\spxxx} ! 362: \def\spxxx #1{\par \vskip #1\baselineskip} ! 363: ! 364: % @comment ...line which is ignored... ! 365: % @c is the same as @comment ! 366: % @ignore ... @end ignore is another way to write a comment ! 367: ! 368: \def\comment{\parsearg \commentxxx} ! 369: ! 370: \def\commentxxx #1{} ! 371: ! 372: \let\c=\comment ! 373: ! 374: \long\def\ignore #1\end ignore{} ! 375: ! 376: \outer\def\ifset{\parsearg\ifsetxxx} ! 377: ! 378: \def\ifsetxxx #1#2\end ifset{% ! 379: \expandafter\ifx\csname IF#1\endcsname\relax \else #2\fi} ! 380: ! 381: \outer\def\ifclear{\parsearg\ifclearxxx} ! 382: ! 383: \def\ifclearxxx #1#2\end ifclear{% ! 384: \expandafter\ifx\csname IF#1\endcsname\relax #2\fi} ! 385: ! 386: % Some texinfo constructs that are trivial in tex ! 387: ! 388: \def\iftex{} ! 389: \def\Eiftex{} ! 390: \long\def\ifinfo #1\end ifinfo{} ! 391: \long\def\menu #1\end menu{} ! 392: \def\asis#1{#1} ! 393: ! 394: \def\node{\parsearg\nodezzz} ! 395: \def\nodezzz#1{\nodexxx [#1,]} ! 396: \def\nodexxx[#1,#2]{\gdef\lastnode{#1}} ! 397: \let\lastnode=\relax ! 398: ! 399: \def\donoderef{\ifx\lastnode\relax\else ! 400: \expandafter\expandafter\expandafter\setref{\lastnode}\fi ! 401: \let\lastnode=\relax} ! 402: ! 403: \def\unnumbnoderef{\ifx\lastnode\relax\else ! 404: \expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi ! 405: \let\lastnode=\relax} ! 406: ! 407: \let\refill=\relax ! 408: ! 409: \let\setfilename=\comment ! 410: ! 411: \def\inforef #1{\inforefzzz #1,,,,**} ! 412: \def\inforefzzz #1,#2,#3,#4**{See Info file \file{\losespace#3{}}, node `\losespace#1{}'} ! 413: \def\losespace #1{#1} ! 414: ! 415: \message{fonts,} ! 416: ! 417: % Font-change commands. ! 418: ! 419: %% Try out Computer Modern fonts at a little bigger than \magstephalf ! 420: \font\tenrm=cmr10 scaled \magstephalf ! 421: \font\tentt=cmtt10 scaled \magstephalf ! 422: \font\tenbf=cmb10 scaled \magstephalf ! 423: \font\tenit=cmti10 scaled \magstephalf ! 424: \font\tensl=cmsl10 scaled \magstephalf ! 425: \font\tensf=cmss10 scaled \magstephalf ! 426: \def\li{\sf} ! 427: \font\tensc=cmcsc10 scaled \magstephalf ! 428: ! 429: % Font for title ! 430: \font\titlerm = cmbx10 scaled \magstep5 ! 431: ! 432: % Fonts for indices ! 433: \font\indit=cmti9 \font\indrm=cmr9 ! 434: \def\indbf{\indrm} \def\indsl{\indit} ! 435: \def\indexfonts{\let\it=\indit \let\sl=\indsl \let\bf=\indbf \let\rm=\indrm} ! 436: ! 437: % Fonts for headings ! 438: \font\chaprm=cmbx10 scaled \magstep3 ! 439: \font\chapit=cmti10 scaled \magstep3 ! 440: \font\chapsl=cmsl10 scaled \magstep3 ! 441: \font\chaptt=cmtt10 scaled \magstep3 ! 442: \font\chapsf=cmss10 scaled \magstep3 ! 443: \let\chapbf=\chaprm ! 444: ! 445: \font\secrm=cmbx10 scaled \magstep2 ! 446: \font\secit=cmti10 scaled \magstep2 ! 447: \font\secsl=cmsl10 scaled \magstep2 ! 448: \font\sectt=cmtt10 scaled \magstep2 ! 449: \font\secsf=cmss10 scaled \magstep2 ! 450: \let\secbf=\secrm ! 451: ! 452: \font\ssecrm=cmbx10 scaled \magstep1 ! 453: \font\ssecit=cmti10 scaled \magstep1 ! 454: \font\ssecsl=cmsl10 scaled \magstep1 ! 455: \font\ssectt=cmtt10 scaled \magstep1 ! 456: \font\ssecsf=cmss10 scaled \magstep1 ! 457: \let\ssecbf=\ssecrm ! 458: ! 459: \def\textfonts{\let\rm=\tenrm\let\it=\tenit\let\sl=\tensl\let\bf=\tenbf% ! 460: \let\sc=\tensc\let\sf=\tensf} ! 461: \def\chapfonts{\let\rm=\chaprm\let\it=\chapit\let\sl=\chapsl\let\bf=\chapbf\let\tt=\chaptt\let\sf=\chapsf} ! 462: \def\secfonts{\let\rm=\secrm\let\it=\secit\let\sl=\secsl\let\bf=\secbf\let\tt=\sectt\let\sf=\secsf} ! 463: \def\subsecfonts{\let\rm=\ssecrm\let\it=\ssecit\let\sl=\ssecsl\let\bf=\ssecbf\let\tt=\ssectt\let\sf=\ssecsf} ! 464: % Count depth in font-changes, for error checks ! 465: \newcount\fontdepth \fontdepth=0 ! 466: ! 467: %% Add scribe-like font environments, plus @l for inline lisp (usually sans ! 468: %% serif) and @ii for TeX italic ! 469: ! 470: \def\i#1{{\sl #1}} ! 471: \let\var=\i ! 472: \let\dfn=\i ! 473: \let\emph=\i ! 474: \let\cite=\i ! 475: ! 476: \def\b#1{{\bf #1}} ! 477: \let\strong=\b ! 478: ! 479: \def\t#1{{\tt \rawbackslash #1}\null} ! 480: \let\ttfont = \t ! 481: \let\kbd=\t ! 482: \let\code=\t ! 483: \def\samp #1{`{\tt \rawbackslash #1}'\null} ! 484: \def\key #1{{\tt \uppercase{#1}}\null} ! 485: \def\ctrl #1{{\tt \rawbackslash \hat}#1} ! 486: ! 487: \let\file=\samp ! 488: ! 489: \def\l#1{{\li #1}\null} ! 490: ! 491: \def\r#1{{\rm #1}} ! 492: \def\s#1{{\sc #1}} ! 493: \def\ii#1{{\it #1}} ! 494: ! 495: \def\titlefont#1{{\titlerm #1}} ! 496: ! 497: \def\titlepage{\begingroup \parindent=0pt \hbox{}% ! 498: \let\oldpage=\page ! 499: \def\page{\oldpage \hbox{}}} ! 500: ! 501: \def\Etitlepage{\endgroup\page\HEADINGSon} ! 502: ! 503: % Make altmode in file print out right ! 504: ! 505: \catcode `\^^[=\active \def^^[{$\diamondsuit$} ! 506: ! 507: \message{page headings,} ! 508: ! 509: %%% Set up page headings and footings. ! 510: ! 511: \let\thispage=\folio ! 512: ! 513: \newtoks \evenheadline % Token sequence for heading line of even pages ! 514: \newtoks \oddheadline % Token sequence for heading line of odd pages ! 515: \newtoks \evenfootline % Token sequence for footing line of even pages ! 516: \newtoks \oddfootline % Token sequence for footing line of odd pages ! 517: ! 518: % Now make Tex use those variables ! 519: \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline \else \the\evenheadline \fi}} ! 520: \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline \else \the\evenfootline \fi}} ! 521: ! 522: % Commands to set those variables. ! 523: % For example, this is what @headings on does ! 524: % @evenheading @thistitle|@thispage|@thischapter ! 525: % @oddheading @thischapter|@thispage|@thistitle ! 526: % @evenfooting @thisfile|| ! 527: % @oddfooting ||@thisfile ! 528: ! 529: \def\evenheading{\parsearg\evenheadingxxx} ! 530: \def\oddheading{\parsearg\oddheadingxxx} ! 531: \def\everyheading{\parsearg\everyheadingxxx} ! 532: ! 533: \def\evenfooting{\parsearg\evenfootingxxx} ! 534: \def\oddfooting{\parsearg\oddfootingxxx} ! 535: \def\everyfooting{\parsearg\everyfootingxxx} ! 536: ! 537: \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish} ! 538: \def\evenheadingyyy #1\|#2\|#3\|#4\finish{% ! 539: \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} ! 540: ! 541: \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish} ! 542: \def\oddheadingyyy #1\|#2\|#3\|#4\finish{% ! 543: \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} ! 544: ! 545: \def\everyheadingxxx #1{\everyheadingyyy #1\|\|\|\|\finish} ! 546: \def\everyheadingyyy #1\|#2\|#3\|#4\finish{% ! 547: \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}} ! 548: \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} ! 549: ! 550: \def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish} ! 551: \def\evenfootingyyy #1\|#2\|#3\|#4\finish{% ! 552: \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} ! 553: ! 554: \def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish} ! 555: \def\oddfootingyyy #1\|#2\|#3\|#4\finish{% ! 556: \global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} ! 557: ! 558: \def\everyfootingxxx #1{\everyfootingyyy #1\|\|\|\|\finish} ! 559: \def\everyfootingyyy #1\|#2\|#3\|#4\finish{% ! 560: \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}} ! 561: \global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} ! 562: ! 563: % @headings on turns them on. ! 564: % @headings off turns them off. ! 565: % By default, they are off. ! 566: ! 567: \def\headings #1 {\csname HEADINGS#1\endcsname} ! 568: ! 569: \def\HEADINGSoff{ ! 570: \global\evenheadline={\hfil} \global\evenfootline={\hfil} ! 571: \global\oddheadline={\hfil} \global\oddfootline={\hfil}} ! 572: \HEADINGSoff ! 573: % When we turn headings on, set the page number to 1, ! 574: % Put current file name in lower left corner, ! 575: % Put chapter name on inside top of right hand pages, document ! 576: % title on inside top of left hand pages, and page numbers on outside top ! 577: % edge of all pages. ! 578: \def\HEADINGSon{ ! 579: \global\pageno=1 ! 580: \global\evenfootline={\thisfile\hfil} ! 581: \global\oddfootline={\thisfile\hfil} ! 582: \global\evenheadline={\line{\folio\hfil\thistitle}} ! 583: \global\oddheadline={\line{\thischapter\hfil\folio}} ! 584: } ! 585: ! 586: % Subroutines used in generating headings ! 587: \def\today{\ifcase\month\or ! 588: January\or February\or March\or April\or May\or June\or ! 589: July\or August\or September\or October\or November\or December\fi ! 590: \space\number\day, \number\year} ! 591: ! 592: % @settitle line... specifies the title of the document, for headings ! 593: % It generates no output of its own ! 594: ! 595: \def\thistitle{No Title} ! 596: \def\settitle{\parsearg\settitlezzz} ! 597: \def\settitlezzz #1{\gdef\thistitle{#1}} ! 598: ! 599: \message{tables,} ! 600: ! 601: % Tables -- @table, @ftable, @item(x), @kitem(x), @xitem(x). ! 602: ! 603: % default indentation of table text ! 604: \newdimen\tableindent \tableindent=.8in ! 605: % default indentation of @itemize and @enumerate text ! 606: \newdimen\itemindent \itemindent=.3in ! 607: % margin between end of table item and start of table text. ! 608: \newdimen\itemmargin \itemmargin=.1in ! 609: ! 610: % used internally for \itemindent minus \itemmargin ! 611: \newdimen\itemmax ! 612: ! 613: % Note @table and @ftable define @item, @itemx, etc., with these defs. ! 614: % They also define \itemindex ! 615: % to index the item name in whatever manner is desired (perhaps none). ! 616: ! 617: \def\internalBitem{\smallbreak \parsearg\itemzzz} ! 618: \def\internalBitemx{\par \parsearg\itemzzz} ! 619: ! 620: \def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz} ! 621: \def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \par \parsearg\xitemzzz} ! 622: ! 623: \def\internalBkitem{\smallbreak \parsearg\kitemzzz} ! 624: \def\internalBkitemx{\par \parsearg\kitemzzz} ! 625: ! 626: \def\kitemzzz #1{\dosubind {kw}{#1}{for {\bf \lastfunction}}\itemzzz {#1}} ! 627: ! 628: \def\xitemzzz #1{\dosubind {kw}{#1}{for {\bf \xitemsubtopic}}\itemzzz {#1}} ! 629: ! 630: \def\itemzzz #1{\begingroup % ! 631: \advance \hsize by -\rightskip % ! 632: \advance \hsize by -\leftskip % ! 633: \setbox0=\hbox{\itemfont{#1}}% ! 634: \itemindex{#1}% ! 635: \parskip=0in % ! 636: \noindent % ! 637: \ifdim \wd0>\itemmax % ! 638: \vadjust{\penalty 10000}% ! 639: \hbox to \hsize{\hskip -\tableindent\box0\hss}\ % ! 640: \else % ! 641: \hbox to 0pt{\hskip -\tableindent\box0\hss}% ! 642: \fi % ! 643: \endgroup % ! 644: } ! 645: ! 646: \def\item{\errmessage{@item while not in a table}} ! 647: \def\itemx{\errmessage{@itemx while not in a table}} ! 648: \def\kitem{\errmessage{@kitem while not in a table}} ! 649: \def\kitemx{\errmessage{@kitemx while not in a table}} ! 650: \def\xitem{\errmessage{@xitem while not in a table}} ! 651: \def\xitemx{\errmessage{@xitemx while not in a table}} ! 652: ! 653: %% Contains a kludge to get @end[description] to work ! 654: \def\description{\tablez{\dontindex}{1}{}{}{}{}} ! 655: ! 656: \def\table{\begingroup\inENV\obeylines\obeyspaces\tablex} ! 657: {\obeylines\obeyspaces% ! 658: \gdef\tablex #1^^M{% ! 659: \tabley\dontindex#1 \endtabley}} ! 660: ! 661: \def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex} ! 662: {\obeylines\obeyspaces% ! 663: \gdef\ftablex #1^^M{% ! 664: \tabley\fnitemindex#1 \endtabley}} ! 665: ! 666: \def\dontindex #1{} ! 667: \def\fnitemindex #1{\doind {fn}{#1}}% ! 668: ! 669: {\obeyspaces % ! 670: \gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup% ! 671: \tablez{#1}{#2}{#3}{#4}{#5}{#6}}} ! 672: ! 673: \def\tablez #1#2#3#4#5#6{% ! 674: \aboveenvbreak % ! 675: \begingroup % ! 676: \def\Edescription{\Etable}% Neccessary kludge. ! 677: \let\itemindex=#1% ! 678: \ifnum 0#3>0 \advance \leftskip by #3\mil \fi % ! 679: \ifnum 0#4>0 \tableindent=#4\mil \fi % ! 680: \ifnum 0#5>0 \advance \rightskip by #5\mil \fi % ! 681: \def\itemfont{#2}% ! 682: \itemmax=\tableindent % ! 683: \advance \itemmax by -\itemmargin % ! 684: \advance \leftskip by \tableindent % ! 685: \parindent = 0pt ! 686: \parskip = \smallskipamount ! 687: \ifdim \parskip=0pt \parskip=2pt \fi% ! 688: \def\Etable{\endgraf\endgroup\afterenvbreak}% ! 689: \let\item = \internalBitem % ! 690: \let\itemx = \internalBitemx % ! 691: \let\kitem = \internalBkitem % ! 692: \let\kitemx = \internalBkitemx % ! 693: \let\xitem = \internalBxitem % ! 694: \let\xitemx = \internalBxitemx % ! 695: } ! 696: ! 697: % This is the counter used by @enumerate, which is really @itemize ! 698: ! 699: \newcount \itemno ! 700: ! 701: \def\itemize{\parsearg\itemizezzz} ! 702: ! 703: \def\itemizezzz #1{\itemizey {#1}{\Eitemize}} ! 704: ! 705: \def\itemizey #1#2{% ! 706: \aboveenvbreak % ! 707: \begingroup % ! 708: \itemno = 0 % ! 709: \itemmax=\itemindent % ! 710: \advance \itemmax by -\itemmargin % ! 711: \advance \leftskip by \itemindent % ! 712: \parindent = 0pt ! 713: \parskip = \smallskipamount ! 714: \ifdim \parskip=0pt \parskip=2pt \fi% ! 715: \def#2{\endgraf\endgroup\afterenvbreak}% ! 716: \def\itemcontents{#1}% ! 717: \let\item=\itemizeitem} ! 718: ! 719: \def\bullet{$\ptexbullet$} ! 720: \def\minus{$-$} ! 721: ! 722: \def\enumerate{\itemizey{\the\itemno.}\Eenumerate\flushcr} ! 723: ! 724: % Definition of @item while inside @itemize. ! 725: ! 726: \def\itemizeitem{% ! 727: \advance\itemno by 1 ! 728: {\let\par=\endgraf \smallbreak}% ! 729: \ifhmode \errmessage{\in hmode at itemizeitem}\fi ! 730: {\parskip=0in \hskip 0pt ! 731: \hbox to 0pt{\hss \itemcontents\hskip \itemmargin}% ! 732: \vadjust{\penalty 300}}% ! 733: \flushcr} ! 734: ! 735: \message{indexing,} ! 736: % Index generation facilities ! 737: ! 738: % Define \newwrite to be identical to plain tex's \newwrite ! 739: % except not \outer, so it can be used within \newindex. ! 740: {\catcode`\@=11 ! 741: \gdef\newwrite{\alloc@7\write\chardef\sixt@@n}} ! 742: ! 743: % \newindex {foo} defines an index named foo. ! 744: % It automatically defines \fooindex such that ! 745: % \fooindex ...rest of line... puts an entry in the index foo. ! 746: % It also defines \fooindfile to be the number of the output channel for ! 747: % the file that accumulates this index. The file's extension is foo. ! 748: % The name of an index should be no more than 2 characters long ! 749: % for the sake of vms. ! 750: ! 751: \def\newindex #1{ ! 752: \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file ! 753: \openout \csname#1indfile\endcsname \jobname.#1 % Open the file ! 754: \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex ! 755: \noexpand\doindex {#1}} ! 756: } ! 757: ! 758: % @defindex foo == \newindex{foo} ! 759: ! 760: \def\defindex{\parsearg\newindex} ! 761: ! 762: % @synindex foo bar makes index foo feed into index bar. ! 763: % Do this instead of @defindex foo if you don't want it as a separate index. ! 764: \def\synindex #1 #2 {% ! 765: \expandafter \xdef \csname#1index\endcsname {\noexpand\csname#2index\endcsname}% ! 766: \expandafter \chardef \csname#1indfile\endcsname % ! 767: = \csname#2indfile\endcsname} ! 768: ! 769: % Define \doindex, the driver for all \fooindex macros. ! 770: % Argument #1 is generated by the calling \fooindex macro, ! 771: % and it is "foo", the name of the index. ! 772: ! 773: % \doindex just uses \parsearg; it calls \doind for the actual work. ! 774: % This is because \doind is more useful to call from other macros. ! 775: ! 776: % There is also \dosubind {index}{topic}{subtopic} ! 777: % which makes an entry in a two-level index such as the operation index. ! 778: ! 779: \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer} ! 780: \def\singleindexer #1{\doind{\indexname}{#1}} ! 781: ! 782: \def\indexdummies{% ! 783: \def\bf{\realbackslash bf }% ! 784: \def\rm{\realbackslash rm }% ! 785: \def\sl{\realbackslash sl }% ! 786: \def\dots{\realbackslash dots }% ! 787: \def\copyright{\realbackslash copyright }% ! 788: } ! 789: ! 790: % To define \realbackslash, we must make \ not be an escape. ! 791: % We must first make another character (@) an escape ! 792: % so we do not become unable to do a definition. ! 793: ! 794: {\catcode`\@=0 \catcode`\\=\other ! 795: @gdef@realbackslash{\}} ! 796: ! 797: \let\indexbackslash=0 %overridden during \printindex. ! 798: ! 799: \def\doind #1#2{% ! 800: {\indexdummies % Must do this here, since \bf, etc expand at this stage ! 801: \count10=\lastpenalty % ! 802: \escapechar=`\\% ! 803: {\let\folio=0% Expand all macros now EXCEPT \folio ! 804: \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now ! 805: % so it will be output as is; and it will print as backslash in the indx. ! 806: \edef\temp{% ! 807: \write \csname#1indfile\endcsname{% ! 808: \realbackslash entry {#2}{\folio}{#2}}}% ! 809: \temp }% ! 810: \penalty\count10}} ! 811: ! 812: \def\dosubind #1#2#3{% ! 813: {\indexdummies % Must do this here, since \bf, etc expand at this stage ! 814: \count10=\lastpenalty % ! 815: \escapechar=`\\% ! 816: {\let\folio=0% ! 817: \def\rawbackslashxx{\indexbackslash}% ! 818: \edef\temp{% ! 819: \write \csname#1indfile\endcsname{% ! 820: \realbackslash entry {#2 #3}{\folio}{#2}{#3}}}% ! 821: \temp }% ! 822: \penalty\count10}} ! 823: ! 824: % The index entry written in the file actually looks like ! 825: % \entry {sortstring}{page}{topic} ! 826: % or ! 827: % \entry {sortstring}{page}{topic}{subtopic} ! 828: % The texindex program reads in these files and writes files ! 829: % containing these kinds of lines: ! 830: % \initial {c} ! 831: % before the first topic whose initial is c ! 832: % \entry {topic}{pagelist} ! 833: % for a topic that is used without subtopics ! 834: % \primary {topic} ! 835: % for the beginning of a topic that is used with subtopics ! 836: % \secondary {subtopic}{pagelist} ! 837: % for each subtopic. ! 838: ! 839: % Define the user-accessible indexing commands ! 840: % @findex, @vindex, @kindex, @cindex. ! 841: ! 842: \def\findex {\fnindex} ! 843: \def\kindex {\kyindex} ! 844: \def\cindex {\cpindex} ! 845: \def\vindex {\vrindex} ! 846: \def\tindex {\tpindex} ! 847: \def\pindex {\pgindex} ! 848: ! 849: \def\cindexsub {\begingroup\obeylines\cindexsub} ! 850: {\obeylines % ! 851: \gdef\cindexsub "#1" #2^^M{\endgroup % ! 852: \dosubind{cp}{#2}{#1}}} ! 853: ! 854: % Define the macros used in formatting output of the sorted index material. ! 855: ! 856: % This is what you call to cause a particular index to get printed. ! 857: % Write ! 858: % @unnumbered Function Index ! 859: % @printindex fn ! 860: ! 861: \def\printindex{\parsearg\doprintindex} ! 862: ! 863: \def\doprintindex#1{\tex % ! 864: \catcode`\%=\other\catcode`\&=\other\catcode`\#=\other ! 865: \catcode`\@=\other\catcode`\$=\other\catcode`\_=\other ! 866: \catcode`\~=\other ! 867: \def\indexbackslash{\rawbackslashxx} ! 868: \indexfonts\rm \tolerance=9500 \advance\baselineskip -1pt ! 869: \begindoublecolumns ! 870: \openin 1 \jobname.#1s ! 871: \ifeof 1 \else \closein 1 \input \jobname.#1s ! 872: \fi ! 873: \enddoublecolumns ! 874: \Etex} ! 875: ! 876: % These macros are used by the sorted index file itself. ! 877: % Change them to control the appearance of the index. ! 878: ! 879: \outer\def\initial #1{% ! 880: {\let\tentt=\sectt \let\sf=\sectt ! 881: \bigbreak\line{\secbf#1\hfill}\kern 2pt\penalty3000}} ! 882: ! 883: \outer\def\entry #1#2{ ! 884: {\parfillskip=0in \parskip=0in \parindent=0in ! 885: \hangindent=1in \hangafter=1% ! 886: \noindent\hbox{#1}\leaders\Dotsbox\hskip 0pt plus 1filll #2\par ! 887: }} ! 888: ! 889: \def\primary #1{\line{#1\hfil}} ! 890: ! 891: \newskip\secondaryindent \secondaryindent=0.5cm ! 892: ! 893: \def\secondary #1#2{ ! 894: {\parfillskip=0in \parskip=0in ! 895: \hangindent =1in \hangafter=1 ! 896: \noindent\hskip\secondaryindent\hbox{#1}\leaders\Dotsbox\hskip 0pt plus 1filll#2\par ! 897: }} ! 898: ! 899: %% Define two-column mode, which is used in indexes. ! 900: %% Adapted from the TeXBook, page 416 ! 901: \catcode `\@=11 ! 902: ! 903: \newbox\partialpage ! 904: ! 905: \newdimen\doublecolumnhsize \doublecolumnhsize = 3.11in ! 906: \newdimen\doublecolumnvsize \doublecolumnvsize = 19.1in ! 907: ! 908: \def\begindoublecolumns{\begingroup ! 909: \output={\global\setbox\partialpage=\vbox{\unvbox255\kern -\topskip \kern \baselineskip}}\eject ! 910: \output={\doublecolumnout} \hsize=\doublecolumnhsize \vsize=\doublecolumnvsize} ! 911: \def\enddoublecolumns{\output={\balancecolumns}\eject ! 912: \endgroup \pagegoal=\vsize} ! 913: ! 914: \def\doublecolumnout{\splittopskip=\topskip \splitmaxdepth=\maxdepth ! 915: \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage ! 916: \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ ! 917: \onepageout\pagesofar \unvbox255 \penalty\outputpenalty} ! 918: \def\pagesofar{\unvbox\partialpage % ! 919: \hsize=\doublecolumnhsize % have to restore this since output routine ! 920: % changes it to set cropmarks (P. A. MacKay, 12 Nov. 1986) ! 921: \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}} ! 922: \def\balancecolumns{\setbox0=\vbox{\unvbox255} \dimen@=\ht0 ! 923: \advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip ! 924: \divide\dimen@ by2 \splittopskip=\topskip ! 925: {\vbadness=10000 \loop \global\setbox3=\copy0 ! 926: \global\setbox1=\vsplit3 to\dimen@ ! 927: \ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt \repeat} ! 928: \setbox0=\vbox to\dimen@{\unvbox1} \setbox2=\vbox to\dimen@{\unvbox3} ! 929: \pagesofar} ! 930: ! 931: \catcode `\@=\other ! 932: \message{sectioning,} ! 933: % Define chapters, sections, etc. ! 934: ! 935: \newcount \chapno ! 936: \newcount \secno ! 937: \newcount \subsecno ! 938: \newcount \subsubsecno ! 939: ! 940: % This counter is funny since it counts through charcodes of letters A, B, ... ! 941: \newcount \appendixno \appendixno = `\@ ! 942: \def\appendixletter{\char\the\appendixno} ! 943: ! 944: \newwrite \contentsfile ! 945: \openout \contentsfile = \jobname.toc ! 946: ! 947: % Each @chapter defines this as the name of the chapter. ! 948: % page headings and footings can use it. @section does likewise ! 949: ! 950: \def\thischapter{} \def\thissection{} ! 951: \def\seccheck#1{\if \pageno<0 % ! 952: \errmessage{@#1 not allowed after generating table of contents}\fi ! 953: % ! 954: } ! 955: ! 956: \outer\def\chapter{\parsearg\chapterzzz} ! 957: \def\chapterzzz #1{\seccheck{chapter}% ! 958: \secno=0 \subsecno=0 \subsubsecno=0 \global\advance \chapno by 1 \message{Chapter \the\chapno}% ! 959: \chapmacro {#1}{\the\chapno}% ! 960: \gdef\thissection{#1}\gdef\thischapter{#1}% ! 961: \let\rawbackslash=\relax% ! 962: \edef\temp{{\realbackslash chapentry {#1}{\the\chapno}{\noexpand\folio}}}% ! 963: \escapechar=`\\% ! 964: \write \contentsfile \temp % ! 965: \donoderef % ! 966: } ! 967: ! 968: \outer\def\appendix{\parsearg\appendixzzz} ! 969: \def\appendixzzz #1{\seccheck{appendix}% ! 970: \secno=0 \subsecno=0 \subsubsecno=0 \global\advance \appendixno by 1 \message{Appendix \appendixletter}% ! 971: \chapmacro {#1}{Appendix \appendixletter}% ! 972: \gdef\thischapter{#1}\gdef\thissection{#1}% ! 973: \edef\temp{{\realbackslash chapentry {#1}{Appendix \appendixletter}{\noexpand\folio}}}% ! 974: \escapechar=`\\% ! 975: \write \contentsfile \temp % ! 976: \unnumbnoderef % ! 977: } ! 978: ! 979: \outer\def\unnumbered{\parsearg\unnumberedzzz} ! 980: \def\unnumberedzzz #1{\seccheck{unnumbered}% ! 981: \secno=0 \subsecno=0 \subsubsecno=0 \message{(#1)} ! 982: \unnumbchapmacro {#1}% ! 983: \gdef\thischapter{#1}\gdef\thissection{#1}% ! 984: \edef\temp{{\realbackslash unnumbchapentry {#1}{\noexpand\folio}}}% ! 985: \escapechar=`\\% ! 986: \write \contentsfile \temp % ! 987: \unnumbnoderef % ! 988: } ! 989: ! 990: \outer\def\section{\parsearg\sectionzzz} ! 991: \def\sectionzzz #1{\seccheck{section}% ! 992: \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % ! 993: \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}% ! 994: \edef\temp{{\realbackslash secentry % ! 995: {#1}{\the\chapno}{\the\secno}{\noexpand\folio}}}% ! 996: \escapechar=`\\% ! 997: \write \contentsfile \temp % ! 998: \donoderef % ! 999: \penalty 10000 % ! 1000: } ! 1001: ! 1002: \outer\def\appendixsection{\parsearg\appendixsectionzzz} ! 1003: \outer\def\appendixsec{\parsearg\appendixsectionzzz} ! 1004: \def\appendixsectionzzz #1{\seccheck{appendixsection}% ! 1005: \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % ! 1006: \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}% ! 1007: \edef\temp{{\realbackslash secentry % ! 1008: {#1}{\appendixletter}{\the\secno}{\noexpand\folio}}}% ! 1009: \escapechar=`\\% ! 1010: \write \contentsfile \temp % ! 1011: \unnumbnoderef % ! 1012: \penalty 10000 % ! 1013: } ! 1014: ! 1015: \outer\def\unnumberedsec{\parsearg\unnumberedseczzz} ! 1016: \def\unnumberedseczzz #1{\seccheck{unnumberedsec}% ! 1017: \plainsecheading {#1}\gdef\thissection{#1}% ! 1018: \edef\temp{{\realbackslash unnumbsecentry % ! 1019: {#1}{\noexpand\folio}}}% ! 1020: \escapechar=`\\% ! 1021: \write \contentsfile \temp % ! 1022: \unnumbnoderef % ! 1023: \penalty 10000 % ! 1024: } ! 1025: ! 1026: \outer\def\subsection{\parsearg\subsectionzzz} ! 1027: \def\subsectionzzz #1{\seccheck{subsection}% ! 1028: \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % ! 1029: \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}% ! 1030: \edef\temp{{\realbackslash subsecentry % ! 1031: {#1}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}% ! 1032: \escapechar=`\\% ! 1033: \write \contentsfile \temp % ! 1034: \donoderef % ! 1035: \penalty 10000 % ! 1036: } ! 1037: ! 1038: \outer\def\appendixsubsec{\parsearg\appendixsubseczzz} ! 1039: \def\appendixsubseczzz #1{\seccheck{appendixsubsec}% ! 1040: \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % ! 1041: \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}% ! 1042: \edef\temp{{\realbackslash subsecentry % ! 1043: {#1}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}% ! 1044: \escapechar=`\\% ! 1045: \write \contentsfile \temp % ! 1046: \unnumbnoderef % ! 1047: \penalty 10000 % ! 1048: } ! 1049: ! 1050: \outer\def\unnumberedsubsec{\parsearg\unnumberedsubseczzz} ! 1051: \def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}% ! 1052: \plainsecheading {#1}\gdef\thissection{#1}% ! 1053: \edef\temp{{\realbackslash unnumbsubsecentry % ! 1054: {#1}{\noexpand\folio}}}% ! 1055: \escapechar=`\\% ! 1056: \write \contentsfile \temp % ! 1057: \unnumbnoderef % ! 1058: \penalty 10000 % ! 1059: } ! 1060: ! 1061: \outer\def\subsubsection{\parsearg\subsubsectionzzz} ! 1062: \def\subsubsectionzzz #1{\seccheck{subsubsection}% ! 1063: \gdef\thissection{#1}\global\advance \subsubsecno by 1 % ! 1064: \subsubsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}% ! 1065: \edef\temp{{\realbackslash subsubsecentry % ! 1066: {#1}{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}%\ ! 1067: \escapechar=`\\% ! 1068: \write \contentsfile \temp % ! 1069: \donoderef % ! 1070: \penalty 10000 % ! 1071: } ! 1072: ! 1073: \outer\def\appendixsubsubsec{\parsearg\appendixsubsubseczzz} ! 1074: \def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec}% ! 1075: \gdef\thissection{#1}\global\advance \subsubsecno by 1 % ! 1076: \subsubsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}% ! 1077: \edef\temp{{\realbackslash subsubsecentry % ! 1078: {#1}{\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}%\ ! 1079: \escapechar=`\\% ! 1080: \write \contentsfile \temp % ! 1081: \unnumbnoderef % ! 1082: \penalty 10000 % ! 1083: } ! 1084: ! 1085: \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz} ! 1086: \def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}% ! 1087: \plainsecheading {#1}\gdef\thissection{#1}% ! 1088: \edef\temp{{\realbackslash unnumbsubsubsecentry % ! 1089: {#1}{\noexpand\folio}}}% ! 1090: \escapechar=`\\% ! 1091: \write \contentsfile \temp % ! 1092: \unnumbnoderef % ! 1093: \penalty 10000 % ! 1094: } ! 1095: ! 1096: % Define @majorheading, @heading and @subheading ! 1097: ! 1098: \outer\def\majorheading #1{% ! 1099: {\advance\chapheadingskip by 10pt \chapbreak }% ! 1100: {\chapfonts \line{\chaprm #1\hfill}}\bigskip \par\penalty 200} ! 1101: ! 1102: \outer\def\chapheading #1{\chapbreak % ! 1103: {\chapfonts \line{\chaprm #1\hfill}}\bigskip \par\penalty 200} ! 1104: ! 1105: \let\heading=\secheadingi ! 1106: \let\subheading=\subsecheadingi ! 1107: \let\subsubheading=\subsubsecheadingi ! 1108: ! 1109: % These macros generate a chapter, section, etc. heading only ! 1110: % (including whitespace, linebreaking, etc. around it), ! 1111: % given all the information in convenient, parsed form. ! 1112: ! 1113: %%% Args are the skip and penalty (usually negative) ! 1114: \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} ! 1115: ! 1116: \def\setchapterstyle #1 {\csname CHAPF#1\endcsname} ! 1117: ! 1118: %%% Define plain chapter starts, and page on/off switching for it ! 1119: % Parameter controlling skip before chapter headings (if needed) ! 1120: ! 1121: \newskip \chapheadingskip \chapheadingskip = 30pt plus 8pt minus 4pt ! 1122: ! 1123: \def\chapbreak{\dobreak \chapheadingskip {-4000}} ! 1124: \def\chappager{\par\vfill\supereject} ! 1125: \def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi} ! 1126: ! 1127: \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} ! 1128: \def\CHAPPAGoff{\global\let\pchapsepmacro=\chapbreak} ! 1129: \def\CHAPPAGon{\global\let\pchapsepmacro=\chappager} ! 1130: \def\CHAPPAGodd{\global\let\pchapsepmacro=\chapoddpage} ! 1131: \CHAPPAGon ! 1132: ! 1133: \def\CHAPFplain{ ! 1134: \global\let\chapmacro=\chfplain ! 1135: \global\let\unnumbchapmacro=\unnchfplain} ! 1136: ! 1137: \def\chfplain #1#2{% ! 1138: \pchapsepmacro % ! 1139: {\chapfonts \line{\chaprm #2.\enspace #1\hfill}}\bigskip \par\penalty 5000 % ! 1140: } ! 1141: ! 1142: \def\unnchfplain #1{% ! 1143: \pchapsepmacro % ! 1144: {\chapfonts \line{\chaprm #1\hfill}}\bigskip \par\penalty 10000 % ! 1145: } ! 1146: \CHAPFplain % The default ! 1147: ! 1148: \def\unnchfopen #1{% ! 1149: \chapoddpage {\chapfonts \line{\chaprm #1\hfill}}\bigskip \par\penalty 10000 % ! 1150: } ! 1151: ! 1152: \def\chfopen #1#2{\chapoddpage {\chapfonts ! 1153: \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% ! 1154: \par\penalty 5000 % ! 1155: } ! 1156: ! 1157: \def\CHAPFopen{ ! 1158: \global\let\chapmacro=\chfopen ! 1159: \global\let\unnumbchapmacro=\unnchfopen} ! 1160: ! 1161: % Parameter controlling skip before section headings. ! 1162: ! 1163: \newskip \subsecheadingskip \subsecheadingskip = 17pt plus 8pt minus 4pt ! 1164: \def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}} ! 1165: ! 1166: \newskip \secheadingskip \secheadingskip = 21pt plus 8pt minus 4pt ! 1167: \def\secheadingbreak{\dobreak \secheadingskip {-1000}} ! 1168: ! 1169: \def\secheading #1#2#3{\secheadingi {#2.#3\enspace #1}} ! 1170: \def\plainsecheading #1{\secheadingi {#1}} ! 1171: \def\secheadingi #1{{\advance \secheadingskip by \parskip % ! 1172: \secheadingbreak}% ! 1173: {\secfonts \line{\secrm #1\hfill}}% ! 1174: \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 } ! 1175: ! 1176: \def\subsecheading #1#2#3#4{{\advance \subsecheadingskip by \parskip % ! 1177: \subsecheadingbreak}% ! 1178: {\secfonts \line{\secrm#2.#3.#4\enspace #1\hfill}}% ! 1179: \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 } ! 1180: ! 1181: \def\subsubsecfonts{\subsecfonts} % Maybe this should change ! 1182: ! 1183: \def\subsubsecheading #1#2#3#4#5{{\advance \subsecheadingskip by \parskip % ! 1184: \subsecheadingbreak}% ! 1185: {\secfonts \line{\secrm#2.#3.#4.#5\enspace #1\hfill}}% ! 1186: \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000} ! 1187: ! 1188: \message{toc printing,} ! 1189: ! 1190: \def\Dotsbox{\hbox to 1em{\hss.\hss}} % Used by index macros ! 1191: ! 1192: \def\finishcontents{% ! 1193: \ifnum\pageno>0 % ! 1194: \par\vfill\supereject % ! 1195: \immediate\closeout \contentsfile% ! 1196: \pageno=-1 % Request roman numbered pages ! 1197: \fi} ! 1198: ! 1199: \outer\def\contents{% ! 1200: \finishcontents % ! 1201: \unnumbchapmacro{Table of Contents} ! 1202: \def\thischapter{Table of Contents} ! 1203: {\catcode`\\=0 ! 1204: \catcode`\{=1 % Set up to handle contents files properly ! 1205: \catcode`\}=2 ! 1206: \catcode`\@=11 ! 1207: \input \jobname.toc ! 1208: } ! 1209: \vfill \eject} ! 1210: ! 1211: \outer\def\summarycontents{% ! 1212: \finishcontents % ! 1213: \unnumbchapmacro{Summary Table of Contents} ! 1214: \def\thischapter{Summary Table of Contents} ! 1215: {\catcode`\\=0 ! 1216: \catcode`\{=1 % Set up to handle contents files properly ! 1217: \catcode`\}=2 ! 1218: \catcode`\@=11 ! 1219: \def\smallbreak{} ! 1220: \def\secentry ##1##2##3##4{} ! 1221: \def\subsecentry ##1##2##3##4##5{} ! 1222: \def\subsubsecentry ##1##2##3##4##5##6{} ! 1223: \def\unnumbsecentry ##1##2{} ! 1224: \let\medbreak=\smallbreak ! 1225: \input \jobname.toc ! 1226: } ! 1227: \vfill \eject} ! 1228: ! 1229: \outer\def\bye{\par\vfill\supereject\tracingstats=1\ptexend} ! 1230: ! 1231: % These macros generate individual entries in the table of contents ! 1232: % The first argument is the chapter or section name. ! 1233: % The last argument is the page number. ! 1234: % The arguments in between are the chapter number, section number, ... ! 1235: ! 1236: \def\chapentry #1#2#3{% ! 1237: \medbreak ! 1238: \line{#2.\space#1\leaders\hbox to 1em{\hss.\hss}\hfill #3} ! 1239: } ! 1240: ! 1241: \def\unnumbchapentry #1#2{% ! 1242: \medbreak ! 1243: \line{#1\leaders\Dotsbox\hfill #2} ! 1244: } ! 1245: ! 1246: \def\secentry #1#2#3#4{% ! 1247: \line{\enspace\enspace#2.#3\space#1\leaders\Dotsbox\hfill#4} ! 1248: } ! 1249: ! 1250: \def\unnumbsecentry #1#2{% ! 1251: \line{\enspace\enspace#1\leaders\Dotsbox\hfill #2} ! 1252: } ! 1253: ! 1254: \def\subsecentry #1#2#3#4#5{% ! 1255: \line{\enspace\enspace\enspace\enspace ! 1256: #2.#3.#4\space#1\leaders\Dotsbox\hfill #5} ! 1257: } ! 1258: ! 1259: \def\unnumbsubsecentry #1#2{% ! 1260: \line{\enspace\enspace\enspace\enspace#1\leaders\Dotsbox\hfill #2} ! 1261: } ! 1262: ! 1263: \def\subsubsecentry #1#2#3#4#5#6{% ! 1264: \line{\enspace\enspace\enspace\enspace\enspace\enspace ! 1265: #2.#3.#4.#5\space#1\leaders\Dotsbox\hfill #6} ! 1266: } ! 1267: ! 1268: \def\unnumbsubsubsecentry #1#2{% ! 1269: \line{\enspace\enspace\enspace\enspace\enspace\enspace#1\leaders\Dotsbox\hfill #2} ! 1270: } ! 1271: ! 1272: \message{environments,} ! 1273: ! 1274: % @tex ... @end tex escapes into raw Tex temporarily. ! 1275: % One exception: @ is still an escape character, so that @end tex works. ! 1276: % But \@ or @@ will get a plain tex @ character. ! 1277: ! 1278: \def\tex{\begingroup ! 1279: \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 ! 1280: \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 ! 1281: \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie ! 1282: \catcode `\%=14 ! 1283: \catcode`\"=12 ! 1284: \catcode`\|=12 ! 1285: \catcode`\<=12 ! 1286: \catcode`\>=12 ! 1287: \escapechar=`\\ ! 1288: ! 1289: \let\{=\ptexlbrace ! 1290: \let\}=\ptexrbrace ! 1291: \let\.=\ptexdot ! 1292: \let\*=\ptexstar ! 1293: \def\@={@} ! 1294: \let\bullet=\ptexbullet ! 1295: \let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext \let\l=\ptexl ! 1296: \let\L=\ptexL ! 1297: ! 1298: \let\Etex=\endgroup} ! 1299: ! 1300: % Define @lisp ... @endlisp. ! 1301: % @lisp does a \begingroup so it can rebind things, ! 1302: % including the definition of @endlisp (which normally is erroneous). ! 1303: ! 1304: % Amount to narrow the margins by for @lisp. ! 1305: \newskip\lispnarrowing \lispnarrowing=0.4in ! 1306: ! 1307: % This is the definition that ^M gets inside @lisp ! 1308: % phr: changed space to \null, to avoid overfull hbox problems. ! 1309: {\obeyspaces% ! 1310: \gdef\lisppar{\null\endgraf}} ! 1311: ! 1312: % Cause \obeyspaces to make each Space cause a word-separation ! 1313: % rather than the default which is that it acts punctuation. ! 1314: % This is because space in tt font looks funny. ! 1315: {\obeyspaces % ! 1316: \gdef\sepspaces{\def {\ }}} ! 1317: ! 1318: \newskip\aboveenvskipamount \aboveenvskipamount= 0pt ! 1319: \def\aboveenvbreak{{\advance\aboveenvskipamount by \parskip ! 1320: \endgraf \ifdim\lastskip<\aboveenvskipamount ! 1321: \removelastskip \penalty-50 \vskip\aboveenvskipamount \fi}} ! 1322: ! 1323: \def\afterenvbreak{\endgraf \ifdim\lastskip<\aboveenvskipamount ! 1324: \removelastskip \penalty-50 \vskip\aboveenvskipamount \fi} ! 1325: ! 1326: \def\lisp{\aboveenvbreak\begingroup\inENV %This group ends at the end of the @lisp body ! 1327: \hfuzz=12truept % Don't be fussy ! 1328: % Make spaces be word-separators rather than space tokens. ! 1329: \sepspaces % ! 1330: % Single space lines ! 1331: \singlespace % ! 1332: % The following causes blank lines not to be ignored ! 1333: % by adding a space to the end of each line. ! 1334: \let\par=\lisppar ! 1335: \def\Elisp{\endgroup\afterenvbreak}% ! 1336: \parskip=0pt \advance \rightskip by \lispnarrowing ! 1337: \advance \leftskip by \lispnarrowing ! 1338: \parindent=0pt ! 1339: \let\exdent=\internalexdent ! 1340: \obeyspaces \obeylines \tt \rawbackslash ! 1341: \def\next##1{}\next} ! 1342: ! 1343: ! 1344: \let\example=\lisp ! 1345: \def\Eexample{\Elisp} ! 1346: ! 1347: \let\smallexample=\lisp ! 1348: \def\Esmallexample{\Elisp} ! 1349: ! 1350: % Macro for 9 pt. examples, necessary to print with 5" lines. ! 1351: % From Pavel@xerox. This is not really used unless the ! 1352: % @smallbook command is given. ! 1353: ! 1354: \def\smalllispx{\aboveenvbreak\begingroup\inENV ! 1355: % This group ends at the end of the @lisp body ! 1356: \hfuzz=12truept % Don't be fussy ! 1357: % Make spaces be word-separators rather than space tokens. ! 1358: \sepspaces % ! 1359: % Single space lines ! 1360: \singlespace % ! 1361: % The following causes blank lines not to be ignored ! 1362: % by adding a space to the end of each line. ! 1363: \let\par=\lisppar ! 1364: \def\Esmalllisp{\endgroup\afterenvbreak}% ! 1365: \parskip=0pt \advance \rightskip by \lispnarrowing ! 1366: \advance \leftskip by \lispnarrowing ! 1367: \parindent=0pt ! 1368: \let\exdent=\internalexdent ! 1369: \obeyspaces \obeylines \ninett \rawbackslash ! 1370: \def\next##1{}\next} ! 1371: ! 1372: % This is @display; same as @lisp except use roman font. ! 1373: ! 1374: \def\display{\begingroup\inENV %This group ends at the end of the @display body ! 1375: \aboveenvbreak ! 1376: % Make spaces be word-separators rather than space tokens. ! 1377: \sepspaces % ! 1378: % Single space lines ! 1379: \singlespace % ! 1380: % The following causes blank lines not to be ignored ! 1381: % by adding a space to the end of each line. ! 1382: \let\par=\lisppar ! 1383: \def\Edisplay{\endgroup\afterenvbreak}% ! 1384: \parskip=0pt \advance \rightskip by \lispnarrowing ! 1385: \advance \leftskip by \lispnarrowing ! 1386: \parindent=0pt ! 1387: \let\exdent=\internalexdent ! 1388: \obeyspaces \obeylines ! 1389: \def\next##1{}\next} ! 1390: ! 1391: % This is @format; same as @lisp except use roman font and don't narrow margins ! 1392: ! 1393: \def\format{\begingroup\inENV %This group ends at the end of the @format body ! 1394: \aboveenvbreak ! 1395: % Make spaces be word-separators rather than space tokens. ! 1396: \sepspaces % ! 1397: \singlespace % ! 1398: % The following causes blank lines not to be ignored ! 1399: % by adding a space to the end of each line. ! 1400: \let\par=\lisppar ! 1401: \def\Eformat{\endgroup\afterenvbreak} ! 1402: \parskip=0pt \parindent=0pt ! 1403: \obeyspaces \obeylines ! 1404: \def\next##1{}\next} ! 1405: ! 1406: % @flushleft and @flushright ! 1407: ! 1408: \def\flushleft{\begingroup\inENV %This group ends at the end of the @format body ! 1409: \aboveenvbreak ! 1410: % Make spaces be word-separators rather than space tokens. ! 1411: \sepspaces % ! 1412: % The following causes blank lines not to be ignored ! 1413: % by adding a space to the end of each line. ! 1414: % This also causes @ to work when the directive name ! 1415: % is terminated by end of line. ! 1416: \let\par=\lisppar ! 1417: \def\Eflushleft{\endgroup\afterenvbreak}% ! 1418: \parskip=0pt \parindent=0pt ! 1419: \obeyspaces \obeylines ! 1420: \def\next##1{}\next} ! 1421: ! 1422: \def\flushright{\begingroup\inENV %This group ends at the end of the @format body ! 1423: \aboveenvbreak ! 1424: % Make spaces be word-separators rather than space tokens. ! 1425: \sepspaces % ! 1426: % The following causes blank lines not to be ignored ! 1427: % by adding a space to the end of each line. ! 1428: % This also causes @ to work when the directive name ! 1429: % is terminated by end of line. ! 1430: \let\par=\lisppar ! 1431: \def\Eflushright{\endgroup\afterenvbreak}% ! 1432: \parskip=0pt \parindent=0pt ! 1433: \advance \leftskip by 0pt plus 1fill ! 1434: \obeyspaces \obeylines ! 1435: \def\next##1{}\next} ! 1436: ! 1437: % @quotation - narrow the margins. ! 1438: ! 1439: \def\quotation{\begingroup\inENV %This group ends at the end of the @quotation body ! 1440: {\parskip=0pt % because we will skip by \parskip too, later ! 1441: \aboveenvbreak}% ! 1442: \singlespace ! 1443: \parindent=0pt ! 1444: \def\Equotation{\par\endgroup\afterenvbreak}% ! 1445: \advance \rightskip by \lispnarrowing ! 1446: \advance \leftskip by \lispnarrowing} ! 1447: ! 1448: \message{cross reference,} ! 1449: % Define cross-reference macros ! 1450: \newwrite \auxfile ! 1451: ! 1452: % \setref{foo} defines a cross-reference point named foo. ! 1453: ! 1454: \def\setref#1{% ! 1455: \dosetq{#1-pg}{Ypagenumber}% ! 1456: \dosetq{#1-snt}{Ysectionnumberandtype}} ! 1457: ! 1458: \def\unnumbsetref#1{% ! 1459: \dosetq{#1-pg}{Ypagenumber}% ! 1460: \dosetq{#1-snt}{Ynothing}} ! 1461: ! 1462: % \xref and \pxref generate cross references to specified points. ! 1463: ! 1464: \def\pxref #1{see \xrefX [#1,,,,,,,]} ! 1465: \def\xref #1{See \xrefX [#1,,,,,,,]} ! 1466: \def\xrefX [#1,#2,#3,#4,#5,#6]{% ! 1467: \setbox1=\hbox{\i{\losespace#5{}}}% ! 1468: \setbox0=\hbox{\losespace#3{}}% ! 1469: \ifdim \wd0 =0pt \setbox0=\hbox{\losespace#1{}}\fi% ! 1470: \ifdim \wd1 >0pt% ! 1471: section \unhbox0{} in \unhbox1% ! 1472: \else% ! 1473: \refx{#1-snt} [\unhbox0], page\tie \refx{#1-pg}% ! 1474: \fi } ! 1475: ! 1476: % \dosetq is the interface for calls from other macros ! 1477: ! 1478: \def\dosetq #1#2{{\let\folio=0% ! 1479: \edef\next{\write\auxfile{\internalsetq {#1}{#2}}}% ! 1480: \next}} ! 1481: ! 1482: % \internalsetq {foo}{page} expands into CHARACTERS 'xrdef {foo}{...expansion of \Ypage...} ! 1483: % When the aux file is read, ' is the escape character ! 1484: ! 1485: \def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}} ! 1486: ! 1487: % Things to be expanded by \internalsetq ! 1488: ! 1489: \def\Ypagenumber{\folio} ! 1490: ! 1491: \def\Ynothing{} ! 1492: ! 1493: \def\Ysectionnumberandtype{% ! 1494: \ifnum\secno=0 chapter\xreftie\the\chapno % ! 1495: \else \ifnum \subsecno=0 section\xreftie\the\chapno.\the\secno % ! 1496: \else \ifnum \subsubsecno=0 % ! 1497: section\xreftie\the\chapno.\the\secno.\the\subsecno % ! 1498: \else % ! 1499: section\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno % ! 1500: \fi \fi \fi } ! 1501: ! 1502: \gdef\xreftie{'tie} ! 1503: ! 1504: % Define @refx to reference a specific cross-reference string. ! 1505: ! 1506: \def\refx#1{% ! 1507: {% ! 1508: \expandafter\ifx\csname X#1\endcsname\relax ! 1509: % If not defined, say something at least. ! 1510: \expandafter\gdef\csname X#1\endcsname {$<$undefined$>$}% ! 1511: \message {WARNING: Cross-reference "#1" used but not yet defined}% ! 1512: \message {}% ! 1513: \fi % ! 1514: \csname X#1\endcsname %It's defined, so just use it. ! 1515: }} ! 1516: ! 1517: % Read the last existing aux file, if any. No error if none exists. ! 1518: ! 1519: % This is the macro invoked by entries in the aux file. ! 1520: \def\xrdef #1#2{ ! 1521: {\catcode`\'=\other\expandafter \gdef \csname X#1\endcsname {#2}}} ! 1522: ! 1523: { ! 1524: \catcode `\^^@=\other ! 1525: \catcode `\&=\other ! 1526: \catcode `\=\other ! 1527: \catcode `\^^C=\other ! 1528: \catcode `\^^D=\other ! 1529: \catcode `\^^E=\other ! 1530: \catcode `\^^F=\other ! 1531: \catcode `\^^G=\other ! 1532: \catcode `\^^H=\other ! 1533: \catcode `\=\other ! 1534: \catcode `\^^L=\other ! 1535: \catcode `\=\other ! 1536: \catcode `\=\other ! 1537: \catcode `\=\other ! 1538: \catcode `\=\other ! 1539: \catcode `\=\other ! 1540: \catcode `\=\other ! 1541: \catcode `\=\other ! 1542: \catcode `\=\other ! 1543: \catcode `\=\other ! 1544: \catcode `\=\other ! 1545: \catcode `\=\other ! 1546: \catcode `\=\other ! 1547: \catcode `\=\other ! 1548: \catcode `\^^[=\other ! 1549: \catcode `\^^\=\other ! 1550: \catcode `\^^]=\other ! 1551: \catcode `\^^^=\other ! 1552: \catcode `\^^_=\other ! 1553: \catcode `\@=\other ! 1554: \catcode `\^=\other ! 1555: \catcode `\~=\other ! 1556: \catcode `\[=\other ! 1557: \catcode `\]=\other ! 1558: \catcode`\"=\other ! 1559: \catcode`\_=\other ! 1560: \catcode`\|=\other ! 1561: \catcode`\<=\other ! 1562: \catcode`\>=\other ! 1563: \catcode `\$=\other ! 1564: \catcode `\#=\other ! 1565: \catcode `\&=\other ! 1566: ! 1567: % the aux file uses ' as the escape. ! 1568: % Turn off \ as an escape so we do not lose on ! 1569: % entries which were dumped with control sequences in their names. ! 1570: % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^ ! 1571: % Reference to such entries still does not work the way one would wish, ! 1572: % but at least they do not bomb out when the aux file is read in. ! 1573: ! 1574: \catcode `\{=1 \catcode `\}=2 ! 1575: \catcode `\%=\other ! 1576: \catcode `\'=0 ! 1577: \catcode `\\=\other ! 1578: ! 1579: 'openin 1 'jobname.aux ! 1580: 'ifeof 1 'else 'closein 1 'input 'jobname.aux ! 1581: 'fi ! 1582: } ! 1583: ! 1584: % Open the new aux file. Tex will close it automatically at exit. ! 1585: ! 1586: \openout \auxfile=\jobname.aux ! 1587: ! 1588: % Footnotes. ! 1589: ! 1590: \newcount \footnoteno ! 1591: ! 1592: \def\supereject{\par\penalty -20000\footnoteno =0 } ! 1593: ! 1594: \let\ptexfootnote=\footnote ! 1595: ! 1596: {\catcode `\@=11 ! 1597: \gdef\footnote{\global\advance \footnoteno by \@ne ! 1598: \edef\thisfootno{$^{\the\footnoteno}$}% ! 1599: \let\@sf\empty ! 1600: \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi ! 1601: \thisfootno\@sf\parsearg\footnotezzz} ! 1602: ! 1603: \gdef\footnotezzz #1{\insert\footins{ ! 1604: \interlinepenalty\interfootnotelinepenalty ! 1605: \splittopskip\ht\strutbox % top baseline for broken footnotes ! 1606: \splitmaxdepth\dp\strutbox \floatingpenalty\@MM ! 1607: \leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip ! 1608: \footstrut\hang\textindent{\thisfootno}#1\strut}} ! 1609: ! 1610: }%end \catcode `\@=11 ! 1611: ! 1612: % End of control word definitions. ! 1613: ! 1614: \message{and turning on texinfo input format.} ! 1615: ! 1616: \newindex{cp} ! 1617: \newindex{fn} ! 1618: \newindex{vr} ! 1619: \newindex{tp} ! 1620: \newindex{ky} ! 1621: \newindex{pg} ! 1622: ! 1623: % Set some numeric style parameters, for 8.5 x 11 format. ! 1624: ! 1625: \hsize = 6.5in ! 1626: \parindent 15pt ! 1627: \parskip 18pt plus 1pt ! 1628: \baselineskip 15pt ! 1629: \advance\topskip by 1.2cm ! 1630: ! 1631: % Use @smallbook to reset parameters for 7x9.5 format ! 1632: \def\smallbook{ ! 1633: \global\lispnarrowing = 0.3in ! 1634: \global\baselineskip 12pt ! 1635: \global\parskip 3pt plus 1pt ! 1636: \global\hsize = 5in ! 1637: \global\doublecolumnhsize=2.4in \global\doublecolumnvsize=15.0in ! 1638: \global\vsize=7.5in ! 1639: \global\tolerance=700 ! 1640: \global\hfuzz=1pt ! 1641: ! 1642: \global\pagewidth=\hsize ! 1643: \global\pageheight=\vsize ! 1644: \global\font\ninett=cmtt9 ! 1645: ! 1646: \global\let\smalllisp=\smalllispx ! 1647: \global\let\smallexample=\smalllispx ! 1648: \global\def\Esmallexample{\Esmalllisp} ! 1649: } ! 1650: ! 1651: %% For a final copy, take out the rectangles ! 1652: %% that mark overfull boxes (in case you have decided ! 1653: %% that the text looks ok even though it passes the margin). ! 1654: \def\finalout{\overfullrule=0pt} ! 1655: ! 1656: % Turn off all special characters except @ ! 1657: % (and those which the user can use as if they were ordinary) ! 1658: % Define certain chars to be always in tt font. ! 1659: ! 1660: \catcode`\"=\active ! 1661: \def\activedoublequote{{\tt \char '042}} ! 1662: \let"=\activedoublequote ! 1663: \catcode`\~=\active ! 1664: \def~{{\tt \char '176}} ! 1665: \chardef\hat=`\^ ! 1666: \catcode`\^=\active ! 1667: \def^{{\tt \hat}} ! 1668: \catcode`\_=\active ! 1669: \def_{{\tt \char '137}} ! 1670: \catcode`\|=\active ! 1671: \def|{{\tt \char '174}} ! 1672: \chardef \less=`\< ! 1673: \catcode`\<=\active ! 1674: \def<{{\tt \less}} ! 1675: \chardef \gtr=`\> ! 1676: \catcode`\>=\active ! 1677: \def>{{\tt \gtr}} ! 1678: ! 1679: \catcode`\@=0 ! 1680: ! 1681: % \rawbackslashxx output one backslash character in current font ! 1682: {\catcode`\\=\other ! 1683: @gdef@rawbackslashxx{\}} ! 1684: ! 1685: % \rawbackslash redefines \ as input to do \rawbackslashxx. ! 1686: {\catcode`\\=\active ! 1687: @gdef@rawbackslash{@let\=@rawbackslashxx }} ! 1688: ! 1689: % \normalbackslash outputs one backslash in fixed width font. ! 1690: \def\normalbackslash{{\tt\rawbackslashxx}} ! 1691: ! 1692: % Say @foo, not \foo, in error messages. ! 1693: \escapechar=`\@ ! 1694: ! 1695: %% These look ok in all fonts, so just make them not special. The @rm below ! 1696: %% makes sure that the current font starts out as the newly loaded cmr10 ! 1697: \catcode`\$=\other \catcode`\%=\other \catcode`\&=\other \catcode`\#=\other ! 1698: ! 1699: \catcode 17=0 @c Define control-q ! 1700: \catcode`\\=\active ! 1701: @let\=@normalbackslash ! 1702: ! 1703: @textfonts ! 1704: @rm
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.