2
0

texinfo.tex 314 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011
  1. % texinfo.tex -- TeX macros to handle Texinfo files.
  2. %
  3. % Load plain if necessary, i.e., if running under initex.
  4. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
  5. %
  6. \def\texinfoversion{2012-04-06.11}
  7. %
  8. % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
  9. % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
  10. % 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
  11. %
  12. % This texinfo.tex file is free software: you can redistribute it and/or
  13. % modify it under the terms of the GNU General Public License as
  14. % published by the Free Software Foundation, either version 3 of the
  15. % License, or (at your option) any later version.
  16. %
  17. % This texinfo.tex file is distributed in the hope that it will be
  18. % useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  19. % of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  20. % General Public License for more details.
  21. %
  22. % You should have received a copy of the GNU General Public License
  23. % along with this program. If not, see <http://www.gnu.org/licenses/>.
  24. %
  25. % As a special exception, when this file is read by TeX when processing
  26. % a Texinfo source document, you may use the result without
  27. % restriction. (This has been our intent since Texinfo was invented.)
  28. %
  29. % Please try the latest version of texinfo.tex before submitting bug
  30. % reports; you can get the latest version from:
  31. % http://www.gnu.org/software/texinfo/ (the Texinfo home page), or
  32. % ftp://tug.org/tex/texinfo.tex
  33. % (and all CTAN mirrors, see http://www.ctan.org).
  34. % The texinfo.tex in any given distribution could well be out
  35. % of date, so if that's what you're using, please check.
  36. %
  37. % Send bug reports to bug-texinfo@gnu.org. Please include including a
  38. % complete document in each bug report with which we can reproduce the
  39. % problem. Patches are, of course, greatly appreciated.
  40. %
  41. % To process a Texinfo manual with TeX, it's most reliable to use the
  42. % texi2dvi shell script that comes with the distribution. For a simple
  43. % manual foo.texi, however, you can get away with this:
  44. % tex foo.texi
  45. % texindex foo.??
  46. % tex foo.texi
  47. % tex foo.texi
  48. % dvips foo.dvi -o # or whatever; this makes foo.ps.
  49. % The extra TeX runs get the cross-reference information correct.
  50. % Sometimes one run after texindex suffices, and sometimes you need more
  51. % than two; texi2dvi does it as many times as necessary.
  52. %
  53. % It is possible to adapt texinfo.tex for other languages, to some
  54. % extent. You can get the existing language-specific files from the
  55. % full Texinfo distribution.
  56. %
  57. % The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
  58. \message{Loading texinfo [version \texinfoversion]:}
  59. % If in a .fmt file, print the version number
  60. % and turn on active characters that we couldn't do earlier because
  61. % they might have appeared in the input file name.
  62. \everyjob{\message{[Texinfo version \texinfoversion]}%
  63. \catcode`+=\active \catcode`\_=\active}
  64. \chardef\other=12
  65. % We never want plain's \outer definition of \+ in Texinfo.
  66. % For @tex, we can use \tabalign.
  67. \let\+ = \relax
  68. % Save some plain tex macros whose names we will redefine.
  69. \let\ptexb=\b
  70. \let\ptexbullet=\bullet
  71. \let\ptexc=\c
  72. \let\ptexcomma=\,
  73. \let\ptexdot=\.
  74. \let\ptexdots=\dots
  75. \let\ptexend=\end
  76. \let\ptexequiv=\equiv
  77. \let\ptexexclam=\!
  78. \let\ptexfootnote=\footnote
  79. \let\ptexgtr=>
  80. \let\ptexhat=^
  81. \let\ptexi=\i
  82. \let\ptexindent=\indent
  83. \let\ptexinsert=\insert
  84. \let\ptexlbrace=\{
  85. \let\ptexless=<
  86. \let\ptexnewwrite\newwrite
  87. \let\ptexnoindent=\noindent
  88. \let\ptexplus=+
  89. \let\ptexraggedright=\raggedright
  90. \let\ptexrbrace=\}
  91. \let\ptexslash=\/
  92. \let\ptexstar=\*
  93. \let\ptext=\t
  94. \let\ptextop=\top
  95. {\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode
  96. % If this character appears in an error message or help string, it
  97. % starts a new line in the output.
  98. \newlinechar = `^^J
  99. % Use TeX 3.0's \inputlineno to get the line number, for better error
  100. % messages, but if we're using an old version of TeX, don't do anything.
  101. %
  102. \ifx\inputlineno\thisisundefined
  103. \let\linenumber = \empty % Pre-3.0.
  104. \else
  105. \def\linenumber{l.\the\inputlineno:\space}
  106. \fi
  107. % Set up fixed words for English if not already set.
  108. \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
  109. \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
  110. \ifx\putworderror\undefined \gdef\putworderror{error}\fi
  111. \ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
  112. \ifx\putwordin\undefined \gdef\putwordin{in}\fi
  113. \ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
  114. \ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
  115. \ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
  116. \ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
  117. \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
  118. \ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi
  119. \ifx\putwordof\undefined \gdef\putwordof{of}\fi
  120. \ifx\putwordon\undefined \gdef\putwordon{on}\fi
  121. \ifx\putwordpage\undefined \gdef\putwordpage{page}\fi
  122. \ifx\putwordsection\undefined \gdef\putwordsection{section}\fi
  123. \ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi
  124. \ifx\putwordsee\undefined \gdef\putwordsee{see}\fi
  125. \ifx\putwordSee\undefined \gdef\putwordSee{See}\fi
  126. \ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi
  127. \ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi
  128. %
  129. \ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
  130. \ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
  131. \ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
  132. \ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
  133. \ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
  134. \ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
  135. \ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
  136. \ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
  137. \ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
  138. \ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
  139. \ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
  140. \ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
  141. %
  142. \ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi
  143. \ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi
  144. \ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi
  145. \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
  146. \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
  147. % Since the category of space is not known, we have to be careful.
  148. \chardef\spacecat = 10
  149. \def\spaceisspace{\catcode`\ =\spacecat}
  150. % sometimes characters are active, so we need control sequences.
  151. \chardef\ampChar = `\&
  152. \chardef\colonChar = `\:
  153. \chardef\commaChar = `\,
  154. \chardef\dashChar = `\-
  155. \chardef\dotChar = `\.
  156. \chardef\exclamChar= `\!
  157. \chardef\hashChar = `\#
  158. \chardef\lquoteChar= `\`
  159. \chardef\questChar = `\?
  160. \chardef\rquoteChar= `\'
  161. \chardef\semiChar = `\;
  162. \chardef\slashChar = `\/
  163. \chardef\underChar = `\_
  164. % Ignore a token.
  165. %
  166. \def\gobble#1{}
  167. % The following is used inside several \edef's.
  168. \def\makecsname#1{\expandafter\noexpand\csname#1\endcsname}
  169. % Hyphenation fixes.
  170. \hyphenation{
  171. Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script
  172. ap-pen-dix bit-map bit-maps
  173. data-base data-bases eshell fall-ing half-way long-est man-u-script
  174. man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm
  175. par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces
  176. spell-ing spell-ings
  177. stand-alone strong-est time-stamp time-stamps which-ever white-space
  178. wide-spread wrap-around
  179. }
  180. % Margin to add to right of even pages, to left of odd pages.
  181. \newdimen\bindingoffset
  182. \newdimen\normaloffset
  183. \newdimen\pagewidth \newdimen\pageheight
  184. % For a final copy, take out the rectangles
  185. % that mark overfull boxes (in case you have decided
  186. % that the text looks ok even though it passes the margin).
  187. %
  188. \def\finalout{\overfullrule=0pt }
  189. % Sometimes it is convenient to have everything in the transcript file
  190. % and nothing on the terminal. We don't just call \tracingall here,
  191. % since that produces some useless output on the terminal. We also make
  192. % some effort to order the tracing commands to reduce output in the log
  193. % file; cf. trace.sty in LaTeX.
  194. %
  195. \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
  196. \def\loggingall{%
  197. \tracingstats2
  198. \tracingpages1
  199. \tracinglostchars2 % 2 gives us more in etex
  200. \tracingparagraphs1
  201. \tracingoutput1
  202. \tracingmacros2
  203. \tracingrestores1
  204. \showboxbreadth\maxdimen \showboxdepth\maxdimen
  205. \ifx\eTeXversion\thisisundefined\else % etex gives us more logging
  206. \tracingscantokens1
  207. \tracingifs1
  208. \tracinggroups1
  209. \tracingnesting2
  210. \tracingassigns1
  211. \fi
  212. \tracingcommands3 % 3 gives us more in etex
  213. \errorcontextlines16
  214. }%
  215. % @errormsg{MSG}. Do the index-like expansions on MSG, but if things
  216. % aren't perfect, it's not the end of the world, being an error message,
  217. % after all.
  218. %
  219. \def\errormsg{\begingroup \indexnofonts \doerrormsg}
  220. \def\doerrormsg#1{\errmessage{#1}}
  221. % add check for \lastpenalty to plain's definitions. If the last thing
  222. % we did was a \nobreak, we don't want to insert more space.
  223. %
  224. \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
  225. \removelastskip\penalty-50\smallskip\fi\fi}
  226. \def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
  227. \removelastskip\penalty-100\medskip\fi\fi}
  228. \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
  229. \removelastskip\penalty-200\bigskip\fi\fi}
  230. % Do @cropmarks to get crop marks.
  231. %
  232. \newif\ifcropmarks
  233. \let\cropmarks = \cropmarkstrue
  234. %
  235. % Dimensions to add cropmarks at corners.
  236. % Added by P. A. MacKay, 12 Nov. 1986
  237. %
  238. \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
  239. \newdimen\cornerlong \cornerlong=1pc
  240. \newdimen\cornerthick \cornerthick=.3pt
  241. \newdimen\topandbottommargin \topandbottommargin=.75in
  242. % Output a mark which sets \thischapter, \thissection and \thiscolor.
  243. % We dump everything together because we only have one kind of mark.
  244. % This works because we only use \botmark / \topmark, not \firstmark.
  245. %
  246. % A mark contains a subexpression of the \ifcase ... \fi construct.
  247. % \get*marks macros below extract the needed part using \ifcase.
  248. %
  249. % Another complication is to let the user choose whether \thischapter
  250. % (\thissection) refers to the chapter (section) in effect at the top
  251. % of a page, or that at the bottom of a page. The solution is
  252. % described on page 260 of The TeXbook. It involves outputting two
  253. % marks for the sectioning macros, one before the section break, and
  254. % one after. I won't pretend I can describe this better than DEK...
  255. \def\domark{%
  256. \toks0=\expandafter{\lastchapterdefs}%
  257. \toks2=\expandafter{\lastsectiondefs}%
  258. \toks4=\expandafter{\prevchapterdefs}%
  259. \toks6=\expandafter{\prevsectiondefs}%
  260. \toks8=\expandafter{\lastcolordefs}%
  261. \mark{%
  262. \the\toks0 \the\toks2
  263. \noexpand\or \the\toks4 \the\toks6
  264. \noexpand\else \the\toks8
  265. }%
  266. }
  267. % \topmark doesn't work for the very first chapter (after the title
  268. % page or the contents), so we use \firstmark there -- this gets us
  269. % the mark with the chapter defs, unless the user sneaks in, e.g.,
  270. % @setcolor (or @url, or @link, etc.) between @contents and the very
  271. % first @chapter.
  272. \def\gettopheadingmarks{%
  273. \ifcase0\topmark\fi
  274. \ifx\thischapter\empty \ifcase0\firstmark\fi \fi
  275. }
  276. \def\getbottomheadingmarks{\ifcase1\botmark\fi}
  277. \def\getcolormarks{\ifcase2\topmark\fi}
  278. % Avoid "undefined control sequence" errors.
  279. \def\lastchapterdefs{}
  280. \def\lastsectiondefs{}
  281. \def\prevchapterdefs{}
  282. \def\prevsectiondefs{}
  283. \def\lastcolordefs{}
  284. % Main output routine.
  285. \chardef\PAGE = 255
  286. \output = {\onepageout{\pagecontents\PAGE}}
  287. \newbox\headlinebox
  288. \newbox\footlinebox
  289. % \onepageout takes a vbox as an argument. Note that \pagecontents
  290. % does insertions, but you have to call it yourself.
  291. \def\onepageout#1{%
  292. \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
  293. %
  294. \ifodd\pageno \advance\hoffset by \bindingoffset
  295. \else \advance\hoffset by -\bindingoffset\fi
  296. %
  297. % Do this outside of the \shipout so @code etc. will be expanded in
  298. % the headline as they should be, not taken literally (outputting ''code).
  299. \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
  300. \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
  301. \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
  302. \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
  303. %
  304. {%
  305. % Have to do this stuff outside the \shipout because we want it to
  306. % take effect in \write's, yet the group defined by the \vbox ends
  307. % before the \shipout runs.
  308. %
  309. \indexdummies % don't expand commands in the output.
  310. \normalturnoffactive % \ in index entries must not stay \, e.g., if
  311. % the page break happens to be in the middle of an example.
  312. % We don't want .vr (or whatever) entries like this:
  313. % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}}
  314. % "\acronym" won't work when it's read back in;
  315. % it needs to be
  316. % {\code {{\tt \backslashcurfont }acronym}
  317. \shipout\vbox{%
  318. % Do this early so pdf references go to the beginning of the page.
  319. \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
  320. %
  321. \ifcropmarks \vbox to \outervsize\bgroup
  322. \hsize = \outerhsize
  323. \vskip-\topandbottommargin
  324. \vtop to0pt{%
  325. \line{\ewtop\hfil\ewtop}%
  326. \nointerlineskip
  327. \line{%
  328. \vbox{\moveleft\cornerthick\nstop}%
  329. \hfill
  330. \vbox{\moveright\cornerthick\nstop}%
  331. }%
  332. \vss}%
  333. \vskip\topandbottommargin
  334. \line\bgroup
  335. \hfil % center the page within the outer (page) hsize.
  336. \ifodd\pageno\hskip\bindingoffset\fi
  337. \vbox\bgroup
  338. \fi
  339. %
  340. \unvbox\headlinebox
  341. \pagebody{#1}%
  342. \ifdim\ht\footlinebox > 0pt
  343. % Only leave this space if the footline is nonempty.
  344. % (We lessened \vsize for it in \oddfootingyyy.)
  345. % The \baselineskip=24pt in plain's \makefootline has no effect.
  346. \vskip 24pt
  347. \unvbox\footlinebox
  348. \fi
  349. %
  350. \ifcropmarks
  351. \egroup % end of \vbox\bgroup
  352. \hfil\egroup % end of (centering) \line\bgroup
  353. \vskip\topandbottommargin plus1fill minus1fill
  354. \boxmaxdepth = \cornerthick
  355. \vbox to0pt{\vss
  356. \line{%
  357. \vbox{\moveleft\cornerthick\nsbot}%
  358. \hfill
  359. \vbox{\moveright\cornerthick\nsbot}%
  360. }%
  361. \nointerlineskip
  362. \line{\ewbot\hfil\ewbot}%
  363. }%
  364. \egroup % \vbox from first cropmarks clause
  365. \fi
  366. }% end of \shipout\vbox
  367. }% end of group with \indexdummies
  368. \advancepageno
  369. \ifnum\outputpenalty>-20000 \else\dosupereject\fi
  370. }
  371. \newinsert\margin \dimen\margin=\maxdimen
  372. \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
  373. {\catcode`\@ =11
  374. \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
  375. % marginal hacks, juha@viisa.uucp (Juha Takala)
  376. \ifvoid\margin\else % marginal info is present
  377. \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
  378. \dimen@=\dp#1\relax \unvbox#1\relax
  379. \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
  380. \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
  381. }
  382. % Here are the rules for the cropmarks. Note that they are
  383. % offset so that the space between them is truly \outerhsize or \outervsize
  384. % (P. A. MacKay, 12 November, 1986)
  385. %
  386. \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
  387. \def\nstop{\vbox
  388. {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
  389. \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
  390. \def\nsbot{\vbox
  391. {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
  392. % Parse an argument, then pass it to #1. The argument is the rest of
  393. % the input line (except we remove a trailing comment). #1 should be a
  394. % macro which expects an ordinary undelimited TeX argument.
  395. %
  396. \def\parsearg{\parseargusing{}}
  397. \def\parseargusing#1#2{%
  398. \def\argtorun{#2}%
  399. \begingroup
  400. \obeylines
  401. \spaceisspace
  402. #1%
  403. \parseargline\empty% Insert the \empty token, see \finishparsearg below.
  404. }
  405. {\obeylines %
  406. \gdef\parseargline#1^^M{%
  407. \endgroup % End of the group started in \parsearg.
  408. \argremovecomment #1\comment\ArgTerm%
  409. }%
  410. }
  411. % First remove any @comment, then any @c comment.
  412. \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
  413. \def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
  414. % Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space.
  415. %
  416. % \argremovec might leave us with trailing space, e.g.,
  417. % @end itemize @c foo
  418. % This space token undergoes the same procedure and is eventually removed
  419. % by \finishparsearg.
  420. %
  421. \def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M}
  422. \def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M}
  423. \def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
  424. \def\temp{#3}%
  425. \ifx\temp\empty
  426. % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp:
  427. \let\temp\finishparsearg
  428. \else
  429. \let\temp\argcheckspaces
  430. \fi
  431. % Put the space token in:
  432. \temp#1 #3\ArgTerm
  433. }
  434. % If a _delimited_ argument is enclosed in braces, they get stripped; so
  435. % to get _exactly_ the rest of the line, we had to prevent such situation.
  436. % We prepended an \empty token at the very beginning and we expand it now,
  437. % just before passing the control to \argtorun.
  438. % (Similarly, we have to think about #3 of \argcheckspacesY above: it is
  439. % either the null string, or it ends with \^^M---thus there is no danger
  440. % that a pair of braces would be stripped.
  441. %
  442. % But first, we have to remove the trailing space token.
  443. %
  444. \def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}}
  445. % \parseargdef\foo{...}
  446. % is roughly equivalent to
  447. % \def\foo{\parsearg\Xfoo}
  448. % \def\Xfoo#1{...}
  449. %
  450. % Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my
  451. % favourite TeX trick. --kasal, 16nov03
  452. \def\parseargdef#1{%
  453. \expandafter \doparseargdef \csname\string#1\endcsname #1%
  454. }
  455. \def\doparseargdef#1#2{%
  456. \def#2{\parsearg#1}%
  457. \def#1##1%
  458. }
  459. % Several utility definitions with active space:
  460. {
  461. \obeyspaces
  462. \gdef\obeyedspace{ }
  463. % Make each space character in the input produce a normal interword
  464. % space in the output. Don't allow a line break at this space, as this
  465. % is used only in environments like @example, where each line of input
  466. % should produce a line of output anyway.
  467. %
  468. \gdef\sepspaces{\obeyspaces\let =\tie}
  469. % If an index command is used in an @example environment, any spaces
  470. % therein should become regular spaces in the raw index file, not the
  471. % expansion of \tie (\leavevmode \penalty \@M \ ).
  472. \gdef\unsepspaces{\let =\space}
  473. }
  474. \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
  475. % Define the framework for environments in texinfo.tex. It's used like this:
  476. %
  477. % \envdef\foo{...}
  478. % \def\Efoo{...}
  479. %
  480. % It's the responsibility of \envdef to insert \begingroup before the
  481. % actual body; @end closes the group after calling \Efoo. \envdef also
  482. % defines \thisenv, so the current environment is known; @end checks
  483. % whether the environment name matches. The \checkenv macro can also be
  484. % used to check whether the current environment is the one expected.
  485. %
  486. % Non-false conditionals (@iftex, @ifset) don't fit into this, so they
  487. % are not treated as environments; they don't open a group. (The
  488. % implementation of @end takes care not to call \endgroup in this
  489. % special case.)
  490. % At run-time, environments start with this:
  491. \def\startenvironment#1{\begingroup\def\thisenv{#1}}
  492. % initialize
  493. \let\thisenv\empty
  494. % ... but they get defined via ``\envdef\foo{...}'':
  495. \long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
  496. \def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
  497. % Check whether we're in the right environment:
  498. \def\checkenv#1{%
  499. \def\temp{#1}%
  500. \ifx\thisenv\temp
  501. \else
  502. \badenverr
  503. \fi
  504. }
  505. % Environment mismatch, #1 expected:
  506. \def\badenverr{%
  507. \errhelp = \EMsimple
  508. \errmessage{This command can appear only \inenvironment\temp,
  509. not \inenvironment\thisenv}%
  510. }
  511. \def\inenvironment#1{%
  512. \ifx#1\empty
  513. outside of any environment%
  514. \else
  515. in environment \expandafter\string#1%
  516. \fi
  517. }
  518. % @end foo executes the definition of \Efoo.
  519. % But first, it executes a specialized version of \checkenv
  520. %
  521. \parseargdef\end{%
  522. \if 1\csname iscond.#1\endcsname
  523. \else
  524. % The general wording of \badenverr may not be ideal.
  525. \expandafter\checkenv\csname#1\endcsname
  526. \csname E#1\endcsname
  527. \endgroup
  528. \fi
  529. }
  530. \newhelp\EMsimple{Press RETURN to continue.}
  531. % Be sure we're in horizontal mode when doing a tie, since we make space
  532. % equivalent to this in @example-like environments. Otherwise, a space
  533. % at the beginning of a line will start with \penalty -- and
  534. % since \penalty is valid in vertical mode, we'd end up putting the
  535. % penalty on the vertical list instead of in the new paragraph.
  536. {\catcode`@ = 11
  537. % Avoid using \@M directly, because that causes trouble
  538. % if the definition is written into an index file.
  539. \global\let\tiepenalty = \@M
  540. \gdef\tie{\leavevmode\penalty\tiepenalty\ }
  541. }
  542. % @: forces normal size whitespace following.
  543. \def\:{\spacefactor=1000 }
  544. % @* forces a line break.
  545. \def\*{\hfil\break\hbox{}\ignorespaces}
  546. % @/ allows a line break.
  547. \let\/=\allowbreak
  548. % @. is an end-of-sentence period.
  549. \def\.{.\spacefactor=\endofsentencespacefactor\space}
  550. % @! is an end-of-sentence bang.
  551. \def\!{!\spacefactor=\endofsentencespacefactor\space}
  552. % @? is an end-of-sentence query.
  553. \def\?{?\spacefactor=\endofsentencespacefactor\space}
  554. % @frenchspacing on|off says whether to put extra space after punctuation.
  555. %
  556. \def\onword{on}
  557. \def\offword{off}
  558. %
  559. \parseargdef\frenchspacing{%
  560. \def\temp{#1}%
  561. \ifx\temp\onword \plainfrenchspacing
  562. \else\ifx\temp\offword \plainnonfrenchspacing
  563. \else
  564. \errhelp = \EMsimple
  565. \errmessage{Unknown @frenchspacing option `\temp', must be on|off}%
  566. \fi\fi
  567. }
  568. % @w prevents a word break. Without the \leavevmode, @w at the
  569. % beginning of a paragraph, when TeX is still in vertical mode, would
  570. % produce a whole line of output instead of starting the paragraph.
  571. \def\w#1{\leavevmode\hbox{#1}}
  572. % @group ... @end group forces ... to be all on one page, by enclosing
  573. % it in a TeX vbox. We use \vtop instead of \vbox to construct the box
  574. % to keep its height that of a normal line. According to the rules for
  575. % \topskip (p.114 of the TeXbook), the glue inserted is
  576. % max (\topskip - \ht (first item), 0). If that height is large,
  577. % therefore, no glue is inserted, and the space between the headline and
  578. % the text is small, which looks bad.
  579. %
  580. % Another complication is that the group might be very large. This can
  581. % cause the glue on the previous page to be unduly stretched, because it
  582. % does not have much material. In this case, it's better to add an
  583. % explicit \vfill so that the extra space is at the bottom. The
  584. % threshold for doing this is if the group is more than \vfilllimit
  585. % percent of a page (\vfilllimit can be changed inside of @tex).
  586. %
  587. \newbox\groupbox
  588. \def\vfilllimit{0.7}
  589. %
  590. \envdef\group{%
  591. \ifnum\catcode`\^^M=\active \else
  592. \errhelp = \groupinvalidhelp
  593. \errmessage{@group invalid in context where filling is enabled}%
  594. \fi
  595. \startsavinginserts
  596. %
  597. \setbox\groupbox = \vtop\bgroup
  598. % Do @comment since we are called inside an environment such as
  599. % @example, where each end-of-line in the input causes an
  600. % end-of-line in the output. We don't want the end-of-line after
  601. % the `@group' to put extra space in the output. Since @group
  602. % should appear on a line by itself (according to the Texinfo
  603. % manual), we don't worry about eating any user text.
  604. \comment
  605. }
  606. %
  607. % The \vtop produces a box with normal height and large depth; thus, TeX puts
  608. % \baselineskip glue before it, and (when the next line of text is done)
  609. % \lineskip glue after it. Thus, space below is not quite equal to space
  610. % above. But it's pretty close.
  611. \def\Egroup{%
  612. % To get correct interline space between the last line of the group
  613. % and the first line afterwards, we have to propagate \prevdepth.
  614. \endgraf % Not \par, as it may have been set to \lisppar.
  615. \global\dimen1 = \prevdepth
  616. \egroup % End the \vtop.
  617. % \dimen0 is the vertical size of the group's box.
  618. \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox
  619. % \dimen2 is how much space is left on the page (more or less).
  620. \dimen2 = \pageheight \advance\dimen2 by -\pagetotal
  621. % if the group doesn't fit on the current page, and it's a big big
  622. % group, force a page break.
  623. \ifdim \dimen0 > \dimen2
  624. \ifdim \pagetotal < \vfilllimit\pageheight
  625. \page
  626. \fi
  627. \fi
  628. \box\groupbox
  629. \prevdepth = \dimen1
  630. \checkinserts
  631. }
  632. %
  633. % TeX puts in an \escapechar (i.e., `@') at the beginning of the help
  634. % message, so this ends up printing `@group can only ...'.
  635. %
  636. \newhelp\groupinvalidhelp{%
  637. group can only be used in environments such as @example,^^J%
  638. where each line of input produces a line of output.}
  639. % @need space-in-mils
  640. % forces a page break if there is not space-in-mils remaining.
  641. \newdimen\mil \mil=0.001in
  642. \parseargdef\need{%
  643. % Ensure vertical mode, so we don't make a big box in the middle of a
  644. % paragraph.
  645. \par
  646. %
  647. % If the @need value is less than one line space, it's useless.
  648. \dimen0 = #1\mil
  649. \dimen2 = \ht\strutbox
  650. \advance\dimen2 by \dp\strutbox
  651. \ifdim\dimen0 > \dimen2
  652. %
  653. % Do a \strut just to make the height of this box be normal, so the
  654. % normal leading is inserted relative to the preceding line.
  655. % And a page break here is fine.
  656. \vtop to #1\mil{\strut\vfil}%
  657. %
  658. % TeX does not even consider page breaks if a penalty added to the
  659. % main vertical list is 10000 or more. But in order to see if the
  660. % empty box we just added fits on the page, we must make it consider
  661. % page breaks. On the other hand, we don't want to actually break the
  662. % page after the empty box. So we use a penalty of 9999.
  663. %
  664. % There is an extremely small chance that TeX will actually break the
  665. % page at this \penalty, if there are no other feasible breakpoints in
  666. % sight. (If the user is using lots of big @group commands, which
  667. % almost-but-not-quite fill up a page, TeX will have a hard time doing
  668. % good page breaking, for example.) However, I could not construct an
  669. % example where a page broke at this \penalty; if it happens in a real
  670. % document, then we can reconsider our strategy.
  671. \penalty9999
  672. %
  673. % Back up by the size of the box, whether we did a page break or not.
  674. \kern -#1\mil
  675. %
  676. % Do not allow a page break right after this kern.
  677. \nobreak
  678. \fi
  679. }
  680. % @br forces paragraph break (and is undocumented).
  681. \let\br = \par
  682. % @page forces the start of a new page.
  683. %
  684. \def\page{\par\vfill\supereject}
  685. % @exdent text....
  686. % outputs text on separate line in roman font, starting at standard page margin
  687. % This records the amount of indent in the innermost environment.
  688. % That's how much \exdent should take out.
  689. \newskip\exdentamount
  690. % This defn is used inside fill environments such as @defun.
  691. \parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
  692. % This defn is used inside nofill environments such as @example.
  693. \parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount
  694. \leftline{\hskip\leftskip{\rm#1}}}}
  695. % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
  696. % paragraph. For more general purposes, use the \margin insertion
  697. % class. WHICH is `l' or `r'. Not documented, written for gawk manual.
  698. %
  699. \newskip\inmarginspacing \inmarginspacing=1cm
  700. \def\strutdepth{\dp\strutbox}
  701. %
  702. \def\doinmargin#1#2{\strut\vadjust{%
  703. \nobreak
  704. \kern-\strutdepth
  705. \vtop to \strutdepth{%
  706. \baselineskip=\strutdepth
  707. \vss
  708. % if you have multiple lines of stuff to put here, you'll need to
  709. % make the vbox yourself of the appropriate size.
  710. \ifx#1l%
  711. \llap{\ignorespaces #2\hskip\inmarginspacing}%
  712. \else
  713. \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
  714. \fi
  715. \null
  716. }%
  717. }}
  718. \def\inleftmargin{\doinmargin l}
  719. \def\inrightmargin{\doinmargin r}
  720. %
  721. % @inmargin{TEXT [, RIGHT-TEXT]}
  722. % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
  723. % else use TEXT for both).
  724. %
  725. \def\inmargin#1{\parseinmargin #1,,\finish}
  726. \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
  727. \setbox0 = \hbox{\ignorespaces #2}%
  728. \ifdim\wd0 > 0pt
  729. \def\lefttext{#1}% have both texts
  730. \def\righttext{#2}%
  731. \else
  732. \def\lefttext{#1}% have only one text
  733. \def\righttext{#1}%
  734. \fi
  735. %
  736. \ifodd\pageno
  737. \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
  738. \else
  739. \def\temp{\inleftmargin\lefttext}%
  740. \fi
  741. \temp
  742. }
  743. % @| inserts a changebar to the left of the current line. It should
  744. % surround any changed text. This approach does *not* work if the
  745. % change spans more than two lines of output. To handle that, we would
  746. % have adopt a much more difficult approach (putting marks into the main
  747. % vertical list for the beginning and end of each change). This command
  748. % is not documented, not supported, and doesn't work.
  749. %
  750. \def\|{%
  751. % \vadjust can only be used in horizontal mode.
  752. \leavevmode
  753. %
  754. % Append this vertical mode material after the current line in the output.
  755. \vadjust{%
  756. % We want to insert a rule with the height and depth of the current
  757. % leading; that is exactly what \strutbox is supposed to record.
  758. \vskip-\baselineskip
  759. %
  760. % \vadjust-items are inserted at the left edge of the type. So
  761. % the \llap here moves out into the left-hand margin.
  762. \llap{%
  763. %
  764. % For a thicker or thinner bar, change the `1pt'.
  765. \vrule height\baselineskip width1pt
  766. %
  767. % This is the space between the bar and the text.
  768. \hskip 12pt
  769. }%
  770. }%
  771. }
  772. % @include FILE -- \input text of FILE.
  773. %
  774. \def\include{\parseargusing\filenamecatcodes\includezzz}
  775. \def\includezzz#1{%
  776. \pushthisfilestack
  777. \def\thisfile{#1}%
  778. {%
  779. \makevalueexpandable % we want to expand any @value in FILE.
  780. \turnoffactive % and allow special characters in the expansion
  781. \indexnofonts % Allow `@@' and other weird things in file names.
  782. \wlog{texinfo.tex: doing @include of #1^^J}%
  783. \edef\temp{\noexpand\input #1 }%
  784. %
  785. % This trickery is to read FILE outside of a group, in case it makes
  786. % definitions, etc.
  787. \expandafter
  788. }\temp
  789. \popthisfilestack
  790. }
  791. \def\filenamecatcodes{%
  792. \catcode`\\=\other
  793. \catcode`~=\other
  794. \catcode`^=\other
  795. \catcode`_=\other
  796. \catcode`|=\other
  797. \catcode`<=\other
  798. \catcode`>=\other
  799. \catcode`+=\other
  800. \catcode`-=\other
  801. \catcode`\`=\other
  802. \catcode`\'=\other
  803. }
  804. \def\pushthisfilestack{%
  805. \expandafter\pushthisfilestackX\popthisfilestack\StackTerm
  806. }
  807. \def\pushthisfilestackX{%
  808. \expandafter\pushthisfilestackY\thisfile\StackTerm
  809. }
  810. \def\pushthisfilestackY #1\StackTerm #2\StackTerm {%
  811. \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}%
  812. }
  813. \def\popthisfilestack{\errthisfilestackempty}
  814. \def\errthisfilestackempty{\errmessage{Internal error:
  815. the stack of filenames is empty.}}
  816. %
  817. \def\thisfile{}
  818. % @center line
  819. % outputs that line, centered.
  820. %
  821. \parseargdef\center{%
  822. \ifhmode
  823. \let\centersub\centerH
  824. \else
  825. \let\centersub\centerV
  826. \fi
  827. \centersub{\hfil \ignorespaces#1\unskip \hfil}%
  828. \let\centersub\relax % don't let the definition persist, just in case
  829. }
  830. \def\centerH#1{{%
  831. \hfil\break
  832. \advance\hsize by -\leftskip
  833. \advance\hsize by -\rightskip
  834. \line{#1}%
  835. \break
  836. }}
  837. %
  838. \newcount\centerpenalty
  839. \def\centerV#1{%
  840. % The idea here is the same as in \startdefun, \cartouche, etc.: if
  841. % @center is the first thing after a section heading, we need to wipe
  842. % out the negative parskip inserted by \sectionheading, but still
  843. % prevent a page break here.
  844. \centerpenalty = \lastpenalty
  845. \ifnum\centerpenalty>10000 \vskip\parskip \fi
  846. \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi
  847. \line{\kern\leftskip #1\kern\rightskip}%
  848. }
  849. % @sp n outputs n lines of vertical space
  850. %
  851. \parseargdef\sp{\vskip #1\baselineskip}
  852. % @comment ...line which is ignored...
  853. % @c is the same as @comment
  854. % @ignore ... @end ignore is another way to write a comment
  855. %
  856. \def\comment{\begingroup \catcode`\^^M=\other%
  857. \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
  858. \commentxxx}
  859. {\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
  860. %
  861. \let\c=\comment
  862. % @paragraphindent NCHARS
  863. % We'll use ems for NCHARS, close enough.
  864. % NCHARS can also be the word `asis' or `none'.
  865. % We cannot feasibly implement @paragraphindent asis, though.
  866. %
  867. \def\asisword{asis} % no translation, these are keywords
  868. \def\noneword{none}
  869. %
  870. \parseargdef\paragraphindent{%
  871. \def\temp{#1}%
  872. \ifx\temp\asisword
  873. \else
  874. \ifx\temp\noneword
  875. \defaultparindent = 0pt
  876. \else
  877. \defaultparindent = #1em
  878. \fi
  879. \fi
  880. \parindent = \defaultparindent
  881. }
  882. % @exampleindent NCHARS
  883. % We'll use ems for NCHARS like @paragraphindent.
  884. % It seems @exampleindent asis isn't necessary, but
  885. % I preserve it to make it similar to @paragraphindent.
  886. \parseargdef\exampleindent{%
  887. \def\temp{#1}%
  888. \ifx\temp\asisword
  889. \else
  890. \ifx\temp\noneword
  891. \lispnarrowing = 0pt
  892. \else
  893. \lispnarrowing = #1em
  894. \fi
  895. \fi
  896. }
  897. % @firstparagraphindent WORD
  898. % If WORD is `none', then suppress indentation of the first paragraph
  899. % after a section heading. If WORD is `insert', then do indent at such
  900. % paragraphs.
  901. %
  902. % The paragraph indentation is suppressed or not by calling
  903. % \suppressfirstparagraphindent, which the sectioning commands do.
  904. % We switch the definition of this back and forth according to WORD.
  905. % By default, we suppress indentation.
  906. %
  907. \def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
  908. \def\insertword{insert}
  909. %
  910. \parseargdef\firstparagraphindent{%
  911. \def\temp{#1}%
  912. \ifx\temp\noneword
  913. \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
  914. \else\ifx\temp\insertword
  915. \let\suppressfirstparagraphindent = \relax
  916. \else
  917. \errhelp = \EMsimple
  918. \errmessage{Unknown @firstparagraphindent option `\temp'}%
  919. \fi\fi
  920. }
  921. % Here is how we actually suppress indentation. Redefine \everypar to
  922. % \kern backwards by \parindent, and then reset itself to empty.
  923. %
  924. % We also make \indent itself not actually do anything until the next
  925. % paragraph.
  926. %
  927. \gdef\dosuppressfirstparagraphindent{%
  928. \gdef\indent{%
  929. \restorefirstparagraphindent
  930. \indent
  931. }%
  932. \gdef\noindent{%
  933. \restorefirstparagraphindent
  934. \noindent
  935. }%
  936. \global\everypar = {%
  937. \kern -\parindent
  938. \restorefirstparagraphindent
  939. }%
  940. }
  941. \gdef\restorefirstparagraphindent{%
  942. \global \let \indent = \ptexindent
  943. \global \let \noindent = \ptexnoindent
  944. \global \everypar = {}%
  945. }
  946. % @refill is a no-op.
  947. \let\refill=\relax
  948. % If working on a large document in chapters, it is convenient to
  949. % be able to disable indexing, cross-referencing, and contents, for test runs.
  950. % This is done with @novalidate (before @setfilename).
  951. %
  952. \newif\iflinks \linkstrue % by default we want the aux files.
  953. \let\novalidate = \linksfalse
  954. % @setfilename is done at the beginning of every texinfo file.
  955. % So open here the files we need to have open while reading the input.
  956. % This makes it possible to make a .fmt file for texinfo.
  957. \def\setfilename{%
  958. \fixbackslash % Turn off hack to swallow `\input texinfo'.
  959. \iflinks
  960. \tryauxfile
  961. % Open the new aux file. TeX will close it automatically at exit.
  962. \immediate\openout\auxfile=\jobname.aux
  963. \fi % \openindices needs to do some work in any case.
  964. \openindices
  965. \let\setfilename=\comment % Ignore extra @setfilename cmds.
  966. %
  967. % If texinfo.cnf is present on the system, read it.
  968. % Useful for site-wide @afourpaper, etc.
  969. \openin 1 texinfo.cnf
  970. \ifeof 1 \else \input texinfo.cnf \fi
  971. \closein 1
  972. %
  973. \comment % Ignore the actual filename.
  974. }
  975. % Called from \setfilename.
  976. %
  977. \def\openindices{%
  978. \newindex{cp}%
  979. \newcodeindex{fn}%
  980. \newcodeindex{vr}%
  981. \newcodeindex{tp}%
  982. \newcodeindex{ky}%
  983. \newcodeindex{pg}%
  984. }
  985. % @bye.
  986. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
  987. \message{pdf,}
  988. % adobe `portable' document format
  989. \newcount\tempnum
  990. \newcount\lnkcount
  991. \newtoks\filename
  992. \newcount\filenamelength
  993. \newcount\pgn
  994. \newtoks\toksA
  995. \newtoks\toksB
  996. \newtoks\toksC
  997. \newtoks\toksD
  998. \newbox\boxA
  999. \newcount\countA
  1000. \newif\ifpdf
  1001. \newif\ifpdfmakepagedest
  1002. % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
  1003. % can be set). So we test for \relax and 0 as well as being undefined.
  1004. \ifx\pdfoutput\thisisundefined
  1005. \else
  1006. \ifx\pdfoutput\relax
  1007. \else
  1008. \ifcase\pdfoutput
  1009. \else
  1010. \pdftrue
  1011. \fi
  1012. \fi
  1013. \fi
  1014. % PDF uses PostScript string constants for the names of xref targets,
  1015. % for display in the outlines, and in other places. Thus, we have to
  1016. % double any backslashes. Otherwise, a name like "\node" will be
  1017. % interpreted as a newline (\n), followed by o, d, e. Not good.
  1018. %
  1019. % See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and
  1020. % related messages. The final outcome is that it is up to the TeX user
  1021. % to double the backslashes and otherwise make the string valid, so
  1022. % that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to
  1023. % do this reliably, so we use it.
  1024. % #1 is a control sequence in which to do the replacements,
  1025. % which we \xdef.
  1026. \def\txiescapepdf#1{%
  1027. \ifx\pdfescapestring\relax
  1028. % No primitive available; should we give a warning or log?
  1029. % Many times it won't matter.
  1030. \else
  1031. % The expandable \pdfescapestring primitive escapes parentheses,
  1032. % backslashes, and other special chars.
  1033. \xdef#1{\pdfescapestring{#1}}%
  1034. \fi
  1035. }
  1036. \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
  1037. with PDF output, and none of those formats could be found. (.eps cannot
  1038. be supported due to the design of the PDF format; use regular TeX (DVI
  1039. output) for that.)}
  1040. \ifpdf
  1041. %
  1042. % Color manipulation macros based on pdfcolor.tex,
  1043. % except using rgb instead of cmyk; the latter is said to render as a
  1044. % very dark gray on-screen and a very dark halftone in print, instead
  1045. % of actual black.
  1046. \def\rgbDarkRed{0.50 0.09 0.12}
  1047. \def\rgbBlack{0 0 0}
  1048. %
  1049. % k sets the color for filling (usual text, etc.);
  1050. % K sets the color for stroking (thin rules, e.g., normal _'s).
  1051. \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}}
  1052. %
  1053. % Set color, and create a mark which defines \thiscolor accordingly,
  1054. % so that \makeheadline knows which color to restore.
  1055. \def\setcolor#1{%
  1056. \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}%
  1057. \domark
  1058. \pdfsetcolor{#1}%
  1059. }
  1060. %
  1061. \def\maincolor{\rgbBlack}
  1062. \pdfsetcolor{\maincolor}
  1063. \edef\thiscolor{\maincolor}
  1064. \def\lastcolordefs{}
  1065. %
  1066. \def\makefootline{%
  1067. \baselineskip24pt
  1068. \line{\pdfsetcolor{\maincolor}\the\footline}%
  1069. }
  1070. %
  1071. \def\makeheadline{%
  1072. \vbox to 0pt{%
  1073. \vskip-22.5pt
  1074. \line{%
  1075. \vbox to8.5pt{}%
  1076. % Extract \thiscolor definition from the marks.
  1077. \getcolormarks
  1078. % Typeset the headline with \maincolor, then restore the color.
  1079. \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
  1080. }%
  1081. \vss
  1082. }%
  1083. \nointerlineskip
  1084. }
  1085. %
  1086. %
  1087. \pdfcatalog{/PageMode /UseOutlines}
  1088. %
  1089. % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
  1090. \def\dopdfimage#1#2#3{%
  1091. \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
  1092. \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
  1093. %
  1094. % pdftex (and the PDF format) support .pdf, .png, .jpg (among
  1095. % others). Let's try in that order, PDF first since if
  1096. % someone has a scalable image, presumably better to use that than a
  1097. % bitmap.
  1098. \let\pdfimgext=\empty
  1099. \begingroup
  1100. \openin 1 #1.pdf \ifeof 1
  1101. \openin 1 #1.PDF \ifeof 1
  1102. \openin 1 #1.png \ifeof 1
  1103. \openin 1 #1.jpg \ifeof 1
  1104. \openin 1 #1.jpeg \ifeof 1
  1105. \openin 1 #1.JPG \ifeof 1
  1106. \errhelp = \nopdfimagehelp
  1107. \errmessage{Could not find image file #1 for pdf}%
  1108. \else \gdef\pdfimgext{JPG}%
  1109. \fi
  1110. \else \gdef\pdfimgext{jpeg}%
  1111. \fi
  1112. \else \gdef\pdfimgext{jpg}%
  1113. \fi
  1114. \else \gdef\pdfimgext{png}%
  1115. \fi
  1116. \else \gdef\pdfimgext{PDF}%
  1117. \fi
  1118. \else \gdef\pdfimgext{pdf}%
  1119. \fi
  1120. \closein 1
  1121. \endgroup
  1122. %
  1123. % without \immediate, ancient pdftex seg faults when the same image is
  1124. % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.)
  1125. \ifnum\pdftexversion < 14
  1126. \immediate\pdfimage
  1127. \else
  1128. \immediate\pdfximage
  1129. \fi
  1130. \ifdim \wd0 >0pt width \pdfimagewidth \fi
  1131. \ifdim \wd2 >0pt height \pdfimageheight \fi
  1132. \ifnum\pdftexversion<13
  1133. #1.\pdfimgext
  1134. \else
  1135. {#1.\pdfimgext}%
  1136. \fi
  1137. \ifnum\pdftexversion < 14 \else
  1138. \pdfrefximage \pdflastximage
  1139. \fi}
  1140. %
  1141. \def\pdfmkdest#1{{%
  1142. % We have to set dummies so commands such as @code, and characters
  1143. % such as \, aren't expanded when present in a section title.
  1144. \indexnofonts
  1145. \turnoffactive
  1146. \makevalueexpandable
  1147. \def\pdfdestname{#1}%
  1148. \txiescapepdf\pdfdestname
  1149. \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
  1150. }}
  1151. %
  1152. % used to mark target names; must be expandable.
  1153. \def\pdfmkpgn#1{#1}
  1154. %
  1155. % by default, use a color that is dark enough to print on paper as
  1156. % nearly black, but still distinguishable for online viewing.
  1157. \def\urlcolor{\rgbDarkRed}
  1158. \def\linkcolor{\rgbDarkRed}
  1159. \def\endlink{\setcolor{\maincolor}\pdfendlink}
  1160. %
  1161. % Adding outlines to PDF; macros for calculating structure of outlines
  1162. % come from Petr Olsak
  1163. \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
  1164. \else \csname#1\endcsname \fi}
  1165. \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
  1166. \advance\tempnum by 1
  1167. \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
  1168. %
  1169. % #1 is the section text, which is what will be displayed in the
  1170. % outline by the pdf viewer. #2 is the pdf expression for the number
  1171. % of subentries (or empty, for subsubsections). #3 is the node text,
  1172. % which might be empty if this toc entry had no corresponding node.
  1173. % #4 is the page number
  1174. %
  1175. \def\dopdfoutline#1#2#3#4{%
  1176. % Generate a link to the node text if that exists; else, use the
  1177. % page number. We could generate a destination for the section
  1178. % text in the case where a section has no node, but it doesn't
  1179. % seem worth the trouble, since most documents are normally structured.
  1180. \edef\pdfoutlinedest{#3}%
  1181. \ifx\pdfoutlinedest\empty
  1182. \def\pdfoutlinedest{#4}%
  1183. \else
  1184. \txiescapepdf\pdfoutlinedest
  1185. \fi
  1186. %
  1187. % Also escape PDF chars in the display string.
  1188. \edef\pdfoutlinetext{#1}%
  1189. \txiescapepdf\pdfoutlinetext
  1190. %
  1191. \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
  1192. }
  1193. %
  1194. \def\pdfmakeoutlines{%
  1195. \begingroup
  1196. % Read toc silently, to get counts of subentries for \pdfoutline.
  1197. \def\partentry##1##2##3##4{}% ignore parts in the outlines
  1198. \def\numchapentry##1##2##3##4{%
  1199. \def\thischapnum{##2}%
  1200. \def\thissecnum{0}%
  1201. \def\thissubsecnum{0}%
  1202. }%
  1203. \def\numsecentry##1##2##3##4{%
  1204. \advancenumber{chap\thischapnum}%
  1205. \def\thissecnum{##2}%
  1206. \def\thissubsecnum{0}%
  1207. }%
  1208. \def\numsubsecentry##1##2##3##4{%
  1209. \advancenumber{sec\thissecnum}%
  1210. \def\thissubsecnum{##2}%
  1211. }%
  1212. \def\numsubsubsecentry##1##2##3##4{%
  1213. \advancenumber{subsec\thissubsecnum}%
  1214. }%
  1215. \def\thischapnum{0}%
  1216. \def\thissecnum{0}%
  1217. \def\thissubsecnum{0}%
  1218. %
  1219. % use \def rather than \let here because we redefine \chapentry et
  1220. % al. a second time, below.
  1221. \def\appentry{\numchapentry}%
  1222. \def\appsecentry{\numsecentry}%
  1223. \def\appsubsecentry{\numsubsecentry}%
  1224. \def\appsubsubsecentry{\numsubsubsecentry}%
  1225. \def\unnchapentry{\numchapentry}%
  1226. \def\unnsecentry{\numsecentry}%
  1227. \def\unnsubsecentry{\numsubsecentry}%
  1228. \def\unnsubsubsecentry{\numsubsubsecentry}%
  1229. \readdatafile{toc}%
  1230. %
  1231. % Read toc second time, this time actually producing the outlines.
  1232. % The `-' means take the \expnumber as the absolute number of
  1233. % subentries, which we calculated on our first read of the .toc above.
  1234. %
  1235. % We use the node names as the destinations.
  1236. \def\numchapentry##1##2##3##4{%
  1237. \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
  1238. \def\numsecentry##1##2##3##4{%
  1239. \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
  1240. \def\numsubsecentry##1##2##3##4{%
  1241. \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%
  1242. \def\numsubsubsecentry##1##2##3##4{% count is always zero
  1243. \dopdfoutline{##1}{}{##3}{##4}}%
  1244. %
  1245. % PDF outlines are displayed using system fonts, instead of
  1246. % document fonts. Therefore we cannot use special characters,
  1247. % since the encoding is unknown. For example, the eogonek from
  1248. % Latin 2 (0xea) gets translated to a | character. Info from
  1249. % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
  1250. %
  1251. % TODO this right, we have to translate 8-bit characters to
  1252. % their "best" equivalent, based on the @documentencoding. Too
  1253. % much work for too little return. Just use the ASCII equivalents
  1254. % we use for the index sort strings.
  1255. %
  1256. \indexnofonts
  1257. \setupdatafile
  1258. % We can have normal brace characters in the PDF outlines, unlike
  1259. % Texinfo index files. So set that up.
  1260. \def\{{\lbracecharliteral}%
  1261. \def\}{\rbracecharliteral}%
  1262. \catcode`\\=\active \otherbackslash
  1263. \input \tocreadfilename
  1264. \endgroup
  1265. }
  1266. {\catcode`[=1 \catcode`]=2
  1267. \catcode`{=\other \catcode`}=\other
  1268. \gdef\lbracecharliteral[{]%
  1269. \gdef\rbracecharliteral[}]%
  1270. ]
  1271. %
  1272. \def\skipspaces#1{\def\PP{#1}\def\D{|}%
  1273. \ifx\PP\D\let\nextsp\relax
  1274. \else\let\nextsp\skipspaces
  1275. \ifx\p\space\else\addtokens{\filename}{\PP}%
  1276. \advance\filenamelength by 1
  1277. \fi
  1278. \fi
  1279. \nextsp}
  1280. \def\getfilename#1{%
  1281. \filenamelength=0
  1282. % If we don't expand the argument now, \skipspaces will get
  1283. % snagged on things like "@value{foo}".
  1284. \edef\temp{#1}%
  1285. \expandafter\skipspaces\temp|\relax
  1286. }
  1287. \ifnum\pdftexversion < 14
  1288. \let \startlink \pdfannotlink
  1289. \else
  1290. \let \startlink \pdfstartlink
  1291. \fi
  1292. % make a live url in pdf output.
  1293. \def\pdfurl#1{%
  1294. \begingroup
  1295. % it seems we really need yet another set of dummies; have not
  1296. % tried to figure out what each command should do in the context
  1297. % of @url. for now, just make @/ a no-op, that's the only one
  1298. % people have actually reported a problem with.
  1299. %
  1300. \normalturnoffactive
  1301. \def\@{@}%
  1302. \let\/=\empty
  1303. \makevalueexpandable
  1304. % do we want to go so far as to use \indexnofonts instead of just
  1305. % special-casing \var here?
  1306. \def\var##1{##1}%
  1307. %
  1308. \leavevmode\setcolor{\urlcolor}%
  1309. \startlink attr{/Border [0 0 0]}%
  1310. user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
  1311. \endgroup}
  1312. \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
  1313. \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
  1314. \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
  1315. \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
  1316. \def\maketoks{%
  1317. \expandafter\poptoks\the\toksA|ENDTOKS|\relax
  1318. \ifx\first0\adn0
  1319. \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
  1320. \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
  1321. \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
  1322. \else
  1323. \ifnum0=\countA\else\makelink\fi
  1324. \ifx\first.\let\next=\done\else
  1325. \let\next=\maketoks
  1326. \addtokens{\toksB}{\the\toksD}
  1327. \ifx\first,\addtokens{\toksB}{\space}\fi
  1328. \fi
  1329. \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
  1330. \next}
  1331. \def\makelink{\addtokens{\toksB}%
  1332. {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
  1333. \def\pdflink#1{%
  1334. \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
  1335. \setcolor{\linkcolor}#1\endlink}
  1336. \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
  1337. \else
  1338. % non-pdf mode
  1339. \let\pdfmkdest = \gobble
  1340. \let\pdfurl = \gobble
  1341. \let\endlink = \relax
  1342. \let\setcolor = \gobble
  1343. \let\pdfsetcolor = \gobble
  1344. \let\pdfmakeoutlines = \relax
  1345. \fi % \ifx\pdfoutput
  1346. \message{fonts,}
  1347. % Change the current font style to #1, remembering it in \curfontstyle.
  1348. % For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
  1349. % italics, not bold italics.
  1350. %
  1351. \def\setfontstyle#1{%
  1352. \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
  1353. \csname ten#1\endcsname % change the current font
  1354. }
  1355. % Select #1 fonts with the current style.
  1356. %
  1357. \def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname}
  1358. \def\rm{\fam=0 \setfontstyle{rm}}
  1359. \def\it{\fam=\itfam \setfontstyle{it}}
  1360. \def\sl{\fam=\slfam \setfontstyle{sl}}
  1361. \def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
  1362. \def\tt{\fam=\ttfam \setfontstyle{tt}}
  1363. % Unfortunately, we have to override this for titles and the like, since
  1364. % in those cases "rm" is bold. Sigh.
  1365. \def\rmisbold{\rm\def\curfontstyle{bf}}
  1366. % Texinfo sort of supports the sans serif font style, which plain TeX does not.
  1367. % So we set up a \sf.
  1368. \newfam\sffam
  1369. \def\sf{\fam=\sffam \setfontstyle{sf}}
  1370. \let\li = \sf % Sometimes we call it \li, not \sf.
  1371. % We don't need math for this font style.
  1372. \def\ttsl{\setfontstyle{ttsl}}
  1373. % Default leading.
  1374. \newdimen\textleading \textleading = 13.2pt
  1375. % Set the baselineskip to #1, and the lineskip and strut size
  1376. % correspondingly. There is no deep meaning behind these magic numbers
  1377. % used as factors; they just match (closely enough) what Knuth defined.
  1378. %
  1379. \def\lineskipfactor{.08333}
  1380. \def\strutheightpercent{.70833}
  1381. \def\strutdepthpercent {.29167}
  1382. %
  1383. % can get a sort of poor man's double spacing by redefining this.
  1384. \def\baselinefactor{1}
  1385. %
  1386. \def\setleading#1{%
  1387. \dimen0 = #1\relax
  1388. \normalbaselineskip = \baselinefactor\dimen0
  1389. \normallineskip = \lineskipfactor\normalbaselineskip
  1390. \normalbaselines
  1391. \setbox\strutbox =\hbox{%
  1392. \vrule width0pt height\strutheightpercent\baselineskip
  1393. depth \strutdepthpercent \baselineskip
  1394. }%
  1395. }
  1396. % PDF CMaps. See also LaTeX's t1.cmap.
  1397. %
  1398. % do nothing with this by default.
  1399. \expandafter\let\csname cmapOT1\endcsname\gobble
  1400. \expandafter\let\csname cmapOT1IT\endcsname\gobble
  1401. \expandafter\let\csname cmapOT1TT\endcsname\gobble
  1402. % if we are producing pdf, and we have \pdffontattr, then define cmaps.
  1403. % (\pdffontattr was introduced many years ago, but people still run
  1404. % older pdftex's; it's easy to conditionalize, so we do.)
  1405. \ifpdf \ifx\pdffontattr\thisisundefined \else
  1406. \begingroup
  1407. \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
  1408. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
  1409. %%DocumentNeededResources: ProcSet (CIDInit)
  1410. %%IncludeResource: ProcSet (CIDInit)
  1411. %%BeginResource: CMap (TeX-OT1-0)
  1412. %%Title: (TeX-OT1-0 TeX OT1 0)
  1413. %%Version: 1.000
  1414. %%EndComments
  1415. /CIDInit /ProcSet findresource begin
  1416. 12 dict begin
  1417. begincmap
  1418. /CIDSystemInfo
  1419. << /Registry (TeX)
  1420. /Ordering (OT1)
  1421. /Supplement 0
  1422. >> def
  1423. /CMapName /TeX-OT1-0 def
  1424. /CMapType 2 def
  1425. 1 begincodespacerange
  1426. <00> <7F>
  1427. endcodespacerange
  1428. 8 beginbfrange
  1429. <00> <01> <0393>
  1430. <09> <0A> <03A8>
  1431. <23> <26> <0023>
  1432. <28> <3B> <0028>
  1433. <3F> <5B> <003F>
  1434. <5D> <5E> <005D>
  1435. <61> <7A> <0061>
  1436. <7B> <7C> <2013>
  1437. endbfrange
  1438. 40 beginbfchar
  1439. <02> <0398>
  1440. <03> <039B>
  1441. <04> <039E>
  1442. <05> <03A0>
  1443. <06> <03A3>
  1444. <07> <03D2>
  1445. <08> <03A6>
  1446. <0B> <00660066>
  1447. <0C> <00660069>
  1448. <0D> <0066006C>
  1449. <0E> <006600660069>
  1450. <0F> <00660066006C>
  1451. <10> <0131>
  1452. <11> <0237>
  1453. <12> <0060>
  1454. <13> <00B4>
  1455. <14> <02C7>
  1456. <15> <02D8>
  1457. <16> <00AF>
  1458. <17> <02DA>
  1459. <18> <00B8>
  1460. <19> <00DF>
  1461. <1A> <00E6>
  1462. <1B> <0153>
  1463. <1C> <00F8>
  1464. <1D> <00C6>
  1465. <1E> <0152>
  1466. <1F> <00D8>
  1467. <21> <0021>
  1468. <22> <201D>
  1469. <27> <2019>
  1470. <3C> <00A1>
  1471. <3D> <003D>
  1472. <3E> <00BF>
  1473. <5C> <201C>
  1474. <5F> <02D9>
  1475. <60> <2018>
  1476. <7D> <02DD>
  1477. <7E> <007E>
  1478. <7F> <00A8>
  1479. endbfchar
  1480. endcmap
  1481. CMapName currentdict /CMap defineresource pop
  1482. end
  1483. end
  1484. %%EndResource
  1485. %%EOF
  1486. }\endgroup
  1487. \expandafter\edef\csname cmapOT1\endcsname#1{%
  1488. \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
  1489. }%
  1490. %
  1491. % \cmapOT1IT
  1492. \begingroup
  1493. \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
  1494. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
  1495. %%DocumentNeededResources: ProcSet (CIDInit)
  1496. %%IncludeResource: ProcSet (CIDInit)
  1497. %%BeginResource: CMap (TeX-OT1IT-0)
  1498. %%Title: (TeX-OT1IT-0 TeX OT1IT 0)
  1499. %%Version: 1.000
  1500. %%EndComments
  1501. /CIDInit /ProcSet findresource begin
  1502. 12 dict begin
  1503. begincmap
  1504. /CIDSystemInfo
  1505. << /Registry (TeX)
  1506. /Ordering (OT1IT)
  1507. /Supplement 0
  1508. >> def
  1509. /CMapName /TeX-OT1IT-0 def
  1510. /CMapType 2 def
  1511. 1 begincodespacerange
  1512. <00> <7F>
  1513. endcodespacerange
  1514. 8 beginbfrange
  1515. <00> <01> <0393>
  1516. <09> <0A> <03A8>
  1517. <25> <26> <0025>
  1518. <28> <3B> <0028>
  1519. <3F> <5B> <003F>
  1520. <5D> <5E> <005D>
  1521. <61> <7A> <0061>
  1522. <7B> <7C> <2013>
  1523. endbfrange
  1524. 42 beginbfchar
  1525. <02> <0398>
  1526. <03> <039B>
  1527. <04> <039E>
  1528. <05> <03A0>
  1529. <06> <03A3>
  1530. <07> <03D2>
  1531. <08> <03A6>
  1532. <0B> <00660066>
  1533. <0C> <00660069>
  1534. <0D> <0066006C>
  1535. <0E> <006600660069>
  1536. <0F> <00660066006C>
  1537. <10> <0131>
  1538. <11> <0237>
  1539. <12> <0060>
  1540. <13> <00B4>
  1541. <14> <02C7>
  1542. <15> <02D8>
  1543. <16> <00AF>
  1544. <17> <02DA>
  1545. <18> <00B8>
  1546. <19> <00DF>
  1547. <1A> <00E6>
  1548. <1B> <0153>
  1549. <1C> <00F8>
  1550. <1D> <00C6>
  1551. <1E> <0152>
  1552. <1F> <00D8>
  1553. <21> <0021>
  1554. <22> <201D>
  1555. <23> <0023>
  1556. <24> <00A3>
  1557. <27> <2019>
  1558. <3C> <00A1>
  1559. <3D> <003D>
  1560. <3E> <00BF>
  1561. <5C> <201C>
  1562. <5F> <02D9>
  1563. <60> <2018>
  1564. <7D> <02DD>
  1565. <7E> <007E>
  1566. <7F> <00A8>
  1567. endbfchar
  1568. endcmap
  1569. CMapName currentdict /CMap defineresource pop
  1570. end
  1571. end
  1572. %%EndResource
  1573. %%EOF
  1574. }\endgroup
  1575. \expandafter\edef\csname cmapOT1IT\endcsname#1{%
  1576. \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
  1577. }%
  1578. %
  1579. % \cmapOT1TT
  1580. \begingroup
  1581. \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
  1582. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
  1583. %%DocumentNeededResources: ProcSet (CIDInit)
  1584. %%IncludeResource: ProcSet (CIDInit)
  1585. %%BeginResource: CMap (TeX-OT1TT-0)
  1586. %%Title: (TeX-OT1TT-0 TeX OT1TT 0)
  1587. %%Version: 1.000
  1588. %%EndComments
  1589. /CIDInit /ProcSet findresource begin
  1590. 12 dict begin
  1591. begincmap
  1592. /CIDSystemInfo
  1593. << /Registry (TeX)
  1594. /Ordering (OT1TT)
  1595. /Supplement 0
  1596. >> def
  1597. /CMapName /TeX-OT1TT-0 def
  1598. /CMapType 2 def
  1599. 1 begincodespacerange
  1600. <00> <7F>
  1601. endcodespacerange
  1602. 5 beginbfrange
  1603. <00> <01> <0393>
  1604. <09> <0A> <03A8>
  1605. <21> <26> <0021>
  1606. <28> <5F> <0028>
  1607. <61> <7E> <0061>
  1608. endbfrange
  1609. 32 beginbfchar
  1610. <02> <0398>
  1611. <03> <039B>
  1612. <04> <039E>
  1613. <05> <03A0>
  1614. <06> <03A3>
  1615. <07> <03D2>
  1616. <08> <03A6>
  1617. <0B> <2191>
  1618. <0C> <2193>
  1619. <0D> <0027>
  1620. <0E> <00A1>
  1621. <0F> <00BF>
  1622. <10> <0131>
  1623. <11> <0237>
  1624. <12> <0060>
  1625. <13> <00B4>
  1626. <14> <02C7>
  1627. <15> <02D8>
  1628. <16> <00AF>
  1629. <17> <02DA>
  1630. <18> <00B8>
  1631. <19> <00DF>
  1632. <1A> <00E6>
  1633. <1B> <0153>
  1634. <1C> <00F8>
  1635. <1D> <00C6>
  1636. <1E> <0152>
  1637. <1F> <00D8>
  1638. <20> <2423>
  1639. <27> <2019>
  1640. <60> <2018>
  1641. <7F> <00A8>
  1642. endbfchar
  1643. endcmap
  1644. CMapName currentdict /CMap defineresource pop
  1645. end
  1646. end
  1647. %%EndResource
  1648. %%EOF
  1649. }\endgroup
  1650. \expandafter\edef\csname cmapOT1TT\endcsname#1{%
  1651. \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
  1652. }%
  1653. \fi\fi
  1654. % Set the font macro #1 to the font named #2, adding on the
  1655. % specified font prefix (normally `cm').
  1656. % #3 is the font's design size, #4 is a scale factor, #5 is the CMap
  1657. % encoding (currently only OT1, OT1IT and OT1TT are allowed, pass
  1658. % empty to omit).
  1659. \def\setfont#1#2#3#4#5{%
  1660. \font#1=\fontprefix#2#3 scaled #4
  1661. \csname cmap#5\endcsname#1%
  1662. }
  1663. % This is what gets called when #5 of \setfont is empty.
  1664. \let\cmap\gobble
  1665. % emacs-page end of cmaps
  1666. % Use cm as the default font prefix.
  1667. % To specify the font prefix, you must define \fontprefix
  1668. % before you read in texinfo.tex.
  1669. \ifx\fontprefix\thisisundefined
  1670. \def\fontprefix{cm}
  1671. \fi
  1672. % Support font families that don't use the same naming scheme as CM.
  1673. \def\rmshape{r}
  1674. \def\rmbshape{bx} %where the normal face is bold
  1675. \def\bfshape{b}
  1676. \def\bxshape{bx}
  1677. \def\ttshape{tt}
  1678. \def\ttbshape{tt}
  1679. \def\ttslshape{sltt}
  1680. \def\itshape{ti}
  1681. \def\itbshape{bxti}
  1682. \def\slshape{sl}
  1683. \def\slbshape{bxsl}
  1684. \def\sfshape{ss}
  1685. \def\sfbshape{ss}
  1686. \def\scshape{csc}
  1687. \def\scbshape{csc}
  1688. % Definitions for a main text size of 11pt. This is the default in
  1689. % Texinfo.
  1690. %
  1691. \def\definetextfontsizexi{%
  1692. % Text fonts (11.2pt, magstep1).
  1693. \def\textnominalsize{11pt}
  1694. \edef\mainmagstep{\magstephalf}
  1695. \setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
  1696. \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
  1697. \setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
  1698. \setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
  1699. \setfont\textsl\slshape{10}{\mainmagstep}{OT1}
  1700. \setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
  1701. \setfont\textsc\scshape{10}{\mainmagstep}{OT1}
  1702. \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
  1703. \font\texti=cmmi10 scaled \mainmagstep
  1704. \font\textsy=cmsy10 scaled \mainmagstep
  1705. \def\textecsize{1095}
  1706. % A few fonts for @defun names and args.
  1707. \setfont\defbf\bfshape{10}{\magstep1}{OT1}
  1708. \setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
  1709. \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
  1710. \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
  1711. % Fonts for indices, footnotes, small examples (9pt).
  1712. \def\smallnominalsize{9pt}
  1713. \setfont\smallrm\rmshape{9}{1000}{OT1}
  1714. \setfont\smalltt\ttshape{9}{1000}{OT1TT}
  1715. \setfont\smallbf\bfshape{10}{900}{OT1}
  1716. \setfont\smallit\itshape{9}{1000}{OT1IT}
  1717. \setfont\smallsl\slshape{9}{1000}{OT1}
  1718. \setfont\smallsf\sfshape{9}{1000}{OT1}
  1719. \setfont\smallsc\scshape{10}{900}{OT1}
  1720. \setfont\smallttsl\ttslshape{10}{900}{OT1TT}
  1721. \font\smalli=cmmi9
  1722. \font\smallsy=cmsy9
  1723. \def\smallecsize{0900}
  1724. % Fonts for small examples (8pt).
  1725. \def\smallernominalsize{8pt}
  1726. \setfont\smallerrm\rmshape{8}{1000}{OT1}
  1727. \setfont\smallertt\ttshape{8}{1000}{OT1TT}
  1728. \setfont\smallerbf\bfshape{10}{800}{OT1}
  1729. \setfont\smallerit\itshape{8}{1000}{OT1IT}
  1730. \setfont\smallersl\slshape{8}{1000}{OT1}
  1731. \setfont\smallersf\sfshape{8}{1000}{OT1}
  1732. \setfont\smallersc\scshape{10}{800}{OT1}
  1733. \setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
  1734. \font\smalleri=cmmi8
  1735. \font\smallersy=cmsy8
  1736. \def\smallerecsize{0800}
  1737. % Fonts for title page (20.4pt):
  1738. \def\titlenominalsize{20pt}
  1739. \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
  1740. \setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
  1741. \setfont\titlesl\slbshape{10}{\magstep4}{OT1}
  1742. \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
  1743. \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
  1744. \setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
  1745. \let\titlebf=\titlerm
  1746. \setfont\titlesc\scbshape{10}{\magstep4}{OT1}
  1747. \font\titlei=cmmi12 scaled \magstep3
  1748. \font\titlesy=cmsy10 scaled \magstep4
  1749. \def\titleecsize{2074}
  1750. % Chapter (and unnumbered) fonts (17.28pt).
  1751. \def\chapnominalsize{17pt}
  1752. \setfont\chaprm\rmbshape{12}{\magstep2}{OT1}
  1753. \setfont\chapit\itbshape{10}{\magstep3}{OT1IT}
  1754. \setfont\chapsl\slbshape{10}{\magstep3}{OT1}
  1755. \setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT}
  1756. \setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT}
  1757. \setfont\chapsf\sfbshape{17}{1000}{OT1}
  1758. \let\chapbf=\chaprm
  1759. \setfont\chapsc\scbshape{10}{\magstep3}{OT1}
  1760. \font\chapi=cmmi12 scaled \magstep2
  1761. \font\chapsy=cmsy10 scaled \magstep3
  1762. \def\chapecsize{1728}
  1763. % Section fonts (14.4pt).
  1764. \def\secnominalsize{14pt}
  1765. \setfont\secrm\rmbshape{12}{\magstep1}{OT1}
  1766. \setfont\secit\itbshape{10}{\magstep2}{OT1IT}
  1767. \setfont\secsl\slbshape{10}{\magstep2}{OT1}
  1768. \setfont\sectt\ttbshape{12}{\magstep1}{OT1TT}
  1769. \setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT}
  1770. \setfont\secsf\sfbshape{12}{\magstep1}{OT1}
  1771. \let\secbf\secrm
  1772. \setfont\secsc\scbshape{10}{\magstep2}{OT1}
  1773. \font\seci=cmmi12 scaled \magstep1
  1774. \font\secsy=cmsy10 scaled \magstep2
  1775. \def\sececsize{1440}
  1776. % Subsection fonts (13.15pt).
  1777. \def\ssecnominalsize{13pt}
  1778. \setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1}
  1779. \setfont\ssecit\itbshape{10}{1315}{OT1IT}
  1780. \setfont\ssecsl\slbshape{10}{1315}{OT1}
  1781. \setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT}
  1782. \setfont\ssecttsl\ttslshape{10}{1315}{OT1TT}
  1783. \setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1}
  1784. \let\ssecbf\ssecrm
  1785. \setfont\ssecsc\scbshape{10}{1315}{OT1}
  1786. \font\sseci=cmmi12 scaled \magstephalf
  1787. \font\ssecsy=cmsy10 scaled 1315
  1788. \def\ssececsize{1200}
  1789. % Reduced fonts for @acro in text (10pt).
  1790. \def\reducednominalsize{10pt}
  1791. \setfont\reducedrm\rmshape{10}{1000}{OT1}
  1792. \setfont\reducedtt\ttshape{10}{1000}{OT1TT}
  1793. \setfont\reducedbf\bfshape{10}{1000}{OT1}
  1794. \setfont\reducedit\itshape{10}{1000}{OT1IT}
  1795. \setfont\reducedsl\slshape{10}{1000}{OT1}
  1796. \setfont\reducedsf\sfshape{10}{1000}{OT1}
  1797. \setfont\reducedsc\scshape{10}{1000}{OT1}
  1798. \setfont\reducedttsl\ttslshape{10}{1000}{OT1TT}
  1799. \font\reducedi=cmmi10
  1800. \font\reducedsy=cmsy10
  1801. \def\reducedecsize{1000}
  1802. \textleading = 13.2pt % line spacing for 11pt CM
  1803. \textfonts % reset the current fonts
  1804. \rm
  1805. } % end of 11pt text font size definitions
  1806. % Definitions to make the main text be 10pt Computer Modern, with
  1807. % section, chapter, etc., sizes following suit. This is for the GNU
  1808. % Press printing of the Emacs 22 manual. Maybe other manuals in the
  1809. % future. Used with @smallbook, which sets the leading to 12pt.
  1810. %
  1811. \def\definetextfontsizex{%
  1812. % Text fonts (10pt).
  1813. \def\textnominalsize{10pt}
  1814. \edef\mainmagstep{1000}
  1815. \setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
  1816. \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
  1817. \setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
  1818. \setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
  1819. \setfont\textsl\slshape{10}{\mainmagstep}{OT1}
  1820. \setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
  1821. \setfont\textsc\scshape{10}{\mainmagstep}{OT1}
  1822. \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
  1823. \font\texti=cmmi10 scaled \mainmagstep
  1824. \font\textsy=cmsy10 scaled \mainmagstep
  1825. \def\textecsize{1000}
  1826. % A few fonts for @defun names and args.
  1827. \setfont\defbf\bfshape{10}{\magstephalf}{OT1}
  1828. \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
  1829. \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
  1830. \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
  1831. % Fonts for indices, footnotes, small examples (9pt).
  1832. \def\smallnominalsize{9pt}
  1833. \setfont\smallrm\rmshape{9}{1000}{OT1}
  1834. \setfont\smalltt\ttshape{9}{1000}{OT1TT}
  1835. \setfont\smallbf\bfshape{10}{900}{OT1}
  1836. \setfont\smallit\itshape{9}{1000}{OT1IT}
  1837. \setfont\smallsl\slshape{9}{1000}{OT1}
  1838. \setfont\smallsf\sfshape{9}{1000}{OT1}
  1839. \setfont\smallsc\scshape{10}{900}{OT1}
  1840. \setfont\smallttsl\ttslshape{10}{900}{OT1TT}
  1841. \font\smalli=cmmi9
  1842. \font\smallsy=cmsy9
  1843. \def\smallecsize{0900}
  1844. % Fonts for small examples (8pt).
  1845. \def\smallernominalsize{8pt}
  1846. \setfont\smallerrm\rmshape{8}{1000}{OT1}
  1847. \setfont\smallertt\ttshape{8}{1000}{OT1TT}
  1848. \setfont\smallerbf\bfshape{10}{800}{OT1}
  1849. \setfont\smallerit\itshape{8}{1000}{OT1IT}
  1850. \setfont\smallersl\slshape{8}{1000}{OT1}
  1851. \setfont\smallersf\sfshape{8}{1000}{OT1}
  1852. \setfont\smallersc\scshape{10}{800}{OT1}
  1853. \setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
  1854. \font\smalleri=cmmi8
  1855. \font\smallersy=cmsy8
  1856. \def\smallerecsize{0800}
  1857. % Fonts for title page (20.4pt):
  1858. \def\titlenominalsize{20pt}
  1859. \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
  1860. \setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
  1861. \setfont\titlesl\slbshape{10}{\magstep4}{OT1}
  1862. \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
  1863. \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
  1864. \setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
  1865. \let\titlebf=\titlerm
  1866. \setfont\titlesc\scbshape{10}{\magstep4}{OT1}
  1867. \font\titlei=cmmi12 scaled \magstep3
  1868. \font\titlesy=cmsy10 scaled \magstep4
  1869. \def\titleecsize{2074}
  1870. % Chapter fonts (14.4pt).
  1871. \def\chapnominalsize{14pt}
  1872. \setfont\chaprm\rmbshape{12}{\magstep1}{OT1}
  1873. \setfont\chapit\itbshape{10}{\magstep2}{OT1IT}
  1874. \setfont\chapsl\slbshape{10}{\magstep2}{OT1}
  1875. \setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT}
  1876. \setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT}
  1877. \setfont\chapsf\sfbshape{12}{\magstep1}{OT1}
  1878. \let\chapbf\chaprm
  1879. \setfont\chapsc\scbshape{10}{\magstep2}{OT1}
  1880. \font\chapi=cmmi12 scaled \magstep1
  1881. \font\chapsy=cmsy10 scaled \magstep2
  1882. \def\chapecsize{1440}
  1883. % Section fonts (12pt).
  1884. \def\secnominalsize{12pt}
  1885. \setfont\secrm\rmbshape{12}{1000}{OT1}
  1886. \setfont\secit\itbshape{10}{\magstep1}{OT1IT}
  1887. \setfont\secsl\slbshape{10}{\magstep1}{OT1}
  1888. \setfont\sectt\ttbshape{12}{1000}{OT1TT}
  1889. \setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT}
  1890. \setfont\secsf\sfbshape{12}{1000}{OT1}
  1891. \let\secbf\secrm
  1892. \setfont\secsc\scbshape{10}{\magstep1}{OT1}
  1893. \font\seci=cmmi12
  1894. \font\secsy=cmsy10 scaled \magstep1
  1895. \def\sececsize{1200}
  1896. % Subsection fonts (10pt).
  1897. \def\ssecnominalsize{10pt}
  1898. \setfont\ssecrm\rmbshape{10}{1000}{OT1}
  1899. \setfont\ssecit\itbshape{10}{1000}{OT1IT}
  1900. \setfont\ssecsl\slbshape{10}{1000}{OT1}
  1901. \setfont\ssectt\ttbshape{10}{1000}{OT1TT}
  1902. \setfont\ssecttsl\ttslshape{10}{1000}{OT1TT}
  1903. \setfont\ssecsf\sfbshape{10}{1000}{OT1}
  1904. \let\ssecbf\ssecrm
  1905. \setfont\ssecsc\scbshape{10}{1000}{OT1}
  1906. \font\sseci=cmmi10
  1907. \font\ssecsy=cmsy10
  1908. \def\ssececsize{1000}
  1909. % Reduced fonts for @acro in text (9pt).
  1910. \def\reducednominalsize{9pt}
  1911. \setfont\reducedrm\rmshape{9}{1000}{OT1}
  1912. \setfont\reducedtt\ttshape{9}{1000}{OT1TT}
  1913. \setfont\reducedbf\bfshape{10}{900}{OT1}
  1914. \setfont\reducedit\itshape{9}{1000}{OT1IT}
  1915. \setfont\reducedsl\slshape{9}{1000}{OT1}
  1916. \setfont\reducedsf\sfshape{9}{1000}{OT1}
  1917. \setfont\reducedsc\scshape{10}{900}{OT1}
  1918. \setfont\reducedttsl\ttslshape{10}{900}{OT1TT}
  1919. \font\reducedi=cmmi9
  1920. \font\reducedsy=cmsy9
  1921. \def\reducedecsize{0900}
  1922. \divide\parskip by 2 % reduce space between paragraphs
  1923. \textleading = 12pt % line spacing for 10pt CM
  1924. \textfonts % reset the current fonts
  1925. \rm
  1926. } % end of 10pt text font size definitions
  1927. % We provide the user-level command
  1928. % @fonttextsize 10
  1929. % (or 11) to redefine the text font size. pt is assumed.
  1930. %
  1931. \def\xiword{11}
  1932. \def\xword{10}
  1933. \def\xwordpt{10pt}
  1934. %
  1935. \parseargdef\fonttextsize{%
  1936. \def\textsizearg{#1}%
  1937. %\wlog{doing @fonttextsize \textsizearg}%
  1938. %
  1939. % Set \globaldefs so that documents can use this inside @tex, since
  1940. % makeinfo 4.8 does not support it, but we need it nonetheless.
  1941. %
  1942. \begingroup \globaldefs=1
  1943. \ifx\textsizearg\xword \definetextfontsizex
  1944. \else \ifx\textsizearg\xiword \definetextfontsizexi
  1945. \else
  1946. \errhelp=\EMsimple
  1947. \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
  1948. \fi\fi
  1949. \endgroup
  1950. }
  1951. % In order for the font changes to affect most math symbols and letters,
  1952. % we have to define the \textfont of the standard families. Since
  1953. % texinfo doesn't allow for producing subscripts and superscripts except
  1954. % in the main text, we don't bother to reset \scriptfont and
  1955. % \scriptscriptfont (which would also require loading a lot more fonts).
  1956. %
  1957. \def\resetmathfonts{%
  1958. \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy
  1959. \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf
  1960. \textfont\ttfam=\tentt \textfont\sffam=\tensf
  1961. }
  1962. % The font-changing commands redefine the meanings of \tenSTYLE, instead
  1963. % of just \STYLE. We do this because \STYLE needs to also set the
  1964. % current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire
  1965. % \tenSTYLE to set the current font.
  1966. %
  1967. % Each font-changing command also sets the names \lsize (one size lower)
  1968. % and \lllsize (three sizes lower). These relative commands are used in
  1969. % the LaTeX logo and acronyms.
  1970. %
  1971. % This all needs generalizing, badly.
  1972. %
  1973. \def\textfonts{%
  1974. \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
  1975. \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
  1976. \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
  1977. \let\tenttsl=\textttsl
  1978. \def\curfontsize{text}%
  1979. \def\lsize{reduced}\def\lllsize{smaller}%
  1980. \resetmathfonts \setleading{\textleading}}
  1981. \def\titlefonts{%
  1982. \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
  1983. \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
  1984. \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
  1985. \let\tenttsl=\titlettsl
  1986. \def\curfontsize{title}%
  1987. \def\lsize{chap}\def\lllsize{subsec}%
  1988. \resetmathfonts \setleading{27pt}}
  1989. \def\titlefont#1{{\titlefonts\rmisbold #1}}
  1990. \def\chapfonts{%
  1991. \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
  1992. \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
  1993. \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
  1994. \let\tenttsl=\chapttsl
  1995. \def\curfontsize{chap}%
  1996. \def\lsize{sec}\def\lllsize{text}%
  1997. \resetmathfonts \setleading{19pt}}
  1998. \def\secfonts{%
  1999. \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
  2000. \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
  2001. \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
  2002. \let\tenttsl=\secttsl
  2003. \def\curfontsize{sec}%
  2004. \def\lsize{subsec}\def\lllsize{reduced}%
  2005. \resetmathfonts \setleading{16pt}}
  2006. \def\subsecfonts{%
  2007. \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
  2008. \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
  2009. \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
  2010. \let\tenttsl=\ssecttsl
  2011. \def\curfontsize{ssec}%
  2012. \def\lsize{text}\def\lllsize{small}%
  2013. \resetmathfonts \setleading{15pt}}
  2014. \let\subsubsecfonts = \subsecfonts
  2015. \def\reducedfonts{%
  2016. \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl
  2017. \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc
  2018. \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy
  2019. \let\tenttsl=\reducedttsl
  2020. \def\curfontsize{reduced}%
  2021. \def\lsize{small}\def\lllsize{smaller}%
  2022. \resetmathfonts \setleading{10.5pt}}
  2023. \def\smallfonts{%
  2024. \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
  2025. \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
  2026. \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
  2027. \let\tenttsl=\smallttsl
  2028. \def\curfontsize{small}%
  2029. \def\lsize{smaller}\def\lllsize{smaller}%
  2030. \resetmathfonts \setleading{10.5pt}}
  2031. \def\smallerfonts{%
  2032. \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
  2033. \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
  2034. \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
  2035. \let\tenttsl=\smallerttsl
  2036. \def\curfontsize{smaller}%
  2037. \def\lsize{smaller}\def\lllsize{smaller}%
  2038. \resetmathfonts \setleading{9.5pt}}
  2039. % Fonts for short table of contents.
  2040. \setfont\shortcontrm\rmshape{12}{1000}{OT1}
  2041. \setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12
  2042. \setfont\shortcontsl\slshape{12}{1000}{OT1}
  2043. \setfont\shortconttt\ttshape{12}{1000}{OT1TT}
  2044. % Define these just so they can be easily changed for other fonts.
  2045. \def\angleleft{$\langle$}
  2046. \def\angleright{$\rangle$}
  2047. % Set the fonts to use with the @small... environments.
  2048. \let\smallexamplefonts = \smallfonts
  2049. % About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample
  2050. % can fit this many characters:
  2051. % 8.5x11=86 smallbook=72 a4=90 a5=69
  2052. % If we use \scriptfonts (8pt), then we can fit this many characters:
  2053. % 8.5x11=90+ smallbook=80 a4=90+ a5=77
  2054. % For me, subjectively, the few extra characters that fit aren't worth
  2055. % the additional smallness of 8pt. So I'm making the default 9pt.
  2056. %
  2057. % By the way, for comparison, here's what fits with @example (10pt):
  2058. % 8.5x11=71 smallbook=60 a4=75 a5=58
  2059. % --karl, 24jan03.
  2060. % Set up the default fonts, so we can use them for creating boxes.
  2061. %
  2062. \definetextfontsizexi
  2063. \message{markup,}
  2064. % Check if we are currently using a typewriter font. Since all the
  2065. % Computer Modern typewriter fonts have zero interword stretch (and
  2066. % shrink), and it is reasonable to expect all typewriter fonts to have
  2067. % this property, we can check that font parameter.
  2068. %
  2069. \def\ifmonospace{\ifdim\fontdimen3\font=0pt }
  2070. % Markup style infrastructure. \defmarkupstylesetup\INITMACRO will
  2071. % define and register \INITMACRO to be called on markup style changes.
  2072. % \INITMACRO can check \currentmarkupstyle for the innermost
  2073. % style and the set of \ifmarkupSTYLE switches for all styles
  2074. % currently in effect.
  2075. \newif\ifmarkupvar
  2076. \newif\ifmarkupsamp
  2077. \newif\ifmarkupkey
  2078. %\newif\ifmarkupfile % @file == @samp.
  2079. %\newif\ifmarkupoption % @option == @samp.
  2080. \newif\ifmarkupcode
  2081. \newif\ifmarkupkbd
  2082. %\newif\ifmarkupenv % @env == @code.
  2083. %\newif\ifmarkupcommand % @command == @code.
  2084. \newif\ifmarkuptex % @tex (and part of @math, for now).
  2085. \newif\ifmarkupexample
  2086. \newif\ifmarkupverb
  2087. \newif\ifmarkupverbatim
  2088. \let\currentmarkupstyle\empty
  2089. \def\setupmarkupstyle#1{%
  2090. \csname markup#1true\endcsname
  2091. \def\currentmarkupstyle{#1}%
  2092. \markupstylesetup
  2093. }
  2094. \let\markupstylesetup\empty
  2095. \def\defmarkupstylesetup#1{%
  2096. \expandafter\def\expandafter\markupstylesetup
  2097. \expandafter{\markupstylesetup #1}%
  2098. \def#1%
  2099. }
  2100. % Markup style setup for left and right quotes.
  2101. \defmarkupstylesetup\markupsetuplq{%
  2102. \expandafter\let\expandafter \temp
  2103. \csname markupsetuplq\currentmarkupstyle\endcsname
  2104. \ifx\temp\relax \markupsetuplqdefault \else \temp \fi
  2105. }
  2106. \defmarkupstylesetup\markupsetuprq{%
  2107. \expandafter\let\expandafter \temp
  2108. \csname markupsetuprq\currentmarkupstyle\endcsname
  2109. \ifx\temp\relax \markupsetuprqdefault \else \temp \fi
  2110. }
  2111. {
  2112. \catcode`\'=\active
  2113. \catcode`\`=\active
  2114. \gdef\markupsetuplqdefault{\let`\lq}
  2115. \gdef\markupsetuprqdefault{\let'\rq}
  2116. \gdef\markupsetcodequoteleft{\let`\codequoteleft}
  2117. \gdef\markupsetcodequoteright{\let'\codequoteright}
  2118. \gdef\markupsetnoligaturesquoteleft{\let`\noligaturesquoteleft}
  2119. }
  2120. \let\markupsetuplqcode \markupsetcodequoteleft
  2121. \let\markupsetuprqcode \markupsetcodequoteright
  2122. %
  2123. \let\markupsetuplqexample \markupsetcodequoteleft
  2124. \let\markupsetuprqexample \markupsetcodequoteright
  2125. %
  2126. \let\markupsetuplqsamp \markupsetcodequoteleft
  2127. \let\markupsetuprqsamp \markupsetcodequoteright
  2128. %
  2129. \let\markupsetuplqverb \markupsetcodequoteleft
  2130. \let\markupsetuprqverb \markupsetcodequoteright
  2131. %
  2132. \let\markupsetuplqverbatim \markupsetcodequoteleft
  2133. \let\markupsetuprqverbatim \markupsetcodequoteright
  2134. \let\markupsetuplqkbd \markupsetnoligaturesquoteleft
  2135. % Allow an option to not use regular directed right quote/apostrophe
  2136. % (char 0x27), but instead the undirected quote from cmtt (char 0x0d).
  2137. % The undirected quote is ugly, so don't make it the default, but it
  2138. % works for pasting with more pdf viewers (at least evince), the
  2139. % lilypond developers report. xpdf does work with the regular 0x27.
  2140. %
  2141. \def\codequoteright{%
  2142. \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
  2143. \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
  2144. '%
  2145. \else \char'15 \fi
  2146. \else \char'15 \fi
  2147. }
  2148. %
  2149. % and a similar option for the left quote char vs. a grave accent.
  2150. % Modern fonts display ASCII 0x60 as a grave accent, so some people like
  2151. % the code environments to do likewise.
  2152. %
  2153. \def\codequoteleft{%
  2154. \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
  2155. \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
  2156. % [Knuth] pp. 380,381,391
  2157. % \relax disables Spanish ligatures ?` and !` of \tt font.
  2158. \relax`%
  2159. \else \char'22 \fi
  2160. \else \char'22 \fi
  2161. }
  2162. % Commands to set the quote options.
  2163. %
  2164. \parseargdef\codequoteundirected{%
  2165. \def\temp{#1}%
  2166. \ifx\temp\onword
  2167. \expandafter\let\csname SETtxicodequoteundirected\endcsname
  2168. = t%
  2169. \else\ifx\temp\offword
  2170. \expandafter\let\csname SETtxicodequoteundirected\endcsname
  2171. = \relax
  2172. \else
  2173. \errhelp = \EMsimple
  2174. \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}%
  2175. \fi\fi
  2176. }
  2177. %
  2178. \parseargdef\codequotebacktick{%
  2179. \def\temp{#1}%
  2180. \ifx\temp\onword
  2181. \expandafter\let\csname SETtxicodequotebacktick\endcsname
  2182. = t%
  2183. \else\ifx\temp\offword
  2184. \expandafter\let\csname SETtxicodequotebacktick\endcsname
  2185. = \relax
  2186. \else
  2187. \errhelp = \EMsimple
  2188. \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}%
  2189. \fi\fi
  2190. }
  2191. % [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
  2192. \def\noligaturesquoteleft{\relax\lq}
  2193. % Count depth in font-changes, for error checks
  2194. \newcount\fontdepth \fontdepth=0
  2195. % Font commands.
  2196. % #1 is the font command (\sl or \it), #2 is the text to slant.
  2197. % If we are in a monospaced environment, however, 1) always use \ttsl,
  2198. % and 2) do not add an italic correction.
  2199. \def\dosmartslant#1#2{%
  2200. \ifusingtt
  2201. {{\ttsl #2}\let\next=\relax}%
  2202. {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}%
  2203. \next
  2204. }
  2205. \def\smartslanted{\dosmartslant\sl}
  2206. \def\smartitalic{\dosmartslant\it}
  2207. % Output an italic correction unless \next (presumed to be the following
  2208. % character) is such as not to need one.
  2209. \def\smartitaliccorrection{%
  2210. \ifx\next,%
  2211. \else\ifx\next-%
  2212. \else\ifx\next.%
  2213. \else\ptexslash
  2214. \fi\fi\fi
  2215. \aftersmartic
  2216. }
  2217. % like \smartslanted except unconditionally uses \ttsl, and no ic.
  2218. % @var is set to this for defun arguments.
  2219. \def\ttslanted#1{{\ttsl #1}}
  2220. % @cite is like \smartslanted except unconditionally use \sl. We never want
  2221. % ttsl for book titles, do we?
  2222. \def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection}
  2223. \def\aftersmartic{}
  2224. \def\var#1{%
  2225. \let\saveaftersmartic = \aftersmartic
  2226. \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}%
  2227. \smartslanted{#1}%
  2228. }
  2229. \let\i=\smartitalic
  2230. \let\slanted=\smartslanted
  2231. \let\dfn=\smartslanted
  2232. \let\emph=\smartitalic
  2233. % Explicit font changes: @r, @sc, undocumented @ii.
  2234. \def\r#1{{\rm #1}} % roman font
  2235. \def\sc#1{{\smallcaps#1}} % smallcaps font
  2236. \def\ii#1{{\it #1}} % italic font
  2237. % @b, explicit bold. Also @strong.
  2238. \def\b#1{{\bf #1}}
  2239. \let\strong=\b
  2240. % @sansserif, explicit sans.
  2241. \def\sansserif#1{{\sf #1}}
  2242. % We can't just use \exhyphenpenalty, because that only has effect at
  2243. % the end of a paragraph. Restore normal hyphenation at the end of the
  2244. % group within which \nohyphenation is presumably called.
  2245. %
  2246. \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
  2247. \def\restorehyphenation{\hyphenchar\font = `- }
  2248. % Set sfcode to normal for the chars that usually have another value.
  2249. % Can't use plain's \frenchspacing because it uses the `\x notation, and
  2250. % sometimes \x has an active definition that messes things up.
  2251. %
  2252. \catcode`@=11
  2253. \def\plainfrenchspacing{%
  2254. \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m
  2255. \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m
  2256. \def\endofsentencespacefactor{1000}% for @. and friends
  2257. }
  2258. \def\plainnonfrenchspacing{%
  2259. \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000
  2260. \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250
  2261. \def\endofsentencespacefactor{3000}% for @. and friends
  2262. }
  2263. \catcode`@=\other
  2264. \def\endofsentencespacefactor{3000}% default
  2265. % @t, explicit typewriter.
  2266. \def\t#1{%
  2267. {\tt \rawbackslash \plainfrenchspacing #1}%
  2268. \null
  2269. }
  2270. % @samp.
  2271. \def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}}
  2272. % definition of @key that produces a lozenge. Doesn't adjust to text size.
  2273. %\setfont\keyrm\rmshape{8}{1000}{OT1}
  2274. %\font\keysy=cmsy9
  2275. %\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
  2276. % \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
  2277. % \vbox{\hrule\kern-0.4pt
  2278. % \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
  2279. % \kern-0.4pt\hrule}%
  2280. % \kern-.06em\raise0.4pt\hbox{\angleright}}}}
  2281. % definition of @key with no lozenge. If the current font is already
  2282. % monospace, don't change it; that way, we respect @kbdinputstyle. But
  2283. % if it isn't monospace, then use \tt.
  2284. %
  2285. \def\key#1{{\setupmarkupstyle{key}%
  2286. \nohyphenation
  2287. \ifmonospace\else\tt\fi
  2288. #1}\null}
  2289. % ctrl is no longer a Texinfo command.
  2290. \def\ctrl #1{{\tt \rawbackslash \hat}#1}
  2291. % @file, @option are the same as @samp.
  2292. \let\file=\samp
  2293. \let\option=\samp
  2294. % @code is a modification of @t,
  2295. % which makes spaces the same size as normal in the surrounding text.
  2296. \def\tclose#1{%
  2297. {%
  2298. % Change normal interword space to be same as for the current font.
  2299. \spaceskip = \fontdimen2\font
  2300. %
  2301. % Switch to typewriter.
  2302. \tt
  2303. %
  2304. % But `\ ' produces the large typewriter interword space.
  2305. \def\ {{\spaceskip = 0pt{} }}%
  2306. %
  2307. % Turn off hyphenation.
  2308. \nohyphenation
  2309. %
  2310. \rawbackslash
  2311. \plainfrenchspacing
  2312. #1%
  2313. }%
  2314. \null % reset spacefactor to 1000
  2315. }
  2316. % We *must* turn on hyphenation at `-' and `_' in @code.
  2317. % Otherwise, it is too hard to avoid overfull hboxes
  2318. % in the Emacs manual, the Library manual, etc.
  2319. % Unfortunately, TeX uses one parameter (\hyphenchar) to control
  2320. % both hyphenation at - and hyphenation within words.
  2321. % We must therefore turn them both off (\tclose does that)
  2322. % and arrange explicitly to hyphenate at a dash.
  2323. % -- rms.
  2324. {
  2325. \catcode`\-=\active \catcode`\_=\active
  2326. \catcode`\'=\active \catcode`\`=\active
  2327. \global\let'=\rq \global\let`=\lq % default definitions
  2328. %
  2329. \global\def\code{\begingroup
  2330. \setupmarkupstyle{code}%
  2331. % The following should really be moved into \setupmarkupstyle handlers.
  2332. \catcode\dashChar=\active \catcode\underChar=\active
  2333. \ifallowcodebreaks
  2334. \let-\codedash
  2335. \let_\codeunder
  2336. \else
  2337. \let-\realdash
  2338. \let_\realunder
  2339. \fi
  2340. \codex
  2341. }
  2342. }
  2343. \def\codex #1{\tclose{#1}\endgroup}
  2344. \def\realdash{-}
  2345. \def\codedash{-\discretionary{}{}{}}
  2346. \def\codeunder{%
  2347. % this is all so @math{@code{var_name}+1} can work. In math mode, _
  2348. % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
  2349. % will therefore expand the active definition of _, which is us
  2350. % (inside @code that is), therefore an endless loop.
  2351. \ifusingtt{\ifmmode
  2352. \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
  2353. \else\normalunderscore \fi
  2354. \discretionary{}{}{}}%
  2355. {\_}%
  2356. }
  2357. % An additional complication: the above will allow breaks after, e.g.,
  2358. % each of the four underscores in __typeof__. This is undesirable in
  2359. % some manuals, especially if they don't have long identifiers in
  2360. % general. @allowcodebreaks provides a way to control this.
  2361. %
  2362. \newif\ifallowcodebreaks \allowcodebreakstrue
  2363. \def\keywordtrue{true}
  2364. \def\keywordfalse{false}
  2365. \parseargdef\allowcodebreaks{%
  2366. \def\txiarg{#1}%
  2367. \ifx\txiarg\keywordtrue
  2368. \allowcodebreakstrue
  2369. \else\ifx\txiarg\keywordfalse
  2370. \allowcodebreaksfalse
  2371. \else
  2372. \errhelp = \EMsimple
  2373. \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}%
  2374. \fi\fi
  2375. }
  2376. % @uref (abbreviation for `urlref') takes an optional (comma-separated)
  2377. % second argument specifying the text to display and an optional third
  2378. % arg as text to display instead of (rather than in addition to) the url
  2379. % itself. First (mandatory) arg is the url.
  2380. % (This \urefnobreak definition isn't used now, leaving it for a while
  2381. % for comparison.)
  2382. \def\urefnobreak#1{\dourefnobreak #1,,,\finish}
  2383. \def\dourefnobreak#1,#2,#3,#4\finish{\begingroup
  2384. \unsepspaces
  2385. \pdfurl{#1}%
  2386. \setbox0 = \hbox{\ignorespaces #3}%
  2387. \ifdim\wd0 > 0pt
  2388. \unhbox0 % third arg given, show only that
  2389. \else
  2390. \setbox0 = \hbox{\ignorespaces #2}%
  2391. \ifdim\wd0 > 0pt
  2392. \ifpdf
  2393. \unhbox0 % PDF: 2nd arg given, show only it
  2394. \else
  2395. \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
  2396. \fi
  2397. \else
  2398. \code{#1}% only url given, so show it
  2399. \fi
  2400. \fi
  2401. \endlink
  2402. \endgroup}
  2403. % This \urefbreak definition is the active one.
  2404. \def\urefbreak{\begingroup \urefcatcodes \dourefbreak}
  2405. \let\uref=\urefbreak
  2406. \def\dourefbreak#1{\urefbreakfinish #1,,,\finish}
  2407. \def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example
  2408. \unsepspaces
  2409. \pdfurl{#1}%
  2410. \setbox0 = \hbox{\ignorespaces #3}%
  2411. \ifdim\wd0 > 0pt
  2412. \unhbox0 % third arg given, show only that
  2413. \else
  2414. \setbox0 = \hbox{\ignorespaces #2}%
  2415. \ifdim\wd0 > 0pt
  2416. \ifpdf
  2417. \unhbox0 % PDF: 2nd arg given, show only it
  2418. \else
  2419. \unhbox0\ (\urefcode{#1})% DVI: 2nd arg given, show both it and url
  2420. \fi
  2421. \else
  2422. \urefcode{#1}% only url given, so show it
  2423. \fi
  2424. \fi
  2425. \endlink
  2426. \endgroup}
  2427. % Allow line breaks around only a few characters (only).
  2428. \def\urefcatcodes{%
  2429. \catcode\ampChar=\active \catcode\dotChar=\active
  2430. \catcode\hashChar=\active \catcode\questChar=\active
  2431. \catcode\slashChar=\active
  2432. }
  2433. {
  2434. \urefcatcodes
  2435. %
  2436. \global\def\urefcode{\begingroup
  2437. \setupmarkupstyle{code}%
  2438. \urefcatcodes
  2439. \let&\urefcodeamp
  2440. \let.\urefcodedot
  2441. \let#\urefcodehash
  2442. \let?\urefcodequest
  2443. \let/\urefcodeslash
  2444. \codex
  2445. }
  2446. %
  2447. % By default, they are just regular characters.
  2448. \global\def&{\normalamp}
  2449. \global\def.{\normaldot}
  2450. \global\def#{\normalhash}
  2451. \global\def?{\normalquest}
  2452. \global\def/{\normalslash}
  2453. }
  2454. % we put a little stretch before and after the breakable chars, to help
  2455. % line breaking of long url's. The unequal skips make look better in
  2456. % cmtt at least, especially for dots.
  2457. \def\urefprestretch{\urefprebreak \hskip0pt plus.13em }
  2458. \def\urefpoststretch{\urefpostbreak \hskip0pt plus.1em }
  2459. %
  2460. \def\urefcodeamp{\urefprestretch \&\urefpoststretch}
  2461. \def\urefcodedot{\urefprestretch .\urefpoststretch}
  2462. \def\urefcodehash{\urefprestretch \#\urefpoststretch}
  2463. \def\urefcodequest{\urefprestretch ?\urefpoststretch}
  2464. \def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
  2465. {
  2466. \catcode`\/=\active
  2467. \global\def\urefcodeslashfinish{%
  2468. \urefprestretch \slashChar
  2469. % Allow line break only after the final / in a sequence of
  2470. % slashes, to avoid line break between the slashes in http://.
  2471. \ifx\next/\else \urefpoststretch \fi
  2472. }
  2473. }
  2474. % One more complication: by default we'll break after the special
  2475. % characters, but some people like to break before the special chars, so
  2476. % allow that. Also allow no breaking at all, for manual control.
  2477. %
  2478. \parseargdef\urefbreakstyle{%
  2479. \def\txiarg{#1}%
  2480. \ifx\txiarg\wordnone
  2481. \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
  2482. \else\ifx\txiarg\wordbefore
  2483. \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak}
  2484. \else\ifx\txiarg\wordafter
  2485. \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak}
  2486. \else
  2487. \errhelp = \EMsimple
  2488. \errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
  2489. \fi\fi\fi
  2490. }
  2491. \def\wordafter{after}
  2492. \def\wordbefore{before}
  2493. \def\wordnone{none}
  2494. \urefbreakstyle after
  2495. % @url synonym for @uref, since that's how everyone uses it.
  2496. %
  2497. \let\url=\uref
  2498. % rms does not like angle brackets --karl, 17may97.
  2499. % So now @email is just like @uref, unless we are pdf.
  2500. %
  2501. %\def\email#1{\angleleft{\tt #1}\angleright}
  2502. \ifpdf
  2503. \def\email#1{\doemail#1,,\finish}
  2504. \def\doemail#1,#2,#3\finish{\begingroup
  2505. \unsepspaces
  2506. \pdfurl{mailto:#1}%
  2507. \setbox0 = \hbox{\ignorespaces #2}%
  2508. \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
  2509. \endlink
  2510. \endgroup}
  2511. \else
  2512. \let\email=\uref
  2513. \fi
  2514. % @kbd is like @code, except that if the argument is just one @key command,
  2515. % then @kbd has no effect.
  2516. \def\kbd#1{{\setupmarkupstyle{kbd}\def\look{#1}\expandafter\kbdfoo\look??\par}}
  2517. % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
  2518. % `example' (@kbd uses ttsl only inside of @example and friends),
  2519. % or `code' (@kbd uses normal tty font always).
  2520. \parseargdef\kbdinputstyle{%
  2521. \def\txiarg{#1}%
  2522. \ifx\txiarg\worddistinct
  2523. \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
  2524. \else\ifx\txiarg\wordexample
  2525. \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
  2526. \else\ifx\txiarg\wordcode
  2527. \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
  2528. \else
  2529. \errhelp = \EMsimple
  2530. \errmessage{Unknown @kbdinputstyle setting `\txiarg'}%
  2531. \fi\fi\fi
  2532. }
  2533. \def\worddistinct{distinct}
  2534. \def\wordexample{example}
  2535. \def\wordcode{code}
  2536. % Default is `distinct'.
  2537. \kbdinputstyle distinct
  2538. \def\xkey{\key}
  2539. \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
  2540. \ifx\one\xkey\ifx\threex\three \key{#2}%
  2541. \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
  2542. \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi}
  2543. % For @indicateurl, @env, @command quotes seem unnecessary, so use \code.
  2544. \let\indicateurl=\code
  2545. \let\env=\code
  2546. \let\command=\code
  2547. % @clicksequence{File @click{} Open ...}
  2548. \def\clicksequence#1{\begingroup #1\endgroup}
  2549. % @clickstyle @arrow (by default)
  2550. \parseargdef\clickstyle{\def\click{#1}}
  2551. \def\click{\arrow}
  2552. % Typeset a dimension, e.g., `in' or `pt'. The only reason for the
  2553. % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
  2554. %
  2555. \def\dmn#1{\thinspace #1}
  2556. % @l was never documented to mean ``switch to the Lisp font'',
  2557. % and it is not used as such in any manual I can find. We need it for
  2558. % Polish suppressed-l. --karl, 22sep96.
  2559. %\def\l#1{{\li #1}\null}
  2560. % @acronym for "FBI", "NATO", and the like.
  2561. % We print this one point size smaller, since it's intended for
  2562. % all-uppercase.
  2563. %
  2564. \def\acronym#1{\doacronym #1,,\finish}
  2565. \def\doacronym#1,#2,#3\finish{%
  2566. {\selectfonts\lsize #1}%
  2567. \def\temp{#2}%
  2568. \ifx\temp\empty \else
  2569. \space ({\unsepspaces \ignorespaces \temp \unskip})%
  2570. \fi
  2571. \null % reset \spacefactor=1000
  2572. }
  2573. % @abbr for "Comput. J." and the like.
  2574. % No font change, but don't do end-of-sentence spacing.
  2575. %
  2576. \def\abbr#1{\doabbr #1,,\finish}
  2577. \def\doabbr#1,#2,#3\finish{%
  2578. {\plainfrenchspacing #1}%
  2579. \def\temp{#2}%
  2580. \ifx\temp\empty \else
  2581. \space ({\unsepspaces \ignorespaces \temp \unskip})%
  2582. \fi
  2583. \null % reset \spacefactor=1000
  2584. }
  2585. % @asis just yields its argument. Used with @table, for example.
  2586. %
  2587. \def\asis#1{#1}
  2588. % @math outputs its argument in math mode.
  2589. %
  2590. % One complication: _ usually means subscripts, but it could also mean
  2591. % an actual _ character, as in @math{@var{some_variable} + 1}. So make
  2592. % _ active, and distinguish by seeing if the current family is \slfam,
  2593. % which is what @var uses.
  2594. {
  2595. \catcode`\_ = \active
  2596. \gdef\mathunderscore{%
  2597. \catcode`\_=\active
  2598. \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
  2599. }
  2600. }
  2601. % Another complication: we want \\ (and @\) to output a math (or tt) \.
  2602. % FYI, plain.tex uses \\ as a temporary control sequence (for no
  2603. % particular reason), but this is not advertised and we don't care.
  2604. %
  2605. % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
  2606. \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
  2607. %
  2608. \def\math{%
  2609. \tex
  2610. \mathunderscore
  2611. \let\\ = \mathbackslash
  2612. \mathactive
  2613. % make the texinfo accent commands work in math mode
  2614. \let\"=\ddot
  2615. \let\'=\acute
  2616. \let\==\bar
  2617. \let\^=\hat
  2618. \let\`=\grave
  2619. \let\u=\breve
  2620. \let\v=\check
  2621. \let\~=\tilde
  2622. \let\dotaccent=\dot
  2623. $\finishmath
  2624. }
  2625. \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
  2626. % Some active characters (such as <) are spaced differently in math.
  2627. % We have to reset their definitions in case the @math was an argument
  2628. % to a command which sets the catcodes (such as @item or @section).
  2629. %
  2630. {
  2631. \catcode`^ = \active
  2632. \catcode`< = \active
  2633. \catcode`> = \active
  2634. \catcode`+ = \active
  2635. \catcode`' = \active
  2636. \gdef\mathactive{%
  2637. \let^ = \ptexhat
  2638. \let< = \ptexless
  2639. \let> = \ptexgtr
  2640. \let+ = \ptexplus
  2641. \let' = \ptexquoteright
  2642. }
  2643. }
  2644. % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
  2645. % Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
  2646. % except specified as a normal braced arg, so no newlines to worry about.
  2647. %
  2648. \def\outfmtnametex{tex}
  2649. %
  2650. \long\def\inlinefmt#1{\doinlinefmt #1,\finish}
  2651. \long\def\doinlinefmt#1,#2,\finish{%
  2652. \def\inlinefmtname{#1}%
  2653. \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
  2654. }
  2655. % For raw, must switch into @tex before parsing the argument, to avoid
  2656. % setting catcodes prematurely. Doing it this way means that, for
  2657. % example, @inlineraw{html, foo{bar} gets a parse error instead of being
  2658. % ignored. But this isn't important because if people want a literal
  2659. % *right* brace they would have to use a command anyway, so they may as
  2660. % well use a command to get a left brace too. We could re-use the
  2661. % delimiter character idea from \verb, but it seems like overkill.
  2662. %
  2663. \long\def\inlineraw{\tex \doinlineraw}
  2664. \long\def\doinlineraw#1{\doinlinerawtwo #1,\finish}
  2665. \def\doinlinerawtwo#1,#2,\finish{%
  2666. \def\inlinerawname{#1}%
  2667. \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi
  2668. \endgroup % close group opened by \tex.
  2669. }
  2670. \message{glyphs,}
  2671. % and logos.
  2672. % @@ prints an @, as does @atchar{}.
  2673. \def\@{\char64 }
  2674. \let\atchar=\@
  2675. % @{ @} @lbracechar{} @rbracechar{} all generate brace characters.
  2676. % Unless we're in typewriter, use \ecfont because the CM text fonts do
  2677. % not have braces, and we don't want to switch into math.
  2678. \def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}}
  2679. \def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}}
  2680. \let\{=\mylbrace \let\lbracechar=\{
  2681. \let\}=\myrbrace \let\rbracechar=\}
  2682. \begingroup
  2683. % Definitions to produce \{ and \} commands for indices,
  2684. % and @{ and @} for the aux/toc files.
  2685. \catcode`\{ = \other \catcode`\} = \other
  2686. \catcode`\[ = 1 \catcode`\] = 2
  2687. \catcode`\! = 0 \catcode`\\ = \other
  2688. !gdef!lbracecmd[\{]%
  2689. !gdef!rbracecmd[\}]%
  2690. !gdef!lbraceatcmd[@{]%
  2691. !gdef!rbraceatcmd[@}]%
  2692. !endgroup
  2693. % @comma{} to avoid , parsing problems.
  2694. \let\comma = ,
  2695. % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
  2696. % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
  2697. \let\, = \ptexc
  2698. \let\dotaccent = \ptexdot
  2699. \def\ringaccent#1{{\accent23 #1}}
  2700. \let\tieaccent = \ptext
  2701. \let\ubaraccent = \ptexb
  2702. \let\udotaccent = \d
  2703. % Other special characters: @questiondown @exclamdown @ordf @ordm
  2704. % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
  2705. \def\questiondown{?`}
  2706. \def\exclamdown{!`}
  2707. \def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
  2708. \def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
  2709. % Dotless i and dotless j, used for accents.
  2710. \def\imacro{i}
  2711. \def\jmacro{j}
  2712. \def\dotless#1{%
  2713. \def\temp{#1}%
  2714. \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
  2715. \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
  2716. \else \errmessage{@dotless can be used only with i or j}%
  2717. \fi\fi
  2718. }
  2719. % The \TeX{} logo, as in plain, but resetting the spacing so that a
  2720. % period following counts as ending a sentence. (Idea found in latex.)
  2721. %
  2722. \edef\TeX{\TeX \spacefactor=1000 }
  2723. % @LaTeX{} logo. Not quite the same results as the definition in
  2724. % latex.ltx, since we use a different font for the raised A; it's most
  2725. % convenient for us to use an explicitly smaller font, rather than using
  2726. % the \scriptstyle font (since we don't reset \scriptstyle and
  2727. % \scriptscriptstyle).
  2728. %
  2729. \def\LaTeX{%
  2730. L\kern-.36em
  2731. {\setbox0=\hbox{T}%
  2732. \vbox to \ht0{\hbox{%
  2733. \ifx\textnominalsize\xwordpt
  2734. % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX.
  2735. % Revert to plain's \scriptsize, which is 7pt.
  2736. \count255=\the\fam $\fam\count255 \scriptstyle A$%
  2737. \else
  2738. % For 11pt, we can use our lllsize.
  2739. \selectfonts\lllsize A%
  2740. \fi
  2741. }%
  2742. \vss
  2743. }}%
  2744. \kern-.15em
  2745. \TeX
  2746. }
  2747. % Some math mode symbols.
  2748. \def\bullet{$\ptexbullet$}
  2749. \def\geq{\ifmmode \ge\else $\ge$\fi}
  2750. \def\leq{\ifmmode \le\else $\le$\fi}
  2751. \def\minus{\ifmmode -\else $-$\fi}
  2752. % @dots{} outputs an ellipsis using the current font.
  2753. % We do .5em per period so that it has the same spacing in the cm
  2754. % typewriter fonts as three actual period characters; on the other hand,
  2755. % in other typewriter fonts three periods are wider than 1.5em. So do
  2756. % whichever is larger.
  2757. %
  2758. \def\dots{%
  2759. \leavevmode
  2760. \setbox0=\hbox{...}% get width of three periods
  2761. \ifdim\wd0 > 1.5em
  2762. \dimen0 = \wd0
  2763. \else
  2764. \dimen0 = 1.5em
  2765. \fi
  2766. \hbox to \dimen0{%
  2767. \hskip 0pt plus.25fil
  2768. .\hskip 0pt plus1fil
  2769. .\hskip 0pt plus1fil
  2770. .\hskip 0pt plus.5fil
  2771. }%
  2772. }
  2773. % @enddots{} is an end-of-sentence ellipsis.
  2774. %
  2775. \def\enddots{%
  2776. \dots
  2777. \spacefactor=\endofsentencespacefactor
  2778. }
  2779. % @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
  2780. %
  2781. % Since these characters are used in examples, they should be an even number of
  2782. % \tt widths. Each \tt character is 1en, so two makes it 1em.
  2783. %
  2784. \def\point{$\star$}
  2785. \def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}}
  2786. \def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
  2787. \def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}}
  2788. \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
  2789. \def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}}
  2790. % The @error{} command.
  2791. % Adapted from the TeXbook's \boxit.
  2792. %
  2793. \newbox\errorbox
  2794. %
  2795. {\tentt \global\dimen0 = 3em}% Width of the box.
  2796. \dimen2 = .55pt % Thickness of rules
  2797. % The text. (`r' is open on the right, `e' somewhat less so on the left.)
  2798. \setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt}
  2799. %
  2800. \setbox\errorbox=\hbox to \dimen0{\hfil
  2801. \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
  2802. \advance\hsize by -2\dimen2 % Rules.
  2803. \vbox{%
  2804. \hrule height\dimen2
  2805. \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
  2806. \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
  2807. \kern3pt\vrule width\dimen2}% Space to right.
  2808. \hrule height\dimen2}
  2809. \hfil}
  2810. %
  2811. \def\error{\leavevmode\lower.7ex\copy\errorbox}
  2812. % @pounds{} is a sterling sign, which Knuth put in the CM italic font.
  2813. %
  2814. \def\pounds{{\it\$}}
  2815. % @euro{} comes from a separate font, depending on the current style.
  2816. % We use the free feym* fonts from the eurosym package by Henrik
  2817. % Theiling, which support regular, slanted, bold and bold slanted (and
  2818. % "outlined" (blackboard board, sort of) versions, which we don't need).
  2819. % It is available from http://www.ctan.org/tex-archive/fonts/eurosym.
  2820. %
  2821. % Although only regular is the truly official Euro symbol, we ignore
  2822. % that. The Euro is designed to be slightly taller than the regular
  2823. % font height.
  2824. %
  2825. % feymr - regular
  2826. % feymo - slanted
  2827. % feybr - bold
  2828. % feybo - bold slanted
  2829. %
  2830. % There is no good (free) typewriter version, to my knowledge.
  2831. % A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
  2832. % Hmm.
  2833. %
  2834. % Also doesn't work in math. Do we need to do math with euro symbols?
  2835. % Hope not.
  2836. %
  2837. %
  2838. \def\euro{{\eurofont e}}
  2839. \def\eurofont{%
  2840. % We set the font at each command, rather than predefining it in
  2841. % \textfonts and the other font-switching commands, so that
  2842. % installations which never need the symbol don't have to have the
  2843. % font installed.
  2844. %
  2845. % There is only one designed size (nominal 10pt), so we always scale
  2846. % that to the current nominal size.
  2847. %
  2848. % By the way, simply using "at 1em" works for cmr10 and the like, but
  2849. % does not work for cmbx10 and other extended/shrunken fonts.
  2850. %
  2851. \def\eurosize{\csname\curfontsize nominalsize\endcsname}%
  2852. %
  2853. \ifx\curfontstyle\bfstylename
  2854. % bold:
  2855. \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
  2856. \else
  2857. % regular:
  2858. \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
  2859. \fi
  2860. \thiseurofont
  2861. }
  2862. % Glyphs from the EC fonts. We don't use \let for the aliases, because
  2863. % sometimes we redefine the original macro, and the alias should reflect
  2864. % the redefinition.
  2865. %
  2866. % Use LaTeX names for the Icelandic letters.
  2867. \def\DH{{\ecfont \char"D0}} % Eth
  2868. \def\dh{{\ecfont \char"F0}} % eth
  2869. \def\TH{{\ecfont \char"DE}} % Thorn
  2870. \def\th{{\ecfont \char"FE}} % thorn
  2871. %
  2872. \def\guillemetleft{{\ecfont \char"13}}
  2873. \def\guillemotleft{\guillemetleft}
  2874. \def\guillemetright{{\ecfont \char"14}}
  2875. \def\guillemotright{\guillemetright}
  2876. \def\guilsinglleft{{\ecfont \char"0E}}
  2877. \def\guilsinglright{{\ecfont \char"0F}}
  2878. \def\quotedblbase{{\ecfont \char"12}}
  2879. \def\quotesinglbase{{\ecfont \char"0D}}
  2880. %
  2881. % This positioning is not perfect (see the ogonek LaTeX package), but
  2882. % we have the precomposed glyphs for the most common cases. We put the
  2883. % tests to use those glyphs in the single \ogonek macro so we have fewer
  2884. % dummy definitions to worry about for index entries, etc.
  2885. %
  2886. % ogonek is also used with other letters in Lithuanian (IOU), but using
  2887. % the precomposed glyphs for those is not so easy since they aren't in
  2888. % the same EC font.
  2889. \def\ogonek#1{{%
  2890. \def\temp{#1}%
  2891. \ifx\temp\macrocharA\Aogonek
  2892. \else\ifx\temp\macrochara\aogonek
  2893. \else\ifx\temp\macrocharE\Eogonek
  2894. \else\ifx\temp\macrochare\eogonek
  2895. \else
  2896. \ecfont \setbox0=\hbox{#1}%
  2897. \ifdim\ht0=1ex\accent"0C #1%
  2898. \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}%
  2899. \fi
  2900. \fi\fi\fi\fi
  2901. }%
  2902. }
  2903. \def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A}
  2904. \def\aogonek{{\ecfont \char"A1}}\def\macrochara{a}
  2905. \def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E}
  2906. \def\eogonek{{\ecfont \char"A6}}\def\macrochare{e}
  2907. %
  2908. % Use the ec* fonts (cm-super in outline format) for non-CM glyphs.
  2909. \def\ecfont{%
  2910. % We can't distinguish serif/sans and italic/slanted, but this
  2911. % is used for crude hacks anyway (like adding French and German
  2912. % quotes to documents typeset with CM, where we lose kerning), so
  2913. % hopefully nobody will notice/care.
  2914. \edef\ecsize{\csname\curfontsize ecsize\endcsname}%
  2915. \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
  2916. \ifx\curfontstyle\bfstylename
  2917. % bold:
  2918. \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize
  2919. \else
  2920. % regular:
  2921. \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize
  2922. \fi
  2923. \thisecfont
  2924. }
  2925. % @registeredsymbol - R in a circle. The font for the R should really
  2926. % be smaller yet, but lllsize is the best we can do for now.
  2927. % Adapted from the plain.tex definition of \copyright.
  2928. %
  2929. \def\registeredsymbol{%
  2930. $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}%
  2931. \hfil\crcr\Orb}}%
  2932. }$%
  2933. }
  2934. % @textdegree - the normal degrees sign.
  2935. %
  2936. \def\textdegree{$^\circ$}
  2937. % Laurent Siebenmann reports \Orb undefined with:
  2938. % Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38
  2939. % so we'll define it if necessary.
  2940. %
  2941. \ifx\Orb\thisisundefined
  2942. \def\Orb{\mathhexbox20D}
  2943. \fi
  2944. % Quotes.
  2945. \chardef\quotedblleft="5C
  2946. \chardef\quotedblright=`\"
  2947. \chardef\quoteleft=`\`
  2948. \chardef\quoteright=`\'
  2949. \message{page headings,}
  2950. \newskip\titlepagetopglue \titlepagetopglue = 1.5in
  2951. \newskip\titlepagebottomglue \titlepagebottomglue = 2pc
  2952. % First the title page. Must do @settitle before @titlepage.
  2953. \newif\ifseenauthor
  2954. \newif\iffinishedtitlepage
  2955. % Do an implicit @contents or @shortcontents after @end titlepage if the
  2956. % user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
  2957. %
  2958. \newif\ifsetcontentsaftertitlepage
  2959. \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
  2960. \newif\ifsetshortcontentsaftertitlepage
  2961. \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
  2962. \parseargdef\shorttitlepage{%
  2963. \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
  2964. \endgroup\page\hbox{}\page}
  2965. \envdef\titlepage{%
  2966. % Open one extra group, as we want to close it in the middle of \Etitlepage.
  2967. \begingroup
  2968. \parindent=0pt \textfonts
  2969. % Leave some space at the very top of the page.
  2970. \vglue\titlepagetopglue
  2971. % No rule at page bottom unless we print one at the top with @title.
  2972. \finishedtitlepagetrue
  2973. %
  2974. % Most title ``pages'' are actually two pages long, with space
  2975. % at the top of the second. We don't want the ragged left on the second.
  2976. \let\oldpage = \page
  2977. \def\page{%
  2978. \iffinishedtitlepage\else
  2979. \finishtitlepage
  2980. \fi
  2981. \let\page = \oldpage
  2982. \page
  2983. \null
  2984. }%
  2985. }
  2986. \def\Etitlepage{%
  2987. \iffinishedtitlepage\else
  2988. \finishtitlepage
  2989. \fi
  2990. % It is important to do the page break before ending the group,
  2991. % because the headline and footline are only empty inside the group.
  2992. % If we use the new definition of \page, we always get a blank page
  2993. % after the title page, which we certainly don't want.
  2994. \oldpage
  2995. \endgroup
  2996. %
  2997. % Need this before the \...aftertitlepage checks so that if they are
  2998. % in effect the toc pages will come out with page numbers.
  2999. \HEADINGSon
  3000. %
  3001. % If they want short, they certainly want long too.
  3002. \ifsetshortcontentsaftertitlepage
  3003. \shortcontents
  3004. \contents
  3005. \global\let\shortcontents = \relax
  3006. \global\let\contents = \relax
  3007. \fi
  3008. %
  3009. \ifsetcontentsaftertitlepage
  3010. \contents
  3011. \global\let\contents = \relax
  3012. \global\let\shortcontents = \relax
  3013. \fi
  3014. }
  3015. \def\finishtitlepage{%
  3016. \vskip4pt \hrule height 2pt width \hsize
  3017. \vskip\titlepagebottomglue
  3018. \finishedtitlepagetrue
  3019. }
  3020. % Macros to be used within @titlepage:
  3021. \let\subtitlerm=\tenrm
  3022. \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
  3023. \parseargdef\title{%
  3024. \checkenv\titlepage
  3025. \leftline{\titlefonts\rmisbold #1}
  3026. % print a rule at the page bottom also.
  3027. \finishedtitlepagefalse
  3028. \vskip4pt \hrule height 4pt width \hsize \vskip4pt
  3029. }
  3030. \parseargdef\subtitle{%
  3031. \checkenv\titlepage
  3032. {\subtitlefont \rightline{#1}}%
  3033. }
  3034. % @author should come last, but may come many times.
  3035. % It can also be used inside @quotation.
  3036. %
  3037. \parseargdef\author{%
  3038. \def\temp{\quotation}%
  3039. \ifx\thisenv\temp
  3040. \def\quotationauthor{#1}% printed in \Equotation.
  3041. \else
  3042. \checkenv\titlepage
  3043. \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
  3044. {\secfonts\rmisbold \leftline{#1}}%
  3045. \fi
  3046. }
  3047. % Set up page headings and footings.
  3048. \let\thispage=\folio
  3049. \newtoks\evenheadline % headline on even pages
  3050. \newtoks\oddheadline % headline on odd pages
  3051. \newtoks\evenfootline % footline on even pages
  3052. \newtoks\oddfootline % footline on odd pages
  3053. % Now make TeX use those variables
  3054. \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
  3055. \else \the\evenheadline \fi}}
  3056. \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
  3057. \else \the\evenfootline \fi}\HEADINGShook}
  3058. \let\HEADINGShook=\relax
  3059. % Commands to set those variables.
  3060. % For example, this is what @headings on does
  3061. % @evenheading @thistitle|@thispage|@thischapter
  3062. % @oddheading @thischapter|@thispage|@thistitle
  3063. % @evenfooting @thisfile||
  3064. % @oddfooting ||@thisfile
  3065. \def\evenheading{\parsearg\evenheadingxxx}
  3066. \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
  3067. \def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
  3068. \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  3069. \def\oddheading{\parsearg\oddheadingxxx}
  3070. \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
  3071. \def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
  3072. \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  3073. \parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
  3074. \def\evenfooting{\parsearg\evenfootingxxx}
  3075. \def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}
  3076. \def\evenfootingyyy #1\|#2\|#3\|#4\finish{%
  3077. \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  3078. \def\oddfooting{\parsearg\oddfootingxxx}
  3079. \def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}
  3080. \def\oddfootingyyy #1\|#2\|#3\|#4\finish{%
  3081. \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
  3082. %
  3083. % Leave some space for the footline. Hopefully ok to assume
  3084. % @evenfooting will not be used by itself.
  3085. \global\advance\pageheight by -12pt
  3086. \global\advance\vsize by -12pt
  3087. }
  3088. \parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
  3089. % @evenheadingmarks top \thischapter <- chapter at the top of a page
  3090. % @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page
  3091. %
  3092. % The same set of arguments for:
  3093. %
  3094. % @oddheadingmarks
  3095. % @evenfootingmarks
  3096. % @oddfootingmarks
  3097. % @everyheadingmarks
  3098. % @everyfootingmarks
  3099. \def\evenheadingmarks{\headingmarks{even}{heading}}
  3100. \def\oddheadingmarks{\headingmarks{odd}{heading}}
  3101. \def\evenfootingmarks{\headingmarks{even}{footing}}
  3102. \def\oddfootingmarks{\headingmarks{odd}{footing}}
  3103. \def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1}
  3104. \headingmarks{odd}{heading}{#1} }
  3105. \def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1}
  3106. \headingmarks{odd}{footing}{#1} }
  3107. % #1 = even/odd, #2 = heading/footing, #3 = top/bottom.
  3108. \def\headingmarks#1#2#3 {%
  3109. \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname
  3110. \global\expandafter\let\csname get#1#2marks\endcsname \temp
  3111. }
  3112. \everyheadingmarks bottom
  3113. \everyfootingmarks bottom
  3114. % @headings double turns headings on for double-sided printing.
  3115. % @headings single turns headings on for single-sided printing.
  3116. % @headings off turns them off.
  3117. % @headings on same as @headings double, retained for compatibility.
  3118. % @headings after turns on double-sided headings after this page.
  3119. % @headings doubleafter turns on double-sided headings after this page.
  3120. % @headings singleafter turns on single-sided headings after this page.
  3121. % By default, they are off at the start of a document,
  3122. % and turned `on' after @end titlepage.
  3123. \def\headings #1 {\csname HEADINGS#1\endcsname}
  3124. \def\headingsoff{% non-global headings elimination
  3125. \evenheadline={\hfil}\evenfootline={\hfil}%
  3126. \oddheadline={\hfil}\oddfootline={\hfil}%
  3127. }
  3128. \def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
  3129. \HEADINGSoff % it's the default
  3130. % When we turn headings on, set the page number to 1.
  3131. % For double-sided printing, put current file name in lower left corner,
  3132. % chapter name on inside top of right hand pages, document
  3133. % title on inside top of left hand pages, and page numbers on outside top
  3134. % edge of all pages.
  3135. \def\HEADINGSdouble{%
  3136. \global\pageno=1
  3137. \global\evenfootline={\hfil}
  3138. \global\oddfootline={\hfil}
  3139. \global\evenheadline={\line{\folio\hfil\thistitle}}
  3140. \global\oddheadline={\line{\thischapter\hfil\folio}}
  3141. \global\let\contentsalignmacro = \chapoddpage
  3142. }
  3143. \let\contentsalignmacro = \chappager
  3144. % For single-sided printing, chapter title goes across top left of page,
  3145. % page number on top right.
  3146. \def\HEADINGSsingle{%
  3147. \global\pageno=1
  3148. \global\evenfootline={\hfil}
  3149. \global\oddfootline={\hfil}
  3150. \global\evenheadline={\line{\thischapter\hfil\folio}}
  3151. \global\oddheadline={\line{\thischapter\hfil\folio}}
  3152. \global\let\contentsalignmacro = \chappager
  3153. }
  3154. \def\HEADINGSon{\HEADINGSdouble}
  3155. \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
  3156. \let\HEADINGSdoubleafter=\HEADINGSafter
  3157. \def\HEADINGSdoublex{%
  3158. \global\evenfootline={\hfil}
  3159. \global\oddfootline={\hfil}
  3160. \global\evenheadline={\line{\folio\hfil\thistitle}}
  3161. \global\oddheadline={\line{\thischapter\hfil\folio}}
  3162. \global\let\contentsalignmacro = \chapoddpage
  3163. }
  3164. \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
  3165. \def\HEADINGSsinglex{%
  3166. \global\evenfootline={\hfil}
  3167. \global\oddfootline={\hfil}
  3168. \global\evenheadline={\line{\thischapter\hfil\folio}}
  3169. \global\oddheadline={\line{\thischapter\hfil\folio}}
  3170. \global\let\contentsalignmacro = \chappager
  3171. }
  3172. % Subroutines used in generating headings
  3173. % This produces Day Month Year style of output.
  3174. % Only define if not already defined, in case a txi-??.tex file has set
  3175. % up a different format (e.g., txi-cs.tex does this).
  3176. \ifx\today\thisisundefined
  3177. \def\today{%
  3178. \number\day\space
  3179. \ifcase\month
  3180. \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
  3181. \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
  3182. \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
  3183. \fi
  3184. \space\number\year}
  3185. \fi
  3186. % @settitle line... specifies the title of the document, for headings.
  3187. % It generates no output of its own.
  3188. \def\thistitle{\putwordNoTitle}
  3189. \def\settitle{\parsearg{\gdef\thistitle}}
  3190. \message{tables,}
  3191. % Tables -- @table, @ftable, @vtable, @item(x).
  3192. % default indentation of table text
  3193. \newdimen\tableindent \tableindent=.8in
  3194. % default indentation of @itemize and @enumerate text
  3195. \newdimen\itemindent \itemindent=.3in
  3196. % margin between end of table item and start of table text.
  3197. \newdimen\itemmargin \itemmargin=.1in
  3198. % used internally for \itemindent minus \itemmargin
  3199. \newdimen\itemmax
  3200. % Note @table, @ftable, and @vtable define @item, @itemx, etc., with
  3201. % these defs.
  3202. % They also define \itemindex
  3203. % to index the item name in whatever manner is desired (perhaps none).
  3204. \newif\ifitemxneedsnegativevskip
  3205. \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
  3206. \def\internalBitem{\smallbreak \parsearg\itemzzz}
  3207. \def\internalBitemx{\itemxpar \parsearg\itemzzz}
  3208. \def\itemzzz #1{\begingroup %
  3209. \advance\hsize by -\rightskip
  3210. \advance\hsize by -\tableindent
  3211. \setbox0=\hbox{\itemindicate{#1}}%
  3212. \itemindex{#1}%
  3213. \nobreak % This prevents a break before @itemx.
  3214. %
  3215. % If the item text does not fit in the space we have, put it on a line
  3216. % by itself, and do not allow a page break either before or after that
  3217. % line. We do not start a paragraph here because then if the next
  3218. % command is, e.g., @kindex, the whatsit would get put into the
  3219. % horizontal list on a line by itself, resulting in extra blank space.
  3220. \ifdim \wd0>\itemmax
  3221. %
  3222. % Make this a paragraph so we get the \parskip glue and wrapping,
  3223. % but leave it ragged-right.
  3224. \begingroup
  3225. \advance\leftskip by-\tableindent
  3226. \advance\hsize by\tableindent
  3227. \advance\rightskip by0pt plus1fil\relax
  3228. \leavevmode\unhbox0\par
  3229. \endgroup
  3230. %
  3231. % We're going to be starting a paragraph, but we don't want the
  3232. % \parskip glue -- logically it's part of the @item we just started.
  3233. \nobreak \vskip-\parskip
  3234. %
  3235. % Stop a page break at the \parskip glue coming up. However, if
  3236. % what follows is an environment such as @example, there will be no
  3237. % \parskip glue; then the negative vskip we just inserted would
  3238. % cause the example and the item to crash together. So we use this
  3239. % bizarre value of 10001 as a signal to \aboveenvbreak to insert
  3240. % \parskip glue after all. Section titles are handled this way also.
  3241. %
  3242. \penalty 10001
  3243. \endgroup
  3244. \itemxneedsnegativevskipfalse
  3245. \else
  3246. % The item text fits into the space. Start a paragraph, so that the
  3247. % following text (if any) will end up on the same line.
  3248. \noindent
  3249. % Do this with kerns and \unhbox so that if there is a footnote in
  3250. % the item text, it can migrate to the main vertical list and
  3251. % eventually be printed.
  3252. \nobreak\kern-\tableindent
  3253. \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
  3254. \unhbox0
  3255. \nobreak\kern\dimen0
  3256. \endgroup
  3257. \itemxneedsnegativevskiptrue
  3258. \fi
  3259. }
  3260. \def\item{\errmessage{@item while not in a list environment}}
  3261. \def\itemx{\errmessage{@itemx while not in a list environment}}
  3262. % @table, @ftable, @vtable.
  3263. \envdef\table{%
  3264. \let\itemindex\gobble
  3265. \tablecheck{table}%
  3266. }
  3267. \envdef\ftable{%
  3268. \def\itemindex ##1{\doind {fn}{\code{##1}}}%
  3269. \tablecheck{ftable}%
  3270. }
  3271. \envdef\vtable{%
  3272. \def\itemindex ##1{\doind {vr}{\code{##1}}}%
  3273. \tablecheck{vtable}%
  3274. }
  3275. \def\tablecheck#1{%
  3276. \ifnum \the\catcode`\^^M=\active
  3277. \endgroup
  3278. \errmessage{This command won't work in this context; perhaps the problem is
  3279. that we are \inenvironment\thisenv}%
  3280. \def\next{\doignore{#1}}%
  3281. \else
  3282. \let\next\tablex
  3283. \fi
  3284. \next
  3285. }
  3286. \def\tablex#1{%
  3287. \def\itemindicate{#1}%
  3288. \parsearg\tabley
  3289. }
  3290. \def\tabley#1{%
  3291. {%
  3292. \makevalueexpandable
  3293. \edef\temp{\noexpand\tablez #1\space\space\space}%
  3294. \expandafter
  3295. }\temp \endtablez
  3296. }
  3297. \def\tablez #1 #2 #3 #4\endtablez{%
  3298. \aboveenvbreak
  3299. \ifnum 0#1>0 \advance \leftskip by #1\mil \fi
  3300. \ifnum 0#2>0 \tableindent=#2\mil \fi
  3301. \ifnum 0#3>0 \advance \rightskip by #3\mil \fi
  3302. \itemmax=\tableindent
  3303. \advance \itemmax by -\itemmargin
  3304. \advance \leftskip by \tableindent
  3305. \exdentamount=\tableindent
  3306. \parindent = 0pt
  3307. \parskip = \smallskipamount
  3308. \ifdim \parskip=0pt \parskip=2pt \fi
  3309. \let\item = \internalBitem
  3310. \let\itemx = \internalBitemx
  3311. }
  3312. \def\Etable{\endgraf\afterenvbreak}
  3313. \let\Eftable\Etable
  3314. \let\Evtable\Etable
  3315. \let\Eitemize\Etable
  3316. \let\Eenumerate\Etable
  3317. % This is the counter used by @enumerate, which is really @itemize
  3318. \newcount \itemno
  3319. \envdef\itemize{\parsearg\doitemize}
  3320. \def\doitemize#1{%
  3321. \aboveenvbreak
  3322. \itemmax=\itemindent
  3323. \advance\itemmax by -\itemmargin
  3324. \advance\leftskip by \itemindent
  3325. \exdentamount=\itemindent
  3326. \parindent=0pt
  3327. \parskip=\smallskipamount
  3328. \ifdim\parskip=0pt \parskip=2pt \fi
  3329. %
  3330. % Try typesetting the item mark that if the document erroneously says
  3331. % something like @itemize @samp (intending @table), there's an error
  3332. % right away at the @itemize. It's not the best error message in the
  3333. % world, but it's better than leaving it to the @item. This means if
  3334. % the user wants an empty mark, they have to say @w{} not just @w.
  3335. \def\itemcontents{#1}%
  3336. \setbox0 = \hbox{\itemcontents}%
  3337. %
  3338. % @itemize with no arg is equivalent to @itemize @bullet.
  3339. \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
  3340. %
  3341. \let\item=\itemizeitem
  3342. }
  3343. % Definition of @item while inside @itemize and @enumerate.
  3344. %
  3345. \def\itemizeitem{%
  3346. \advance\itemno by 1 % for enumerations
  3347. {\let\par=\endgraf \smallbreak}% reasonable place to break
  3348. {%
  3349. % If the document has an @itemize directly after a section title, a
  3350. % \nobreak will be last on the list, and \sectionheading will have
  3351. % done a \vskip-\parskip. In that case, we don't want to zero
  3352. % parskip, or the item text will crash with the heading. On the
  3353. % other hand, when there is normal text preceding the item (as there
  3354. % usually is), we do want to zero parskip, or there would be too much
  3355. % space. In that case, we won't have a \nobreak before. At least
  3356. % that's the theory.
  3357. \ifnum\lastpenalty<10000 \parskip=0in \fi
  3358. \noindent
  3359. \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
  3360. %
  3361. \vadjust{\penalty 1200}}% not good to break after first line of item.
  3362. \flushcr
  3363. }
  3364. % \splitoff TOKENS\endmark defines \first to be the first token in
  3365. % TOKENS, and \rest to be the remainder.
  3366. %
  3367. \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
  3368. % Allow an optional argument of an uppercase letter, lowercase letter,
  3369. % or number, to specify the first label in the enumerated list. No
  3370. % argument is the same as `1'.
  3371. %
  3372. \envparseargdef\enumerate{\enumeratey #1 \endenumeratey}
  3373. \def\enumeratey #1 #2\endenumeratey{%
  3374. % If we were given no argument, pretend we were given `1'.
  3375. \def\thearg{#1}%
  3376. \ifx\thearg\empty \def\thearg{1}\fi
  3377. %
  3378. % Detect if the argument is a single token. If so, it might be a
  3379. % letter. Otherwise, the only valid thing it can be is a number.
  3380. % (We will always have one token, because of the test we just made.
  3381. % This is a good thing, since \splitoff doesn't work given nothing at
  3382. % all -- the first parameter is undelimited.)
  3383. \expandafter\splitoff\thearg\endmark
  3384. \ifx\rest\empty
  3385. % Only one token in the argument. It could still be anything.
  3386. % A ``lowercase letter'' is one whose \lccode is nonzero.
  3387. % An ``uppercase letter'' is one whose \lccode is both nonzero, and
  3388. % not equal to itself.
  3389. % Otherwise, we assume it's a number.
  3390. %
  3391. % We need the \relax at the end of the \ifnum lines to stop TeX from
  3392. % continuing to look for a <number>.
  3393. %
  3394. \ifnum\lccode\expandafter`\thearg=0\relax
  3395. \numericenumerate % a number (we hope)
  3396. \else
  3397. % It's a letter.
  3398. \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
  3399. \lowercaseenumerate % lowercase letter
  3400. \else
  3401. \uppercaseenumerate % uppercase letter
  3402. \fi
  3403. \fi
  3404. \else
  3405. % Multiple tokens in the argument. We hope it's a number.
  3406. \numericenumerate
  3407. \fi
  3408. }
  3409. % An @enumerate whose labels are integers. The starting integer is
  3410. % given in \thearg.
  3411. %
  3412. \def\numericenumerate{%
  3413. \itemno = \thearg
  3414. \startenumeration{\the\itemno}%
  3415. }
  3416. % The starting (lowercase) letter is in \thearg.
  3417. \def\lowercaseenumerate{%
  3418. \itemno = \expandafter`\thearg
  3419. \startenumeration{%
  3420. % Be sure we're not beyond the end of the alphabet.
  3421. \ifnum\itemno=0
  3422. \errmessage{No more lowercase letters in @enumerate; get a bigger
  3423. alphabet}%
  3424. \fi
  3425. \char\lccode\itemno
  3426. }%
  3427. }
  3428. % The starting (uppercase) letter is in \thearg.
  3429. \def\uppercaseenumerate{%
  3430. \itemno = \expandafter`\thearg
  3431. \startenumeration{%
  3432. % Be sure we're not beyond the end of the alphabet.
  3433. \ifnum\itemno=0
  3434. \errmessage{No more uppercase letters in @enumerate; get a bigger
  3435. alphabet}
  3436. \fi
  3437. \char\uccode\itemno
  3438. }%
  3439. }
  3440. % Call \doitemize, adding a period to the first argument and supplying the
  3441. % common last two arguments. Also subtract one from the initial value in
  3442. % \itemno, since @item increments \itemno.
  3443. %
  3444. \def\startenumeration#1{%
  3445. \advance\itemno by -1
  3446. \doitemize{#1.}\flushcr
  3447. }
  3448. % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
  3449. % to @enumerate.
  3450. %
  3451. \def\alphaenumerate{\enumerate{a}}
  3452. \def\capsenumerate{\enumerate{A}}
  3453. \def\Ealphaenumerate{\Eenumerate}
  3454. \def\Ecapsenumerate{\Eenumerate}
  3455. % @multitable macros
  3456. % Amy Hendrickson, 8/18/94, 3/6/96
  3457. %
  3458. % @multitable ... @end multitable will make as many columns as desired.
  3459. % Contents of each column will wrap at width given in preamble. Width
  3460. % can be specified either with sample text given in a template line,
  3461. % or in percent of \hsize, the current width of text on page.
  3462. % Table can continue over pages but will only break between lines.
  3463. % To make preamble:
  3464. %
  3465. % Either define widths of columns in terms of percent of \hsize:
  3466. % @multitable @columnfractions .25 .3 .45
  3467. % @item ...
  3468. %
  3469. % Numbers following @columnfractions are the percent of the total
  3470. % current hsize to be used for each column. You may use as many
  3471. % columns as desired.
  3472. % Or use a template:
  3473. % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
  3474. % @item ...
  3475. % using the widest term desired in each column.
  3476. % Each new table line starts with @item, each subsequent new column
  3477. % starts with @tab. Empty columns may be produced by supplying @tab's
  3478. % with nothing between them for as many times as empty columns are needed,
  3479. % ie, @tab@tab@tab will produce two empty columns.
  3480. % @item, @tab do not need to be on their own lines, but it will not hurt
  3481. % if they are.
  3482. % Sample multitable:
  3483. % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
  3484. % @item first col stuff @tab second col stuff @tab third col
  3485. % @item
  3486. % first col stuff
  3487. % @tab
  3488. % second col stuff
  3489. % @tab
  3490. % third col
  3491. % @item first col stuff @tab second col stuff
  3492. % @tab Many paragraphs of text may be used in any column.
  3493. %
  3494. % They will wrap at the width determined by the template.
  3495. % @item@tab@tab This will be in third column.
  3496. % @end multitable
  3497. % Default dimensions may be reset by user.
  3498. % @multitableparskip is vertical space between paragraphs in table.
  3499. % @multitableparindent is paragraph indent in table.
  3500. % @multitablecolmargin is horizontal space to be left between columns.
  3501. % @multitablelinespace is space to leave between table items, baseline
  3502. % to baseline.
  3503. % 0pt means it depends on current normal line spacing.
  3504. %
  3505. \newskip\multitableparskip
  3506. \newskip\multitableparindent
  3507. \newdimen\multitablecolspace
  3508. \newskip\multitablelinespace
  3509. \multitableparskip=0pt
  3510. \multitableparindent=6pt
  3511. \multitablecolspace=12pt
  3512. \multitablelinespace=0pt
  3513. % Macros used to set up halign preamble:
  3514. %
  3515. \let\endsetuptable\relax
  3516. \def\xendsetuptable{\endsetuptable}
  3517. \let\columnfractions\relax
  3518. \def\xcolumnfractions{\columnfractions}
  3519. \newif\ifsetpercent
  3520. % #1 is the @columnfraction, usually a decimal number like .5, but might
  3521. % be just 1. We just use it, whatever it is.
  3522. %
  3523. \def\pickupwholefraction#1 {%
  3524. \global\advance\colcount by 1
  3525. \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}%
  3526. \setuptable
  3527. }
  3528. \newcount\colcount
  3529. \def\setuptable#1{%
  3530. \def\firstarg{#1}%
  3531. \ifx\firstarg\xendsetuptable
  3532. \let\go = \relax
  3533. \else
  3534. \ifx\firstarg\xcolumnfractions
  3535. \global\setpercenttrue
  3536. \else
  3537. \ifsetpercent
  3538. \let\go\pickupwholefraction
  3539. \else
  3540. \global\advance\colcount by 1
  3541. \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
  3542. % separator; typically that is always in the input, anyway.
  3543. \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
  3544. \fi
  3545. \fi
  3546. \ifx\go\pickupwholefraction
  3547. % Put the argument back for the \pickupwholefraction call, so
  3548. % we'll always have a period there to be parsed.
  3549. \def\go{\pickupwholefraction#1}%
  3550. \else
  3551. \let\go = \setuptable
  3552. \fi%
  3553. \fi
  3554. \go
  3555. }
  3556. % multitable-only commands.
  3557. %
  3558. % @headitem starts a heading row, which we typeset in bold.
  3559. % Assignments have to be global since we are inside the implicit group
  3560. % of an alignment entry. \everycr resets \everytab so we don't have to
  3561. % undo it ourselves.
  3562. \def\headitemfont{\b}% for people to use in the template row; not changeable
  3563. \def\headitem{%
  3564. \checkenv\multitable
  3565. \crcr
  3566. \global\everytab={\bf}% can't use \headitemfont since the parsing differs
  3567. \the\everytab % for the first item
  3568. }%
  3569. %
  3570. % A \tab used to include \hskip1sp. But then the space in a template
  3571. % line is not enough. That is bad. So let's go back to just `&' until
  3572. % we again encounter the problem the 1sp was intended to solve.
  3573. % --karl, nathan@acm.org, 20apr99.
  3574. \def\tab{\checkenv\multitable &\the\everytab}%
  3575. % @multitable ... @end multitable definitions:
  3576. %
  3577. \newtoks\everytab % insert after every tab.
  3578. %
  3579. \envdef\multitable{%
  3580. \vskip\parskip
  3581. \startsavinginserts
  3582. %
  3583. % @item within a multitable starts a normal row.
  3584. % We use \def instead of \let so that if one of the multitable entries
  3585. % contains an @itemize, we don't choke on the \item (seen as \crcr aka
  3586. % \endtemplate) expanding \doitemize.
  3587. \def\item{\crcr}%
  3588. %
  3589. \tolerance=9500
  3590. \hbadness=9500
  3591. \setmultitablespacing
  3592. \parskip=\multitableparskip
  3593. \parindent=\multitableparindent
  3594. \overfullrule=0pt
  3595. \global\colcount=0
  3596. %
  3597. \everycr = {%
  3598. \noalign{%
  3599. \global\everytab={}%
  3600. \global\colcount=0 % Reset the column counter.
  3601. % Check for saved footnotes, etc.
  3602. \checkinserts
  3603. % Keeps underfull box messages off when table breaks over pages.
  3604. %\filbreak
  3605. % Maybe so, but it also creates really weird page breaks when the
  3606. % table breaks over pages. Wouldn't \vfil be better? Wait until the
  3607. % problem manifests itself, so it can be fixed for real --karl.
  3608. }%
  3609. }%
  3610. %
  3611. \parsearg\domultitable
  3612. }
  3613. \def\domultitable#1{%
  3614. % To parse everything between @multitable and @item:
  3615. \setuptable#1 \endsetuptable
  3616. %
  3617. % This preamble sets up a generic column definition, which will
  3618. % be used as many times as user calls for columns.
  3619. % \vtop will set a single line and will also let text wrap and
  3620. % continue for many paragraphs if desired.
  3621. \halign\bgroup &%
  3622. \global\advance\colcount by 1
  3623. \multistrut
  3624. \vtop{%
  3625. % Use the current \colcount to find the correct column width:
  3626. \hsize=\expandafter\csname col\the\colcount\endcsname
  3627. %
  3628. % In order to keep entries from bumping into each other
  3629. % we will add a \leftskip of \multitablecolspace to all columns after
  3630. % the first one.
  3631. %
  3632. % If a template has been used, we will add \multitablecolspace
  3633. % to the width of each template entry.
  3634. %
  3635. % If the user has set preamble in terms of percent of \hsize we will
  3636. % use that dimension as the width of the column, and the \leftskip
  3637. % will keep entries from bumping into each other. Table will start at
  3638. % left margin and final column will justify at right margin.
  3639. %
  3640. % Make sure we don't inherit \rightskip from the outer environment.
  3641. \rightskip=0pt
  3642. \ifnum\colcount=1
  3643. % The first column will be indented with the surrounding text.
  3644. \advance\hsize by\leftskip
  3645. \else
  3646. \ifsetpercent \else
  3647. % If user has not set preamble in terms of percent of \hsize
  3648. % we will advance \hsize by \multitablecolspace.
  3649. \advance\hsize by \multitablecolspace
  3650. \fi
  3651. % In either case we will make \leftskip=\multitablecolspace:
  3652. \leftskip=\multitablecolspace
  3653. \fi
  3654. % Ignoring space at the beginning and end avoids an occasional spurious
  3655. % blank line, when TeX decides to break the line at the space before the
  3656. % box from the multistrut, so the strut ends up on a line by itself.
  3657. % For example:
  3658. % @multitable @columnfractions .11 .89
  3659. % @item @code{#}
  3660. % @tab Legal holiday which is valid in major parts of the whole country.
  3661. % Is automatically provided with highlighting sequences respectively
  3662. % marking characters.
  3663. \noindent\ignorespaces##\unskip\multistrut
  3664. }\cr
  3665. }
  3666. \def\Emultitable{%
  3667. \crcr
  3668. \egroup % end the \halign
  3669. \global\setpercentfalse
  3670. }
  3671. \def\setmultitablespacing{%
  3672. \def\multistrut{\strut}% just use the standard line spacing
  3673. %
  3674. % Compute \multitablelinespace (if not defined by user) for use in
  3675. % \multitableparskip calculation. We used define \multistrut based on
  3676. % this, but (ironically) that caused the spacing to be off.
  3677. % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100.
  3678. \ifdim\multitablelinespace=0pt
  3679. \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
  3680. \global\advance\multitablelinespace by-\ht0
  3681. \fi
  3682. % Test to see if parskip is larger than space between lines of
  3683. % table. If not, do nothing.
  3684. % If so, set to same dimension as multitablelinespace.
  3685. \ifdim\multitableparskip>\multitablelinespace
  3686. \global\multitableparskip=\multitablelinespace
  3687. \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
  3688. % than skip between lines in the table.
  3689. \fi%
  3690. \ifdim\multitableparskip=0pt
  3691. \global\multitableparskip=\multitablelinespace
  3692. \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
  3693. % than skip between lines in the table.
  3694. \fi}
  3695. \message{conditionals,}
  3696. % @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext,
  3697. % @ifnotxml always succeed. They currently do nothing; we don't
  3698. % attempt to check whether the conditionals are properly nested. But we
  3699. % have to remember that they are conditionals, so that @end doesn't
  3700. % attempt to close an environment group.
  3701. %
  3702. \def\makecond#1{%
  3703. \expandafter\let\csname #1\endcsname = \relax
  3704. \expandafter\let\csname iscond.#1\endcsname = 1
  3705. }
  3706. \makecond{iftex}
  3707. \makecond{ifnotdocbook}
  3708. \makecond{ifnothtml}
  3709. \makecond{ifnotinfo}
  3710. \makecond{ifnotplaintext}
  3711. \makecond{ifnotxml}
  3712. % Ignore @ignore, @ifhtml, @ifinfo, and the like.
  3713. %
  3714. \def\direntry{\doignore{direntry}}
  3715. \def\documentdescription{\doignore{documentdescription}}
  3716. \def\docbook{\doignore{docbook}}
  3717. \def\html{\doignore{html}}
  3718. \def\ifdocbook{\doignore{ifdocbook}}
  3719. \def\ifhtml{\doignore{ifhtml}}
  3720. \def\ifinfo{\doignore{ifinfo}}
  3721. \def\ifnottex{\doignore{ifnottex}}
  3722. \def\ifplaintext{\doignore{ifplaintext}}
  3723. \def\ifxml{\doignore{ifxml}}
  3724. \def\ignore{\doignore{ignore}}
  3725. \def\menu{\doignore{menu}}
  3726. \def\xml{\doignore{xml}}
  3727. % Ignore text until a line `@end #1', keeping track of nested conditionals.
  3728. %
  3729. % A count to remember the depth of nesting.
  3730. \newcount\doignorecount
  3731. \def\doignore#1{\begingroup
  3732. % Scan in ``verbatim'' mode:
  3733. \obeylines
  3734. \catcode`\@ = \other
  3735. \catcode`\{ = \other
  3736. \catcode`\} = \other
  3737. %
  3738. % Make sure that spaces turn into tokens that match what \doignoretext wants.
  3739. \spaceisspace
  3740. %
  3741. % Count number of #1's that we've seen.
  3742. \doignorecount = 0
  3743. %
  3744. % Swallow text until we reach the matching `@end #1'.
  3745. \dodoignore{#1}%
  3746. }
  3747. { \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source.
  3748. \obeylines %
  3749. %
  3750. \gdef\dodoignore#1{%
  3751. % #1 contains the command name as a string, e.g., `ifinfo'.
  3752. %
  3753. % Define a command to find the next `@end #1'.
  3754. \long\def\doignoretext##1^^M@end #1{%
  3755. \doignoretextyyy##1^^M@#1\_STOP_}%
  3756. %
  3757. % And this command to find another #1 command, at the beginning of a
  3758. % line. (Otherwise, we would consider a line `@c @ifset', for
  3759. % example, to count as an @ifset for nesting.)
  3760. \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%
  3761. %
  3762. % And now expand that command.
  3763. \doignoretext ^^M%
  3764. }%
  3765. }
  3766. \def\doignoreyyy#1{%
  3767. \def\temp{#1}%
  3768. \ifx\temp\empty % Nothing found.
  3769. \let\next\doignoretextzzz
  3770. \else % Found a nested condition, ...
  3771. \advance\doignorecount by 1
  3772. \let\next\doignoretextyyy % ..., look for another.
  3773. % If we're here, #1 ends with ^^M\ifinfo (for example).
  3774. \fi
  3775. \next #1% the token \_STOP_ is present just after this macro.
  3776. }
  3777. % We have to swallow the remaining "\_STOP_".
  3778. %
  3779. \def\doignoretextzzz#1{%
  3780. \ifnum\doignorecount = 0 % We have just found the outermost @end.
  3781. \let\next\enddoignore
  3782. \else % Still inside a nested condition.
  3783. \advance\doignorecount by -1
  3784. \let\next\doignoretext % Look for the next @end.
  3785. \fi
  3786. \next
  3787. }
  3788. % Finish off ignored text.
  3789. { \obeylines%
  3790. % Ignore anything after the last `@end #1'; this matters in verbatim
  3791. % environments, where otherwise the newline after an ignored conditional
  3792. % would result in a blank line in the output.
  3793. \gdef\enddoignore#1^^M{\endgroup\ignorespaces}%
  3794. }
  3795. % @set VAR sets the variable VAR to an empty value.
  3796. % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
  3797. %
  3798. % Since we want to separate VAR from REST-OF-LINE (which might be
  3799. % empty), we can't just use \parsearg; we have to insert a space of our
  3800. % own to delimit the rest of the line, and then take it out again if we
  3801. % didn't need it.
  3802. % We rely on the fact that \parsearg sets \catcode`\ =10.
  3803. %
  3804. \parseargdef\set{\setyyy#1 \endsetyyy}
  3805. \def\setyyy#1 #2\endsetyyy{%
  3806. {%
  3807. \makevalueexpandable
  3808. \def\temp{#2}%
  3809. \edef\next{\gdef\makecsname{SET#1}}%
  3810. \ifx\temp\empty
  3811. \next{}%
  3812. \else
  3813. \setzzz#2\endsetzzz
  3814. \fi
  3815. }%
  3816. }
  3817. % Remove the trailing space \setxxx inserted.
  3818. \def\setzzz#1 \endsetzzz{\next{#1}}
  3819. % @clear VAR clears (i.e., unsets) the variable VAR.
  3820. %
  3821. \parseargdef\clear{%
  3822. {%
  3823. \makevalueexpandable
  3824. \global\expandafter\let\csname SET#1\endcsname=\relax
  3825. }%
  3826. }
  3827. % @value{foo} gets the text saved in variable foo.
  3828. \def\value{\begingroup\makevalueexpandable\valuexxx}
  3829. \def\valuexxx#1{\expandablevalue{#1}\endgroup}
  3830. {
  3831. \catcode`\- = \active \catcode`\_ = \active
  3832. %
  3833. \gdef\makevalueexpandable{%
  3834. \let\value = \expandablevalue
  3835. % We don't want these characters active, ...
  3836. \catcode`\-=\other \catcode`\_=\other
  3837. % ..., but we might end up with active ones in the argument if
  3838. % we're called from @code, as @code{@value{foo-bar_}}, though.
  3839. % So \let them to their normal equivalents.
  3840. \let-\realdash \let_\normalunderscore
  3841. }
  3842. }
  3843. % We have this subroutine so that we can handle at least some @value's
  3844. % properly in indexes (we call \makevalueexpandable in \indexdummies).
  3845. % The command has to be fully expandable (if the variable is set), since
  3846. % the result winds up in the index file. This means that if the
  3847. % variable's value contains other Texinfo commands, it's almost certain
  3848. % it will fail (although perhaps we could fix that with sufficient work
  3849. % to do a one-level expansion on the result, instead of complete).
  3850. %
  3851. \def\expandablevalue#1{%
  3852. \expandafter\ifx\csname SET#1\endcsname\relax
  3853. {[No value for ``#1'']}%
  3854. \message{Variable `#1', used in @value, is not set.}%
  3855. \else
  3856. \csname SET#1\endcsname
  3857. \fi
  3858. }
  3859. % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
  3860. % with @set.
  3861. %
  3862. % To get special treatment of `@end ifset,' call \makeond and the redefine.
  3863. %
  3864. \makecond{ifset}
  3865. \def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}
  3866. \def\doifset#1#2{%
  3867. {%
  3868. \makevalueexpandable
  3869. \let\next=\empty
  3870. \expandafter\ifx\csname SET#2\endcsname\relax
  3871. #1% If not set, redefine \next.
  3872. \fi
  3873. \expandafter
  3874. }\next
  3875. }
  3876. \def\ifsetfail{\doignore{ifset}}
  3877. % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
  3878. % defined with @set, or has been undefined with @clear.
  3879. %
  3880. % The `\else' inside the `\doifset' parameter is a trick to reuse the
  3881. % above code: if the variable is not set, do nothing, if it is set,
  3882. % then redefine \next to \ifclearfail.
  3883. %
  3884. \makecond{ifclear}
  3885. \def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
  3886. \def\ifclearfail{\doignore{ifclear}}
  3887. % @dircategory CATEGORY -- specify a category of the dir file
  3888. % which this file should belong to. Ignore this in TeX.
  3889. \let\dircategory=\comment
  3890. % @defininfoenclose.
  3891. \let\definfoenclose=\comment
  3892. \message{indexing,}
  3893. % Index generation facilities
  3894. % Define \newwrite to be identical to plain tex's \newwrite
  3895. % except not \outer, so it can be used within macros and \if's.
  3896. \edef\newwrite{\makecsname{ptexnewwrite}}
  3897. % \newindex {foo} defines an index named foo.
  3898. % It automatically defines \fooindex such that
  3899. % \fooindex ...rest of line... puts an entry in the index foo.
  3900. % It also defines \fooindfile to be the number of the output channel for
  3901. % the file that accumulates this index. The file's extension is foo.
  3902. % The name of an index should be no more than 2 characters long
  3903. % for the sake of vms.
  3904. %
  3905. \def\newindex#1{%
  3906. \iflinks
  3907. \expandafter\newwrite \csname#1indfile\endcsname
  3908. \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
  3909. \fi
  3910. \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
  3911. \noexpand\doindex{#1}}
  3912. }
  3913. % @defindex foo == \newindex{foo}
  3914. %
  3915. \def\defindex{\parsearg\newindex}
  3916. % Define @defcodeindex, like @defindex except put all entries in @code.
  3917. %
  3918. \def\defcodeindex{\parsearg\newcodeindex}
  3919. %
  3920. \def\newcodeindex#1{%
  3921. \iflinks
  3922. \expandafter\newwrite \csname#1indfile\endcsname
  3923. \openout \csname#1indfile\endcsname \jobname.#1
  3924. \fi
  3925. \expandafter\xdef\csname#1index\endcsname{%
  3926. \noexpand\docodeindex{#1}}%
  3927. }
  3928. % @synindex foo bar makes index foo feed into index bar.
  3929. % Do this instead of @defindex foo if you don't want it as a separate index.
  3930. %
  3931. % @syncodeindex foo bar similar, but put all entries made for index foo
  3932. % inside @code.
  3933. %
  3934. \def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
  3935. \def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
  3936. % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
  3937. % #3 the target index (bar).
  3938. \def\dosynindex#1#2#3{%
  3939. % Only do \closeout if we haven't already done it, else we'll end up
  3940. % closing the target index.
  3941. \expandafter \ifx\csname donesynindex#2\endcsname \relax
  3942. % The \closeout helps reduce unnecessary open files; the limit on the
  3943. % Acorn RISC OS is a mere 16 files.
  3944. \expandafter\closeout\csname#2indfile\endcsname
  3945. \expandafter\let\csname donesynindex#2\endcsname = 1
  3946. \fi
  3947. % redefine \fooindfile:
  3948. \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
  3949. \expandafter\let\csname#2indfile\endcsname=\temp
  3950. % redefine \fooindex:
  3951. \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
  3952. }
  3953. % Define \doindex, the driver for all \fooindex macros.
  3954. % Argument #1 is generated by the calling \fooindex macro,
  3955. % and it is "foo", the name of the index.
  3956. % \doindex just uses \parsearg; it calls \doind for the actual work.
  3957. % This is because \doind is more useful to call from other macros.
  3958. % There is also \dosubind {index}{topic}{subtopic}
  3959. % which makes an entry in a two-level index such as the operation index.
  3960. \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
  3961. \def\singleindexer #1{\doind{\indexname}{#1}}
  3962. % like the previous two, but they put @code around the argument.
  3963. \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
  3964. \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
  3965. % Take care of Texinfo commands that can appear in an index entry.
  3966. % Since there are some commands we want to expand, and others we don't,
  3967. % we have to laboriously prevent expansion for those that we don't.
  3968. %
  3969. \def\indexdummies{%
  3970. \escapechar = `\\ % use backslash in output files.
  3971. \def\@{@}% change to @@ when we switch to @ as escape char in index files.
  3972. \def\ {\realbackslash\space }%
  3973. %
  3974. % Need these unexpandable (because we define \tt as a dummy)
  3975. % definitions when @{ or @} appear in index entry text. Also, more
  3976. % complicated, when \tex is in effect and \{ is a \delimiter again.
  3977. % We can't use \lbracecmd and \rbracecmd because texindex assumes
  3978. % braces and backslashes are used only as delimiters. Perhaps we
  3979. % should define @lbrace and @rbrace commands a la @comma.
  3980. \def\{{{\tt\char123}}%
  3981. \def\}{{\tt\char125}}%
  3982. %
  3983. % I don't entirely understand this, but when an index entry is
  3984. % generated from a macro call, the \endinput which \scanmacro inserts
  3985. % causes processing to be prematurely terminated. This is,
  3986. % apparently, because \indexsorttmp is fully expanded, and \endinput
  3987. % is an expandable command. The redefinition below makes \endinput
  3988. % disappear altogether for that purpose -- although logging shows that
  3989. % processing continues to some further point. On the other hand, it
  3990. % seems \endinput does not hurt in the printed index arg, since that
  3991. % is still getting written without apparent harm.
  3992. %
  3993. % Sample source (mac-idx3.tex, reported by Graham Percival to
  3994. % help-texinfo, 22may06):
  3995. % @macro funindex {WORD}
  3996. % @findex xyz
  3997. % @end macro
  3998. % ...
  3999. % @funindex commtest
  4000. %
  4001. % The above is not enough to reproduce the bug, but it gives the flavor.
  4002. %
  4003. % Sample whatsit resulting:
  4004. % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}}
  4005. %
  4006. % So:
  4007. \let\endinput = \empty
  4008. %
  4009. % Do the redefinitions.
  4010. \commondummies
  4011. }
  4012. % For the aux and toc files, @ is the escape character. So we want to
  4013. % redefine everything using @ as the escape character (instead of
  4014. % \realbackslash, still used for index files). When everything uses @,
  4015. % this will be simpler.
  4016. %
  4017. \def\atdummies{%
  4018. \def\@{@@}%
  4019. \def\ {@ }%
  4020. \let\{ = \lbraceatcmd
  4021. \let\} = \rbraceatcmd
  4022. %
  4023. % Do the redefinitions.
  4024. \commondummies
  4025. \otherbackslash
  4026. }
  4027. % Called from \indexdummies and \atdummies.
  4028. %
  4029. \def\commondummies{%
  4030. %
  4031. % \definedummyword defines \#1 as \string\#1\space, thus effectively
  4032. % preventing its expansion. This is used only for control words,
  4033. % not control letters, because the \space would be incorrect for
  4034. % control characters, but is needed to separate the control word
  4035. % from whatever follows.
  4036. %
  4037. % For control letters, we have \definedummyletter, which omits the
  4038. % space.
  4039. %
  4040. % These can be used both for control words that take an argument and
  4041. % those that do not. If it is followed by {arg} in the input, then
  4042. % that will dutifully get written to the index (or wherever).
  4043. %
  4044. \def\definedummyword ##1{\def##1{\string##1\space}}%
  4045. \def\definedummyletter##1{\def##1{\string##1}}%
  4046. \let\definedummyaccent\definedummyletter
  4047. %
  4048. \commondummiesnofonts
  4049. %
  4050. \definedummyletter\_%
  4051. \definedummyletter\-%
  4052. %
  4053. % Non-English letters.
  4054. \definedummyword\AA
  4055. \definedummyword\AE
  4056. \definedummyword\DH
  4057. \definedummyword\L
  4058. \definedummyword\O
  4059. \definedummyword\OE
  4060. \definedummyword\TH
  4061. \definedummyword\aa
  4062. \definedummyword\ae
  4063. \definedummyword\dh
  4064. \definedummyword\exclamdown
  4065. \definedummyword\l
  4066. \definedummyword\o
  4067. \definedummyword\oe
  4068. \definedummyword\ordf
  4069. \definedummyword\ordm
  4070. \definedummyword\questiondown
  4071. \definedummyword\ss
  4072. \definedummyword\th
  4073. %
  4074. % Although these internal commands shouldn't show up, sometimes they do.
  4075. \definedummyword\bf
  4076. \definedummyword\gtr
  4077. \definedummyword\hat
  4078. \definedummyword\less
  4079. \definedummyword\sf
  4080. \definedummyword\sl
  4081. \definedummyword\tclose
  4082. \definedummyword\tt
  4083. %
  4084. \definedummyword\LaTeX
  4085. \definedummyword\TeX
  4086. %
  4087. % Assorted special characters.
  4088. \definedummyword\arrow
  4089. \definedummyword\bullet
  4090. \definedummyword\comma
  4091. \definedummyword\copyright
  4092. \definedummyword\registeredsymbol
  4093. \definedummyword\dots
  4094. \definedummyword\enddots
  4095. \definedummyword\entrybreak
  4096. \definedummyword\equiv
  4097. \definedummyword\error
  4098. \definedummyword\euro
  4099. \definedummyword\expansion
  4100. \definedummyword\geq
  4101. \definedummyword\guillemetleft
  4102. \definedummyword\guillemetright
  4103. \definedummyword\guilsinglleft
  4104. \definedummyword\guilsinglright
  4105. \definedummyword\lbracechar
  4106. \definedummyword\leq
  4107. \definedummyword\minus
  4108. \definedummyword\ogonek
  4109. \definedummyword\pounds
  4110. \definedummyword\point
  4111. \definedummyword\print
  4112. \definedummyword\quotedblbase
  4113. \definedummyword\quotedblleft
  4114. \definedummyword\quotedblright
  4115. \definedummyword\quoteleft
  4116. \definedummyword\quoteright
  4117. \definedummyword\quotesinglbase
  4118. \definedummyword\rbracechar
  4119. \definedummyword\result
  4120. \definedummyword\textdegree
  4121. %
  4122. % We want to disable all macros so that they are not expanded by \write.
  4123. \macrolist
  4124. %
  4125. \normalturnoffactive
  4126. %
  4127. % Handle some cases of @value -- where it does not contain any
  4128. % (non-fully-expandable) commands.
  4129. \makevalueexpandable
  4130. }
  4131. % \commondummiesnofonts: common to \commondummies and \indexnofonts.
  4132. %
  4133. \def\commondummiesnofonts{%
  4134. % Control letters and accents.
  4135. \definedummyletter\!%
  4136. \definedummyaccent\"%
  4137. \definedummyaccent\'%
  4138. \definedummyletter\*%
  4139. \definedummyaccent\,%
  4140. \definedummyletter\.%
  4141. \definedummyletter\/%
  4142. \definedummyletter\:%
  4143. \definedummyaccent\=%
  4144. \definedummyletter\?%
  4145. \definedummyaccent\^%
  4146. \definedummyaccent\`%
  4147. \definedummyaccent\~%
  4148. \definedummyword\u
  4149. \definedummyword\v
  4150. \definedummyword\H
  4151. \definedummyword\dotaccent
  4152. \definedummyword\ogonek
  4153. \definedummyword\ringaccent
  4154. \definedummyword\tieaccent
  4155. \definedummyword\ubaraccent
  4156. \definedummyword\udotaccent
  4157. \definedummyword\dotless
  4158. %
  4159. % Texinfo font commands.
  4160. \definedummyword\b
  4161. \definedummyword\i
  4162. \definedummyword\r
  4163. \definedummyword\sansserif
  4164. \definedummyword\sc
  4165. \definedummyword\slanted
  4166. \definedummyword\t
  4167. %
  4168. % Commands that take arguments.
  4169. \definedummyword\abbr
  4170. \definedummyword\acronym
  4171. \definedummyword\anchor
  4172. \definedummyword\cite
  4173. \definedummyword\code
  4174. \definedummyword\command
  4175. \definedummyword\dfn
  4176. \definedummyword\dmn
  4177. \definedummyword\email
  4178. \definedummyword\emph
  4179. \definedummyword\env
  4180. \definedummyword\file
  4181. \definedummyword\image
  4182. \definedummyword\indicateurl
  4183. \definedummyword\inforef
  4184. \definedummyword\kbd
  4185. \definedummyword\key
  4186. \definedummyword\math
  4187. \definedummyword\option
  4188. \definedummyword\pxref
  4189. \definedummyword\ref
  4190. \definedummyword\samp
  4191. \definedummyword\strong
  4192. \definedummyword\tie
  4193. \definedummyword\uref
  4194. \definedummyword\url
  4195. \definedummyword\var
  4196. \definedummyword\verb
  4197. \definedummyword\w
  4198. \definedummyword\xref
  4199. }
  4200. % \indexnofonts is used when outputting the strings to sort the index
  4201. % by, and when constructing control sequence names. It eliminates all
  4202. % control sequences and just writes whatever the best ASCII sort string
  4203. % would be for a given command (usually its argument).
  4204. %
  4205. \def\indexnofonts{%
  4206. % Accent commands should become @asis.
  4207. \def\definedummyaccent##1{\let##1\asis}%
  4208. % We can just ignore other control letters.
  4209. \def\definedummyletter##1{\let##1\empty}%
  4210. % All control words become @asis by default; overrides below.
  4211. \let\definedummyword\definedummyaccent
  4212. %
  4213. \commondummiesnofonts
  4214. %
  4215. % Don't no-op \tt, since it isn't a user-level command
  4216. % and is used in the definitions of the active chars like <, >, |, etc.
  4217. % Likewise with the other plain tex font commands.
  4218. %\let\tt=\asis
  4219. %
  4220. \def\ { }%
  4221. \def\@{@}%
  4222. \def\_{\normalunderscore}%
  4223. \def\-{}% @- shouldn't affect sorting
  4224. %
  4225. % Unfortunately, texindex is not prepared to handle braces in the
  4226. % content at all. So for index sorting, we map @{ and @} to strings
  4227. % starting with |, since that ASCII character is between ASCII { and }.
  4228. \def\{{|a}%
  4229. \def\lbracechar{|a}%
  4230. %
  4231. \def\}{|b}%
  4232. \def\rbracechar{|b}%
  4233. %
  4234. % Non-English letters.
  4235. \def\AA{AA}%
  4236. \def\AE{AE}%
  4237. \def\DH{DZZ}%
  4238. \def\L{L}%
  4239. \def\OE{OE}%
  4240. \def\O{O}%
  4241. \def\TH{ZZZ}%
  4242. \def\aa{aa}%
  4243. \def\ae{ae}%
  4244. \def\dh{dzz}%
  4245. \def\exclamdown{!}%
  4246. \def\l{l}%
  4247. \def\oe{oe}%
  4248. \def\ordf{a}%
  4249. \def\ordm{o}%
  4250. \def\o{o}%
  4251. \def\questiondown{?}%
  4252. \def\ss{ss}%
  4253. \def\th{zzz}%
  4254. %
  4255. \def\LaTeX{LaTeX}%
  4256. \def\TeX{TeX}%
  4257. %
  4258. % Assorted special characters.
  4259. % (The following {} will end up in the sort string, but that's ok.)
  4260. \def\arrow{->}%
  4261. \def\bullet{bullet}%
  4262. \def\comma{,}%
  4263. \def\copyright{copyright}%
  4264. \def\dots{...}%
  4265. \def\enddots{...}%
  4266. \def\equiv{==}%
  4267. \def\error{error}%
  4268. \def\euro{euro}%
  4269. \def\expansion{==>}%
  4270. \def\geq{>=}%
  4271. \def\guillemetleft{<<}%
  4272. \def\guillemetright{>>}%
  4273. \def\guilsinglleft{<}%
  4274. \def\guilsinglright{>}%
  4275. \def\leq{<=}%
  4276. \def\minus{-}%
  4277. \def\point{.}%
  4278. \def\pounds{pounds}%
  4279. \def\print{-|}%
  4280. \def\quotedblbase{"}%
  4281. \def\quotedblleft{"}%
  4282. \def\quotedblright{"}%
  4283. \def\quoteleft{`}%
  4284. \def\quoteright{'}%
  4285. \def\quotesinglbase{,}%
  4286. \def\registeredsymbol{R}%
  4287. \def\result{=>}%
  4288. \def\textdegree{o}%
  4289. %
  4290. \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax
  4291. \else \indexlquoteignore \fi
  4292. %
  4293. % We need to get rid of all macros, leaving only the arguments (if present).
  4294. % Of course this is not nearly correct, but it is the best we can do for now.
  4295. % makeinfo does not expand macros in the argument to @deffn, which ends up
  4296. % writing an index entry, and texindex isn't prepared for an index sort entry
  4297. % that starts with \.
  4298. %
  4299. % Since macro invocations are followed by braces, we can just redefine them
  4300. % to take a single TeX argument. The case of a macro invocation that
  4301. % goes to end-of-line is not handled.
  4302. %
  4303. \macrolist
  4304. }
  4305. % Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us
  4306. % ignore left quotes in the sort term.
  4307. {\catcode`\`=\active
  4308. \gdef\indexlquoteignore{\let`=\empty}}
  4309. \let\indexbackslash=0 %overridden during \printindex.
  4310. \let\SETmarginindex=\relax % put index entries in margin (undocumented)?
  4311. % Most index entries go through here, but \dosubind is the general case.
  4312. % #1 is the index name, #2 is the entry text.
  4313. \def\doind#1#2{\dosubind{#1}{#2}{}}
  4314. % Workhorse for all \fooindexes.
  4315. % #1 is name of index, #2 is stuff to put there, #3 is subentry --
  4316. % empty if called from \doind, as we usually are (the main exception
  4317. % is with most defuns, which call us directly).
  4318. %
  4319. \def\dosubind#1#2#3{%
  4320. \iflinks
  4321. {%
  4322. % Store the main index entry text (including the third arg).
  4323. \toks0 = {#2}%
  4324. % If third arg is present, precede it with a space.
  4325. \def\thirdarg{#3}%
  4326. \ifx\thirdarg\empty \else
  4327. \toks0 = \expandafter{\the\toks0 \space #3}%
  4328. \fi
  4329. %
  4330. \edef\writeto{\csname#1indfile\endcsname}%
  4331. %
  4332. \safewhatsit\dosubindwrite
  4333. }%
  4334. \fi
  4335. }
  4336. % Write the entry in \toks0 to the index file:
  4337. %
  4338. \def\dosubindwrite{%
  4339. % Put the index entry in the margin if desired.
  4340. \ifx\SETmarginindex\relax\else
  4341. \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}%
  4342. \fi
  4343. %
  4344. % Remember, we are within a group.
  4345. \indexdummies % Must do this here, since \bf, etc expand at this stage
  4346. \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now
  4347. % so it will be output as is; and it will print as backslash.
  4348. %
  4349. % Process the index entry with all font commands turned off, to
  4350. % get the string to sort by.
  4351. {\indexnofonts
  4352. \edef\temp{\the\toks0}% need full expansion
  4353. \xdef\indexsorttmp{\temp}%
  4354. }%
  4355. %
  4356. % Set up the complete index entry, with both the sort key and
  4357. % the original text, including any font commands. We write
  4358. % three arguments to \entry to the .?? file (four in the
  4359. % subentry case), texindex reduces to two when writing the .??s
  4360. % sorted result.
  4361. \edef\temp{%
  4362. \write\writeto{%
  4363. \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}%
  4364. }%
  4365. \temp
  4366. }
  4367. % Take care of unwanted page breaks/skips around a whatsit:
  4368. %
  4369. % If a skip is the last thing on the list now, preserve it
  4370. % by backing up by \lastskip, doing the \write, then inserting
  4371. % the skip again. Otherwise, the whatsit generated by the
  4372. % \write or \pdfdest will make \lastskip zero. The result is that
  4373. % sequences like this:
  4374. % @end defun
  4375. % @tindex whatever
  4376. % @defun ...
  4377. % will have extra space inserted, because the \medbreak in the
  4378. % start of the @defun won't see the skip inserted by the @end of
  4379. % the previous defun.
  4380. %
  4381. % But don't do any of this if we're not in vertical mode. We
  4382. % don't want to do a \vskip and prematurely end a paragraph.
  4383. %
  4384. % Avoid page breaks due to these extra skips, too.
  4385. %
  4386. % But wait, there is a catch there:
  4387. % We'll have to check whether \lastskip is zero skip. \ifdim is not
  4388. % sufficient for this purpose, as it ignores stretch and shrink parts
  4389. % of the skip. The only way seems to be to check the textual
  4390. % representation of the skip.
  4391. %
  4392. % The following is almost like \def\zeroskipmacro{0.0pt} except that
  4393. % the ``p'' and ``t'' characters have catcode \other, not 11 (letter).
  4394. %
  4395. \edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname}
  4396. %
  4397. \newskip\whatsitskip
  4398. \newcount\whatsitpenalty
  4399. %
  4400. % ..., ready, GO:
  4401. %
  4402. \def\safewhatsit#1{\ifhmode
  4403. #1%
  4404. \else
  4405. % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
  4406. \whatsitskip = \lastskip
  4407. \edef\lastskipmacro{\the\lastskip}%
  4408. \whatsitpenalty = \lastpenalty
  4409. %
  4410. % If \lastskip is nonzero, that means the last item was a
  4411. % skip. And since a skip is discardable, that means this
  4412. % -\whatsitskip glue we're inserting is preceded by a
  4413. % non-discardable item, therefore it is not a potential
  4414. % breakpoint, therefore no \nobreak needed.
  4415. \ifx\lastskipmacro\zeroskipmacro
  4416. \else
  4417. \vskip-\whatsitskip
  4418. \fi
  4419. %
  4420. #1%
  4421. %
  4422. \ifx\lastskipmacro\zeroskipmacro
  4423. % If \lastskip was zero, perhaps the last item was a penalty, and
  4424. % perhaps it was >=10000, e.g., a \nobreak. In that case, we want
  4425. % to re-insert the same penalty (values >10000 are used for various
  4426. % signals); since we just inserted a non-discardable item, any
  4427. % following glue (such as a \parskip) would be a breakpoint. For example:
  4428. % @deffn deffn-whatever
  4429. % @vindex index-whatever
  4430. % Description.
  4431. % would allow a break between the index-whatever whatsit
  4432. % and the "Description." paragraph.
  4433. \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi
  4434. \else
  4435. % On the other hand, if we had a nonzero \lastskip,
  4436. % this make-up glue would be preceded by a non-discardable item
  4437. % (the whatsit from the \write), so we must insert a \nobreak.
  4438. \nobreak\vskip\whatsitskip
  4439. \fi
  4440. \fi}
  4441. % The index entry written in the file actually looks like
  4442. % \entry {sortstring}{page}{topic}
  4443. % or
  4444. % \entry {sortstring}{page}{topic}{subtopic}
  4445. % The texindex program reads in these files and writes files
  4446. % containing these kinds of lines:
  4447. % \initial {c}
  4448. % before the first topic whose initial is c
  4449. % \entry {topic}{pagelist}
  4450. % for a topic that is used without subtopics
  4451. % \primary {topic}
  4452. % for the beginning of a topic that is used with subtopics
  4453. % \secondary {subtopic}{pagelist}
  4454. % for each subtopic.
  4455. % Define the user-accessible indexing commands
  4456. % @findex, @vindex, @kindex, @cindex.
  4457. \def\findex {\fnindex}
  4458. \def\kindex {\kyindex}
  4459. \def\cindex {\cpindex}
  4460. \def\vindex {\vrindex}
  4461. \def\tindex {\tpindex}
  4462. \def\pindex {\pgindex}
  4463. \def\cindexsub {\begingroup\obeylines\cindexsub}
  4464. {\obeylines %
  4465. \gdef\cindexsub "#1" #2^^M{\endgroup %
  4466. \dosubind{cp}{#2}{#1}}}
  4467. % Define the macros used in formatting output of the sorted index material.
  4468. % @printindex causes a particular index (the ??s file) to get printed.
  4469. % It does not print any chapter heading (usually an @unnumbered).
  4470. %
  4471. \parseargdef\printindex{\begingroup
  4472. \dobreak \chapheadingskip{10000}%
  4473. %
  4474. \smallfonts \rm
  4475. \tolerance = 9500
  4476. \plainfrenchspacing
  4477. \everypar = {}% don't want the \kern\-parindent from indentation suppression.
  4478. %
  4479. % See if the index file exists and is nonempty.
  4480. % Change catcode of @ here so that if the index file contains
  4481. % \initial {@}
  4482. % as its first line, TeX doesn't complain about mismatched braces
  4483. % (because it thinks @} is a control sequence).
  4484. \catcode`\@ = 11
  4485. \openin 1 \jobname.#1s
  4486. \ifeof 1
  4487. % \enddoublecolumns gets confused if there is no text in the index,
  4488. % and it loses the chapter title and the aux file entries for the
  4489. % index. The easiest way to prevent this problem is to make sure
  4490. % there is some text.
  4491. \putwordIndexNonexistent
  4492. \else
  4493. %
  4494. % If the index file exists but is empty, then \openin leaves \ifeof
  4495. % false. We have to make TeX try to read something from the file, so
  4496. % it can discover if there is anything in it.
  4497. \read 1 to \temp
  4498. \ifeof 1
  4499. \putwordIndexIsEmpty
  4500. \else
  4501. % Index files are almost Texinfo source, but we use \ as the escape
  4502. % character. It would be better to use @, but that's too big a change
  4503. % to make right now.
  4504. \def\indexbackslash{\backslashcurfont}%
  4505. \catcode`\\ = 0
  4506. \escapechar = `\\
  4507. \begindoublecolumns
  4508. \input \jobname.#1s
  4509. \enddoublecolumns
  4510. \fi
  4511. \fi
  4512. \closein 1
  4513. \endgroup}
  4514. % These macros are used by the sorted index file itself.
  4515. % Change them to control the appearance of the index.
  4516. \def\initial#1{{%
  4517. % Some minor font changes for the special characters.
  4518. \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
  4519. %
  4520. % Remove any glue we may have, we'll be inserting our own.
  4521. \removelastskip
  4522. %
  4523. % We like breaks before the index initials, so insert a bonus.
  4524. \nobreak
  4525. \vskip 0pt plus 3\baselineskip
  4526. \penalty 0
  4527. \vskip 0pt plus -3\baselineskip
  4528. %
  4529. % Typeset the initial. Making this add up to a whole number of
  4530. % baselineskips increases the chance of the dots lining up from column
  4531. % to column. It still won't often be perfect, because of the stretch
  4532. % we need before each entry, but it's better.
  4533. %
  4534. % No shrink because it confuses \balancecolumns.
  4535. \vskip 1.67\baselineskip plus .5\baselineskip
  4536. \leftline{\secbf #1}%
  4537. % Do our best not to break after the initial.
  4538. \nobreak
  4539. \vskip .33\baselineskip plus .1\baselineskip
  4540. }}
  4541. % \entry typesets a paragraph consisting of the text (#1), dot leaders, and
  4542. % then page number (#2) flushed to the right margin. It is used for index
  4543. % and table of contents entries. The paragraph is indented by \leftskip.
  4544. %
  4545. % A straightforward implementation would start like this:
  4546. % \def\entry#1#2{...
  4547. % But this freezes the catcodes in the argument, and can cause problems to
  4548. % @code, which sets - active. This problem was fixed by a kludge---
  4549. % ``-'' was active throughout whole index, but this isn't really right.
  4550. % The right solution is to prevent \entry from swallowing the whole text.
  4551. % --kasal, 21nov03
  4552. \def\entry{%
  4553. \begingroup
  4554. %
  4555. % Start a new paragraph if necessary, so our assignments below can't
  4556. % affect previous text.
  4557. \par
  4558. %
  4559. % Do not fill out the last line with white space.
  4560. \parfillskip = 0in
  4561. %
  4562. % No extra space above this paragraph.
  4563. \parskip = 0in
  4564. %
  4565. % Do not prefer a separate line ending with a hyphen to fewer lines.
  4566. \finalhyphendemerits = 0
  4567. %
  4568. % \hangindent is only relevant when the entry text and page number
  4569. % don't both fit on one line. In that case, bob suggests starting the
  4570. % dots pretty far over on the line. Unfortunately, a large
  4571. % indentation looks wrong when the entry text itself is broken across
  4572. % lines. So we use a small indentation and put up with long leaders.
  4573. %
  4574. % \hangafter is reset to 1 (which is the value we want) at the start
  4575. % of each paragraph, so we need not do anything with that.
  4576. \hangindent = 2em
  4577. %
  4578. % When the entry text needs to be broken, just fill out the first line
  4579. % with blank space.
  4580. \rightskip = 0pt plus1fil
  4581. %
  4582. % A bit of stretch before each entry for the benefit of balancing
  4583. % columns.
  4584. \vskip 0pt plus1pt
  4585. %
  4586. % When reading the text of entry, convert explicit line breaks
  4587. % from @* into spaces. The user might give these in long section
  4588. % titles, for instance.
  4589. \def\*{\unskip\space\ignorespaces}%
  4590. \def\entrybreak{\hfil\break}%
  4591. %
  4592. % Swallow the left brace of the text (first parameter):
  4593. \afterassignment\doentry
  4594. \let\temp =
  4595. }
  4596. \def\entrybreak{\unskip\space\ignorespaces}%
  4597. \def\doentry{%
  4598. \bgroup % Instead of the swallowed brace.
  4599. \noindent
  4600. \aftergroup\finishentry
  4601. % And now comes the text of the entry.
  4602. }
  4603. \def\finishentry#1{%
  4604. % #1 is the page number.
  4605. %
  4606. % The following is kludged to not output a line of dots in the index if
  4607. % there are no page numbers. The next person who breaks this will be
  4608. % cursed by a Unix daemon.
  4609. \setbox\boxA = \hbox{#1}%
  4610. \ifdim\wd\boxA = 0pt
  4611. \ %
  4612. \else
  4613. %
  4614. % If we must, put the page number on a line of its own, and fill out
  4615. % this line with blank space. (The \hfil is overwhelmed with the
  4616. % fill leaders glue in \indexdotfill if the page number does fit.)
  4617. \hfil\penalty50
  4618. \null\nobreak\indexdotfill % Have leaders before the page number.
  4619. %
  4620. % The `\ ' here is removed by the implicit \unskip that TeX does as
  4621. % part of (the primitive) \par. Without it, a spurious underfull
  4622. % \hbox ensues.
  4623. \ifpdf
  4624. \pdfgettoks#1.%
  4625. \ \the\toksA
  4626. \else
  4627. \ #1%
  4628. \fi
  4629. \fi
  4630. \par
  4631. \endgroup
  4632. }
  4633. % Like plain.tex's \dotfill, except uses up at least 1 em.
  4634. \def\indexdotfill{\cleaders
  4635. \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill}
  4636. \def\primary #1{\line{#1\hfil}}
  4637. \newskip\secondaryindent \secondaryindent=0.5cm
  4638. \def\secondary#1#2{{%
  4639. \parfillskip=0in
  4640. \parskip=0in
  4641. \hangindent=1in
  4642. \hangafter=1
  4643. \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
  4644. \ifpdf
  4645. \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
  4646. \else
  4647. #2
  4648. \fi
  4649. \par
  4650. }}
  4651. % Define two-column mode, which we use to typeset indexes.
  4652. % Adapted from the TeXbook, page 416, which is to say,
  4653. % the manmac.tex format used to print the TeXbook itself.
  4654. \catcode`\@=11
  4655. \newbox\partialpage
  4656. \newdimen\doublecolumnhsize
  4657. \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
  4658. % Grab any single-column material above us.
  4659. \output = {%
  4660. %
  4661. % Here is a possibility not foreseen in manmac: if we accumulate a
  4662. % whole lot of material, we might end up calling this \output
  4663. % routine twice in a row (see the doublecol-lose test, which is
  4664. % essentially a couple of indexes with @setchapternewpage off). In
  4665. % that case we just ship out what is in \partialpage with the normal
  4666. % output routine. Generally, \partialpage will be empty when this
  4667. % runs and this will be a no-op. See the indexspread.tex test case.
  4668. \ifvoid\partialpage \else
  4669. \onepageout{\pagecontents\partialpage}%
  4670. \fi
  4671. %
  4672. \global\setbox\partialpage = \vbox{%
  4673. % Unvbox the main output page.
  4674. \unvbox\PAGE
  4675. \kern-\topskip \kern\baselineskip
  4676. }%
  4677. }%
  4678. \eject % run that output routine to set \partialpage
  4679. %
  4680. % Use the double-column output routine for subsequent pages.
  4681. \output = {\doublecolumnout}%
  4682. %
  4683. % Change the page size parameters. We could do this once outside this
  4684. % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
  4685. % format, but then we repeat the same computation. Repeating a couple
  4686. % of assignments once per index is clearly meaningless for the
  4687. % execution time, so we may as well do it in one place.
  4688. %
  4689. % First we halve the line length, less a little for the gutter between
  4690. % the columns. We compute the gutter based on the line length, so it
  4691. % changes automatically with the paper format. The magic constant
  4692. % below is chosen so that the gutter has the same value (well, +-<1pt)
  4693. % as it did when we hard-coded it.
  4694. %
  4695. % We put the result in a separate register, \doublecolumhsize, so we
  4696. % can restore it in \pagesofar, after \hsize itself has (potentially)
  4697. % been clobbered.
  4698. %
  4699. \doublecolumnhsize = \hsize
  4700. \advance\doublecolumnhsize by -.04154\hsize
  4701. \divide\doublecolumnhsize by 2
  4702. \hsize = \doublecolumnhsize
  4703. %
  4704. % Double the \vsize as well. (We don't need a separate register here,
  4705. % since nobody clobbers \vsize.)
  4706. \vsize = 2\vsize
  4707. }
  4708. % The double-column output routine for all double-column pages except
  4709. % the last.
  4710. %
  4711. \def\doublecolumnout{%
  4712. \splittopskip=\topskip \splitmaxdepth=\maxdepth
  4713. % Get the available space for the double columns -- the normal
  4714. % (undoubled) page height minus any material left over from the
  4715. % previous page.
  4716. \dimen@ = \vsize
  4717. \divide\dimen@ by 2
  4718. \advance\dimen@ by -\ht\partialpage
  4719. %
  4720. % box0 will be the left-hand column, box2 the right.
  4721. \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
  4722. \onepageout\pagesofar
  4723. \unvbox255
  4724. \penalty\outputpenalty
  4725. }
  4726. %
  4727. % Re-output the contents of the output page -- any previous material,
  4728. % followed by the two boxes we just split, in box0 and box2.
  4729. \def\pagesofar{%
  4730. \unvbox\partialpage
  4731. %
  4732. \hsize = \doublecolumnhsize
  4733. \wd0=\hsize \wd2=\hsize
  4734. \hbox to\pagewidth{\box0\hfil\box2}%
  4735. }
  4736. %
  4737. % All done with double columns.
  4738. \def\enddoublecolumns{%
  4739. % The following penalty ensures that the page builder is exercised
  4740. % _before_ we change the output routine. This is necessary in the
  4741. % following situation:
  4742. %
  4743. % The last section of the index consists only of a single entry.
  4744. % Before this section, \pagetotal is less than \pagegoal, so no
  4745. % break occurs before the last section starts. However, the last
  4746. % section, consisting of \initial and the single \entry, does not
  4747. % fit on the page and has to be broken off. Without the following
  4748. % penalty the page builder will not be exercised until \eject
  4749. % below, and by that time we'll already have changed the output
  4750. % routine to the \balancecolumns version, so the next-to-last
  4751. % double-column page will be processed with \balancecolumns, which
  4752. % is wrong: The two columns will go to the main vertical list, with
  4753. % the broken-off section in the recent contributions. As soon as
  4754. % the output routine finishes, TeX starts reconsidering the page
  4755. % break. The two columns and the broken-off section both fit on the
  4756. % page, because the two columns now take up only half of the page
  4757. % goal. When TeX sees \eject from below which follows the final
  4758. % section, it invokes the new output routine that we've set after
  4759. % \balancecolumns below; \onepageout will try to fit the two columns
  4760. % and the final section into the vbox of \pageheight (see
  4761. % \pagebody), causing an overfull box.
  4762. %
  4763. % Note that glue won't work here, because glue does not exercise the
  4764. % page builder, unlike penalties (see The TeXbook, pp. 280-281).
  4765. \penalty0
  4766. %
  4767. \output = {%
  4768. % Split the last of the double-column material. Leave it on the
  4769. % current page, no automatic page break.
  4770. \balancecolumns
  4771. %
  4772. % If we end up splitting too much material for the current page,
  4773. % though, there will be another page break right after this \output
  4774. % invocation ends. Having called \balancecolumns once, we do not
  4775. % want to call it again. Therefore, reset \output to its normal
  4776. % definition right away. (We hope \balancecolumns will never be
  4777. % called on to balance too much material, but if it is, this makes
  4778. % the output somewhat more palatable.)
  4779. \global\output = {\onepageout{\pagecontents\PAGE}}%
  4780. }%
  4781. \eject
  4782. \endgroup % started in \begindoublecolumns
  4783. %
  4784. % \pagegoal was set to the doubled \vsize above, since we restarted
  4785. % the current page. We're now back to normal single-column
  4786. % typesetting, so reset \pagegoal to the normal \vsize (after the
  4787. % \endgroup where \vsize got restored).
  4788. \pagegoal = \vsize
  4789. }
  4790. %
  4791. % Called at the end of the double column material.
  4792. \def\balancecolumns{%
  4793. \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
  4794. \dimen@ = \ht0
  4795. \advance\dimen@ by \topskip
  4796. \advance\dimen@ by-\baselineskip
  4797. \divide\dimen@ by 2 % target to split to
  4798. %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
  4799. \splittopskip = \topskip
  4800. % Loop until we get a decent breakpoint.
  4801. {%
  4802. \vbadness = 10000
  4803. \loop
  4804. \global\setbox3 = \copy0
  4805. \global\setbox1 = \vsplit3 to \dimen@
  4806. \ifdim\ht3>\dimen@
  4807. \global\advance\dimen@ by 1pt
  4808. \repeat
  4809. }%
  4810. %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
  4811. \setbox0=\vbox to\dimen@{\unvbox1}%
  4812. \setbox2=\vbox to\dimen@{\unvbox3}%
  4813. %
  4814. \pagesofar
  4815. }
  4816. \catcode`\@ = \other
  4817. \message{sectioning,}
  4818. % Chapters, sections, etc.
  4819. % Let's start with @part.
  4820. \outer\parseargdef\part{\partzzz{#1}}
  4821. \def\partzzz#1{%
  4822. \chapoddpage
  4823. \null
  4824. \vskip.3\vsize % move it down on the page a bit
  4825. \begingroup
  4826. \noindent \titlefonts\rmisbold #1\par % the text
  4827. \let\lastnode=\empty % no node to associate with
  4828. \writetocentry{part}{#1}{}% but put it in the toc
  4829. \headingsoff % no headline or footline on the part page
  4830. \chapoddpage
  4831. \endgroup
  4832. }
  4833. % \unnumberedno is an oxymoron. But we count the unnumbered
  4834. % sections so that we can refer to them unambiguously in the pdf
  4835. % outlines by their "section number". We avoid collisions with chapter
  4836. % numbers by starting them at 10000. (If a document ever has 10000
  4837. % chapters, we're in trouble anyway, I'm sure.)
  4838. \newcount\unnumberedno \unnumberedno = 10000
  4839. \newcount\chapno
  4840. \newcount\secno \secno=0
  4841. \newcount\subsecno \subsecno=0
  4842. \newcount\subsubsecno \subsubsecno=0
  4843. % This counter is funny since it counts through charcodes of letters A, B, ...
  4844. \newcount\appendixno \appendixno = `\@
  4845. %
  4846. % \def\appendixletter{\char\the\appendixno}
  4847. % We do the following ugly conditional instead of the above simple
  4848. % construct for the sake of pdftex, which needs the actual
  4849. % letter in the expansion, not just typeset.
  4850. %
  4851. \def\appendixletter{%
  4852. \ifnum\appendixno=`A A%
  4853. \else\ifnum\appendixno=`B B%
  4854. \else\ifnum\appendixno=`C C%
  4855. \else\ifnum\appendixno=`D D%
  4856. \else\ifnum\appendixno=`E E%
  4857. \else\ifnum\appendixno=`F F%
  4858. \else\ifnum\appendixno=`G G%
  4859. \else\ifnum\appendixno=`H H%
  4860. \else\ifnum\appendixno=`I I%
  4861. \else\ifnum\appendixno=`J J%
  4862. \else\ifnum\appendixno=`K K%
  4863. \else\ifnum\appendixno=`L L%
  4864. \else\ifnum\appendixno=`M M%
  4865. \else\ifnum\appendixno=`N N%
  4866. \else\ifnum\appendixno=`O O%
  4867. \else\ifnum\appendixno=`P P%
  4868. \else\ifnum\appendixno=`Q Q%
  4869. \else\ifnum\appendixno=`R R%
  4870. \else\ifnum\appendixno=`S S%
  4871. \else\ifnum\appendixno=`T T%
  4872. \else\ifnum\appendixno=`U U%
  4873. \else\ifnum\appendixno=`V V%
  4874. \else\ifnum\appendixno=`W W%
  4875. \else\ifnum\appendixno=`X X%
  4876. \else\ifnum\appendixno=`Y Y%
  4877. \else\ifnum\appendixno=`Z Z%
  4878. % The \the is necessary, despite appearances, because \appendixletter is
  4879. % expanded while writing the .toc file. \char\appendixno is not
  4880. % expandable, thus it is written literally, thus all appendixes come out
  4881. % with the same letter (or @) in the toc without it.
  4882. \else\char\the\appendixno
  4883. \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
  4884. \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
  4885. % Each @chapter defines these (using marks) as the number+name, number
  4886. % and name of the chapter. Page headings and footings can use
  4887. % these. @section does likewise.
  4888. \def\thischapter{}
  4889. \def\thischapternum{}
  4890. \def\thischaptername{}
  4891. \def\thissection{}
  4892. \def\thissectionnum{}
  4893. \def\thissectionname{}
  4894. \newcount\absseclevel % used to calculate proper heading level
  4895. \newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
  4896. % @raisesections: treat @section as chapter, @subsection as section, etc.
  4897. \def\raisesections{\global\advance\secbase by -1}
  4898. \let\up=\raisesections % original BFox name
  4899. % @lowersections: treat @chapter as section, @section as subsection, etc.
  4900. \def\lowersections{\global\advance\secbase by 1}
  4901. \let\down=\lowersections % original BFox name
  4902. % we only have subsub.
  4903. \chardef\maxseclevel = 3
  4904. %
  4905. % A numbered section within an unnumbered changes to unnumbered too.
  4906. % To achieve this, remember the "biggest" unnum. sec. we are currently in:
  4907. \chardef\unnlevel = \maxseclevel
  4908. %
  4909. % Trace whether the current chapter is an appendix or not:
  4910. % \chapheadtype is "N" or "A", unnumbered chapters are ignored.
  4911. \def\chapheadtype{N}
  4912. % Choose a heading macro
  4913. % #1 is heading type
  4914. % #2 is heading level
  4915. % #3 is text for heading
  4916. \def\genhead#1#2#3{%
  4917. % Compute the abs. sec. level:
  4918. \absseclevel=#2
  4919. \advance\absseclevel by \secbase
  4920. % Make sure \absseclevel doesn't fall outside the range:
  4921. \ifnum \absseclevel < 0
  4922. \absseclevel = 0
  4923. \else
  4924. \ifnum \absseclevel > 3
  4925. \absseclevel = 3
  4926. \fi
  4927. \fi
  4928. % The heading type:
  4929. \def\headtype{#1}%
  4930. \if \headtype U%
  4931. \ifnum \absseclevel < \unnlevel
  4932. \chardef\unnlevel = \absseclevel
  4933. \fi
  4934. \else
  4935. % Check for appendix sections:
  4936. \ifnum \absseclevel = 0
  4937. \edef\chapheadtype{\headtype}%
  4938. \else
  4939. \if \headtype A\if \chapheadtype N%
  4940. \errmessage{@appendix... within a non-appendix chapter}%
  4941. \fi\fi
  4942. \fi
  4943. % Check for numbered within unnumbered:
  4944. \ifnum \absseclevel > \unnlevel
  4945. \def\headtype{U}%
  4946. \else
  4947. \chardef\unnlevel = 3
  4948. \fi
  4949. \fi
  4950. % Now print the heading:
  4951. \if \headtype U%
  4952. \ifcase\absseclevel
  4953. \unnumberedzzz{#3}%
  4954. \or \unnumberedseczzz{#3}%
  4955. \or \unnumberedsubseczzz{#3}%
  4956. \or \unnumberedsubsubseczzz{#3}%
  4957. \fi
  4958. \else
  4959. \if \headtype A%
  4960. \ifcase\absseclevel
  4961. \appendixzzz{#3}%
  4962. \or \appendixsectionzzz{#3}%
  4963. \or \appendixsubseczzz{#3}%
  4964. \or \appendixsubsubseczzz{#3}%
  4965. \fi
  4966. \else
  4967. \ifcase\absseclevel
  4968. \chapterzzz{#3}%
  4969. \or \seczzz{#3}%
  4970. \or \numberedsubseczzz{#3}%
  4971. \or \numberedsubsubseczzz{#3}%
  4972. \fi
  4973. \fi
  4974. \fi
  4975. \suppressfirstparagraphindent
  4976. }
  4977. % an interface:
  4978. \def\numhead{\genhead N}
  4979. \def\apphead{\genhead A}
  4980. \def\unnmhead{\genhead U}
  4981. % @chapter, @appendix, @unnumbered. Increment top-level counter, reset
  4982. % all lower-level sectioning counters to zero.
  4983. %
  4984. % Also set \chaplevelprefix, which we prepend to @float sequence numbers
  4985. % (e.g., figures), q.v. By default (before any chapter), that is empty.
  4986. \let\chaplevelprefix = \empty
  4987. %
  4988. \outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz
  4989. \def\chapterzzz#1{%
  4990. % section resetting is \global in case the chapter is in a group, such
  4991. % as an @include file.
  4992. \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
  4993. \global\advance\chapno by 1
  4994. %
  4995. % Used for \float.
  4996. \gdef\chaplevelprefix{\the\chapno.}%
  4997. \resetallfloatnos
  4998. %
  4999. % \putwordChapter can contain complex things in translations.
  5000. \toks0=\expandafter{\putwordChapter}%
  5001. \message{\the\toks0 \space \the\chapno}%
  5002. %
  5003. % Write the actual heading.
  5004. \chapmacro{#1}{Ynumbered}{\the\chapno}%
  5005. %
  5006. % So @section and the like are numbered underneath this chapter.
  5007. \global\let\section = \numberedsec
  5008. \global\let\subsection = \numberedsubsec
  5009. \global\let\subsubsection = \numberedsubsubsec
  5010. }
  5011. \outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz
  5012. %
  5013. \def\appendixzzz#1{%
  5014. \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
  5015. \global\advance\appendixno by 1
  5016. \gdef\chaplevelprefix{\appendixletter.}%
  5017. \resetallfloatnos
  5018. %
  5019. % \putwordAppendix can contain complex things in translations.
  5020. \toks0=\expandafter{\putwordAppendix}%
  5021. \message{\the\toks0 \space \appendixletter}%
  5022. %
  5023. \chapmacro{#1}{Yappendix}{\appendixletter}%
  5024. %
  5025. \global\let\section = \appendixsec
  5026. \global\let\subsection = \appendixsubsec
  5027. \global\let\subsubsection = \appendixsubsubsec
  5028. }
  5029. % normally unnmhead0 calls unnumberedzzz:
  5030. \outer\parseargdef\unnumbered{\unnmhead0{#1}}
  5031. \def\unnumberedzzz#1{%
  5032. \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
  5033. \global\advance\unnumberedno by 1
  5034. %
  5035. % Since an unnumbered has no number, no prefix for figures.
  5036. \global\let\chaplevelprefix = \empty
  5037. \resetallfloatnos
  5038. %
  5039. % This used to be simply \message{#1}, but TeX fully expands the
  5040. % argument to \message. Therefore, if #1 contained @-commands, TeX
  5041. % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
  5042. % expanded @cite (which turns out to cause errors because \cite is meant
  5043. % to be executed, not expanded).
  5044. %
  5045. % Anyway, we don't want the fully-expanded definition of @cite to appear
  5046. % as a result of the \message, we just want `@cite' itself. We use
  5047. % \the<toks register> to achieve this: TeX expands \the<toks> only once,
  5048. % simply yielding the contents of <toks register>. (We also do this for
  5049. % the toc entries.)
  5050. \toks0 = {#1}%
  5051. \message{(\the\toks0)}%
  5052. %
  5053. \chapmacro{#1}{Ynothing}{\the\unnumberedno}%
  5054. %
  5055. \global\let\section = \unnumberedsec
  5056. \global\let\subsection = \unnumberedsubsec
  5057. \global\let\subsubsection = \unnumberedsubsubsec
  5058. }
  5059. % @centerchap is like @unnumbered, but the heading is centered.
  5060. \outer\parseargdef\centerchap{%
  5061. % Well, we could do the following in a group, but that would break
  5062. % an assumption that \chapmacro is called at the outermost level.
  5063. % Thus we are safer this way: --kasal, 24feb04
  5064. \let\centerparametersmaybe = \centerparameters
  5065. \unnmhead0{#1}%
  5066. \let\centerparametersmaybe = \relax
  5067. }
  5068. % @top is like @unnumbered.
  5069. \let\top\unnumbered
  5070. % Sections.
  5071. %
  5072. \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
  5073. \def\seczzz#1{%
  5074. \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
  5075. \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
  5076. }
  5077. % normally calls appendixsectionzzz:
  5078. \outer\parseargdef\appendixsection{\apphead1{#1}}
  5079. \def\appendixsectionzzz#1{%
  5080. \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
  5081. \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
  5082. }
  5083. \let\appendixsec\appendixsection
  5084. % normally calls unnumberedseczzz:
  5085. \outer\parseargdef\unnumberedsec{\unnmhead1{#1}}
  5086. \def\unnumberedseczzz#1{%
  5087. \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
  5088. \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
  5089. }
  5090. % Subsections.
  5091. %
  5092. % normally calls numberedsubseczzz:
  5093. \outer\parseargdef\numberedsubsec{\numhead2{#1}}
  5094. \def\numberedsubseczzz#1{%
  5095. \global\subsubsecno=0 \global\advance\subsecno by 1
  5096. \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
  5097. }
  5098. % normally calls appendixsubseczzz:
  5099. \outer\parseargdef\appendixsubsec{\apphead2{#1}}
  5100. \def\appendixsubseczzz#1{%
  5101. \global\subsubsecno=0 \global\advance\subsecno by 1
  5102. \sectionheading{#1}{subsec}{Yappendix}%
  5103. {\appendixletter.\the\secno.\the\subsecno}%
  5104. }
  5105. % normally calls unnumberedsubseczzz:
  5106. \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}}
  5107. \def\unnumberedsubseczzz#1{%
  5108. \global\subsubsecno=0 \global\advance\subsecno by 1
  5109. \sectionheading{#1}{subsec}{Ynothing}%
  5110. {\the\unnumberedno.\the\secno.\the\subsecno}%
  5111. }
  5112. % Subsubsections.
  5113. %
  5114. % normally numberedsubsubseczzz:
  5115. \outer\parseargdef\numberedsubsubsec{\numhead3{#1}}
  5116. \def\numberedsubsubseczzz#1{%
  5117. \global\advance\subsubsecno by 1
  5118. \sectionheading{#1}{subsubsec}{Ynumbered}%
  5119. {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
  5120. }
  5121. % normally appendixsubsubseczzz:
  5122. \outer\parseargdef\appendixsubsubsec{\apphead3{#1}}
  5123. \def\appendixsubsubseczzz#1{%
  5124. \global\advance\subsubsecno by 1
  5125. \sectionheading{#1}{subsubsec}{Yappendix}%
  5126. {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
  5127. }
  5128. % normally unnumberedsubsubseczzz:
  5129. \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}}
  5130. \def\unnumberedsubsubseczzz#1{%
  5131. \global\advance\subsubsecno by 1
  5132. \sectionheading{#1}{subsubsec}{Ynothing}%
  5133. {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}%
  5134. }
  5135. % These macros control what the section commands do, according
  5136. % to what kind of chapter we are in (ordinary, appendix, or unnumbered).
  5137. % Define them by default for a numbered chapter.
  5138. \let\section = \numberedsec
  5139. \let\subsection = \numberedsubsec
  5140. \let\subsubsection = \numberedsubsubsec
  5141. % Define @majorheading, @heading and @subheading
  5142. % NOTE on use of \vbox for chapter headings, section headings, and such:
  5143. % 1) We use \vbox rather than the earlier \line to permit
  5144. % overlong headings to fold.
  5145. % 2) \hyphenpenalty is set to 10000 because hyphenation in a
  5146. % heading is obnoxious; this forbids it.
  5147. % 3) Likewise, headings look best if no \parindent is used, and
  5148. % if justification is not attempted. Hence \raggedright.
  5149. \def\majorheading{%
  5150. {\advance\chapheadingskip by 10pt \chapbreak }%
  5151. \parsearg\chapheadingzzz
  5152. }
  5153. \def\chapheading{\chapbreak \parsearg\chapheadingzzz}
  5154. \def\chapheadingzzz#1{%
  5155. {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  5156. \parindent=0pt\ptexraggedright
  5157. \rmisbold #1\hfill}}%
  5158. \bigskip \par\penalty 200\relax
  5159. \suppressfirstparagraphindent
  5160. }
  5161. % @heading, @subheading, @subsubheading.
  5162. \parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{}
  5163. \suppressfirstparagraphindent}
  5164. \parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{}
  5165. \suppressfirstparagraphindent}
  5166. \parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
  5167. \suppressfirstparagraphindent}
  5168. % These macros generate a chapter, section, etc. heading only
  5169. % (including whitespace, linebreaking, etc. around it),
  5170. % given all the information in convenient, parsed form.
  5171. % Args are the skip and penalty (usually negative)
  5172. \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
  5173. % Parameter controlling skip before chapter headings (if needed)
  5174. \newskip\chapheadingskip
  5175. % Define plain chapter starts, and page on/off switching for it.
  5176. \def\chapbreak{\dobreak \chapheadingskip {-4000}}
  5177. \def\chappager{\par\vfill\supereject}
  5178. % Because \domark is called before \chapoddpage, the filler page will
  5179. % get the headings for the next chapter, which is wrong. But we don't
  5180. % care -- we just disable all headings on the filler page.
  5181. \def\chapoddpage{%
  5182. \chappager
  5183. \ifodd\pageno \else
  5184. \begingroup
  5185. \headingsoff
  5186. \null
  5187. \chappager
  5188. \endgroup
  5189. \fi
  5190. }
  5191. \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
  5192. \def\CHAPPAGoff{%
  5193. \global\let\contentsalignmacro = \chappager
  5194. \global\let\pchapsepmacro=\chapbreak
  5195. \global\let\pagealignmacro=\chappager}
  5196. \def\CHAPPAGon{%
  5197. \global\let\contentsalignmacro = \chappager
  5198. \global\let\pchapsepmacro=\chappager
  5199. \global\let\pagealignmacro=\chappager
  5200. \global\def\HEADINGSon{\HEADINGSsingle}}
  5201. \def\CHAPPAGodd{%
  5202. \global\let\contentsalignmacro = \chapoddpage
  5203. \global\let\pchapsepmacro=\chapoddpage
  5204. \global\let\pagealignmacro=\chapoddpage
  5205. \global\def\HEADINGSon{\HEADINGSdouble}}
  5206. \CHAPPAGon
  5207. % Chapter opening.
  5208. %
  5209. % #1 is the text, #2 is the section type (Ynumbered, Ynothing,
  5210. % Yappendix, Yomitfromtoc), #3 the chapter number.
  5211. %
  5212. % To test against our argument.
  5213. \def\Ynothingkeyword{Ynothing}
  5214. \def\Yomitfromtockeyword{Yomitfromtoc}
  5215. \def\Yappendixkeyword{Yappendix}
  5216. %
  5217. \def\chapmacro#1#2#3{%
  5218. % Insert the first mark before the heading break (see notes for \domark).
  5219. \let\prevchapterdefs=\lastchapterdefs
  5220. \let\prevsectiondefs=\lastsectiondefs
  5221. \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
  5222. \gdef\thissection{}}%
  5223. %
  5224. \def\temptype{#2}%
  5225. \ifx\temptype\Ynothingkeyword
  5226. \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
  5227. \gdef\thischapter{\thischaptername}}%
  5228. \else\ifx\temptype\Yomitfromtockeyword
  5229. \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
  5230. \gdef\thischapter{}}%
  5231. \else\ifx\temptype\Yappendixkeyword
  5232. \toks0={#1}%
  5233. \xdef\lastchapterdefs{%
  5234. \gdef\noexpand\thischaptername{\the\toks0}%
  5235. \gdef\noexpand\thischapternum{\appendixletter}%
  5236. % \noexpand\putwordAppendix avoids expanding indigestible
  5237. % commands in some of the translations.
  5238. \gdef\noexpand\thischapter{\noexpand\putwordAppendix{}
  5239. \noexpand\thischapternum:
  5240. \noexpand\thischaptername}%
  5241. }%
  5242. \else
  5243. \toks0={#1}%
  5244. \xdef\lastchapterdefs{%
  5245. \gdef\noexpand\thischaptername{\the\toks0}%
  5246. \gdef\noexpand\thischapternum{\the\chapno}%
  5247. % \noexpand\putwordChapter avoids expanding indigestible
  5248. % commands in some of the translations.
  5249. \gdef\noexpand\thischapter{\noexpand\putwordChapter{}
  5250. \noexpand\thischapternum:
  5251. \noexpand\thischaptername}%
  5252. }%
  5253. \fi\fi\fi
  5254. %
  5255. % Output the mark. Pass it through \safewhatsit, to take care of
  5256. % the preceding space.
  5257. \safewhatsit\domark
  5258. %
  5259. % Insert the chapter heading break.
  5260. \pchapsepmacro
  5261. %
  5262. % Now the second mark, after the heading break. No break points
  5263. % between here and the heading.
  5264. \let\prevchapterdefs=\lastchapterdefs
  5265. \let\prevsectiondefs=\lastsectiondefs
  5266. \domark
  5267. %
  5268. {%
  5269. \chapfonts \rmisbold
  5270. %
  5271. % Have to define \lastsection before calling \donoderef, because the
  5272. % xref code eventually uses it. On the other hand, it has to be called
  5273. % after \pchapsepmacro, or the headline will change too soon.
  5274. \gdef\lastsection{#1}%
  5275. %
  5276. % Only insert the separating space if we have a chapter/appendix
  5277. % number, and don't print the unnumbered ``number''.
  5278. \ifx\temptype\Ynothingkeyword
  5279. \setbox0 = \hbox{}%
  5280. \def\toctype{unnchap}%
  5281. \else\ifx\temptype\Yomitfromtockeyword
  5282. \setbox0 = \hbox{}% contents like unnumbered, but no toc entry
  5283. \def\toctype{omit}%
  5284. \else\ifx\temptype\Yappendixkeyword
  5285. \setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
  5286. \def\toctype{app}%
  5287. \else
  5288. \setbox0 = \hbox{#3\enspace}%
  5289. \def\toctype{numchap}%
  5290. \fi\fi\fi
  5291. %
  5292. % Write the toc entry for this chapter. Must come before the
  5293. % \donoderef, because we include the current node name in the toc
  5294. % entry, and \donoderef resets it to empty.
  5295. \writetocentry{\toctype}{#1}{#3}%
  5296. %
  5297. % For pdftex, we have to write out the node definition (aka, make
  5298. % the pdfdest) after any page break, but before the actual text has
  5299. % been typeset. If the destination for the pdf outline is after the
  5300. % text, then jumping from the outline may wind up with the text not
  5301. % being visible, for instance under high magnification.
  5302. \donoderef{#2}%
  5303. %
  5304. % Typeset the actual heading.
  5305. \nobreak % Avoid page breaks at the interline glue.
  5306. \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
  5307. \hangindent=\wd0 \centerparametersmaybe
  5308. \unhbox0 #1\par}%
  5309. }%
  5310. \nobreak\bigskip % no page break after a chapter title
  5311. \nobreak
  5312. }
  5313. % @centerchap -- centered and unnumbered.
  5314. \let\centerparametersmaybe = \relax
  5315. \def\centerparameters{%
  5316. \advance\rightskip by 3\rightskip
  5317. \leftskip = \rightskip
  5318. \parfillskip = 0pt
  5319. }
  5320. % I don't think this chapter style is supported any more, so I'm not
  5321. % updating it with the new noderef stuff. We'll see. --karl, 11aug03.
  5322. %
  5323. \def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
  5324. %
  5325. \def\unnchfopen #1{%
  5326. \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  5327. \parindent=0pt\ptexraggedright
  5328. \rmisbold #1\hfill}}\bigskip \par\nobreak
  5329. }
  5330. \def\chfopen #1#2{\chapoddpage {\chapfonts
  5331. \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
  5332. \par\penalty 5000 %
  5333. }
  5334. \def\centerchfopen #1{%
  5335. \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  5336. \parindent=0pt
  5337. \hfill {\rmisbold #1}\hfill}}\bigskip \par\nobreak
  5338. }
  5339. \def\CHAPFopen{%
  5340. \global\let\chapmacro=\chfopen
  5341. \global\let\centerchapmacro=\centerchfopen}
  5342. % Section titles. These macros combine the section number parts and
  5343. % call the generic \sectionheading to do the printing.
  5344. %
  5345. \newskip\secheadingskip
  5346. \def\secheadingbreak{\dobreak \secheadingskip{-1000}}
  5347. % Subsection titles.
  5348. \newskip\subsecheadingskip
  5349. \def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}}
  5350. % Subsubsection titles.
  5351. \def\subsubsecheadingskip{\subsecheadingskip}
  5352. \def\subsubsecheadingbreak{\subsecheadingbreak}
  5353. % Print any size, any type, section title.
  5354. %
  5355. % #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is
  5356. % the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the
  5357. % section number.
  5358. %
  5359. \def\seckeyword{sec}
  5360. %
  5361. \def\sectionheading#1#2#3#4{%
  5362. {%
  5363. \checkenv{}% should not be in an environment.
  5364. %
  5365. % Switch to the right set of fonts.
  5366. \csname #2fonts\endcsname \rmisbold
  5367. %
  5368. \def\sectionlevel{#2}%
  5369. \def\temptype{#3}%
  5370. %
  5371. % Insert first mark before the heading break (see notes for \domark).
  5372. \let\prevsectiondefs=\lastsectiondefs
  5373. \ifx\temptype\Ynothingkeyword
  5374. \ifx\sectionlevel\seckeyword
  5375. \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
  5376. \gdef\thissection{\thissectionname}}%
  5377. \fi
  5378. \else\ifx\temptype\Yomitfromtockeyword
  5379. % Don't redefine \thissection.
  5380. \else\ifx\temptype\Yappendixkeyword
  5381. \ifx\sectionlevel\seckeyword
  5382. \toks0={#1}%
  5383. \xdef\lastsectiondefs{%
  5384. \gdef\noexpand\thissectionname{\the\toks0}%
  5385. \gdef\noexpand\thissectionnum{#4}%
  5386. % \noexpand\putwordSection avoids expanding indigestible
  5387. % commands in some of the translations.
  5388. \gdef\noexpand\thissection{\noexpand\putwordSection{}
  5389. \noexpand\thissectionnum:
  5390. \noexpand\thissectionname}%
  5391. }%
  5392. \fi
  5393. \else
  5394. \ifx\sectionlevel\seckeyword
  5395. \toks0={#1}%
  5396. \xdef\lastsectiondefs{%
  5397. \gdef\noexpand\thissectionname{\the\toks0}%
  5398. \gdef\noexpand\thissectionnum{#4}%
  5399. % \noexpand\putwordSection avoids expanding indigestible
  5400. % commands in some of the translations.
  5401. \gdef\noexpand\thissection{\noexpand\putwordSection{}
  5402. \noexpand\thissectionnum:
  5403. \noexpand\thissectionname}%
  5404. }%
  5405. \fi
  5406. \fi\fi\fi
  5407. %
  5408. % Go into vertical mode. Usually we'll already be there, but we
  5409. % don't want the following whatsit to end up in a preceding paragraph
  5410. % if the document didn't happen to have a blank line.
  5411. \par
  5412. %
  5413. % Output the mark. Pass it through \safewhatsit, to take care of
  5414. % the preceding space.
  5415. \safewhatsit\domark
  5416. %
  5417. % Insert space above the heading.
  5418. \csname #2headingbreak\endcsname
  5419. %
  5420. % Now the second mark, after the heading break. No break points
  5421. % between here and the heading.
  5422. \let\prevsectiondefs=\lastsectiondefs
  5423. \domark
  5424. %
  5425. % Only insert the space after the number if we have a section number.
  5426. \ifx\temptype\Ynothingkeyword
  5427. \setbox0 = \hbox{}%
  5428. \def\toctype{unn}%
  5429. \gdef\lastsection{#1}%
  5430. \else\ifx\temptype\Yomitfromtockeyword
  5431. % for @headings -- no section number, don't include in toc,
  5432. % and don't redefine \lastsection.
  5433. \setbox0 = \hbox{}%
  5434. \def\toctype{omit}%
  5435. \let\sectionlevel=\empty
  5436. \else\ifx\temptype\Yappendixkeyword
  5437. \setbox0 = \hbox{#4\enspace}%
  5438. \def\toctype{app}%
  5439. \gdef\lastsection{#1}%
  5440. \else
  5441. \setbox0 = \hbox{#4\enspace}%
  5442. \def\toctype{num}%
  5443. \gdef\lastsection{#1}%
  5444. \fi\fi\fi
  5445. %
  5446. % Write the toc entry (before \donoderef). See comments in \chapmacro.
  5447. \writetocentry{\toctype\sectionlevel}{#1}{#4}%
  5448. %
  5449. % Write the node reference (= pdf destination for pdftex).
  5450. % Again, see comments in \chapmacro.
  5451. \donoderef{#3}%
  5452. %
  5453. % Interline glue will be inserted when the vbox is completed.
  5454. % That glue will be a valid breakpoint for the page, since it'll be
  5455. % preceded by a whatsit (usually from the \donoderef, or from the
  5456. % \writetocentry if there was no node). We don't want to allow that
  5457. % break, since then the whatsits could end up on page n while the
  5458. % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000.
  5459. \nobreak
  5460. %
  5461. % Output the actual section heading.
  5462. \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
  5463. \hangindent=\wd0 % zero if no section number
  5464. \unhbox0 #1}%
  5465. }%
  5466. % Add extra space after the heading -- half of whatever came above it.
  5467. % Don't allow stretch, though.
  5468. \kern .5 \csname #2headingskip\endcsname
  5469. %
  5470. % Do not let the kern be a potential breakpoint, as it would be if it
  5471. % was followed by glue.
  5472. \nobreak
  5473. %
  5474. % We'll almost certainly start a paragraph next, so don't let that
  5475. % glue accumulate. (Not a breakpoint because it's preceded by a
  5476. % discardable item.) However, when a paragraph is not started next
  5477. % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out
  5478. % or the negative glue will cause weirdly wrong output, typically
  5479. % obscuring the section heading with something else.
  5480. \vskip-\parskip
  5481. %
  5482. % This is so the last item on the main vertical list is a known
  5483. % \penalty > 10000, so \startdefun, etc., can recognize the situation
  5484. % and do the needful.
  5485. \penalty 10001
  5486. }
  5487. \message{toc,}
  5488. % Table of contents.
  5489. \newwrite\tocfile
  5490. % Write an entry to the toc file, opening it if necessary.
  5491. % Called from @chapter, etc.
  5492. %
  5493. % Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno}
  5494. % We append the current node name (if any) and page number as additional
  5495. % arguments for the \{chap,sec,...}entry macros which will eventually
  5496. % read this. The node name is used in the pdf outlines as the
  5497. % destination to jump to.
  5498. %
  5499. % We open the .toc file for writing here instead of at @setfilename (or
  5500. % any other fixed time) so that @contents can be anywhere in the document.
  5501. % But if #1 is `omit', then we don't do anything. This is used for the
  5502. % table of contents chapter openings themselves.
  5503. %
  5504. \newif\iftocfileopened
  5505. \def\omitkeyword{omit}%
  5506. %
  5507. \def\writetocentry#1#2#3{%
  5508. \edef\writetoctype{#1}%
  5509. \ifx\writetoctype\omitkeyword \else
  5510. \iftocfileopened\else
  5511. \immediate\openout\tocfile = \jobname.toc
  5512. \global\tocfileopenedtrue
  5513. \fi
  5514. %
  5515. \iflinks
  5516. {\atdummies
  5517. \edef\temp{%
  5518. \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}%
  5519. \temp
  5520. }%
  5521. \fi
  5522. \fi
  5523. %
  5524. % Tell \shipout to create a pdf destination on each page, if we're
  5525. % writing pdf. These are used in the table of contents. We can't
  5526. % just write one on every page because the title pages are numbered
  5527. % 1 and 2 (the page numbers aren't printed), and so are the first
  5528. % two pages of the document. Thus, we'd have two destinations named
  5529. % `1', and two named `2'.
  5530. \ifpdf \global\pdfmakepagedesttrue \fi
  5531. }
  5532. % These characters do not print properly in the Computer Modern roman
  5533. % fonts, so we must take special care. This is more or less redundant
  5534. % with the Texinfo input format setup at the end of this file.
  5535. %
  5536. \def\activecatcodes{%
  5537. \catcode`\"=\active
  5538. \catcode`\$=\active
  5539. \catcode`\<=\active
  5540. \catcode`\>=\active
  5541. \catcode`\\=\active
  5542. \catcode`\^=\active
  5543. \catcode`\_=\active
  5544. \catcode`\|=\active
  5545. \catcode`\~=\active
  5546. }
  5547. % Read the toc file, which is essentially Texinfo input.
  5548. \def\readtocfile{%
  5549. \setupdatafile
  5550. \activecatcodes
  5551. \input \tocreadfilename
  5552. }
  5553. \newskip\contentsrightmargin \contentsrightmargin=1in
  5554. \newcount\savepageno
  5555. \newcount\lastnegativepageno \lastnegativepageno = -1
  5556. % Prepare to read what we've written to \tocfile.
  5557. %
  5558. \def\startcontents#1{%
  5559. % If @setchapternewpage on, and @headings double, the contents should
  5560. % start on an odd page, unlike chapters. Thus, we maintain
  5561. % \contentsalignmacro in parallel with \pagealignmacro.
  5562. % From: Torbjorn Granlund <tege@matematik.su.se>
  5563. \contentsalignmacro
  5564. \immediate\closeout\tocfile
  5565. %
  5566. % Don't need to put `Contents' or `Short Contents' in the headline.
  5567. % It is abundantly clear what they are.
  5568. \chapmacro{#1}{Yomitfromtoc}{}%
  5569. %
  5570. \savepageno = \pageno
  5571. \begingroup % Set up to handle contents files properly.
  5572. \raggedbottom % Worry more about breakpoints than the bottom.
  5573. \advance\hsize by -\contentsrightmargin % Don't use the full line length.
  5574. %
  5575. % Roman numerals for page numbers.
  5576. \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
  5577. }
  5578. % redefined for the two-volume lispref. We always output on
  5579. % \jobname.toc even if this is redefined.
  5580. %
  5581. \def\tocreadfilename{\jobname.toc}
  5582. % Normal (long) toc.
  5583. %
  5584. \def\contents{%
  5585. \startcontents{\putwordTOC}%
  5586. \openin 1 \tocreadfilename\space
  5587. \ifeof 1 \else
  5588. \readtocfile
  5589. \fi
  5590. \vfill \eject
  5591. \contentsalignmacro % in case @setchapternewpage odd is in effect
  5592. \ifeof 1 \else
  5593. \pdfmakeoutlines
  5594. \fi
  5595. \closein 1
  5596. \endgroup
  5597. \lastnegativepageno = \pageno
  5598. \global\pageno = \savepageno
  5599. }
  5600. % And just the chapters.
  5601. \def\summarycontents{%
  5602. \startcontents{\putwordShortTOC}%
  5603. %
  5604. \let\partentry = \shortpartentry
  5605. \let\numchapentry = \shortchapentry
  5606. \let\appentry = \shortchapentry
  5607. \let\unnchapentry = \shortunnchapentry
  5608. % We want a true roman here for the page numbers.
  5609. \secfonts
  5610. \let\rm=\shortcontrm \let\bf=\shortcontbf
  5611. \let\sl=\shortcontsl \let\tt=\shortconttt
  5612. \rm
  5613. \hyphenpenalty = 10000
  5614. \advance\baselineskip by 1pt % Open it up a little.
  5615. \def\numsecentry##1##2##3##4{}
  5616. \let\appsecentry = \numsecentry
  5617. \let\unnsecentry = \numsecentry
  5618. \let\numsubsecentry = \numsecentry
  5619. \let\appsubsecentry = \numsecentry
  5620. \let\unnsubsecentry = \numsecentry
  5621. \let\numsubsubsecentry = \numsecentry
  5622. \let\appsubsubsecentry = \numsecentry
  5623. \let\unnsubsubsecentry = \numsecentry
  5624. \openin 1 \tocreadfilename\space
  5625. \ifeof 1 \else
  5626. \readtocfile
  5627. \fi
  5628. \closein 1
  5629. \vfill \eject
  5630. \contentsalignmacro % in case @setchapternewpage odd is in effect
  5631. \endgroup
  5632. \lastnegativepageno = \pageno
  5633. \global\pageno = \savepageno
  5634. }
  5635. \let\shortcontents = \summarycontents
  5636. % Typeset the label for a chapter or appendix for the short contents.
  5637. % The arg is, e.g., `A' for an appendix, or `3' for a chapter.
  5638. %
  5639. \def\shortchaplabel#1{%
  5640. % This space should be enough, since a single number is .5em, and the
  5641. % widest letter (M) is 1em, at least in the Computer Modern fonts.
  5642. % But use \hss just in case.
  5643. % (This space doesn't include the extra space that gets added after
  5644. % the label; that gets put in by \shortchapentry above.)
  5645. %
  5646. % We'd like to right-justify chapter numbers, but that looks strange
  5647. % with appendix letters. And right-justifying numbers and
  5648. % left-justifying letters looks strange when there is less than 10
  5649. % chapters. Have to read the whole toc once to know how many chapters
  5650. % there are before deciding ...
  5651. \hbox to 1em{#1\hss}%
  5652. }
  5653. % These macros generate individual entries in the table of contents.
  5654. % The first argument is the chapter or section name.
  5655. % The last argument is the page number.
  5656. % The arguments in between are the chapter number, section number, ...
  5657. % Parts, in the main contents. Replace the part number, which doesn't
  5658. % exist, with an empty box. Let's hope all the numbers have the same width.
  5659. % Also ignore the page number, which is conventionally not printed.
  5660. \def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}}
  5661. \def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}}
  5662. %
  5663. % Parts, in the short toc.
  5664. \def\shortpartentry#1#2#3#4{%
  5665. \penalty-300
  5666. \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip
  5667. \shortchapentry{{\bf #1}}{\numeralbox}{}{}%
  5668. }
  5669. % Chapters, in the main contents.
  5670. \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
  5671. %
  5672. % Chapters, in the short toc.
  5673. % See comments in \dochapentry re vbox and related settings.
  5674. \def\shortchapentry#1#2#3#4{%
  5675. \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}%
  5676. }
  5677. % Appendices, in the main contents.
  5678. % Need the word Appendix, and a fixed-size box.
  5679. %
  5680. \def\appendixbox#1{%
  5681. % We use M since it's probably the widest letter.
  5682. \setbox0 = \hbox{\putwordAppendix{} M}%
  5683. \hbox to \wd0{\putwordAppendix{} #1\hss}}
  5684. %
  5685. \def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}}
  5686. % Unnumbered chapters.
  5687. \def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}
  5688. \def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}}
  5689. % Sections.
  5690. \def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}}
  5691. \let\appsecentry=\numsecentry
  5692. \def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}}
  5693. % Subsections.
  5694. \def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}}
  5695. \let\appsubsecentry=\numsubsecentry
  5696. \def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}
  5697. % And subsubsections.
  5698. \def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}}
  5699. \let\appsubsubsecentry=\numsubsubsecentry
  5700. \def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}}
  5701. % This parameter controls the indentation of the various levels.
  5702. % Same as \defaultparindent.
  5703. \newdimen\tocindent \tocindent = 15pt
  5704. % Now for the actual typesetting. In all these, #1 is the text and #2 is the
  5705. % page number.
  5706. %
  5707. % If the toc has to be broken over pages, we want it to be at chapters
  5708. % if at all possible; hence the \penalty.
  5709. \def\dochapentry#1#2{%
  5710. \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
  5711. \begingroup
  5712. \chapentryfonts
  5713. \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  5714. \endgroup
  5715. \nobreak\vskip .25\baselineskip plus.1\baselineskip
  5716. }
  5717. \def\dosecentry#1#2{\begingroup
  5718. \secentryfonts \leftskip=\tocindent
  5719. \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  5720. \endgroup}
  5721. \def\dosubsecentry#1#2{\begingroup
  5722. \subsecentryfonts \leftskip=2\tocindent
  5723. \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  5724. \endgroup}
  5725. \def\dosubsubsecentry#1#2{\begingroup
  5726. \subsubsecentryfonts \leftskip=3\tocindent
  5727. \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  5728. \endgroup}
  5729. % We use the same \entry macro as for the index entries.
  5730. \let\tocentry = \entry
  5731. % Space between chapter (or whatever) number and the title.
  5732. \def\labelspace{\hskip1em \relax}
  5733. \def\dopageno#1{{\rm #1}}
  5734. \def\doshortpageno#1{{\rm #1}}
  5735. \def\chapentryfonts{\secfonts \rm}
  5736. \def\secentryfonts{\textfonts}
  5737. \def\subsecentryfonts{\textfonts}
  5738. \def\subsubsecentryfonts{\textfonts}
  5739. \message{environments,}
  5740. % @foo ... @end foo.
  5741. % @tex ... @end tex escapes into raw TeX temporarily.
  5742. % One exception: @ is still an escape character, so that @end tex works.
  5743. % But \@ or @@ will get a plain @ character.
  5744. \envdef\tex{%
  5745. \setupmarkupstyle{tex}%
  5746. \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
  5747. \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
  5748. \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
  5749. \catcode `\%=14
  5750. \catcode `\+=\other
  5751. \catcode `\"=\other
  5752. \catcode `\|=\other
  5753. \catcode `\<=\other
  5754. \catcode `\>=\other
  5755. \catcode`\`=\other
  5756. \catcode`\'=\other
  5757. \escapechar=`\\
  5758. %
  5759. % ' is active in math mode (mathcode"8000). So reset it, and all our
  5760. % other math active characters (just in case), to plain's definitions.
  5761. \mathactive
  5762. %
  5763. \let\b=\ptexb
  5764. \let\bullet=\ptexbullet
  5765. \let\c=\ptexc
  5766. \let\,=\ptexcomma
  5767. \let\.=\ptexdot
  5768. \let\dots=\ptexdots
  5769. \let\equiv=\ptexequiv
  5770. \let\!=\ptexexclam
  5771. \let\i=\ptexi
  5772. \let\indent=\ptexindent
  5773. \let\noindent=\ptexnoindent
  5774. \let\{=\ptexlbrace
  5775. \let\+=\tabalign
  5776. \let\}=\ptexrbrace
  5777. \let\/=\ptexslash
  5778. \let\*=\ptexstar
  5779. \let\t=\ptext
  5780. \expandafter \let\csname top\endcsname=\ptextop % outer
  5781. \let\frenchspacing=\plainfrenchspacing
  5782. %
  5783. \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
  5784. \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
  5785. \def\@{@}%
  5786. }
  5787. % There is no need to define \Etex.
  5788. % Define @lisp ... @end lisp.
  5789. % @lisp environment forms a group so it can rebind things,
  5790. % including the definition of @end lisp (which normally is erroneous).
  5791. % Amount to narrow the margins by for @lisp.
  5792. \newskip\lispnarrowing \lispnarrowing=0.4in
  5793. % This is the definition that ^^M gets inside @lisp, @example, and other
  5794. % such environments. \null is better than a space, since it doesn't
  5795. % have any width.
  5796. \def\lisppar{\null\endgraf}
  5797. % This space is always present above and below environments.
  5798. \newskip\envskipamount \envskipamount = 0pt
  5799. % Make spacing and below environment symmetrical. We use \parskip here
  5800. % to help in doing that, since in @example-like environments \parskip
  5801. % is reset to zero; thus the \afterenvbreak inserts no space -- but the
  5802. % start of the next paragraph will insert \parskip.
  5803. %
  5804. \def\aboveenvbreak{{%
  5805. % =10000 instead of <10000 because of a special case in \itemzzz and
  5806. % \sectionheading, q.v.
  5807. \ifnum \lastpenalty=10000 \else
  5808. \advance\envskipamount by \parskip
  5809. \endgraf
  5810. \ifdim\lastskip<\envskipamount
  5811. \removelastskip
  5812. % it's not a good place to break if the last penalty was \nobreak
  5813. % or better ...
  5814. \ifnum\lastpenalty<10000 \penalty-50 \fi
  5815. \vskip\envskipamount
  5816. \fi
  5817. \fi
  5818. }}
  5819. \let\afterenvbreak = \aboveenvbreak
  5820. % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will
  5821. % also clear it, so that its embedded environments do the narrowing again.
  5822. \let\nonarrowing=\relax
  5823. % @cartouche ... @end cartouche: draw rectangle w/rounded corners around
  5824. % environment contents.
  5825. \font\circle=lcircle10
  5826. \newdimen\circthick
  5827. \newdimen\cartouter\newdimen\cartinner
  5828. \newskip\normbskip\newskip\normpskip\newskip\normlskip
  5829. \circthick=\fontdimen8\circle
  5830. %
  5831. \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
  5832. \def\ctr{{\hskip 6pt\circle\char'010}}
  5833. \def\cbl{{\circle\char'012\hskip -6pt}}
  5834. \def\cbr{{\hskip 6pt\circle\char'011}}
  5835. \def\carttop{\hbox to \cartouter{\hskip\lskip
  5836. \ctl\leaders\hrule height\circthick\hfil\ctr
  5837. \hskip\rskip}}
  5838. \def\cartbot{\hbox to \cartouter{\hskip\lskip
  5839. \cbl\leaders\hrule height\circthick\hfil\cbr
  5840. \hskip\rskip}}
  5841. %
  5842. \newskip\lskip\newskip\rskip
  5843. \envdef\cartouche{%
  5844. \ifhmode\par\fi % can't be in the midst of a paragraph.
  5845. \startsavinginserts
  5846. \lskip=\leftskip \rskip=\rightskip
  5847. \leftskip=0pt\rightskip=0pt % we want these *outside*.
  5848. \cartinner=\hsize \advance\cartinner by-\lskip
  5849. \advance\cartinner by-\rskip
  5850. \cartouter=\hsize
  5851. \advance\cartouter by 18.4pt % allow for 3pt kerns on either
  5852. % side, and for 6pt waste from
  5853. % each corner char, and rule thickness
  5854. \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
  5855. % Flag to tell @lisp, etc., not to narrow margin.
  5856. \let\nonarrowing = t%
  5857. %
  5858. % If this cartouche directly follows a sectioning command, we need the
  5859. % \parskip glue (backspaced over by default) or the cartouche can
  5860. % collide with the section heading.
  5861. \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi
  5862. %
  5863. \vbox\bgroup
  5864. \baselineskip=0pt\parskip=0pt\lineskip=0pt
  5865. \carttop
  5866. \hbox\bgroup
  5867. \hskip\lskip
  5868. \vrule\kern3pt
  5869. \vbox\bgroup
  5870. \kern3pt
  5871. \hsize=\cartinner
  5872. \baselineskip=\normbskip
  5873. \lineskip=\normlskip
  5874. \parskip=\normpskip
  5875. \vskip -\parskip
  5876. \comment % For explanation, see the end of def\group.
  5877. }
  5878. \def\Ecartouche{%
  5879. \ifhmode\par\fi
  5880. \kern3pt
  5881. \egroup
  5882. \kern3pt\vrule
  5883. \hskip\rskip
  5884. \egroup
  5885. \cartbot
  5886. \egroup
  5887. \checkinserts
  5888. }
  5889. % This macro is called at the beginning of all the @example variants,
  5890. % inside a group.
  5891. \newdimen\nonfillparindent
  5892. \def\nonfillstart{%
  5893. \aboveenvbreak
  5894. \hfuzz = 12pt % Don't be fussy
  5895. \sepspaces % Make spaces be word-separators rather than space tokens.
  5896. \let\par = \lisppar % don't ignore blank lines
  5897. \obeylines % each line of input is a line of output
  5898. \parskip = 0pt
  5899. % Turn off paragraph indentation but redefine \indent to emulate
  5900. % the normal \indent.
  5901. \nonfillparindent=\parindent
  5902. \parindent = 0pt
  5903. \let\indent\nonfillindent
  5904. %
  5905. \emergencystretch = 0pt % don't try to avoid overfull boxes
  5906. \ifx\nonarrowing\relax
  5907. \advance \leftskip by \lispnarrowing
  5908. \exdentamount=\lispnarrowing
  5909. \else
  5910. \let\nonarrowing = \relax
  5911. \fi
  5912. \let\exdent=\nofillexdent
  5913. }
  5914. \begingroup
  5915. \obeyspaces
  5916. % We want to swallow spaces (but not other tokens) after the fake
  5917. % @indent in our nonfill-environments, where spaces are normally
  5918. % active and set to @tie, resulting in them not being ignored after
  5919. % @indent.
  5920. \gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}%
  5921. \gdef\nonfillindentcheck{%
  5922. \ifx\temp %
  5923. \expandafter\nonfillindentgobble%
  5924. \else%
  5925. \leavevmode\nonfillindentbox%
  5926. \fi%
  5927. }%
  5928. \endgroup
  5929. \def\nonfillindentgobble#1{\nonfillindent}
  5930. \def\nonfillindentbox{\hbox to \nonfillparindent{\hss}}
  5931. % If you want all examples etc. small: @set dispenvsize small.
  5932. % If you want even small examples the full size: @set dispenvsize nosmall.
  5933. % This affects the following displayed environments:
  5934. % @example, @display, @format, @lisp
  5935. %
  5936. \def\smallword{small}
  5937. \def\nosmallword{nosmall}
  5938. \let\SETdispenvsize\relax
  5939. \def\setnormaldispenv{%
  5940. \ifx\SETdispenvsize\smallword
  5941. % end paragraph for sake of leading, in case document has no blank
  5942. % line. This is redundant with what happens in \aboveenvbreak, but
  5943. % we need to do it before changing the fonts, and it's inconvenient
  5944. % to change the fonts afterward.
  5945. \ifnum \lastpenalty=10000 \else \endgraf \fi
  5946. \smallexamplefonts \rm
  5947. \fi
  5948. }
  5949. \def\setsmalldispenv{%
  5950. \ifx\SETdispenvsize\nosmallword
  5951. \else
  5952. \ifnum \lastpenalty=10000 \else \endgraf \fi
  5953. \smallexamplefonts \rm
  5954. \fi
  5955. }
  5956. % We often define two environments, @foo and @smallfoo.
  5957. % Let's do it in one command. #1 is the env name, #2 the definition.
  5958. \def\makedispenvdef#1#2{%
  5959. \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}%
  5960. \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}%
  5961. \expandafter\let\csname E#1\endcsname \afterenvbreak
  5962. \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
  5963. }
  5964. % Define two environment synonyms (#1 and #2) for an environment.
  5965. \def\maketwodispenvdef#1#2#3{%
  5966. \makedispenvdef{#1}{#3}%
  5967. \makedispenvdef{#2}{#3}%
  5968. }
  5969. %
  5970. % @lisp: indented, narrowed, typewriter font;
  5971. % @example: same as @lisp.
  5972. %
  5973. % @smallexample and @smalllisp: use smaller fonts.
  5974. % Originally contributed by Pavel@xerox.
  5975. %
  5976. \maketwodispenvdef{lisp}{example}{%
  5977. \nonfillstart
  5978. \tt\setupmarkupstyle{example}%
  5979. \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
  5980. \gobble % eat return
  5981. }
  5982. % @display/@smalldisplay: same as @lisp except keep current font.
  5983. %
  5984. \makedispenvdef{display}{%
  5985. \nonfillstart
  5986. \gobble
  5987. }
  5988. % @format/@smallformat: same as @display except don't narrow margins.
  5989. %
  5990. \makedispenvdef{format}{%
  5991. \let\nonarrowing = t%
  5992. \nonfillstart
  5993. \gobble
  5994. }
  5995. % @flushleft: same as @format, but doesn't obey \SETdispenvsize.
  5996. \envdef\flushleft{%
  5997. \let\nonarrowing = t%
  5998. \nonfillstart
  5999. \gobble
  6000. }
  6001. \let\Eflushleft = \afterenvbreak
  6002. % @flushright.
  6003. %
  6004. \envdef\flushright{%
  6005. \let\nonarrowing = t%
  6006. \nonfillstart
  6007. \advance\leftskip by 0pt plus 1fill\relax
  6008. \gobble
  6009. }
  6010. \let\Eflushright = \afterenvbreak
  6011. % @raggedright does more-or-less normal line breaking but no right
  6012. % justification. From plain.tex.
  6013. \envdef\raggedright{%
  6014. \rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax
  6015. }
  6016. \let\Eraggedright\par
  6017. \envdef\raggedleft{%
  6018. \parindent=0pt \leftskip0pt plus2em
  6019. \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
  6020. \hbadness=10000 % Last line will usually be underfull, so turn off
  6021. % badness reporting.
  6022. }
  6023. \let\Eraggedleft\par
  6024. \envdef\raggedcenter{%
  6025. \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em
  6026. \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
  6027. \hbadness=10000 % Last line will usually be underfull, so turn off
  6028. % badness reporting.
  6029. }
  6030. \let\Eraggedcenter\par
  6031. % @quotation does normal linebreaking (hence we can't use \nonfillstart)
  6032. % and narrows the margins. We keep \parskip nonzero in general, since
  6033. % we're doing normal filling. So, when using \aboveenvbreak and
  6034. % \afterenvbreak, temporarily make \parskip 0.
  6035. %
  6036. \makedispenvdef{quotation}{\quotationstart}
  6037. %
  6038. \def\quotationstart{%
  6039. {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
  6040. \parindent=0pt
  6041. %
  6042. % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
  6043. \ifx\nonarrowing\relax
  6044. \advance\leftskip by \lispnarrowing
  6045. \advance\rightskip by \lispnarrowing
  6046. \exdentamount = \lispnarrowing
  6047. \else
  6048. \let\nonarrowing = \relax
  6049. \fi
  6050. \parsearg\quotationlabel
  6051. }
  6052. % We have retained a nonzero parskip for the environment, since we're
  6053. % doing normal filling.
  6054. %
  6055. \def\Equotation{%
  6056. \par
  6057. \ifx\quotationauthor\thisisundefined\else
  6058. % indent a bit.
  6059. \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
  6060. \fi
  6061. {\parskip=0pt \afterenvbreak}%
  6062. }
  6063. \def\Esmallquotation{\Equotation}
  6064. % If we're given an argument, typeset it in bold with a colon after.
  6065. \def\quotationlabel#1{%
  6066. \def\temp{#1}%
  6067. \ifx\temp\empty \else
  6068. {\bf #1: }%
  6069. \fi
  6070. }
  6071. % LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
  6072. % If we want to allow any <char> as delimiter,
  6073. % we need the curly braces so that makeinfo sees the @verb command, eg:
  6074. % `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
  6075. %
  6076. % [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
  6077. %
  6078. % [Knuth] p.344; only we need to do the other characters Texinfo sets
  6079. % active too. Otherwise, they get lost as the first character on a
  6080. % verbatim line.
  6081. \def\dospecials{%
  6082. \do\ \do\\\do\{\do\}\do\$\do\&%
  6083. \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
  6084. \do\<\do\>\do\|\do\@\do+\do\"%
  6085. % Don't do the quotes -- if we do, @set txicodequoteundirected and
  6086. % @set txicodequotebacktick will not have effect on @verb and
  6087. % @verbatim, and ?` and !` ligatures won't get disabled.
  6088. %\do\`\do\'%
  6089. }
  6090. %
  6091. % [Knuth] p. 380
  6092. \def\uncatcodespecials{%
  6093. \def\do##1{\catcode`##1=\other}\dospecials}
  6094. %
  6095. % Setup for the @verb command.
  6096. %
  6097. % Eight spaces for a tab
  6098. \begingroup
  6099. \catcode`\^^I=\active
  6100. \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
  6101. \endgroup
  6102. %
  6103. \def\setupverb{%
  6104. \tt % easiest (and conventionally used) font for verbatim
  6105. \def\par{\leavevmode\endgraf}%
  6106. \setupmarkupstyle{verb}%
  6107. \tabeightspaces
  6108. % Respect line breaks,
  6109. % print special symbols as themselves, and
  6110. % make each space count
  6111. % must do in this order:
  6112. \obeylines \uncatcodespecials \sepspaces
  6113. }
  6114. % Setup for the @verbatim environment
  6115. %
  6116. % Real tab expansion.
  6117. \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
  6118. %
  6119. % We typeset each line of the verbatim in an \hbox, so we can handle
  6120. % tabs. The \global is in case the verbatim line starts with an accent,
  6121. % or some other command that starts with a begin-group. Otherwise, the
  6122. % entire \verbbox would disappear at the corresponding end-group, before
  6123. % it is typeset. Meanwhile, we can't have nested verbatim commands
  6124. % (can we?), so the \global won't be overwriting itself.
  6125. \newbox\verbbox
  6126. \def\starttabbox{\global\setbox\verbbox=\hbox\bgroup}
  6127. %
  6128. \begingroup
  6129. \catcode`\^^I=\active
  6130. \gdef\tabexpand{%
  6131. \catcode`\^^I=\active
  6132. \def^^I{\leavevmode\egroup
  6133. \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab
  6134. \divide\dimen\verbbox by\tabw
  6135. \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw
  6136. \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw
  6137. \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox
  6138. }%
  6139. }
  6140. \endgroup
  6141. % start the verbatim environment.
  6142. \def\setupverbatim{%
  6143. \let\nonarrowing = t%
  6144. \nonfillstart
  6145. \tt % easiest (and conventionally used) font for verbatim
  6146. % The \leavevmode here is for blank lines. Otherwise, we would
  6147. % never \starttabox and the \egroup would end verbatim mode.
  6148. \def\par{\leavevmode\egroup\box\verbbox\endgraf}%
  6149. \tabexpand
  6150. \setupmarkupstyle{verbatim}%
  6151. % Respect line breaks,
  6152. % print special symbols as themselves, and
  6153. % make each space count.
  6154. % Must do in this order:
  6155. \obeylines \uncatcodespecials \sepspaces
  6156. \everypar{\starttabbox}%
  6157. }
  6158. % Do the @verb magic: verbatim text is quoted by unique
  6159. % delimiter characters. Before first delimiter expect a
  6160. % right brace, after last delimiter expect closing brace:
  6161. %
  6162. % \def\doverb'{'<char>#1<char>'}'{#1}
  6163. %
  6164. % [Knuth] p. 382; only eat outer {}
  6165. \begingroup
  6166. \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other
  6167. \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
  6168. \endgroup
  6169. %
  6170. \def\verb{\begingroup\setupverb\doverb}
  6171. %
  6172. %
  6173. % Do the @verbatim magic: define the macro \doverbatim so that
  6174. % the (first) argument ends when '@end verbatim' is reached, ie:
  6175. %
  6176. % \def\doverbatim#1@end verbatim{#1}
  6177. %
  6178. % For Texinfo it's a lot easier than for LaTeX,
  6179. % because texinfo's \verbatim doesn't stop at '\end{verbatim}':
  6180. % we need not redefine '\', '{' and '}'.
  6181. %
  6182. % Inspired by LaTeX's verbatim command set [latex.ltx]
  6183. %
  6184. \begingroup
  6185. \catcode`\ =\active
  6186. \obeylines %
  6187. % ignore everything up to the first ^^M, that's the newline at the end
  6188. % of the @verbatim input line itself. Otherwise we get an extra blank
  6189. % line in the output.
  6190. \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}%
  6191. % We really want {...\end verbatim} in the body of the macro, but
  6192. % without the active space; thus we have to use \xdef and \gobble.
  6193. \endgroup
  6194. %
  6195. \envdef\verbatim{%
  6196. \setupverbatim\doverbatim
  6197. }
  6198. \let\Everbatim = \afterenvbreak
  6199. % @verbatiminclude FILE - insert text of file in verbatim environment.
  6200. %
  6201. \def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude}
  6202. %
  6203. \def\doverbatiminclude#1{%
  6204. {%
  6205. \makevalueexpandable
  6206. \setupverbatim
  6207. \indexnofonts % Allow `@@' and other weird things in file names.
  6208. \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
  6209. \input #1
  6210. \afterenvbreak
  6211. }%
  6212. }
  6213. % @copying ... @end copying.
  6214. % Save the text away for @insertcopying later.
  6215. %
  6216. % We save the uninterpreted tokens, rather than creating a box.
  6217. % Saving the text in a box would be much easier, but then all the
  6218. % typesetting commands (@smallbook, font changes, etc.) have to be done
  6219. % beforehand -- and a) we want @copying to be done first in the source
  6220. % file; b) letting users define the frontmatter in as flexible order as
  6221. % possible is very desirable.
  6222. %
  6223. \def\copying{\checkenv{}\begingroup\scanargctxt\docopying}
  6224. \def\docopying#1@end copying{\endgroup\def\copyingtext{#1}}
  6225. %
  6226. \def\insertcopying{%
  6227. \begingroup
  6228. \parindent = 0pt % paragraph indentation looks wrong on title page
  6229. \scanexp\copyingtext
  6230. \endgroup
  6231. }
  6232. \message{defuns,}
  6233. % @defun etc.
  6234. \newskip\defbodyindent \defbodyindent=.4in
  6235. \newskip\defargsindent \defargsindent=50pt
  6236. \newskip\deflastargmargin \deflastargmargin=18pt
  6237. \newcount\defunpenalty
  6238. % Start the processing of @deffn:
  6239. \def\startdefun{%
  6240. \ifnum\lastpenalty<10000
  6241. \medbreak
  6242. \defunpenalty=10003 % Will keep this @deffn together with the
  6243. % following @def command, see below.
  6244. \else
  6245. % If there are two @def commands in a row, we'll have a \nobreak,
  6246. % which is there to keep the function description together with its
  6247. % header. But if there's nothing but headers, we need to allow a
  6248. % break somewhere. Check specifically for penalty 10002, inserted
  6249. % by \printdefunline, instead of 10000, since the sectioning
  6250. % commands also insert a nobreak penalty, and we don't want to allow
  6251. % a break between a section heading and a defun.
  6252. %
  6253. % As a further refinement, we avoid "club" headers by signalling
  6254. % with penalty of 10003 after the very first @deffn in the
  6255. % sequence (see above), and penalty of 10002 after any following
  6256. % @def command.
  6257. \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi
  6258. %
  6259. % Similarly, after a section heading, do not allow a break.
  6260. % But do insert the glue.
  6261. \medskip % preceded by discardable penalty, so not a breakpoint
  6262. \fi
  6263. %
  6264. \parindent=0in
  6265. \advance\leftskip by \defbodyindent
  6266. \exdentamount=\defbodyindent
  6267. }
  6268. \def\dodefunx#1{%
  6269. % First, check whether we are in the right environment:
  6270. \checkenv#1%
  6271. %
  6272. % As above, allow line break if we have multiple x headers in a row.
  6273. % It's not a great place, though.
  6274. \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi
  6275. %
  6276. % And now, it's time to reuse the body of the original defun:
  6277. \expandafter\gobbledefun#1%
  6278. }
  6279. \def\gobbledefun#1\startdefun{}
  6280. % \printdefunline \deffnheader{text}
  6281. %
  6282. \def\printdefunline#1#2{%
  6283. \begingroup
  6284. % call \deffnheader:
  6285. #1#2 \endheader
  6286. % common ending:
  6287. \interlinepenalty = 10000
  6288. \advance\rightskip by 0pt plus 1fil\relax
  6289. \endgraf
  6290. \nobreak\vskip -\parskip
  6291. \penalty\defunpenalty % signal to \startdefun and \dodefunx
  6292. % Some of the @defun-type tags do not enable magic parentheses,
  6293. % rendering the following check redundant. But we don't optimize.
  6294. \checkparencounts
  6295. \endgroup
  6296. }
  6297. \def\Edefun{\endgraf\medbreak}
  6298. % \makedefun{deffn} creates \deffn, \deffnx and \Edeffn;
  6299. % the only thing remaining is to define \deffnheader.
  6300. %
  6301. \def\makedefun#1{%
  6302. \expandafter\let\csname E#1\endcsname = \Edefun
  6303. \edef\temp{\noexpand\domakedefun
  6304. \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}%
  6305. \temp
  6306. }
  6307. % \domakedefun \deffn \deffnx \deffnheader
  6308. %
  6309. % Define \deffn and \deffnx, without parameters.
  6310. % \deffnheader has to be defined explicitly.
  6311. %
  6312. \def\domakedefun#1#2#3{%
  6313. \envdef#1{%
  6314. \startdefun
  6315. \doingtypefnfalse % distinguish typed functions from all else
  6316. \parseargusing\activeparens{\printdefunline#3}%
  6317. }%
  6318. \def#2{\dodefunx#1}%
  6319. \def#3%
  6320. }
  6321. \newif\ifdoingtypefn % doing typed function?
  6322. \newif\ifrettypeownline % typeset return type on its own line?
  6323. % @deftypefnnewline on|off says whether the return type of typed functions
  6324. % are printed on their own line. This affects @deftypefn, @deftypefun,
  6325. % @deftypeop, and @deftypemethod.
  6326. %
  6327. \parseargdef\deftypefnnewline{%
  6328. \def\temp{#1}%
  6329. \ifx\temp\onword
  6330. \expandafter\let\csname SETtxideftypefnnl\endcsname
  6331. = \empty
  6332. \else\ifx\temp\offword
  6333. \expandafter\let\csname SETtxideftypefnnl\endcsname
  6334. = \relax
  6335. \else
  6336. \errhelp = \EMsimple
  6337. \errmessage{Unknown @txideftypefnnl value `\temp',
  6338. must be on|off}%
  6339. \fi\fi
  6340. }
  6341. % Untyped functions:
  6342. % @deffn category name args
  6343. \makedefun{deffn}{\deffngeneral{}}
  6344. % @deffn category class name args
  6345. \makedefun{defop}#1 {\defopon{#1\ \putwordon}}
  6346. % \defopon {category on}class name args
  6347. \def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
  6348. % \deffngeneral {subind}category name args
  6349. %
  6350. \def\deffngeneral#1#2 #3 #4\endheader{%
  6351. % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}.
  6352. \dosubind{fn}{\code{#3}}{#1}%
  6353. \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
  6354. }
  6355. % Typed functions:
  6356. % @deftypefn category type name args
  6357. \makedefun{deftypefn}{\deftypefngeneral{}}
  6358. % @deftypeop category class type name args
  6359. \makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}}
  6360. % \deftypeopon {category on}class type name args
  6361. \def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
  6362. % \deftypefngeneral {subind}category type name args
  6363. %
  6364. \def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
  6365. \dosubind{fn}{\code{#4}}{#1}%
  6366. \doingtypefntrue
  6367. \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
  6368. }
  6369. % Typed variables:
  6370. % @deftypevr category type var args
  6371. \makedefun{deftypevr}{\deftypecvgeneral{}}
  6372. % @deftypecv category class type var args
  6373. \makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}}
  6374. % \deftypecvof {category of}class type var args
  6375. \def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} }
  6376. % \deftypecvgeneral {subind}category type var args
  6377. %
  6378. \def\deftypecvgeneral#1#2 #3 #4 #5\endheader{%
  6379. \dosubind{vr}{\code{#4}}{#1}%
  6380. \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
  6381. }
  6382. % Untyped variables:
  6383. % @defvr category var args
  6384. \makedefun{defvr}#1 {\deftypevrheader{#1} {} }
  6385. % @defcv category class var args
  6386. \makedefun{defcv}#1 {\defcvof{#1\ \putwordof}}
  6387. % \defcvof {category of}class var args
  6388. \def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
  6389. % Types:
  6390. % @deftp category name args
  6391. \makedefun{deftp}#1 #2 #3\endheader{%
  6392. \doind{tp}{\code{#2}}%
  6393. \defname{#1}{}{#2}\defunargs{#3\unskip}%
  6394. }
  6395. % Remaining @defun-like shortcuts:
  6396. \makedefun{defun}{\deffnheader{\putwordDeffunc} }
  6397. \makedefun{defmac}{\deffnheader{\putwordDefmac} }
  6398. \makedefun{defspec}{\deffnheader{\putwordDefspec} }
  6399. \makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} }
  6400. \makedefun{defvar}{\defvrheader{\putwordDefvar} }
  6401. \makedefun{defopt}{\defvrheader{\putwordDefopt} }
  6402. \makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} }
  6403. \makedefun{defmethod}{\defopon\putwordMethodon}
  6404. \makedefun{deftypemethod}{\deftypeopon\putwordMethodon}
  6405. \makedefun{defivar}{\defcvof\putwordInstanceVariableof}
  6406. \makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof}
  6407. % \defname, which formats the name of the @def (not the args).
  6408. % #1 is the category, such as "Function".
  6409. % #2 is the return type, if any.
  6410. % #3 is the function name.
  6411. %
  6412. % We are followed by (but not passed) the arguments, if any.
  6413. %
  6414. \def\defname#1#2#3{%
  6415. \par
  6416. % Get the values of \leftskip and \rightskip as they were outside the @def...
  6417. \advance\leftskip by -\defbodyindent
  6418. %
  6419. % Determine if we are typesetting the return type of a typed function
  6420. % on a line by itself.
  6421. \rettypeownlinefalse
  6422. \ifdoingtypefn % doing a typed function specifically?
  6423. % then check user option for putting return type on its own line:
  6424. \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else
  6425. \rettypeownlinetrue
  6426. \fi
  6427. \fi
  6428. %
  6429. % How we'll format the category name. Putting it in brackets helps
  6430. % distinguish it from the body text that may end up on the next line
  6431. % just below it.
  6432. \def\temp{#1}%
  6433. \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
  6434. %
  6435. % Figure out line sizes for the paragraph shape. We'll always have at
  6436. % least two.
  6437. \tempnum = 2
  6438. %
  6439. % The first line needs space for \box0; but if \rightskip is nonzero,
  6440. % we need only space for the part of \box0 which exceeds it:
  6441. \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip
  6442. %
  6443. % If doing a return type on its own line, we'll have another line.
  6444. \ifrettypeownline
  6445. \advance\tempnum by 1
  6446. \def\maybeshapeline{0in \hsize}%
  6447. \else
  6448. \def\maybeshapeline{}%
  6449. \fi
  6450. %
  6451. % The continuations:
  6452. \dimen2=\hsize \advance\dimen2 by -\defargsindent
  6453. %
  6454. % The final paragraph shape:
  6455. \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2
  6456. %
  6457. % Put the category name at the right margin.
  6458. \noindent
  6459. \hbox to 0pt{%
  6460. \hfil\box0 \kern-\hsize
  6461. % \hsize has to be shortened this way:
  6462. \kern\leftskip
  6463. % Intentionally do not respect \rightskip, since we need the space.
  6464. }%
  6465. %
  6466. % Allow all lines to be underfull without complaint:
  6467. \tolerance=10000 \hbadness=10000
  6468. \exdentamount=\defbodyindent
  6469. {%
  6470. % defun fonts. We use typewriter by default (used to be bold) because:
  6471. % . we're printing identifiers, they should be in tt in principle.
  6472. % . in languages with many accents, such as Czech or French, it's
  6473. % common to leave accents off identifiers. The result looks ok in
  6474. % tt, but exceedingly strange in rm.
  6475. % . we don't want -- and --- to be treated as ligatures.
  6476. % . this still does not fix the ?` and !` ligatures, but so far no
  6477. % one has made identifiers using them :).
  6478. \df \tt
  6479. \def\temp{#2}% text of the return type
  6480. \ifx\temp\empty\else
  6481. \tclose{\temp}% typeset the return type
  6482. \ifrettypeownline
  6483. % put return type on its own line; prohibit line break following:
  6484. \hfil\vadjust{\nobreak}\break
  6485. \else
  6486. \space % type on same line, so just followed by a space
  6487. \fi
  6488. \fi % no return type
  6489. #3% output function name
  6490. }%
  6491. {\rm\enskip}% hskip 0.5 em of \tenrm
  6492. %
  6493. \boldbrax
  6494. % arguments will be output next, if any.
  6495. }
  6496. % Print arguments in slanted roman (not ttsl), inconsistently with using
  6497. % tt for the name. This is because literal text is sometimes needed in
  6498. % the argument list (groff manual), and ttsl and tt are not very
  6499. % distinguishable. Prevent hyphenation at `-' chars.
  6500. %
  6501. \def\defunargs#1{%
  6502. % use sl by default (not ttsl),
  6503. % tt for the names.
  6504. \df \sl \hyphenchar\font=0
  6505. %
  6506. % On the other hand, if an argument has two dashes (for instance), we
  6507. % want a way to get ttsl. Let's try @var for that.
  6508. \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}%
  6509. #1%
  6510. \sl\hyphenchar\font=45
  6511. }
  6512. % We want ()&[] to print specially on the defun line.
  6513. %
  6514. \def\activeparens{%
  6515. \catcode`\(=\active \catcode`\)=\active
  6516. \catcode`\[=\active \catcode`\]=\active
  6517. \catcode`\&=\active
  6518. }
  6519. % Make control sequences which act like normal parenthesis chars.
  6520. \let\lparen = ( \let\rparen = )
  6521. % Be sure that we always have a definition for `(', etc. For example,
  6522. % if the fn name has parens in it, \boldbrax will not be in effect yet,
  6523. % so TeX would otherwise complain about undefined control sequence.
  6524. {
  6525. \activeparens
  6526. \global\let(=\lparen \global\let)=\rparen
  6527. \global\let[=\lbrack \global\let]=\rbrack
  6528. \global\let& = \&
  6529. \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
  6530. \gdef\magicamp{\let&=\amprm}
  6531. }
  6532. \newcount\parencount
  6533. % If we encounter &foo, then turn on ()-hacking afterwards
  6534. \newif\ifampseen
  6535. \def\amprm#1 {\ampseentrue{\bf\&#1 }}
  6536. \def\parenfont{%
  6537. \ifampseen
  6538. % At the first level, print parens in roman,
  6539. % otherwise use the default font.
  6540. \ifnum \parencount=1 \rm \fi
  6541. \else
  6542. % The \sf parens (in \boldbrax) actually are a little bolder than
  6543. % the contained text. This is especially needed for [ and ] .
  6544. \sf
  6545. \fi
  6546. }
  6547. \def\infirstlevel#1{%
  6548. \ifampseen
  6549. \ifnum\parencount=1
  6550. #1%
  6551. \fi
  6552. \fi
  6553. }
  6554. \def\bfafterword#1 {#1 \bf}
  6555. \def\opnr{%
  6556. \global\advance\parencount by 1
  6557. {\parenfont(}%
  6558. \infirstlevel \bfafterword
  6559. }
  6560. \def\clnr{%
  6561. {\parenfont)}%
  6562. \infirstlevel \sl
  6563. \global\advance\parencount by -1
  6564. }
  6565. \newcount\brackcount
  6566. \def\lbrb{%
  6567. \global\advance\brackcount by 1
  6568. {\bf[}%
  6569. }
  6570. \def\rbrb{%
  6571. {\bf]}%
  6572. \global\advance\brackcount by -1
  6573. }
  6574. \def\checkparencounts{%
  6575. \ifnum\parencount=0 \else \badparencount \fi
  6576. \ifnum\brackcount=0 \else \badbrackcount \fi
  6577. }
  6578. % these should not use \errmessage; the glibc manual, at least, actually
  6579. % has such constructs (when documenting function pointers).
  6580. \def\badparencount{%
  6581. \message{Warning: unbalanced parentheses in @def...}%
  6582. \global\parencount=0
  6583. }
  6584. \def\badbrackcount{%
  6585. \message{Warning: unbalanced square brackets in @def...}%
  6586. \global\brackcount=0
  6587. }
  6588. \message{macros,}
  6589. % @macro.
  6590. % To do this right we need a feature of e-TeX, \scantokens,
  6591. % which we arrange to emulate with a temporary file in ordinary TeX.
  6592. \ifx\eTeXversion\thisisundefined
  6593. \newwrite\macscribble
  6594. \def\scantokens#1{%
  6595. \toks0={#1}%
  6596. \immediate\openout\macscribble=\jobname.tmp
  6597. \immediate\write\macscribble{\the\toks0}%
  6598. \immediate\closeout\macscribble
  6599. \input \jobname.tmp
  6600. }
  6601. \fi
  6602. \def\scanmacro#1{\begingroup
  6603. \newlinechar`\^^M
  6604. \let\xeatspaces\eatspaces
  6605. %
  6606. % Undo catcode changes of \startcontents and \doprintindex
  6607. % When called from @insertcopying or (short)caption, we need active
  6608. % backslash to get it printed correctly. Previously, we had
  6609. % \catcode`\\=\other instead. We'll see whether a problem appears
  6610. % with macro expansion. --kasal, 19aug04
  6611. \catcode`\@=0 \catcode`\\=\active \escapechar=`\@
  6612. %
  6613. % ... and for \example:
  6614. \spaceisspace
  6615. %
  6616. % The \empty here causes a following catcode 5 newline to be eaten as
  6617. % part of reading whitespace after a control sequence. It does not
  6618. % eat a catcode 13 newline. There's no good way to handle the two
  6619. % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX
  6620. % would then have different behavior). See the Macro Details node in
  6621. % the manual for the workaround we recommend for macros and
  6622. % line-oriented commands.
  6623. %
  6624. \scantokens{#1\empty}%
  6625. \endgroup}
  6626. \def\scanexp#1{%
  6627. \edef\temp{\noexpand\scanmacro{#1}}%
  6628. \temp
  6629. }
  6630. \newcount\paramno % Count of parameters
  6631. \newtoks\macname % Macro name
  6632. \newif\ifrecursive % Is it recursive?
  6633. % List of all defined macros in the form
  6634. % \definedummyword\macro1\definedummyword\macro2...
  6635. % Currently is also contains all @aliases; the list can be split
  6636. % if there is a need.
  6637. \def\macrolist{}
  6638. % Add the macro to \macrolist
  6639. \def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname}
  6640. \def\addtomacrolistxxx#1{%
  6641. \toks0 = \expandafter{\macrolist\definedummyword#1}%
  6642. \xdef\macrolist{\the\toks0}%
  6643. }
  6644. % Utility routines.
  6645. % This does \let #1 = #2, with \csnames; that is,
  6646. % \let \csname#1\endcsname = \csname#2\endcsname
  6647. % (except of course we have to play expansion games).
  6648. %
  6649. \def\cslet#1#2{%
  6650. \expandafter\let
  6651. \csname#1\expandafter\endcsname
  6652. \csname#2\endcsname
  6653. }
  6654. % Trim leading and trailing spaces off a string.
  6655. % Concepts from aro-bend problem 15 (see CTAN).
  6656. {\catcode`\@=11
  6657. \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
  6658. \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
  6659. \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
  6660. \def\unbrace#1{#1}
  6661. \unbrace{\gdef\trim@@@ #1 } #2@{#1}
  6662. }
  6663. % Trim a single trailing ^^M off a string.
  6664. {\catcode`\^^M=\other \catcode`\Q=3%
  6665. \gdef\eatcr #1{\eatcra #1Q^^MQ}%
  6666. \gdef\eatcra#1^^MQ{\eatcrb#1Q}%
  6667. \gdef\eatcrb#1Q#2Q{#1}%
  6668. }
  6669. % Macro bodies are absorbed as an argument in a context where
  6670. % all characters are catcode 10, 11 or 12, except \ which is active
  6671. % (as in normal texinfo). It is necessary to change the definition of \
  6672. % to recognize macro arguments; this is the job of \mbodybackslash.
  6673. %
  6674. % Non-ASCII encodings make 8-bit characters active, so un-activate
  6675. % them to avoid their expansion. Must do this non-globally, to
  6676. % confine the change to the current group.
  6677. %
  6678. % It's necessary to have hard CRs when the macro is executed. This is
  6679. % done by making ^^M (\endlinechar) catcode 12 when reading the macro
  6680. % body, and then making it the \newlinechar in \scanmacro.
  6681. %
  6682. \def\scanctxt{% used as subroutine
  6683. \catcode`\"=\other
  6684. \catcode`\+=\other
  6685. \catcode`\<=\other
  6686. \catcode`\>=\other
  6687. \catcode`\@=\other
  6688. \catcode`\^=\other
  6689. \catcode`\_=\other
  6690. \catcode`\|=\other
  6691. \catcode`\~=\other
  6692. \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi
  6693. }
  6694. \def\scanargctxt{% used for copying and captions, not macros.
  6695. \scanctxt
  6696. \catcode`\\=\other
  6697. \catcode`\^^M=\other
  6698. }
  6699. \def\macrobodyctxt{% used for @macro definitions
  6700. \scanctxt
  6701. \catcode`\{=\other
  6702. \catcode`\}=\other
  6703. \catcode`\^^M=\other
  6704. \usembodybackslash
  6705. }
  6706. \def\macroargctxt{% used when scanning invocations
  6707. \scanctxt
  6708. \catcode`\\=0
  6709. }
  6710. % why catcode 0 for \ in the above? To recognize \\ \{ \} as "escapes"
  6711. % for the single characters \ { }. Thus, we end up with the "commands"
  6712. % that would be written @\ @{ @} in a Texinfo document.
  6713. %
  6714. % We already have @{ and @}. For @\, we define it here, and only for
  6715. % this purpose, to produce a typewriter backslash (so, the @\ that we
  6716. % define for @math can't be used with @macro calls):
  6717. %
  6718. \def\\{\normalbackslash}%
  6719. %
  6720. % We would like to do this for \, too, since that is what makeinfo does.
  6721. % But it is not possible, because Texinfo already has a command @, for a
  6722. % cedilla accent. Documents must use @comma{} instead.
  6723. %
  6724. % \anythingelse will almost certainly be an error of some kind.
  6725. % \mbodybackslash is the definition of \ in @macro bodies.
  6726. % It maps \foo\ => \csname macarg.foo\endcsname => #N
  6727. % where N is the macro parameter number.
  6728. % We define \csname macarg.\endcsname to be \realbackslash, so
  6729. % \\ in macro replacement text gets you a backslash.
  6730. %
  6731. {\catcode`@=0 @catcode`@\=@active
  6732. @gdef@usembodybackslash{@let\=@mbodybackslash}
  6733. @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
  6734. }
  6735. \expandafter\def\csname macarg.\endcsname{\realbackslash}
  6736. \def\margbackslash#1{\char`\#1 }
  6737. \def\macro{\recursivefalse\parsearg\macroxxx}
  6738. \def\rmacro{\recursivetrue\parsearg\macroxxx}
  6739. \def\macroxxx#1{%
  6740. \getargs{#1}% now \macname is the macname and \argl the arglist
  6741. \ifx\argl\empty % no arguments
  6742. \paramno=0\relax
  6743. \else
  6744. \expandafter\parsemargdef \argl;%
  6745. \if\paramno>256\relax
  6746. \ifx\eTeXversion\thisisundefined
  6747. \errhelp = \EMsimple
  6748. \errmessage{You need eTeX to compile a file with macros with more than 256 arguments}
  6749. \fi
  6750. \fi
  6751. \fi
  6752. \if1\csname ismacro.\the\macname\endcsname
  6753. \message{Warning: redefining \the\macname}%
  6754. \else
  6755. \expandafter\ifx\csname \the\macname\endcsname \relax
  6756. \else \errmessage{Macro name \the\macname\space already defined}\fi
  6757. \global\cslet{macsave.\the\macname}{\the\macname}%
  6758. \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
  6759. \addtomacrolist{\the\macname}%
  6760. \fi
  6761. \begingroup \macrobodyctxt
  6762. \ifrecursive \expandafter\parsermacbody
  6763. \else \expandafter\parsemacbody
  6764. \fi}
  6765. \parseargdef\unmacro{%
  6766. \if1\csname ismacro.#1\endcsname
  6767. \global\cslet{#1}{macsave.#1}%
  6768. \global\expandafter\let \csname ismacro.#1\endcsname=0%
  6769. % Remove the macro name from \macrolist:
  6770. \begingroup
  6771. \expandafter\let\csname#1\endcsname \relax
  6772. \let\definedummyword\unmacrodo
  6773. \xdef\macrolist{\macrolist}%
  6774. \endgroup
  6775. \else
  6776. \errmessage{Macro #1 not defined}%
  6777. \fi
  6778. }
  6779. % Called by \do from \dounmacro on each macro. The idea is to omit any
  6780. % macro definitions that have been changed to \relax.
  6781. %
  6782. \def\unmacrodo#1{%
  6783. \ifx #1\relax
  6784. % remove this
  6785. \else
  6786. \noexpand\definedummyword \noexpand#1%
  6787. \fi
  6788. }
  6789. % This makes use of the obscure feature that if the last token of a
  6790. % <parameter list> is #, then the preceding argument is delimited by
  6791. % an opening brace, and that opening brace is not consumed.
  6792. \def\getargs#1{\getargsxxx#1{}}
  6793. \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
  6794. \def\getmacname#1 #2\relax{\macname={#1}}
  6795. \def\getmacargs#1{\def\argl{#1}}
  6796. % For macro processing make @ a letter so that we can make Texinfo private macro names.
  6797. \edef\texiatcatcode{\the\catcode`\@}
  6798. \catcode `@=11\relax
  6799. % Parse the optional {params} list. Set up \paramno and \paramlist
  6800. % so \defmacro knows what to do. Define \macarg.BLAH for each BLAH
  6801. % in the params list to some hook where the argument si to be expanded. If
  6802. % there are less than 10 arguments that hook is to be replaced by ##N where N
  6803. % is the position in that list, that is to say the macro arguments are to be
  6804. % defined `a la TeX in the macro body.
  6805. %
  6806. % That gets used by \mbodybackslash (above).
  6807. %
  6808. % We need to get `macro parameter char #' into several definitions.
  6809. % The technique used is stolen from LaTeX: let \hash be something
  6810. % unexpandable, insert that wherever you need a #, and then redefine
  6811. % it to # just before using the token list produced.
  6812. %
  6813. % The same technique is used to protect \eatspaces till just before
  6814. % the macro is used.
  6815. %
  6816. % If there are 10 or more arguments, a different technique is used, where the
  6817. % hook remains in the body, and when macro is to be expanded the body is
  6818. % processed again to replace the arguments.
  6819. %
  6820. % In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the
  6821. % argument N value and then \edef the body (nothing else will expand because of
  6822. % the catcode regime underwhich the body was input).
  6823. %
  6824. % If you compile with TeX (not eTeX), and you have macros with 10 or more
  6825. % arguments, you need that no macro has more than 256 arguments, otherwise an
  6826. % error is produced.
  6827. \def\parsemargdef#1;{%
  6828. \paramno=0\def\paramlist{}%
  6829. \let\hash\relax
  6830. \let\xeatspaces\relax
  6831. \parsemargdefxxx#1,;,%
  6832. % In case that there are 10 or more arguments we parse again the arguments
  6833. % list to set new definitions for the \macarg.BLAH macros corresponding to
  6834. % each BLAH argument. It was anyhow needed to parse already once this list
  6835. % in order to count the arguments, and as macros with at most 9 arguments
  6836. % are by far more frequent than macro with 10 or more arguments, defining
  6837. % twice the \macarg.BLAH macros does not cost too much processing power.
  6838. \ifnum\paramno<10\relax\else
  6839. \paramno0\relax
  6840. \parsemmanyargdef@@#1,;,% 10 or more arguments
  6841. \fi
  6842. }
  6843. \def\parsemargdefxxx#1,{%
  6844. \if#1;\let\next=\relax
  6845. \else \let\next=\parsemargdefxxx
  6846. \advance\paramno by 1
  6847. \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
  6848. {\xeatspaces{\hash\the\paramno}}%
  6849. \edef\paramlist{\paramlist\hash\the\paramno,}%
  6850. \fi\next}
  6851. \def\parsemmanyargdef@@#1,{%
  6852. \if#1;\let\next=\relax
  6853. \else
  6854. \let\next=\parsemmanyargdef@@
  6855. \edef\tempb{\eatspaces{#1}}%
  6856. \expandafter\def\expandafter\tempa
  6857. \expandafter{\csname macarg.\tempb\endcsname}%
  6858. % Note that we need some extra \noexpand\noexpand, this is because we
  6859. % don't want \the to be expanded in the \parsermacbody as it uses an
  6860. % \xdef .
  6861. \expandafter\edef\tempa
  6862. {\noexpand\noexpand\noexpand\the\toks\the\paramno}%
  6863. \advance\paramno by 1\relax
  6864. \fi\next}
  6865. % These two commands read recursive and nonrecursive macro bodies.
  6866. % (They're different since rec and nonrec macros end differently.)
  6867. %
  6868. \catcode `\@\texiatcatcode
  6869. \long\def\parsemacbody#1@end macro%
  6870. {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
  6871. \long\def\parsermacbody#1@end rmacro%
  6872. {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
  6873. \catcode `\@=11\relax
  6874. \let\endargs@\relax
  6875. \let\nil@\relax
  6876. \def\nilm@{\nil@}%
  6877. \long\def\nillm@{\nil@}%
  6878. % This macro is expanded during the Texinfo macro expansion, not during its
  6879. % definition. It gets all the arguments values and assigns them to macros
  6880. % macarg.ARGNAME
  6881. %
  6882. % #1 is the macro name
  6883. % #2 is the list of argument names
  6884. % #3 is the list of argument values
  6885. \def\getargvals@#1#2#3{%
  6886. \def\macargdeflist@{}%
  6887. \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion.
  6888. \def\paramlist{#2,\nil@}%
  6889. \def\macroname{#1}%
  6890. \begingroup
  6891. \macroargctxt
  6892. \def\argvaluelist{#3,\nil@}%
  6893. \def\@tempa{#3}%
  6894. \ifx\@tempa\empty
  6895. \setemptyargvalues@
  6896. \else
  6897. \getargvals@@
  6898. \fi
  6899. }
  6900. %
  6901. \def\getargvals@@{%
  6902. \ifx\paramlist\nilm@
  6903. % Some sanity check needed here that \argvaluelist is also empty.
  6904. \ifx\argvaluelist\nillm@
  6905. \else
  6906. \errhelp = \EMsimple
  6907. \errmessage{Too many arguments in macro `\macroname'!}%
  6908. \fi
  6909. \let\next\macargexpandinbody@
  6910. \else
  6911. \ifx\argvaluelist\nillm@
  6912. % No more arguments values passed to macro. Set remaining named-arg
  6913. % macros to empty.
  6914. \let\next\setemptyargvalues@
  6915. \else
  6916. % pop current arg name into \@tempb
  6917. \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}%
  6918. \expandafter\@tempa\expandafter{\paramlist}%
  6919. % pop current argument value into \@tempc
  6920. \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}%
  6921. \expandafter\@tempa\expandafter{\argvaluelist}%
  6922. % Here \@tempb is the current arg name and \@tempc is the current arg value.
  6923. % First place the new argument macro definition into \@tempd
  6924. \expandafter\macname\expandafter{\@tempc}%
  6925. \expandafter\let\csname macarg.\@tempb\endcsname\relax
  6926. \expandafter\def\expandafter\@tempe\expandafter{%
  6927. \csname macarg.\@tempb\endcsname}%
  6928. \edef\@tempd{\long\def\@tempe{\the\macname}}%
  6929. \push@\@tempd\macargdeflist@
  6930. \let\next\getargvals@@
  6931. \fi
  6932. \fi
  6933. \next
  6934. }
  6935. \def\push@#1#2{%
  6936. \expandafter\expandafter\expandafter\def
  6937. \expandafter\expandafter\expandafter#2%
  6938. \expandafter\expandafter\expandafter{%
  6939. \expandafter#1#2}%
  6940. }
  6941. % Replace arguments by their values in the macro body, and place the result
  6942. % in macro \@tempa
  6943. \def\macvalstoargs@{%
  6944. % To do this we use the property that token registers that are \the'ed
  6945. % within an \edef expand only once. So we are going to place all argument
  6946. % values into respective token registers.
  6947. %
  6948. % First we save the token context, and initialize argument numbering.
  6949. \begingroup
  6950. \paramno0\relax
  6951. % Then, for each argument number #N, we place the corresponding argument
  6952. % value into a new token list register \toks#N
  6953. \expandafter\putargsintokens@\saveparamlist@,;,%
  6954. % Then, we expand the body so that argument are replaced by their
  6955. % values. The trick for values not to be expanded themselves is that they
  6956. % are within tokens and that tokens expand only once in an \edef .
  6957. \edef\@tempc{\csname mac.\macroname .body\endcsname}%
  6958. % Now we restore the token stack pointer to free the token list registers
  6959. % which we have used, but we make sure that expanded body is saved after
  6960. % group.
  6961. \expandafter
  6962. \endgroup
  6963. \expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
  6964. }
  6965. \def\macargexpandinbody@{%
  6966. %% Define the named-macro outside of this group and then close this group.
  6967. \expandafter
  6968. \endgroup
  6969. \macargdeflist@
  6970. % First the replace in body the macro arguments by their values, the result
  6971. % is in \@tempa .
  6972. \macvalstoargs@
  6973. % Then we point at the \norecurse or \gobble (for recursive) macro value
  6974. % with \@tempb .
  6975. \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname
  6976. % Depending on whether it is recursive or not, we need some tailing
  6977. % \egroup .
  6978. \ifx\@tempb\gobble
  6979. \let\@tempc\relax
  6980. \else
  6981. \let\@tempc\egroup
  6982. \fi
  6983. % And now we do the real job:
  6984. \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}%
  6985. \@tempd
  6986. }
  6987. \def\putargsintokens@#1,{%
  6988. \if#1;\let\next\relax
  6989. \else
  6990. \let\next\putargsintokens@
  6991. % First we allocate the new token list register, and give it a temporary
  6992. % alias \@tempb .
  6993. \toksdef\@tempb\the\paramno
  6994. % Then we place the argument value into that token list register.
  6995. \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname
  6996. \expandafter\@tempb\expandafter{\@tempa}%
  6997. \advance\paramno by 1\relax
  6998. \fi
  6999. \next
  7000. }
  7001. % Save the token stack pointer into macro #1
  7002. \def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}}
  7003. % Restore the token stack pointer from number in macro #1
  7004. \def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax}
  7005. % newtoks that can be used non \outer .
  7006. \def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi}
  7007. % Tailing missing arguments are set to empty
  7008. \def\setemptyargvalues@{%
  7009. \ifx\paramlist\nilm@
  7010. \let\next\macargexpandinbody@
  7011. \else
  7012. \expandafter\setemptyargvaluesparser@\paramlist\endargs@
  7013. \let\next\setemptyargvalues@
  7014. \fi
  7015. \next
  7016. }
  7017. \def\setemptyargvaluesparser@#1,#2\endargs@{%
  7018. \expandafter\def\expandafter\@tempa\expandafter{%
  7019. \expandafter\def\csname macarg.#1\endcsname{}}%
  7020. \push@\@tempa\macargdeflist@
  7021. \def\paramlist{#2}%
  7022. }
  7023. % #1 is the element target macro
  7024. % #2 is the list macro
  7025. % #3,#4\endargs@ is the list value
  7026. \def\pop@#1#2#3,#4\endargs@{%
  7027. \def#1{#3}%
  7028. \def#2{#4}%
  7029. }
  7030. \long\def\longpop@#1#2#3,#4\endargs@{%
  7031. \long\def#1{#3}%
  7032. \long\def#2{#4}%
  7033. }
  7034. % This defines a Texinfo @macro. There are eight cases: recursive and
  7035. % nonrecursive macros of zero, one, up to nine, and many arguments.
  7036. % Much magic with \expandafter here.
  7037. % \xdef is used so that macro definitions will survive the file
  7038. % they're defined in; @include reads the file inside a group.
  7039. %
  7040. \def\defmacro{%
  7041. \let\hash=##% convert placeholders to macro parameter chars
  7042. \ifrecursive
  7043. \ifcase\paramno
  7044. % 0
  7045. \expandafter\xdef\csname\the\macname\endcsname{%
  7046. \noexpand\scanmacro{\temp}}%
  7047. \or % 1
  7048. \expandafter\xdef\csname\the\macname\endcsname{%
  7049. \bgroup\noexpand\macroargctxt
  7050. \noexpand\braceorline
  7051. \expandafter\noexpand\csname\the\macname xxx\endcsname}%
  7052. \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
  7053. \egroup\noexpand\scanmacro{\temp}}%
  7054. \else
  7055. \ifnum\paramno<10\relax % at most 9
  7056. \expandafter\xdef\csname\the\macname\endcsname{%
  7057. \bgroup\noexpand\macroargctxt
  7058. \noexpand\csname\the\macname xx\endcsname}%
  7059. \expandafter\xdef\csname\the\macname xx\endcsname##1{%
  7060. \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
  7061. \expandafter\expandafter
  7062. \expandafter\xdef
  7063. \expandafter\expandafter
  7064. \csname\the\macname xxx\endcsname
  7065. \paramlist{\egroup\noexpand\scanmacro{\temp}}%
  7066. \else % 10 or more
  7067. \expandafter\xdef\csname\the\macname\endcsname{%
  7068. \noexpand\getargvals@{\the\macname}{\argl}%
  7069. }%
  7070. \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
  7071. \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble
  7072. \fi
  7073. \fi
  7074. \else
  7075. \ifcase\paramno
  7076. % 0
  7077. \expandafter\xdef\csname\the\macname\endcsname{%
  7078. \noexpand\norecurse{\the\macname}%
  7079. \noexpand\scanmacro{\temp}\egroup}%
  7080. \or % 1
  7081. \expandafter\xdef\csname\the\macname\endcsname{%
  7082. \bgroup\noexpand\macroargctxt
  7083. \noexpand\braceorline
  7084. \expandafter\noexpand\csname\the\macname xxx\endcsname}%
  7085. \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
  7086. \egroup
  7087. \noexpand\norecurse{\the\macname}%
  7088. \noexpand\scanmacro{\temp}\egroup}%
  7089. \else % at most 9
  7090. \ifnum\paramno<10\relax
  7091. \expandafter\xdef\csname\the\macname\endcsname{%
  7092. \bgroup\noexpand\macroargctxt
  7093. \expandafter\noexpand\csname\the\macname xx\endcsname}%
  7094. \expandafter\xdef\csname\the\macname xx\endcsname##1{%
  7095. \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
  7096. \expandafter\expandafter
  7097. \expandafter\xdef
  7098. \expandafter\expandafter
  7099. \csname\the\macname xxx\endcsname
  7100. \paramlist{%
  7101. \egroup
  7102. \noexpand\norecurse{\the\macname}%
  7103. \noexpand\scanmacro{\temp}\egroup}%
  7104. \else % 10 or more:
  7105. \expandafter\xdef\csname\the\macname\endcsname{%
  7106. \noexpand\getargvals@{\the\macname}{\argl}%
  7107. }%
  7108. \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
  7109. \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse
  7110. \fi
  7111. \fi
  7112. \fi}
  7113. \catcode `\@\texiatcatcode\relax
  7114. \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
  7115. % \braceorline decides whether the next nonwhitespace character is a
  7116. % {. If so it reads up to the closing }, if not, it reads the whole
  7117. % line. Whatever was read is then fed to the next control sequence
  7118. % as an argument (by \parsebrace or \parsearg).
  7119. %
  7120. \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
  7121. \def\braceorlinexxx{%
  7122. \ifx\nchar\bgroup\else
  7123. \expandafter\parsearg
  7124. \fi \macnamexxx}
  7125. % @alias.
  7126. % We need some trickery to remove the optional spaces around the equal
  7127. % sign. Make them active and then expand them all to nothing.
  7128. %
  7129. \def\alias{\parseargusing\obeyspaces\aliasxxx}
  7130. \def\aliasxxx #1{\aliasyyy#1\relax}
  7131. \def\aliasyyy #1=#2\relax{%
  7132. {%
  7133. \expandafter\let\obeyedspace=\empty
  7134. \addtomacrolist{#1}%
  7135. \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%
  7136. }%
  7137. \next
  7138. }
  7139. \message{cross references,}
  7140. \newwrite\auxfile
  7141. \newif\ifhavexrefs % True if xref values are known.
  7142. \newif\ifwarnedxrefs % True if we warned once that they aren't known.
  7143. % @inforef is relatively simple.
  7144. \def\inforef #1{\inforefzzz #1,,,,**}
  7145. \def\inforefzzz #1,#2,#3,#4**{%
  7146. \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
  7147. node \samp{\ignorespaces#1{}}}
  7148. % @node's only job in TeX is to define \lastnode, which is used in
  7149. % cross-references. The @node line might or might not have commas, and
  7150. % might or might not have spaces before the first comma, like:
  7151. % @node foo , bar , ...
  7152. % We don't want such trailing spaces in the node name.
  7153. %
  7154. \parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse}
  7155. %
  7156. % also remove a trailing comma, in case of something like this:
  7157. % @node Help-Cross, , , Cross-refs
  7158. \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
  7159. \def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}}
  7160. \let\nwnode=\node
  7161. \let\lastnode=\empty
  7162. % Write a cross-reference definition for the current node. #1 is the
  7163. % type (Ynumbered, Yappendix, Ynothing).
  7164. %
  7165. \def\donoderef#1{%
  7166. \ifx\lastnode\empty\else
  7167. \setref{\lastnode}{#1}%
  7168. \global\let\lastnode=\empty
  7169. \fi
  7170. }
  7171. % @anchor{NAME} -- define xref target at arbitrary point.
  7172. %
  7173. \newcount\savesfregister
  7174. %
  7175. \def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
  7176. \def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
  7177. \def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
  7178. % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
  7179. % anchor), which consists of three parts:
  7180. % 1) NAME-title - the current sectioning name taken from \lastsection,
  7181. % or the anchor name.
  7182. % 2) NAME-snt - section number and type, passed as the SNT arg, or
  7183. % empty for anchors.
  7184. % 3) NAME-pg - the page number.
  7185. %
  7186. % This is called from \donoderef, \anchor, and \dofloat. In the case of
  7187. % floats, there is an additional part, which is not written here:
  7188. % 4) NAME-lof - the text as it should appear in a @listoffloats.
  7189. %
  7190. \def\setref#1#2{%
  7191. \pdfmkdest{#1}%
  7192. \iflinks
  7193. {%
  7194. \atdummies % preserve commands, but don't expand them
  7195. \edef\writexrdef##1##2{%
  7196. \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
  7197. ##1}{##2}}% these are parameters of \writexrdef
  7198. }%
  7199. \toks0 = \expandafter{\lastsection}%
  7200. \immediate \writexrdef{title}{\the\toks0 }%
  7201. \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
  7202. \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout
  7203. }%
  7204. \fi
  7205. }
  7206. % @xrefautosectiontitle on|off says whether @section(ing) names are used
  7207. % automatically in xrefs, if the third arg is not explicitly specified.
  7208. % This was provided as a "secret" @set xref-automatic-section-title
  7209. % variable, now it's official.
  7210. %
  7211. \parseargdef\xrefautomaticsectiontitle{%
  7212. \def\temp{#1}%
  7213. \ifx\temp\onword
  7214. \expandafter\let\csname SETxref-automatic-section-title\endcsname
  7215. = \empty
  7216. \else\ifx\temp\offword
  7217. \expandafter\let\csname SETxref-automatic-section-title\endcsname
  7218. = \relax
  7219. \else
  7220. \errhelp = \EMsimple
  7221. \errmessage{Unknown @xrefautomaticsectiontitle value `\temp',
  7222. must be on|off}%
  7223. \fi\fi
  7224. }
  7225. %
  7226. % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
  7227. % the node name, #2 the name of the Info cross-reference, #3 the printed
  7228. % node name, #4 the name of the Info file, #5 the name of the printed
  7229. % manual. All but the node name can be omitted.
  7230. %
  7231. \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
  7232. \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
  7233. \def\ref#1{\xrefX[#1,,,,,,,]}
  7234. %
  7235. \newbox\toprefbox
  7236. \newbox\printedrefnamebox
  7237. \newbox\infofilenamebox
  7238. \newbox\printedmanualbox
  7239. %
  7240. \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
  7241. \unsepspaces
  7242. %
  7243. % Get args without leading/trailing spaces.
  7244. \def\printedrefname{\ignorespaces #3}%
  7245. \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}%
  7246. %
  7247. \def\infofilename{\ignorespaces #4}%
  7248. \setbox\infofilenamebox = \hbox{\infofilename\unskip}%
  7249. %
  7250. \def\printedmanual{\ignorespaces #5}%
  7251. \setbox\printedmanualbox = \hbox{\printedmanual\unskip}%
  7252. %
  7253. % If the printed reference name (arg #3) was not explicitly given in
  7254. % the @xref, figure out what we want to use.
  7255. \ifdim \wd\printedrefnamebox = 0pt
  7256. % No printed node name was explicitly given.
  7257. \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax
  7258. % Not auto section-title: use node name inside the square brackets.
  7259. \def\printedrefname{\ignorespaces #1}%
  7260. \else
  7261. % Auto section-title: use chapter/section title inside
  7262. % the square brackets if we have it.
  7263. \ifdim \wd\printedmanualbox > 0pt
  7264. % It is in another manual, so we don't have it; use node name.
  7265. \def\printedrefname{\ignorespaces #1}%
  7266. \else
  7267. \ifhavexrefs
  7268. % We (should) know the real title if we have the xref values.
  7269. \def\printedrefname{\refx{#1-title}{}}%
  7270. \else
  7271. % Otherwise just copy the Info node name.
  7272. \def\printedrefname{\ignorespaces #1}%
  7273. \fi%
  7274. \fi
  7275. \fi
  7276. \fi
  7277. %
  7278. % Make link in pdf output.
  7279. \ifpdf
  7280. {\indexnofonts
  7281. \turnoffactive
  7282. \makevalueexpandable
  7283. % This expands tokens, so do it after making catcode changes, so _
  7284. % etc. don't get their TeX definitions. This ignores all spaces in
  7285. % #4, including (wrongly) those in the middle of the filename.
  7286. \getfilename{#4}%
  7287. %
  7288. % This (wrongly) does not take account of leading or trailing
  7289. % spaces in #1, which should be ignored.
  7290. \edef\pdfxrefdest{#1}%
  7291. \ifx\pdfxrefdest\empty
  7292. \def\pdfxrefdest{Top}% no empty targets
  7293. \else
  7294. \txiescapepdf\pdfxrefdest % escape PDF special chars
  7295. \fi
  7296. %
  7297. \leavevmode
  7298. \startlink attr{/Border [0 0 0]}%
  7299. \ifnum\filenamelength>0
  7300. goto file{\the\filename.pdf} name{\pdfxrefdest}%
  7301. \else
  7302. goto name{\pdfmkpgn{\pdfxrefdest}}%
  7303. \fi
  7304. }%
  7305. \setcolor{\linkcolor}%
  7306. \fi
  7307. %
  7308. % Float references are printed completely differently: "Figure 1.2"
  7309. % instead of "[somenode], p.3". We distinguish them by the
  7310. % LABEL-title being set to a magic string.
  7311. {%
  7312. % Have to otherify everything special to allow the \csname to
  7313. % include an _ in the xref name, etc.
  7314. \indexnofonts
  7315. \turnoffactive
  7316. \expandafter\global\expandafter\let\expandafter\Xthisreftitle
  7317. \csname XR#1-title\endcsname
  7318. }%
  7319. \iffloat\Xthisreftitle
  7320. % If the user specified the print name (third arg) to the ref,
  7321. % print it instead of our usual "Figure 1.2".
  7322. \ifdim\wd\printedrefnamebox = 0pt
  7323. \refx{#1-snt}{}%
  7324. \else
  7325. \printedrefname
  7326. \fi
  7327. %
  7328. % If the user also gave the printed manual name (fifth arg), append
  7329. % "in MANUALNAME".
  7330. \ifdim \wd\printedmanualbox > 0pt
  7331. \space \putwordin{} \cite{\printedmanual}%
  7332. \fi
  7333. \else
  7334. % node/anchor (non-float) references.
  7335. %
  7336. % If we use \unhbox to print the node names, TeX does not insert
  7337. % empty discretionaries after hyphens, which means that it will not
  7338. % find a line break at a hyphen in a node names. Since some manuals
  7339. % are best written with fairly long node names, containing hyphens,
  7340. % this is a loss. Therefore, we give the text of the node name
  7341. % again, so it is as if TeX is seeing it for the first time.
  7342. %
  7343. \ifdim \wd\printedmanualbox > 0pt
  7344. % Cross-manual reference with a printed manual name.
  7345. %
  7346. \crossmanualxref{\cite{\printedmanual\unskip}}%
  7347. %
  7348. \else\ifdim \wd\infofilenamebox > 0pt
  7349. % Cross-manual reference with only an info filename (arg 4), no
  7350. % printed manual name (arg 5). This is essentially the same as
  7351. % the case above; we output the filename, since we have nothing else.
  7352. %
  7353. \crossmanualxref{\code{\infofilename\unskip}}%
  7354. %
  7355. \else
  7356. % Reference within this manual.
  7357. %
  7358. % _ (for example) has to be the character _ for the purposes of the
  7359. % control sequence corresponding to the node, but it has to expand
  7360. % into the usual \leavevmode...\vrule stuff for purposes of
  7361. % printing. So we \turnoffactive for the \refx-snt, back on for the
  7362. % printing, back off for the \refx-pg.
  7363. {\turnoffactive
  7364. % Only output a following space if the -snt ref is nonempty; for
  7365. % @unnumbered and @anchor, it won't be.
  7366. \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
  7367. \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
  7368. }%
  7369. % output the `[mynode]' via the macro below so it can be overridden.
  7370. \xrefprintnodename\printedrefname
  7371. %
  7372. % But we always want a comma and a space:
  7373. ,\space
  7374. %
  7375. % output the `page 3'.
  7376. \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
  7377. \fi\fi
  7378. \fi
  7379. \endlink
  7380. \endgroup}
  7381. % Output a cross-manual xref to #1. Used just above (twice).
  7382. %
  7383. % Only include the text "Section ``foo'' in" if the foo is neither
  7384. % missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply
  7385. % "see The Foo Manual", the idea being to refer to the whole manual.
  7386. %
  7387. % But, this being TeX, we can't easily compare our node name against the
  7388. % string "Top" while ignoring the possible spaces before and after in
  7389. % the input. By adding the arbitrary 7sp below, we make it much less
  7390. % likely that a real node name would have the same width as "Top" (e.g.,
  7391. % in a monospaced font). Hopefully it will never happen in practice.
  7392. %
  7393. % For the same basic reason, we retypeset the "Top" at every
  7394. % reference, since the current font is indeterminate.
  7395. %
  7396. \def\crossmanualxref#1{%
  7397. \setbox\toprefbox = \hbox{Top\kern7sp}%
  7398. \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
  7399. \ifdim \wd2 > 7sp % nonempty?
  7400. \ifdim \wd2 = \wd\toprefbox \else % same as Top?
  7401. \putwordSection{} ``\printedrefname'' \putwordin{}\space
  7402. \fi
  7403. \fi
  7404. #1%
  7405. }
  7406. % This macro is called from \xrefX for the `[nodename]' part of xref
  7407. % output. It's a separate macro only so it can be changed more easily,
  7408. % since square brackets don't work well in some documents. Particularly
  7409. % one that Bob is working on :).
  7410. %
  7411. \def\xrefprintnodename#1{[#1]}
  7412. % Things referred to by \setref.
  7413. %
  7414. \def\Ynothing{}
  7415. \def\Yomitfromtoc{}
  7416. \def\Ynumbered{%
  7417. \ifnum\secno=0
  7418. \putwordChapter@tie \the\chapno
  7419. \else \ifnum\subsecno=0
  7420. \putwordSection@tie \the\chapno.\the\secno
  7421. \else \ifnum\subsubsecno=0
  7422. \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
  7423. \else
  7424. \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
  7425. \fi\fi\fi
  7426. }
  7427. \def\Yappendix{%
  7428. \ifnum\secno=0
  7429. \putwordAppendix@tie @char\the\appendixno{}%
  7430. \else \ifnum\subsecno=0
  7431. \putwordSection@tie @char\the\appendixno.\the\secno
  7432. \else \ifnum\subsubsecno=0
  7433. \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
  7434. \else
  7435. \putwordSection@tie
  7436. @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
  7437. \fi\fi\fi
  7438. }
  7439. % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
  7440. % If its value is nonempty, SUFFIX is output afterward.
  7441. %
  7442. \def\refx#1#2{%
  7443. {%
  7444. \indexnofonts
  7445. \otherbackslash
  7446. \expandafter\global\expandafter\let\expandafter\thisrefX
  7447. \csname XR#1\endcsname
  7448. }%
  7449. \ifx\thisrefX\relax
  7450. % If not defined, say something at least.
  7451. \angleleft un\-de\-fined\angleright
  7452. \iflinks
  7453. \ifhavexrefs
  7454. {\toks0 = {#1}% avoid expansion of possibly-complex value
  7455. \message{\linenumber Undefined cross reference `\the\toks0'.}}%
  7456. \else
  7457. \ifwarnedxrefs\else
  7458. \global\warnedxrefstrue
  7459. \message{Cross reference values unknown; you must run TeX again.}%
  7460. \fi
  7461. \fi
  7462. \fi
  7463. \else
  7464. % It's defined, so just use it.
  7465. \thisrefX
  7466. \fi
  7467. #2% Output the suffix in any case.
  7468. }
  7469. % This is the macro invoked by entries in the aux file. Usually it's
  7470. % just a \def (we prepend XR to the control sequence name to avoid
  7471. % collisions). But if this is a float type, we have more work to do.
  7472. %
  7473. \def\xrdef#1#2{%
  7474. {% The node name might contain 8-bit characters, which in our current
  7475. % implementation are changed to commands like @'e. Don't let these
  7476. % mess up the control sequence name.
  7477. \indexnofonts
  7478. \turnoffactive
  7479. \xdef\safexrefname{#1}%
  7480. }%
  7481. %
  7482. \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref
  7483. %
  7484. % Was that xref control sequence that we just defined for a float?
  7485. \expandafter\iffloat\csname XR\safexrefname\endcsname
  7486. % it was a float, and we have the (safe) float type in \iffloattype.
  7487. \expandafter\let\expandafter\floatlist
  7488. \csname floatlist\iffloattype\endcsname
  7489. %
  7490. % Is this the first time we've seen this float type?
  7491. \expandafter\ifx\floatlist\relax
  7492. \toks0 = {\do}% yes, so just \do
  7493. \else
  7494. % had it before, so preserve previous elements in list.
  7495. \toks0 = \expandafter{\floatlist\do}%
  7496. \fi
  7497. %
  7498. % Remember this xref in the control sequence \floatlistFLOATTYPE,
  7499. % for later use in \listoffloats.
  7500. \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0
  7501. {\safexrefname}}%
  7502. \fi
  7503. }
  7504. % Read the last existing aux file, if any. No error if none exists.
  7505. %
  7506. \def\tryauxfile{%
  7507. \openin 1 \jobname.aux
  7508. \ifeof 1 \else
  7509. \readdatafile{aux}%
  7510. \global\havexrefstrue
  7511. \fi
  7512. \closein 1
  7513. }
  7514. \def\setupdatafile{%
  7515. \catcode`\^^@=\other
  7516. \catcode`\^^A=\other
  7517. \catcode`\^^B=\other
  7518. \catcode`\^^C=\other
  7519. \catcode`\^^D=\other
  7520. \catcode`\^^E=\other
  7521. \catcode`\^^F=\other
  7522. \catcode`\^^G=\other
  7523. \catcode`\^^H=\other
  7524. \catcode`\^^K=\other
  7525. \catcode`\^^L=\other
  7526. \catcode`\^^N=\other
  7527. \catcode`\^^P=\other
  7528. \catcode`\^^Q=\other
  7529. \catcode`\^^R=\other
  7530. \catcode`\^^S=\other
  7531. \catcode`\^^T=\other
  7532. \catcode`\^^U=\other
  7533. \catcode`\^^V=\other
  7534. \catcode`\^^W=\other
  7535. \catcode`\^^X=\other
  7536. \catcode`\^^Z=\other
  7537. \catcode`\^^[=\other
  7538. \catcode`\^^\=\other
  7539. \catcode`\^^]=\other
  7540. \catcode`\^^^=\other
  7541. \catcode`\^^_=\other
  7542. % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
  7543. % in xref tags, i.e., node names. But since ^^e4 notation isn't
  7544. % supported in the main text, it doesn't seem desirable. Furthermore,
  7545. % that is not enough: for node names that actually contain a ^
  7546. % character, we would end up writing a line like this: 'xrdef {'hat
  7547. % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
  7548. % argument, and \hat is not an expandable control sequence. It could
  7549. % all be worked out, but why? Either we support ^^ or we don't.
  7550. %
  7551. % The other change necessary for this was to define \auxhat:
  7552. % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
  7553. % and then to call \auxhat in \setq.
  7554. %
  7555. \catcode`\^=\other
  7556. %
  7557. % Special characters. Should be turned off anyway, but...
  7558. \catcode`\~=\other
  7559. \catcode`\[=\other
  7560. \catcode`\]=\other
  7561. \catcode`\"=\other
  7562. \catcode`\_=\other
  7563. \catcode`\|=\other
  7564. \catcode`\<=\other
  7565. \catcode`\>=\other
  7566. \catcode`\$=\other
  7567. \catcode`\#=\other
  7568. \catcode`\&=\other
  7569. \catcode`\%=\other
  7570. \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
  7571. %
  7572. % This is to support \ in node names and titles, since the \
  7573. % characters end up in a \csname. It's easier than
  7574. % leaving it active and making its active definition an actual \
  7575. % character. What I don't understand is why it works in the *value*
  7576. % of the xrdef. Seems like it should be a catcode12 \, and that
  7577. % should not typeset properly. But it works, so I'm moving on for
  7578. % now. --karl, 15jan04.
  7579. \catcode`\\=\other
  7580. %
  7581. % Make the characters 128-255 be printing characters.
  7582. {%
  7583. \count1=128
  7584. \def\loop{%
  7585. \catcode\count1=\other
  7586. \advance\count1 by 1
  7587. \ifnum \count1<256 \loop \fi
  7588. }%
  7589. }%
  7590. %
  7591. % @ is our escape character in .aux files, and we need braces.
  7592. \catcode`\{=1
  7593. \catcode`\}=2
  7594. \catcode`\@=0
  7595. }
  7596. \def\readdatafile#1{%
  7597. \begingroup
  7598. \setupdatafile
  7599. \input\jobname.#1
  7600. \endgroup}
  7601. \message{insertions,}
  7602. % including footnotes.
  7603. \newcount \footnoteno
  7604. % The trailing space in the following definition for supereject is
  7605. % vital for proper filling; pages come out unaligned when you do a
  7606. % pagealignmacro call if that space before the closing brace is
  7607. % removed. (Generally, numeric constants should always be followed by a
  7608. % space to prevent strange expansion errors.)
  7609. \def\supereject{\par\penalty -20000\footnoteno =0 }
  7610. % @footnotestyle is meaningful for Info output only.
  7611. \let\footnotestyle=\comment
  7612. {\catcode `\@=11
  7613. %
  7614. % Auto-number footnotes. Otherwise like plain.
  7615. \gdef\footnote{%
  7616. \let\indent=\ptexindent
  7617. \let\noindent=\ptexnoindent
  7618. \global\advance\footnoteno by \@ne
  7619. \edef\thisfootno{$^{\the\footnoteno}$}%
  7620. %
  7621. % In case the footnote comes at the end of a sentence, preserve the
  7622. % extra spacing after we do the footnote number.
  7623. \let\@sf\empty
  7624. \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
  7625. %
  7626. % Remove inadvertent blank space before typesetting the footnote number.
  7627. \unskip
  7628. \thisfootno\@sf
  7629. \dofootnote
  7630. }%
  7631. % Don't bother with the trickery in plain.tex to not require the
  7632. % footnote text as a parameter. Our footnotes don't need to be so general.
  7633. %
  7634. % Oh yes, they do; otherwise, @ifset (and anything else that uses
  7635. % \parseargline) fails inside footnotes because the tokens are fixed when
  7636. % the footnote is read. --karl, 16nov96.
  7637. %
  7638. \gdef\dofootnote{%
  7639. \insert\footins\bgroup
  7640. % We want to typeset this text as a normal paragraph, even if the
  7641. % footnote reference occurs in (for example) a display environment.
  7642. % So reset some parameters.
  7643. \hsize=\pagewidth
  7644. \interlinepenalty\interfootnotelinepenalty
  7645. \splittopskip\ht\strutbox % top baseline for broken footnotes
  7646. \splitmaxdepth\dp\strutbox
  7647. \floatingpenalty\@MM
  7648. \leftskip\z@skip
  7649. \rightskip\z@skip
  7650. \spaceskip\z@skip
  7651. \xspaceskip\z@skip
  7652. \parindent\defaultparindent
  7653. %
  7654. \smallfonts \rm
  7655. %
  7656. % Because we use hanging indentation in footnotes, a @noindent appears
  7657. % to exdent this text, so make it be a no-op. makeinfo does not use
  7658. % hanging indentation so @noindent can still be needed within footnote
  7659. % text after an @example or the like (not that this is good style).
  7660. \let\noindent = \relax
  7661. %
  7662. % Hang the footnote text off the number. Use \everypar in case the
  7663. % footnote extends for more than one paragraph.
  7664. \everypar = {\hang}%
  7665. \textindent{\thisfootno}%
  7666. %
  7667. % Don't crash into the line above the footnote text. Since this
  7668. % expands into a box, it must come within the paragraph, lest it
  7669. % provide a place where TeX can split the footnote.
  7670. \footstrut
  7671. %
  7672. % Invoke rest of plain TeX footnote routine.
  7673. \futurelet\next\fo@t
  7674. }
  7675. }%end \catcode `\@=11
  7676. % In case a @footnote appears in a vbox, save the footnote text and create
  7677. % the real \insert just after the vbox finished. Otherwise, the insertion
  7678. % would be lost.
  7679. % Similarly, if a @footnote appears inside an alignment, save the footnote
  7680. % text to a box and make the \insert when a row of the table is finished.
  7681. % And the same can be done for other insert classes. --kasal, 16nov03.
  7682. % Replace the \insert primitive by a cheating macro.
  7683. % Deeper inside, just make sure that the saved insertions are not spilled
  7684. % out prematurely.
  7685. %
  7686. \def\startsavinginserts{%
  7687. \ifx \insert\ptexinsert
  7688. \let\insert\saveinsert
  7689. \else
  7690. \let\checkinserts\relax
  7691. \fi
  7692. }
  7693. % This \insert replacement works for both \insert\footins{foo} and
  7694. % \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}.
  7695. %
  7696. \def\saveinsert#1{%
  7697. \edef\next{\noexpand\savetobox \makeSAVEname#1}%
  7698. \afterassignment\next
  7699. % swallow the left brace
  7700. \let\temp =
  7701. }
  7702. \def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}}
  7703. \def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1}
  7704. \def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi}
  7705. \def\placesaveins#1{%
  7706. \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname
  7707. {\box#1}%
  7708. }
  7709. % eat @SAVE -- beware, all of them have catcode \other:
  7710. {
  7711. \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-)
  7712. \gdef\gobblesave @SAVE{}
  7713. }
  7714. % initialization:
  7715. \def\newsaveins #1{%
  7716. \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}%
  7717. \next
  7718. }
  7719. \def\newsaveinsX #1{%
  7720. \csname newbox\endcsname #1%
  7721. \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts
  7722. \checksaveins #1}%
  7723. }
  7724. % initialize:
  7725. \let\checkinserts\empty
  7726. \newsaveins\footins
  7727. \newsaveins\margin
  7728. % @image. We use the macros from epsf.tex to support this.
  7729. % If epsf.tex is not installed and @image is used, we complain.
  7730. %
  7731. % Check for and read epsf.tex up front. If we read it only at @image
  7732. % time, we might be inside a group, and then its definitions would get
  7733. % undone and the next image would fail.
  7734. \openin 1 = epsf.tex
  7735. \ifeof 1 \else
  7736. % Do not bother showing banner with epsf.tex v2.7k (available in
  7737. % doc/epsf.tex and on ctan).
  7738. \def\epsfannounce{\toks0 = }%
  7739. \input epsf.tex
  7740. \fi
  7741. \closein 1
  7742. %
  7743. % We will only complain once about lack of epsf.tex.
  7744. \newif\ifwarnednoepsf
  7745. \newhelp\noepsfhelp{epsf.tex must be installed for images to
  7746. work. It is also included in the Texinfo distribution, or you can get
  7747. it from ftp://tug.org/tex/epsf.tex.}
  7748. %
  7749. \def\image#1{%
  7750. \ifx\epsfbox\thisisundefined
  7751. \ifwarnednoepsf \else
  7752. \errhelp = \noepsfhelp
  7753. \errmessage{epsf.tex not found, images will be ignored}%
  7754. \global\warnednoepsftrue
  7755. \fi
  7756. \else
  7757. \imagexxx #1,,,,,\finish
  7758. \fi
  7759. }
  7760. %
  7761. % Arguments to @image:
  7762. % #1 is (mandatory) image filename; we tack on .eps extension.
  7763. % #2 is (optional) width, #3 is (optional) height.
  7764. % #4 is (ignored optional) html alt text.
  7765. % #5 is (ignored optional) extension.
  7766. % #6 is just the usual extra ignored arg for parsing stuff.
  7767. \newif\ifimagevmode
  7768. \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
  7769. \catcode`\^^M = 5 % in case we're inside an example
  7770. \normalturnoffactive % allow _ et al. in names
  7771. % If the image is by itself, center it.
  7772. \ifvmode
  7773. \imagevmodetrue
  7774. \else \ifx\centersub\centerV
  7775. % for @center @image, we need a vbox so we can have our vertical space
  7776. \imagevmodetrue
  7777. \vbox\bgroup % vbox has better behavior than vtop herev
  7778. \fi\fi
  7779. %
  7780. \ifimagevmode
  7781. \nobreak\medskip
  7782. % Usually we'll have text after the image which will insert
  7783. % \parskip glue, so insert it here too to equalize the space
  7784. % above and below.
  7785. \nobreak\vskip\parskip
  7786. \nobreak
  7787. \fi
  7788. %
  7789. % Leave vertical mode so that indentation from an enclosing
  7790. % environment such as @quotation is respected.
  7791. % However, if we're at the top level, we don't want the
  7792. % normal paragraph indentation.
  7793. % On the other hand, if we are in the case of @center @image, we don't
  7794. % want to start a paragraph, which will create a hsize-width box and
  7795. % eradicate the centering.
  7796. \ifx\centersub\centerV\else \noindent \fi
  7797. %
  7798. % Output the image.
  7799. \ifpdf
  7800. \dopdfimage{#1}{#2}{#3}%
  7801. \else
  7802. % \epsfbox itself resets \epsf?size at each figure.
  7803. \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
  7804. \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
  7805. \epsfbox{#1.eps}%
  7806. \fi
  7807. %
  7808. \ifimagevmode
  7809. \medskip % space after a standalone image
  7810. \fi
  7811. \ifx\centersub\centerV \egroup \fi
  7812. \endgroup}
  7813. % @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables,
  7814. % etc. We don't actually implement floating yet, we always include the
  7815. % float "here". But it seemed the best name for the future.
  7816. %
  7817. \envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish}
  7818. % There may be a space before second and/or third parameter; delete it.
  7819. \def\eatcommaspace#1, {#1,}
  7820. % #1 is the optional FLOATTYPE, the text label for this float, typically
  7821. % "Figure", "Table", "Example", etc. Can't contain commas. If omitted,
  7822. % this float will not be numbered and cannot be referred to.
  7823. %
  7824. % #2 is the optional xref label. Also must be present for the float to
  7825. % be referable.
  7826. %
  7827. % #3 is the optional positioning argument; for now, it is ignored. It
  7828. % will somehow specify the positions allowed to float to (here, top, bottom).
  7829. %
  7830. % We keep a separate counter for each FLOATTYPE, which we reset at each
  7831. % chapter-level command.
  7832. \let\resetallfloatnos=\empty
  7833. %
  7834. \def\dofloat#1,#2,#3,#4\finish{%
  7835. \let\thiscaption=\empty
  7836. \let\thisshortcaption=\empty
  7837. %
  7838. % don't lose footnotes inside @float.
  7839. %
  7840. % BEWARE: when the floats start float, we have to issue warning whenever an
  7841. % insert appears inside a float which could possibly float. --kasal, 26may04
  7842. %
  7843. \startsavinginserts
  7844. %
  7845. % We can't be used inside a paragraph.
  7846. \par
  7847. %
  7848. \vtop\bgroup
  7849. \def\floattype{#1}%
  7850. \def\floatlabel{#2}%
  7851. \def\floatloc{#3}% we do nothing with this yet.
  7852. %
  7853. \ifx\floattype\empty
  7854. \let\safefloattype=\empty
  7855. \else
  7856. {%
  7857. % the floattype might have accents or other special characters,
  7858. % but we need to use it in a control sequence name.
  7859. \indexnofonts
  7860. \turnoffactive
  7861. \xdef\safefloattype{\floattype}%
  7862. }%
  7863. \fi
  7864. %
  7865. % If label is given but no type, we handle that as the empty type.
  7866. \ifx\floatlabel\empty \else
  7867. % We want each FLOATTYPE to be numbered separately (Figure 1,
  7868. % Table 1, Figure 2, ...). (And if no label, no number.)
  7869. %
  7870. \expandafter\getfloatno\csname\safefloattype floatno\endcsname
  7871. \global\advance\floatno by 1
  7872. %
  7873. {%
  7874. % This magic value for \lastsection is output by \setref as the
  7875. % XREFLABEL-title value. \xrefX uses it to distinguish float
  7876. % labels (which have a completely different output format) from
  7877. % node and anchor labels. And \xrdef uses it to construct the
  7878. % lists of floats.
  7879. %
  7880. \edef\lastsection{\floatmagic=\safefloattype}%
  7881. \setref{\floatlabel}{Yfloat}%
  7882. }%
  7883. \fi
  7884. %
  7885. % start with \parskip glue, I guess.
  7886. \vskip\parskip
  7887. %
  7888. % Don't suppress indentation if a float happens to start a section.
  7889. \restorefirstparagraphindent
  7890. }
  7891. % we have these possibilities:
  7892. % @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap
  7893. % @float Foo,lbl & no caption: Foo 1.1
  7894. % @float Foo & @caption{Cap}: Foo: Cap
  7895. % @float Foo & no caption: Foo
  7896. % @float ,lbl & Caption{Cap}: 1.1: Cap
  7897. % @float ,lbl & no caption: 1.1
  7898. % @float & @caption{Cap}: Cap
  7899. % @float & no caption:
  7900. %
  7901. \def\Efloat{%
  7902. \let\floatident = \empty
  7903. %
  7904. % In all cases, if we have a float type, it comes first.
  7905. \ifx\floattype\empty \else \def\floatident{\floattype}\fi
  7906. %
  7907. % If we have an xref label, the number comes next.
  7908. \ifx\floatlabel\empty \else
  7909. \ifx\floattype\empty \else % if also had float type, need tie first.
  7910. \appendtomacro\floatident{\tie}%
  7911. \fi
  7912. % the number.
  7913. \appendtomacro\floatident{\chaplevelprefix\the\floatno}%
  7914. \fi
  7915. %
  7916. % Start the printed caption with what we've constructed in
  7917. % \floatident, but keep it separate; we need \floatident again.
  7918. \let\captionline = \floatident
  7919. %
  7920. \ifx\thiscaption\empty \else
  7921. \ifx\floatident\empty \else
  7922. \appendtomacro\captionline{: }% had ident, so need a colon between
  7923. \fi
  7924. %
  7925. % caption text.
  7926. \appendtomacro\captionline{\scanexp\thiscaption}%
  7927. \fi
  7928. %
  7929. % If we have anything to print, print it, with space before.
  7930. % Eventually this needs to become an \insert.
  7931. \ifx\captionline\empty \else
  7932. \vskip.5\parskip
  7933. \captionline
  7934. %
  7935. % Space below caption.
  7936. \vskip\parskip
  7937. \fi
  7938. %
  7939. % If have an xref label, write the list of floats info. Do this
  7940. % after the caption, to avoid chance of it being a breakpoint.
  7941. \ifx\floatlabel\empty \else
  7942. % Write the text that goes in the lof to the aux file as
  7943. % \floatlabel-lof. Besides \floatident, we include the short
  7944. % caption if specified, else the full caption if specified, else nothing.
  7945. {%
  7946. \atdummies
  7947. %
  7948. % since we read the caption text in the macro world, where ^^M
  7949. % is turned into a normal character, we have to scan it back, so
  7950. % we don't write the literal three characters "^^M" into the aux file.
  7951. \scanexp{%
  7952. \xdef\noexpand\gtemp{%
  7953. \ifx\thisshortcaption\empty
  7954. \thiscaption
  7955. \else
  7956. \thisshortcaption
  7957. \fi
  7958. }%
  7959. }%
  7960. \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident
  7961. \ifx\gtemp\empty \else : \gtemp \fi}}%
  7962. }%
  7963. \fi
  7964. \egroup % end of \vtop
  7965. %
  7966. % place the captured inserts
  7967. %
  7968. % BEWARE: when the floats start floating, we have to issue warning
  7969. % whenever an insert appears inside a float which could possibly
  7970. % float. --kasal, 26may04
  7971. %
  7972. \checkinserts
  7973. }
  7974. % Append the tokens #2 to the definition of macro #1, not expanding either.
  7975. %
  7976. \def\appendtomacro#1#2{%
  7977. \expandafter\def\expandafter#1\expandafter{#1#2}%
  7978. }
  7979. % @caption, @shortcaption
  7980. %
  7981. \def\caption{\docaption\thiscaption}
  7982. \def\shortcaption{\docaption\thisshortcaption}
  7983. \def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption}
  7984. \def\defcaption#1#2{\egroup \def#1{#2}}
  7985. % The parameter is the control sequence identifying the counter we are
  7986. % going to use. Create it if it doesn't exist and assign it to \floatno.
  7987. \def\getfloatno#1{%
  7988. \ifx#1\relax
  7989. % Haven't seen this figure type before.
  7990. \csname newcount\endcsname #1%
  7991. %
  7992. % Remember to reset this floatno at the next chap.
  7993. \expandafter\gdef\expandafter\resetallfloatnos
  7994. \expandafter{\resetallfloatnos #1=0 }%
  7995. \fi
  7996. \let\floatno#1%
  7997. }
  7998. % \setref calls this to get the XREFLABEL-snt value. We want an @xref
  7999. % to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we
  8000. % first read the @float command.
  8001. %
  8002. \def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}%
  8003. % Magic string used for the XREFLABEL-title value, so \xrefX can
  8004. % distinguish floats from other xref types.
  8005. \def\floatmagic{!!float!!}
  8006. % #1 is the control sequence we are passed; we expand into a conditional
  8007. % which is true if #1 represents a float ref. That is, the magic
  8008. % \lastsection value which we \setref above.
  8009. %
  8010. \def\iffloat#1{\expandafter\doiffloat#1==\finish}
  8011. %
  8012. % #1 is (maybe) the \floatmagic string. If so, #2 will be the
  8013. % (safe) float type for this float. We set \iffloattype to #2.
  8014. %
  8015. \def\doiffloat#1=#2=#3\finish{%
  8016. \def\temp{#1}%
  8017. \def\iffloattype{#2}%
  8018. \ifx\temp\floatmagic
  8019. }
  8020. % @listoffloats FLOATTYPE - print a list of floats like a table of contents.
  8021. %
  8022. \parseargdef\listoffloats{%
  8023. \def\floattype{#1}% floattype
  8024. {%
  8025. % the floattype might have accents or other special characters,
  8026. % but we need to use it in a control sequence name.
  8027. \indexnofonts
  8028. \turnoffactive
  8029. \xdef\safefloattype{\floattype}%
  8030. }%
  8031. %
  8032. % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE.
  8033. \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax
  8034. \ifhavexrefs
  8035. % if the user said @listoffloats foo but never @float foo.
  8036. \message{\linenumber No `\safefloattype' floats to list.}%
  8037. \fi
  8038. \else
  8039. \begingroup
  8040. \leftskip=\tocindent % indent these entries like a toc
  8041. \let\do=\listoffloatsdo
  8042. \csname floatlist\safefloattype\endcsname
  8043. \endgroup
  8044. \fi
  8045. }
  8046. % This is called on each entry in a list of floats. We're passed the
  8047. % xref label, in the form LABEL-title, which is how we save it in the
  8048. % aux file. We strip off the -title and look up \XRLABEL-lof, which
  8049. % has the text we're supposed to typeset here.
  8050. %
  8051. % Figures without xref labels will not be included in the list (since
  8052. % they won't appear in the aux file).
  8053. %
  8054. \def\listoffloatsdo#1{\listoffloatsdoentry#1\finish}
  8055. \def\listoffloatsdoentry#1-title\finish{{%
  8056. % Can't fully expand XR#1-lof because it can contain anything. Just
  8057. % pass the control sequence. On the other hand, XR#1-pg is just the
  8058. % page number, and we want to fully expand that so we can get a link
  8059. % in pdf output.
  8060. \toksA = \expandafter{\csname XR#1-lof\endcsname}%
  8061. %
  8062. % use the same \entry macro we use to generate the TOC and index.
  8063. \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}%
  8064. \writeentry
  8065. }}
  8066. \message{localization,}
  8067. % For single-language documents, @documentlanguage is usually given very
  8068. % early, just after @documentencoding. Single argument is the language
  8069. % (de) or locale (de_DE) abbreviation.
  8070. %
  8071. {
  8072. \catcode`\_ = \active
  8073. \globaldefs=1
  8074. \parseargdef\documentlanguage{\begingroup
  8075. \let_=\normalunderscore % normal _ character for filenames
  8076. \tex % read txi-??.tex file in plain TeX.
  8077. % Read the file by the name they passed if it exists.
  8078. \openin 1 txi-#1.tex
  8079. \ifeof 1
  8080. \documentlanguagetrywithoutunderscore{#1_\finish}%
  8081. \else
  8082. \globaldefs = 1 % everything in the txi-LL files needs to persist
  8083. \input txi-#1.tex
  8084. \fi
  8085. \closein 1
  8086. \endgroup % end raw TeX
  8087. \endgroup}
  8088. %
  8089. % If they passed de_DE, and txi-de_DE.tex doesn't exist,
  8090. % try txi-de.tex.
  8091. %
  8092. \gdef\documentlanguagetrywithoutunderscore#1_#2\finish{%
  8093. \openin 1 txi-#1.tex
  8094. \ifeof 1
  8095. \errhelp = \nolanghelp
  8096. \errmessage{Cannot read language file txi-#1.tex}%
  8097. \else
  8098. \globaldefs = 1 % everything in the txi-LL files needs to persist
  8099. \input txi-#1.tex
  8100. \fi
  8101. \closein 1
  8102. }
  8103. }% end of special _ catcode
  8104. %
  8105. \newhelp\nolanghelp{The given language definition file cannot be found or
  8106. is empty. Maybe you need to install it? Putting it in the current
  8107. directory should work if nowhere else does.}
  8108. % This macro is called from txi-??.tex files; the first argument is the
  8109. % \language name to set (without the "\lang@" prefix), the second and
  8110. % third args are \{left,right}hyphenmin.
  8111. %
  8112. % The language names to pass are determined when the format is built.
  8113. % See the etex.log file created at that time, e.g.,
  8114. % /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log.
  8115. %
  8116. % With TeX Live 2008, etex now includes hyphenation patterns for all
  8117. % available languages. This means we can support hyphenation in
  8118. % Texinfo, at least to some extent. (This still doesn't solve the
  8119. % accented characters problem.)
  8120. %
  8121. \catcode`@=11
  8122. \def\txisetlanguage#1#2#3{%
  8123. % do not set the language if the name is undefined in the current TeX.
  8124. \expandafter\ifx\csname lang@#1\endcsname \relax
  8125. \message{no patterns for #1}%
  8126. \else
  8127. \global\language = \csname lang@#1\endcsname
  8128. \fi
  8129. % but there is no harm in adjusting the hyphenmin values regardless.
  8130. \global\lefthyphenmin = #2\relax
  8131. \global\righthyphenmin = #3\relax
  8132. }
  8133. % Helpers for encodings.
  8134. % Set the catcode of characters 128 through 255 to the specified number.
  8135. %
  8136. \def\setnonasciicharscatcode#1{%
  8137. \count255=128
  8138. \loop\ifnum\count255<256
  8139. \global\catcode\count255=#1\relax
  8140. \advance\count255 by 1
  8141. \repeat
  8142. }
  8143. \def\setnonasciicharscatcodenonglobal#1{%
  8144. \count255=128
  8145. \loop\ifnum\count255<256
  8146. \catcode\count255=#1\relax
  8147. \advance\count255 by 1
  8148. \repeat
  8149. }
  8150. % @documentencoding sets the definition of non-ASCII characters
  8151. % according to the specified encoding.
  8152. %
  8153. \parseargdef\documentencoding{%
  8154. % Encoding being declared for the document.
  8155. \def\declaredencoding{\csname #1.enc\endcsname}%
  8156. %
  8157. % Supported encodings: names converted to tokens in order to be able
  8158. % to compare them with \ifx.
  8159. \def\ascii{\csname US-ASCII.enc\endcsname}%
  8160. \def\latnine{\csname ISO-8859-15.enc\endcsname}%
  8161. \def\latone{\csname ISO-8859-1.enc\endcsname}%
  8162. \def\lattwo{\csname ISO-8859-2.enc\endcsname}%
  8163. \def\utfeight{\csname UTF-8.enc\endcsname}%
  8164. %
  8165. \ifx \declaredencoding \ascii
  8166. \asciichardefs
  8167. %
  8168. \else \ifx \declaredencoding \lattwo
  8169. \setnonasciicharscatcode\active
  8170. \lattwochardefs
  8171. %
  8172. \else \ifx \declaredencoding \latone
  8173. \setnonasciicharscatcode\active
  8174. \latonechardefs
  8175. %
  8176. \else \ifx \declaredencoding \latnine
  8177. \setnonasciicharscatcode\active
  8178. \latninechardefs
  8179. %
  8180. \else \ifx \declaredencoding \utfeight
  8181. \setnonasciicharscatcode\active
  8182. \utfeightchardefs
  8183. %
  8184. \else
  8185. \message{Unknown document encoding #1, ignoring.}%
  8186. %
  8187. \fi % utfeight
  8188. \fi % latnine
  8189. \fi % latone
  8190. \fi % lattwo
  8191. \fi % ascii
  8192. }
  8193. % A message to be logged when using a character that isn't available
  8194. % the default font encoding (OT1).
  8195. %
  8196. \def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}}
  8197. % Take account of \c (plain) vs. \, (Texinfo) difference.
  8198. \def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
  8199. % First, make active non-ASCII characters in order for them to be
  8200. % correctly categorized when TeX reads the replacement text of
  8201. % macros containing the character definitions.
  8202. \setnonasciicharscatcode\active
  8203. %
  8204. % Latin1 (ISO-8859-1) character definitions.
  8205. \def\latonechardefs{%
  8206. \gdef^^a0{\tie}
  8207. \gdef^^a1{\exclamdown}
  8208. \gdef^^a2{\missingcharmsg{CENT SIGN}}
  8209. \gdef^^a3{{\pounds}}
  8210. \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
  8211. \gdef^^a5{\missingcharmsg{YEN SIGN}}
  8212. \gdef^^a6{\missingcharmsg{BROKEN BAR}}
  8213. \gdef^^a7{\S}
  8214. \gdef^^a8{\"{}}
  8215. \gdef^^a9{\copyright}
  8216. \gdef^^aa{\ordf}
  8217. \gdef^^ab{\guillemetleft}
  8218. \gdef^^ac{$\lnot$}
  8219. \gdef^^ad{\-}
  8220. \gdef^^ae{\registeredsymbol}
  8221. \gdef^^af{\={}}
  8222. %
  8223. \gdef^^b0{\textdegree}
  8224. \gdef^^b1{$\pm$}
  8225. \gdef^^b2{$^2$}
  8226. \gdef^^b3{$^3$}
  8227. \gdef^^b4{\'{}}
  8228. \gdef^^b5{$\mu$}
  8229. \gdef^^b6{\P}
  8230. %
  8231. \gdef^^b7{$^.$}
  8232. \gdef^^b8{\cedilla\ }
  8233. \gdef^^b9{$^1$}
  8234. \gdef^^ba{\ordm}
  8235. %
  8236. \gdef^^bb{\guillemetright}
  8237. \gdef^^bc{$1\over4$}
  8238. \gdef^^bd{$1\over2$}
  8239. \gdef^^be{$3\over4$}
  8240. \gdef^^bf{\questiondown}
  8241. %
  8242. \gdef^^c0{\`A}
  8243. \gdef^^c1{\'A}
  8244. \gdef^^c2{\^A}
  8245. \gdef^^c3{\~A}
  8246. \gdef^^c4{\"A}
  8247. \gdef^^c5{\ringaccent A}
  8248. \gdef^^c6{\AE}
  8249. \gdef^^c7{\cedilla C}
  8250. \gdef^^c8{\`E}
  8251. \gdef^^c9{\'E}
  8252. \gdef^^ca{\^E}
  8253. \gdef^^cb{\"E}
  8254. \gdef^^cc{\`I}
  8255. \gdef^^cd{\'I}
  8256. \gdef^^ce{\^I}
  8257. \gdef^^cf{\"I}
  8258. %
  8259. \gdef^^d0{\DH}
  8260. \gdef^^d1{\~N}
  8261. \gdef^^d2{\`O}
  8262. \gdef^^d3{\'O}
  8263. \gdef^^d4{\^O}
  8264. \gdef^^d5{\~O}
  8265. \gdef^^d6{\"O}
  8266. \gdef^^d7{$\times$}
  8267. \gdef^^d8{\O}
  8268. \gdef^^d9{\`U}
  8269. \gdef^^da{\'U}
  8270. \gdef^^db{\^U}
  8271. \gdef^^dc{\"U}
  8272. \gdef^^dd{\'Y}
  8273. \gdef^^de{\TH}
  8274. \gdef^^df{\ss}
  8275. %
  8276. \gdef^^e0{\`a}
  8277. \gdef^^e1{\'a}
  8278. \gdef^^e2{\^a}
  8279. \gdef^^e3{\~a}
  8280. \gdef^^e4{\"a}
  8281. \gdef^^e5{\ringaccent a}
  8282. \gdef^^e6{\ae}
  8283. \gdef^^e7{\cedilla c}
  8284. \gdef^^e8{\`e}
  8285. \gdef^^e9{\'e}
  8286. \gdef^^ea{\^e}
  8287. \gdef^^eb{\"e}
  8288. \gdef^^ec{\`{\dotless i}}
  8289. \gdef^^ed{\'{\dotless i}}
  8290. \gdef^^ee{\^{\dotless i}}
  8291. \gdef^^ef{\"{\dotless i}}
  8292. %
  8293. \gdef^^f0{\dh}
  8294. \gdef^^f1{\~n}
  8295. \gdef^^f2{\`o}
  8296. \gdef^^f3{\'o}
  8297. \gdef^^f4{\^o}
  8298. \gdef^^f5{\~o}
  8299. \gdef^^f6{\"o}
  8300. \gdef^^f7{$\div$}
  8301. \gdef^^f8{\o}
  8302. \gdef^^f9{\`u}
  8303. \gdef^^fa{\'u}
  8304. \gdef^^fb{\^u}
  8305. \gdef^^fc{\"u}
  8306. \gdef^^fd{\'y}
  8307. \gdef^^fe{\th}
  8308. \gdef^^ff{\"y}
  8309. }
  8310. % Latin9 (ISO-8859-15) encoding character definitions.
  8311. \def\latninechardefs{%
  8312. % Encoding is almost identical to Latin1.
  8313. \latonechardefs
  8314. %
  8315. \gdef^^a4{\euro}
  8316. \gdef^^a6{\v S}
  8317. \gdef^^a8{\v s}
  8318. \gdef^^b4{\v Z}
  8319. \gdef^^b8{\v z}
  8320. \gdef^^bc{\OE}
  8321. \gdef^^bd{\oe}
  8322. \gdef^^be{\"Y}
  8323. }
  8324. % Latin2 (ISO-8859-2) character definitions.
  8325. \def\lattwochardefs{%
  8326. \gdef^^a0{\tie}
  8327. \gdef^^a1{\ogonek{A}}
  8328. \gdef^^a2{\u{}}
  8329. \gdef^^a3{\L}
  8330. \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
  8331. \gdef^^a5{\v L}
  8332. \gdef^^a6{\'S}
  8333. \gdef^^a7{\S}
  8334. \gdef^^a8{\"{}}
  8335. \gdef^^a9{\v S}
  8336. \gdef^^aa{\cedilla S}
  8337. \gdef^^ab{\v T}
  8338. \gdef^^ac{\'Z}
  8339. \gdef^^ad{\-}
  8340. \gdef^^ae{\v Z}
  8341. \gdef^^af{\dotaccent Z}
  8342. %
  8343. \gdef^^b0{\textdegree}
  8344. \gdef^^b1{\ogonek{a}}
  8345. \gdef^^b2{\ogonek{ }}
  8346. \gdef^^b3{\l}
  8347. \gdef^^b4{\'{}}
  8348. \gdef^^b5{\v l}
  8349. \gdef^^b6{\'s}
  8350. \gdef^^b7{\v{}}
  8351. \gdef^^b8{\cedilla\ }
  8352. \gdef^^b9{\v s}
  8353. \gdef^^ba{\cedilla s}
  8354. \gdef^^bb{\v t}
  8355. \gdef^^bc{\'z}
  8356. \gdef^^bd{\H{}}
  8357. \gdef^^be{\v z}
  8358. \gdef^^bf{\dotaccent z}
  8359. %
  8360. \gdef^^c0{\'R}
  8361. \gdef^^c1{\'A}
  8362. \gdef^^c2{\^A}
  8363. \gdef^^c3{\u A}
  8364. \gdef^^c4{\"A}
  8365. \gdef^^c5{\'L}
  8366. \gdef^^c6{\'C}
  8367. \gdef^^c7{\cedilla C}
  8368. \gdef^^c8{\v C}
  8369. \gdef^^c9{\'E}
  8370. \gdef^^ca{\ogonek{E}}
  8371. \gdef^^cb{\"E}
  8372. \gdef^^cc{\v E}
  8373. \gdef^^cd{\'I}
  8374. \gdef^^ce{\^I}
  8375. \gdef^^cf{\v D}
  8376. %
  8377. \gdef^^d0{\DH}
  8378. \gdef^^d1{\'N}
  8379. \gdef^^d2{\v N}
  8380. \gdef^^d3{\'O}
  8381. \gdef^^d4{\^O}
  8382. \gdef^^d5{\H O}
  8383. \gdef^^d6{\"O}
  8384. \gdef^^d7{$\times$}
  8385. \gdef^^d8{\v R}
  8386. \gdef^^d9{\ringaccent U}
  8387. \gdef^^da{\'U}
  8388. \gdef^^db{\H U}
  8389. \gdef^^dc{\"U}
  8390. \gdef^^dd{\'Y}
  8391. \gdef^^de{\cedilla T}
  8392. \gdef^^df{\ss}
  8393. %
  8394. \gdef^^e0{\'r}
  8395. \gdef^^e1{\'a}
  8396. \gdef^^e2{\^a}
  8397. \gdef^^e3{\u a}
  8398. \gdef^^e4{\"a}
  8399. \gdef^^e5{\'l}
  8400. \gdef^^e6{\'c}
  8401. \gdef^^e7{\cedilla c}
  8402. \gdef^^e8{\v c}
  8403. \gdef^^e9{\'e}
  8404. \gdef^^ea{\ogonek{e}}
  8405. \gdef^^eb{\"e}
  8406. \gdef^^ec{\v e}
  8407. \gdef^^ed{\'{\dotless{i}}}
  8408. \gdef^^ee{\^{\dotless{i}}}
  8409. \gdef^^ef{\v d}
  8410. %
  8411. \gdef^^f0{\dh}
  8412. \gdef^^f1{\'n}
  8413. \gdef^^f2{\v n}
  8414. \gdef^^f3{\'o}
  8415. \gdef^^f4{\^o}
  8416. \gdef^^f5{\H o}
  8417. \gdef^^f6{\"o}
  8418. \gdef^^f7{$\div$}
  8419. \gdef^^f8{\v r}
  8420. \gdef^^f9{\ringaccent u}
  8421. \gdef^^fa{\'u}
  8422. \gdef^^fb{\H u}
  8423. \gdef^^fc{\"u}
  8424. \gdef^^fd{\'y}
  8425. \gdef^^fe{\cedilla t}
  8426. \gdef^^ff{\dotaccent{}}
  8427. }
  8428. % UTF-8 character definitions.
  8429. %
  8430. % This code to support UTF-8 is based on LaTeX's utf8.def, with some
  8431. % changes for Texinfo conventions. It is included here under the GPL by
  8432. % permission from Frank Mittelbach and the LaTeX team.
  8433. %
  8434. \newcount\countUTFx
  8435. \newcount\countUTFy
  8436. \newcount\countUTFz
  8437. \gdef\UTFviiiTwoOctets#1#2{\expandafter
  8438. \UTFviiiDefined\csname u8:#1\string #2\endcsname}
  8439. %
  8440. \gdef\UTFviiiThreeOctets#1#2#3{\expandafter
  8441. \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname}
  8442. %
  8443. \gdef\UTFviiiFourOctets#1#2#3#4{\expandafter
  8444. \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname}
  8445. \gdef\UTFviiiDefined#1{%
  8446. \ifx #1\relax
  8447. \message{\linenumber Unicode char \string #1 not defined for Texinfo}%
  8448. \else
  8449. \expandafter #1%
  8450. \fi
  8451. }
  8452. \begingroup
  8453. \catcode`\~13
  8454. \catcode`\"12
  8455. \def\UTFviiiLoop{%
  8456. \global\catcode\countUTFx\active
  8457. \uccode`\~\countUTFx
  8458. \uppercase\expandafter{\UTFviiiTmp}%
  8459. \advance\countUTFx by 1
  8460. \ifnum\countUTFx < \countUTFy
  8461. \expandafter\UTFviiiLoop
  8462. \fi}
  8463. \countUTFx = "C2
  8464. \countUTFy = "E0
  8465. \def\UTFviiiTmp{%
  8466. \xdef~{\noexpand\UTFviiiTwoOctets\string~}}
  8467. \UTFviiiLoop
  8468. \countUTFx = "E0
  8469. \countUTFy = "F0
  8470. \def\UTFviiiTmp{%
  8471. \xdef~{\noexpand\UTFviiiThreeOctets\string~}}
  8472. \UTFviiiLoop
  8473. \countUTFx = "F0
  8474. \countUTFy = "F4
  8475. \def\UTFviiiTmp{%
  8476. \xdef~{\noexpand\UTFviiiFourOctets\string~}}
  8477. \UTFviiiLoop
  8478. \endgroup
  8479. \begingroup
  8480. \catcode`\"=12
  8481. \catcode`\<=12
  8482. \catcode`\.=12
  8483. \catcode`\,=12
  8484. \catcode`\;=12
  8485. \catcode`\!=12
  8486. \catcode`\~=13
  8487. \gdef\DeclareUnicodeCharacter#1#2{%
  8488. \countUTFz = "#1\relax
  8489. %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%
  8490. \begingroup
  8491. \parseXMLCharref
  8492. \def\UTFviiiTwoOctets##1##2{%
  8493. \csname u8:##1\string ##2\endcsname}%
  8494. \def\UTFviiiThreeOctets##1##2##3{%
  8495. \csname u8:##1\string ##2\string ##3\endcsname}%
  8496. \def\UTFviiiFourOctets##1##2##3##4{%
  8497. \csname u8:##1\string ##2\string ##3\string ##4\endcsname}%
  8498. \expandafter\expandafter\expandafter\expandafter
  8499. \expandafter\expandafter\expandafter
  8500. \gdef\UTFviiiTmp{#2}%
  8501. \endgroup}
  8502. \gdef\parseXMLCharref{%
  8503. \ifnum\countUTFz < "A0\relax
  8504. \errhelp = \EMsimple
  8505. \errmessage{Cannot define Unicode char value < 00A0}%
  8506. \else\ifnum\countUTFz < "800\relax
  8507. \parseUTFviiiA,%
  8508. \parseUTFviiiB C\UTFviiiTwoOctets.,%
  8509. \else\ifnum\countUTFz < "10000\relax
  8510. \parseUTFviiiA;%
  8511. \parseUTFviiiA,%
  8512. \parseUTFviiiB E\UTFviiiThreeOctets.{,;}%
  8513. \else
  8514. \parseUTFviiiA;%
  8515. \parseUTFviiiA,%
  8516. \parseUTFviiiA!%
  8517. \parseUTFviiiB F\UTFviiiFourOctets.{!,;}%
  8518. \fi\fi\fi
  8519. }
  8520. \gdef\parseUTFviiiA#1{%
  8521. \countUTFx = \countUTFz
  8522. \divide\countUTFz by 64
  8523. \countUTFy = \countUTFz
  8524. \multiply\countUTFz by 64
  8525. \advance\countUTFx by -\countUTFz
  8526. \advance\countUTFx by 128
  8527. \uccode `#1\countUTFx
  8528. \countUTFz = \countUTFy}
  8529. \gdef\parseUTFviiiB#1#2#3#4{%
  8530. \advance\countUTFz by "#10\relax
  8531. \uccode `#3\countUTFz
  8532. \uppercase{\gdef\UTFviiiTmp{#2#3#4}}}
  8533. \endgroup
  8534. \def\utfeightchardefs{%
  8535. \DeclareUnicodeCharacter{00A0}{\tie}
  8536. \DeclareUnicodeCharacter{00A1}{\exclamdown}
  8537. \DeclareUnicodeCharacter{00A3}{\pounds}
  8538. \DeclareUnicodeCharacter{00A8}{\"{ }}
  8539. \DeclareUnicodeCharacter{00A9}{\copyright}
  8540. \DeclareUnicodeCharacter{00AA}{\ordf}
  8541. \DeclareUnicodeCharacter{00AB}{\guillemetleft}
  8542. \DeclareUnicodeCharacter{00AD}{\-}
  8543. \DeclareUnicodeCharacter{00AE}{\registeredsymbol}
  8544. \DeclareUnicodeCharacter{00AF}{\={ }}
  8545. \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}
  8546. \DeclareUnicodeCharacter{00B4}{\'{ }}
  8547. \DeclareUnicodeCharacter{00B8}{\cedilla{ }}
  8548. \DeclareUnicodeCharacter{00BA}{\ordm}
  8549. \DeclareUnicodeCharacter{00BB}{\guillemetright}
  8550. \DeclareUnicodeCharacter{00BF}{\questiondown}
  8551. \DeclareUnicodeCharacter{00C0}{\`A}
  8552. \DeclareUnicodeCharacter{00C1}{\'A}
  8553. \DeclareUnicodeCharacter{00C2}{\^A}
  8554. \DeclareUnicodeCharacter{00C3}{\~A}
  8555. \DeclareUnicodeCharacter{00C4}{\"A}
  8556. \DeclareUnicodeCharacter{00C5}{\AA}
  8557. \DeclareUnicodeCharacter{00C6}{\AE}
  8558. \DeclareUnicodeCharacter{00C7}{\cedilla{C}}
  8559. \DeclareUnicodeCharacter{00C8}{\`E}
  8560. \DeclareUnicodeCharacter{00C9}{\'E}
  8561. \DeclareUnicodeCharacter{00CA}{\^E}
  8562. \DeclareUnicodeCharacter{00CB}{\"E}
  8563. \DeclareUnicodeCharacter{00CC}{\`I}
  8564. \DeclareUnicodeCharacter{00CD}{\'I}
  8565. \DeclareUnicodeCharacter{00CE}{\^I}
  8566. \DeclareUnicodeCharacter{00CF}{\"I}
  8567. \DeclareUnicodeCharacter{00D0}{\DH}
  8568. \DeclareUnicodeCharacter{00D1}{\~N}
  8569. \DeclareUnicodeCharacter{00D2}{\`O}
  8570. \DeclareUnicodeCharacter{00D3}{\'O}
  8571. \DeclareUnicodeCharacter{00D4}{\^O}
  8572. \DeclareUnicodeCharacter{00D5}{\~O}
  8573. \DeclareUnicodeCharacter{00D6}{\"O}
  8574. \DeclareUnicodeCharacter{00D8}{\O}
  8575. \DeclareUnicodeCharacter{00D9}{\`U}
  8576. \DeclareUnicodeCharacter{00DA}{\'U}
  8577. \DeclareUnicodeCharacter{00DB}{\^U}
  8578. \DeclareUnicodeCharacter{00DC}{\"U}
  8579. \DeclareUnicodeCharacter{00DD}{\'Y}
  8580. \DeclareUnicodeCharacter{00DE}{\TH}
  8581. \DeclareUnicodeCharacter{00DF}{\ss}
  8582. \DeclareUnicodeCharacter{00E0}{\`a}
  8583. \DeclareUnicodeCharacter{00E1}{\'a}
  8584. \DeclareUnicodeCharacter{00E2}{\^a}
  8585. \DeclareUnicodeCharacter{00E3}{\~a}
  8586. \DeclareUnicodeCharacter{00E4}{\"a}
  8587. \DeclareUnicodeCharacter{00E5}{\aa}
  8588. \DeclareUnicodeCharacter{00E6}{\ae}
  8589. \DeclareUnicodeCharacter{00E7}{\cedilla{c}}
  8590. \DeclareUnicodeCharacter{00E8}{\`e}
  8591. \DeclareUnicodeCharacter{00E9}{\'e}
  8592. \DeclareUnicodeCharacter{00EA}{\^e}
  8593. \DeclareUnicodeCharacter{00EB}{\"e}
  8594. \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}
  8595. \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}
  8596. \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}
  8597. \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}
  8598. \DeclareUnicodeCharacter{00F0}{\dh}
  8599. \DeclareUnicodeCharacter{00F1}{\~n}
  8600. \DeclareUnicodeCharacter{00F2}{\`o}
  8601. \DeclareUnicodeCharacter{00F3}{\'o}
  8602. \DeclareUnicodeCharacter{00F4}{\^o}
  8603. \DeclareUnicodeCharacter{00F5}{\~o}
  8604. \DeclareUnicodeCharacter{00F6}{\"o}
  8605. \DeclareUnicodeCharacter{00F8}{\o}
  8606. \DeclareUnicodeCharacter{00F9}{\`u}
  8607. \DeclareUnicodeCharacter{00FA}{\'u}
  8608. \DeclareUnicodeCharacter{00FB}{\^u}
  8609. \DeclareUnicodeCharacter{00FC}{\"u}
  8610. \DeclareUnicodeCharacter{00FD}{\'y}
  8611. \DeclareUnicodeCharacter{00FE}{\th}
  8612. \DeclareUnicodeCharacter{00FF}{\"y}
  8613. \DeclareUnicodeCharacter{0100}{\=A}
  8614. \DeclareUnicodeCharacter{0101}{\=a}
  8615. \DeclareUnicodeCharacter{0102}{\u{A}}
  8616. \DeclareUnicodeCharacter{0103}{\u{a}}
  8617. \DeclareUnicodeCharacter{0104}{\ogonek{A}}
  8618. \DeclareUnicodeCharacter{0105}{\ogonek{a}}
  8619. \DeclareUnicodeCharacter{0106}{\'C}
  8620. \DeclareUnicodeCharacter{0107}{\'c}
  8621. \DeclareUnicodeCharacter{0108}{\^C}
  8622. \DeclareUnicodeCharacter{0109}{\^c}
  8623. \DeclareUnicodeCharacter{0118}{\ogonek{E}}
  8624. \DeclareUnicodeCharacter{0119}{\ogonek{e}}
  8625. \DeclareUnicodeCharacter{010A}{\dotaccent{C}}
  8626. \DeclareUnicodeCharacter{010B}{\dotaccent{c}}
  8627. \DeclareUnicodeCharacter{010C}{\v{C}}
  8628. \DeclareUnicodeCharacter{010D}{\v{c}}
  8629. \DeclareUnicodeCharacter{010E}{\v{D}}
  8630. \DeclareUnicodeCharacter{0112}{\=E}
  8631. \DeclareUnicodeCharacter{0113}{\=e}
  8632. \DeclareUnicodeCharacter{0114}{\u{E}}
  8633. \DeclareUnicodeCharacter{0115}{\u{e}}
  8634. \DeclareUnicodeCharacter{0116}{\dotaccent{E}}
  8635. \DeclareUnicodeCharacter{0117}{\dotaccent{e}}
  8636. \DeclareUnicodeCharacter{011A}{\v{E}}
  8637. \DeclareUnicodeCharacter{011B}{\v{e}}
  8638. \DeclareUnicodeCharacter{011C}{\^G}
  8639. \DeclareUnicodeCharacter{011D}{\^g}
  8640. \DeclareUnicodeCharacter{011E}{\u{G}}
  8641. \DeclareUnicodeCharacter{011F}{\u{g}}
  8642. \DeclareUnicodeCharacter{0120}{\dotaccent{G}}
  8643. \DeclareUnicodeCharacter{0121}{\dotaccent{g}}
  8644. \DeclareUnicodeCharacter{0124}{\^H}
  8645. \DeclareUnicodeCharacter{0125}{\^h}
  8646. \DeclareUnicodeCharacter{0128}{\~I}
  8647. \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}
  8648. \DeclareUnicodeCharacter{012A}{\=I}
  8649. \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}
  8650. \DeclareUnicodeCharacter{012C}{\u{I}}
  8651. \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}
  8652. \DeclareUnicodeCharacter{0130}{\dotaccent{I}}
  8653. \DeclareUnicodeCharacter{0131}{\dotless{i}}
  8654. \DeclareUnicodeCharacter{0132}{IJ}
  8655. \DeclareUnicodeCharacter{0133}{ij}
  8656. \DeclareUnicodeCharacter{0134}{\^J}
  8657. \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}
  8658. \DeclareUnicodeCharacter{0139}{\'L}
  8659. \DeclareUnicodeCharacter{013A}{\'l}
  8660. \DeclareUnicodeCharacter{0141}{\L}
  8661. \DeclareUnicodeCharacter{0142}{\l}
  8662. \DeclareUnicodeCharacter{0143}{\'N}
  8663. \DeclareUnicodeCharacter{0144}{\'n}
  8664. \DeclareUnicodeCharacter{0147}{\v{N}}
  8665. \DeclareUnicodeCharacter{0148}{\v{n}}
  8666. \DeclareUnicodeCharacter{014C}{\=O}
  8667. \DeclareUnicodeCharacter{014D}{\=o}
  8668. \DeclareUnicodeCharacter{014E}{\u{O}}
  8669. \DeclareUnicodeCharacter{014F}{\u{o}}
  8670. \DeclareUnicodeCharacter{0150}{\H{O}}
  8671. \DeclareUnicodeCharacter{0151}{\H{o}}
  8672. \DeclareUnicodeCharacter{0152}{\OE}
  8673. \DeclareUnicodeCharacter{0153}{\oe}
  8674. \DeclareUnicodeCharacter{0154}{\'R}
  8675. \DeclareUnicodeCharacter{0155}{\'r}
  8676. \DeclareUnicodeCharacter{0158}{\v{R}}
  8677. \DeclareUnicodeCharacter{0159}{\v{r}}
  8678. \DeclareUnicodeCharacter{015A}{\'S}
  8679. \DeclareUnicodeCharacter{015B}{\'s}
  8680. \DeclareUnicodeCharacter{015C}{\^S}
  8681. \DeclareUnicodeCharacter{015D}{\^s}
  8682. \DeclareUnicodeCharacter{015E}{\cedilla{S}}
  8683. \DeclareUnicodeCharacter{015F}{\cedilla{s}}
  8684. \DeclareUnicodeCharacter{0160}{\v{S}}
  8685. \DeclareUnicodeCharacter{0161}{\v{s}}
  8686. \DeclareUnicodeCharacter{0162}{\cedilla{t}}
  8687. \DeclareUnicodeCharacter{0163}{\cedilla{T}}
  8688. \DeclareUnicodeCharacter{0164}{\v{T}}
  8689. \DeclareUnicodeCharacter{0168}{\~U}
  8690. \DeclareUnicodeCharacter{0169}{\~u}
  8691. \DeclareUnicodeCharacter{016A}{\=U}
  8692. \DeclareUnicodeCharacter{016B}{\=u}
  8693. \DeclareUnicodeCharacter{016C}{\u{U}}
  8694. \DeclareUnicodeCharacter{016D}{\u{u}}
  8695. \DeclareUnicodeCharacter{016E}{\ringaccent{U}}
  8696. \DeclareUnicodeCharacter{016F}{\ringaccent{u}}
  8697. \DeclareUnicodeCharacter{0170}{\H{U}}
  8698. \DeclareUnicodeCharacter{0171}{\H{u}}
  8699. \DeclareUnicodeCharacter{0174}{\^W}
  8700. \DeclareUnicodeCharacter{0175}{\^w}
  8701. \DeclareUnicodeCharacter{0176}{\^Y}
  8702. \DeclareUnicodeCharacter{0177}{\^y}
  8703. \DeclareUnicodeCharacter{0178}{\"Y}
  8704. \DeclareUnicodeCharacter{0179}{\'Z}
  8705. \DeclareUnicodeCharacter{017A}{\'z}
  8706. \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}
  8707. \DeclareUnicodeCharacter{017C}{\dotaccent{z}}
  8708. \DeclareUnicodeCharacter{017D}{\v{Z}}
  8709. \DeclareUnicodeCharacter{017E}{\v{z}}
  8710. \DeclareUnicodeCharacter{01C4}{D\v{Z}}
  8711. \DeclareUnicodeCharacter{01C5}{D\v{z}}
  8712. \DeclareUnicodeCharacter{01C6}{d\v{z}}
  8713. \DeclareUnicodeCharacter{01C7}{LJ}
  8714. \DeclareUnicodeCharacter{01C8}{Lj}
  8715. \DeclareUnicodeCharacter{01C9}{lj}
  8716. \DeclareUnicodeCharacter{01CA}{NJ}
  8717. \DeclareUnicodeCharacter{01CB}{Nj}
  8718. \DeclareUnicodeCharacter{01CC}{nj}
  8719. \DeclareUnicodeCharacter{01CD}{\v{A}}
  8720. \DeclareUnicodeCharacter{01CE}{\v{a}}
  8721. \DeclareUnicodeCharacter{01CF}{\v{I}}
  8722. \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}
  8723. \DeclareUnicodeCharacter{01D1}{\v{O}}
  8724. \DeclareUnicodeCharacter{01D2}{\v{o}}
  8725. \DeclareUnicodeCharacter{01D3}{\v{U}}
  8726. \DeclareUnicodeCharacter{01D4}{\v{u}}
  8727. \DeclareUnicodeCharacter{01E2}{\={\AE}}
  8728. \DeclareUnicodeCharacter{01E3}{\={\ae}}
  8729. \DeclareUnicodeCharacter{01E6}{\v{G}}
  8730. \DeclareUnicodeCharacter{01E7}{\v{g}}
  8731. \DeclareUnicodeCharacter{01E8}{\v{K}}
  8732. \DeclareUnicodeCharacter{01E9}{\v{k}}
  8733. \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}
  8734. \DeclareUnicodeCharacter{01F1}{DZ}
  8735. \DeclareUnicodeCharacter{01F2}{Dz}
  8736. \DeclareUnicodeCharacter{01F3}{dz}
  8737. \DeclareUnicodeCharacter{01F4}{\'G}
  8738. \DeclareUnicodeCharacter{01F5}{\'g}
  8739. \DeclareUnicodeCharacter{01F8}{\`N}
  8740. \DeclareUnicodeCharacter{01F9}{\`n}
  8741. \DeclareUnicodeCharacter{01FC}{\'{\AE}}
  8742. \DeclareUnicodeCharacter{01FD}{\'{\ae}}
  8743. \DeclareUnicodeCharacter{01FE}{\'{\O}}
  8744. \DeclareUnicodeCharacter{01FF}{\'{\o}}
  8745. \DeclareUnicodeCharacter{021E}{\v{H}}
  8746. \DeclareUnicodeCharacter{021F}{\v{h}}
  8747. \DeclareUnicodeCharacter{0226}{\dotaccent{A}}
  8748. \DeclareUnicodeCharacter{0227}{\dotaccent{a}}
  8749. \DeclareUnicodeCharacter{0228}{\cedilla{E}}
  8750. \DeclareUnicodeCharacter{0229}{\cedilla{e}}
  8751. \DeclareUnicodeCharacter{022E}{\dotaccent{O}}
  8752. \DeclareUnicodeCharacter{022F}{\dotaccent{o}}
  8753. \DeclareUnicodeCharacter{0232}{\=Y}
  8754. \DeclareUnicodeCharacter{0233}{\=y}
  8755. \DeclareUnicodeCharacter{0237}{\dotless{j}}
  8756. \DeclareUnicodeCharacter{02DB}{\ogonek{ }}
  8757. \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}
  8758. \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}
  8759. \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}
  8760. \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}
  8761. \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}
  8762. \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}
  8763. \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}
  8764. \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}
  8765. \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}
  8766. \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}
  8767. \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}
  8768. \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}
  8769. \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}
  8770. \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}
  8771. \DeclareUnicodeCharacter{1E20}{\=G}
  8772. \DeclareUnicodeCharacter{1E21}{\=g}
  8773. \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}
  8774. \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}
  8775. \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}
  8776. \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}
  8777. \DeclareUnicodeCharacter{1E26}{\"H}
  8778. \DeclareUnicodeCharacter{1E27}{\"h}
  8779. \DeclareUnicodeCharacter{1E30}{\'K}
  8780. \DeclareUnicodeCharacter{1E31}{\'k}
  8781. \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}
  8782. \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}
  8783. \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}
  8784. \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}
  8785. \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}
  8786. \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}
  8787. \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}
  8788. \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}
  8789. \DeclareUnicodeCharacter{1E3E}{\'M}
  8790. \DeclareUnicodeCharacter{1E3F}{\'m}
  8791. \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}
  8792. \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}
  8793. \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}
  8794. \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}
  8795. \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}
  8796. \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}
  8797. \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}
  8798. \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}
  8799. \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}
  8800. \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}
  8801. \DeclareUnicodeCharacter{1E54}{\'P}
  8802. \DeclareUnicodeCharacter{1E55}{\'p}
  8803. \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}
  8804. \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}
  8805. \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}
  8806. \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}
  8807. \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}
  8808. \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}
  8809. \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}
  8810. \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}
  8811. \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}
  8812. \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}
  8813. \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}
  8814. \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}
  8815. \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}
  8816. \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}
  8817. \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}
  8818. \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}
  8819. \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}
  8820. \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}
  8821. \DeclareUnicodeCharacter{1E7C}{\~V}
  8822. \DeclareUnicodeCharacter{1E7D}{\~v}
  8823. \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}
  8824. \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}
  8825. \DeclareUnicodeCharacter{1E80}{\`W}
  8826. \DeclareUnicodeCharacter{1E81}{\`w}
  8827. \DeclareUnicodeCharacter{1E82}{\'W}
  8828. \DeclareUnicodeCharacter{1E83}{\'w}
  8829. \DeclareUnicodeCharacter{1E84}{\"W}
  8830. \DeclareUnicodeCharacter{1E85}{\"w}
  8831. \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}
  8832. \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}
  8833. \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}
  8834. \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}
  8835. \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}
  8836. \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}
  8837. \DeclareUnicodeCharacter{1E8C}{\"X}
  8838. \DeclareUnicodeCharacter{1E8D}{\"x}
  8839. \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}
  8840. \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}
  8841. \DeclareUnicodeCharacter{1E90}{\^Z}
  8842. \DeclareUnicodeCharacter{1E91}{\^z}
  8843. \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}
  8844. \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}
  8845. \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}
  8846. \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}
  8847. \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}
  8848. \DeclareUnicodeCharacter{1E97}{\"t}
  8849. \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}
  8850. \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}
  8851. \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}
  8852. \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}
  8853. \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}
  8854. \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}
  8855. \DeclareUnicodeCharacter{1EBC}{\~E}
  8856. \DeclareUnicodeCharacter{1EBD}{\~e}
  8857. \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}
  8858. \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}
  8859. \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}
  8860. \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}
  8861. \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}
  8862. \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}
  8863. \DeclareUnicodeCharacter{1EF2}{\`Y}
  8864. \DeclareUnicodeCharacter{1EF3}{\`y}
  8865. \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}
  8866. \DeclareUnicodeCharacter{1EF8}{\~Y}
  8867. \DeclareUnicodeCharacter{1EF9}{\~y}
  8868. \DeclareUnicodeCharacter{2013}{--}
  8869. \DeclareUnicodeCharacter{2014}{---}
  8870. \DeclareUnicodeCharacter{2018}{\quoteleft}
  8871. \DeclareUnicodeCharacter{2019}{\quoteright}
  8872. \DeclareUnicodeCharacter{201A}{\quotesinglbase}
  8873. \DeclareUnicodeCharacter{201C}{\quotedblleft}
  8874. \DeclareUnicodeCharacter{201D}{\quotedblright}
  8875. \DeclareUnicodeCharacter{201E}{\quotedblbase}
  8876. \DeclareUnicodeCharacter{2022}{\bullet}
  8877. \DeclareUnicodeCharacter{2026}{\dots}
  8878. \DeclareUnicodeCharacter{2039}{\guilsinglleft}
  8879. \DeclareUnicodeCharacter{203A}{\guilsinglright}
  8880. \DeclareUnicodeCharacter{20AC}{\euro}
  8881. \DeclareUnicodeCharacter{2192}{\expansion}
  8882. \DeclareUnicodeCharacter{21D2}{\result}
  8883. \DeclareUnicodeCharacter{2212}{\minus}
  8884. \DeclareUnicodeCharacter{2217}{\point}
  8885. \DeclareUnicodeCharacter{2261}{\equiv}
  8886. }% end of \utfeightchardefs
  8887. % US-ASCII character definitions.
  8888. \def\asciichardefs{% nothing need be done
  8889. \relax
  8890. }
  8891. % Make non-ASCII characters printable again for compatibility with
  8892. % existing Texinfo documents that may use them, even without declaring a
  8893. % document encoding.
  8894. %
  8895. \setnonasciicharscatcode \other
  8896. \message{formatting,}
  8897. \newdimen\defaultparindent \defaultparindent = 15pt
  8898. \chapheadingskip = 15pt plus 4pt minus 2pt
  8899. \secheadingskip = 12pt plus 3pt minus 2pt
  8900. \subsecheadingskip = 9pt plus 2pt minus 2pt
  8901. % Prevent underfull vbox error messages.
  8902. \vbadness = 10000
  8903. % Don't be very finicky about underfull hboxes, either.
  8904. \hbadness = 6666
  8905. % Following George Bush, get rid of widows and orphans.
  8906. \widowpenalty=10000
  8907. \clubpenalty=10000
  8908. % Use TeX 3.0's \emergencystretch to help line breaking, but if we're
  8909. % using an old version of TeX, don't do anything. We want the amount of
  8910. % stretch added to depend on the line length, hence the dependence on
  8911. % \hsize. We call this whenever the paper size is set.
  8912. %
  8913. \def\setemergencystretch{%
  8914. \ifx\emergencystretch\thisisundefined
  8915. % Allow us to assign to \emergencystretch anyway.
  8916. \def\emergencystretch{\dimen0}%
  8917. \else
  8918. \emergencystretch = .15\hsize
  8919. \fi
  8920. }
  8921. % Parameters in order: 1) textheight; 2) textwidth;
  8922. % 3) voffset; 4) hoffset; 5) binding offset; 6) topskip;
  8923. % 7) physical page height; 8) physical page width.
  8924. %
  8925. % We also call \setleading{\textleading}, so the caller should define
  8926. % \textleading. The caller should also set \parskip.
  8927. %
  8928. \def\internalpagesizes#1#2#3#4#5#6#7#8{%
  8929. \voffset = #3\relax
  8930. \topskip = #6\relax
  8931. \splittopskip = \topskip
  8932. %
  8933. \vsize = #1\relax
  8934. \advance\vsize by \topskip
  8935. \outervsize = \vsize
  8936. \advance\outervsize by 2\topandbottommargin
  8937. \pageheight = \vsize
  8938. %
  8939. \hsize = #2\relax
  8940. \outerhsize = \hsize
  8941. \advance\outerhsize by 0.5in
  8942. \pagewidth = \hsize
  8943. %
  8944. \normaloffset = #4\relax
  8945. \bindingoffset = #5\relax
  8946. %
  8947. \ifpdf
  8948. \pdfpageheight #7\relax
  8949. \pdfpagewidth #8\relax
  8950. % if we don't reset these, they will remain at "1 true in" of
  8951. % whatever layout pdftex was dumped with.
  8952. \pdfhorigin = 1 true in
  8953. \pdfvorigin = 1 true in
  8954. \fi
  8955. %
  8956. \setleading{\textleading}
  8957. %
  8958. \parindent = \defaultparindent
  8959. \setemergencystretch
  8960. }
  8961. % @letterpaper (the default).
  8962. \def\letterpaper{{\globaldefs = 1
  8963. \parskip = 3pt plus 2pt minus 1pt
  8964. \textleading = 13.2pt
  8965. %
  8966. % If page is nothing but text, make it come out even.
  8967. \internalpagesizes{607.2pt}{6in}% that's 46 lines
  8968. {\voffset}{.25in}%
  8969. {\bindingoffset}{36pt}%
  8970. {11in}{8.5in}%
  8971. }}
  8972. % Use @smallbook to reset parameters for 7x9.25 trim size.
  8973. \def\smallbook{{\globaldefs = 1
  8974. \parskip = 2pt plus 1pt
  8975. \textleading = 12pt
  8976. %
  8977. \internalpagesizes{7.5in}{5in}%
  8978. {-.2in}{0in}%
  8979. {\bindingoffset}{16pt}%
  8980. {9.25in}{7in}%
  8981. %
  8982. \lispnarrowing = 0.3in
  8983. \tolerance = 700
  8984. \hfuzz = 1pt
  8985. \contentsrightmargin = 0pt
  8986. \defbodyindent = .5cm
  8987. }}
  8988. % Use @smallerbook to reset parameters for 6x9 trim size.
  8989. % (Just testing, parameters still in flux.)
  8990. \def\smallerbook{{\globaldefs = 1
  8991. \parskip = 1.5pt plus 1pt
  8992. \textleading = 12pt
  8993. %
  8994. \internalpagesizes{7.4in}{4.8in}%
  8995. {-.2in}{-.4in}%
  8996. {0pt}{14pt}%
  8997. {9in}{6in}%
  8998. %
  8999. \lispnarrowing = 0.25in
  9000. \tolerance = 700
  9001. \hfuzz = 1pt
  9002. \contentsrightmargin = 0pt
  9003. \defbodyindent = .4cm
  9004. }}
  9005. % Use @afourpaper to print on European A4 paper.
  9006. \def\afourpaper{{\globaldefs = 1
  9007. \parskip = 3pt plus 2pt minus 1pt
  9008. \textleading = 13.2pt
  9009. %
  9010. % Double-side printing via postscript on Laserjet 4050
  9011. % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
  9012. % To change the settings for a different printer or situation, adjust
  9013. % \normaloffset until the front-side and back-side texts align. Then
  9014. % do the same for \bindingoffset. You can set these for testing in
  9015. % your texinfo source file like this:
  9016. % @tex
  9017. % \global\normaloffset = -6mm
  9018. % \global\bindingoffset = 10mm
  9019. % @end tex
  9020. \internalpagesizes{673.2pt}{160mm}% that's 51 lines
  9021. {\voffset}{\hoffset}%
  9022. {\bindingoffset}{44pt}%
  9023. {297mm}{210mm}%
  9024. %
  9025. \tolerance = 700
  9026. \hfuzz = 1pt
  9027. \contentsrightmargin = 0pt
  9028. \defbodyindent = 5mm
  9029. }}
  9030. % Use @afivepaper to print on European A5 paper.
  9031. % From romildo@urano.iceb.ufop.br, 2 July 2000.
  9032. % He also recommends making @example and @lisp be small.
  9033. \def\afivepaper{{\globaldefs = 1
  9034. \parskip = 2pt plus 1pt minus 0.1pt
  9035. \textleading = 12.5pt
  9036. %
  9037. \internalpagesizes{160mm}{120mm}%
  9038. {\voffset}{\hoffset}%
  9039. {\bindingoffset}{8pt}%
  9040. {210mm}{148mm}%
  9041. %
  9042. \lispnarrowing = 0.2in
  9043. \tolerance = 800
  9044. \hfuzz = 1.2pt
  9045. \contentsrightmargin = 0pt
  9046. \defbodyindent = 2mm
  9047. \tableindent = 12mm
  9048. }}
  9049. % A specific text layout, 24x15cm overall, intended for A4 paper.
  9050. \def\afourlatex{{\globaldefs = 1
  9051. \afourpaper
  9052. \internalpagesizes{237mm}{150mm}%
  9053. {\voffset}{4.6mm}%
  9054. {\bindingoffset}{7mm}%
  9055. {297mm}{210mm}%
  9056. %
  9057. % Must explicitly reset to 0 because we call \afourpaper.
  9058. \globaldefs = 0
  9059. }}
  9060. % Use @afourwide to print on A4 paper in landscape format.
  9061. \def\afourwide{{\globaldefs = 1
  9062. \afourpaper
  9063. \internalpagesizes{241mm}{165mm}%
  9064. {\voffset}{-2.95mm}%
  9065. {\bindingoffset}{7mm}%
  9066. {297mm}{210mm}%
  9067. \globaldefs = 0
  9068. }}
  9069. % @pagesizes TEXTHEIGHT[,TEXTWIDTH]
  9070. % Perhaps we should allow setting the margins, \topskip, \parskip,
  9071. % and/or leading, also. Or perhaps we should compute them somehow.
  9072. %
  9073. \parseargdef\pagesizes{\pagesizesyyy #1,,\finish}
  9074. \def\pagesizesyyy#1,#2,#3\finish{{%
  9075. \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
  9076. \globaldefs = 1
  9077. %
  9078. \parskip = 3pt plus 2pt minus 1pt
  9079. \setleading{\textleading}%
  9080. %
  9081. \dimen0 = #1\relax
  9082. \advance\dimen0 by \voffset
  9083. %
  9084. \dimen2 = \hsize
  9085. \advance\dimen2 by \normaloffset
  9086. %
  9087. \internalpagesizes{#1}{\hsize}%
  9088. {\voffset}{\normaloffset}%
  9089. {\bindingoffset}{44pt}%
  9090. {\dimen0}{\dimen2}%
  9091. }}
  9092. % Set default to letter.
  9093. %
  9094. \letterpaper
  9095. \message{and turning on texinfo input format.}
  9096. \def^^L{\par} % remove \outer, so ^L can appear in an @comment
  9097. % DEL is a comment character, in case @c does not suffice.
  9098. \catcode`\^^? = 14
  9099. % Define macros to output various characters with catcode for normal text.
  9100. \catcode`\"=\other \def\normaldoublequote{"}
  9101. \catcode`\$=\other \def\normaldollar{$}%$ font-lock fix
  9102. \catcode`\+=\other \def\normalplus{+}
  9103. \catcode`\<=\other \def\normalless{<}
  9104. \catcode`\>=\other \def\normalgreater{>}
  9105. \catcode`\^=\other \def\normalcaret{^}
  9106. \catcode`\_=\other \def\normalunderscore{_}
  9107. \catcode`\|=\other \def\normalverticalbar{|}
  9108. \catcode`\~=\other \def\normaltilde{~}
  9109. % This macro is used to make a character print one way in \tt
  9110. % (where it can probably be output as-is), and another way in other fonts,
  9111. % where something hairier probably needs to be done.
  9112. %
  9113. % #1 is what to print if we are indeed using \tt; #2 is what to print
  9114. % otherwise. Since all the Computer Modern typewriter fonts have zero
  9115. % interword stretch (and shrink), and it is reasonable to expect all
  9116. % typewriter fonts to have this, we can check that font parameter.
  9117. %
  9118. \def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
  9119. % Same as above, but check for italic font. Actually this also catches
  9120. % non-italic slanted fonts since it is impossible to distinguish them from
  9121. % italic fonts. But since this is only used by $ and it uses \sl anyway
  9122. % this is not a problem.
  9123. \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
  9124. % Turn off all special characters except @
  9125. % (and those which the user can use as if they were ordinary).
  9126. % Most of these we simply print from the \tt font, but for some, we can
  9127. % use math or other variants that look better in normal text.
  9128. \catcode`\"=\active
  9129. \def\activedoublequote{{\tt\char34}}
  9130. \let"=\activedoublequote
  9131. \catcode`\~=\active
  9132. \def~{{\tt\char126}}
  9133. \chardef\hat=`\^
  9134. \catcode`\^=\active
  9135. \def^{{\tt \hat}}
  9136. \catcode`\_=\active
  9137. \def_{\ifusingtt\normalunderscore\_}
  9138. \let\realunder=_
  9139. % Subroutine for the previous macro.
  9140. \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
  9141. \catcode`\|=\active
  9142. \def|{{\tt\char124}}
  9143. \chardef \less=`\<
  9144. \catcode`\<=\active
  9145. \def<{{\tt \less}}
  9146. \chardef \gtr=`\>
  9147. \catcode`\>=\active
  9148. \def>{{\tt \gtr}}
  9149. \catcode`\+=\active
  9150. \def+{{\tt \char 43}}
  9151. \catcode`\$=\active
  9152. \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
  9153. % If a .fmt file is being used, characters that might appear in a file
  9154. % name cannot be active until we have parsed the command line.
  9155. % So turn them off again, and have \everyjob (or @setfilename) turn them on.
  9156. % \otherifyactive is called near the end of this file.
  9157. \def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
  9158. % Used sometimes to turn off (effectively) the active characters even after
  9159. % parsing them.
  9160. \def\turnoffactive{%
  9161. \normalturnoffactive
  9162. \otherbackslash
  9163. }
  9164. \catcode`\@=0
  9165. % \backslashcurfont outputs one backslash character in current font,
  9166. % as in \char`\\.
  9167. \global\chardef\backslashcurfont=`\\
  9168. \global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work
  9169. % \realbackslash is an actual character `\' with catcode other, and
  9170. % \doublebackslash is two of them (for the pdf outlines).
  9171. {\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}}
  9172. % In texinfo, backslash is an active character; it prints the backslash
  9173. % in fixed width font.
  9174. \catcode`\\=\active % @ for escape char from now on.
  9175. % The story here is that in math mode, the \char of \backslashcurfont
  9176. % ends up printing the roman \ from the math symbol font (because \char
  9177. % in math mode uses the \mathcode, and plain.tex sets
  9178. % \mathcode`\\="026E). It seems better for @backslashchar{} to always
  9179. % print a typewriter backslash, hence we use an explicit \mathchar,
  9180. % which is the decimal equivalent of "715c (class 7, e.g., use \fam;
  9181. % ignored family value; char position "5C). We can't use " for the
  9182. % usual hex value because it has already been made active.
  9183. @def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}}
  9184. @let@backslashchar = @normalbackslash % @backslashchar{} is for user documents.
  9185. % On startup, @fixbackslash assigns:
  9186. % @let \ = @normalbackslash
  9187. % \rawbackslash defines an active \ to do \backslashcurfont.
  9188. % \otherbackslash defines an active \ to be a literal `\' character with
  9189. % catcode other. We switch back and forth between these.
  9190. @gdef@rawbackslash{@let\=@backslashcurfont}
  9191. @gdef@otherbackslash{@let\=@realbackslash}
  9192. % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
  9193. % the literal character `\'.
  9194. %
  9195. @def@normalturnoffactive{%
  9196. @let"=@normaldoublequote
  9197. @let$=@normaldollar %$ font-lock fix
  9198. @let+=@normalplus
  9199. @let<=@normalless
  9200. @let>=@normalgreater
  9201. @let\=@normalbackslash
  9202. @let^=@normalcaret
  9203. @let_=@normalunderscore
  9204. @let|=@normalverticalbar
  9205. @let~=@normaltilde
  9206. @markupsetuplqdefault
  9207. @markupsetuprqdefault
  9208. @unsepspaces
  9209. }
  9210. % Make _ and + \other characters, temporarily.
  9211. % This is canceled by @fixbackslash.
  9212. @otherifyactive
  9213. % If a .fmt file is being used, we don't want the `\input texinfo' to show up.
  9214. % That is what \eatinput is for; after that, the `\' should revert to printing
  9215. % a backslash.
  9216. %
  9217. @gdef@eatinput input texinfo{@fixbackslash}
  9218. @global@let\ = @eatinput
  9219. % On the other hand, perhaps the file did not have a `\input texinfo'. Then
  9220. % the first `\' in the file would cause an error. This macro tries to fix
  9221. % that, assuming it is called before the first `\' could plausibly occur.
  9222. % Also turn back on active characters that might appear in the input
  9223. % file name, in case not using a pre-dumped format.
  9224. %
  9225. @gdef@fixbackslash{%
  9226. @ifx\@eatinput @let\ = @normalbackslash @fi
  9227. @catcode`+=@active
  9228. @catcode`@_=@active
  9229. }
  9230. % Say @foo, not \foo, in error messages.
  9231. @escapechar = `@@
  9232. % These (along with & and #) are made active for url-breaking, so need
  9233. % active definitions as the normal characters.
  9234. @def@normaldot{.}
  9235. @def@normalquest{?}
  9236. @def@normalslash{/}
  9237. % These look ok in all fonts, so just make them not special.
  9238. % @hashchar{} gets its own user-level command, because of #line.
  9239. @catcode`@& = @other @def@normalamp{&}
  9240. @catcode`@# = @other @def@normalhash{#}
  9241. @catcode`@% = @other @def@normalpercent{%}
  9242. @let @hashchar = @normalhash
  9243. @c Finally, make ` and ' active, so that txicodequoteundirected and
  9244. @c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we
  9245. @c don't make ` and ' active, @code will not get them as active chars.
  9246. @c Do this last of all since we use ` in the previous @catcode assignments.
  9247. @catcode`@'=@active
  9248. @catcode`@`=@active
  9249. @markupsetuplqdefault
  9250. @markupsetuprqdefault
  9251. @c Local variables:
  9252. @c eval: (add-hook 'write-file-hooks 'time-stamp)
  9253. @c page-delimiter: "^\\\\message"
  9254. @c time-stamp-start: "def\\\\texinfoversion{"
  9255. @c time-stamp-format: "%:y-%02m-%02d.%02H"
  9256. @c time-stamp-end: "}"
  9257. @c End:
  9258. @c vim:sw=2:
  9259. @ignore
  9260. arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115
  9261. @end ignore