texinfo.tex 52 KB

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