botex.tex 64 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987
  1. %% TeX macros to simulate something like Bolio
  2. \def\BoTeXrevdate{15 July 1985} \def\BoTeXversion{0.26}
  3. \message{Loading BoTeX package [Version \BoTeXversion\space of \BoTeXrevdate]:}
  4. \message{}
  5. %% Revisions:
  6. %%
  7. %% Version Date Changes
  8. %% 0.02 31 Oct 84 (RMS) \Bfoo -> \foo, argument parsing, Scribble cruft,
  9. %% gobs of features.
  10. %% 0.03 2 Nov 84 (RpK) Try to get headings to work; use CM fonts,
  11. %% centralize outside font definitions.
  12. %% 0.04 6 Nov 84 (RpK) Tune the fonts, add @b,i,r,t from Scribe.
  13. %% Plus: @l Lisp font, usually sans-serif)
  14. %% @s Small caps (can't use @c !)
  15. %% @ii TeX italics. (@i is really slanted.)
  16. %% 0.05 13 Nov 84 (RpK) @titlepage command, @copyrightpage environment
  17. %% @setq x section-name, chapter-name
  18. %% 0.06 14 Nov 84 (RpK) Headings are off by default; turn them on after
  19. %% the front pages. @end[foo] is smart about error
  20. %% message -- top level \Efoo's are no longer needed.
  21. %% 0.07 20 Nov 84 (RpK) Kill @section page break.
  22. %% 0.08 21 Nov 84 (RpK) Fix headings (again, sigh)
  23. %% 0.09 27 Nov 84 (RpK) Make headings a little smaller. Avoid
  24. %% @thischapter lookahead lossage.
  25. %% 0.10 29 Nov 84 (RpK) Fix @setx, increment section #'s globally
  26. %% 0.11 30 Nov 84 (RpK) Kludge for @@ until the fonts are fixed.
  27. %% 0.12 6 Dec 84 (RpK) @fontvector, @settabs support, @bye shows stats,
  28. %% () as delims, itemindent is 8.in, @end description
  29. %% @lisp is less fussy (more \hfuzz), @label and
  30. %% @pageref, @title, and @nameref for it.
  31. %% 0.13 10 Dec 84 (RpK) @figure, @fullpage-, @top-. No toc for them yet.
  32. %% 0.13a 17 Dec 84 (RpK) Typo in odd-page chapter macro
  33. %% 0.14 15 Jan 85 (RpK) @synindex bug. @cindex &c. uses \parsearg
  34. %% 0.15 23 Jan 85 (RpK) Fix output, adding \onepageout.
  35. %% 0.16 7 Mar 85 (RpK) Put lmipart on front, add copyrightdate variable
  36. %% 0.18 4 Apr 85 (RpK) ``open'' chapter style started. More
  37. %% space before a section heading; \subsecheadingskip
  38. %% Fix output (again !); appendix letters in TOC.
  39. %% 0.19 23 Apr 85 (RpK) Fix headers/footers in indices. Fix typos.
  40. %% 0.20 5 Jun 85 (RMS) {} delimited arguments. ``No Title''
  41. %% is the initial title.
  42. %% 0.21 15 Jun 85 (RMS) Use \aboveenvbreak and \afterenvbreak
  43. %% rather than \smallbreak, around environments.
  44. %% \aboveenvbreak adds in \parskip to make space
  45. %% after and before the same.
  46. %% \aboveenvskipamount is amount of additional skip
  47. %% beyond \parskip.
  48. %% Add in \parskip to break before section heading.
  49. %% Make penalty after section heading really work.
  50. %% \parskip inside itemize, etc, is same as
  51. %% item spacing. Define @example, same as @lisp.
  52. %% Make xrefs get section # when read, not
  53. %% when shippedout.
  54. %% 0.22 17 Jun 85 (RpK) Snag runaway intersection whitespace
  55. %% 0.23 19 Jun 85 (RMS) Fix unaligned dots in indexes.
  56. %% Fix special characters in indexes.
  57. %% 0.24 13 Jul 85 (RMS) Define \tableindent, indent of table
  58. %% bodies. \itemindent still used for
  59. %% @itemize and @enumerate.
  60. %% Use \aboveenvbreak and \afterenvbreak
  61. %% in @table, @itemize, @enumerate.
  62. %% 0.25 14 Jul 85 (RMS) Define @subsubheading.
  63. %% Fix bug where aboveenvbreak clobbered
  64. %% aboveenvskipamount.
  65. %% 0.26 15 Jul 85 (RMS) Use \medbreak between chapters in
  66. %% @summarycontents. Double indentation
  67. %% for sections, subsecs, subsubsecs
  68. %% in full contents.
  69. %% Todo:
  70. %% Tabular/Matrix environments, figures
  71. %% Fix @, \ characters (fonts are generally 'orrible)
  72. \message{Basics,}
  73. \chardef\other=12
  74. \parskip=1.5pt
  75. \advance\topskip by 1.2cm
  76. % Compensate for losing imagen.
  77. \advance \hoffset 1in
  78. \advance \voffset 1in
  79. \hyphenation{ap-pen-dix zeta-lisp}
  80. % Copyright notice
  81. \def\Xcopyrightdate{\number\year}
  82. \def\LMIcopyright{Copyright \copyright\ \Xcopyrightdate\ Lisp Machine Incorporated.}
  83. \def\LMIpub{\vbox{%
  84. \line{\hfil Published by LMI 1000 Massachusetts Avenue. Cambridge MA 02138 USA}}}
  85. % Margin to add to right of even pages, to left of odd pages.
  86. \newdimen \bindingoffset \bindingoffset=0pt
  87. \newdimen \normaloffset \normaloffset=\hoffset
  88. \newdimen\pagewidth \newdimen\pageheight
  89. \pagewidth=\hsize \pageheight=\vsize
  90. % \onepageout takes a vbox as an argument. Note that \pagecontents
  91. % does insertions itself, but you have to call it yourself.
  92. \chardef\PAGE=255 \output={\onepageout{\pagecontents\PAGE}}
  93. \def\onepageout#1{\hoffset=\normaloffset
  94. \ifodd\pageno \advance\hoffset by \bindingoffset
  95. \else \advance\hoffset by -\bindingoffset\fi
  96. \shipout\vbox{{\let\hsize=\pagewidth \makeheadline} \pagebody{#1}%
  97. {\let\hsize=\pagewidth \makefootline}}
  98. \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi}
  99. \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
  100. {\catcode`\@ =11
  101. \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
  102. \dimen@=\dp#1 \unvbox#1
  103. \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
  104. \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
  105. }
  106. % Parse an argument, then pass it to #1.
  107. % The argument can be delimited with [...] or with "..."
  108. % or it can be a whole line.
  109. % #1 should be a macro which expects
  110. % an ordinary undelimited TeX argument.
  111. \def\parsearg #1{\let\next=#1\begingroup\obeylines\futurelet\temp\parseargx}
  112. \def\parseargx{%
  113. \ifx \obeyedspace\temp \aftergroup\parseargdiscardspace \else%
  114. \ifx [\temp \aftergroup\parseargbracket\else%
  115. \ifx (\temp \aftergroup\parseargparen\else%
  116. \ifx \activedoublequote\temp \aftergroup\parseargdoublequote\else%
  117. \ifx \mylbrace\temp \aftergroup\parseargbrace\else%
  118. \aftergroup \parseargline %
  119. \fi\fi\fi\fi\fi \endgroup}
  120. {\obeyspaces %
  121. \gdef\parseargdiscardspace {\begingroup\obeylines\futurelet\temp\parseargx}}
  122. \gdef\obeyedspace{\ }
  123. \def\parseargbracket [#1]{\next {#1}} \def\parseargparen (#1){\next {#1}}
  124. {\catcode `\"=\active
  125. \gdef\parseargdoublequote "#1"{\next {#1}}}
  126. {\catcode `\[=1 \catcode `\]=2 \catcode `\}=\active
  127. \catcode `\{=\active
  128. \gdef\parseargbrace {#1}[\next [#1]]]
  129. \def\parseargline{\begingroup \obeylines \parsearglinex}
  130. {\obeylines %
  131. \gdef\parsearglinex #1^^M{\endgroup \next {#1}}}
  132. %% These are used to keep @begin/@end levels from running away
  133. %% Call \inENV within environments (after a \begingroup)
  134. \newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
  135. \def\ENVcheck{%
  136. \ifENV\errmessage{Still within an environment. Type Return to continue.}
  137. \endgroup\fi} % This is not perfect, but it should reduce lossage
  138. % @begin foo is the same as @foo, for now.
  139. \newhelp\EMsimple{Type <Return> to continue}
  140. \outer\def\begin{\parsearg\beginxxx}
  141. \def\beginxxx #1{%
  142. \expandafter\ifx\csname #1\endcsname\relax
  143. {\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else
  144. \csname #1\endcsname\fi}
  145. %% @end foo executes the definition of \Efoo.
  146. %% foo can be delimited by doublequotes or brackets.
  147. \let\ptexend = \end
  148. \def\end{\parsearg\endxxx}
  149. \def\endxxx #1{%
  150. \expandafter\ifx\csname E#1\endcsname\relax
  151. \expandafter\ifx\csname #1\endcsname\relax
  152. \errmessage{Undefined command @end #1}\else
  153. \errorE{#1}\fi\fi
  154. \csname E#1\endcsname}
  155. \def\errorE#1{
  156. {\errhelp=\EMsimple \errmessage{@end #1 not within #1 environment}}}
  157. % Simple aliases that make some plain tex constructs available.
  158. \let\nopara=\noindent
  159. \let\ptexnobreak=\nobreak
  160. \def\nobreak{\par\penalty 10000}
  161. % Single-spacing is done by various environments.
  162. \newskip\singlespaceskip \singlespaceskip = \baselineskip
  163. \def\singlespace{\baselineskip=\singlespaceskip}
  164. % @@ prints an @ -- for Scribe compatibility.
  165. % Kludge this until the fonts are right (grr).
  166. \def\@{{\sf @}}
  167. % @: is a Scribe command to cause end-of-sentence whitespace.
  168. \def\:{\spacefactor=3000 }
  169. % @* forces a line break.
  170. \let\ptexstar=\* \def\*{\hfil\break}
  171. % @. is an abbreviation period.
  172. \let\ptexdot=\. \def\.{.\spacefactor=1000 }
  173. % @# leaves space for a special character.
  174. \let\ptexnumsign=\# \def\#{\write19{(@##)}\hbox to 0.7em{\hfil}}
  175. % @w prevents a word break
  176. \def\w{\parsearg\atomx} \def\atomx #1{\hbox{#1}}
  177. % Save the essence of & for tabular environments as @\ for BoTeX
  178. % Say @settabs 4 @columns, then @<col0@\col1@\col2@\col3@cr
  179. \let\\=& \let\<=\+
  180. % @+ raises its argument, @- lowers.
  181. \let\ptexplus=\+
  182. \def\+{\parsearg\plusxxx} \def\plusxxx #1{\raise 1ex\hbox{#1}}
  183. \let\ptexminus=\-
  184. \def\-{\parsearg\minusxxx} \def\minusxxx #1{\lower 1ex\hbox{#1}}
  185. % @titlepage outputs a standard LMI window title page
  186. % titlecomment, lmipart can be @setx'ed
  187. \def\Xlmipart{} \def\Xtitlecomment{}
  188. \def\titlepage{
  189. {\advance\hsize by 0.064truein % Just enough to hit the window
  190. \line{\hfil \hbox{
  191. \vbox to 3.02truein{
  192. \vfil
  193. \hrule\kern 2truept\hrule\kern 3.5truept
  194. \vbox to 1.4truein{
  195. \vfil
  196. \hbox to 4truein{\hfil{\chapbf\thistitle}\hfil}
  197. \hbox to 4truein{\hfil{\btwelve\Xtitlecomment}\hfil}
  198. \vfil
  199. \hbox to 4truein{\hfil{\tenrm\Xlmipart}}}
  200. \kern 3.5truept\hrule\kern 2truept\hrule}}}
  201. \par\vfill \LMIpub \supereject
  202. }} % end \def
  203. % @copyrightpage smushes things toward the bottom
  204. \def\copyrightpage{\begingroup\inENV
  205. \def\Ecopyrightpage{\par\kern14pt\hrule%
  206. \kern14pt\line{\LMIcopyright\hfil}\egroup\endgroup\supereject\HEADINGSon}%
  207. \vbox to\vsize \bgroup \vfill}
  208. % @group ... @end group forces ... to be all on one page.
  209. \def\group{\begingroup% \inENV ???
  210. \def \Egroup{\egroup\endgroup}
  211. \vbox\bgroup}
  212. % @br forces paragraph break
  213. \let\br = \par
  214. % @page forces the start of a new page
  215. \def\page{\par\vfill\supereject}
  216. % @exdent n text....
  217. % outputs text on separate line in roman font, starting at standard page margin
  218. % The argument n is ignored. This is most likely to be right
  219. % for the ways @exdent actually appears in Bolio files.
  220. \def\exdent{\errmessage{@exdent in filled text}}
  221. % @lisp, etc, define \exdent locally from \internalexdent
  222. {\obeyspaces
  223. \gdef\internalexdent #1 {\parsearg\exdentzzz}}
  224. \def\exdentzzz #1{{\advance \leftskip by -\lispnarrowing
  225. \advance \hsize by -\leftskip
  226. \advance \hsize by -\rightskip
  227. \leftline{{\rm#1}}}}
  228. % @include file insert text of that file as input.
  229. \def\include{\parsearg\includexxx}
  230. \def\includexxx #1{{\def\thisfile{#1}\input #1
  231. }}
  232. \def\thisfile{}
  233. % @need space-in-mils
  234. % forces a page break if there is not space-in-mils remaining.
  235. \newdimen\mil \mil=0.001in
  236. \def\need{\parsearg\needx}
  237. \def\needx #1{\par %
  238. \begingroup %
  239. \dimen0=\pagetotal %
  240. \advance \dimen0 by #1\mil %
  241. \ifdim \dimen0>\pagegoal \vfill\eject \fi %
  242. \endgroup}
  243. % @setpageheight and @setpagewidth
  244. % These are no longer really necessary
  245. % since you can now do @hsize = or @vsize =
  246. \def\setpagewidth #1 {\global\hsize #1}
  247. \def\setpageheight #1 {\global\vsize #1}
  248. % @center line outputs that line, centered
  249. \def\center{\parsearg\centerxxx}
  250. \def\centerxxx #1{{\advance\hsize by -\leftskip
  251. \advance\hsize by -\rightskip
  252. \centerline{#1}}}
  253. % @sp n outputs n lines of vertical space
  254. \def\sp{\parsearg\spacexxx}
  255. \def\spacexxx #1{\par \vskip #1\baselineskip}
  256. % @comment ...line which is ignored...
  257. % @c is the same as @comment
  258. % @ignore ... @end ignore is another way to write a comment
  259. \def\comment{\parsearg \commentxxx}
  260. \def\commentxxx #1{}
  261. \let\c=\comment
  262. \long\def\ignore #1\end ignore{}
  263. % Document-version conditionals
  264. \message{conditionals,}
  265. % @setflag foo sets flag "foo"
  266. % @clearflag foo clears flag "foo"
  267. % @defaultsetflag foo sets flag if never been explicitly set or cleared
  268. % @ifset [foo]...@end if includes body if foo is set
  269. % @ifclear [foo]...@end if includes body if foo is not set.
  270. % A flag is initially clear by default.
  271. % A flag is represented by the value of a control sequence
  272. % whose name is F followed by the flag name.
  273. % If its definition is \relax, it has never been explicitly set or cleared.
  274. % This counts as "clear" for everything except @defaultsetflag.
  275. % It is the initial state.
  276. % Flags explicitly set or cleared have these definitions:
  277. \def\flagtrue{true}
  278. \def\flagfalse{false}
  279. \def\setflag{\parsearg\setflagxxx}
  280. \def\setflagxxx #1{\expandafter\let\csname F#1\endcsname=\flagtrue}
  281. \def\clearflag{\parsearg\clearflagxxx}
  282. \def\clearflagxxx #1{\expandafter\let\csname F#1\endcsname=\flagfalse}
  283. \def\defaultsetflag{\parsearg\defaultsetflagxxx}
  284. \def\defaultsetflagxxx #1{%
  285. \expandafter\ifx\csname F#1\endcsname\relax
  286. \expandafter\let\csname F#1\endcsname=\flagtrue
  287. \fi}
  288. \def\ifset{\parsearg\ifsetxxx}
  289. \def\ifsetxxx #1{%
  290. \expandafter\ifx\csname F#1\endcsname\flagtrue \let\next=\relax \else
  291. \let\next=\iffails \fi \next}
  292. \def\ifnotset{\parsearg\ifnotsetxxx}
  293. \def\ifclear{\parsearg\ifnotsetxxx}
  294. \def\ifnotsetxxx #1{%
  295. \expandafter\ifx\csname F#1\endcsname\flagtrue \let\next=\iffails \else
  296. \let\next=\relax \fi \next}
  297. \def\iffails #1\end if{}
  298. \def\Eif{}
  299. \message{fonts,}
  300. % Font-change commands.
  301. \font\btwelve=ambx10 at 12pt
  302. %% Try out Computer Modern fonts at a little bigger than \magstephalf
  303. \font\tenrm=cmr10 scaled 1100
  304. \font\tentt=amtt10 scaled \magstephalf
  305. \font\tenbf=cmb10 scaled 1100
  306. \font\tenit=cmti10 scaled 1100
  307. \font\tensl=cms10 scaled 1100
  308. % \font\tensf=cmss10 scaled 1100
  309. \font\tensf=amss10 scaled 1100
  310. \def\li{\sf}
  311. \font\tensc=amcsc10 scaled \magstephalf
  312. \font\defbf=ambx7 scaled \magstep2
  313. \let\deftt=\tentt
  314. \font\twelvesf=cmss12
  315. % Font for title
  316. \font\titlerm = cmb10 scaled 2800
  317. % Fonts for indices
  318. \font\indit=cmi9 \font\indrm=cmr9
  319. \def\indbf{\indrm} \def\indsl{\indit}
  320. \def\indexfonts{\let\it=\indit \let\sl=\indsl \let\bf=\indbf \let\rm=\indrm}
  321. \font\secrm=cmb10 scaled 1400
  322. \font\secit=cmti10 scaled 1400
  323. \font\secsl=cms10 scaled 1400
  324. \let\secbf=\secrm
  325. \font\chaprm=cmb10 scaled 1800
  326. \font\chapit=cmti10 scaled 1800
  327. \let\chapbf=\chaprm
  328. \font\ssecrm=cmb10 scaled 1200
  329. \font\ssecit=cmti10 scaled 1200
  330. \font\ssecsl=cms10 scaled 1200
  331. \let\ssecbf=\ssecrm
  332. \def\textfonts{\let\rm=\tenrm\let\it=\tenit\let\sl=\tensl\let\bf=\tenbf%
  333. \let\sc=\tensc\let\sf=\tensf}
  334. \def\chapfonts{\let\rm=\chaprm\let\it=\chapit\let\sl=\chapsl\let\bf=\chapbf}
  335. \def\secfonts{\let\rm=\secrm\let\it=\secit\let\sl=\secsl\let\bf=\secbf}
  336. \def\subsecfonts{\let\rm=\ssecrm\let\it=\ssecit\let\sl=\ssecsl\let\bf=\ssecbf}
  337. % Count depth in font-changes, for error checks
  338. \newcount\fontdepth \fontdepth=0
  339. \def\fontspec #1{\endgroup
  340. \if #1$\epsilon$\else \if #1*\fontpop \global\advance\fontdepth by -1 \else
  341. \global\advance\fontdepth by 1 %
  342. \begingroup\let\fontpop=\endgroup\fontselect#1\fi\fi}
  343. %% This is zero-based; things actually start out in 0 (=rm by default) now.
  344. %% Font 9 is always \titlerm for hysterical reasons
  345. \def\nofont{\errmessage{No such font. Type Return to continue.}}
  346. \def\fontvector#1#2#3#4#5#6#7#8#9{
  347. \def\FMzero{#1} \def\FMone{#2} \def\FMtwo{#3} \def\FMthree{#4} \def\FMfour{#5}
  348. \def\FMfive{#6} \def\FMsix{#7} \def\FMseven{#8} \def\FMeight{#9}}
  349. \fontvector \rm \bf \sl \li \chaprm \chaprm \nofont \tt \nofont
  350. %% Ever hear of AREF ? Actually, \ifcase seems to lose here
  351. \def\fontselect#1{\if #10\FMzero\else\if #11\FMone\else\if#12\FMtwo\else%
  352. \if #13\FMthree\else\if #14\FMfour\else\if #15\FMfive\else\if #16\FMsix\else%
  353. \if #17\FMseven\else\if #18\FMeight\else\if #19\titlerm
  354. \else\errmessage{Illegal font selector (#1)}\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
  355. \def\fontpop{\errmessage{extra ^F*}}
  356. \def\levelcheck{\ifnum \fontdepth > 0 %
  357. \errmessage{Unmatched font-changes before this point}\fi\ENVcheck}
  358. \catcode`\^^F=\active
  359. \def\ctlf{\begingroup\catcode`\^^F=\other\fontspec}
  360. \let^^F=\ctlf
  361. %% Add scribe-like font environments, plus @l for inline lisp (usually sans
  362. %% serif) and @ii for TeX italic
  363. \let\ptexb=\b \let\ptexc=\c \let\ptexi=\i \let\ptext=\t
  364. \let\ptexl=\l \let\ptexL=\L
  365. \def\I{\parsearg\iF} \let\i=\I \def\iF#1{{\sl #1}}
  366. \def\R{\parsearg\rF} \let\r=\R \def\rF#1{{\rm #1}}
  367. \def\B{\parsearg\bF} \let\b=\B \def\bF#1{{\bf #1}}
  368. \def\L{\parsearg\lF} \let\l=\L \def\lF#1{{\li #1}}
  369. \def\s{\parsearg\sF} \def\sF#1{{\sc #1}}
  370. \def\T{\parsearg\tF} \let\t=\T \def\tF#1{{\tt #1}}
  371. \def\II{\parsearg\iiF} \let\ii=\II \def\iiF#1{{\it #1}}
  372. % ^Q quote next character
  373. \catcode`\^^Q=\active
  374. \def\ctlq{\begingroup
  375. \catcode `\@=\other
  376. \afterassignment\quotechar\let\nextchar= }
  377. \let^^Q=\ctlq
  378. \def\quotechar{%
  379. \ifx \nextchar\ref $\otimes$\else
  380. \ifx \nextchar\ctlq $\supset$\else
  381. \ifx \nextchar\ctlf $\epsilon$\else
  382. \if \nextchar-$-$\else
  383. \if \nextchar\space\penalty 10000\ \else
  384. \if \nextchar,\penalty 10000\ \else
  385. \nextchar\spacefactor=1000
  386. \fi\fi\fi\fi\fi\fi
  387. \endgroup}
  388. \def\tie{\penalty 10000\ } % Save plain tex definition of ~.
  389. % Define the random MIT characters
  390. \catcode `\^^@=\active \def^^@{$\cdot$}
  391. \catcode `\=\active \def{$\downarrow$}
  392. \catcode `\=\active \def{$\alpha$}
  393. \catcode `\^^C=\active \def^^C{$\beta$}
  394. \catcode `\^^D=\active \def^^D{$\wedge$}
  395. \catcode `\^^E=\active \def^^E{$\neg$}
  396. \catcode `\^^G=\active \def^^G{$\pi$}
  397. \catcode `\^^H=\active \def^^H{$\lambda$}
  398. \catcode `\ =\active \def {$\uparrow$}
  399. \catcode `\^^L=\active \def^^L{$\plusminus$}
  400. \catcode `\=\active \def{$\infty$}
  401. \catcode `\=\active \def{$\partial$}
  402. \catcode `\=\active \def{$\subset$}
  403. \catcode `\=\active \def{$\cap$}
  404. \catcode `\=\active \def{$\cup$}
  405. \catcode `\=\active \def{$\forall$}
  406. \catcode `\=\active \def{$\exists$}
  407. \catcode `\=\active \def{$\rightleftharpoons$}
  408. \catcode `\=\active \def{$\leftarrow$}
  409. \catcode `\=\active \def{$\rightarrow$}
  410. \catcode `\=\active \def{$\neq$}
  411. \catcode `\^^[=\active \def^^[{$\diamondsuit$}
  412. \catcode `\^^\=\active \def^^\{$\leq$}
  413. \catcode `\^^]=\active \def^^]{$\geq$}
  414. \catcode `\^^^=\active \def^^^{$\equiv$}
  415. \catcode `\^^_=\active \def^^_{$\vee$}
  416. % Font for variables
  417. \let\vf=\sl
  418. % Font(s) for functions being defined
  419. \let\defsf=\twelvesf
  420. \def\df{\let\tt=\deftt \dffont}
  421. \def\DEFbf{\global\let\dffont=\defbf}
  422. \def\DEFsf{\global\let\dffont=\defsf}
  423. \DEFbf
  424. \message{page headings,}
  425. %%% Set up page headings and footings.
  426. \let\thispage=\folio
  427. \newtoks \evenheadline % Token sequence for heading line of even pages
  428. \newtoks \oddheadline % Token sequence for heading line of odd pages
  429. \newtoks \evenfootline % Token sequence for footing line of even pages
  430. \newtoks \oddfootline % Token sequence for footing line of odd pages
  431. % Now make Tex use those variables
  432. \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline \else \the\evenheadline \fi}}
  433. \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline \else \the\evenfootline \fi}}
  434. % Commands to set those variables.
  435. % For example, this is what @headings on does
  436. % @evenheading @thistitle|@thispage|@thischapter
  437. % @oddheading @thischapter|@thispage|@thistitle
  438. % @evenfooting @thisfile||
  439. % @oddfooting ||@thisfile
  440. \def\evenheading{\parsearg\evenheadingxxx}
  441. \def\oddheading{\parsearg\oddheadingxxx}
  442. \def\everyheading{\parsearg\everyheadingxxx}
  443. \def\evenfooting{\parsearg\evenfootingxxx}
  444. \def\oddfooting{\parsearg\oddfootingxxx}
  445. \def\everyfooting{\parsearg\everyfootingxxx}
  446. \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
  447. \def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
  448. \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  449. \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
  450. \def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
  451. \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  452. \def\everyheadingxxx #1{\everyheadingyyy #1\|\|\|\|\finish}
  453. \def\everyheadingyyy #1\|#2\|#3\|#4\finish{%
  454. \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
  455. \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  456. \def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}
  457. \def\evenfootingyyy #1\|#2\|#3\|#4\finish{%
  458. \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  459. \def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}
  460. \def\oddfootingyyy #1\|#2\|#3\|#4\finish{%
  461. \global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  462. \def\everyfootingxxx #1{\everyfootingyyy #1\|\|\|\|\finish}
  463. \def\everyfootingyyy #1\|#2\|#3\|#4\finish{%
  464. \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
  465. \global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  466. % @headings on turns them on.
  467. % @headings off turns them off.
  468. % By default, they are off.
  469. \def\headings #1 {\csname HEADINGS#1\endcsname}
  470. \def\HEADINGSoff{
  471. \global\evenheadline={\hfil} \global\evenfootline={\hfil}
  472. \global\oddheadline={\hfil} \global\oddfootline={\hfil}}
  473. \HEADINGSoff
  474. % When we turn headings on, set the page number to 1,
  475. % Put current file name in lower left corner,
  476. % Put chapter name in upper right corner, document title in upper left,
  477. % and page number in the center.
  478. \def\HEADINGSon{
  479. \global\pageno=1
  480. \global\evenfootline={\thisfile\hfil}
  481. \global\oddfootline={\thisfile\hfil}
  482. \global\evenheadline={\rlap{\centerline{\folio}}\line{\thistitle\hfil\thischapter}}
  483. \global\oddheadline={\rlap{\centerline{\folio}}\line{\thistitle\hfil\thischapter}}
  484. }
  485. % Subroutines used in generating headings
  486. \def\today{\ifcase\month\or
  487. January\or February\or March\or April\or May\or June\or
  488. July\or August\or September\or October\or November\or December\fi
  489. \space\number\day, \number\year}
  490. % @settitle line... specifies the title of the document, for headings
  491. % It generates no output of its own
  492. \def\thistitle{No Title}
  493. \def\settitle{\parsearg\settitlezz}
  494. \def\settitlezz #1{\gdef\thistitle{#1}}
  495. \message{tables,}
  496. % Tables -- @table, @ftable, @item(x), @kitem(x), @xitem(x).
  497. % default indentation of table text
  498. \newdimen\tableindent \tableindent=.8in
  499. % default indentation of @itemize and @enumerate text
  500. \newdimen\itemindent \itemindent=.8in
  501. % margin between end of table item and start of table text.
  502. \newdimen\itemmargin \itemmargin=.1in
  503. % used internally for \itemindent minus \itemmargin
  504. \newdimen\itemmax
  505. % Note @table and @ftable define @item, @itemx, etc., with these defs.
  506. % They also define \itemindex
  507. % to index the item name in whatever manner is desired (perhaps none).
  508. \def\internalBitem{\smallbreak \parsearg\itemzzz}
  509. \def\internalBitemx{\par \parsearg\itemzzz}
  510. \def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
  511. \def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \par \parsearg\xitemzzz}
  512. \def\internalBkitem{\smallbreak \parsearg\kitemzzz}
  513. \def\internalBkitemx{\par \parsearg\kitemzzz}
  514. \def\kitemzzz #1{\dosubind {kw}{#1}{for {\bf \lastfunction}}\itemzzz {#1}}
  515. \def\xitemzzz #1{\dosubind {kw}{#1}{for {\bf \xitemsubtopic}}\itemzzz {#1}}
  516. \def\itemzzz #1{\begingroup %
  517. \advance \hsize by -\rightskip %
  518. \advance \hsize by -\leftskip %
  519. \setbox0=\hbox{{\itemfont #1}}%
  520. \itemindex{#1}%
  521. \parskip=0in %
  522. \noindent\vadjust{\penalty 800}%
  523. \ifdim \wd0>\itemmax %
  524. \hbox to \hsize{\hskip -\tableindent\box0\hss}\ %
  525. \else %
  526. \hbox to 0pt{\hskip -\tableindent\box0\hss}%
  527. \fi %
  528. \endgroup %
  529. }
  530. \def\item{\errmessage{@item while not in a table}}
  531. \def\itemx{\errmessage{@itemx while not in a table}}
  532. \def\kitem{\errmessage{@kitem while not in a table}}
  533. \def\kitemx{\errmessage{@kitemx while not in a table}}
  534. \def\xitem{\errmessage{@xitem while not in a table}}
  535. \def\xitemx{\errmessage{@xitemx while not in a table}}
  536. %% Contains a kludge to get @end[description] to work
  537. \def\description{\tablez{\dontindex}{1}{}{}{}{}}
  538. \def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
  539. {\obeylines\obeyspaces%
  540. \gdef\tablex #1^^M{%
  541. \tabley\dontindex#1 \endtabley}}
  542. \def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
  543. {\obeylines\obeyspaces%
  544. \gdef\ftablex #1^^M{%
  545. \tabley\fnitemindex#1 \endtabley}}
  546. \def\dontindex #1{}
  547. \def\fnitemindex #1{\doind {fn}{#1}}%
  548. {\obeyspaces %
  549. \gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
  550. \tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
  551. \def\tablez #1#2#3#4#5#6{%
  552. \aboveenvbreak %
  553. \begingroup %
  554. \def\Edescription{\Etable}% Neccessary kludge.
  555. \let\itemindex=#1%
  556. \ifnum 0#3>0 \advance \leftskip by #3\mil \fi %
  557. \ifnum 0#4>0 \tableindent=#4\mil \fi %
  558. \ifnum 0#5>0 \advance \rightskip by #5\mil \fi %
  559. \let\itemfont=\bf %
  560. \edef\itemfont{\fontselect{#2}}
  561. \itemmax=\tableindent %
  562. \advance \itemmax by -\itemmargin %
  563. \advance \leftskip by \tableindent %
  564. \parindent = 0pt
  565. \parskip = \smallskipamount
  566. \ifdim \parskip=0pt \parskip=2pt \fi%
  567. \def\Etable{\par\endgroup\afterenvbreak}%
  568. \let\item = \internalBitem %
  569. \let\itemx = \internalBitemx %
  570. \let\kitem = \internalBkitem %
  571. \let\kitemx = \internalBkitemx %
  572. \let\xitem = \internalBxitem %
  573. \let\xitemx = \internalBxitemx %
  574. }
  575. % This is the counter used by @enumerate, which is really @itemize
  576. \newcount \itemno
  577. \def\itemize{\parsearg\itemizezzz}
  578. \def\itemizezzz #1{\itemizey {#1}{\Eitemize}}
  579. \def\itemizey #1#2{%
  580. \aboveenvbreak %
  581. \begingroup %
  582. \itemno = 0 %
  583. \itemmax=\itemindent %
  584. \advance \itemmax by -\itemmargin %
  585. \advance \leftskip by \itemindent %
  586. \parindent = 0pt
  587. \parskip = \smallskipamount
  588. \ifdim \parskip=0pt \parskip=2pt \fi%
  589. \def#2{\par\endgroup\afterenvbreak}%
  590. \def\itemcontents{#1}%
  591. \let\item=\itemizeitem
  592. }
  593. \let\ptexbullet=\bullet
  594. \def\bullet{$\ptexbullet$}
  595. \def\enumerate{\itemizey{\the\itemno.}\Eenumerate}
  596. % Definition of @item while inside @itemize.
  597. \def\itemizeitem{%
  598. \advance\itemno by 1
  599. \par
  600. \smallbreak
  601. \ifhmode \errmessage{\in hmode at itemizeitem}\fi
  602. {\parskip=0in \hskip 0pt
  603. \hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
  604. \vadjust{\penalty 300}%
  605. }}
  606. \message{figures,} % Floating insertions, basically
  607. \newcount\figno \figno=0
  608. \def\basicaption{\parsearg\captionx}
  609. \def\captionx #1{\global\advance\figno by 1%
  610. \par{\textfonts\line{\hfil{\bf Figure \the\figno .} #1\hfil}}}
  611. \def\filcaption{\vfil\basicaption}
  612. \def\iEfigure{\smallskip\hrule\endinsert}
  613. \def\fullpagefigure{%
  614. \pageinsert\inENV\let\caption=\filcaption\let\Efullpagefigure=\iEfigure\hrule\smallskip}
  615. \def\figure{% This tries to be near where the command was
  616. \midinsert\inENV\let\caption=\basicaption\let\Efigure=\iEfigure\hrule\smallskip}
  617. \def\topfigure{% This tries to be near the top of a page
  618. \topinsert\inENV\let\caption=\basicaption\let\Etopfigure=\iEfigure\hrule\smallskip}
  619. \message{footnotes,}% Footnotes
  620. \newcount \footnoteno
  621. \def\supereject{\par\penalty -20000\footnoteno =0 }
  622. \let\ptexfootnote=\footnote
  623. {\catcode `\@=11
  624. \gdef\footnote{\global\advance \footnoteno by \@ne
  625. \edef\thisfootno{$^{\the\footnoteno}$}%
  626. \let\@sf\empty
  627. \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
  628. \thisfootno\@sf\parsearg\footnotezzz}
  629. \gdef\footnotezzz #1{\insert\footins{
  630. \interlinepenalty\interfootnotelinepenalty
  631. \splittopskip\ht\strutbox % top baseline for broken footnotes
  632. \splitmaxdepth\dp\strutbox \floatingpenalty\@MM
  633. \leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip
  634. \footstrut\hang\textindent{\thisfootno}#1\strut}}
  635. } %end \catcode `\@=11
  636. \message{indexing,}
  637. % Index generation facilities
  638. % Define \newwrite to be identical to plain tex's \newwrite
  639. % except not \outer, so it can be used within \newindex.
  640. {\catcode`\@=11
  641. \gdef\newwrite{\alloc@7\write\chardef\sixt@@n}}
  642. % \newindex {foo} defines an index named foo.
  643. % It automatically defines \fooindex such that
  644. % \fooindex ...rest of line... puts an entry in the index foo.
  645. % It also defines \fooindfile to be the number of the output channel for
  646. % the file that accumulates this index. The file's extension is foo.
  647. % The name of an index should be no more than 2 characters long
  648. % for the sake of vms.
  649. % @defindex foo is the form you write in a bolio file.
  650. \def\defindex {\parsearg\newindex}
  651. \def\newindex #1{
  652. \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
  653. \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
  654. \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
  655. \noexpand\doindex {#1}}
  656. }
  657. % @synindex foo bar makes index foo feed into index bar.
  658. % Do this instead of @defindex foo if you don't want it as a separate index.
  659. \def\synindex #1 #2 {%
  660. \expandafter \xdef \csname#1index\endcsname {\noexpand\csname#2index\endcsname}%
  661. \expandafter \chardef \csname#1indfile\endcsname %
  662. = \csname#2indfile\endcsname}
  663. % Define \doindex, the driver for all \fooindex macros.
  664. % Argument #1 is generated by the calling \fooindex macro,
  665. % and it is "foo", the name of the index.
  666. % \doindex just uses \parsearg; it calls \doind for the actual work.
  667. % This is because \doind is more useful to call from other macros.
  668. % There is also \dosubind {index}{topic}{subtopic}
  669. % which makes an entry in a two-level index such as the operation index.
  670. \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
  671. \def\singleindexer #1{\doind{\indexname}{#1}}
  672. \def\indexdummies{%
  673. \def\bf{\realbackslash bf }
  674. \def\rm{\realbackslash rm }
  675. \def\sl{\realbackslash sl texindex.}
  676. }
  677. % To define \realbackslash, we must make \ not be an escape.
  678. % We must first make another character (@) an escape
  679. % so we do not become unable to do a definition.
  680. {\catcode`\@=0 \catcode`\\=\other
  681. @gdef@realbackslash{\}}
  682. \def\doind #1#2{%
  683. {\indexdummies % Must do this here, since \bf, etc expand at this stage
  684. \let\folio=0 \edef\temp{ % Expand all macros now EXCEPT \folio
  685. \write \csname#1indfile\endcsname{%
  686. \realbackslash entry {#2}{\folio}{#2}}}%
  687. \temp}}
  688. \def\dosubind #1#2#3{%
  689. {\indexdummies % Must do this here, since \bf, etc expand at this stage
  690. \let\folio=0 \edef\temp{ %
  691. \write \csname#1indfile\endcsname{%
  692. \realbackslash entry {#2 #3}{\folio}{#2}{#3}}}%
  693. \temp}}
  694. % The index entry written in the file actually looks like
  695. % \entry {sortstring}{page}{topic}
  696. % or
  697. % \entry {sortstring}{page}{topic}{subtopic}
  698. % The texindex program reads in these files and writes files
  699. % containing these kinds of lines:
  700. % \initial {c}
  701. % before the first topic whose initial is c
  702. % \entry {topic}{pagelist}
  703. % for a topic that is used without subtopics
  704. % \primary {topic}
  705. % for the beginning of a topic that is used with subtopics
  706. % \secondary {subtopic}{pagelist}
  707. % for each subtopic.
  708. % Define the user-accessible indexing commands
  709. % @findex, @vindex, @kindex, @cindex.
  710. \def\findex {\fnindex}
  711. \def\kindex {\kwindex}
  712. \def\cindex {\cpindex}
  713. \def\vindex {\vrindex}
  714. \def\cindexsub {\begingroup\obeylines\cindexsub}
  715. {\obeylines %
  716. \gdef\cindexsub "#1" #2^^M{\endgroup %
  717. \dosubind{cp}{#2}{#1}}}
  718. % Define the macros used in formatting output of the sorted index material.
  719. % This is what you call to cause a particular index to get printed.
  720. % Write
  721. % @unnumbered Function Index
  722. % @printindex fn
  723. \def\printindex{\parsearg\doprintindex}
  724. \def\doprintindex#1{\tex %
  725. \catcode`\%=\other\catcode`\&=\other\catcode`\#=\other
  726. \catcode`\@=\other\catcode`\$=\other\catcode`\_=\other
  727. \catcode`\~=\other
  728. \indexfonts\rm \tolerance=9500 \advance\baselineskip -1pt
  729. \begindoublecolumns
  730. \openin 1 \jobname.#1s
  731. \ifeof 1 \else \closein 1 \input \jobname.#1s
  732. \fi
  733. \enddoublecolumns
  734. \Etex}
  735. % These macros are used by the sorted index file itself.
  736. % Change them to control the appearance of the index.
  737. \outer\def\initial #1{\bigbreak\line{\secbf#1\hfill}\kern 2pt\penalty3000}
  738. \outer\def\entry #1#2{
  739. {\parfillskip=0in \parskip=0in \parindent=0in
  740. \hangindent=1in \hangafter=1%
  741. \noindent\hbox{#1}\leaders\Dotsbox\hskip 0pt plus 1filll #2\par
  742. }}
  743. \def\primary #1{\line{#1\hfil}}
  744. \newskip\secondaryindent \secondaryindent=0.5cm
  745. \def\secondary #1#2{
  746. {\parfillskip=0in \parskip=0in
  747. \hangindent =1in \hangafter=1
  748. \noindent\hskip\secondaryindent\hbox{#1}\leaders\Dotsbox\hskip 0pt plus 1filll#2\par
  749. }}
  750. %% Define two-column mode, which is used in indexes.
  751. %% Adapted from the TeXBook, page 416
  752. \catcode `\@=11
  753. \newbox\partialpage
  754. \def\begindoublecolumns{\begingroup
  755. \output={\global\setbox\partialpage=\vbox{\unvbox255\kern -\topskip \kern \baselineskip}}\eject
  756. \output={\doublecolumnout} \hsize=3.11in \vsize=19.1in}
  757. \def\enddoublecolumns{\output={\balancecolumns}\eject
  758. \endgroup \pagegoal=\vsize}
  759. \def\doublecolumnout{\splittopskip=\topskip \splitmaxdepth=\maxdepth
  760. \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage
  761. \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
  762. \onepageout\pagesofar \unvbox255 \penalty\outputpenalty}
  763. \def\pagesofar{\unvbox\partialpage %
  764. \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}}
  765. \def\balancecolumns{\setbox0=\vbox{\unvbox255} \dimen@=\ht0
  766. \advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip
  767. \divide\dimen@ by2 \splittopskip=\topskip
  768. {\vbadness=10000 \loop \global\setbox3=\copy0
  769. \global\setbox1=\vsplit3 to\dimen@
  770. \ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt \repeat}
  771. \setbox0=\vbox to\dimen@{\unvbox1} \setbox2=\vbox to\dimen@{\unvbox3}
  772. \pagesofar}
  773. \catcode `\@=\other
  774. \message{sectioning,}
  775. % Define chapters, sections, etc.
  776. \outer\def\chapter{\parsearg\chapx}
  777. \outer\def\unnumbered{\parsearg\chapxn}
  778. \outer\def\appendix{\parsearg\chapapx}
  779. \outer\def\section{\parsearg\secx}
  780. \outer\def\appendixsection{\parsearg\apsecx}
  781. \outer\def\unnumberedsec{\parsearg\secxn}
  782. \outer\def\subsection{\parsearg\subsecx}
  783. \outer\def\subsubsection{\parsearg\subsubsecx}
  784. \newcount \chapno
  785. \newcount \secno
  786. \newcount \subsecno
  787. \newcount \subsubsecno
  788. % This counter is funny since it counts through charcodes of letters A, B, ...
  789. \newcount \appendixno \appendixno = `\@
  790. \def\appendixletter{\char\the\appendixno}
  791. \newwrite \contentsfile
  792. \openout \contentsfile = \jobname.toc
  793. % Each @chapter defines this as the name of the chapter.
  794. % page headings and footings can use it. @section does likewise
  795. \def\thischapter{} \def\thissection{}
  796. \def\seccheck#1{\levelcheck \if \pageno<0 %
  797. \errmessage{@#1 not allowed after generating table of contents}\fi
  798. %
  799. }
  800. \def\chapx #1{\seccheck{chapter}%
  801. \secno=0 \subsecno=0 \subsubsecno=0 \global\advance \chapno by 1 \message{Chapter \the\chapno}%
  802. \chapmacro {#1}{\the\chapno}%
  803. \gdef\thissection{#1}\gdef\thischapter{#1}%
  804. \edef\temp{{\realbackslash chapentry {#1}{\the\chapno}{\noexpand\folio}}}%
  805. \write \contentsfile \temp %
  806. }
  807. \def\chapapx #1{\seccheck{appendix}%
  808. \secno=0 \subsecno=0 \subsubsecno=0 \global\advance \appendixno by 1 \message{Appendix \appendixletter}%
  809. \chapmacro {#1}{Appendix \appendixletter}%
  810. \gdef\thischapter{#1}\gdef\thissection{#1}%
  811. \edef\temp{{\realbackslash chapentry {#1}{Appendix \appendixletter}{\noexpand\folio}}}%
  812. \write \contentsfile \temp %
  813. }
  814. \def\chapxn #1{\seccheck{unnumbered}%
  815. \secno=0 \subsecno=0 \subsubsecno=0 \message{(#1)}
  816. \unnumbchapmacro {#1}%
  817. \gdef\thischapter{#1}\gdef\thissection{#1}%
  818. \edef\temp{{\realbackslash unnumbchapentry {#1}{\noexpand\folio}}}%
  819. \write \contentsfile \temp %
  820. }
  821. \def\secx #1{\seccheck{section}%
  822. \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
  823. \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
  824. \edef\temp{{\realbackslash secentry %
  825. {#1}{\the\chapno}{\the\secno}{\noexpand\folio}}}%
  826. \write \contentsfile \temp %
  827. }
  828. \def\apsecx #1{\seccheck{appendixsection}%
  829. \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
  830. \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
  831. \edef\temp{{\realbackslash secentry %
  832. {#1}{\appendixletter}{\the\secno}{\noexpand\folio}}}%
  833. \write \contentsfile \temp %
  834. }
  835. \def\secxn #1{\seccheck{unnumberedsec}%
  836. \plainsecheading {#1}\gdef\thissection{#1}%
  837. \edef\temp{{\realbackslash unnumbsecentry %
  838. {#1}{\noexpand\folio}}}%
  839. \write \contentsfile \temp %
  840. }
  841. \def\subsecx #1{\seccheck{subsection}%
  842. \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
  843. \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
  844. \edef\temp{{\realbackslash subsecentry %
  845. {#1}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
  846. \write \contentsfile \temp %
  847. }
  848. \def\subsubsecx #1{\seccheck{subsubsection}%
  849. \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
  850. \subsubsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
  851. \edef\temp{{\realbackslash subsubsecentry %
  852. {#1}{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}%\
  853. \write \contentsfile \temp %
  854. }
  855. % Define @majorheading, @heading and @subheading
  856. \outer\def\majorheading{\parsearg\majorheadingzzz}
  857. \def\majorheadingzzz #1{%
  858. {\advance\chapheadingskip by 10pt \chapbreak }%
  859. {\chapfonts \line{\chaprm #1\hfill}}\bigskip \par\penalty 200}
  860. \outer\def\heading{\parsearg\headingzzz}
  861. \def\headingzzz #1{\chapbreak %
  862. {\chapfonts \line{\chaprm #1\hfill}}\bigskip \par\penalty 200}
  863. \outer\def\subheading{\parsearg\secheadingi}
  864. \outer\def\subsubheading{\parsearg\subsecheadingi}
  865. % These macros generate a chapter, section, etc. heading only
  866. % (including whitespace, linebreaking, etc. around it),
  867. % given all the information in convenient, parsed form.
  868. %%% Args are the skip and penalty (usually negative)
  869. \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1 \fi}
  870. \def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
  871. %%% Define plain chapter starts, and page on/off switching for it
  872. % Parameter controlling skip before chapter headings (if needed)
  873. \newskip \chapheadingskip \chapheadingskip = 30pt plus 8pt minus 4pt
  874. \def\chapbreak{\dobreak \chapheadingskip {-100}}
  875. \def\chappager{\par\vfill\supereject}
  876. \def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi}
  877. \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
  878. \def\CHAPPAGoff{\global\let\pchapsepmacro=\chapbreak}
  879. \def\CHAPPAGon{\global\let\pchapsepmacro=\chappager}
  880. \def\CHAPPAGodd{\global\let\pchapsepmacro=\chapoddpage}
  881. \CHAPPAGon
  882. \def\CHAPFplain{
  883. \global\let\chapmacro=\chfplain
  884. \global\let\unnumbchapmacro=\unnchfplain}
  885. \def\chfplain #1#2{%
  886. \pchapsepmacro %
  887. {\chapfonts \line{\chaprm #2.\enspace #1\hfill}}\bigskip \par\penalty 5000 %
  888. }
  889. \def\unnchfplain #1{%
  890. \pchapsepmacro %
  891. {\chapfonts \line{\chaprm #1\hfill}}\bigskip \par\penalty 10000 %
  892. }
  893. \CHAPFplain % The default
  894. \def\unnchfopen #1{%
  895. \chapoddpage {\chapfonts \line{\chaprm #1\hfill}}\bigskip \par\penalty 10000 %
  896. }
  897. \def\chfopen #1#2{\chapoddpage {\chapfonts
  898. \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
  899. \par\penalty 5000 %
  900. }
  901. \def\CHAPFopen{
  902. \global\let\chapmacro=\chfopen
  903. \global\let\unnumbchapmacro=\unnchfopen}
  904. % Parameter controlling skip before section headings.
  905. \newskip \subsecheadingskip \subsecheadingskip = 17pt plus 4pt minus 4pt
  906. \def\subsecheadingbreak{\dobreak \subsecheadingskip {-30}}
  907. \newskip \secheadingskip \secheadingskip = 21pt plus 6pt minus 4pt
  908. \def\secheadingbreak{\dobreak \secheadingskip {-50}}
  909. \def\secheading #1#2#3{\secheadingi {#2.#3\enspace #1}}
  910. \def\plainsecheading #1{\secheadingi {#1}}
  911. \def\secheadingi #1{{\advance \secheadingskip by \parskip %
  912. \secheadingbreak} %
  913. {\secfonts \line{\secrm #1\hfill}} %
  914. \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 1000}
  915. \def\subsecheading #1#2#3#4{{\advance \subsecheadingskip by \parskip %
  916. \subsecheadingbreak} %
  917. {\subsecfonts \line{\secrm#2.#3.#4\enspace #1\hfill}}
  918. \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 1000}
  919. \def\subsubsecfonts{\subsecfonts} % Maybe this should change
  920. \def\subsubsecheading #1#2#3#4#5{{\advance \subsecheadingskip by \parskip %
  921. \subsecheadingbreak} %
  922. {\subsubsecfonts \line{\secrm#2.#3.#4.#5\enspace #1\hfill}}
  923. \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 1000}
  924. \message{toc printing,}
  925. \def\Dotsbox{\hbox to 1em{\hss.\hss}} % Used by index macros
  926. \def\finishcontents{%
  927. \ifnum\pageno>0 %
  928. \par\vfill\supereject %
  929. \immediate\closeout \contentsfile%
  930. \pageno=-1 % Request roman numbered pages
  931. \fi}
  932. \outer\def\contents{%
  933. \finishcontents %
  934. \unnumbchapmacro{Table of Contents}
  935. \def\thischapter{Table of Contents}
  936. {\catcode`\\=0
  937. \catcode`\{=1 % Set up to handle contents files properly
  938. \catcode`\}=2
  939. \input \jobname.toc
  940. }
  941. \vfill \eject}
  942. \outer\def\summarycontents{%
  943. \finishcontents %
  944. \unnumbchapmacro{Summary Table of Contents}
  945. \def\thischapter{Summary Table of Contents}
  946. {\catcode`\\=0
  947. \catcode`\{=1 % Set up to handle contents files properly
  948. \catcode`\}=2
  949. \def\smallbreak{}
  950. \def\secentry ##1##2##3##4{}
  951. \def\subsecentry ##1##2##3##4##5{}
  952. \def\subsubsecentry ##1##2##3##4##5##6{}
  953. \def\unnumbsecentry ##1##2{}
  954. \let\medbreak=\smallbreak
  955. \input \jobname.toc
  956. }
  957. \vfill \eject}
  958. \outer\def\bye{\par\vfill\supereject\tracingstats=1\ptexend}
  959. % These macros generate individual entries in the table of contents
  960. % The first argument is the chapter or section name.
  961. % The last argument is the page number.
  962. % The arguments in between are the chapter number, section number, ...
  963. \def\chapentry #1#2#3{%
  964. \medbreak
  965. \line{#2.\space#1\leaders\hbox to 1em{\hss.\hss}\hfill #3}
  966. }
  967. \def\unnumbchapentry #1#2{%
  968. \medbreak
  969. \line{#1\leaders\Dotsbox\hfill #2}
  970. }
  971. \def\secentry #1#2#3#4{%
  972. \line{\enspace\enspace#2.#3\space#1\leaders\Dotsbox\hfill#4}
  973. }
  974. \def\unnumbsecentry #1#2{%
  975. \line{\enspace\enspace#1\leaders\Dotsbox\hfill #2}
  976. }
  977. \def\subsecentry #1#2#3#4#5{%
  978. \line{\enspace\enspace\enspace\enspace
  979. #2.#3.#4\space#1\leaders\Dotsbox\hfill #5}
  980. }
  981. \def\subsubsecentry #1#2#3#4#5#6{%
  982. \line{\enspace\enspace\enspace\enspace\enspace\enspace
  983. #2.#3.#4.#5\space#1\leaders\Dotsbox\hfill #6}
  984. }
  985. \message{environments,}
  986. % @tex ... @end tex escapes into raw Tex temporarily.
  987. \def\tex{\begingroup
  988. \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
  989. \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
  990. \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
  991. \let\{=\lbrace \let\}=\rbrace
  992. \let\nobreak=\ptexnobreak
  993. \let\.=\ptexdot
  994. \let\#=\ptexnumsign
  995. \let\*=\ptexstar
  996. \let\+=\tabalign
  997. \let\-=\ptexminus
  998. \let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext \let\l=\ptexl
  999. \let\L=\ptexL
  1000. \catcode `\%=14 \let\Etex=\endgroup}
  1001. % Define @lisp ... @endlisp.
  1002. % @lisp does a \begingroup so it can rebind things,
  1003. % including the definition of @endlisp (which normally is erroneous).
  1004. % Amount to narrow the margins by for @lisp.
  1005. \newskip\lispnarrowing \lispnarrowing=0.3in
  1006. % This is the definition that ^M gets inside @lisp
  1007. {\obeyspaces%
  1008. \gdef\lisppar{ \endgraf}}
  1009. % Cause \obeyspaces to make each Space cause a word-separation
  1010. % rather than the default which is that it acts punctuation.
  1011. % This is because space in tt font looks funny.
  1012. {\obeyspaces %
  1013. \gdef\sepspaces{\def {\ }}}
  1014. \newskip\aboveenvskipamount \aboveenvskipamount=3pt
  1015. \def\aboveenvbreak{{\advance\aboveenvskipamount by \parskip
  1016. \par \ifdim\lastskip<\aboveenvskipamount
  1017. \removelastskip \penalty-50 \vskip\aboveenvskipamount \fi}}
  1018. \def\afterenvbreak{\par \ifdim\lastskip<\aboveenvskipamount
  1019. \removelastskip \penalty-50 \vskip\aboveenvskipamount \fi}
  1020. {\catcode`\@=\active%
  1021. % @ must be active when this definition is made,
  1022. % so that the \let@ can be parsed properly.
  1023. \gdef\lisp{\begingroup\inENV %This group ends at the end of the @lisp body
  1024. \aboveenvbreak \hfuzz=12truept % Don't be fussy
  1025. % Make spaces be word-separators rather than space tokens.
  1026. \sepspaces %
  1027. % Single space lines
  1028. \singlespace %
  1029. % The following causes blank lines not to be ignored
  1030. % by adding a space to the end of each line.
  1031. \let\par=\lisppar
  1032. \catcode`\{=\other \catcode`\}=\other
  1033. \def\Elisp{\endgroup\afterenvbreak}
  1034. \parskip=0pt \advance \rightskip by \lispnarrowing
  1035. \advance \leftskip by \lispnarrowing
  1036. \parindent=0pt
  1037. \let\exdent=\internalexdent
  1038. \obeyspaces \obeylines \tt}}
  1039. \let\example=\lisp
  1040. \def\Eexample{\Elisp}
  1041. % This is @display; same as @lisp except use roman font.
  1042. {\catcode`\@=\active%
  1043. % @ must be active when this definition is made,
  1044. % so that the \let@ can be parsed properly.
  1045. \gdef\display{\begingroup\inENV %This group ends at the end of the @display body
  1046. \aboveenvbreak
  1047. % Make spaces be word-separators rather than space tokens.
  1048. \sepspaces %
  1049. % Single space lines
  1050. \singlespace %
  1051. % The following causes blank lines not to be ignored
  1052. % by adding a space to the end of each line.
  1053. \let\par=\lisppar
  1054. \def\Edisplay{\endgroup\afterenvbreak}
  1055. \parskip=0pt \advance \rightskip by \lispnarrowing
  1056. \advance \leftskip by \lispnarrowing
  1057. \parindent=0pt
  1058. \let\exdent=\internalexdent
  1059. \obeyspaces \obeylines}}
  1060. % This is @format; same as @lisp except use roman font and don't narrow margins
  1061. {\catcode`\@=\active%
  1062. % @ must be active when this definition is made,
  1063. % so that the \let@ can be parsed properly.
  1064. \gdef\format{\begingroup\inENV %This group ends at the end of the @format body
  1065. \aboveenvbreak
  1066. % Make spaces be word-separators rather than space tokens.
  1067. \sepspaces %
  1068. \singlespace %
  1069. % The following causes blank lines not to be ignored
  1070. % by adding a space to the end of each line.
  1071. \let\par=\lisppar
  1072. \def\Eformat{\endgroup\afterenvbreak}
  1073. \parskip=0pt \parindent=0pt
  1074. \obeyspaces \obeylines}}
  1075. % This is @address; same as @format except put left margin in mid page
  1076. {\catcode`\@=\active%
  1077. % @ must be active when this definition is made,
  1078. % so that the \let@ can be parsed properly.
  1079. \gdef\address{\begingroup\inENV %This group ends at the end of the @address body
  1080. \aboveenvbreak
  1081. % Make spaces be word-separators rather than space tokens.
  1082. \sepspaces %
  1083. % The following causes blank lines not to be ignored
  1084. % by adding a space to the end of each line.
  1085. % This also causes @ to work when the directive name
  1086. % is terminated by end of line.
  1087. \let\par=\lisppar
  1088. \def\Eaddress{\endgroup\afterenvbreak}
  1089. \def\Eclosing{\endgroup\afterenvbreak}
  1090. \parskip=0pt \parindent=0pt
  1091. \obeyspaces \obeylines}}
  1092. \let\closing=\address
  1093. % @flushleft and @flushright
  1094. {\catcode`\@=\active%
  1095. % @ must be active when this definition is made,
  1096. % so that the \let@ can be parsed properly.
  1097. \gdef\flushleft{\begingroup\inENV %This group ends at the end of the @format body
  1098. \aboveenvbreak
  1099. % Make spaces be word-separators rather than space tokens.
  1100. \sepspaces %
  1101. % The following causes blank lines not to be ignored
  1102. % by adding a space to the end of each line.
  1103. % This also causes @ to work when the directive name
  1104. % is terminated by end of line.
  1105. \let\par=\lisppar
  1106. \def\Eflushleft{\endgroup\afterenvbreak}
  1107. \parskip=0pt \parindent=0pt
  1108. \obeyspaces \obeylines}}
  1109. {\catcode`\@=\active%
  1110. % @ must be active when this definition is made,
  1111. % so that the \let@ can be parsed properly.
  1112. \gdef\flushright{\begingroup\inENV %This group ends at the end of the @format body
  1113. \aboveenvbreak
  1114. % Make spaces be word-separators rather than space tokens.
  1115. \sepspaces %
  1116. % The following causes blank lines not to be ignored
  1117. % by adding a space to the end of each line.
  1118. % This also causes @ to work when the directive name
  1119. % is terminated by end of line.
  1120. \let\par=\lisppar
  1121. \def\Eflushright{\endgroup\afterenvbreak}
  1122. \parskip=0pt \parindent=0pt
  1123. \advance \leftskip by 0pt plus 1fill
  1124. \obeyspaces \obeylines}}
  1125. % @quotation - narrow the margins.
  1126. \def\quotation{\begingroup\inENV %This group ends at the end of the @quotation body
  1127. \aboveenvbreak
  1128. \singlespace
  1129. \def\Equotation{\par\endgroup\afterenvbreak}
  1130. \advance \rightskip by \lispnarrowing
  1131. \advance \leftskip by \lispnarrowing}
  1132. % @undent - make every paragraph have a hanging indentation
  1133. \def\undent{\begingroup %This group ends at the end of the @undent body
  1134. \def\Eundent{\par\endgroup}
  1135. \everypar={\hangindent=\parindent \hskip-\parindent \hangafter=1 }}
  1136. % @document - nothing now, later it will read in the aux file, close toc files
  1137. \def\document{} \def\Edocument{}
  1138. \message{defuns,}
  1139. % Define formatter for defuns
  1140. % First, allow user to change definition object font (\df) internally
  1141. \def\setdeffont #1 {\csname DEF#1\endcsname}
  1142. \newskip\defbodyindent \defbodyindent=36pt
  1143. \newskip\defargsindent \defargsindent=50pt
  1144. \newskip\deftypemargin \deftypemargin=12pt
  1145. \newskip\deflastargmargin \deflastargmargin=18pt
  1146. \newcount\parencount
  1147. % define \functionparens, which makes ( and ) and & do special things.
  1148. % \functionparens affects the group it is contained in.
  1149. \def\activeparens{%
  1150. \catcode`\(=\active \catcode`\)=\active \catcode`\&=\active
  1151. \catcode`\[=\active \catcode`\]=\active}
  1152. {\activeparens % Now, smart parens don't turn on until &foo (see \amprm)
  1153. \gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 }
  1154. \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
  1155. % Definitions of (, ) and & used in args for functions.
  1156. % This is the definition of ( outside of all parentheses.
  1157. \gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested %
  1158. \global\advance\parencount by 1 }
  1159. %
  1160. % This is the definition of ( when already inside a level of parens.
  1161. \gdef\opnested{\char`\(\global\advance\parencount by 1 }
  1162. %
  1163. \gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
  1164. % also in that case restore the outer-level definition of (.
  1165. \ifnum \parencount=1 {\rm \char `\)}\vf \let(=\oprm \else \char `\) \fi
  1166. \global\advance \parencount by -1 }
  1167. % If we encounter &foo, then turn on ()-hacking afterwards
  1168. \gdef\amprm#1 {{\rm\&#1}\let(=\oprm \let)=\clrm\ }
  1169. %
  1170. \gdef\normalparens{\boldbrax\let&=\ampnr}
  1171. } % End of definition inside \activeparens
  1172. %% These parens (in \boldbrax) actually are a little bolder than the
  1173. %% contained text. This is especially needed for [ and ]
  1174. \def\opnr{{\sf\char`\(}} \def\clnr{{\sf\char`\)}} \def\ampnr{\&}
  1175. \def\lbrb{{\tt\char`\[}} \def\rbrb{{\tt\char`\]}}
  1176. % First, defname, which formats the header line itself.
  1177. % #1 should be the function name.
  1178. % #2 should be the type of definition, such as "Function".
  1179. \def\defname #1#2{%
  1180. \leftskip = 0in %
  1181. \noindent %
  1182. \setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
  1183. \dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line
  1184. \dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations
  1185. \parshape 2 0in \dimen0 \defargsindent \dimen1 %
  1186. % Now output arg 2 ("Function" or some such)
  1187. % ending at \deftypemargin from the right margin,
  1188. % but stuck inside a box of width 0 so it does not interfere with linebreaking
  1189. \rlap{\rightline{{\rm #2}\hskip \deftypemargin}}%
  1190. \tolerance=10000 \hbadness=10000 % Make all lines underfull and no complaints
  1191. {\df #1}\enskip % Generate function name
  1192. }
  1193. % Actually process the body of a definition
  1194. % #1 should be the terminating control sequence, such as \Edefun.
  1195. % #2 should be the "another name" control sequence, such as \defunx.
  1196. % #3 should be the control sequence that actually processes the header,
  1197. % such as \defunheader.
  1198. \def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
  1199. \medbreak %
  1200. % Define the end token that this defining construct specifies
  1201. % so that it will exit this group.
  1202. \def#1{\endgraf\endgroup\medbreak}%
  1203. \def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
  1204. \parindent=0in \leftskip=\defbodyindent %
  1205. \begingroup\obeylines\activeparens\spacesplit#3}
  1206. \def\defmethparsebody #1#2#3#4 {\begingroup\inENV %
  1207. \medbreak %
  1208. % Define the end token that this defining construct specifies
  1209. % so that it will exit this group.
  1210. \def#1{\endgraf\endgroup\medbreak}%
  1211. \def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}%
  1212. \parindent=0in \leftskip=\defbodyindent %
  1213. \begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
  1214. % Split up #2 at the first space token.
  1215. % call #1 with two arguments:
  1216. % the first is all of #2 before the space token,
  1217. % the second is all of #2 after that space token.
  1218. % If #2 contains no space token, all of it is passed as the first arg
  1219. % and the second is passed as empty.
  1220. {\obeylines
  1221. \gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}%
  1222. \long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{%
  1223. \ifx\relax #3%
  1224. #1{#2}{}\else #1{#2}{#3#4}\fi}}
  1225. % So much for the things common to all kinds of definitions.
  1226. % Define \defun.
  1227. % First, define the processing that is wanted for arguments of \defun
  1228. % Use this to expand the args and terminate the paragraph they make up
  1229. \def\defunargs #1{\functionparens \vf #1%
  1230. \ifnum\parencount=0 \else \errmessage{unbalanced parens in @def arguments}\fi%
  1231. \interlinepenalty=10000
  1232. \endgraf\vskip -\parskip \penalty 10000}
  1233. % \lastfunction is always defined to the name in the most recennt @defun
  1234. % It is used by @kitem as the subtopic to index the keyword under
  1235. \def\lastfunction{}
  1236. % Do complete processing of one @defun or @defunx line already parsed.
  1237. \def\defunheader #1#2{\doind {fn}{#1} % Make entry in function index
  1238. \gdef\lastfunction{#1}%
  1239. \dosetq {#1-fun}{page}%
  1240. {\defname {#1}{Function}\defunargs {#2}}%
  1241. }
  1242. \def\defmacheader #1#2{\doind {fn}{#1} % Make entry in function index
  1243. \gdef\lastfunction{#1}%
  1244. \dosetq {#1-fun}{page}%
  1245. \begingroup\defname {#1}{Macro}%
  1246. \defunargs {#2}\endgroup %
  1247. }
  1248. \def\defspecheader #1#2{\doind {fn}{#1} % Make entry in function index
  1249. \gdef\lastfunction{#1}%
  1250. \dosetq {#1-fun}{page}%
  1251. \begingroup\defname {#1}{Special form}%
  1252. \defunargs {#2}\endgroup %
  1253. }
  1254. \def\defmessageheader #1#2{\doind {op}{#1} % Make entry in operation index
  1255. \gdef\lastfunction{#1}%
  1256. \dosetq {#1-message}{page}%
  1257. \begingroup\defname {#1}{Operation}%
  1258. \defunargs {#2}\endgroup %
  1259. }
  1260. % Now we can define @defun itself.
  1261. \def\defun{\defparsebody\Edefun\defunx\defunheader}
  1262. \def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
  1263. \def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
  1264. \def\defmessage{\defparsebody\Edefmessage\defmessagex\defmessageheader}
  1265. % This definition is run if you use @defunx
  1266. % anywhere other than immediately after a @defun or @defunx.
  1267. \def\defunx #1 {\errmessage{@defunx in invalid context}}
  1268. \def\defmacx #1 {\errmessage{@defmacx in invalid context}}
  1269. \def\defspecx #1 {\errmessage{@defspecx in invalid context}}
  1270. \def\defmessagex #1 {\errmessage{@defmessagex in invalid context}}
  1271. % @defmethod, @defmetamethod, and so on
  1272. % Do complete processing of one @defmethod line already parsed.
  1273. \def\defmethodheader #1#2#3{\dosubind {op}{#2}{on {\bf #1}}% Make entry in operation index
  1274. \gdef\lastfunction{#2}%
  1275. \dosetqflushcolon {#1-}#2-method {page}%
  1276. \begingroup\defname {#2}{Operation on {\bf #1}}%
  1277. \defunargs {#3}\endgroup %
  1278. }
  1279. \def\defmetamethodheader #1#2#3{\dosubind {op}{#2}{on #1}% Make entry in operation index
  1280. \gdef\lastfunction{#2}%
  1281. \dosetqflushcolon {#1-}#2-method {page}%
  1282. \begingroup\defname {#2}{Operation on #1}%
  1283. \defunargs {#3}\endgroup %
  1284. }
  1285. \def\defivarheader #1#2#3{%
  1286. \gdef\lastfunction{#2}%
  1287. \dosubind {iv}{#2}{of {\bf #1}}% Make entry in instance variable index
  1288. \dosetq {#1-#2-ivar}{page}%
  1289. \begingroup\defname {#2}{Instance variable of {\bf #1}}%
  1290. \defvarargs {#3}\endgroup %
  1291. }
  1292. \def\defmetaivarheader #1#2#3{%
  1293. \gdef\lastfunction{#2}%
  1294. \dosubind {iv}{#2}{of #1}% Make entry in ivar index
  1295. \dosetq {#1-#2-ivar}{page}%
  1296. \begingroup\defname {#2}{Instance variable of #1}%
  1297. \defvarargs {#3}\endgroup %
  1298. }
  1299. \def\definitheader #1#2#3{%
  1300. \gdef\lastfunction{#2}%
  1301. \dosubind {io}{#2}{for {\bf #1}}% Make entry in init option index
  1302. \dosetqflushcolon {#1-}#2-init-option {page}%
  1303. \begingroup\defname {#2}{Init keyword for {\bf #1}}%
  1304. \defvarargs {#3}\endgroup %
  1305. }
  1306. \def\defmetainitheader #1#2#3{%
  1307. \gdef\lastfunction{#2}%
  1308. \dosubind {io}{#2}{for #1}% Make entry in init option index
  1309. \dosetqflushcolon {#1-}#2-init-option {page}%
  1310. \begingroup\defname {#2}{Init keyword for #1}%
  1311. \defvarargs {#3}\endgroup %
  1312. }
  1313. \def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
  1314. \def\defmetamethod{%
  1315. \defmethparsebody\Edefmetamethod\defmetamethodx\defmetamethodheader}
  1316. \def\defivar{\defmethparsebody\Edefivar\defivarx\defivarheader}
  1317. \def\defmetaivar{%
  1318. \defmethparsebody\Edefmetaivar\defmetaivarx\defmetaivarheader}
  1319. \def\definit{\defmethparsebody\Edefinit\definitx\definitheader}
  1320. \def\defmetainit{%
  1321. \defmethparsebody\Edefmetainit\defmetainitx\defmetainitheader}
  1322. % These definitions are run if you use @defmethodx, etc.,
  1323. % anywhere other than immediately after a @defmethod, etc.
  1324. \def\defmethodx #1 {\errmessage{@defmethodx in invalid context}}
  1325. \def\defmetamethodx #1 {\errmessage{@defmetamethodx in invalid context}}
  1326. \def\defivarx #1 {\errmessage{@defivarx in invalid context}}
  1327. \def\defmetaivarx #1 {\errmessage{@defmetaivarx in invalid context}}
  1328. \def\definitx #1 {\errmessage{@definitx in invalid context}}
  1329. \def\defmetainitx #1 {\errmessage{@defmetainitx in invalid context}}
  1330. % Now @defvar
  1331. % First, define the processing that is wanted for arguments of @defvar.
  1332. % This is actually simple: just print them in roman.
  1333. % This must expand the args and terminate the paragraph they make up
  1334. \def\defvarargs #1{\normalparens #1%
  1335. \interlinepenalty=10000
  1336. \endgraf\vskip -\parskip \penalty 10000}
  1337. % Do complete processing of one @defvar or @defvarx line already parsed.
  1338. \def\defvarheader #1#2{\doind {vr}{#1}% Make entry in var index
  1339. \gdef\lastfunction{#1}%
  1340. \dosetq {#1-var}{page}%
  1341. \begingroup\defname {#1}{Variable}%
  1342. \defvarargs {#2}\endgroup %
  1343. }
  1344. \def\defconstheader #1#2{\doind {vr}{#1}% Make entry in var index
  1345. \gdef\lastfunction{#1}%
  1346. \dosetq {#1-var}{page}%
  1347. \begingroup\defname {#1}{Constant}%
  1348. \defvarargs {#2}\endgroup %
  1349. }
  1350. \def\defmeterheader #1#2{\doind {mt}{#1}% Make entry in meter index
  1351. \gdef\lastfunction{#1}%
  1352. \dosetq {#1-meter}{page}%
  1353. \begingroup\defname {#1}{Meter}%
  1354. \defvarargs {#2}\endgroup %
  1355. }
  1356. \def\defresourceheader #1#2{\doind {rs}{#1}% Make entry in resource index
  1357. \gdef\lastfunction{#1}%
  1358. \dosetq {#1-resource}{page}%
  1359. \begingroup\defname {#1}{Resource}%
  1360. \defvarargs {#2}\endgroup %
  1361. }
  1362. % Now we can define @defvar itself. Also @defconst.
  1363. \def\defvar{\defparsebody\Edefvar\defvarx\defvarheader}
  1364. \def\defconst{\defparsebody\Edefconst\defconstx\defconstheader}
  1365. \def\defmeter{\defparsebody\Edefmeter\defmeterx\defmeterheader}
  1366. \def\defresource{\defparsebody\Edefresource\defresourcex\defresourceheader}
  1367. % This definition is run if you use @defvarx
  1368. % anywhere other than immediately after a @defvar or @defvarx.
  1369. \def\defvarx #1 {\errmessage{@defvarx in invalid context}}
  1370. \def\defconstx #1 {\errmessage{@defconstx in invalid context}}
  1371. \def\defmeterx #1 {\errmessage{@defmeterx in invalid context}}
  1372. \def\defresourcex #1 {\errmessage{@defresourcex in invalid context}}
  1373. % Now define @defflavor
  1374. % Args are printed in bold, a slight difference from @defvar.
  1375. \def\defflavargs #1{\bf \defvarargs{#1}}
  1376. % Do complete processing of one @defflavor (or similar construct) line.
  1377. \def\defflavorheader #1#2{\doind {fl}{#1}% Make entry in flavor index
  1378. \gdef\lastfunction{#1}%
  1379. \dosetq {#1-flavor}{page}%
  1380. \begingroup\defname {#1}{Flavor}%
  1381. \defflavargs {#2}\endgroup %
  1382. }
  1383. \def\defconditionheader #1#2{\doind {cn}{#1}% Make entry in condition index
  1384. \gdef\lastfunction{#1}%
  1385. \dosetq {#1-condition}{page}%
  1386. \begingroup\defname {#1}{Condition}%
  1387. \defflavargs {#2}\endgroup %
  1388. }
  1389. \def\defconditionflavorheader #1#2{%
  1390. \gdef\lastfunction{#1}%
  1391. \doind {cn}{#1}% Make entry in condition index
  1392. \doind {fl}{#1}% Make entry in flavor index
  1393. \dosetq {#1-condition}{page}%
  1394. \dosetq {#1-flavor}{page}%
  1395. \dosetq {#1-condition-flavor}{page}%
  1396. \doind {fl}{#1}% Make entry in flavor index
  1397. \begingroup\defname {#1}{Condition flavor}%
  1398. \defflavargs {#2}\endgroup %
  1399. }
  1400. \def\defflavor{\defparsebody\Edefflavor\defflavorx\defflavorheader}
  1401. \def\defcondition{%
  1402. \defparsebody\Edefcondition\defconditionx\defconditionheader}
  1403. \def\defconditionflavor{%
  1404. \defparsebody\Edefconditionflavor\defconditionflavorx\defconditionflavorheader}
  1405. % This definition is run if you use @defflavorx, etc
  1406. % anywhere other than immediately after a @defflavor, etc.
  1407. \def\defflavorx #1 {\errmessage{@defflavorx in invalid context}}
  1408. \def\defconditionx #1 {\errmessage{@defconditionx in invalid context}}
  1409. \def\defconditionflavorx #1 {\errmessage{@defconditionflavorx in invalid context}}
  1410. \message{cross reference,}
  1411. % Define cross-reference macros
  1412. \newwrite \auxfile
  1413. % Define @setq. @setq foo page defines a string-variable named foo
  1414. % whose value is "page nnn".
  1415. % Also allowed are
  1416. % @setq foo section-page defines as "section c.s.ss, page nnn"
  1417. % @setq foo page-number defines as "nnn"
  1418. % @setq foo chapter-number defines as "c"
  1419. % @setq foo section-number defines as "c.s.ss"
  1420. % @setx foo text defines foo as "text", literally.
  1421. % Turn on \obeylines before parsing the arguments.
  1422. % \setqx does the actual parsing.
  1423. \def\setq{\begingroup\obeylines \setqx}
  1424. \def\setx{\begingroup\obeylines \setxx}
  1425. % Define \setqx, which just puts the arguments into a \write
  1426. % preceded by \internalsetq, which will expand at write time and do all the real work,
  1427. { \obeylines %
  1428. \gdef\setqx #1 #2^^M{%
  1429. \let\folio=0\edef\next{\write\auxfile{\internalsetq {#1}{#2}}}%
  1430. \next\endgroup}
  1431. %
  1432. \gdef\setxx #1 #2^^M{%
  1433. \write\auxfile{'xrdef {#1}{#2}}\endgroup}}
  1434. %% @label for Scribe. setq's x-pg, x-title, x-snam, x for
  1435. %% @pageref, @title, @nameref, @ref
  1436. \def\label{\parsearg\labelx} \def\pageref{\parsearg\pagerefx}
  1437. \def\nameref{\parsearg\namerefx}
  1438. \def\labelx#1{\dosetq{#1-pg}{page-number}\dosetq{#1-title}{title}%
  1439. \dosetq{#1-snam}{section-name}\dosetq{#1}{section-number}}
  1440. \def\pagerefx#1{\refx{#1-pg}} \def\namerefx#1{\refx{#1-snam}}
  1441. \def\titlex#1{\refx{#1-title}}
  1442. % \dosetq is the interface for calls from other macros
  1443. \def\dosetq #1#2{{\let\folio=0%
  1444. \edef\next{\write\auxfile{\internalsetq {#1}{#2}}}%
  1445. \next}}
  1446. % dosetqflushcolon {foo-}:bar {value} defines foo-bar to value,
  1447. % thus flushing the colon from the front of :bar.
  1448. % This is how we define the variables for @defmethod, etc.
  1449. \def\dosetqflushcolon #1:#2 #3{\write\auxfile{\internalsetq {#1#2}{#3}}}
  1450. % \internalsetq {foo}{page} expands into CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
  1451. % When the aux file is read, ' is the escape character
  1452. \def\internalsetq #1#2{'xrdef {#1}{\csname Y#2\endcsname}}
  1453. % We want to do \edef\Xfoo{\Ypage}
  1454. % Define \Ypage to generate "page nnn".
  1455. \def\Ypage{page \folio}
  1456. \def\Ytitle{\ifnum\secno=0 chapter\else section\fi}
  1457. % Define \Ysection-page to generate "section m.n, page n"
  1458. % Define \Ysection-number-and-type to generate "section m.n"
  1459. % Define \Ysection-number to generate just "m.n"
  1460. {\catcode `\-=11
  1461. \gdef\Ysection-page{%
  1462. \ifnum\secno=0 chapter\xreftie\the\chapno, page\xreftie\folio %
  1463. \else \ifnum \subsecno=0 section\xreftie\the\chapno.\the\secno, page\xreftie\folio %
  1464. \else \ifnum \subsubsecno=0 %
  1465. section\xreftie\the\chapno.\the\secno.\the\subsecno, page\xreftie\folio %
  1466. \else %
  1467. section\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno, page\xreftie\folio %
  1468. \fi \fi \fi}
  1469. \gdef\Ysection-number-and-type{%
  1470. \ifnum\secno=0 chapter\xreftie\the\chapno %
  1471. \else \ifnum \subsecno=0 section\xreftie\the\chapno.\the\secno %
  1472. \else \ifnum \subsubsecno=0 %
  1473. section\xreftie\the\chapno.\the\secno.\the\subsecno %
  1474. \else %
  1475. section\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno %
  1476. \fi \fi \fi }
  1477. \gdef\xreftie{'tie}
  1478. \gdef\Ysection-number{%
  1479. \ifnum\secno=0 \the\chapno %
  1480. \else \ifnum \subsecno=0 \the\chapno.\the\secno %
  1481. \else \ifnum \subsubsecno=0 %
  1482. \the\chapno.\the\secno.\the\subsecno %
  1483. \else %
  1484. \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno %
  1485. \fi \fi \fi}}
  1486. % Define \Ychapter-number, \Ypage-number, \Ychapter-name \Ysection-name
  1487. {\catcode `\-=11
  1488. \gdef\Ychapter-number{\the\chapno}
  1489. \gdef\Ypage-number{\folio}
  1490. \gdef\Ychapter-name{\thischapter}
  1491. \gdef\Ysection-name{\thissection}
  1492. }
  1493. % Define @ref, and alternatively the character ^V, to reference a cross-ref.
  1494. \def\ref{\parsearg\refx}
  1495. \def\refx#1{%
  1496. {%
  1497. \setbox0=\hbox{\csname X#1\endcsname}%
  1498. \ifdim\wd0>0in \else % If not defined, say something at least.
  1499. \expandafter\gdef\csname X#1\endcsname {$<$undefined$>$}%
  1500. \message {WARNING: Cross-reference "#1" used but not yet defined}%
  1501. \message {}%
  1502. \fi %
  1503. \csname X#1\endcsname %It's defined, so just use it.
  1504. }}
  1505. %% Mention a Lisp construct, telling the reader the page number
  1506. %% The first argument is the construct, the second the name of the construct
  1507. %% Sample use: @see[cons][fun] --> cons (see page 23)
  1508. \def\see[#1][#2]{{\li #1} (see \refx{#1-#2})}
  1509. \catcode`\^^V=\active
  1510. \let^^V=\ref
  1511. % Read the last existing aux file, if any. No error if none exists.
  1512. % This is the macro invoked by entries in the aux file.
  1513. \def\xrdef #1#2{
  1514. {\catcode`\'=\other\expandafter \gdef \csname X#1\endcsname {#2}}}
  1515. {
  1516. \catcode `\^^@=\other
  1517. \catcode `\=\other
  1518. \catcode `\=\other
  1519. \catcode `\^^C=\other
  1520. \catcode `\^^D=\other
  1521. \catcode `\^^E=\other
  1522. \catcode `\^^F=\other
  1523. \catcode `\^^G=\other
  1524. \catcode `\^^H=\other
  1525. \catcode `\ =\other
  1526. \catcode `\^^L=\other
  1527. \catcode `\=\other
  1528. \catcode `\=\other
  1529. \catcode `\=\other
  1530. \catcode `\=\other
  1531. \catcode `\=\other
  1532. \catcode `\=\other
  1533. \catcode `\=\other
  1534. \catcode `\=\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. % the aux file uses ' as the escape.
  1559. % Turn off \ as an escape so we do not lose on
  1560. % entries which were dumped with control sequences in their names.
  1561. % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
  1562. % Reference to such entries still does not work the way one would wish,
  1563. % but at least they do not bomb out when the aux file is read in.
  1564. \catcode `\{=1 \catcode `\}=2
  1565. \catcode `\%=\other
  1566. \catcode `\'=0
  1567. \catcode `\\=\other
  1568. 'openin 1 'jobname.aux
  1569. 'ifeof 1 'else 'closein 1 'input 'jobname.aux
  1570. 'fi
  1571. }
  1572. % Open the new aux file. Tex will close it automatically at exit.
  1573. \openout \auxfile=\jobname.aux
  1574. % End of control word definitions.
  1575. \message{and turning on Bolio.}
  1576. % Turn off all special characters except @
  1577. % (and those which the user can use as if they were ordinary)
  1578. % Define certain chars to be always in tt font.
  1579. \catcode`\"=\active
  1580. \def\activedoublequote{{\tt \char '042}}
  1581. \let"=\activedoublequote
  1582. \catcode`\~=\active
  1583. \def~{{\tt \char '176}}
  1584. \chardef\hat=`\^
  1585. \catcode`\^=\active
  1586. \def^{{\tt \hat}}
  1587. \catcode`\_=\active
  1588. \def_{{\tt \char '137}}
  1589. \catcode`\|=\active
  1590. \def|{{\tt \char '174}}
  1591. \chardef \less=`\<
  1592. \catcode`\<=\active
  1593. \def<{{\tt \less}}
  1594. \chardef \gtr=`\>
  1595. \catcode`\>=\active
  1596. \def>{{\tt \gtr}}
  1597. %%% CHANGE! Used by \activeparens for \defspec's benefit
  1598. \def\nlbrace{\ifmmode \delimiter"4266308 \else {\tensy\char'146}\fi}
  1599. \def\nrbrace{\ifmmode \delimiter"5267309 \else {\tensy\char'147}\fi}
  1600. \let\{=\nlbrace \let \}=\nrbrace
  1601. \def\mylbrace {{\tt \char '173}}
  1602. \def\myrbrace {{\tt \char '175}}
  1603. \catcode`\{=\active
  1604. \let{=\mylbrace
  1605. \catcode`\}=\active
  1606. \let}=\myrbrace
  1607. %% These look ok in all fonts, so just make them not special. The @rm below
  1608. %% makes sure that the current font starts out as the newly loaded cmr10
  1609. \catcode`\$=\other \catcode`\%=\other \catcode`\&=\other \catcode`\#=\other
  1610. \catcode`\@=0 \catcode`\\=\other
  1611. @textfonts
  1612. @rm