texinfo.tex 116 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650
  1. %% TeX macros to handle texinfo files
  2. % Copyright (C) 1985, 86, 88, 90, 91, 92 Free Software Foundation, Inc.
  3. %This texinfo.tex file is free software; you can redistribute it and/or
  4. %modify it under the terms of the GNU General Public License as
  5. %published by the Free Software Foundation; either version 2, or (at
  6. %your option) any later version.
  7. %This texinfo.tex file is distributed in the hope that it will be
  8. %useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  9. %of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. %General Public License for more details.
  11. %You should have received a copy of the GNU General Public License
  12. %along with this texinfo.tex file; see the file COPYING. If not, write
  13. %to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139,
  14. %USA.
  15. %In other words, you are welcome to use, share and improve this program.
  16. %You are forbidden to forbid anyone else to use, share and improve
  17. %what you give them. Help stamp out software-hoarding!
  18. \def\texinfoversion{2.85}
  19. \message{Loading texinfo package [Version \texinfoversion]:}
  20. \message{}
  21. % Print the version number if in a .fmt file.
  22. \everyjob{\message{[Texinfo version \texinfoversion]}\message{}}
  23. % Save some parts of plain tex whose names we will redefine.
  24. \let\ptexlbrace=\{
  25. \let\ptexrbrace=\}
  26. \let\ptexdots=\dots
  27. \let\ptexdot=\.
  28. \let\ptexstar=\*
  29. \let\ptexend=\end
  30. \let\ptexbullet=\bullet
  31. \let\ptexb=\b
  32. \let\ptexc=\c
  33. \let\ptexi=\i
  34. \let\ptext=\t
  35. \let\ptexl=\l
  36. \let\ptexL=\L
  37. \def\tie{\penalty 10000\ } % Save plain tex definition of ~.
  38. \message{Basics,}
  39. \chardef\other=12
  40. % If this character appears in an error message or help string, it
  41. % starts a new line in the output.
  42. \newlinechar = `^^J
  43. % Ignore a token.
  44. %
  45. \def\gobble#1{}
  46. \hyphenation{ap-pen-dix}
  47. \hyphenation{mini-buf-fer mini-buf-fers}
  48. \hyphenation{eshell}
  49. % Margin to add to right of even pages, to left of odd pages.
  50. \newdimen \bindingoffset \bindingoffset=0pt
  51. \newdimen \normaloffset \normaloffset=\hoffset
  52. \newdimen\pagewidth \newdimen\pageheight
  53. \pagewidth=\hsize \pageheight=\vsize
  54. % Sometimes it is convenient to have everything in the transcript file
  55. % and nothing on the terminal. We don't just call \tracingall here,
  56. % since that produces some useless output on the terminal.
  57. %
  58. \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
  59. \def\loggingall{\tracingcommands2 \tracingstats2
  60. \tracingpages1 \tracingoutput1 \tracinglostchars1
  61. \tracingmacros2 \tracingparagraphs1 \tracingrestores1
  62. \showboxbreadth\maxdimen\showboxdepth\maxdimen
  63. }%
  64. %---------------------Begin change-----------------------
  65. %
  66. %%%% For @cropmarks command.
  67. % Dimensions to add cropmarks at corners Added by P. A. MacKay, 12 Nov. 1986
  68. %
  69. \newdimen\cornerlong \newdimen\cornerthick
  70. \newdimen \topandbottommargin
  71. \newdimen \outerhsize \newdimen \outervsize
  72. \cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks
  73. \outerhsize=7in
  74. %\outervsize=9.5in
  75. % Alternative @smallbook page size is 9.25in
  76. \outervsize=9.25in
  77. \topandbottommargin=.75in
  78. %
  79. %---------------------End change-----------------------
  80. % \onepageout takes a vbox as an argument. Note that \pagecontents
  81. % does insertions itself, but you have to call it yourself.
  82. \chardef\PAGE=255 \output={\onepageout{\pagecontents\PAGE}}
  83. \def\onepageout#1{\hoffset=\normaloffset
  84. \ifodd\pageno \advance\hoffset by \bindingoffset
  85. \else \advance\hoffset by -\bindingoffset\fi
  86. {\escapechar=`\\\relax % makes sure backslash is used in output files.
  87. \shipout\vbox{{\let\hsize=\pagewidth \makeheadline} \pagebody{#1}%
  88. {\let\hsize=\pagewidth \makefootline}}}%
  89. \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi}
  90. %%%% For @cropmarks command %%%%
  91. % Here is a modification of the main output routine for Near East Publications
  92. % This provides right-angle cropmarks at all four corners.
  93. % The contents of the page are centerlined into the cropmarks,
  94. % and any desired binding offset is added as an \hskip on either
  95. % site of the centerlined box. (P. A. MacKay, 12 November, 1986)
  96. %
  97. \def\croppageout#1{\hoffset=0pt % make sure this doesn't mess things up
  98. \shipout
  99. \vbox to \outervsize{\hsize=\outerhsize
  100. \vbox{\line{\ewtop\hfill\ewtop}}
  101. \nointerlineskip
  102. \line{\vbox{\moveleft\cornerthick\nstop}
  103. \hfill
  104. \vbox{\moveright\cornerthick\nstop}}
  105. \vskip \topandbottommargin
  106. \centerline{\ifodd\pageno\hskip\bindingoffset\fi
  107. \vbox{
  108. {\let\hsize=\pagewidth \makeheadline}
  109. \pagebody{#1}
  110. {\let\hsize=\pagewidth \makefootline}}
  111. \ifodd\pageno\else\hskip\bindingoffset\fi}
  112. \vskip \topandbottommargin plus1fill minus1fill
  113. \boxmaxdepth\cornerthick
  114. \line{\vbox{\moveleft\cornerthick\nsbot}
  115. \hfill
  116. \vbox{\moveright\cornerthick\nsbot}}
  117. \nointerlineskip
  118. \vbox{\line{\ewbot\hfill\ewbot}}
  119. }
  120. \advancepageno
  121. \ifnum\outputpenalty>-20000 \else\dosupereject\fi}
  122. %
  123. % Do @cropmarks to get crop marks
  124. \def\cropmarks{\let\onepageout=\croppageout }
  125. \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
  126. {\catcode`\@ =11
  127. \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
  128. \dimen@=\dp#1 \unvbox#1
  129. \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
  130. \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
  131. }
  132. %
  133. % Here are the rules for the cropmarks. Note that they are
  134. % offset so that the space between them is truly \outerhsize or \outervsize
  135. % (P. A. MacKay, 12 November, 1986)
  136. %
  137. \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
  138. \def\nstop{\vbox
  139. {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
  140. \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
  141. \def\nsbot{\vbox
  142. {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
  143. % Parse an argument, then pass it to #1. The argument is the rest of
  144. % the input line (except we remove a trailing comment). #1 should be a
  145. % macro which expects an ordinary undelimited TeX argument.
  146. %
  147. \def\parsearg#1{%
  148. \let\next = #1%
  149. \begingroup
  150. \obeylines
  151. \futurelet\temp\parseargx
  152. }
  153. % If the next token is an obeyed space (from an @example environment or
  154. % the like), remove it and recurse. Otherwise, we're done.
  155. \def\parseargx{%
  156. \ifx\obeyedspace\temp
  157. \expandafter\parseargdiscardspace
  158. \else
  159. \expandafter\parseargline
  160. \fi
  161. }
  162. % Remove a single space (as the delimiter token to the macro call).
  163. {\obeyspaces %
  164. \gdef\parseargdiscardspace {\futurelet\temp\parseargx}}
  165. \gdef\obeyedspace{\ }
  166. {\obeylines %
  167. \gdef\parseargline#1^^M{%
  168. \endgroup % End of the group started in \parsearg.
  169. %
  170. % First remove any @c comment, then any @comment.
  171. % Result of each macro is put in \toks0.
  172. \argremovec #1\c\relax %
  173. \expandafter\argremovecomment \the\toks0 \comment\relax %
  174. %
  175. % Call the caller's macro, saved as \next in \parsearg.
  176. \expandafter\next\expandafter{\the\toks0}%
  177. }%
  178. }
  179. % Since all \c{,omment} does is throw away the argument, we can let TeX
  180. % do that for us. The \relax here is matched by the \relax in the call
  181. % in \parseargline; it could be more or less anything, its purpose is
  182. % just to delimit the argument to the \c.
  183. \def\argremovec#1\c#2\relax{\toks0 = {#1}}
  184. \def\argremovecomment#1\comment#2\relax{\toks0 = {#1}}
  185. % \argremovec{,omment} might leave us with trailing spaces, though; e.g.,
  186. % @end itemize @c foo
  187. % will have two active spaces as part of the argument with the
  188. % `itemize'. Here we remove all active spaces from #1, and assign the
  189. % result to \toks0.
  190. %
  191. % This loses if there are any *other* active characters besides spaces
  192. % in the argument -- _ ^ +, for example -- since they get expanded.
  193. % Fortunately, Texinfo does not define any such commands. (If it ever
  194. % does, the catcode of the characters in questionwill have to be changed
  195. % here.) But this means we cannot call \removeactivespaces as part of
  196. % \argremovec{,omment}, since @c uses \parsearg, and thus the argument
  197. % that \parsearg gets might well have any character at all in it.
  198. %
  199. \def\removeactivespaces#1{%
  200. \begingroup
  201. \ignoreactivespaces
  202. \edef\temp{#1}%
  203. \global\toks0 = \expandafter{\temp}%
  204. \endgroup
  205. }
  206. % Change the active space to expand to nothing.
  207. %
  208. \begingroup
  209. \obeyspaces
  210. \gdef\ignoreactivespaces{\obeyspaces\let =\empty}
  211. \endgroup
  212. \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
  213. %% These are used to keep @begin/@end levels from running away
  214. %% Call \inENV within environments (after a \begingroup)
  215. \newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
  216. \def\ENVcheck{%
  217. \ifENV\errmessage{Still within an environment. Type Return to continue.}
  218. \endgroup\fi} % This is not perfect, but it should reduce lossage
  219. % @begin foo is the same as @foo, for now.
  220. \newhelp\EMsimple{Type <Return> to continue.}
  221. \outer\def\begin{\parsearg\beginxxx}
  222. \def\beginxxx #1{%
  223. \expandafter\ifx\csname #1\endcsname\relax
  224. {\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else
  225. \csname #1\endcsname\fi}
  226. % @end foo executes the definition of \Efoo.
  227. %
  228. \def\end{\parsearg\endxxx}
  229. \def\endxxx #1{%
  230. \removeactivespaces{#1}%
  231. \edef\endthing{\the\toks0}%
  232. %
  233. \expandafter\ifx\csname E\endthing\endcsname\relax
  234. \expandafter\ifx\csname \endthing\endcsname\relax
  235. % There's no \foo, i.e., no ``environment'' foo.
  236. \errhelp = \EMsimple
  237. \errmessage{Undefined command `@end \endthing'}%
  238. \else
  239. % There is an environment foo, but it hasn't been started.
  240. \errhelp = \EMsimple
  241. \errmessage{This `@end \endthing' doesn't have a matching `@\endthing'}%
  242. \fi
  243. \else
  244. % Everything's ok; the right environment has been started.
  245. \csname E\endthing\endcsname
  246. \fi
  247. }
  248. % Single-spacing is done by various environments.
  249. \newskip\singlespaceskip \singlespaceskip = \baselineskip
  250. \def\singlespace{%
  251. {\advance \baselineskip by -\singlespaceskip
  252. \kern \baselineskip}%
  253. \baselineskip=\singlespaceskip
  254. }
  255. %% Simple single-character @ commands
  256. % @@ prints an @
  257. % Kludge this until the fonts are right (grr).
  258. \def\@{{\tt \char '100}}
  259. % This is turned off because it was never documented
  260. % and you can use @w{...} around a quote to suppress ligatures.
  261. %% Define @` and @' to be the same as ` and '
  262. %% but suppressing ligatures.
  263. %\def\`{{`}}
  264. %\def\'{{'}}
  265. % Used to generate quoted braces.
  266. \def\mylbrace {{\tt \char '173}}
  267. \def\myrbrace {{\tt \char '175}}
  268. \let\{=\mylbrace
  269. \let\}=\myrbrace
  270. % @: forces normal size whitespace following.
  271. \def\:{\spacefactor=1000 }
  272. % @* forces a line break.
  273. \def\*{\hfil\break\hbox{}\ignorespaces}
  274. % @. is an end-of-sentence period.
  275. \def\.{.\spacefactor=3000 }
  276. % @w prevents a word break. Without the \leavevmode, @w at the
  277. % beginning of a paragraph, when TeX is still in vertical mode, would
  278. % produce a whole line of output instead of starting the paragraph.
  279. \def\w#1{\leavevmode\hbox{#1}}
  280. % @group ... @end group forces ... to be all on one page, by enclosing
  281. % it in a TeX vbox. We use \vtop instead of \vbox to construct the box
  282. % to keep its height that of a normal line. According to the rules for
  283. % \topskip (p.114 of the TeXbook), the glue inserted is
  284. % max (\topskip - \ht (first item), 0). If that height is large,
  285. % therefore, no glue is inserted, and the space between the headline and
  286. % the text is small, which looks bad.
  287. %
  288. \def\group{\begingroup
  289. \ifnum\catcode13=\active \else
  290. \errhelp = \groupinvalidhelp
  291. \errmessage{@group invalid in context where filling is enabled}%
  292. \fi
  293. %
  294. % If we don't do the \strut ... \nointerlineskip, we wind up with a
  295. % box with a large depth, and hence get (typically) \lineskip leading
  296. % (1pt), instead of the usual interline space (\baselineskip). See
  297. % p.82 of the TeXbook.
  298. \def\Egroup{%
  299. \strut % Put in the normal leading.
  300. \egroup % End the \vtop.
  301. \endgroup % End the \group.
  302. \nointerlineskip % We inserted our own leading.
  303. }%
  304. %
  305. \vtop\bgroup
  306. % We do @comment here in case we are called inside an environment,
  307. % such as @example, where each end-of-line in the input causes an
  308. % end-of-line in the output. We don't want the end-of-line after
  309. % the `@group' to put extra space in the output. Since @group
  310. % should appear on a line by itself (according to the Texinfo
  311. % manual), we don't worry about eating any user text.
  312. \comment
  313. }
  314. %
  315. % TeX puts in an \escapechar (i.e., `@') at the beginning of the help
  316. % message, so this ends up printing `@group can only ...'.
  317. %
  318. \newhelp\groupinvalidhelp{%
  319. group can only be used in environments such as @example,^^J%
  320. where each line of input produces a line of output.}
  321. % @need space-in-mils
  322. % forces a page break if there is not space-in-mils remaining.
  323. \newdimen\mil \mil=0.001in
  324. \def\need{\parsearg\needx}
  325. % Old definition--didn't work.
  326. %\def\needx #1{\par %
  327. %% This method tries to make TeX break the page naturally
  328. %% if the depth of the box does not fit.
  329. %{\baselineskip=0pt%
  330. %\vtop to #1\mil{\vfil}\kern -#1\mil\penalty 10000
  331. %\prevdepth=-1000pt
  332. %}}
  333. \def\needx#1{%
  334. % Go into vertical mode, so we don't make a big box in the middle of a
  335. % paragraph.
  336. \par
  337. %
  338. % Don't add any leading before our big empty box, but allow a page
  339. % break, since the best break might be right here.
  340. \allowbreak
  341. \nointerlineskip
  342. \vtop to #1\mil{\vfil}%
  343. %
  344. % TeX does not even consider page breaks if a penalty added to the
  345. % main vertical list is 10000 or more. But in order to see if the
  346. % empty box we just added fits on the page, we must make it consider
  347. % page breaks. On the other hand, we don't want to actually break the
  348. % page after the empty box. So we use a penalty of 9999.
  349. %
  350. % There is an extremely small chance that TeX will actually break the
  351. % page at this \penalty, if there are no other feasible breakpoints in
  352. % sight. (If the user is using lots of big @group commands, which
  353. % almost-but-not-quite fill up a page, TeX will have a hard time doing
  354. % good page breaking, for example.) However, I could not construct an
  355. % example where a page broke at this \penalty; if it happens in a real
  356. % document, then we can reconsider our strategy.
  357. \penalty9999
  358. %
  359. % Back up by the size of the box, whether we did a page break or not.
  360. \kern -#1\mil
  361. %
  362. % Do not allow a page break right after this kern.
  363. \nobreak
  364. }
  365. % @br forces paragraph break
  366. \let\br = \par
  367. % @dots{} output some dots
  368. \def\dots{$\ldots$}
  369. % @page forces the start of a new page
  370. \def\page{\par\vfill\supereject}
  371. % @exdent text....
  372. % outputs text on separate line in roman font, starting at standard page margin
  373. % This records the amount of indent in the innermost environment.
  374. % That's how much \exdent should take out.
  375. \newskip\exdentamount
  376. % This defn is used inside fill environments such as @defun.
  377. \def\exdent{\parsearg\exdentyyy}
  378. \def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}}
  379. % This defn is used inside nofill environments such as @example.
  380. \def\nofillexdent{\parsearg\nofillexdentyyy}
  381. \def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount
  382. \leftline{\hskip\leftskip{\rm#1}}}}
  383. %\hbox{{\rm#1}}\hfil\break}}
  384. % @include file insert text of that file as input.
  385. \def\include{\parsearg\includezzz}
  386. \def\includezzz #1{{\def\thisfile{#1}\input #1
  387. }}
  388. \def\thisfile{}
  389. % @center line outputs that line, centered
  390. \def\center{\parsearg\centerzzz}
  391. \def\centerzzz #1{{\advance\hsize by -\leftskip
  392. \advance\hsize by -\rightskip
  393. \centerline{#1}}}
  394. % @sp n outputs n lines of vertical space
  395. \def\sp{\parsearg\spxxx}
  396. \def\spxxx #1{\par \vskip #1\baselineskip}
  397. % @comment ...line which is ignored...
  398. % @c is the same as @comment
  399. % @ignore ... @end ignore is another way to write a comment
  400. \def\comment{\catcode 64=\other \catcode 123=\other \catcode 125=\other%
  401. \parsearg \commentxxx}
  402. \def\commentxxx #1{\catcode 64=0 \catcode 123=1 \catcode 125=2 }
  403. \let\c=\comment
  404. % Prevent errors for section commands.
  405. % Used in @ignore and in failing conditionals.
  406. \def\ignoresections{%
  407. \let\chapter=\relax
  408. \let\unnumbered=\relax
  409. \let\top=\relax
  410. \let\unnumberedsec=\relax
  411. \let\unnumberedsection=\relax
  412. \let\unnumberedsubsec=\relax
  413. \let\unnumberedsubsection=\relax
  414. \let\unnumberedsubsubsec=\relax
  415. \let\unnumberedsubsubsection=\relax
  416. \let\section=\relax
  417. \let\subsec=\relax
  418. \let\subsubsec=\relax
  419. \let\subsection=\relax
  420. \let\subsubsection=\relax
  421. \let\appendix=\relax
  422. \let\appendixsec=\relax
  423. \let\appendixsection=\relax
  424. \let\appendixsubsec=\relax
  425. \let\appendixsubsection=\relax
  426. \let\appendixsubsubsec=\relax
  427. \let\appendixsubsubsection=\relax
  428. \let\contents=\relax
  429. \let\smallbook=\relax
  430. \let\titlepage=\relax
  431. }
  432. % Ignore @ignore ... @end ignore.
  433. %
  434. \def\ignore{\doignore{ignore}}
  435. % We ignore @ifinfo text.
  436. %
  437. \def\ifinfo{\doignore{ifinfo}}
  438. % Ignore text until a line `@end #1'.
  439. %
  440. \def\doignore#1{\begingroup
  441. % Don't complain about control sequences we have declared \outer.
  442. \ignoresections
  443. %
  444. % Define a command to swallow text until we reach `@end #1'.
  445. \long\def\doignoretext##1\end #1{\enddoignore}%
  446. %
  447. % Make sure that spaces turn into tokens that match what \doignoretext wants.
  448. \catcode32 = 10
  449. %
  450. % And now expand that command.
  451. \doignoretext
  452. }
  453. % What we do to finish off ignored text.
  454. %
  455. \def\enddoignore{\endgroup\ignorespaces}%
  456. \def\direntry{\begingroup\direntryxxx}
  457. \long\def\direntryxxx #1\end direntry{\endgroup\ignorespaces}
  458. % Conditionals to test whether a flag is set.
  459. \def\ifset{\begingroup\ignoresections\parsearg\ifsetxxx}
  460. \def\ifsetxxx #1{\endgroup
  461. \expandafter\ifx\csname SET#1\endcsname\relax \let\temp=\ifsetfail
  462. \else \let\temp=\relax \fi
  463. \temp}
  464. \def\Eifset{}
  465. \def\ifsetfail{\doignore{ifset}}
  466. \def\ifclear{\begingroup\ignoresections\parsearg\ifclearxxx}
  467. \def\ifclearxxx #1{\endgroup
  468. \expandafter\ifx\csname SET#1\endcsname\relax \let\temp=\relax
  469. \else \let\temp=\ifclearfail \fi
  470. \temp}
  471. \def\Eifclear{}
  472. \def\ifclearfail{\doignore{ifclear}}
  473. % @set foo
  474. % to set the flag named foo to a default value (empty)
  475. % @set foo REST-OF-LINE
  476. % to set the flag named foo to a text string REST-OF-LINE
  477. % @clear foo to clear the flag named foo.
  478. % @value{foo} to set the text saved in foo
  479. %
  480. % @set command, work macro \setyyy
  481. %
  482. \def\setyyy#1 #2\endsetyyy{\expandafter\xdef\csname SET#1\endcsname{#2\unskip}}
  483. %
  484. \def\setxxx#1{\setyyy#1 \endsetyyy}
  485. \def\set{\parsearg\setxxx}
  486. \def\clear{\parsearg\clearxxx}
  487. \def\clearxxx #1{
  488. \expandafter\let\csname SET#1\endcsname=\relax}
  489. \def\value#1{\expandafter
  490. \ifx\csname SET#1\endcsname\relax
  491. {\{No value for ``#1''\}}
  492. \else \csname SET#1\endcsname \fi}
  493. % Some texinfo constructs that are trivial in tex
  494. \def\iftex{}
  495. \def\Eiftex{}
  496. \long\def\menu #1\end menu{}
  497. \def\asis#1{#1}
  498. % @math means output in math mode.
  499. % We don't use $'s directly in the definition of \math because control
  500. % sequences like \math are expanded when the toc file is written. Then,
  501. % we read the toc file back, the $'s will be normal characters (as they
  502. % should be, according to the definition of Texinfo). So we must use a
  503. % control sequence to switch into and out of math mode.
  504. %
  505. % This isn't quite enough for @math to work properly in indices, but it
  506. % seems unlikely it will ever be needed there.
  507. %
  508. \let\implicitmath = $
  509. \def\math#1{\implicitmath #1\implicitmath}
  510. \def\node{\ENVcheck\parsearg\nodezzz}
  511. \def\nodezzz#1{\nodexxx [#1,]}
  512. \def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
  513. \let\lastnode=\relax
  514. \def\donoderef{\ifx\lastnode\relax\else
  515. \expandafter\expandafter\expandafter\setref{\lastnode}\fi
  516. \let\lastnode=\relax}
  517. \def\unnumbnoderef{\ifx\lastnode\relax\else
  518. \expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi
  519. \let\lastnode=\relax}
  520. \def\appendixnoderef{\ifx\lastnode\relax\else
  521. \expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi
  522. \let\lastnode=\relax}
  523. \let\refill=\relax
  524. % @setfilename is done at the beginning of every texinfo file.
  525. % So open here the files we need to have open while reading the input.
  526. % This makes it possible to make a .fmt file for texinfo.
  527. \def\setfilename{%
  528. \readauxfile
  529. \opencontents
  530. \openindices
  531. \fixbackslash % Turn off hack to swallow `\input texinfo'.
  532. \global\let\setfilename=\comment % Ignore extra @setfilename cmds.
  533. \comment % Ignore the actual filename.
  534. }
  535. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
  536. \def\inforef #1{\inforefzzz #1,,,,**}
  537. \def\inforefzzz #1,#2,#3,#4**{See Info file \file{\losespace#3{}},
  538. node \samp{\losespace#1{}}}
  539. \def\losespace #1{#1}
  540. \message{fonts,}
  541. % Font-change commands.
  542. % Texinfo supports the sans serif font style, which plain TeX does not.
  543. % So we set up a \sf analogous to plain's \rm, etc.
  544. \newfam\sffam
  545. \def\sf{\fam=\sffam \tensf}
  546. \let\li = \sf % Sometimes we call it \li, not \sf.
  547. %% Try out Computer Modern fonts at \magstephalf
  548. \let\mainmagstep=\magstephalf
  549. \ifx\bigger\relax
  550. \let\mainmagstep=\magstep1
  551. \font\textrm=cmr12
  552. \font\texttt=cmtt12
  553. \else
  554. \font\textrm=cmr10 scaled \mainmagstep
  555. \font\texttt=cmtt10 scaled \mainmagstep
  556. \fi
  557. % Instead of cmb10, you many want to use cmbx10.
  558. % cmbx10 is a prettier font on its own, but cmb10
  559. % looks better when embedded in a line with cmr10.
  560. \font\textbf=cmb10 scaled \mainmagstep
  561. \font\textit=cmti10 scaled \mainmagstep
  562. \font\textsl=cmsl10 scaled \mainmagstep
  563. \font\textsf=cmss10 scaled \mainmagstep
  564. \font\textsc=cmcsc10 scaled \mainmagstep
  565. \font\texti=cmmi10 scaled \mainmagstep
  566. \font\textsy=cmsy10 scaled \mainmagstep
  567. % A few fonts for @defun, etc.
  568. \font\defbf=cmbx10 scaled \magstep1 %was 1314
  569. \font\deftt=cmtt10 scaled \magstep1
  570. \def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf}
  571. % Fonts for indices and small examples.
  572. % We actually use the slanted font rather than the italic,
  573. % because texinfo normally uses the slanted fonts for that.
  574. % Do not make many font distinctions in general in the index, since they
  575. % aren't very useful.
  576. \font\ninett=cmtt9
  577. \font\indrm=cmr9
  578. \font\indit=cmsl9
  579. \let\indsl=\indit
  580. \let\indtt=\ninett
  581. \let\indsf=\indrm
  582. \let\indbf=\indrm
  583. \let\indsc=\indrm
  584. \font\indi=cmmi9
  585. \font\indsy=cmsy9
  586. % Fonts for headings
  587. \font\chaprm=cmbx12 scaled \magstep2
  588. \font\chapit=cmti12 scaled \magstep2
  589. \font\chapsl=cmsl12 scaled \magstep2
  590. \font\chaptt=cmtt12 scaled \magstep2
  591. \font\chapsf=cmss12 scaled \magstep2
  592. \let\chapbf=\chaprm
  593. \font\chapsc=cmcsc10 scaled\magstep3
  594. \font\chapi=cmmi12 scaled \magstep2
  595. \font\chapsy=cmsy10 scaled \magstep3
  596. \font\secrm=cmbx12 scaled \magstep1
  597. \font\secit=cmti12 scaled \magstep1
  598. \font\secsl=cmsl12 scaled \magstep1
  599. \font\sectt=cmtt12 scaled \magstep1
  600. \font\secsf=cmss12 scaled \magstep1
  601. \font\secbf=cmbx12 scaled \magstep1
  602. \font\secsc=cmcsc10 scaled\magstep2
  603. \font\seci=cmmi12 scaled \magstep1
  604. \font\secsy=cmsy10 scaled \magstep2
  605. % \font\ssecrm=cmbx10 scaled \magstep1 % This size an font looked bad.
  606. % \font\ssecit=cmti10 scaled \magstep1 % The letters were too crowded.
  607. % \font\ssecsl=cmsl10 scaled \magstep1
  608. % \font\ssectt=cmtt10 scaled \magstep1
  609. % \font\ssecsf=cmss10 scaled \magstep1
  610. %\font\ssecrm=cmb10 scaled 1315 % Note the use of cmb rather than cmbx.
  611. %\font\ssecit=cmti10 scaled 1315 % Also, the size is a little larger than
  612. %\font\ssecsl=cmsl10 scaled 1315 % being scaled magstep1.
  613. %\font\ssectt=cmtt10 scaled 1315
  614. %\font\ssecsf=cmss10 scaled 1315
  615. %\let\ssecbf=\ssecrm
  616. \font\ssecrm=cmbx12 scaled \magstephalf
  617. \font\ssecit=cmti12 scaled \magstephalf
  618. \font\ssecsl=cmsl12 scaled \magstephalf
  619. \font\ssectt=cmtt12 scaled \magstephalf
  620. \font\ssecsf=cmss12 scaled \magstephalf
  621. \font\ssecbf=cmbx12 scaled \magstephalf
  622. \font\ssecsc=cmcsc10 scaled \magstep1
  623. \font\sseci=cmmi12 scaled \magstephalf
  624. \font\ssecsy=cmsy10 scaled \magstep1
  625. % The smallcaps and symbol fonts should actually be scaled \magstep1.5,
  626. % but that is not a standard magnification.
  627. % Fonts for title page:
  628. \font\titlerm = cmbx12 scaled \magstep3
  629. \let\authorrm = \secrm
  630. % In order for the font changes to affect most math symbols and letters,
  631. % we have to define the \textfont of the standard families. Since
  632. % texinfo doesn't allow for producing subscripts and superscripts, we
  633. % don't bother to reset \scriptfont and \scriptscriptfont (which would
  634. % also require loading a lot more fonts).
  635. %
  636. \def\resetmathfonts{%
  637. \textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy
  638. \textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf
  639. \textfont\ttfam = \tentt \textfont\sffam = \tensf
  640. }
  641. % The font-changing commands redefine the meanings of \tenSTYLE, instead
  642. % of just \STYLE. We do this so that font changes will continue to work
  643. % in math mode, where it is the current \fam that is relevant in most
  644. % cases, not the current. Plain TeX does, for example,
  645. % \def\bf{\fam=\bffam \tenbf} By redefining \tenbf, we obviate the need
  646. % to redefine \bf itself.
  647. \def\textfonts{%
  648. \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
  649. \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
  650. \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
  651. \resetmathfonts}
  652. \def\chapfonts{%
  653. \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
  654. \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
  655. \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
  656. \resetmathfonts}
  657. \def\secfonts{%
  658. \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
  659. \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
  660. \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
  661. \resetmathfonts}
  662. \def\subsecfonts{%
  663. \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
  664. \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
  665. \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
  666. \resetmathfonts}
  667. \def\indexfonts{%
  668. \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl
  669. \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc
  670. \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy
  671. \resetmathfonts}
  672. % Set up the default fonts, so we can use them for creating boxes.
  673. %
  674. \textfonts
  675. % Count depth in font-changes, for error checks
  676. \newcount\fontdepth \fontdepth=0
  677. % Fonts for short table of contents.
  678. \font\shortcontrm=cmr12
  679. \font\shortcontbf=cmbx12
  680. \font\shortcontsl=cmsl12
  681. %% Add scribe-like font environments, plus @l for inline lisp (usually sans
  682. %% serif) and @ii for TeX italic
  683. % \smartitalic{ARG} outputs arg in italics, followed by an italic correction
  684. % unless the following character is such as not to need one.
  685. \def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
  686. \def\smartitalic#1{{\sl #1}\futurelet\next\smartitalicx}
  687. \let\i=\smartitalic
  688. \let\var=\smartitalic
  689. \let\dfn=\smartitalic
  690. \let\emph=\smartitalic
  691. \let\cite=\smartitalic
  692. \def\b#1{{\bf #1}}
  693. \let\strong=\b
  694. \def\t#1{{\tt \exhyphenpenalty=10000\rawbackslash \frenchspacing #1}\null}
  695. \let\ttfont = \t
  696. %\def\samp #1{`{\tt \rawbackslash \frenchspacing #1}'\null}
  697. \def\samp #1{`\tclose{#1}'\null}
  698. \def\key #1{{\tt \exhyphenpenalty=10000\uppercase{#1}}\null}
  699. \def\ctrl #1{{\tt \rawbackslash \hat}#1}
  700. \let\file=\samp
  701. % @code is a modification of @t,
  702. % which makes spaces the same size as normal in the surrounding text.
  703. \newdimen\tclosesave
  704. \newdimen\tcloserm
  705. \def\tclose#1{{\rm \tcloserm=\fontdimen2\font \tt \tclosesave=\fontdimen2\font
  706. \fontdimen2\font=\tcloserm
  707. % prevent breaking lines at hyphens.
  708. \exhyphenpenalty=10000
  709. \def\ {{\fontdimen2\font=\tclosesave{} }}%
  710. \rawbackslash \frenchspacing #1\fontdimen2\font=\tclosesave}\null}
  711. \let\code=\tclose
  712. %\let\exp=\tclose %Was temporary
  713. % @kbd is like @code, except that if the argument is just one @key command,
  714. % then @kbd has no effect.
  715. \def\xkey{\key}
  716. \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
  717. \ifx\one\xkey\ifx\threex\three \key{#2}%
  718. \else\tclose{\look}\fi
  719. \else\tclose{\look}\fi}
  720. % Typeset a dimension, e.g., `in' or `pt'. The only reason for the
  721. % argument is to make the input look right: @dmn{pt} instead of
  722. % @dmn{}pt.
  723. %
  724. \def\dmn#1{\thinspace #1}
  725. \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}
  726. \def\l#1{{\li #1}\null} %
  727. \def\r#1{{\rm #1}} % roman font
  728. % Use of \lowercase was suggested.
  729. \def\sc#1{{\smallcaps#1}} % smallcaps font
  730. \def\ii#1{{\it #1}} % italic font
  731. \message{page headings,}
  732. \newskip\titlepagetopglue \titlepagetopglue = 1.5in
  733. \newskip\titlepagebottomglue \titlepagebottomglue = 2pc
  734. % First the title page. Must do @settitle before @titlepage.
  735. \def\titlefont#1{{\titlerm #1}}
  736. \newtoks\realeverypar
  737. \newif\ifseenauthor
  738. \newif\iffinishedtitlepage
  739. \def\titlepage{\begingroup \parindent=0pt \textfonts
  740. \let\subtitlerm=\tenrm
  741. % I deinstalled the following change because \cmr12 is undefined.
  742. % This change was not in the ChangeLog anyway. --rms.
  743. % \let\subtitlerm=\cmr12
  744. \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
  745. %
  746. \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}%
  747. %
  748. % Leave some space at the very top of the page.
  749. \vglue\titlepagetopglue
  750. %
  751. % Now you can print the title using @title.
  752. \def\title{\parsearg\titlezzz}%
  753. \def\titlezzz##1{\leftline{\titlefont{##1}}
  754. % print a rule at the page bottom also.
  755. \finishedtitlepagefalse
  756. \vskip4pt \hrule height 4pt \vskip4pt}%
  757. % No rule at page bottom unless we print one at the top with @title.
  758. \finishedtitlepagetrue
  759. %
  760. % Now you can put text using @subtitle.
  761. \def\subtitle{\parsearg\subtitlezzz}%
  762. \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}%
  763. %
  764. % @author should come last, but may come many times.
  765. \def\author{\parsearg\authorzzz}%
  766. \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi
  767. {\authorfont \leftline{##1}}}%
  768. %
  769. % Most title ``pages'' are actually two pages long, with space
  770. % at the top of the second. We don't want the ragged left on the second.
  771. \let\oldpage = \page
  772. \def\page{%
  773. \iffinishedtitlepage\else
  774. \finishtitlepage
  775. \fi
  776. \oldpage
  777. \let\page = \oldpage
  778. \hbox{}}%
  779. % \def\page{\oldpage \hbox{}}
  780. }
  781. \def\Etitlepage{%
  782. \iffinishedtitlepage\else
  783. \finishtitlepage
  784. \fi
  785. % It is important to do the page break before ending the group,
  786. % because the headline and footline are only empty inside the group.
  787. % If we use the new definition of \page, we always get a blank page
  788. % after the title page, which we certainly don't want.
  789. \oldpage
  790. \endgroup
  791. \HEADINGSon
  792. }
  793. \def\finishtitlepage{%
  794. \vskip4pt \hrule height 2pt
  795. \vskip\titlepagebottomglue
  796. \finishedtitlepagetrue
  797. }
  798. %%% Set up page headings and footings.
  799. \let\thispage=\folio
  800. \newtoks \evenheadline % Token sequence for heading line of even pages
  801. \newtoks \oddheadline % Token sequence for heading line of odd pages
  802. \newtoks \evenfootline % Token sequence for footing line of even pages
  803. \newtoks \oddfootline % Token sequence for footing line of odd pages
  804. % Now make Tex use those variables
  805. \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
  806. \else \the\evenheadline \fi}}
  807. \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
  808. \else \the\evenfootline \fi}\HEADINGShook}
  809. \let\HEADINGShook=\relax
  810. % Commands to set those variables.
  811. % For example, this is what @headings on does
  812. % @evenheading @thistitle|@thispage|@thischapter
  813. % @oddheading @thischapter|@thispage|@thistitle
  814. % @evenfooting @thisfile||
  815. % @oddfooting ||@thisfile
  816. \def\evenheading{\parsearg\evenheadingxxx}
  817. \def\oddheading{\parsearg\oddheadingxxx}
  818. \def\everyheading{\parsearg\everyheadingxxx}
  819. \def\evenfooting{\parsearg\evenfootingxxx}
  820. \def\oddfooting{\parsearg\oddfootingxxx}
  821. \def\everyfooting{\parsearg\everyfootingxxx}
  822. {\catcode`\@=0 %
  823. \gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish}
  824. \gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{%
  825. \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  826. \gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish}
  827. \gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{%
  828. \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  829. \gdef\everyheadingxxx #1{\everyheadingyyy #1@|@|@|@|\finish}
  830. \gdef\everyheadingyyy #1@|#2@|#3@|#4\finish{%
  831. \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
  832. \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  833. \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish}
  834. \gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{%
  835. \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  836. \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish}
  837. \gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{%
  838. \global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  839. \gdef\everyfootingxxx #1{\everyfootingyyy #1@|@|@|@|\finish}
  840. \gdef\everyfootingyyy #1@|#2@|#3@|#4\finish{%
  841. \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
  842. \global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  843. %
  844. }% unbind the catcode of @.
  845. % @headings double turns headings on for double-sided printing.
  846. % @headings single turns headings on for single-sided printing.
  847. % @headings off turns them off.
  848. % @headings on same as @headings double, retained for compatibility.
  849. % @headings after turns on double-sided headings after this page.
  850. % @headings doubleafter turns on double-sided headings after this page.
  851. % @headings singleafter turns on single-sided headings after this page.
  852. % By default, they are off.
  853. \def\headings #1 {\csname HEADINGS#1\endcsname}
  854. \def\HEADINGSoff{
  855. \global\evenheadline={\hfil} \global\evenfootline={\hfil}
  856. \global\oddheadline={\hfil} \global\oddfootline={\hfil}}
  857. \HEADINGSoff
  858. % When we turn headings on, set the page number to 1.
  859. % For double-sided printing, put current file name in lower left corner,
  860. % chapter name on inside top of right hand pages, document
  861. % title on inside top of left hand pages, and page numbers on outside top
  862. % edge of all pages.
  863. \def\HEADINGSdouble{
  864. %\pagealignmacro
  865. \global\pageno=1
  866. \global\evenfootline={\hfil}
  867. \global\oddfootline={\hfil}
  868. \global\evenheadline={\line{\folio\hfil\thistitle}}
  869. \global\oddheadline={\line{\thischapter\hfil\folio}}
  870. }
  871. % For single-sided printing, chapter title goes across top left of page,
  872. % page number on top right.
  873. \def\HEADINGSsingle{
  874. %\pagealignmacro
  875. \global\pageno=1
  876. \global\evenfootline={\hfil}
  877. \global\oddfootline={\hfil}
  878. \global\evenheadline={\line{\thischapter\hfil\folio}}
  879. \global\oddheadline={\line{\thischapter\hfil\folio}}
  880. }
  881. \def\HEADINGSon{\HEADINGSdouble}
  882. \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
  883. \let\HEADINGSdoubleafter=\HEADINGSafter
  884. \def\HEADINGSdoublex{%
  885. \global\evenfootline={\hfil}
  886. \global\oddfootline={\hfil}
  887. \global\evenheadline={\line{\folio\hfil\thistitle}}
  888. \global\oddheadline={\line{\thischapter\hfil\folio}}
  889. }
  890. \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
  891. \def\HEADINGSsinglex{%
  892. \global\evenfootline={\hfil}
  893. \global\oddfootline={\hfil}
  894. \global\evenheadline={\line{\thischapter\hfil\folio}}
  895. \global\oddheadline={\line{\thischapter\hfil\folio}}
  896. }
  897. % Subroutines used in generating headings
  898. % Produces Day Month Year style of output.
  899. \def\today{\number\day\space
  900. \ifcase\month\or
  901. January\or February\or March\or April\or May\or June\or
  902. July\or August\or September\or October\or November\or December\fi
  903. \space\number\year}
  904. % Use this if you want the Month Day, Year style of output.
  905. %\def\today{\ifcase\month\or
  906. %January\or February\or March\or April\or May\or June\or
  907. %July\or August\or September\or October\or November\or December\fi
  908. %\space\number\day, \number\year}
  909. % @settitle line... specifies the title of the document, for headings
  910. % It generates no output of its own
  911. \def\thistitle{No Title}
  912. \def\settitle{\parsearg\settitlezzz}
  913. \def\settitlezzz #1{\gdef\thistitle{#1}}
  914. \message{tables,}
  915. % @tabs -- simple alignment
  916. % These don't work. For one thing, \+ is defined as outer.
  917. % So these macros cannot even be defined.
  918. %\def\tabs{\parsearg\tabszzz}
  919. %\def\tabszzz #1{\settabs\+#1\cr}
  920. %\def\tabline{\parsearg\tablinezzz}
  921. %\def\tablinezzz #1{\+#1\cr}
  922. %\def\&{&}
  923. % Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
  924. % default indentation of table text
  925. \newdimen\tableindent \tableindent=.8in
  926. % default indentation of @itemize and @enumerate text
  927. \newdimen\itemindent \itemindent=.3in
  928. % margin between end of table item and start of table text.
  929. \newdimen\itemmargin \itemmargin=.1in
  930. % used internally for \itemindent minus \itemmargin
  931. \newdimen\itemmax
  932. % Note @table, @vtable, and @vtable define @item, @itemx, etc., with
  933. % these defs.
  934. % They also define \itemindex
  935. % to index the item name in whatever manner is desired (perhaps none).
  936. \def\internalBitem{\smallbreak \parsearg\itemzzz}
  937. \def\internalBitemx{\par \parsearg\itemzzz}
  938. \def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
  939. \def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \par \parsearg\xitemzzz}
  940. \def\internalBkitem{\smallbreak \parsearg\kitemzzz}
  941. \def\internalBkitemx{\par \parsearg\kitemzzz}
  942. \def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}%
  943. \itemzzz {#1}}
  944. \def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}%
  945. \itemzzz {#1}}
  946. \def\itemzzz #1{\begingroup %
  947. \advance\hsize by -\rightskip
  948. \advance\hsize by -\tableindent
  949. \setbox0=\hbox{\itemfont{#1}}%
  950. \itemindex{#1}%
  951. \nobreak % This prevents a break before @itemx.
  952. %
  953. % Be sure we are not still in the middle of a paragraph.
  954. \parskip=0in
  955. \par
  956. %
  957. % If the item text does not fit in the space we have, put it on a line
  958. % by itself, and do not allow a page break either before or after that
  959. % line. We do not start a paragraph here because then if the next
  960. % command is, e.g., @kindex, the whatsit would get put into the
  961. % horizontal list on a line by itself, resulting in extra blank space.
  962. \ifdim \wd0>\itemmax
  963. \setbox0=\hbox{\hskip \leftskip \hskip -\tableindent \unhbox0}\box0
  964. \nobreak
  965. \else
  966. % The item text fits into the space. Start a paragraph, so that the
  967. % following text (if any) will end up on the same line. Since that
  968. % text will be indented by \tableindent, we make the item text be in
  969. % a zero-width box.
  970. \noindent
  971. \rlap{\hskip -\tableindent\box0}%
  972. \fi
  973. \endgroup
  974. }
  975. \def\item{\errmessage{@item while not in a table}}
  976. \def\itemx{\errmessage{@itemx while not in a table}}
  977. \def\kitem{\errmessage{@kitem while not in a table}}
  978. \def\kitemx{\errmessage{@kitemx while not in a table}}
  979. \def\xitem{\errmessage{@xitem while not in a table}}
  980. \def\xitemx{\errmessage{@xitemx while not in a table}}
  981. %% Contains a kludge to get @end[description] to work
  982. \def\description{\tablez{\dontindex}{1}{}{}{}{}}
  983. \def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
  984. {\obeylines\obeyspaces%
  985. \gdef\tablex #1^^M{%
  986. \tabley\dontindex#1 \endtabley}}
  987. \def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
  988. {\obeylines\obeyspaces%
  989. \gdef\ftablex #1^^M{%
  990. \tabley\fnitemindex#1 \endtabley
  991. \def\Eftable{\endgraf\endgroup\afterenvbreak}%
  992. \let\Etable=\relax}}
  993. \def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex}
  994. {\obeylines\obeyspaces%
  995. \gdef\vtablex #1^^M{%
  996. \tabley\vritemindex#1 \endtabley
  997. \def\Evtable{\endgraf\endgroup\afterenvbreak}%
  998. \let\Etable=\relax}}
  999. \def\dontindex #1{}
  1000. \def\fnitemindex #1{\doind {fn}{\code{#1}}}%
  1001. \def\vritemindex #1{\doind {vr}{\code{#1}}}%
  1002. {\obeyspaces %
  1003. \gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
  1004. \tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
  1005. \def\tablez #1#2#3#4#5#6{%
  1006. \aboveenvbreak %
  1007. \begingroup %
  1008. \def\Edescription{\Etable}% Neccessary kludge.
  1009. \let\itemindex=#1%
  1010. \ifnum 0#3>0 \advance \leftskip by #3\mil \fi %
  1011. \ifnum 0#4>0 \tableindent=#4\mil \fi %
  1012. \ifnum 0#5>0 \advance \rightskip by #5\mil \fi %
  1013. \def\itemfont{#2}%
  1014. \itemmax=\tableindent %
  1015. \advance \itemmax by -\itemmargin %
  1016. \advance \leftskip by \tableindent %
  1017. \exdentamount=\tableindent
  1018. \parindent = 0pt
  1019. \parskip = \smallskipamount
  1020. \ifdim \parskip=0pt \parskip=2pt \fi%
  1021. \def\Etable{\endgraf\endgroup\afterenvbreak}%
  1022. \let\item = \internalBitem %
  1023. \let\itemx = \internalBitemx %
  1024. \let\kitem = \internalBkitem %
  1025. \let\kitemx = \internalBkitemx %
  1026. \let\xitem = \internalBxitem %
  1027. \let\xitemx = \internalBxitemx %
  1028. }
  1029. % This is the counter used by @enumerate, which is really @itemize
  1030. \newcount \itemno
  1031. \def\itemize{\parsearg\itemizezzz}
  1032. \def\itemizezzz #1{%
  1033. \begingroup % ended by the @end itemsize
  1034. \itemizey {#1}{\Eitemize}
  1035. }
  1036. \def\itemizey #1#2{%
  1037. \aboveenvbreak %
  1038. \itemmax=\itemindent %
  1039. \advance \itemmax by -\itemmargin %
  1040. \advance \leftskip by \itemindent %
  1041. \exdentamount=\itemindent
  1042. \parindent = 0pt %
  1043. \parskip = \smallskipamount %
  1044. \ifdim \parskip=0pt \parskip=2pt \fi%
  1045. \def#2{\endgraf\endgroup\afterenvbreak}%
  1046. \def\itemcontents{#1}%
  1047. \let\item=\itemizeitem}
  1048. \def\bullet{$\ptexbullet$}
  1049. \def\minus{$-$}
  1050. % Set sfcode to normal for the chars that usually have another value.
  1051. % These are `.?!:;,'
  1052. \def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000
  1053. \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 }
  1054. % \splitoff TOKENS\endmark defines \first to be the first token in
  1055. % TOKENS, and \rest to be the remainder.
  1056. %
  1057. \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
  1058. % Allow an optional argument of an uppercase letter, lowercase letter,
  1059. % or number, to specify the first label in the enumerated list. No
  1060. % argument is the same as `1'.
  1061. %
  1062. \def\enumerate{\parsearg\enumeratezzz}
  1063. \def\enumeratezzz #1{\enumeratey #1 \endenumeratey}
  1064. \def\enumeratey #1 #2\endenumeratey{%
  1065. \begingroup % ended by the @end enumerate
  1066. %
  1067. % If we were given no argument, pretend we were given `1'.
  1068. \def\thearg{#1}%
  1069. \ifx\thearg\empty \def\thearg{1}\fi
  1070. %
  1071. % Detect if the argument is a single token. If so, it might be a
  1072. % letter. Otherwise, the only valid thing it can be is a number.
  1073. % (We will always have one token, because of the test we just made.
  1074. % This is a good thing, since \splitoff doesn't work given nothing at
  1075. % all -- the first parameter is undelimited.)
  1076. \expandafter\splitoff\thearg\endmark
  1077. \ifx\rest\empty
  1078. % Only one token in the argument. It could still be anything.
  1079. % A ``lowercase letter'' is one whose \lccode is nonzero.
  1080. % An ``uppercase letter'' is one whose \lccode is both nonzero, and
  1081. % not equal to itself.
  1082. % Otherwise, we assume it's a number.
  1083. %
  1084. % We need the \relax at the end of the \ifnum lines to stop TeX from
  1085. % continuing to look for a <number>.
  1086. %
  1087. \ifnum\lccode\expandafter`\thearg=0\relax
  1088. \numericenumerate % a number (we hope)
  1089. \else
  1090. % It's a letter.
  1091. \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
  1092. \lowercaseenumerate % lowercase letter
  1093. \else
  1094. \uppercaseenumerate % uppercase letter
  1095. \fi
  1096. \fi
  1097. \else
  1098. % Multiple tokens in the argument. We hope it's a number.
  1099. \numericenumerate
  1100. \fi
  1101. }
  1102. % An @enumerate whose labels are integers. The starting integer is
  1103. % given in \thearg.
  1104. %
  1105. \def\numericenumerate{%
  1106. \itemno = \thearg
  1107. \startenumeration{\the\itemno}%
  1108. }
  1109. % The starting (lowercase) letter is in \thearg.
  1110. \def\lowercaseenumerate{%
  1111. \itemno = \expandafter`\thearg
  1112. \startenumeration{%
  1113. % Be sure we're not beyond the end of the alphabet.
  1114. \ifnum\itemno=0
  1115. \errmessage{No more lowercase letters in @enumerate; get a bigger
  1116. alphabet}%
  1117. \fi
  1118. \char\lccode\itemno
  1119. }%
  1120. }
  1121. % The starting (uppercase) letter is in \thearg.
  1122. \def\uppercaseenumerate{%
  1123. \itemno = \expandafter`\thearg
  1124. \startenumeration{%
  1125. % Be sure we're not beyond the end of the alphabet.
  1126. \ifnum\itemno=0
  1127. \errmessage{No more uppercase letters in @enumerate; get a bigger
  1128. alphabet}
  1129. \fi
  1130. \char\uccode\itemno
  1131. }%
  1132. }
  1133. % Call itemizey, adding a period to the first argument and supplying the
  1134. % common last two arguments. Also subtract one from the initial value in
  1135. % \itemno, since @item increments \itemno.
  1136. %
  1137. \def\startenumeration#1{%
  1138. \advance\itemno by -1
  1139. \itemizey{#1.}\Eenumerate\flushcr
  1140. }
  1141. % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
  1142. % to @enumerate.
  1143. %
  1144. \def\alphaenumerate{\enumerate{a}}
  1145. \def\capsenumerate{\enumerate{A}}
  1146. \def\Ealphaenumerate{\Eenumerate}
  1147. \def\Ecapsenumerate{\Eenumerate}
  1148. % Definition of @item while inside @itemize.
  1149. \def\itemizeitem{%
  1150. \advance\itemno by 1
  1151. {\let\par=\endgraf \smallbreak}%
  1152. \ifhmode \errmessage{\in hmode at itemizeitem}\fi
  1153. {\parskip=0in \hskip 0pt
  1154. \hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
  1155. \vadjust{\penalty 1200}}%
  1156. \flushcr}
  1157. \message{indexing,}
  1158. % Index generation facilities
  1159. % Define \newwrite to be identical to plain tex's \newwrite
  1160. % except not \outer, so it can be used within \newindex.
  1161. {\catcode`\@=11
  1162. \gdef\newwrite{\alloc@7\write\chardef\sixt@@n}}
  1163. % \newindex {foo} defines an index named foo.
  1164. % It automatically defines \fooindex such that
  1165. % \fooindex ...rest of line... puts an entry in the index foo.
  1166. % It also defines \fooindfile to be the number of the output channel for
  1167. % the file that accumulates this index. The file's extension is foo.
  1168. % The name of an index should be no more than 2 characters long
  1169. % for the sake of vms.
  1170. \def\newindex #1{
  1171. \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
  1172. \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
  1173. \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
  1174. \noexpand\doindex {#1}}
  1175. }
  1176. % @defindex foo == \newindex{foo}
  1177. \def\defindex{\parsearg\newindex}
  1178. % Define @defcodeindex, like @defindex except put all entries in @code.
  1179. \def\newcodeindex #1{
  1180. \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
  1181. \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
  1182. \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
  1183. \noexpand\docodeindex {#1}}
  1184. }
  1185. \def\defcodeindex{\parsearg\newcodeindex}
  1186. % @synindex foo bar makes index foo feed into index bar.
  1187. % Do this instead of @defindex foo if you don't want it as a separate index.
  1188. \def\synindex #1 #2 {%
  1189. \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
  1190. \expandafter\let\csname#1indfile\endcsname=\synindexfoo
  1191. \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
  1192. \noexpand\doindex {#2}}%
  1193. }
  1194. % @syncodeindex foo bar similar, but put all entries made for index foo
  1195. % inside @code.
  1196. \def\syncodeindex #1 #2 {%
  1197. \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
  1198. \expandafter\let\csname#1indfile\endcsname=\synindexfoo
  1199. \expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
  1200. \noexpand\docodeindex {#2}}%
  1201. }
  1202. % Define \doindex, the driver for all \fooindex macros.
  1203. % Argument #1 is generated by the calling \fooindex macro,
  1204. % and it is "foo", the name of the index.
  1205. % \doindex just uses \parsearg; it calls \doind for the actual work.
  1206. % This is because \doind is more useful to call from other macros.
  1207. % There is also \dosubind {index}{topic}{subtopic}
  1208. % which makes an entry in a two-level index such as the operation index.
  1209. \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
  1210. \def\singleindexer #1{\doind{\indexname}{#1}}
  1211. % like the previous two, but they put @code around the argument.
  1212. \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
  1213. \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
  1214. \def\indexdummies{%
  1215. \def\_{{\realbackslash _}}%
  1216. \def\w{\realbackslash w }%
  1217. \def\bf{\realbackslash bf }%
  1218. \def\rm{\realbackslash rm }%
  1219. \def\sl{\realbackslash sl }%
  1220. \def\sf{\realbackslash sf}%
  1221. \def\tt{\realbackslash tt}%
  1222. \def\gtr{\realbackslash gtr}%
  1223. \def\less{\realbackslash less}%
  1224. \def\hat{\realbackslash hat}%
  1225. \def\char{\realbackslash char}%
  1226. \def\TeX{\realbackslash TeX}%
  1227. \def\dots{\realbackslash dots }%
  1228. \def\copyright{\realbackslash copyright }%
  1229. \def\tclose##1{\realbackslash tclose {##1}}%
  1230. \def\code##1{\realbackslash code {##1}}%
  1231. \def\samp##1{\realbackslash samp {##1}}%
  1232. \def\t##1{\realbackslash r {##1}}%
  1233. \def\r##1{\realbackslash r {##1}}%
  1234. \def\i##1{\realbackslash i {##1}}%
  1235. \def\b##1{\realbackslash b {##1}}%
  1236. \def\cite##1{\realbackslash cite {##1}}%
  1237. \def\key##1{\realbackslash key {##1}}%
  1238. \def\file##1{\realbackslash file {##1}}%
  1239. \def\var##1{\realbackslash var {##1}}%
  1240. \def\kbd##1{\realbackslash kbd {##1}}%
  1241. }
  1242. % \indexnofonts no-ops all font-change commands.
  1243. % This is used when outputting the strings to sort the index by.
  1244. \def\indexdummyfont#1{#1}
  1245. \def\indexdummytex{TeX}
  1246. \def\indexdummydots{...}
  1247. \def\indexnofonts{%
  1248. \let\w=\indexdummyfont
  1249. \let\t=\indexdummyfont
  1250. \let\r=\indexdummyfont
  1251. \let\i=\indexdummyfont
  1252. \let\b=\indexdummyfont
  1253. \let\emph=\indexdummyfont
  1254. \let\strong=\indexdummyfont
  1255. \let\cite=\indexdummyfont
  1256. \let\sc=\indexdummyfont
  1257. %Don't no-op \tt, since it isn't a user-level command
  1258. % and is used in the definitions of the active chars like <, >, |...
  1259. %\let\tt=\indexdummyfont
  1260. \let\tclose=\indexdummyfont
  1261. \let\code=\indexdummyfont
  1262. \let\file=\indexdummyfont
  1263. \let\samp=\indexdummyfont
  1264. \let\kbd=\indexdummyfont
  1265. \let\key=\indexdummyfont
  1266. \let\var=\indexdummyfont
  1267. \let\TeX=\indexdummytex
  1268. \let\dots=\indexdummydots
  1269. }
  1270. % To define \realbackslash, we must make \ not be an escape.
  1271. % We must first make another character (@) an escape
  1272. % so we do not become unable to do a definition.
  1273. {\catcode`\@=0 \catcode`\\=\other
  1274. @gdef@realbackslash{\}}
  1275. \let\indexbackslash=0 %overridden during \printindex.
  1276. \def\doind #1#2{%
  1277. {\count10=\lastpenalty %
  1278. {\indexdummies % Must do this here, since \bf, etc expand at this stage
  1279. \escapechar=`\\%
  1280. {\let\folio=0% Expand all macros now EXCEPT \folio
  1281. \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
  1282. % so it will be output as is; and it will print as backslash in the indx.
  1283. %
  1284. % Now process the index-string once, with all font commands turned off,
  1285. % to get the string to sort the index by.
  1286. {\indexnofonts
  1287. \xdef\temp1{#2}%
  1288. }%
  1289. % Now produce the complete index entry. We process the index-string again,
  1290. % this time with font commands expanded, to get what to print in the index.
  1291. \edef\temp{%
  1292. \write \csname#1indfile\endcsname{%
  1293. \realbackslash entry {\temp1}{\folio}{#2}}}%
  1294. \temp }%
  1295. }\penalty\count10}}
  1296. \def\dosubind #1#2#3{%
  1297. {\count10=\lastpenalty %
  1298. {\indexdummies % Must do this here, since \bf, etc expand at this stage
  1299. \escapechar=`\\%
  1300. {\let\folio=0%
  1301. \def\rawbackslashxx{\indexbackslash}%
  1302. %
  1303. % Now process the index-string once, with all font commands turned off,
  1304. % to get the string to sort the index by.
  1305. {\indexnofonts
  1306. \xdef\temp1{#2 #3}%
  1307. }%
  1308. % Now produce the complete index entry. We process the index-string again,
  1309. % this time with font commands expanded, to get what to print in the index.
  1310. \edef\temp{%
  1311. \write \csname#1indfile\endcsname{%
  1312. \realbackslash entry {\temp1}{\folio}{#2}{#3}}}%
  1313. \temp }%
  1314. }\penalty\count10}}
  1315. % The index entry written in the file actually looks like
  1316. % \entry {sortstring}{page}{topic}
  1317. % or
  1318. % \entry {sortstring}{page}{topic}{subtopic}
  1319. % The texindex program reads in these files and writes files
  1320. % containing these kinds of lines:
  1321. % \initial {c}
  1322. % before the first topic whose initial is c
  1323. % \entry {topic}{pagelist}
  1324. % for a topic that is used without subtopics
  1325. % \primary {topic}
  1326. % for the beginning of a topic that is used with subtopics
  1327. % \secondary {subtopic}{pagelist}
  1328. % for each subtopic.
  1329. % Define the user-accessible indexing commands
  1330. % @findex, @vindex, @kindex, @cindex.
  1331. \def\findex {\fnindex}
  1332. \def\kindex {\kyindex}
  1333. \def\cindex {\cpindex}
  1334. \def\vindex {\vrindex}
  1335. \def\tindex {\tpindex}
  1336. \def\pindex {\pgindex}
  1337. \def\cindexsub {\begingroup\obeylines\cindexsub}
  1338. {\obeylines %
  1339. \gdef\cindexsub "#1" #2^^M{\endgroup %
  1340. \dosubind{cp}{#2}{#1}}}
  1341. % Define the macros used in formatting output of the sorted index material.
  1342. % This is what you call to cause a particular index to get printed.
  1343. % Write
  1344. % @unnumbered Function Index
  1345. % @printindex fn
  1346. \def\printindex{\parsearg\doprintindex}
  1347. \def\doprintindex#1{%
  1348. \tex
  1349. \dobreak \chapheadingskip {10000}
  1350. \catcode`\%=\other\catcode`\&=\other\catcode`\#=\other
  1351. \catcode`\$=\other\catcode`\_=\other
  1352. \catcode`\~=\other
  1353. %
  1354. % The following don't help, since the chars were translated
  1355. % when the raw index was written, and their fonts were discarded
  1356. % due to \indexnofonts.
  1357. %\catcode`\"=\active
  1358. %\catcode`\^=\active
  1359. %\catcode`\_=\active
  1360. %\catcode`\|=\active
  1361. %\catcode`\<=\active
  1362. %\catcode`\>=\active
  1363. % %
  1364. \def\indexbackslash{\rawbackslashxx}
  1365. \indexfonts\rm \tolerance=9500 \advance\baselineskip -1pt
  1366. \begindoublecolumns
  1367. %
  1368. % See if the index file exists and is nonempty.
  1369. \openin 1 \jobname.#1s
  1370. \ifeof 1
  1371. % \enddoublecolumns gets confused if there is no text in the index,
  1372. % and it loses the chapter title and the aux file entries for the
  1373. % index. The easiest way to prevent this problem is to make sure
  1374. % there is some text.
  1375. (Index is nonexistent)
  1376. \else
  1377. %
  1378. % If the index file exists but is empty, then \openin leaves \ifeof
  1379. % false. We have to make TeX try to read something from the file, so
  1380. % it can discover if there is anything in it.
  1381. \read 1 to \temp
  1382. \ifeof 1
  1383. (Index is empty)
  1384. \else
  1385. \input \jobname.#1s
  1386. \fi
  1387. \fi
  1388. \closein 1
  1389. \enddoublecolumns
  1390. \Etex
  1391. }
  1392. % These macros are used by the sorted index file itself.
  1393. % Change them to control the appearance of the index.
  1394. % Same as \bigskipamount except no shrink.
  1395. % \balancecolumns gets confused if there is any shrink.
  1396. \newskip\initialskipamount \initialskipamount 12pt plus4pt
  1397. \def\initial #1{%
  1398. {\let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
  1399. \ifdim\lastskip<\initialskipamount
  1400. \removelastskip \penalty-200 \vskip \initialskipamount\fi
  1401. \line{\secbf#1\hfill}\kern 2pt\penalty10000}}
  1402. % This typesets a paragraph consisting of #1, dot leaders, and then #2
  1403. % flush to the right margin. It is used for index and table of contents
  1404. % entries. The paragraph is indented by \leftskip.
  1405. %
  1406. \def\entry #1#2{\begingroup
  1407. %
  1408. % Start a new paragraph if necessary, so our assignments below can't
  1409. % affect previous text.
  1410. \par
  1411. %
  1412. % Do not fill out the last line with white space.
  1413. \parfillskip = 0in
  1414. %
  1415. % No extra space above this paragraph.
  1416. \parskip = 0in
  1417. %
  1418. % Do not prefer a separate line ending with a hyphen to fewer lines.
  1419. \finalhyphendemerits = 0
  1420. %
  1421. % \hangindent is only relevant when the entry text and page number
  1422. % don't both fit on one line. In that case, bob suggests starting the
  1423. % dots pretty far over on the line. Unfortunately, a large
  1424. % indentation looks wrong when the entry text itself is broken across
  1425. % lines. So we use a small indentation and put up with long leaders.
  1426. %
  1427. % \hangafter is reset to 1 (which is the value we want) at the start
  1428. % of each paragraph, so we need not do anything with that.
  1429. \hangindent=2em
  1430. %
  1431. % When the entry text needs to be broken, just fill out the first line
  1432. % with blank space.
  1433. \rightskip = 0pt plus1fil
  1434. %
  1435. % Start a ``paragraph'' for the index entry so the line breaking
  1436. % parameters we've set above will have an effect.
  1437. \noindent
  1438. %
  1439. % Insert the text of the index entry. TeX will do line-breaking on it.
  1440. #1%
  1441. %
  1442. % If we must, put the page number on a line of its own, and fill out
  1443. % this line with blank space. (The \hfil is overwhelmed with the
  1444. % fill leaders glue in \indexdotfill if the page number does fit.)
  1445. \hfil\penalty50
  1446. \null\nobreak\indexdotfill % Have leaders before the page number.
  1447. %
  1448. % The `\ ' here is removed by the implicit \unskip that TeX does as
  1449. % part of (the primitive) \par. Without it, a spurious underfull
  1450. % \hbox ensues.
  1451. \ #2% The page number ends the paragraph.
  1452. \par
  1453. \endgroup}
  1454. % Like \dotfill except takes at least 1 em.
  1455. \def\indexdotfill{\cleaders
  1456. \hbox{$\mathsurround=0pt \mkern1.5mu . \mkern1.5mu$}\hskip 1em plus 1fill}
  1457. \def\primary #1{\line{#1\hfil}}
  1458. \newskip\secondaryindent \secondaryindent=0.5cm
  1459. \def\secondary #1#2{
  1460. {\parfillskip=0in \parskip=0in
  1461. \hangindent =1in \hangafter=1
  1462. \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par
  1463. }}
  1464. %% Define two-column mode, which is used in indexes.
  1465. %% Adapted from the TeXbook, page 416.
  1466. \catcode `\@=11
  1467. \newbox\partialpage
  1468. \newdimen\doublecolumnhsize
  1469. \newdimen\availdimen@
  1470. \def\begindoublecolumns{\begingroup
  1471. % Grab any single-column material above us.
  1472. \output = {\global\setbox\partialpage
  1473. =\vbox{\unvbox255\kern -\topskip \kern \baselineskip}}%
  1474. \eject
  1475. %
  1476. % Now switch to the double-column output routine.
  1477. \output={\doublecolumnout}%
  1478. %
  1479. % Change the page size parameters. We could do this once outside this
  1480. % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
  1481. % format, but then we repeat the same computation. Repeating a couple
  1482. % of assignments once per index is clearly meaningless for the
  1483. % execution time, so we may as well do it once.
  1484. %
  1485. % First we halve the line length, less a little for the gutter between
  1486. % the columns. We compute the gutter based on the line length, so it
  1487. % changes automatically with the paper format. The magic constant
  1488. % below is chosen so that the gutter has the same value (well, +- <
  1489. % 1pt) as it did when we hard-coded it.
  1490. %
  1491. % We put the result in a separate register, \doublecolumhsize, so we
  1492. % can restore it in \pagesofar, after \hsize itself has (potentially)
  1493. % been clobbered.
  1494. %
  1495. \doublecolumnhsize = \hsize
  1496. \advance\doublecolumnhsize by -.04154\hsize
  1497. \divide\doublecolumnhsize by 2
  1498. \hsize = \doublecolumnhsize
  1499. %
  1500. % Double the \vsize as well. (We don't need a separate register here,
  1501. % since nobody clobbers \vsize.)
  1502. \vsize = 2\vsize
  1503. }
  1504. \def\enddoublecolumns{\output={\balancecolumns}\eject
  1505. \endgroup \pagegoal=\vsize}
  1506. \def\doublecolumnout{\splittopskip=\topskip \splitmaxdepth=\maxdepth
  1507. \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage
  1508. \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
  1509. \onepageout\pagesofar \unvbox255 \penalty\outputpenalty}
  1510. \def\pagesofar{\unvbox\partialpage %
  1511. \hsize=\doublecolumnhsize % have to restore this since output routine
  1512. % changes it to set cropmarks (P. A. MacKay, 12 Nov. 1986)
  1513. \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}}
  1514. \def\balancecolumns{%
  1515. % Unset the glue.
  1516. \setbox255=\vbox{\unvbox255}
  1517. \dimen@=\ht255
  1518. \advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip
  1519. \divide\dimen@ by2
  1520. \availdimen@=\pageheight \advance\availdimen@ by-\ht\partialpage
  1521. % If the remaining data is too big for one page,
  1522. % output one page normally, then work with what remains.
  1523. \ifdim \dimen@>\availdimen@
  1524. {
  1525. \splittopskip=\topskip \splitmaxdepth=\maxdepth
  1526. \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage
  1527. \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
  1528. \onepageout\pagesofar
  1529. }
  1530. % Recompute size of what remains, in case we just output some of it.
  1531. \dimen@=\ht255
  1532. \advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip
  1533. \divide\dimen@ by2
  1534. \fi
  1535. \setbox0=\vbox{\unvbox255}
  1536. \splittopskip=\topskip
  1537. {\vbadness=10000 \loop \global\setbox3=\copy0
  1538. \global\setbox1=\vsplit3 to\dimen@
  1539. \ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt \repeat}
  1540. \setbox0=\vbox to\dimen@{\unvbox1} \setbox2=\vbox to\dimen@{\unvbox3}
  1541. \pagesofar}
  1542. \catcode `\@=\other
  1543. \message{sectioning,}
  1544. % Define chapters, sections, etc.
  1545. \newcount \chapno
  1546. \newcount \secno \secno=0
  1547. \newcount \subsecno \subsecno=0
  1548. \newcount \subsubsecno \subsubsecno=0
  1549. % This counter is funny since it counts through charcodes of letters A, B, ...
  1550. \newcount \appendixno \appendixno = `\@
  1551. \def\appendixletter{\char\the\appendixno}
  1552. \newwrite \contentsfile
  1553. % This is called from \setfilename.
  1554. \def\opencontents{\openout \contentsfile = \jobname.toc}
  1555. % Each @chapter defines this as the name of the chapter.
  1556. % page headings and footings can use it. @section does likewise
  1557. \def\thischapter{} \def\thissection{}
  1558. \def\seccheck#1{\if \pageno<0 %
  1559. \errmessage{@#1 not allowed after generating table of contents}\fi
  1560. %
  1561. }
  1562. \def\chapternofonts{%
  1563. \let\rawbackslash=\relax%
  1564. \let\frenchspacing=\relax%
  1565. \def\result{\realbackslash result}
  1566. \def\equiv{\realbackslash equiv}
  1567. \def\expansion{\realbackslash expansion}
  1568. \def\print{\realbackslash print}
  1569. \def\TeX{\realbackslash TeX}
  1570. \def\dots{\realbackslash dots}
  1571. \def\copyright{\realbackslash copyright}
  1572. \def\tt{\realbackslash tt}
  1573. \def\bf{\realbackslash bf }
  1574. \def\w{\realbackslash w}
  1575. \def\less{\realbackslash less}
  1576. \def\gtr{\realbackslash gtr}
  1577. \def\hat{\realbackslash hat}
  1578. \def\char{\realbackslash char}
  1579. \def\tclose##1{\realbackslash tclose {##1}}
  1580. \def\code##1{\realbackslash code {##1}}
  1581. \def\samp##1{\realbackslash samp {##1}}
  1582. \def\r##1{\realbackslash r {##1}}
  1583. \def\b##1{\realbackslash b {##1}}
  1584. \def\key##1{\realbackslash key {##1}}
  1585. \def\file##1{\realbackslash file {##1}}
  1586. \def\kbd##1{\realbackslash kbd {##1}}
  1587. % These are redefined because @smartitalic wouldn't work inside xdef.
  1588. \def\i##1{\realbackslash i {##1}}
  1589. \def\cite##1{\realbackslash cite {##1}}
  1590. \def\var##1{\realbackslash var {##1}}
  1591. \def\emph##1{\realbackslash emph {##1}}
  1592. \def\dfn##1{\realbackslash dfn {##1}}
  1593. }
  1594. \def\thischaptername{No Chapter Title}
  1595. \outer\def\chapter{\parsearg\chapterzzz}
  1596. \def\chapterzzz #1{\seccheck{chapter}%
  1597. \secno=0 \subsecno=0 \subsubsecno=0
  1598. \global\advance \chapno by 1 \message{Chapter \the\chapno}%
  1599. \chapmacro {#1}{\the\chapno}%
  1600. \gdef\thissection{#1}%
  1601. \gdef\thischaptername{#1}%
  1602. % We don't substitute the actual chapter name into \thischapter
  1603. % because we don't want its macros evaluated now.
  1604. \xdef\thischapter{Chapter \the\chapno: \noexpand\thischaptername}%
  1605. {\chapternofonts%
  1606. \edef\temp{{\realbackslash chapentry {#1}{\the\chapno}{\noexpand\folio}}}%
  1607. \escapechar=`\\%
  1608. \write \contentsfile \temp %
  1609. \donoderef %
  1610. \global\let\section = \numberedsec
  1611. \global\let\subsection = \numberedsubsec
  1612. \global\let\subsubsection = \numberedsubsubsec
  1613. }}
  1614. \outer\def\appendix{\parsearg\appendixzzz}
  1615. \def\appendixzzz #1{\seccheck{appendix}%
  1616. \secno=0 \subsecno=0 \subsubsecno=0
  1617. \global\advance \appendixno by 1 \message{Appendix \appendixletter}%
  1618. \chapmacro {#1}{Appendix \appendixletter}%
  1619. \gdef\thissection{#1}%
  1620. \gdef\thischaptername{#1}%
  1621. \xdef\thischapter{Appendix \appendixletter: \noexpand\thischaptername}%
  1622. {\chapternofonts%
  1623. \edef\temp{{\realbackslash chapentry
  1624. {#1}{Appendix \appendixletter}{\noexpand\folio}}}%
  1625. \escapechar=`\\%
  1626. \write \contentsfile \temp %
  1627. \appendixnoderef %
  1628. \global\let\section = \appendixsec
  1629. \global\let\subsection = \appendixsubsec
  1630. \global\let\subsubsection = \appendixsubsubsec
  1631. }}
  1632. \outer\def\top{\parsearg\unnumberedzzz}
  1633. \outer\def\unnumbered{\parsearg\unnumberedzzz}
  1634. \def\unnumberedzzz #1{\seccheck{unnumbered}%
  1635. \secno=0 \subsecno=0 \subsubsecno=0
  1636. %
  1637. % If we just use `#1' in the message, it is fully expanded -- and so if
  1638. % it contains @-commands, they will be expanded, and this is not at all
  1639. % what we want. TeX expands \the\toks only once.
  1640. \toks0 = {#1}\message{(\the\toks0)}%
  1641. %
  1642. \unnumbchapmacro {#1}%
  1643. \gdef\thischapter{#1}\gdef\thissection{#1}%
  1644. {\chapternofonts%
  1645. \edef\temp{{\realbackslash unnumbchapentry {#1}{\noexpand\folio}}}%
  1646. \escapechar=`\\%
  1647. \write \contentsfile \temp %
  1648. \unnumbnoderef %
  1649. \global\let\section = \unnumberedsec
  1650. \global\let\subsection = \unnumberedsubsec
  1651. \global\let\subsubsection = \unnumberedsubsubsec
  1652. }}
  1653. \outer\def\numberedsec{\parsearg\seczzz}
  1654. \def\seczzz #1{\seccheck{section}%
  1655. \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
  1656. \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
  1657. {\chapternofonts%
  1658. \edef\temp{{\realbackslash secentry %
  1659. {#1}{\the\chapno}{\the\secno}{\noexpand\folio}}}%
  1660. \escapechar=`\\%
  1661. \write \contentsfile \temp %
  1662. \donoderef %
  1663. \penalty 10000 %
  1664. }}
  1665. \outer\def\appendixsection{\parsearg\appendixsectionzzz}
  1666. \outer\def\appendixsec{\parsearg\appendixsectionzzz}
  1667. \def\appendixsectionzzz #1{\seccheck{appendixsection}%
  1668. \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
  1669. \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
  1670. {\chapternofonts%
  1671. \edef\temp{{\realbackslash secentry %
  1672. {#1}{\appendixletter}{\the\secno}{\noexpand\folio}}}%
  1673. \escapechar=`\\%
  1674. \write \contentsfile \temp %
  1675. \appendixnoderef %
  1676. \penalty 10000 %
  1677. }}
  1678. \outer\def\unnumberedsec{\parsearg\unnumberedseczzz}
  1679. \def\unnumberedseczzz #1{\seccheck{unnumberedsec}%
  1680. \plainsecheading {#1}\gdef\thissection{#1}%
  1681. {\chapternofonts%
  1682. \edef\temp{{\realbackslash unnumbsecentry{#1}{\noexpand\folio}}}%
  1683. \escapechar=`\\%
  1684. \write \contentsfile \temp %
  1685. \unnumbnoderef %
  1686. \penalty 10000 %
  1687. }}
  1688. \outer\def\numberedsubsec{\parsearg\numberedsubseczzz}
  1689. \def\numberedsubseczzz #1{\seccheck{subsection}%
  1690. \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
  1691. \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
  1692. {\chapternofonts%
  1693. \edef\temp{{\realbackslash subsecentry %
  1694. {#1}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
  1695. \escapechar=`\\%
  1696. \write \contentsfile \temp %
  1697. \donoderef %
  1698. \penalty 10000 %
  1699. }}
  1700. \outer\def\appendixsubsec{\parsearg\appendixsubseczzz}
  1701. \def\appendixsubseczzz #1{\seccheck{appendixsubsec}%
  1702. \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
  1703. \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
  1704. {\chapternofonts%
  1705. \edef\temp{{\realbackslash subsecentry %
  1706. {#1}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
  1707. \escapechar=`\\%
  1708. \write \contentsfile \temp %
  1709. \appendixnoderef %
  1710. \penalty 10000 %
  1711. }}
  1712. \outer\def\unnumberedsubsec{\parsearg\unnumberedsubseczzz}
  1713. \def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}%
  1714. \plainsecheading {#1}\gdef\thissection{#1}%
  1715. {\chapternofonts%
  1716. \edef\temp{{\realbackslash unnumbsubsecentry{#1}{\noexpand\folio}}}%
  1717. \escapechar=`\\%
  1718. \write \contentsfile \temp %
  1719. \unnumbnoderef %
  1720. \penalty 10000 %
  1721. }}
  1722. \outer\def\numberedsubsubsec{\parsearg\numberedsubsubseczzz}
  1723. \def\numberedsubsubseczzz #1{\seccheck{subsubsection}%
  1724. \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
  1725. \subsubsecheading {#1}
  1726. {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
  1727. {\chapternofonts%
  1728. \edef\temp{{\realbackslash subsubsecentry %
  1729. {#1}
  1730. {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}
  1731. {\noexpand\folio}}}%
  1732. \escapechar=`\\%
  1733. \write \contentsfile \temp %
  1734. \donoderef %
  1735. \penalty 10000 %
  1736. }}
  1737. \outer\def\appendixsubsubsec{\parsearg\appendixsubsubseczzz}
  1738. \def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec}%
  1739. \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
  1740. \subsubsecheading {#1}
  1741. {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
  1742. {\chapternofonts%
  1743. \edef\temp{{\realbackslash subsubsecentry{#1}%
  1744. {\appendixletter}
  1745. {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}%
  1746. \escapechar=`\\%
  1747. \write \contentsfile \temp %
  1748. \appendixnoderef %
  1749. \penalty 10000 %
  1750. }}
  1751. \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
  1752. \def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}%
  1753. \plainsecheading {#1}\gdef\thissection{#1}%
  1754. {\chapternofonts%
  1755. \edef\temp{{\realbackslash unnumbsubsubsecentry{#1}{\noexpand\folio}}}%
  1756. \escapechar=`\\%
  1757. \write \contentsfile \temp %
  1758. \unnumbnoderef %
  1759. \penalty 10000 %
  1760. }}
  1761. % These are variants which are not "outer", so they can appear in @ifinfo.
  1762. % Actually, they should now be obsolete; ordinary section commands should work.
  1763. \def\infotop{\parsearg\unnumberedzzz}
  1764. \def\infounnumbered{\parsearg\unnumberedzzz}
  1765. \def\infounnumberedsec{\parsearg\unnumberedseczzz}
  1766. \def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz}
  1767. \def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
  1768. \def\infoappendix{\parsearg\appendixzzz}
  1769. \def\infoappendixsec{\parsearg\appendixseczzz}
  1770. \def\infoappendixsubsec{\parsearg\appendixsubseczzz}
  1771. \def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz}
  1772. \def\infochapter{\parsearg\chapterzzz}
  1773. \def\infosection{\parsearg\sectionzzz}
  1774. \def\infosubsection{\parsearg\subsectionzzz}
  1775. \def\infosubsubsection{\parsearg\subsubsectionzzz}
  1776. % These macros control what the section commands do, according
  1777. % to what kind of chapter we are in (ordinary, appendix, or unnumbered).
  1778. % Define them by default for a numbered chapter.
  1779. \global\let\section = \numberedsec
  1780. \global\let\subsection = \numberedsubsec
  1781. \global\let\subsubsection = \numberedsubsubsec
  1782. % Define @majorheading, @heading and @subheading
  1783. % NOTE on use of \vbox for chapter headings, section headings, and
  1784. % such:
  1785. % 1) We use \vbox rather than the earlier \line to permit
  1786. % overlong headings to fold.
  1787. % 2) \hyphenpenalty is set to 10000 because hyphenation in a
  1788. % heading is obnoxious; this forbids it.
  1789. % 3) Likewise, headings look best if no \parindent is used, and
  1790. % if justification is not attempted. Hence \raggedright.
  1791. \def\majorheading{\parsearg\majorheadingzzz}
  1792. \def\majorheadingzzz #1{%
  1793. {\advance\chapheadingskip by 10pt \chapbreak }%
  1794. {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  1795. \parindent=0pt\raggedright
  1796. \rm #1\hfill}}\bigskip \par\penalty 200}
  1797. \def\chapheading{\parsearg\chapheadingzzz}
  1798. \def\chapheadingzzz #1{\chapbreak %
  1799. {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  1800. \parindent=0pt\raggedright
  1801. \rm #1\hfill}}\bigskip \par\penalty 200}
  1802. \def\heading{\parsearg\secheadingi}
  1803. \def\subheading{\parsearg\subsecheadingi}
  1804. \def\subsubheading{\parsearg\subsubsecheadingi}
  1805. % These macros generate a chapter, section, etc. heading only
  1806. % (including whitespace, linebreaking, etc. around it),
  1807. % given all the information in convenient, parsed form.
  1808. %%% Args are the skip and penalty (usually negative)
  1809. \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
  1810. \def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
  1811. %%% Define plain chapter starts, and page on/off switching for it
  1812. % Parameter controlling skip before chapter headings (if needed)
  1813. \newskip \chapheadingskip \chapheadingskip = 30pt plus 8pt minus 4pt
  1814. \def\chapbreak{\dobreak \chapheadingskip {-4000}}
  1815. \def\chappager{\par\vfill\supereject}
  1816. \def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi}
  1817. \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
  1818. \def\CHAPPAGoff{
  1819. \global\let\pchapsepmacro=\chapbreak
  1820. \global\let\pagealignmacro=\chappager}
  1821. \def\CHAPPAGon{
  1822. \global\let\pchapsepmacro=\chappager
  1823. \global\let\pagealignmacro=\chappager
  1824. \global\def\HEADINGSon{\HEADINGSsingle}}
  1825. \def\CHAPPAGodd{
  1826. \global\let\pchapsepmacro=\chapoddpage
  1827. \global\let\pagealignmacro=\chapoddpage
  1828. \global\def\HEADINGSon{\HEADINGSdouble}}
  1829. \CHAPPAGon
  1830. \def\CHAPFplain{
  1831. \global\let\chapmacro=\chfplain
  1832. \global\let\unnumbchapmacro=\unnchfplain}
  1833. \def\chfplain #1#2{%
  1834. \pchapsepmacro
  1835. {%
  1836. \chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  1837. \parindent=0pt\raggedright
  1838. \rm #2\enspace #1}%
  1839. }%
  1840. \bigskip
  1841. \penalty5000
  1842. }
  1843. \def\unnchfplain #1{%
  1844. \pchapsepmacro %
  1845. {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  1846. \parindent=0pt\raggedright
  1847. \rm #1\hfill}}\bigskip \par\penalty 10000 %
  1848. }
  1849. \CHAPFplain % The default
  1850. \def\unnchfopen #1{%
  1851. \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  1852. \parindent=0pt\raggedright
  1853. \rm #1\hfill}}\bigskip \par\penalty 10000 %
  1854. }
  1855. \def\chfopen #1#2{\chapoddpage {\chapfonts
  1856. \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
  1857. \par\penalty 5000 %
  1858. }
  1859. \def\CHAPFopen{
  1860. \global\let\chapmacro=\chfopen
  1861. \global\let\unnumbchapmacro=\unnchfopen}
  1862. % Parameter controlling skip before section headings.
  1863. \newskip \subsecheadingskip \subsecheadingskip = 17pt plus 8pt minus 4pt
  1864. \def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}}
  1865. \newskip \secheadingskip \secheadingskip = 21pt plus 8pt minus 4pt
  1866. \def\secheadingbreak{\dobreak \secheadingskip {-1000}}
  1867. % @paragraphindent is defined for the Info formatting commands only.
  1868. \let\paragraphindent=\comment
  1869. % Section fonts are the base font at magstep2, which produces
  1870. % a size a bit more than 14 points in the default situation.
  1871. \def\secheading #1#2#3{\secheadingi {#2.#3\enspace #1}}
  1872. \def\plainsecheading #1{\secheadingi {#1}}
  1873. \def\secheadingi #1{{\advance \secheadingskip by \parskip %
  1874. \secheadingbreak}%
  1875. {\secfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  1876. \parindent=0pt\raggedright
  1877. \rm #1\hfill}}%
  1878. \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 }
  1879. % Subsection fonts are the base font at magstep1,
  1880. % which produces a size of 12 points.
  1881. \def\subsecheading #1#2#3#4{\subsecheadingi {#2.#3.#4\enspace #1}}
  1882. \def\subsecheadingi #1{{\advance \subsecheadingskip by \parskip %
  1883. \subsecheadingbreak}%
  1884. {\subsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  1885. \parindent=0pt\raggedright
  1886. \rm #1\hfill}}%
  1887. \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 }
  1888. \def\subsubsecfonts{\subsecfonts} % Maybe this should change:
  1889. % Perhaps make sssec fonts scaled
  1890. % magstep half
  1891. \def\subsubsecheading #1#2#3#4#5{\subsubsecheadingi {#2.#3.#4.#5\enspace #1}}
  1892. \def\subsubsecheadingi #1{{\advance \subsecheadingskip by \parskip %
  1893. \subsecheadingbreak}%
  1894. {\subsubsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  1895. \parindent=0pt\raggedright
  1896. \rm #1\hfill}}%
  1897. \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000}
  1898. \message{toc printing,}
  1899. % Finish up the main text and prepare to read what we've written
  1900. % to \contentsfile.
  1901. \newskip\contentsrightmargin \contentsrightmargin=1in
  1902. \def\startcontents#1{%
  1903. \pagealignmacro
  1904. \immediate\closeout \contentsfile
  1905. \ifnum \pageno>0
  1906. \pageno = -1 % Request roman numbered pages.
  1907. \fi
  1908. % Don't need to put `Contents' or `Short Contents' in the headline.
  1909. % It is abundantly clear what they are.
  1910. \unnumbchapmacro{#1}\def\thischapter{}%
  1911. \begingroup % Set up to handle contents files properly.
  1912. \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11
  1913. \raggedbottom % Worry more about breakpoints than the bottom.
  1914. \advance\hsize by -\contentsrightmargin % Don't use the full line length.
  1915. }
  1916. % Normal (long) toc.
  1917. \outer\def\contents{%
  1918. \startcontents{Table of Contents}%
  1919. \input \jobname.toc
  1920. \endgroup
  1921. \vfill \eject
  1922. }
  1923. % And just the chapters.
  1924. \outer\def\summarycontents{%
  1925. \startcontents{Short Contents}%
  1926. %
  1927. \let\chapentry = \shortchapentry
  1928. \let\unnumbchapentry = \shortunnumberedentry
  1929. % We want a true roman here for the page numbers.
  1930. \secfonts
  1931. \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl
  1932. \rm
  1933. \advance\baselineskip by 1pt % Open it up a little.
  1934. \def\secentry ##1##2##3##4{}
  1935. \def\unnumbsecentry ##1##2{}
  1936. \def\subsecentry ##1##2##3##4##5{}
  1937. \def\unnumbsubsecentry ##1##2{}
  1938. \def\subsubsecentry ##1##2##3##4##5##6{}
  1939. \def\unnumbsubsubsecentry ##1##2{}
  1940. \input \jobname.toc
  1941. \endgroup
  1942. \vfill \eject
  1943. }
  1944. \let\shortcontents = \summarycontents
  1945. % These macros generate individual entries in the table of contents.
  1946. % The first argument is the chapter or section name.
  1947. % The last argument is the page number.
  1948. % The arguments in between are the chapter number, section number, ...
  1949. % Chapter-level things, for both the long and short contents.
  1950. \def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}
  1951. % See comments in \dochapentry re vbox and related settings
  1952. \def\shortchapentry#1#2#3{%
  1953. \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno{#3}}%
  1954. }
  1955. % Typeset the label for a chapter or appendix for the short contents.
  1956. % The arg is, e.g. `Appendix A' for an appendix, or `3' for a chapter.
  1957. % We could simplify the code here by writing out an \appendixentry
  1958. % command in the toc file for appendices, instead of using \chapentry
  1959. % for both, but it doesn't seem worth it.
  1960. \setbox0 = \hbox{\shortcontrm Appendix }
  1961. \newdimen\shortappendixwidth \shortappendixwidth = \wd0
  1962. \def\shortchaplabel#1{%
  1963. % We typeset #1 in a box of constant width, regardless of the text of
  1964. % #1, so the chapter titles will come out aligned.
  1965. \setbox0 = \hbox{#1}%
  1966. \dimen0 = \ifdim\wd0 > \shortappendixwidth \shortappendixwidth \else 0pt \fi
  1967. %
  1968. % This space should be plenty, since a single number is .5em, and the
  1969. % widest letter (M) is 1em, at least in the Computer Modern fonts.
  1970. % (This space doesn't include the extra space that gets added after
  1971. % the label; that gets put in in \shortchapentry above.)
  1972. \advance\dimen0 by 1.1em
  1973. \hbox to \dimen0{#1\hfil}%
  1974. }
  1975. \def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
  1976. \def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno{#2}}}
  1977. % Sections.
  1978. \def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}}
  1979. \def\unnumbsecentry#1#2{\dosecentry{#1}{#2}}
  1980. % Subsections.
  1981. \def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}}
  1982. \def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}}
  1983. % And subsubsections.
  1984. \def\subsubsecentry#1#2#3#4#5#6{%
  1985. \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}}
  1986. \def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}}
  1987. % This parameter controls the indentation of the various levels.
  1988. \newdimen\tocindent \tocindent = 3pc
  1989. % Now for the actual typesetting. In all these, #1 is the text and #2 is the
  1990. % page number.
  1991. %
  1992. % If the toc has to be broken over pages, we would want to be at chapters
  1993. % if at all possible; hence the \penalty.
  1994. \def\dochapentry#1#2{%
  1995. \penalty-300 \vskip\baselineskip
  1996. \begingroup
  1997. \chapentryfonts
  1998. \tocentry{#1}{\dopageno{#2}}%
  1999. \endgroup
  2000. \nobreak\vskip .25\baselineskip
  2001. }
  2002. \def\dosecentry#1#2{\begingroup
  2003. \secentryfonts \leftskip=\tocindent
  2004. \tocentry{#1}{\dopageno{#2}}%
  2005. \endgroup}
  2006. \def\dosubsecentry#1#2{\begingroup
  2007. \subsecentryfonts \leftskip=2\tocindent
  2008. \tocentry{#1}{\dopageno{#2}}%
  2009. \endgroup}
  2010. \def\dosubsubsecentry#1#2{\begingroup
  2011. \subsubsecentryfonts \leftskip=3\tocindent
  2012. \tocentry{#1}{\dopageno{#2}}%
  2013. \endgroup}
  2014. % Final typesetting of a toc entry; we use the same \entry macro as for
  2015. % the index entries, but we want to suppress hyphenation here. (We
  2016. % can't do that in the \entry macro, since index entries might consist
  2017. % of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.)
  2018. %
  2019. \def\tocentry#1#2{\begingroup
  2020. \hyphenpenalty = 10000
  2021. \entry{#1}{#2}%
  2022. \endgroup}
  2023. % Space between chapter (or whatever) number and the title.
  2024. \def\labelspace{\hskip1em \relax}
  2025. \def\dopageno#1{{\rm #1}}
  2026. \def\doshortpageno#1{{\rm #1}}
  2027. \def\chapentryfonts{\secfonts \rm}
  2028. \def\secentryfonts{\textfonts}
  2029. \let\subsecentryfonts = \textfonts
  2030. \let\subsubsecentryfonts = \textfonts
  2031. \message{environments,}
  2032. % Since these characters are used in examples, it should be an even number of
  2033. % \tt widths. Each \tt character is 1en, so two makes it 1em.
  2034. % Furthermore, these definitions must come after we define our fonts.
  2035. \newbox\dblarrowbox \newbox\longdblarrowbox
  2036. \newbox\pushcharbox \newbox\bullbox
  2037. \newbox\equivbox \newbox\errorbox
  2038. \let\ptexequiv = \equiv
  2039. %{\tentt
  2040. %\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil}
  2041. %\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil}
  2042. %\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil}
  2043. %\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil}
  2044. % Adapted from the manmac format (p.420 of TeXbook)
  2045. %\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex
  2046. % depth .1ex\hfil}
  2047. %}
  2048. \def\point{$\star$}
  2049. \def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
  2050. \def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}}
  2051. \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
  2052. \def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}}
  2053. % Adapted from the TeXbook's \boxit.
  2054. {\tentt \global\dimen0 = 3em}% Width of the box.
  2055. \dimen2 = .55pt % Thickness of rules
  2056. % The text. (`r' is open on the right, `e' somewhat less so on the left.)
  2057. \setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt}
  2058. \global\setbox\errorbox=\hbox to \dimen0{\hfil
  2059. \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
  2060. \advance\hsize by -2\dimen2 % Rules.
  2061. \vbox{
  2062. \hrule height\dimen2
  2063. \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
  2064. \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
  2065. \kern3pt\vrule width\dimen2}% Space to right.
  2066. \hrule height\dimen2}
  2067. \hfil}
  2068. % The @error{} command.
  2069. \def\error{\leavevmode\lower.7ex\copy\errorbox}
  2070. % @tex ... @end tex escapes into raw Tex temporarily.
  2071. % One exception: @ is still an escape character, so that @end tex works.
  2072. % But \@ or @@ will get a plain tex @ character.
  2073. \def\tex{\begingroup
  2074. \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
  2075. \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
  2076. \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
  2077. \catcode `\%=14
  2078. \catcode 43=12
  2079. \catcode`\"=12
  2080. \catcode`\==12
  2081. \catcode`\|=12
  2082. \catcode`\<=12
  2083. \catcode`\>=12
  2084. \escapechar=`\\
  2085. %
  2086. \let\{=\ptexlbrace
  2087. \let\}=\ptexrbrace
  2088. \let\.=\ptexdot
  2089. \let\*=\ptexstar
  2090. \let\dots=\ptexdots
  2091. \def\@{@}%
  2092. \let\bullet=\ptexbullet
  2093. \let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext \let\l=\ptexl
  2094. \let\L=\ptexL
  2095. %
  2096. \let\Etex=\endgroup}
  2097. % Define @lisp ... @endlisp.
  2098. % @lisp does a \begingroup so it can rebind things,
  2099. % including the definition of @endlisp (which normally is erroneous).
  2100. % Amount to narrow the margins by for @lisp.
  2101. \newskip\lispnarrowing \lispnarrowing=0.4in
  2102. % This is the definition that ^M gets inside @lisp
  2103. % phr: changed space to \null, to avoid overfull hbox problems.
  2104. {\obeyspaces%
  2105. \gdef\lisppar{\null\endgraf}}
  2106. % Cause \obeyspaces to make each Space cause a word-separation
  2107. % rather than the default which is that it acts punctuation.
  2108. % This is because space in tt font looks funny.
  2109. {\obeyspaces %
  2110. \gdef\sepspaces{\def {\ }}}
  2111. % This space is always present above and below environments.
  2112. \newskip\envskipamount \envskipamount = 0pt
  2113. % Make spacing and below environment symmetrical.
  2114. \def\aboveenvbreak{{\advance\envskipamount by \parskip
  2115. \endgraf \ifdim\lastskip<\envskipamount
  2116. \removelastskip \penalty-50 \vskip\envskipamount \fi}}
  2117. \let\afterenvbreak = \aboveenvbreak
  2118. % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins.
  2119. \let\nonarrowing=\relax
  2120. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2121. % \cartouche: draw rectangle w/rounded corners around argument
  2122. \font\circle=lcircle10
  2123. \newdimen\circthick
  2124. \newdimen\cartouter\newdimen\cartinner
  2125. \newskip\normbskip\newskip\normpskip\newskip\normlskip
  2126. \circthick=\fontdimen8\circle
  2127. %
  2128. \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
  2129. \def\ctr{{\hskip 6pt\circle\char'010}}
  2130. \def\cbl{{\circle\char'012\hskip -6pt}}
  2131. \def\cbr{{\hskip 6pt\circle\char'011}}
  2132. \def\carttop{\hbox to \cartouter{\hskip\lskip
  2133. \ctl\leaders\hrule height\circthick\hfil\ctr
  2134. \hskip\rskip}}
  2135. \def\cartbot{\hbox to \cartouter{\hskip\lskip
  2136. \cbl\leaders\hrule height\circthick\hfil\cbr
  2137. \hskip\rskip}}
  2138. %
  2139. \newskip\lskip\newskip\rskip
  2140. \long\def\cartouche{%
  2141. \begingroup
  2142. \lskip=\leftskip \rskip=\rightskip
  2143. \leftskip=0pt\rightskip=0pt %we want these *outside*.
  2144. \cartinner=\hsize \advance\cartinner by-\lskip
  2145. \advance\cartinner by-\rskip
  2146. \cartouter=\hsize
  2147. \advance\cartouter by 18pt % allow for 3pt kerns on either
  2148. % side, and for 6pt waste from
  2149. % each corner char
  2150. \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
  2151. % Flag to tell @lisp, etc., not to narrow margin.
  2152. \let\nonarrowing=\comment
  2153. \vbox\bgroup
  2154. \baselineskip=0pt\parskip=0pt\lineskip=0pt
  2155. \carttop
  2156. \hbox\bgroup
  2157. \hskip\lskip
  2158. \vrule\kern3pt
  2159. \vbox\bgroup
  2160. \hsize=\cartinner
  2161. \kern3pt
  2162. \begingroup
  2163. \baselineskip=\normbskip
  2164. \lineskip=\normlskip
  2165. \parskip=\normpskip
  2166. \vskip -\parskip
  2167. \def\Ecartouche{%
  2168. \endgroup
  2169. \kern3pt
  2170. \egroup
  2171. \kern3pt\vrule
  2172. \hskip\rskip
  2173. \egroup
  2174. \cartbot
  2175. \egroup
  2176. \endgroup
  2177. }}
  2178. \def\lisp{\aboveenvbreak
  2179. \begingroup\inENV % This group ends at the end of the @lisp body
  2180. \hfuzz=12truept % Don't be fussy
  2181. % Make spaces be word-separators rather than space tokens.
  2182. \sepspaces %
  2183. % Single space lines
  2184. \singlespace %
  2185. % The following causes blank lines not to be ignored
  2186. % by adding a space to the end of each line.
  2187. \let\par=\lisppar
  2188. \def\Elisp{\endgroup\afterenvbreak}%
  2189. \parskip=0pt
  2190. % @cartouche defines \nonarrowing to inhibit narrowing
  2191. % at next level down.
  2192. \ifx\nonarrowing\relax
  2193. \advance \leftskip by \lispnarrowing
  2194. \exdentamount=\lispnarrowing
  2195. \let\exdent=\nofillexdent
  2196. \let\nonarrowing=\relax
  2197. \fi
  2198. \parindent=0pt
  2199. \obeyspaces \obeylines \tt \rawbackslash
  2200. \gobble
  2201. }
  2202. % Define the \E... control sequence only if we are inside the
  2203. % environment, so the error checking in \end will work.
  2204. %
  2205. % We must call \lisp last in the definition, since it reads the
  2206. % return following the @example (or whatever) command.
  2207. %
  2208. \def\example{\begingroup \def\Eexample{\Elisp\endgroup}\lisp}
  2209. \def\smallexample{\begingroup \def\Esmallexample{\Elisp\endgroup}\lisp}
  2210. % Macro for 9 pt. examples, necessary to print with 5" lines.
  2211. % From Pavel@xerox. This is not really used unless the
  2212. % @smallbook command is given.
  2213. \def\smalllispx{\aboveenvbreak\begingroup\inENV
  2214. % This group ends at the end of the @lisp body
  2215. \hfuzz=12truept % Don't be fussy
  2216. % Make spaces be word-separators rather than space tokens.
  2217. \sepspaces %
  2218. % Single space lines
  2219. \singlespace %
  2220. % The following causes blank lines not to be ignored
  2221. % by adding a space to the end of each line.
  2222. \let\par=\lisppar
  2223. \def\Esmalllisp{\endgroup\afterenvbreak}%
  2224. %%%% Smaller baseline skip for small examples.
  2225. \baselineskip 10pt
  2226. \parskip=0pt
  2227. % @cartouche defines \nonarrowing to inhibit narrowing
  2228. % at next level down.
  2229. \ifx\nonarrowing\relax
  2230. \advance \leftskip by \lispnarrowing
  2231. \exdentamount=\lispnarrowing
  2232. \let\exdent=\nofillexdent
  2233. \let\nonarrowing=\relax
  2234. \fi
  2235. \parindent=0pt
  2236. \obeyspaces \obeylines \ninett \indexfonts \rawbackslash
  2237. \def\next##1{}\next}
  2238. % This is @display; same as @lisp except use roman font.
  2239. \def\display{\begingroup\inENV %This group ends at the end of the @display body
  2240. \aboveenvbreak
  2241. % Make spaces be word-separators rather than space tokens.
  2242. \sepspaces %
  2243. % Single space lines
  2244. \singlespace %
  2245. % The following causes blank lines not to be ignored
  2246. % by adding a space to the end of each line.
  2247. \let\par=\lisppar
  2248. \def\Edisplay{\endgroup\afterenvbreak}%
  2249. \parskip=0pt
  2250. % @cartouche defines \nonarrowing to inhibit narrowing
  2251. % at next level down.
  2252. \ifx\nonarrowing\relax
  2253. \advance \leftskip by \lispnarrowing
  2254. \exdentamount=\lispnarrowing
  2255. \let\exdent=\nofillexdent
  2256. \let\nonarrowing=\relax
  2257. \fi
  2258. \parindent=0pt
  2259. \obeyspaces \obeylines
  2260. \def\next##1{}\next}
  2261. % This is @format; same as @lisp except use roman font and don't narrow margins
  2262. \def\format{\begingroup\inENV %This group ends at the end of the @format body
  2263. \aboveenvbreak
  2264. % Make spaces be word-separators rather than space tokens.
  2265. \sepspaces %
  2266. \singlespace %
  2267. % The following causes blank lines not to be ignored
  2268. % by adding a space to the end of each line.
  2269. \let\par=\lisppar
  2270. \def\Eformat{\endgroup\afterenvbreak}
  2271. \parskip=0pt \parindent=0pt
  2272. \obeyspaces \obeylines
  2273. \def\next##1{}\next}
  2274. % @flushleft and @flushright
  2275. \def\flushleft{%
  2276. \begingroup\inENV %This group ends at the end of the @format body
  2277. \aboveenvbreak
  2278. % Make spaces be word-separators rather than space tokens.
  2279. \sepspaces %
  2280. % The following causes blank lines not to be ignored
  2281. % by adding a space to the end of each line.
  2282. % This also causes @ to work when the directive name
  2283. % is terminated by end of line.
  2284. \let\par=\lisppar
  2285. \def\Eflushleft{\endgroup\afterenvbreak}%
  2286. \parskip=0pt \parindent=0pt
  2287. \obeyspaces \obeylines
  2288. \def\next##1{}\next}
  2289. \def\flushright{%
  2290. \begingroup\inENV %This group ends at the end of the @format body
  2291. \aboveenvbreak
  2292. % Make spaces be word-separators rather than space tokens.
  2293. \sepspaces %
  2294. % The following causes blank lines not to be ignored
  2295. % by adding a space to the end of each line.
  2296. % This also causes @ to work when the directive name
  2297. % is terminated by end of line.
  2298. \let\par=\lisppar
  2299. \def\Eflushright{\endgroup\afterenvbreak}%
  2300. \parskip=0pt \parindent=0pt
  2301. \advance \leftskip by 0pt plus 1fill
  2302. \obeyspaces \obeylines
  2303. \def\next##1{}\next}
  2304. % @quotation - narrow the margins.
  2305. \def\quotation{%
  2306. \begingroup\inENV %This group ends at the end of the @quotation body
  2307. {\parskip=0pt % because we will skip by \parskip too, later
  2308. \aboveenvbreak}%
  2309. \singlespace
  2310. \parindent=0pt
  2311. \def\Equotation{\par\endgroup\afterenvbreak}%
  2312. % @cartouche defines \nonarrowing to inhibit narrowing
  2313. % at next level down.
  2314. \ifx\nonarrowing\relax
  2315. \advance \leftskip by \lispnarrowing
  2316. \advance \rightskip by \lispnarrowing
  2317. \exdentamount=\lispnarrowing
  2318. \let\nonarrowing=\relax
  2319. \fi}
  2320. \message{defuns,}
  2321. % Define formatter for defuns
  2322. % First, allow user to change definition object font (\df) internally
  2323. \def\setdeffont #1 {\csname DEF#1\endcsname}
  2324. \newskip\defbodyindent \defbodyindent=.4in
  2325. \newskip\defargsindent \defargsindent=50pt
  2326. \newskip\deftypemargin \deftypemargin=12pt
  2327. \newskip\deflastargmargin \deflastargmargin=18pt
  2328. \newcount\parencount
  2329. % define \functionparens, which makes ( and ) and & do special things.
  2330. % \functionparens affects the group it is contained in.
  2331. \def\activeparens{%
  2332. \catcode`\(=\active \catcode`\)=\active \catcode`\&=\active
  2333. \catcode`\[=\active \catcode`\]=\active}
  2334. % Make control sequences which act like normal parenthesis chars.
  2335. \let\lparen = ( \let\rparen = )
  2336. {\activeparens % Now, smart parens don't turn on until &foo (see \amprm)
  2337. % Be sure that we always have a definition for `(', etc. For example,
  2338. % if the fn name has parens in it, \boldbrax will not be in effect yet,
  2339. % so TeX would otherwise complain about undefined control sequence.
  2340. \global\let(=\lparen \global\let)=\rparen
  2341. \global\let[=\lbrack \global\let]=\rbrack
  2342. \gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 }
  2343. \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
  2344. % Definitions of (, ) and & used in args for functions.
  2345. % This is the definition of ( outside of all parentheses.
  2346. \gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested %
  2347. \global\advance\parencount by 1 }
  2348. %
  2349. % This is the definition of ( when already inside a level of parens.
  2350. \gdef\opnested{\char`\(\global\advance\parencount by 1 }
  2351. %
  2352. \gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
  2353. % also in that case restore the outer-level definition of (.
  2354. \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi
  2355. \global\advance \parencount by -1 }
  2356. % If we encounter &foo, then turn on ()-hacking afterwards
  2357. \gdef\amprm#1 {{\rm\&#1}\let(=\oprm \let)=\clrm\ }
  2358. %
  2359. \gdef\normalparens{\boldbrax\let&=\ampnr}
  2360. } % End of definition inside \activeparens
  2361. %% These parens (in \boldbrax) actually are a little bolder than the
  2362. %% contained text. This is especially needed for [ and ]
  2363. \def\opnr{{\sf\char`\(}} \def\clnr{{\sf\char`\)}} \def\ampnr{\&}
  2364. \def\lbrb{{\bf\char`\[}} \def\rbrb{{\bf\char`\]}}
  2365. % First, defname, which formats the header line itself.
  2366. % #1 should be the function name.
  2367. % #2 should be the type of definition, such as "Function".
  2368. \def\defname #1#2{%
  2369. % Get the values of \leftskip and \rightskip as they were
  2370. % outside the @def...
  2371. \dimen2=\leftskip
  2372. \advance\dimen2 by -\defbodyindent
  2373. \dimen3=\rightskip
  2374. \advance\dimen3 by -\defbodyindent
  2375. \noindent %
  2376. \setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
  2377. \dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line
  2378. \dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations
  2379. \parshape 2 0in \dimen0 \defargsindent \dimen1 %
  2380. % Now output arg 2 ("Function" or some such)
  2381. % ending at \deftypemargin from the right margin,
  2382. % but stuck inside a box of width 0 so it does not interfere with linebreaking
  2383. {% Adjust \hsize to exclude the ambient margins,
  2384. % so that \rightline will obey them.
  2385. \advance \hsize by -\dimen2 \advance \hsize by -\dimen3
  2386. \rlap{\rightline{{\rm #2}\hskip \deftypemargin}}}%
  2387. % Make all lines underfull and no complaints:
  2388. \tolerance=10000 \hbadness=10000
  2389. \advance\leftskip by -\defbodyindent
  2390. \exdentamount=\defbodyindent
  2391. {\df #1}\enskip % Generate function name
  2392. }
  2393. % Actually process the body of a definition
  2394. % #1 should be the terminating control sequence, such as \Edefun.
  2395. % #2 should be the "another name" control sequence, such as \defunx.
  2396. % #3 should be the control sequence that actually processes the header,
  2397. % such as \defunheader.
  2398. \def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
  2399. \medbreak %
  2400. % Define the end token that this defining construct specifies
  2401. % so that it will exit this group.
  2402. \def#1{\endgraf\endgroup\medbreak}%
  2403. \def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
  2404. \parindent=0in
  2405. \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
  2406. \exdentamount=\defbodyindent
  2407. \begingroup %
  2408. \catcode 61=\active %
  2409. \obeylines\activeparens\spacesplit#3}
  2410. \def\defmethparsebody #1#2#3#4 {\begingroup\inENV %
  2411. \medbreak %
  2412. % Define the end token that this defining construct specifies
  2413. % so that it will exit this group.
  2414. \def#1{\endgraf\endgroup\medbreak}%
  2415. \def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}%
  2416. \parindent=0in
  2417. \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
  2418. \exdentamount=\defbodyindent
  2419. \begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
  2420. \def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
  2421. \medbreak %
  2422. % Define the end token that this defining construct specifies
  2423. % so that it will exit this group.
  2424. \def#1{\endgraf\endgroup\medbreak}%
  2425. \def#2##1 ##2 {\def#4{##1}%
  2426. \begingroup\obeylines\activeparens\spacesplit{#3{##2}}}%
  2427. \parindent=0in
  2428. \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
  2429. \exdentamount=\defbodyindent
  2430. \begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
  2431. % These parsing functions are similar to the preceding ones
  2432. % except that they do not make parens into active characters.
  2433. % These are used for "variables" since they have no arguments.
  2434. \def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
  2435. \medbreak %
  2436. % Define the end token that this defining construct specifies
  2437. % so that it will exit this group.
  2438. \def#1{\endgraf\endgroup\medbreak}%
  2439. \def#2{\begingroup\obeylines\spacesplit#3}%
  2440. \parindent=0in
  2441. \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
  2442. \exdentamount=\defbodyindent
  2443. \begingroup %
  2444. \catcode 61=\active %
  2445. \obeylines\spacesplit#3}
  2446. \def\defvrparsebody #1#2#3#4 {\begingroup\inENV %
  2447. \medbreak %
  2448. % Define the end token that this defining construct specifies
  2449. % so that it will exit this group.
  2450. \def#1{\endgraf\endgroup\medbreak}%
  2451. \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}%
  2452. \parindent=0in
  2453. \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
  2454. \exdentamount=\defbodyindent
  2455. \begingroup\obeylines\spacesplit{#3{#4}}}
  2456. % This is the same as all the others except for the last line. We need
  2457. % to parse the arguments differently for @deftp, since the ``attributes''
  2458. % there are optional.
  2459. %
  2460. \def\deftpparsebody #1#2#3#4 {\begingroup\inENV %
  2461. \medbreak %
  2462. % Define the end token that this defining construct specifies
  2463. % so that it will exit this group.
  2464. \def#1{\endgraf\endgroup\medbreak}%
  2465. \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}%
  2466. \parindent=0in
  2467. \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
  2468. \exdentamount=\defbodyindent
  2469. \begingroup\obeylines\parsetpheaderline{#3{#4}}}
  2470. {\obeylines %
  2471. % Parse the type name and any attributes (field names, etc.).
  2472. % #1 is the beginning of the macro call that will produce the output,
  2473. % i.e., \deftpheader{CLASS}; this is passed from \deftpparsebody.
  2474. % #2 is the type name, e.g., `struct termios'.
  2475. % #3 is the (possibly empty) attribute list.
  2476. %
  2477. \gdef\parsetpheaderline#1#2#3^^M{%
  2478. \endgroup % Started in \deftpparsebody.
  2479. %
  2480. % If the attribute list is in fact empty, there will be no space after
  2481. % #2; so we can't put a space in our TeX parameter list. But if it
  2482. % isn't empty, then #3 will begin with an unwanted space.
  2483. \def\theargs{\ignorespaces #3}%
  2484. %
  2485. % Call the macro to produce the output.
  2486. #1{#2}\theargs %
  2487. }%
  2488. }
  2489. \def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV %
  2490. \medbreak %
  2491. % Define the end token that this defining construct specifies
  2492. % so that it will exit this group.
  2493. \def#1{\endgraf\endgroup\medbreak}%
  2494. \def#2##1 ##2 {\def#4{##1}%
  2495. \begingroup\obeylines\spacesplit{#3{##2}}}%
  2496. \parindent=0in
  2497. \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
  2498. \exdentamount=\defbodyindent
  2499. \begingroup\obeylines\spacesplit{#3{#5}}}
  2500. % Split up #2 at the first space token.
  2501. % call #1 with two arguments:
  2502. % the first is all of #2 before the space token,
  2503. % the second is all of #2 after that space token.
  2504. % If #2 contains no space token, all of it is passed as the first arg
  2505. % and the second is passed as empty.
  2506. {\obeylines
  2507. \gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}%
  2508. \long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{%
  2509. \ifx\relax #3%
  2510. #1{#2}{}\else #1{#2}{#3#4}\fi}}
  2511. % So much for the things common to all kinds of definitions.
  2512. % Define @defun.
  2513. % First, define the processing that is wanted for arguments of \defun
  2514. % Use this to expand the args and terminate the paragraph they make up
  2515. \def\defunargs #1{\functionparens \sl
  2516. % Expand, preventing hyphenation at `-' chars.
  2517. % Note that groups don't affect changes in \hyphenchar.
  2518. \hyphenchar\tensl=0
  2519. #1%
  2520. \hyphenchar\tensl=45
  2521. \ifnum\parencount=0 \else \errmessage{unbalanced parens in @def arguments}\fi%
  2522. \interlinepenalty=10000
  2523. \advance\rightskip by 0pt plus 1fil
  2524. \endgraf\penalty 10000\vskip -\parskip\penalty 10000%
  2525. }
  2526. \def\deftypefunargs #1{%
  2527. % Expand, preventing hyphenation at `-' chars.
  2528. % Note that groups don't affect changes in \hyphenchar.
  2529. \functionparens
  2530. \code{#1}%
  2531. \interlinepenalty=10000
  2532. \advance\rightskip by 0pt plus 1fil
  2533. \endgraf\penalty 10000\vskip -\parskip\penalty 10000%
  2534. }
  2535. % Do complete processing of one @defun or @defunx line already parsed.
  2536. % @deffn Command forward-char nchars
  2537. \def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader}
  2538. \def\deffnheader #1#2#3{\doind {fn}{\code{#2}}%
  2539. \begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
  2540. \catcode 61=\other % Turn off change made in \defparsebody
  2541. }
  2542. % @defun == @deffn Function
  2543. \def\defun{\defparsebody\Edefun\defunx\defunheader}
  2544. \def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
  2545. \begingroup\defname {#1}{Function}%
  2546. \defunargs {#2}\endgroup %
  2547. \catcode 61=\other % Turn off change made in \defparsebody
  2548. }
  2549. % @deftypefun int foobar (int @var{foo}, float @var{bar})
  2550. \def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader}
  2551. % #1 is the data type. #2 is the name and args.
  2552. \def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax}
  2553. % #1 is the data type, #2 the name, #3 the args.
  2554. \def\deftypefunheaderx #1#2 #3\relax{%
  2555. \doind {fn}{\code{#2}}% Make entry in function index
  2556. \begingroup\defname {\code{#1} #2}{Function}%
  2557. \deftypefunargs {#3}\endgroup %
  2558. \catcode 61=\other % Turn off change made in \defparsebody
  2559. }
  2560. % @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
  2561. \def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
  2562. % #1 is the classification. #2 is the data type. #3 is the name and args.
  2563. \def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax}
  2564. % #1 is the classification, #2 the data type, #3 the name, #4 the args.
  2565. \def\deftypefnheaderx #1#2#3 #4\relax{%
  2566. \doind {fn}{\code{#3}}% Make entry in function index
  2567. \begingroup\defname {\code{#2} #3}{#1}%
  2568. \deftypefunargs {#4}\endgroup %
  2569. \catcode 61=\other % Turn off change made in \defparsebody
  2570. }
  2571. % @defmac == @deffn Macro
  2572. \def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
  2573. \def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
  2574. \begingroup\defname {#1}{Macro}%
  2575. \defunargs {#2}\endgroup %
  2576. \catcode 61=\other % Turn off change made in \defparsebody
  2577. }
  2578. % @defspec == @deffn Special Form
  2579. \def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
  2580. \def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
  2581. \begingroup\defname {#1}{Special Form}%
  2582. \defunargs {#2}\endgroup %
  2583. \catcode 61=\other % Turn off change made in \defparsebody
  2584. }
  2585. % This definition is run if you use @defunx
  2586. % anywhere other than immediately after a @defun or @defunx.
  2587. \def\deffnx #1 {\errmessage{@deffnx in invalid context}}
  2588. \def\defunx #1 {\errmessage{@defunx in invalid context}}
  2589. \def\defmacx #1 {\errmessage{@defmacx in invalid context}}
  2590. \def\defspecx #1 {\errmessage{@defspecx in invalid context}}
  2591. \def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}}
  2592. \def\deftypeunx #1 {\errmessage{@deftypeunx in invalid context}}
  2593. % @defmethod, and so on
  2594. % @defop {Funny Method} foo-class frobnicate argument
  2595. \def\defop #1 {\def\defoptype{#1}%
  2596. \defopparsebody\Edefop\defopx\defopheader\defoptype}
  2597. \def\defopheader #1#2#3{%
  2598. \dosubind {fn}{\code{#2}}{on #1}% Make entry in function index
  2599. \begingroup\defname {#2}{\defoptype{} on #1}%
  2600. \defunargs {#3}\endgroup %
  2601. }
  2602. % @defmethod == @defop Method
  2603. \def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
  2604. \def\defmethodheader #1#2#3{%
  2605. \dosubind {fn}{\code{#2}}{on #1}% entry in function index
  2606. \begingroup\defname {#2}{Method on #1}%
  2607. \defunargs {#3}\endgroup %
  2608. }
  2609. % @defcv {Class Option} foo-class foo-flag
  2610. \def\defcv #1 {\def\defcvtype{#1}%
  2611. \defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
  2612. \def\defcvarheader #1#2#3{%
  2613. \dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
  2614. \begingroup\defname {#2}{\defcvtype{} of #1}%
  2615. \defvarargs {#3}\endgroup %
  2616. }
  2617. % @defivar == @defcv {Instance Variable}
  2618. \def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
  2619. \def\defivarheader #1#2#3{%
  2620. \dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
  2621. \begingroup\defname {#2}{Instance Variable of #1}%
  2622. \defvarargs {#3}\endgroup %
  2623. }
  2624. % These definitions are run if you use @defmethodx, etc.,
  2625. % anywhere other than immediately after a @defmethod, etc.
  2626. \def\defopx #1 {\errmessage{@defopx in invalid context}}
  2627. \def\defmethodx #1 {\errmessage{@defmethodx in invalid context}}
  2628. \def\defcvx #1 {\errmessage{@defcvx in invalid context}}
  2629. \def\defivarx #1 {\errmessage{@defivarx in invalid context}}
  2630. % Now @defvar
  2631. % First, define the processing that is wanted for arguments of @defvar.
  2632. % This is actually simple: just print them in roman.
  2633. % This must expand the args and terminate the paragraph they make up
  2634. \def\defvarargs #1{\normalparens #1%
  2635. \interlinepenalty=10000
  2636. \endgraf\penalty 10000\vskip -\parskip\penalty 10000}
  2637. % @defvr Counter foo-count
  2638. \def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader}
  2639. \def\defvrheader #1#2#3{\doind {vr}{\code{#2}}%
  2640. \begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup}
  2641. % @defvar == @defvr Variable
  2642. \def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader}
  2643. \def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
  2644. \begingroup\defname {#1}{Variable}%
  2645. \defvarargs {#2}\endgroup %
  2646. }
  2647. % @defopt == @defvr {User Option}
  2648. \def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader}
  2649. \def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
  2650. \begingroup\defname {#1}{User Option}%
  2651. \defvarargs {#2}\endgroup %
  2652. }
  2653. % @deftypevar int foobar
  2654. \def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader}
  2655. % #1 is the data type. #2 is the name.
  2656. \def\deftypevarheader #1#2{%
  2657. \doind {vr}{\code{#2}}% Make entry in variables index
  2658. \begingroup\defname {\code{#1} #2}{Variable}%
  2659. \interlinepenalty=10000
  2660. \endgraf\penalty 10000\vskip -\parskip\penalty 10000
  2661. \endgroup}
  2662. % @deftypevr {Global Flag} int enable
  2663. \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
  2664. \def\deftypevrheader #1#2#3{\doind {vr}{\code{#3}}%
  2665. \begingroup\defname {\code{#2} #3}{#1}
  2666. \interlinepenalty=10000
  2667. \endgraf\penalty 10000\vskip -\parskip\penalty 10000
  2668. \endgroup}
  2669. % This definition is run if you use @defvarx
  2670. % anywhere other than immediately after a @defvar or @defvarx.
  2671. \def\defvrx #1 {\errmessage{@defvrx in invalid context}}
  2672. \def\defvarx #1 {\errmessage{@defvarx in invalid context}}
  2673. \def\defoptx #1 {\errmessage{@defoptx in invalid context}}
  2674. \def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context}}
  2675. \def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context}}
  2676. % Now define @deftp
  2677. % Args are printed in bold, a slight difference from @defvar.
  2678. \def\deftpargs #1{\bf \defvarargs{#1}}
  2679. % @deftp Class window height width ...
  2680. \def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader}
  2681. \def\deftpheader #1#2#3{\doind {tp}{\code{#2}}%
  2682. \begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
  2683. % This definition is run if you use @deftpx, etc
  2684. % anywhere other than immediately after a @deftp, etc.
  2685. \def\deftpx #1 {\errmessage{@deftpx in invalid context}}
  2686. \message{cross reference,}
  2687. % Define cross-reference macros
  2688. \newwrite \auxfile
  2689. \newif\ifhavexrefs % True if xref values are known.
  2690. \newif\ifwarnedxrefs % True if we warned once that they aren't known.
  2691. % \setref{foo} defines a cross-reference point named foo.
  2692. \def\setref#1{%
  2693. %\dosetq{#1-title}{Ytitle}%
  2694. \dosetq{#1-pg}{Ypagenumber}%
  2695. \dosetq{#1-snt}{Ysectionnumberandtype}}
  2696. \def\unnumbsetref#1{%
  2697. %\dosetq{#1-title}{Ytitle}%
  2698. \dosetq{#1-pg}{Ypagenumber}%
  2699. \dosetq{#1-snt}{Ynothing}}
  2700. \def\appendixsetref#1{%
  2701. %\dosetq{#1-title}{Ytitle}%
  2702. \dosetq{#1-pg}{Ypagenumber}%
  2703. \dosetq{#1-snt}{Yappendixletterandtype}}
  2704. % \xref, \pxref, and \ref generate cross-references to specified points.
  2705. % For \xrefX, #1 is the node name, #2 the name of the Info
  2706. % cross-reference, #3 the printed node name, #4 the name of the Info
  2707. % file, #5 the name of the printed manual. All but the node name can be
  2708. % omitted.
  2709. %
  2710. \def\pxref#1{see \xrefX[#1,,,,,,,]}
  2711. \def\xref#1{See \xrefX[#1,,,,,,,]}
  2712. \def\ref#1{\xrefX[#1,,,,,,,]}
  2713. \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup%
  2714. \def\printedmanual{\ignorespaces #5}%
  2715. \def\printednodename{\ignorespaces #3}%
  2716. %
  2717. \setbox1=\hbox{\printedmanual}%
  2718. \setbox0=\hbox{\printednodename}%
  2719. \ifdim \wd0=0pt%
  2720. \def\printednodename{\ignorespaces #1}%
  2721. %%% Uncommment the following line to make the actual chapter or section title
  2722. %%% appear inside the square brackets.
  2723. %\def\printednodename{#1-title}%
  2724. \fi%
  2725. %
  2726. %
  2727. % If we use \unhbox0 and \unhbox1 to print the node names, TeX does
  2728. % not insert empty discretionaries after hyphens, which means that it
  2729. % will not find a line break at a hyphen in a node names. Since some
  2730. % manuals are best written with fairly long node names, containing
  2731. % hyphens, this is a loss. Therefore, we simply give the text of
  2732. % the node name again, so it is as if TeX is seeing it for the first
  2733. % time.
  2734. \ifdim \wd1>0pt
  2735. section ``\printednodename'' in \cite{\printedmanual}%
  2736. \else%
  2737. \turnoffactive%
  2738. \refx{#1-snt}{} [\printednodename], page\tie\refx{#1-pg}{}%
  2739. \fi
  2740. \endgroup}
  2741. % \dosetq is the interface for calls from other macros
  2742. % Use \turnoffactive so that punctuation chars such as underscore
  2743. % work in node names.
  2744. \def\dosetq #1#2{{\let\folio=0 \turnoffactive%
  2745. \edef\next{\write\auxfile{\internalsetq {#1}{#2}}}%
  2746. \next}}
  2747. % \internalsetq {foo}{page} expands into
  2748. % CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
  2749. % When the aux file is read, ' is the escape character
  2750. \def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}}
  2751. % Things to be expanded by \internalsetq
  2752. \def\Ypagenumber{\folio}
  2753. \def\Ytitle{\thischapter}
  2754. \def\Ynothing{}
  2755. \def\Ysectionnumberandtype{%
  2756. \ifnum\secno=0 Chapter\xreftie\the\chapno %
  2757. \else \ifnum \subsecno=0 Section\xreftie\the\chapno.\the\secno %
  2758. \else \ifnum \subsubsecno=0 %
  2759. Section\xreftie\the\chapno.\the\secno.\the\subsecno %
  2760. \else %
  2761. Section\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno %
  2762. \fi \fi \fi }
  2763. \def\Yappendixletterandtype{%
  2764. \ifnum\secno=0 Appendix\xreftie'char\the\appendixno{}%
  2765. \else \ifnum \subsecno=0 Section\xreftie'char\the\appendixno.\the\secno %
  2766. \else \ifnum \subsubsecno=0 %
  2767. Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno %
  2768. \else %
  2769. Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %
  2770. \fi \fi \fi }
  2771. \gdef\xreftie{'tie}
  2772. % Use TeX 3.0's \inputlineno to get the line number, for better error
  2773. % messages, but if we're using an old version of TeX, don't do anything.
  2774. %
  2775. \ifx\inputlineno\thisisundefined
  2776. \let\linenumber = \empty % Non-3.0.
  2777. \else
  2778. \def\linenumber{\the\inputlineno:\space}
  2779. \fi
  2780. % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
  2781. % If its value is nonempty, SUFFIX is output afterward.
  2782. \def\refx#1#2{%
  2783. \expandafter\ifx\csname X#1\endcsname\relax
  2784. % If not defined, say something at least.
  2785. $\langle$un\-de\-fined$\rangle$%
  2786. \ifhavexrefs
  2787. \message{\linenumber Undefined cross reference `#1'.}%
  2788. \else
  2789. \ifwarnedxrefs\else
  2790. \global\warnedxrefstrue
  2791. \message{Cross reference values unknown; you must run TeX again.}%
  2792. \fi
  2793. \fi
  2794. \else
  2795. % It's defined, so just use it.
  2796. \csname X#1\endcsname
  2797. \fi
  2798. #2% Output the suffix in any case.
  2799. }
  2800. % Read the last existing aux file, if any. No error if none exists.
  2801. % This is the macro invoked by entries in the aux file.
  2802. \def\xrdef #1#2{
  2803. {\catcode`\'=\other\expandafter \gdef \csname X#1\endcsname {#2}}}
  2804. \def\readauxfile{%
  2805. \begingroup
  2806. \catcode `\^^@=\other
  2807. \catcode `\=\other
  2808. \catcode `\=\other
  2809. \catcode `\^^C=\other
  2810. \catcode `\^^D=\other
  2811. \catcode `\^^E=\other
  2812. \catcode `\^^F=\other
  2813. \catcode `\^^G=\other
  2814. \catcode `\^^H=\other
  2815. \catcode `\ =\other
  2816. \catcode `\^^L=\other
  2817. \catcode `\=\other
  2818. \catcode `\=\other
  2819. \catcode `\=\other
  2820. \catcode `\=\other
  2821. \catcode `\=\other
  2822. \catcode `\=\other
  2823. \catcode `\=\other
  2824. \catcode `\=\other
  2825. \catcode `\=\other
  2826. \catcode `\=\other
  2827. \catcode `\=\other
  2828. \catcode `\=\other
  2829. \catcode 26=\other
  2830. \catcode `\^^[=\other
  2831. \catcode `\^^\=\other
  2832. \catcode `\^^]=\other
  2833. \catcode `\^^^=\other
  2834. \catcode `\^^_=\other
  2835. \catcode `\@=\other
  2836. \catcode `\^=\other
  2837. \catcode `\~=\other
  2838. \catcode `\[=\other
  2839. \catcode `\]=\other
  2840. \catcode`\"=\other
  2841. \catcode`\_=\other
  2842. \catcode`\|=\other
  2843. \catcode`\<=\other
  2844. \catcode`\>=\other
  2845. \catcode `\$=\other
  2846. \catcode `\#=\other
  2847. \catcode `\&=\other
  2848. % `\+ does not work, so use 43.
  2849. \catcode 43=\other
  2850. % the aux file uses ' as the escape.
  2851. % Turn off \ as an escape so we do not lose on
  2852. % entries which were dumped with control sequences in their names.
  2853. % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
  2854. % Reference to such entries still does not work the way one would wish,
  2855. % but at least they do not bomb out when the aux file is read in.
  2856. \catcode `\{=1 \catcode `\}=2
  2857. \catcode `\%=\other
  2858. \catcode `\'=0
  2859. \catcode `\\=\other
  2860. \openin 1 \jobname.aux
  2861. \ifeof 1 \else \closein 1 \input \jobname.aux \global\havexrefstrue
  2862. \fi
  2863. % Open the new aux file. Tex will close it automatically at exit.
  2864. \openout \auxfile=\jobname.aux
  2865. \endgroup}
  2866. % Footnotes.
  2867. \newcount \footnoteno
  2868. % The trailing space in the following definition for supereject is
  2869. % vital for proper filling; pages come out unaligned when you do a
  2870. % pagealignmacro call if that space before the closing brace is
  2871. % removed.
  2872. \def\supereject{\par\penalty -20000\footnoteno =0 }
  2873. % @footnotestyle is meaningful for info output only..
  2874. \let\footnotestyle=\comment
  2875. \let\ptexfootnote=\footnote
  2876. {\catcode `\@=11
  2877. \long\gdef\footnote #1{\global\advance \footnoteno by \@ne
  2878. \unskip
  2879. \edef\thisfootno{$^{\the\footnoteno}$}%
  2880. \let\@sf\empty
  2881. \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
  2882. \thisfootno\@sf \footnotezzz{#1}}
  2883. % \parsearg\footnotezzz}
  2884. \long\gdef\footnotezzz #1{\insert\footins{
  2885. \interlinepenalty\interfootnotelinepenalty
  2886. \splittopskip\ht\strutbox % top baseline for broken footnotes
  2887. \splitmaxdepth\dp\strutbox \floatingpenalty\@MM
  2888. \leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip
  2889. \footstrut\parindent=\defaultparindent\hang\textindent{\thisfootno}#1\strut}}
  2890. }%end \catcode `\@=11
  2891. % Set the baselineskip to #1, and the lineskip and strut size
  2892. % correspondingly. There is no deep meaning behind these magic numbers
  2893. % used as factors; they just match (closely enough) what Knuth defined.
  2894. %
  2895. \def\lineskipfactor{.1}
  2896. \def\strutheightpercent{.71}
  2897. \def\strutdepthpercent{.29}
  2898. %
  2899. \def\setleading#1{%
  2900. \baselineskip = #1\relax
  2901. \normalbaselineskip = \baselineskip
  2902. \lineskip = \lineskipfactor\baselineskip
  2903. \setbox\strutbox =\hbox{%
  2904. \vrule width0pt height\strutheightpercent\baselineskip
  2905. depth \strutdepthpercent \baselineskip
  2906. }%
  2907. }
  2908. % @| inserts a changebar to the left of the current line. It should
  2909. % surround any changed text. This approach does *not* work if the
  2910. % change spans more than two lines of output. To handle that, we would
  2911. % have adopt a much more difficult approach (putting marks into the main
  2912. % vertical list for the beginning and end of each change).
  2913. %
  2914. \def\|{%
  2915. % \vadjust can only be used in horizontal mode.
  2916. \leavevmode
  2917. %
  2918. % Append this vertical mode material after the current line in the output.
  2919. \vadjust{%
  2920. % We want to insert a rule with the height and depth of the current
  2921. % leading; that is exactly what \strutbox is supposed to record.
  2922. \vskip-\baselineskip
  2923. %
  2924. % \vadjust-items are inserted at the left edge of the type. So
  2925. % the \llap here moves out into the left-hand margin.
  2926. \llap{%
  2927. %
  2928. % For a thicker or thinner bar, change the `1pt'.
  2929. \vrule height\baselineskip width1pt
  2930. %
  2931. % This is the space between the bar and the text.
  2932. \hskip 12pt
  2933. }%
  2934. }%
  2935. }
  2936. % For a final copy, take out the rectangles
  2937. % that mark overfull boxes (in case you have decided
  2938. % that the text looks ok even though it passes the margin).
  2939. %
  2940. \def\finalout{\overfullrule=0pt}
  2941. % End of control word definitions.
  2942. \message{and turning on texinfo input format.}
  2943. \def\openindices{%
  2944. \newindex{cp}%
  2945. \newcodeindex{fn}%
  2946. \newcodeindex{vr}%
  2947. \newcodeindex{tp}%
  2948. \newcodeindex{ky}%
  2949. \newcodeindex{pg}%
  2950. }
  2951. % Set some numeric style parameters, for 8.5 x 11 format.
  2952. %\hsize = 6.5in
  2953. \newdimen\defaultparindent \defaultparindent = 15pt
  2954. \parindent = \defaultparindent
  2955. \parskip 18pt plus 1pt
  2956. \setleading{15pt}
  2957. \advance\topskip by 1.2cm
  2958. % Prevent underfull vbox error messages.
  2959. \vbadness=10000
  2960. % Following George Bush, just get rid of widows and orphans.
  2961. \widowpenalty=10000
  2962. \clubpenalty=10000
  2963. % Use TeX 3.0's \emergencystretch to help line breaking, but if we're
  2964. % using an old version of TeX, don't do anything. We want the amount of
  2965. % stretch added to depend on the line length, hence the dependence on
  2966. % \hsize. This makes it come to about 9pt for the 8.5x11 format.
  2967. %
  2968. \ifx\emergencystretch\thisisundefined \else
  2969. \emergencystretch = \hsize
  2970. \divide\emergencystretch by 45
  2971. \fi
  2972. % Use @smallbook to reset parameters for 7x9.5 format (or else 7x9.25)
  2973. \def\smallbook{
  2974. % These values for secheadingskip and subsecheadingskip are
  2975. % experiments. RJC 7 Aug 1992
  2976. \global\secheadingskip = 17pt plus 6pt minus 3pt
  2977. \global\subsecheadingskip = 14pt plus 6pt minus 3pt
  2978. \global\lispnarrowing = 0.3in
  2979. \setleading{12pt}
  2980. \advance\topskip by -1cm
  2981. \global\parskip 3pt plus 1pt
  2982. \global\hsize = 5in
  2983. \global\vsize=7.5in
  2984. \global\tolerance=700
  2985. \global\hfuzz=1pt
  2986. \global\contentsrightmargin=0pt
  2987. \global\pagewidth=\hsize
  2988. \global\pageheight=\vsize
  2989. \global\let\smalllisp=\smalllispx
  2990. \global\let\smallexample=\smalllispx
  2991. \global\def\Esmallexample{\Esmalllisp}
  2992. }
  2993. % Use @afourpaper to print on European A4 paper.
  2994. \def\afourpaper{
  2995. \global\tolerance=700
  2996. \global\hfuzz=1pt
  2997. \setleading{12pt}
  2998. \global\parskip 15pt plus 1pt
  2999. \global\vsize= 53\baselineskip
  3000. \advance\vsize by \topskip
  3001. %\global\hsize= 5.85in % A4 wide 10pt
  3002. \global\hsize= 6.5in
  3003. \global\outerhsize=\hsize
  3004. \global\advance\outerhsize by 0.5in
  3005. \global\outervsize=\vsize
  3006. \global\advance\outervsize by 0.6in
  3007. \global\pagewidth=\hsize
  3008. \global\pageheight=\vsize
  3009. }
  3010. % Define macros to output various characters with catcode for normal text.
  3011. \catcode`\"=\other
  3012. \catcode`\~=\other
  3013. \catcode`\^=\other
  3014. \catcode`\_=\other
  3015. \catcode`\|=\other
  3016. \catcode`\<=\other
  3017. \catcode`\>=\other
  3018. \catcode`\+=\other
  3019. \def\normaldoublequote{"}
  3020. \def\normaltilde{~}
  3021. \def\normalcaret{^}
  3022. \def\normalunderscore{_}
  3023. \def\normalverticalbar{|}
  3024. \def\normalless{<}
  3025. \def\normalgreater{>}
  3026. \def\normalplus{+}
  3027. % This macro is used to make a character print one way in ttfont
  3028. % where it can probably just be output, and another way in other fonts,
  3029. % where something hairier probably needs to be done.
  3030. %
  3031. % #1 is what to print if we are indeed using \tt; #2 is what to print
  3032. % otherwise. Since all the Computer Modern typewriter fonts have zero
  3033. % interword stretch (and shrink), and it is reasonable to expect all
  3034. % typewriter fonts to have this, we can check that font parameter.
  3035. %
  3036. \def\ifusingtt#1#2{\ifdim \fontdimen3\the\font=0pt #1\else #2\fi}
  3037. % Turn off all special characters except @
  3038. % (and those which the user can use as if they were ordinary).
  3039. % Most of these we simply print from the \tt font, but for some, we can
  3040. % use math or other variants that look better in normal text.
  3041. \catcode`\"=\active
  3042. \def\activedoublequote{{\tt \char '042}}
  3043. \let"=\activedoublequote
  3044. \catcode`\~=\active
  3045. \def~{{\tt \char '176}}
  3046. \chardef\hat=`\^
  3047. \catcode`\^=\active
  3048. \def^{{\tt \hat}}
  3049. \catcode`\_=\active
  3050. \def_{\ifusingtt\normalunderscore\_}
  3051. % Subroutine for the previous macro.
  3052. \def\_{\lvvmode \kern.06em \vbox{\hrule width.3em height.1ex}}
  3053. % \lvvmode is equivalent in function to \leavevmode.
  3054. % Using \leavevmode runs into trouble when written out to
  3055. % an index file due to the expansion of \leavevmode into ``\unhbox
  3056. % \voidb@x'' ---which looks to TeX like ``\unhbox \voidb\x'' due to our
  3057. % magic tricks with @.
  3058. \def\lvvmode{\vbox to 0pt{}}
  3059. \catcode`\|=\active
  3060. \def|{{\tt \char '174}}
  3061. \chardef \less=`\<
  3062. \catcode`\<=\active
  3063. \def<{{\tt \less}}
  3064. \chardef \gtr=`\>
  3065. \catcode`\>=\active
  3066. \def>{{\tt \gtr}}
  3067. \catcode`\+=\active
  3068. \def+{{\tt \char 43}}
  3069. %\catcode 27=\active
  3070. %\def^^[{$\diamondsuit$}
  3071. % Used sometimes to turn off (effectively) the active characters
  3072. % even after parsing them.
  3073. \def\turnoffactive{\let"=\normaldoublequote
  3074. \let~=\normaltilde
  3075. \let^=\normalcaret
  3076. \let_=\normalunderscore
  3077. \let|=\normalverticalbar
  3078. \let<=\normalless
  3079. \let>=\normalgreater
  3080. \let+=\normalplus}
  3081. % Set up an active definition for =, but don't enable it most of the time.
  3082. {\catcode`\==\active
  3083. \global\def={{\tt \char 61}}}
  3084. \catcode`\@=0
  3085. % \rawbackslashxx output one backslash character in current font
  3086. \global\chardef\rawbackslashxx=`\\
  3087. %{\catcode`\\=\other
  3088. %@gdef@rawbackslashxx{\}}
  3089. % \rawbackslash redefines \ as input to do \rawbackslashxx.
  3090. {\catcode`\\=\active
  3091. @gdef@rawbackslash{@let\=@rawbackslashxx }}
  3092. % \normalbackslash outputs one backslash in fixed width font.
  3093. \def\normalbackslash{{\tt\rawbackslashxx}}
  3094. % Say @foo, not \foo, in error messages.
  3095. \escapechar=`\@
  3096. % \catcode 17=0 % Define control-q
  3097. \catcode`\\=\active
  3098. % If a .fmt file is being used, we don't want the `\input texinfo' to show up.
  3099. % That is what \eatinput is for; after that, the `\' should revert to printing
  3100. % a backslash.
  3101. %
  3102. @gdef@eatinput input texinfo{@fixbackslash}
  3103. @global@let\ = @eatinput
  3104. % On the other hand, perhaps the file did not have a `\input texinfo'. Then
  3105. % the first `\{ in the file would cause an error. This macro tries to fix
  3106. % that, assuming it is called before the first `\' could plausibly occur.
  3107. %
  3108. @gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi}
  3109. %% These look ok in all fonts, so just make them not special. The @rm below
  3110. %% makes sure that the current font starts out as the newly loaded cmr10
  3111. @catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other
  3112. @textfonts
  3113. @rm
  3114. @c Local variables:
  3115. @c page-delimiter: "^\\\\message"
  3116. @c End: