texinfo.tex 308 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873
  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{2011-09-23.09}
  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 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\putwordfile\undefined \gdef\putwordfile{file}\fi
  111. \ifx\putwordin\undefined \gdef\putwordin{in}\fi
  112. \ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
  113. \ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
  114. \ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
  115. \ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
  116. \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
  117. \ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi
  118. \ifx\putwordof\undefined \gdef\putwordof{of}\fi
  119. \ifx\putwordon\undefined \gdef\putwordon{on}\fi
  120. \ifx\putwordpage\undefined \gdef\putwordpage{page}\fi
  121. \ifx\putwordsection\undefined \gdef\putwordsection{section}\fi
  122. \ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi
  123. \ifx\putwordsee\undefined \gdef\putwordsee{see}\fi
  124. \ifx\putwordSee\undefined \gdef\putwordSee{See}\fi
  125. \ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi
  126. \ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi
  127. %
  128. \ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
  129. \ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
  130. \ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
  131. \ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
  132. \ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
  133. \ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
  134. \ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
  135. \ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
  136. \ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
  137. \ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
  138. \ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
  139. \ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
  140. %
  141. \ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi
  142. \ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi
  143. \ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi
  144. \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
  145. \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
  146. % Since the category of space is not known, we have to be careful.
  147. \chardef\spacecat = 10
  148. \def\spaceisspace{\catcode`\ =\spacecat}
  149. % sometimes characters are active, so we need control sequences.
  150. \chardef\ampChar = `\&
  151. \chardef\colonChar = `\:
  152. \chardef\commaChar = `\,
  153. \chardef\dashChar = `\-
  154. \chardef\dotChar = `\.
  155. \chardef\exclamChar= `\!
  156. \chardef\hashChar = `\#
  157. \chardef\lquoteChar= `\`
  158. \chardef\questChar = `\?
  159. \chardef\rquoteChar= `\'
  160. \chardef\semiChar = `\;
  161. \chardef\slashChar = `\/
  162. \chardef\underChar = `\_
  163. % Ignore a token.
  164. %
  165. \def\gobble#1{}
  166. % The following is used inside several \edef's.
  167. \def\makecsname#1{\expandafter\noexpand\csname#1\endcsname}
  168. % Hyphenation fixes.
  169. \hyphenation{
  170. Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script
  171. ap-pen-dix bit-map bit-maps
  172. data-base data-bases eshell fall-ing half-way long-est man-u-script
  173. man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm
  174. par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces
  175. spell-ing spell-ings
  176. stand-alone strong-est time-stamp time-stamps which-ever white-space
  177. wide-spread wrap-around
  178. }
  179. % Margin to add to right of even pages, to left of odd pages.
  180. \newdimen\bindingoffset
  181. \newdimen\normaloffset
  182. \newdimen\pagewidth \newdimen\pageheight
  183. % For a final copy, take out the rectangles
  184. % that mark overfull boxes (in case you have decided
  185. % that the text looks ok even though it passes the margin).
  186. %
  187. \def\finalout{\overfullrule=0pt }
  188. % Sometimes it is convenient to have everything in the transcript file
  189. % and nothing on the terminal. We don't just call \tracingall here,
  190. % since that produces some useless output on the terminal. We also make
  191. % some effort to order the tracing commands to reduce output in the log
  192. % file; cf. trace.sty in LaTeX.
  193. %
  194. \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
  195. \def\loggingall{%
  196. \tracingstats2
  197. \tracingpages1
  198. \tracinglostchars2 % 2 gives us more in etex
  199. \tracingparagraphs1
  200. \tracingoutput1
  201. \tracingmacros2
  202. \tracingrestores1
  203. \showboxbreadth\maxdimen \showboxdepth\maxdimen
  204. \ifx\eTeXversion\thisisundefined\else % etex gives us more logging
  205. \tracingscantokens1
  206. \tracingifs1
  207. \tracinggroups1
  208. \tracingnesting2
  209. \tracingassigns1
  210. \fi
  211. \tracingcommands3 % 3 gives us more in etex
  212. \errorcontextlines16
  213. }%
  214. % add check for \lastpenalty to plain's definitions. If the last thing
  215. % we did was a \nobreak, we don't want to insert more space.
  216. %
  217. \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
  218. \removelastskip\penalty-50\smallskip\fi\fi}
  219. \def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
  220. \removelastskip\penalty-100\medskip\fi\fi}
  221. \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
  222. \removelastskip\penalty-200\bigskip\fi\fi}
  223. % Do @cropmarks to get crop marks.
  224. %
  225. \newif\ifcropmarks
  226. \let\cropmarks = \cropmarkstrue
  227. %
  228. % Dimensions to add cropmarks at corners.
  229. % Added by P. A. MacKay, 12 Nov. 1986
  230. %
  231. \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
  232. \newdimen\cornerlong \cornerlong=1pc
  233. \newdimen\cornerthick \cornerthick=.3pt
  234. \newdimen\topandbottommargin \topandbottommargin=.75in
  235. % Output a mark which sets \thischapter, \thissection and \thiscolor.
  236. % We dump everything together because we only have one kind of mark.
  237. % This works because we only use \botmark / \topmark, not \firstmark.
  238. %
  239. % A mark contains a subexpression of the \ifcase ... \fi construct.
  240. % \get*marks macros below extract the needed part using \ifcase.
  241. %
  242. % Another complication is to let the user choose whether \thischapter
  243. % (\thissection) refers to the chapter (section) in effect at the top
  244. % of a page, or that at the bottom of a page. The solution is
  245. % described on page 260 of The TeXbook. It involves outputting two
  246. % marks for the sectioning macros, one before the section break, and
  247. % one after. I won't pretend I can describe this better than DEK...
  248. \def\domark{%
  249. \toks0=\expandafter{\lastchapterdefs}%
  250. \toks2=\expandafter{\lastsectiondefs}%
  251. \toks4=\expandafter{\prevchapterdefs}%
  252. \toks6=\expandafter{\prevsectiondefs}%
  253. \toks8=\expandafter{\lastcolordefs}%
  254. \mark{%
  255. \the\toks0 \the\toks2
  256. \noexpand\or \the\toks4 \the\toks6
  257. \noexpand\else \the\toks8
  258. }%
  259. }
  260. % \topmark doesn't work for the very first chapter (after the title
  261. % page or the contents), so we use \firstmark there -- this gets us
  262. % the mark with the chapter defs, unless the user sneaks in, e.g.,
  263. % @setcolor (or @url, or @link, etc.) between @contents and the very
  264. % first @chapter.
  265. \def\gettopheadingmarks{%
  266. \ifcase0\topmark\fi
  267. \ifx\thischapter\empty \ifcase0\firstmark\fi \fi
  268. }
  269. \def\getbottomheadingmarks{\ifcase1\botmark\fi}
  270. \def\getcolormarks{\ifcase2\topmark\fi}
  271. % Avoid "undefined control sequence" errors.
  272. \def\lastchapterdefs{}
  273. \def\lastsectiondefs{}
  274. \def\prevchapterdefs{}
  275. \def\prevsectiondefs{}
  276. \def\lastcolordefs{}
  277. % Main output routine.
  278. \chardef\PAGE = 255
  279. \output = {\onepageout{\pagecontents\PAGE}}
  280. \newbox\headlinebox
  281. \newbox\footlinebox
  282. % \onepageout takes a vbox as an argument. Note that \pagecontents
  283. % does insertions, but you have to call it yourself.
  284. \def\onepageout#1{%
  285. \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
  286. %
  287. \ifodd\pageno \advance\hoffset by \bindingoffset
  288. \else \advance\hoffset by -\bindingoffset\fi
  289. %
  290. % Do this outside of the \shipout so @code etc. will be expanded in
  291. % the headline as they should be, not taken literally (outputting ''code).
  292. \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
  293. \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
  294. \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
  295. \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
  296. %
  297. {%
  298. % Have to do this stuff outside the \shipout because we want it to
  299. % take effect in \write's, yet the group defined by the \vbox ends
  300. % before the \shipout runs.
  301. %
  302. \indexdummies % don't expand commands in the output.
  303. \normalturnoffactive % \ in index entries must not stay \, e.g., if
  304. % the page break happens to be in the middle of an example.
  305. % We don't want .vr (or whatever) entries like this:
  306. % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}}
  307. % "\acronym" won't work when it's read back in;
  308. % it needs to be
  309. % {\code {{\tt \backslashcurfont }acronym}
  310. \shipout\vbox{%
  311. % Do this early so pdf references go to the beginning of the page.
  312. \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
  313. %
  314. \ifcropmarks \vbox to \outervsize\bgroup
  315. \hsize = \outerhsize
  316. \vskip-\topandbottommargin
  317. \vtop to0pt{%
  318. \line{\ewtop\hfil\ewtop}%
  319. \nointerlineskip
  320. \line{%
  321. \vbox{\moveleft\cornerthick\nstop}%
  322. \hfill
  323. \vbox{\moveright\cornerthick\nstop}%
  324. }%
  325. \vss}%
  326. \vskip\topandbottommargin
  327. \line\bgroup
  328. \hfil % center the page within the outer (page) hsize.
  329. \ifodd\pageno\hskip\bindingoffset\fi
  330. \vbox\bgroup
  331. \fi
  332. %
  333. \unvbox\headlinebox
  334. \pagebody{#1}%
  335. \ifdim\ht\footlinebox > 0pt
  336. % Only leave this space if the footline is nonempty.
  337. % (We lessened \vsize for it in \oddfootingyyy.)
  338. % The \baselineskip=24pt in plain's \makefootline has no effect.
  339. \vskip 24pt
  340. \unvbox\footlinebox
  341. \fi
  342. %
  343. \ifcropmarks
  344. \egroup % end of \vbox\bgroup
  345. \hfil\egroup % end of (centering) \line\bgroup
  346. \vskip\topandbottommargin plus1fill minus1fill
  347. \boxmaxdepth = \cornerthick
  348. \vbox to0pt{\vss
  349. \line{%
  350. \vbox{\moveleft\cornerthick\nsbot}%
  351. \hfill
  352. \vbox{\moveright\cornerthick\nsbot}%
  353. }%
  354. \nointerlineskip
  355. \line{\ewbot\hfil\ewbot}%
  356. }%
  357. \egroup % \vbox from first cropmarks clause
  358. \fi
  359. }% end of \shipout\vbox
  360. }% end of group with \indexdummies
  361. \advancepageno
  362. \ifnum\outputpenalty>-20000 \else\dosupereject\fi
  363. }
  364. \newinsert\margin \dimen\margin=\maxdimen
  365. \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
  366. {\catcode`\@ =11
  367. \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
  368. % marginal hacks, juha@viisa.uucp (Juha Takala)
  369. \ifvoid\margin\else % marginal info is present
  370. \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
  371. \dimen@=\dp#1\relax \unvbox#1\relax
  372. \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
  373. \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
  374. }
  375. % Here are the rules for the cropmarks. Note that they are
  376. % offset so that the space between them is truly \outerhsize or \outervsize
  377. % (P. A. MacKay, 12 November, 1986)
  378. %
  379. \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
  380. \def\nstop{\vbox
  381. {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
  382. \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
  383. \def\nsbot{\vbox
  384. {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
  385. % Parse an argument, then pass it to #1. The argument is the rest of
  386. % the input line (except we remove a trailing comment). #1 should be a
  387. % macro which expects an ordinary undelimited TeX argument.
  388. %
  389. \def\parsearg{\parseargusing{}}
  390. \def\parseargusing#1#2{%
  391. \def\argtorun{#2}%
  392. \begingroup
  393. \obeylines
  394. \spaceisspace
  395. #1%
  396. \parseargline\empty% Insert the \empty token, see \finishparsearg below.
  397. }
  398. {\obeylines %
  399. \gdef\parseargline#1^^M{%
  400. \endgroup % End of the group started in \parsearg.
  401. \argremovecomment #1\comment\ArgTerm%
  402. }%
  403. }
  404. % First remove any @comment, then any @c comment.
  405. \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
  406. \def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
  407. % Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space.
  408. %
  409. % \argremovec might leave us with trailing space, e.g.,
  410. % @end itemize @c foo
  411. % This space token undergoes the same procedure and is eventually removed
  412. % by \finishparsearg.
  413. %
  414. \def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M}
  415. \def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M}
  416. \def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
  417. \def\temp{#3}%
  418. \ifx\temp\empty
  419. % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp:
  420. \let\temp\finishparsearg
  421. \else
  422. \let\temp\argcheckspaces
  423. \fi
  424. % Put the space token in:
  425. \temp#1 #3\ArgTerm
  426. }
  427. % If a _delimited_ argument is enclosed in braces, they get stripped; so
  428. % to get _exactly_ the rest of the line, we had to prevent such situation.
  429. % We prepended an \empty token at the very beginning and we expand it now,
  430. % just before passing the control to \argtorun.
  431. % (Similarly, we have to think about #3 of \argcheckspacesY above: it is
  432. % either the null string, or it ends with \^^M---thus there is no danger
  433. % that a pair of braces would be stripped.
  434. %
  435. % But first, we have to remove the trailing space token.
  436. %
  437. \def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}}
  438. % \parseargdef\foo{...}
  439. % is roughly equivalent to
  440. % \def\foo{\parsearg\Xfoo}
  441. % \def\Xfoo#1{...}
  442. %
  443. % Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my
  444. % favourite TeX trick. --kasal, 16nov03
  445. \def\parseargdef#1{%
  446. \expandafter \doparseargdef \csname\string#1\endcsname #1%
  447. }
  448. \def\doparseargdef#1#2{%
  449. \def#2{\parsearg#1}%
  450. \def#1##1%
  451. }
  452. % Several utility definitions with active space:
  453. {
  454. \obeyspaces
  455. \gdef\obeyedspace{ }
  456. % Make each space character in the input produce a normal interword
  457. % space in the output. Don't allow a line break at this space, as this
  458. % is used only in environments like @example, where each line of input
  459. % should produce a line of output anyway.
  460. %
  461. \gdef\sepspaces{\obeyspaces\let =\tie}
  462. % If an index command is used in an @example environment, any spaces
  463. % therein should become regular spaces in the raw index file, not the
  464. % expansion of \tie (\leavevmode \penalty \@M \ ).
  465. \gdef\unsepspaces{\let =\space}
  466. }
  467. \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
  468. % Define the framework for environments in texinfo.tex. It's used like this:
  469. %
  470. % \envdef\foo{...}
  471. % \def\Efoo{...}
  472. %
  473. % It's the responsibility of \envdef to insert \begingroup before the
  474. % actual body; @end closes the group after calling \Efoo. \envdef also
  475. % defines \thisenv, so the current environment is known; @end checks
  476. % whether the environment name matches. The \checkenv macro can also be
  477. % used to check whether the current environment is the one expected.
  478. %
  479. % Non-false conditionals (@iftex, @ifset) don't fit into this, so they
  480. % are not treated as environments; they don't open a group. (The
  481. % implementation of @end takes care not to call \endgroup in this
  482. % special case.)
  483. % At run-time, environments start with this:
  484. \def\startenvironment#1{\begingroup\def\thisenv{#1}}
  485. % initialize
  486. \let\thisenv\empty
  487. % ... but they get defined via ``\envdef\foo{...}'':
  488. \long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
  489. \def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
  490. % Check whether we're in the right environment:
  491. \def\checkenv#1{%
  492. \def\temp{#1}%
  493. \ifx\thisenv\temp
  494. \else
  495. \badenverr
  496. \fi
  497. }
  498. % Environment mismatch, #1 expected:
  499. \def\badenverr{%
  500. \errhelp = \EMsimple
  501. \errmessage{This command can appear only \inenvironment\temp,
  502. not \inenvironment\thisenv}%
  503. }
  504. \def\inenvironment#1{%
  505. \ifx#1\empty
  506. outside of any environment%
  507. \else
  508. in environment \expandafter\string#1%
  509. \fi
  510. }
  511. % @end foo executes the definition of \Efoo.
  512. % But first, it executes a specialized version of \checkenv
  513. %
  514. \parseargdef\end{%
  515. \if 1\csname iscond.#1\endcsname
  516. \else
  517. % The general wording of \badenverr may not be ideal.
  518. \expandafter\checkenv\csname#1\endcsname
  519. \csname E#1\endcsname
  520. \endgroup
  521. \fi
  522. }
  523. \newhelp\EMsimple{Press RETURN to continue.}
  524. % Be sure we're in horizontal mode when doing a tie, since we make space
  525. % equivalent to this in @example-like environments. Otherwise, a space
  526. % at the beginning of a line will start with \penalty -- and
  527. % since \penalty is valid in vertical mode, we'd end up putting the
  528. % penalty on the vertical list instead of in the new paragraph.
  529. {\catcode`@ = 11
  530. % Avoid using \@M directly, because that causes trouble
  531. % if the definition is written into an index file.
  532. \global\let\tiepenalty = \@M
  533. \gdef\tie{\leavevmode\penalty\tiepenalty\ }
  534. }
  535. % @: forces normal size whitespace following.
  536. \def\:{\spacefactor=1000 }
  537. % @* forces a line break.
  538. \def\*{\hfil\break\hbox{}\ignorespaces}
  539. % @/ allows a line break.
  540. \let\/=\allowbreak
  541. % @. is an end-of-sentence period.
  542. \def\.{.\spacefactor=\endofsentencespacefactor\space}
  543. % @! is an end-of-sentence bang.
  544. \def\!{!\spacefactor=\endofsentencespacefactor\space}
  545. % @? is an end-of-sentence query.
  546. \def\?{?\spacefactor=\endofsentencespacefactor\space}
  547. % @frenchspacing on|off says whether to put extra space after punctuation.
  548. %
  549. \def\onword{on}
  550. \def\offword{off}
  551. %
  552. \parseargdef\frenchspacing{%
  553. \def\temp{#1}%
  554. \ifx\temp\onword \plainfrenchspacing
  555. \else\ifx\temp\offword \plainnonfrenchspacing
  556. \else
  557. \errhelp = \EMsimple
  558. \errmessage{Unknown @frenchspacing option `\temp', must be on|off}%
  559. \fi\fi
  560. }
  561. % @w prevents a word break. Without the \leavevmode, @w at the
  562. % beginning of a paragraph, when TeX is still in vertical mode, would
  563. % produce a whole line of output instead of starting the paragraph.
  564. \def\w#1{\leavevmode\hbox{#1}}
  565. % @group ... @end group forces ... to be all on one page, by enclosing
  566. % it in a TeX vbox. We use \vtop instead of \vbox to construct the box
  567. % to keep its height that of a normal line. According to the rules for
  568. % \topskip (p.114 of the TeXbook), the glue inserted is
  569. % max (\topskip - \ht (first item), 0). If that height is large,
  570. % therefore, no glue is inserted, and the space between the headline and
  571. % the text is small, which looks bad.
  572. %
  573. % Another complication is that the group might be very large. This can
  574. % cause the glue on the previous page to be unduly stretched, because it
  575. % does not have much material. In this case, it's better to add an
  576. % explicit \vfill so that the extra space is at the bottom. The
  577. % threshold for doing this is if the group is more than \vfilllimit
  578. % percent of a page (\vfilllimit can be changed inside of @tex).
  579. %
  580. \newbox\groupbox
  581. \def\vfilllimit{0.7}
  582. %
  583. \envdef\group{%
  584. \ifnum\catcode`\^^M=\active \else
  585. \errhelp = \groupinvalidhelp
  586. \errmessage{@group invalid in context where filling is enabled}%
  587. \fi
  588. \startsavinginserts
  589. %
  590. \setbox\groupbox = \vtop\bgroup
  591. % Do @comment since we are called inside an environment such as
  592. % @example, where each end-of-line in the input causes an
  593. % end-of-line in the output. We don't want the end-of-line after
  594. % the `@group' to put extra space in the output. Since @group
  595. % should appear on a line by itself (according to the Texinfo
  596. % manual), we don't worry about eating any user text.
  597. \comment
  598. }
  599. %
  600. % The \vtop produces a box with normal height and large depth; thus, TeX puts
  601. % \baselineskip glue before it, and (when the next line of text is done)
  602. % \lineskip glue after it. Thus, space below is not quite equal to space
  603. % above. But it's pretty close.
  604. \def\Egroup{%
  605. % To get correct interline space between the last line of the group
  606. % and the first line afterwards, we have to propagate \prevdepth.
  607. \endgraf % Not \par, as it may have been set to \lisppar.
  608. \global\dimen1 = \prevdepth
  609. \egroup % End the \vtop.
  610. % \dimen0 is the vertical size of the group's box.
  611. \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox
  612. % \dimen2 is how much space is left on the page (more or less).
  613. \dimen2 = \pageheight \advance\dimen2 by -\pagetotal
  614. % if the group doesn't fit on the current page, and it's a big big
  615. % group, force a page break.
  616. \ifdim \dimen0 > \dimen2
  617. \ifdim \pagetotal < \vfilllimit\pageheight
  618. \page
  619. \fi
  620. \fi
  621. \box\groupbox
  622. \prevdepth = \dimen1
  623. \checkinserts
  624. }
  625. %
  626. % TeX puts in an \escapechar (i.e., `@') at the beginning of the help
  627. % message, so this ends up printing `@group can only ...'.
  628. %
  629. \newhelp\groupinvalidhelp{%
  630. group can only be used in environments such as @example,^^J%
  631. where each line of input produces a line of output.}
  632. % @need space-in-mils
  633. % forces a page break if there is not space-in-mils remaining.
  634. \newdimen\mil \mil=0.001in
  635. \parseargdef\need{%
  636. % Ensure vertical mode, so we don't make a big box in the middle of a
  637. % paragraph.
  638. \par
  639. %
  640. % If the @need value is less than one line space, it's useless.
  641. \dimen0 = #1\mil
  642. \dimen2 = \ht\strutbox
  643. \advance\dimen2 by \dp\strutbox
  644. \ifdim\dimen0 > \dimen2
  645. %
  646. % Do a \strut just to make the height of this box be normal, so the
  647. % normal leading is inserted relative to the preceding line.
  648. % And a page break here is fine.
  649. \vtop to #1\mil{\strut\vfil}%
  650. %
  651. % TeX does not even consider page breaks if a penalty added to the
  652. % main vertical list is 10000 or more. But in order to see if the
  653. % empty box we just added fits on the page, we must make it consider
  654. % page breaks. On the other hand, we don't want to actually break the
  655. % page after the empty box. So we use a penalty of 9999.
  656. %
  657. % There is an extremely small chance that TeX will actually break the
  658. % page at this \penalty, if there are no other feasible breakpoints in
  659. % sight. (If the user is using lots of big @group commands, which
  660. % almost-but-not-quite fill up a page, TeX will have a hard time doing
  661. % good page breaking, for example.) However, I could not construct an
  662. % example where a page broke at this \penalty; if it happens in a real
  663. % document, then we can reconsider our strategy.
  664. \penalty9999
  665. %
  666. % Back up by the size of the box, whether we did a page break or not.
  667. \kern -#1\mil
  668. %
  669. % Do not allow a page break right after this kern.
  670. \nobreak
  671. \fi
  672. }
  673. % @br forces paragraph break (and is undocumented).
  674. \let\br = \par
  675. % @page forces the start of a new page.
  676. %
  677. \def\page{\par\vfill\supereject}
  678. % @exdent text....
  679. % outputs text on separate line in roman font, starting at standard page margin
  680. % This records the amount of indent in the innermost environment.
  681. % That's how much \exdent should take out.
  682. \newskip\exdentamount
  683. % This defn is used inside fill environments such as @defun.
  684. \parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
  685. % This defn is used inside nofill environments such as @example.
  686. \parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount
  687. \leftline{\hskip\leftskip{\rm#1}}}}
  688. % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
  689. % paragraph. For more general purposes, use the \margin insertion
  690. % class. WHICH is `l' or `r'. Not documented, written for gawk manual.
  691. %
  692. \newskip\inmarginspacing \inmarginspacing=1cm
  693. \def\strutdepth{\dp\strutbox}
  694. %
  695. \def\doinmargin#1#2{\strut\vadjust{%
  696. \nobreak
  697. \kern-\strutdepth
  698. \vtop to \strutdepth{%
  699. \baselineskip=\strutdepth
  700. \vss
  701. % if you have multiple lines of stuff to put here, you'll need to
  702. % make the vbox yourself of the appropriate size.
  703. \ifx#1l%
  704. \llap{\ignorespaces #2\hskip\inmarginspacing}%
  705. \else
  706. \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
  707. \fi
  708. \null
  709. }%
  710. }}
  711. \def\inleftmargin{\doinmargin l}
  712. \def\inrightmargin{\doinmargin r}
  713. %
  714. % @inmargin{TEXT [, RIGHT-TEXT]}
  715. % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
  716. % else use TEXT for both).
  717. %
  718. \def\inmargin#1{\parseinmargin #1,,\finish}
  719. \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
  720. \setbox0 = \hbox{\ignorespaces #2}%
  721. \ifdim\wd0 > 0pt
  722. \def\lefttext{#1}% have both texts
  723. \def\righttext{#2}%
  724. \else
  725. \def\lefttext{#1}% have only one text
  726. \def\righttext{#1}%
  727. \fi
  728. %
  729. \ifodd\pageno
  730. \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
  731. \else
  732. \def\temp{\inleftmargin\lefttext}%
  733. \fi
  734. \temp
  735. }
  736. % @| inserts a changebar to the left of the current line. It should
  737. % surround any changed text. This approach does *not* work if the
  738. % change spans more than two lines of output. To handle that, we would
  739. % have adopt a much more difficult approach (putting marks into the main
  740. % vertical list for the beginning and end of each change). This command
  741. % is not documented, not supported, and doesn't work.
  742. %
  743. \def\|{%
  744. % \vadjust can only be used in horizontal mode.
  745. \leavevmode
  746. %
  747. % Append this vertical mode material after the current line in the output.
  748. \vadjust{%
  749. % We want to insert a rule with the height and depth of the current
  750. % leading; that is exactly what \strutbox is supposed to record.
  751. \vskip-\baselineskip
  752. %
  753. % \vadjust-items are inserted at the left edge of the type. So
  754. % the \llap here moves out into the left-hand margin.
  755. \llap{%
  756. %
  757. % For a thicker or thinner bar, change the `1pt'.
  758. \vrule height\baselineskip width1pt
  759. %
  760. % This is the space between the bar and the text.
  761. \hskip 12pt
  762. }%
  763. }%
  764. }
  765. % @include FILE -- \input text of FILE.
  766. %
  767. \def\include{\parseargusing\filenamecatcodes\includezzz}
  768. \def\includezzz#1{%
  769. \pushthisfilestack
  770. \def\thisfile{#1}%
  771. {%
  772. \makevalueexpandable % we want to expand any @value in FILE.
  773. \turnoffactive % and allow special characters in the expansion
  774. \indexnofonts % Allow `@@' and other weird things in file names.
  775. \wlog{texinfo.tex: doing @include of #1^^J}%
  776. \edef\temp{\noexpand\input #1 }%
  777. %
  778. % This trickery is to read FILE outside of a group, in case it makes
  779. % definitions, etc.
  780. \expandafter
  781. }\temp
  782. \popthisfilestack
  783. }
  784. \def\filenamecatcodes{%
  785. \catcode`\\=\other
  786. \catcode`~=\other
  787. \catcode`^=\other
  788. \catcode`_=\other
  789. \catcode`|=\other
  790. \catcode`<=\other
  791. \catcode`>=\other
  792. \catcode`+=\other
  793. \catcode`-=\other
  794. \catcode`\`=\other
  795. \catcode`\'=\other
  796. }
  797. \def\pushthisfilestack{%
  798. \expandafter\pushthisfilestackX\popthisfilestack\StackTerm
  799. }
  800. \def\pushthisfilestackX{%
  801. \expandafter\pushthisfilestackY\thisfile\StackTerm
  802. }
  803. \def\pushthisfilestackY #1\StackTerm #2\StackTerm {%
  804. \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}%
  805. }
  806. \def\popthisfilestack{\errthisfilestackempty}
  807. \def\errthisfilestackempty{\errmessage{Internal error:
  808. the stack of filenames is empty.}}
  809. \def\thisfile{}
  810. % @center line
  811. % outputs that line, centered.
  812. %
  813. \parseargdef\center{%
  814. \ifhmode
  815. \let\next\centerH
  816. \else
  817. \let\next\centerV
  818. \fi
  819. \next{\hfil \ignorespaces#1\unskip \hfil}%
  820. }
  821. \def\centerH#1{%
  822. {%
  823. \hfil\break
  824. \advance\hsize by -\leftskip
  825. \advance\hsize by -\rightskip
  826. \line{#1}%
  827. \break
  828. }%
  829. }
  830. \def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}}
  831. % @sp n outputs n lines of vertical space
  832. \parseargdef\sp{\vskip #1\baselineskip}
  833. % @comment ...line which is ignored...
  834. % @c is the same as @comment
  835. % @ignore ... @end ignore is another way to write a comment
  836. \def\comment{\begingroup \catcode`\^^M=\other%
  837. \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
  838. \commentxxx}
  839. {\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
  840. \let\c=\comment
  841. % @paragraphindent NCHARS
  842. % We'll use ems for NCHARS, close enough.
  843. % NCHARS can also be the word `asis' or `none'.
  844. % We cannot feasibly implement @paragraphindent asis, though.
  845. %
  846. \def\asisword{asis} % no translation, these are keywords
  847. \def\noneword{none}
  848. %
  849. \parseargdef\paragraphindent{%
  850. \def\temp{#1}%
  851. \ifx\temp\asisword
  852. \else
  853. \ifx\temp\noneword
  854. \defaultparindent = 0pt
  855. \else
  856. \defaultparindent = #1em
  857. \fi
  858. \fi
  859. \parindent = \defaultparindent
  860. }
  861. % @exampleindent NCHARS
  862. % We'll use ems for NCHARS like @paragraphindent.
  863. % It seems @exampleindent asis isn't necessary, but
  864. % I preserve it to make it similar to @paragraphindent.
  865. \parseargdef\exampleindent{%
  866. \def\temp{#1}%
  867. \ifx\temp\asisword
  868. \else
  869. \ifx\temp\noneword
  870. \lispnarrowing = 0pt
  871. \else
  872. \lispnarrowing = #1em
  873. \fi
  874. \fi
  875. }
  876. % @firstparagraphindent WORD
  877. % If WORD is `none', then suppress indentation of the first paragraph
  878. % after a section heading. If WORD is `insert', then do indent at such
  879. % paragraphs.
  880. %
  881. % The paragraph indentation is suppressed or not by calling
  882. % \suppressfirstparagraphindent, which the sectioning commands do.
  883. % We switch the definition of this back and forth according to WORD.
  884. % By default, we suppress indentation.
  885. %
  886. \def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
  887. \def\insertword{insert}
  888. %
  889. \parseargdef\firstparagraphindent{%
  890. \def\temp{#1}%
  891. \ifx\temp\noneword
  892. \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
  893. \else\ifx\temp\insertword
  894. \let\suppressfirstparagraphindent = \relax
  895. \else
  896. \errhelp = \EMsimple
  897. \errmessage{Unknown @firstparagraphindent option `\temp'}%
  898. \fi\fi
  899. }
  900. % Here is how we actually suppress indentation. Redefine \everypar to
  901. % \kern backwards by \parindent, and then reset itself to empty.
  902. %
  903. % We also make \indent itself not actually do anything until the next
  904. % paragraph.
  905. %
  906. \gdef\dosuppressfirstparagraphindent{%
  907. \gdef\indent{%
  908. \restorefirstparagraphindent
  909. \indent
  910. }%
  911. \gdef\noindent{%
  912. \restorefirstparagraphindent
  913. \noindent
  914. }%
  915. \global\everypar = {%
  916. \kern -\parindent
  917. \restorefirstparagraphindent
  918. }%
  919. }
  920. \gdef\restorefirstparagraphindent{%
  921. \global \let \indent = \ptexindent
  922. \global \let \noindent = \ptexnoindent
  923. \global \everypar = {}%
  924. }
  925. % @refill is a no-op.
  926. \let\refill=\relax
  927. % If working on a large document in chapters, it is convenient to
  928. % be able to disable indexing, cross-referencing, and contents, for test runs.
  929. % This is done with @novalidate (before @setfilename).
  930. %
  931. \newif\iflinks \linkstrue % by default we want the aux files.
  932. \let\novalidate = \linksfalse
  933. % @setfilename is done at the beginning of every texinfo file.
  934. % So open here the files we need to have open while reading the input.
  935. % This makes it possible to make a .fmt file for texinfo.
  936. \def\setfilename{%
  937. \fixbackslash % Turn off hack to swallow `\input texinfo'.
  938. \iflinks
  939. \tryauxfile
  940. % Open the new aux file. TeX will close it automatically at exit.
  941. \immediate\openout\auxfile=\jobname.aux
  942. \fi % \openindices needs to do some work in any case.
  943. \openindices
  944. \let\setfilename=\comment % Ignore extra @setfilename cmds.
  945. %
  946. % If texinfo.cnf is present on the system, read it.
  947. % Useful for site-wide @afourpaper, etc.
  948. \openin 1 texinfo.cnf
  949. \ifeof 1 \else \input texinfo.cnf \fi
  950. \closein 1
  951. %
  952. \comment % Ignore the actual filename.
  953. }
  954. % Called from \setfilename.
  955. %
  956. \def\openindices{%
  957. \newindex{cp}%
  958. \newcodeindex{fn}%
  959. \newcodeindex{vr}%
  960. \newcodeindex{tp}%
  961. \newcodeindex{ky}%
  962. \newcodeindex{pg}%
  963. }
  964. % @bye.
  965. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
  966. \message{pdf,}
  967. % adobe `portable' document format
  968. \newcount\tempnum
  969. \newcount\lnkcount
  970. \newtoks\filename
  971. \newcount\filenamelength
  972. \newcount\pgn
  973. \newtoks\toksA
  974. \newtoks\toksB
  975. \newtoks\toksC
  976. \newtoks\toksD
  977. \newbox\boxA
  978. \newcount\countA
  979. \newif\ifpdf
  980. \newif\ifpdfmakepagedest
  981. % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
  982. % can be set). So we test for \relax and 0 as well as being undefined.
  983. \ifx\pdfoutput\thisisundefined
  984. \else
  985. \ifx\pdfoutput\relax
  986. \else
  987. \ifcase\pdfoutput
  988. \else
  989. \pdftrue
  990. \fi
  991. \fi
  992. \fi
  993. % PDF uses PostScript string constants for the names of xref targets,
  994. % for display in the outlines, and in other places. Thus, we have to
  995. % double any backslashes. Otherwise, a name like "\node" will be
  996. % interpreted as a newline (\n), followed by o, d, e. Not good.
  997. % http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html
  998. % (and related messages, the final outcome is that it is up to the TeX
  999. % user to double the backslashes and otherwise make the string valid, so
  1000. % that's what we do).
  1001. % double active backslashes.
  1002. %
  1003. {\catcode`\@=0 \catcode`\\=\active
  1004. @gdef@activebackslashdouble{%
  1005. @catcode`@\=@active
  1006. @let\=@doublebackslash}
  1007. }
  1008. % To handle parens, we must adopt a different approach, since parens are
  1009. % not active characters. hyperref.dtx (which has the same problem as
  1010. % us) handles it with this amazing macro to replace tokens, with minor
  1011. % changes for Texinfo. It is included here under the GPL by permission
  1012. % from the author, Heiko Oberdiek.
  1013. %
  1014. % #1 is the tokens to replace.
  1015. % #2 is the replacement.
  1016. % #3 is the control sequence with the string.
  1017. %
  1018. \def\HyPsdSubst#1#2#3{%
  1019. \def\HyPsdReplace##1#1##2\END{%
  1020. ##1%
  1021. \ifx\\##2\\%
  1022. \else
  1023. #2%
  1024. \HyReturnAfterFi{%
  1025. \HyPsdReplace##2\END
  1026. }%
  1027. \fi
  1028. }%
  1029. \xdef#3{\expandafter\HyPsdReplace#3#1\END}%
  1030. }
  1031. \long\def\HyReturnAfterFi#1\fi{\fi#1}
  1032. % #1 is a control sequence in which to do the replacements.
  1033. \def\backslashparens#1{%
  1034. \xdef#1{#1}% redefine it as its expansion; the definition is simply
  1035. % \lastnode when called from \setref -> \pdfmkdest.
  1036. \HyPsdSubst{(}{\realbackslash(}{#1}%
  1037. \HyPsdSubst{)}{\realbackslash)}{#1}%
  1038. }
  1039. \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
  1040. with PDF output, and none of those formats could be found. (.eps cannot
  1041. be supported due to the design of the PDF format; use regular TeX (DVI
  1042. output) for that.)}
  1043. \ifpdf
  1044. %
  1045. % Color manipulation macros based on pdfcolor.tex,
  1046. % except using rgb instead of cmyk; the latter is said to render as a
  1047. % very dark gray on-screen and a very dark halftone in print, instead
  1048. % of actual black.
  1049. \def\rgbDarkRed{0.50 0.09 0.12}
  1050. \def\rgbBlack{0 0 0}
  1051. %
  1052. % k sets the color for filling (usual text, etc.);
  1053. % K sets the color for stroking (thin rules, e.g., normal _'s).
  1054. \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}}
  1055. %
  1056. % Set color, and create a mark which defines \thiscolor accordingly,
  1057. % so that \makeheadline knows which color to restore.
  1058. \def\setcolor#1{%
  1059. \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}%
  1060. \domark
  1061. \pdfsetcolor{#1}%
  1062. }
  1063. %
  1064. \def\maincolor{\rgbBlack}
  1065. \pdfsetcolor{\maincolor}
  1066. \edef\thiscolor{\maincolor}
  1067. \def\lastcolordefs{}
  1068. %
  1069. \def\makefootline{%
  1070. \baselineskip24pt
  1071. \line{\pdfsetcolor{\maincolor}\the\footline}%
  1072. }
  1073. %
  1074. \def\makeheadline{%
  1075. \vbox to 0pt{%
  1076. \vskip-22.5pt
  1077. \line{%
  1078. \vbox to8.5pt{}%
  1079. % Extract \thiscolor definition from the marks.
  1080. \getcolormarks
  1081. % Typeset the headline with \maincolor, then restore the color.
  1082. \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
  1083. }%
  1084. \vss
  1085. }%
  1086. \nointerlineskip
  1087. }
  1088. %
  1089. %
  1090. \pdfcatalog{/PageMode /UseOutlines}
  1091. %
  1092. % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
  1093. \def\dopdfimage#1#2#3{%
  1094. \def\imagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
  1095. \def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
  1096. %
  1097. % pdftex (and the PDF format) support .png, .jpg, .pdf (among
  1098. % others). Let's try in that order.
  1099. \let\pdfimgext=\empty
  1100. \begingroup
  1101. \openin 1 #1.png \ifeof 1
  1102. \openin 1 #1.jpg \ifeof 1
  1103. \openin 1 #1.jpeg \ifeof 1
  1104. \openin 1 #1.JPG \ifeof 1
  1105. \openin 1 #1.pdf \ifeof 1
  1106. \openin 1 #1.PDF \ifeof 1
  1107. \errhelp = \nopdfimagehelp
  1108. \errmessage{Could not find image file #1 for pdf}%
  1109. \else \gdef\pdfimgext{PDF}%
  1110. \fi
  1111. \else \gdef\pdfimgext{pdf}%
  1112. \fi
  1113. \else \gdef\pdfimgext{JPG}%
  1114. \fi
  1115. \else \gdef\pdfimgext{jpeg}%
  1116. \fi
  1117. \else \gdef\pdfimgext{jpg}%
  1118. \fi
  1119. \else \gdef\pdfimgext{png}%
  1120. \fi
  1121. \closein 1
  1122. \endgroup
  1123. %
  1124. % without \immediate, ancient pdftex seg faults when the same image is
  1125. % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.)
  1126. \ifnum\pdftexversion < 14
  1127. \immediate\pdfimage
  1128. \else
  1129. \immediate\pdfximage
  1130. \fi
  1131. \ifdim \wd0 >0pt width \imagewidth \fi
  1132. \ifdim \wd2 >0pt height \imageheight \fi
  1133. \ifnum\pdftexversion<13
  1134. #1.\pdfimgext
  1135. \else
  1136. {#1.\pdfimgext}%
  1137. \fi
  1138. \ifnum\pdftexversion < 14 \else
  1139. \pdfrefximage \pdflastximage
  1140. \fi}
  1141. %
  1142. \def\pdfmkdest#1{{%
  1143. % We have to set dummies so commands such as @code, and characters
  1144. % such as \, aren't expanded when present in a section title.
  1145. \indexnofonts
  1146. \turnoffactive
  1147. \activebackslashdouble
  1148. \makevalueexpandable
  1149. \def\pdfdestname{#1}%
  1150. \backslashparens\pdfdestname
  1151. \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
  1152. }}
  1153. %
  1154. % used to mark target names; must be expandable.
  1155. \def\pdfmkpgn#1{#1}
  1156. %
  1157. % by default, use a color that is dark enough to print on paper as
  1158. % nearly black, but still distinguishable for online viewing.
  1159. \def\urlcolor{\rgbDarkRed}
  1160. \def\linkcolor{\rgbDarkRed}
  1161. \def\endlink{\setcolor{\maincolor}\pdfendlink}
  1162. %
  1163. % Adding outlines to PDF; macros for calculating structure of outlines
  1164. % come from Petr Olsak
  1165. \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
  1166. \else \csname#1\endcsname \fi}
  1167. \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
  1168. \advance\tempnum by 1
  1169. \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
  1170. %
  1171. % #1 is the section text, which is what will be displayed in the
  1172. % outline by the pdf viewer. #2 is the pdf expression for the number
  1173. % of subentries (or empty, for subsubsections). #3 is the node text,
  1174. % which might be empty if this toc entry had no corresponding node.
  1175. % #4 is the page number
  1176. %
  1177. \def\dopdfoutline#1#2#3#4{%
  1178. % Generate a link to the node text if that exists; else, use the
  1179. % page number. We could generate a destination for the section
  1180. % text in the case where a section has no node, but it doesn't
  1181. % seem worth the trouble, since most documents are normally structured.
  1182. \def\pdfoutlinedest{#3}%
  1183. \ifx\pdfoutlinedest\empty
  1184. \def\pdfoutlinedest{#4}%
  1185. \else
  1186. % Doubled backslashes in the name.
  1187. {\activebackslashdouble \xdef\pdfoutlinedest{#3}%
  1188. \backslashparens\pdfoutlinedest}%
  1189. \fi
  1190. %
  1191. % Also double the backslashes in the display string.
  1192. {\activebackslashdouble \xdef\pdfoutlinetext{#1}%
  1193. \backslashparens\pdfoutlinetext}%
  1194. %
  1195. \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
  1196. }
  1197. %
  1198. \def\pdfmakeoutlines{%
  1199. \begingroup
  1200. % Thanh's hack / proper braces in bookmarks
  1201. \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
  1202. \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
  1203. %
  1204. % Read toc silently, to get counts of subentries for \pdfoutline.
  1205. \def\partentry##1##2##3##4{}% ignore parts in the outlines
  1206. \def\numchapentry##1##2##3##4{%
  1207. \def\thischapnum{##2}%
  1208. \def\thissecnum{0}%
  1209. \def\thissubsecnum{0}%
  1210. }%
  1211. \def\numsecentry##1##2##3##4{%
  1212. \advancenumber{chap\thischapnum}%
  1213. \def\thissecnum{##2}%
  1214. \def\thissubsecnum{0}%
  1215. }%
  1216. \def\numsubsecentry##1##2##3##4{%
  1217. \advancenumber{sec\thissecnum}%
  1218. \def\thissubsecnum{##2}%
  1219. }%
  1220. \def\numsubsubsecentry##1##2##3##4{%
  1221. \advancenumber{subsec\thissubsecnum}%
  1222. }%
  1223. \def\thischapnum{0}%
  1224. \def\thissecnum{0}%
  1225. \def\thissubsecnum{0}%
  1226. %
  1227. % use \def rather than \let here because we redefine \chapentry et
  1228. % al. a second time, below.
  1229. \def\appentry{\numchapentry}%
  1230. \def\appsecentry{\numsecentry}%
  1231. \def\appsubsecentry{\numsubsecentry}%
  1232. \def\appsubsubsecentry{\numsubsubsecentry}%
  1233. \def\unnchapentry{\numchapentry}%
  1234. \def\unnsecentry{\numsecentry}%
  1235. \def\unnsubsecentry{\numsubsecentry}%
  1236. \def\unnsubsubsecentry{\numsubsubsecentry}%
  1237. \readdatafile{toc}%
  1238. %
  1239. % Read toc second time, this time actually producing the outlines.
  1240. % The `-' means take the \expnumber as the absolute number of
  1241. % subentries, which we calculated on our first read of the .toc above.
  1242. %
  1243. % We use the node names as the destinations.
  1244. \def\numchapentry##1##2##3##4{%
  1245. \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
  1246. \def\numsecentry##1##2##3##4{%
  1247. \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
  1248. \def\numsubsecentry##1##2##3##4{%
  1249. \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%
  1250. \def\numsubsubsecentry##1##2##3##4{% count is always zero
  1251. \dopdfoutline{##1}{}{##3}{##4}}%
  1252. %
  1253. % PDF outlines are displayed using system fonts, instead of
  1254. % document fonts. Therefore we cannot use special characters,
  1255. % since the encoding is unknown. For example, the eogonek from
  1256. % Latin 2 (0xea) gets translated to a | character. Info from
  1257. % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
  1258. %
  1259. % xx to do this right, we have to translate 8-bit characters to
  1260. % their "best" equivalent, based on the @documentencoding. Right
  1261. % now, I guess we'll just let the pdf reader have its way.
  1262. \indexnofonts
  1263. \setupdatafile
  1264. \catcode`\\=\active \otherbackslash
  1265. \input \tocreadfilename
  1266. \endgroup
  1267. }
  1268. %
  1269. \def\skipspaces#1{\def\PP{#1}\def\D{|}%
  1270. \ifx\PP\D\let\nextsp\relax
  1271. \else\let\nextsp\skipspaces
  1272. \ifx\p\space\else\addtokens{\filename}{\PP}%
  1273. \advance\filenamelength by 1
  1274. \fi
  1275. \fi
  1276. \nextsp}
  1277. \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax}
  1278. \ifnum\pdftexversion < 14
  1279. \let \startlink \pdfannotlink
  1280. \else
  1281. \let \startlink \pdfstartlink
  1282. \fi
  1283. % make a live url in pdf output.
  1284. \def\pdfurl#1{%
  1285. \begingroup
  1286. % it seems we really need yet another set of dummies; have not
  1287. % tried to figure out what each command should do in the context
  1288. % of @url. for now, just make @/ a no-op, that's the only one
  1289. % people have actually reported a problem with.
  1290. %
  1291. \normalturnoffactive
  1292. \def\@{@}%
  1293. \let\/=\empty
  1294. \makevalueexpandable
  1295. % do we want to go so far as to use \indexnofonts instead of just
  1296. % special-casing \var here?
  1297. \def\var##1{##1}%
  1298. %
  1299. \leavevmode\setcolor{\urlcolor}%
  1300. \startlink attr{/Border [0 0 0]}%
  1301. user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
  1302. \endgroup}
  1303. \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
  1304. \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
  1305. \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
  1306. \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
  1307. \def\maketoks{%
  1308. \expandafter\poptoks\the\toksA|ENDTOKS|\relax
  1309. \ifx\first0\adn0
  1310. \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
  1311. \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
  1312. \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
  1313. \else
  1314. \ifnum0=\countA\else\makelink\fi
  1315. \ifx\first.\let\next=\done\else
  1316. \let\next=\maketoks
  1317. \addtokens{\toksB}{\the\toksD}
  1318. \ifx\first,\addtokens{\toksB}{\space}\fi
  1319. \fi
  1320. \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
  1321. \next}
  1322. \def\makelink{\addtokens{\toksB}%
  1323. {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
  1324. \def\pdflink#1{%
  1325. \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
  1326. \setcolor{\linkcolor}#1\endlink}
  1327. \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
  1328. \else
  1329. % non-pdf mode
  1330. \let\pdfmkdest = \gobble
  1331. \let\pdfurl = \gobble
  1332. \let\endlink = \relax
  1333. \let\setcolor = \gobble
  1334. \let\pdfsetcolor = \gobble
  1335. \let\pdfmakeoutlines = \relax
  1336. \fi % \ifx\pdfoutput
  1337. \message{fonts,}
  1338. % Change the current font style to #1, remembering it in \curfontstyle.
  1339. % For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
  1340. % italics, not bold italics.
  1341. %
  1342. \def\setfontstyle#1{%
  1343. \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
  1344. \csname ten#1\endcsname % change the current font
  1345. }
  1346. % Select #1 fonts with the current style.
  1347. %
  1348. \def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname}
  1349. \def\rm{\fam=0 \setfontstyle{rm}}
  1350. \def\it{\fam=\itfam \setfontstyle{it}}
  1351. \def\sl{\fam=\slfam \setfontstyle{sl}}
  1352. \def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
  1353. \def\tt{\fam=\ttfam \setfontstyle{tt}}
  1354. % Unfortunately, we have to override this for titles and the like, since
  1355. % in those cases "rm" is bold. Sigh.
  1356. \def\rmisbold{\rm\def\curfontstyle{bf}}
  1357. % Texinfo sort of supports the sans serif font style, which plain TeX does not.
  1358. % So we set up a \sf.
  1359. \newfam\sffam
  1360. \def\sf{\fam=\sffam \setfontstyle{sf}}
  1361. \let\li = \sf % Sometimes we call it \li, not \sf.
  1362. % We don't need math for this font style.
  1363. \def\ttsl{\setfontstyle{ttsl}}
  1364. % Default leading.
  1365. \newdimen\textleading \textleading = 13.2pt
  1366. % Set the baselineskip to #1, and the lineskip and strut size
  1367. % correspondingly. There is no deep meaning behind these magic numbers
  1368. % used as factors; they just match (closely enough) what Knuth defined.
  1369. %
  1370. \def\lineskipfactor{.08333}
  1371. \def\strutheightpercent{.70833}
  1372. \def\strutdepthpercent {.29167}
  1373. %
  1374. % can get a sort of poor man's double spacing by redefining this.
  1375. \def\baselinefactor{1}
  1376. %
  1377. \def\setleading#1{%
  1378. \dimen0 = #1\relax
  1379. \normalbaselineskip = \baselinefactor\dimen0
  1380. \normallineskip = \lineskipfactor\normalbaselineskip
  1381. \normalbaselines
  1382. \setbox\strutbox =\hbox{%
  1383. \vrule width0pt height\strutheightpercent\baselineskip
  1384. depth \strutdepthpercent \baselineskip
  1385. }%
  1386. }
  1387. % PDF CMaps. See also LaTeX's t1.cmap.
  1388. %
  1389. % do nothing with this by default.
  1390. \expandafter\let\csname cmapOT1\endcsname\gobble
  1391. \expandafter\let\csname cmapOT1IT\endcsname\gobble
  1392. \expandafter\let\csname cmapOT1TT\endcsname\gobble
  1393. % if we are producing pdf, and we have \pdffontattr, then define cmaps.
  1394. % (\pdffontattr was introduced many years ago, but people still run
  1395. % older pdftex's; it's easy to conditionalize, so we do.)
  1396. \ifpdf \ifx\pdffontattr\thisisundefined \else
  1397. \begingroup
  1398. \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
  1399. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
  1400. %%DocumentNeededResources: ProcSet (CIDInit)
  1401. %%IncludeResource: ProcSet (CIDInit)
  1402. %%BeginResource: CMap (TeX-OT1-0)
  1403. %%Title: (TeX-OT1-0 TeX OT1 0)
  1404. %%Version: 1.000
  1405. %%EndComments
  1406. /CIDInit /ProcSet findresource begin
  1407. 12 dict begin
  1408. begincmap
  1409. /CIDSystemInfo
  1410. << /Registry (TeX)
  1411. /Ordering (OT1)
  1412. /Supplement 0
  1413. >> def
  1414. /CMapName /TeX-OT1-0 def
  1415. /CMapType 2 def
  1416. 1 begincodespacerange
  1417. <00> <7F>
  1418. endcodespacerange
  1419. 8 beginbfrange
  1420. <00> <01> <0393>
  1421. <09> <0A> <03A8>
  1422. <23> <26> <0023>
  1423. <28> <3B> <0028>
  1424. <3F> <5B> <003F>
  1425. <5D> <5E> <005D>
  1426. <61> <7A> <0061>
  1427. <7B> <7C> <2013>
  1428. endbfrange
  1429. 40 beginbfchar
  1430. <02> <0398>
  1431. <03> <039B>
  1432. <04> <039E>
  1433. <05> <03A0>
  1434. <06> <03A3>
  1435. <07> <03D2>
  1436. <08> <03A6>
  1437. <0B> <00660066>
  1438. <0C> <00660069>
  1439. <0D> <0066006C>
  1440. <0E> <006600660069>
  1441. <0F> <00660066006C>
  1442. <10> <0131>
  1443. <11> <0237>
  1444. <12> <0060>
  1445. <13> <00B4>
  1446. <14> <02C7>
  1447. <15> <02D8>
  1448. <16> <00AF>
  1449. <17> <02DA>
  1450. <18> <00B8>
  1451. <19> <00DF>
  1452. <1A> <00E6>
  1453. <1B> <0153>
  1454. <1C> <00F8>
  1455. <1D> <00C6>
  1456. <1E> <0152>
  1457. <1F> <00D8>
  1458. <21> <0021>
  1459. <22> <201D>
  1460. <27> <2019>
  1461. <3C> <00A1>
  1462. <3D> <003D>
  1463. <3E> <00BF>
  1464. <5C> <201C>
  1465. <5F> <02D9>
  1466. <60> <2018>
  1467. <7D> <02DD>
  1468. <7E> <007E>
  1469. <7F> <00A8>
  1470. endbfchar
  1471. endcmap
  1472. CMapName currentdict /CMap defineresource pop
  1473. end
  1474. end
  1475. %%EndResource
  1476. %%EOF
  1477. }\endgroup
  1478. \expandafter\edef\csname cmapOT1\endcsname#1{%
  1479. \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
  1480. }%
  1481. %
  1482. % \cmapOT1IT
  1483. \begingroup
  1484. \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
  1485. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
  1486. %%DocumentNeededResources: ProcSet (CIDInit)
  1487. %%IncludeResource: ProcSet (CIDInit)
  1488. %%BeginResource: CMap (TeX-OT1IT-0)
  1489. %%Title: (TeX-OT1IT-0 TeX OT1IT 0)
  1490. %%Version: 1.000
  1491. %%EndComments
  1492. /CIDInit /ProcSet findresource begin
  1493. 12 dict begin
  1494. begincmap
  1495. /CIDSystemInfo
  1496. << /Registry (TeX)
  1497. /Ordering (OT1IT)
  1498. /Supplement 0
  1499. >> def
  1500. /CMapName /TeX-OT1IT-0 def
  1501. /CMapType 2 def
  1502. 1 begincodespacerange
  1503. <00> <7F>
  1504. endcodespacerange
  1505. 8 beginbfrange
  1506. <00> <01> <0393>
  1507. <09> <0A> <03A8>
  1508. <25> <26> <0025>
  1509. <28> <3B> <0028>
  1510. <3F> <5B> <003F>
  1511. <5D> <5E> <005D>
  1512. <61> <7A> <0061>
  1513. <7B> <7C> <2013>
  1514. endbfrange
  1515. 42 beginbfchar
  1516. <02> <0398>
  1517. <03> <039B>
  1518. <04> <039E>
  1519. <05> <03A0>
  1520. <06> <03A3>
  1521. <07> <03D2>
  1522. <08> <03A6>
  1523. <0B> <00660066>
  1524. <0C> <00660069>
  1525. <0D> <0066006C>
  1526. <0E> <006600660069>
  1527. <0F> <00660066006C>
  1528. <10> <0131>
  1529. <11> <0237>
  1530. <12> <0060>
  1531. <13> <00B4>
  1532. <14> <02C7>
  1533. <15> <02D8>
  1534. <16> <00AF>
  1535. <17> <02DA>
  1536. <18> <00B8>
  1537. <19> <00DF>
  1538. <1A> <00E6>
  1539. <1B> <0153>
  1540. <1C> <00F8>
  1541. <1D> <00C6>
  1542. <1E> <0152>
  1543. <1F> <00D8>
  1544. <21> <0021>
  1545. <22> <201D>
  1546. <23> <0023>
  1547. <24> <00A3>
  1548. <27> <2019>
  1549. <3C> <00A1>
  1550. <3D> <003D>
  1551. <3E> <00BF>
  1552. <5C> <201C>
  1553. <5F> <02D9>
  1554. <60> <2018>
  1555. <7D> <02DD>
  1556. <7E> <007E>
  1557. <7F> <00A8>
  1558. endbfchar
  1559. endcmap
  1560. CMapName currentdict /CMap defineresource pop
  1561. end
  1562. end
  1563. %%EndResource
  1564. %%EOF
  1565. }\endgroup
  1566. \expandafter\edef\csname cmapOT1IT\endcsname#1{%
  1567. \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
  1568. }%
  1569. %
  1570. % \cmapOT1TT
  1571. \begingroup
  1572. \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
  1573. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
  1574. %%DocumentNeededResources: ProcSet (CIDInit)
  1575. %%IncludeResource: ProcSet (CIDInit)
  1576. %%BeginResource: CMap (TeX-OT1TT-0)
  1577. %%Title: (TeX-OT1TT-0 TeX OT1TT 0)
  1578. %%Version: 1.000
  1579. %%EndComments
  1580. /CIDInit /ProcSet findresource begin
  1581. 12 dict begin
  1582. begincmap
  1583. /CIDSystemInfo
  1584. << /Registry (TeX)
  1585. /Ordering (OT1TT)
  1586. /Supplement 0
  1587. >> def
  1588. /CMapName /TeX-OT1TT-0 def
  1589. /CMapType 2 def
  1590. 1 begincodespacerange
  1591. <00> <7F>
  1592. endcodespacerange
  1593. 5 beginbfrange
  1594. <00> <01> <0393>
  1595. <09> <0A> <03A8>
  1596. <21> <26> <0021>
  1597. <28> <5F> <0028>
  1598. <61> <7E> <0061>
  1599. endbfrange
  1600. 32 beginbfchar
  1601. <02> <0398>
  1602. <03> <039B>
  1603. <04> <039E>
  1604. <05> <03A0>
  1605. <06> <03A3>
  1606. <07> <03D2>
  1607. <08> <03A6>
  1608. <0B> <2191>
  1609. <0C> <2193>
  1610. <0D> <0027>
  1611. <0E> <00A1>
  1612. <0F> <00BF>
  1613. <10> <0131>
  1614. <11> <0237>
  1615. <12> <0060>
  1616. <13> <00B4>
  1617. <14> <02C7>
  1618. <15> <02D8>
  1619. <16> <00AF>
  1620. <17> <02DA>
  1621. <18> <00B8>
  1622. <19> <00DF>
  1623. <1A> <00E6>
  1624. <1B> <0153>
  1625. <1C> <00F8>
  1626. <1D> <00C6>
  1627. <1E> <0152>
  1628. <1F> <00D8>
  1629. <20> <2423>
  1630. <27> <2019>
  1631. <60> <2018>
  1632. <7F> <00A8>
  1633. endbfchar
  1634. endcmap
  1635. CMapName currentdict /CMap defineresource pop
  1636. end
  1637. end
  1638. %%EndResource
  1639. %%EOF
  1640. }\endgroup
  1641. \expandafter\edef\csname cmapOT1TT\endcsname#1{%
  1642. \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
  1643. }%
  1644. \fi\fi
  1645. % Set the font macro #1 to the font named #2, adding on the
  1646. % specified font prefix (normally `cm').
  1647. % #3 is the font's design size, #4 is a scale factor, #5 is the CMap
  1648. % encoding (currently only OT1, OT1IT and OT1TT are allowed, pass
  1649. % empty to omit).
  1650. \def\setfont#1#2#3#4#5{%
  1651. \font#1=\fontprefix#2#3 scaled #4
  1652. \csname cmap#5\endcsname#1%
  1653. }
  1654. % This is what gets called when #5 of \setfont is empty.
  1655. \let\cmap\gobble
  1656. % emacs-page end of cmaps
  1657. % Use cm as the default font prefix.
  1658. % To specify the font prefix, you must define \fontprefix
  1659. % before you read in texinfo.tex.
  1660. \ifx\fontprefix\thisisundefined
  1661. \def\fontprefix{cm}
  1662. \fi
  1663. % Support font families that don't use the same naming scheme as CM.
  1664. \def\rmshape{r}
  1665. \def\rmbshape{bx} %where the normal face is bold
  1666. \def\bfshape{b}
  1667. \def\bxshape{bx}
  1668. \def\ttshape{tt}
  1669. \def\ttbshape{tt}
  1670. \def\ttslshape{sltt}
  1671. \def\itshape{ti}
  1672. \def\itbshape{bxti}
  1673. \def\slshape{sl}
  1674. \def\slbshape{bxsl}
  1675. \def\sfshape{ss}
  1676. \def\sfbshape{ss}
  1677. \def\scshape{csc}
  1678. \def\scbshape{csc}
  1679. % Definitions for a main text size of 11pt. This is the default in
  1680. % Texinfo.
  1681. %
  1682. \def\definetextfontsizexi{%
  1683. % Text fonts (11.2pt, magstep1).
  1684. \def\textnominalsize{11pt}
  1685. \edef\mainmagstep{\magstephalf}
  1686. \setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
  1687. \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
  1688. \setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
  1689. \setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
  1690. \setfont\textsl\slshape{10}{\mainmagstep}{OT1}
  1691. \setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
  1692. \setfont\textsc\scshape{10}{\mainmagstep}{OT1}
  1693. \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
  1694. \font\texti=cmmi10 scaled \mainmagstep
  1695. \font\textsy=cmsy10 scaled \mainmagstep
  1696. \def\textecsize{1095}
  1697. % A few fonts for @defun names and args.
  1698. \setfont\defbf\bfshape{10}{\magstep1}{OT1}
  1699. \setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
  1700. \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
  1701. \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
  1702. % Fonts for indices, footnotes, small examples (9pt).
  1703. \def\smallnominalsize{9pt}
  1704. \setfont\smallrm\rmshape{9}{1000}{OT1}
  1705. \setfont\smalltt\ttshape{9}{1000}{OT1TT}
  1706. \setfont\smallbf\bfshape{10}{900}{OT1}
  1707. \setfont\smallit\itshape{9}{1000}{OT1IT}
  1708. \setfont\smallsl\slshape{9}{1000}{OT1}
  1709. \setfont\smallsf\sfshape{9}{1000}{OT1}
  1710. \setfont\smallsc\scshape{10}{900}{OT1}
  1711. \setfont\smallttsl\ttslshape{10}{900}{OT1TT}
  1712. \font\smalli=cmmi9
  1713. \font\smallsy=cmsy9
  1714. \def\smallecsize{0900}
  1715. % Fonts for small examples (8pt).
  1716. \def\smallernominalsize{8pt}
  1717. \setfont\smallerrm\rmshape{8}{1000}{OT1}
  1718. \setfont\smallertt\ttshape{8}{1000}{OT1TT}
  1719. \setfont\smallerbf\bfshape{10}{800}{OT1}
  1720. \setfont\smallerit\itshape{8}{1000}{OT1IT}
  1721. \setfont\smallersl\slshape{8}{1000}{OT1}
  1722. \setfont\smallersf\sfshape{8}{1000}{OT1}
  1723. \setfont\smallersc\scshape{10}{800}{OT1}
  1724. \setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
  1725. \font\smalleri=cmmi8
  1726. \font\smallersy=cmsy8
  1727. \def\smallerecsize{0800}
  1728. % Fonts for title page (20.4pt):
  1729. \def\titlenominalsize{20pt}
  1730. \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
  1731. \setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
  1732. \setfont\titlesl\slbshape{10}{\magstep4}{OT1}
  1733. \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
  1734. \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
  1735. \setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
  1736. \let\titlebf=\titlerm
  1737. \setfont\titlesc\scbshape{10}{\magstep4}{OT1}
  1738. \font\titlei=cmmi12 scaled \magstep3
  1739. \font\titlesy=cmsy10 scaled \magstep4
  1740. \def\titleecsize{2074}
  1741. % Chapter (and unnumbered) fonts (17.28pt).
  1742. \def\chapnominalsize{17pt}
  1743. \setfont\chaprm\rmbshape{12}{\magstep2}{OT1}
  1744. \setfont\chapit\itbshape{10}{\magstep3}{OT1IT}
  1745. \setfont\chapsl\slbshape{10}{\magstep3}{OT1}
  1746. \setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT}
  1747. \setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT}
  1748. \setfont\chapsf\sfbshape{17}{1000}{OT1}
  1749. \let\chapbf=\chaprm
  1750. \setfont\chapsc\scbshape{10}{\magstep3}{OT1}
  1751. \font\chapi=cmmi12 scaled \magstep2
  1752. \font\chapsy=cmsy10 scaled \magstep3
  1753. \def\chapecsize{1728}
  1754. % Section fonts (14.4pt).
  1755. \def\secnominalsize{14pt}
  1756. \setfont\secrm\rmbshape{12}{\magstep1}{OT1}
  1757. \setfont\secit\itbshape{10}{\magstep2}{OT1IT}
  1758. \setfont\secsl\slbshape{10}{\magstep2}{OT1}
  1759. \setfont\sectt\ttbshape{12}{\magstep1}{OT1TT}
  1760. \setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT}
  1761. \setfont\secsf\sfbshape{12}{\magstep1}{OT1}
  1762. \let\secbf\secrm
  1763. \setfont\secsc\scbshape{10}{\magstep2}{OT1}
  1764. \font\seci=cmmi12 scaled \magstep1
  1765. \font\secsy=cmsy10 scaled \magstep2
  1766. \def\sececsize{1440}
  1767. % Subsection fonts (13.15pt).
  1768. \def\ssecnominalsize{13pt}
  1769. \setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1}
  1770. \setfont\ssecit\itbshape{10}{1315}{OT1IT}
  1771. \setfont\ssecsl\slbshape{10}{1315}{OT1}
  1772. \setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT}
  1773. \setfont\ssecttsl\ttslshape{10}{1315}{OT1TT}
  1774. \setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1}
  1775. \let\ssecbf\ssecrm
  1776. \setfont\ssecsc\scbshape{10}{1315}{OT1}
  1777. \font\sseci=cmmi12 scaled \magstephalf
  1778. \font\ssecsy=cmsy10 scaled 1315
  1779. \def\ssececsize{1200}
  1780. % Reduced fonts for @acro in text (10pt).
  1781. \def\reducednominalsize{10pt}
  1782. \setfont\reducedrm\rmshape{10}{1000}{OT1}
  1783. \setfont\reducedtt\ttshape{10}{1000}{OT1TT}
  1784. \setfont\reducedbf\bfshape{10}{1000}{OT1}
  1785. \setfont\reducedit\itshape{10}{1000}{OT1IT}
  1786. \setfont\reducedsl\slshape{10}{1000}{OT1}
  1787. \setfont\reducedsf\sfshape{10}{1000}{OT1}
  1788. \setfont\reducedsc\scshape{10}{1000}{OT1}
  1789. \setfont\reducedttsl\ttslshape{10}{1000}{OT1TT}
  1790. \font\reducedi=cmmi10
  1791. \font\reducedsy=cmsy10
  1792. \def\reducedecsize{1000}
  1793. \textleading = 13.2pt % line spacing for 11pt CM
  1794. \textfonts % reset the current fonts
  1795. \rm
  1796. } % end of 11pt text font size definitions
  1797. % Definitions to make the main text be 10pt Computer Modern, with
  1798. % section, chapter, etc., sizes following suit. This is for the GNU
  1799. % Press printing of the Emacs 22 manual. Maybe other manuals in the
  1800. % future. Used with @smallbook, which sets the leading to 12pt.
  1801. %
  1802. \def\definetextfontsizex{%
  1803. % Text fonts (10pt).
  1804. \def\textnominalsize{10pt}
  1805. \edef\mainmagstep{1000}
  1806. \setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
  1807. \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
  1808. \setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
  1809. \setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
  1810. \setfont\textsl\slshape{10}{\mainmagstep}{OT1}
  1811. \setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
  1812. \setfont\textsc\scshape{10}{\mainmagstep}{OT1}
  1813. \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
  1814. \font\texti=cmmi10 scaled \mainmagstep
  1815. \font\textsy=cmsy10 scaled \mainmagstep
  1816. \def\textecsize{1000}
  1817. % A few fonts for @defun names and args.
  1818. \setfont\defbf\bfshape{10}{\magstephalf}{OT1}
  1819. \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
  1820. \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
  1821. \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
  1822. % Fonts for indices, footnotes, small examples (9pt).
  1823. \def\smallnominalsize{9pt}
  1824. \setfont\smallrm\rmshape{9}{1000}{OT1}
  1825. \setfont\smalltt\ttshape{9}{1000}{OT1TT}
  1826. \setfont\smallbf\bfshape{10}{900}{OT1}
  1827. \setfont\smallit\itshape{9}{1000}{OT1IT}
  1828. \setfont\smallsl\slshape{9}{1000}{OT1}
  1829. \setfont\smallsf\sfshape{9}{1000}{OT1}
  1830. \setfont\smallsc\scshape{10}{900}{OT1}
  1831. \setfont\smallttsl\ttslshape{10}{900}{OT1TT}
  1832. \font\smalli=cmmi9
  1833. \font\smallsy=cmsy9
  1834. \def\smallecsize{0900}
  1835. % Fonts for small examples (8pt).
  1836. \def\smallernominalsize{8pt}
  1837. \setfont\smallerrm\rmshape{8}{1000}{OT1}
  1838. \setfont\smallertt\ttshape{8}{1000}{OT1TT}
  1839. \setfont\smallerbf\bfshape{10}{800}{OT1}
  1840. \setfont\smallerit\itshape{8}{1000}{OT1IT}
  1841. \setfont\smallersl\slshape{8}{1000}{OT1}
  1842. \setfont\smallersf\sfshape{8}{1000}{OT1}
  1843. \setfont\smallersc\scshape{10}{800}{OT1}
  1844. \setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
  1845. \font\smalleri=cmmi8
  1846. \font\smallersy=cmsy8
  1847. \def\smallerecsize{0800}
  1848. % Fonts for title page (20.4pt):
  1849. \def\titlenominalsize{20pt}
  1850. \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
  1851. \setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
  1852. \setfont\titlesl\slbshape{10}{\magstep4}{OT1}
  1853. \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
  1854. \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
  1855. \setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
  1856. \let\titlebf=\titlerm
  1857. \setfont\titlesc\scbshape{10}{\magstep4}{OT1}
  1858. \font\titlei=cmmi12 scaled \magstep3
  1859. \font\titlesy=cmsy10 scaled \magstep4
  1860. \def\titleecsize{2074}
  1861. % Chapter fonts (14.4pt).
  1862. \def\chapnominalsize{14pt}
  1863. \setfont\chaprm\rmbshape{12}{\magstep1}{OT1}
  1864. \setfont\chapit\itbshape{10}{\magstep2}{OT1IT}
  1865. \setfont\chapsl\slbshape{10}{\magstep2}{OT1}
  1866. \setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT}
  1867. \setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT}
  1868. \setfont\chapsf\sfbshape{12}{\magstep1}{OT1}
  1869. \let\chapbf\chaprm
  1870. \setfont\chapsc\scbshape{10}{\magstep2}{OT1}
  1871. \font\chapi=cmmi12 scaled \magstep1
  1872. \font\chapsy=cmsy10 scaled \magstep2
  1873. \def\chapecsize{1440}
  1874. % Section fonts (12pt).
  1875. \def\secnominalsize{12pt}
  1876. \setfont\secrm\rmbshape{12}{1000}{OT1}
  1877. \setfont\secit\itbshape{10}{\magstep1}{OT1IT}
  1878. \setfont\secsl\slbshape{10}{\magstep1}{OT1}
  1879. \setfont\sectt\ttbshape{12}{1000}{OT1TT}
  1880. \setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT}
  1881. \setfont\secsf\sfbshape{12}{1000}{OT1}
  1882. \let\secbf\secrm
  1883. \setfont\secsc\scbshape{10}{\magstep1}{OT1}
  1884. \font\seci=cmmi12
  1885. \font\secsy=cmsy10 scaled \magstep1
  1886. \def\sececsize{1200}
  1887. % Subsection fonts (10pt).
  1888. \def\ssecnominalsize{10pt}
  1889. \setfont\ssecrm\rmbshape{10}{1000}{OT1}
  1890. \setfont\ssecit\itbshape{10}{1000}{OT1IT}
  1891. \setfont\ssecsl\slbshape{10}{1000}{OT1}
  1892. \setfont\ssectt\ttbshape{10}{1000}{OT1TT}
  1893. \setfont\ssecttsl\ttslshape{10}{1000}{OT1TT}
  1894. \setfont\ssecsf\sfbshape{10}{1000}{OT1}
  1895. \let\ssecbf\ssecrm
  1896. \setfont\ssecsc\scbshape{10}{1000}{OT1}
  1897. \font\sseci=cmmi10
  1898. \font\ssecsy=cmsy10
  1899. \def\ssececsize{1000}
  1900. % Reduced fonts for @acro in text (9pt).
  1901. \def\reducednominalsize{9pt}
  1902. \setfont\reducedrm\rmshape{9}{1000}{OT1}
  1903. \setfont\reducedtt\ttshape{9}{1000}{OT1TT}
  1904. \setfont\reducedbf\bfshape{10}{900}{OT1}
  1905. \setfont\reducedit\itshape{9}{1000}{OT1IT}
  1906. \setfont\reducedsl\slshape{9}{1000}{OT1}
  1907. \setfont\reducedsf\sfshape{9}{1000}{OT1}
  1908. \setfont\reducedsc\scshape{10}{900}{OT1}
  1909. \setfont\reducedttsl\ttslshape{10}{900}{OT1TT}
  1910. \font\reducedi=cmmi9
  1911. \font\reducedsy=cmsy9
  1912. \def\reducedecsize{0900}
  1913. \divide\parskip by 2 % reduce space between paragraphs
  1914. \textleading = 12pt % line spacing for 10pt CM
  1915. \textfonts % reset the current fonts
  1916. \rm
  1917. } % end of 10pt text font size definitions
  1918. % We provide the user-level command
  1919. % @fonttextsize 10
  1920. % (or 11) to redefine the text font size. pt is assumed.
  1921. %
  1922. \def\xiword{11}
  1923. \def\xword{10}
  1924. \def\xwordpt{10pt}
  1925. %
  1926. \parseargdef\fonttextsize{%
  1927. \def\textsizearg{#1}%
  1928. %\wlog{doing @fonttextsize \textsizearg}%
  1929. %
  1930. % Set \globaldefs so that documents can use this inside @tex, since
  1931. % makeinfo 4.8 does not support it, but we need it nonetheless.
  1932. %
  1933. \begingroup \globaldefs=1
  1934. \ifx\textsizearg\xword \definetextfontsizex
  1935. \else \ifx\textsizearg\xiword \definetextfontsizexi
  1936. \else
  1937. \errhelp=\EMsimple
  1938. \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
  1939. \fi\fi
  1940. \endgroup
  1941. }
  1942. % In order for the font changes to affect most math symbols and letters,
  1943. % we have to define the \textfont of the standard families. Since
  1944. % texinfo doesn't allow for producing subscripts and superscripts except
  1945. % in the main text, we don't bother to reset \scriptfont and
  1946. % \scriptscriptfont (which would also require loading a lot more fonts).
  1947. %
  1948. \def\resetmathfonts{%
  1949. \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy
  1950. \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf
  1951. \textfont\ttfam=\tentt \textfont\sffam=\tensf
  1952. }
  1953. % The font-changing commands redefine the meanings of \tenSTYLE, instead
  1954. % of just \STYLE. We do this because \STYLE needs to also set the
  1955. % current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire
  1956. % \tenSTYLE to set the current font.
  1957. %
  1958. % Each font-changing command also sets the names \lsize (one size lower)
  1959. % and \lllsize (three sizes lower). These relative commands are used in
  1960. % the LaTeX logo and acronyms.
  1961. %
  1962. % This all needs generalizing, badly.
  1963. %
  1964. \def\textfonts{%
  1965. \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
  1966. \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
  1967. \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
  1968. \let\tenttsl=\textttsl
  1969. \def\curfontsize{text}%
  1970. \def\lsize{reduced}\def\lllsize{smaller}%
  1971. \resetmathfonts \setleading{\textleading}}
  1972. \def\titlefonts{%
  1973. \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
  1974. \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
  1975. \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
  1976. \let\tenttsl=\titlettsl
  1977. \def\curfontsize{title}%
  1978. \def\lsize{chap}\def\lllsize{subsec}%
  1979. \resetmathfonts \setleading{27pt}}
  1980. \def\titlefont#1{{\titlefonts\rmisbold #1}}
  1981. \def\chapfonts{%
  1982. \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
  1983. \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
  1984. \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
  1985. \let\tenttsl=\chapttsl
  1986. \def\curfontsize{chap}%
  1987. \def\lsize{sec}\def\lllsize{text}%
  1988. \resetmathfonts \setleading{19pt}}
  1989. \def\secfonts{%
  1990. \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
  1991. \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
  1992. \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
  1993. \let\tenttsl=\secttsl
  1994. \def\curfontsize{sec}%
  1995. \def\lsize{subsec}\def\lllsize{reduced}%
  1996. \resetmathfonts \setleading{16pt}}
  1997. \def\subsecfonts{%
  1998. \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
  1999. \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
  2000. \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
  2001. \let\tenttsl=\ssecttsl
  2002. \def\curfontsize{ssec}%
  2003. \def\lsize{text}\def\lllsize{small}%
  2004. \resetmathfonts \setleading{15pt}}
  2005. \let\subsubsecfonts = \subsecfonts
  2006. \def\reducedfonts{%
  2007. \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl
  2008. \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc
  2009. \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy
  2010. \let\tenttsl=\reducedttsl
  2011. \def\curfontsize{reduced}%
  2012. \def\lsize{small}\def\lllsize{smaller}%
  2013. \resetmathfonts \setleading{10.5pt}}
  2014. \def\smallfonts{%
  2015. \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
  2016. \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
  2017. \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
  2018. \let\tenttsl=\smallttsl
  2019. \def\curfontsize{small}%
  2020. \def\lsize{smaller}\def\lllsize{smaller}%
  2021. \resetmathfonts \setleading{10.5pt}}
  2022. \def\smallerfonts{%
  2023. \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
  2024. \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
  2025. \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
  2026. \let\tenttsl=\smallerttsl
  2027. \def\curfontsize{smaller}%
  2028. \def\lsize{smaller}\def\lllsize{smaller}%
  2029. \resetmathfonts \setleading{9.5pt}}
  2030. % Fonts for short table of contents.
  2031. \setfont\shortcontrm\rmshape{12}{1000}{OT1}
  2032. \setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12
  2033. \setfont\shortcontsl\slshape{12}{1000}{OT1}
  2034. \setfont\shortconttt\ttshape{12}{1000}{OT1TT}
  2035. % Define these just so they can be easily changed for other fonts.
  2036. \def\angleleft{$\langle$}
  2037. \def\angleright{$\rangle$}
  2038. % Set the fonts to use with the @small... environments.
  2039. \let\smallexamplefonts = \smallfonts
  2040. % About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample
  2041. % can fit this many characters:
  2042. % 8.5x11=86 smallbook=72 a4=90 a5=69
  2043. % If we use \scriptfonts (8pt), then we can fit this many characters:
  2044. % 8.5x11=90+ smallbook=80 a4=90+ a5=77
  2045. % For me, subjectively, the few extra characters that fit aren't worth
  2046. % the additional smallness of 8pt. So I'm making the default 9pt.
  2047. %
  2048. % By the way, for comparison, here's what fits with @example (10pt):
  2049. % 8.5x11=71 smallbook=60 a4=75 a5=58
  2050. % --karl, 24jan03.
  2051. % Set up the default fonts, so we can use them for creating boxes.
  2052. %
  2053. \definetextfontsizexi
  2054. \message{markup,}
  2055. % Check if we are currently using a typewriter font. Since all the
  2056. % Computer Modern typewriter fonts have zero interword stretch (and
  2057. % shrink), and it is reasonable to expect all typewriter fonts to have
  2058. % this property, we can check that font parameter.
  2059. %
  2060. \def\ifmonospace{\ifdim\fontdimen3\font=0pt }
  2061. % Markup style infrastructure. \defmarkupstylesetup\INITMACRO will
  2062. % define and register \INITMACRO to be called on markup style changes.
  2063. % \INITMACRO can check \currentmarkupstyle for the innermost
  2064. % style and the set of \ifmarkupSTYLE switches for all styles
  2065. % currently in effect.
  2066. \newif\ifmarkupvar
  2067. \newif\ifmarkupsamp
  2068. \newif\ifmarkupkey
  2069. %\newif\ifmarkupfile % @file == @samp.
  2070. %\newif\ifmarkupoption % @option == @samp.
  2071. \newif\ifmarkupcode
  2072. \newif\ifmarkupkbd
  2073. %\newif\ifmarkupenv % @env == @code.
  2074. %\newif\ifmarkupcommand % @command == @code.
  2075. \newif\ifmarkuptex % @tex (and part of @math, for now).
  2076. \newif\ifmarkupexample
  2077. \newif\ifmarkupverb
  2078. \newif\ifmarkupverbatim
  2079. \let\currentmarkupstyle\empty
  2080. \def\setupmarkupstyle#1{%
  2081. \csname markup#1true\endcsname
  2082. \def\currentmarkupstyle{#1}%
  2083. \markupstylesetup
  2084. }
  2085. \let\markupstylesetup\empty
  2086. \def\defmarkupstylesetup#1{%
  2087. \expandafter\def\expandafter\markupstylesetup
  2088. \expandafter{\markupstylesetup #1}%
  2089. \def#1%
  2090. }
  2091. % Markup style setup for left and right quotes.
  2092. \defmarkupstylesetup\markupsetuplq{%
  2093. \expandafter\let\expandafter \temp
  2094. \csname markupsetuplq\currentmarkupstyle\endcsname
  2095. \ifx\temp\relax \markupsetuplqdefault \else \temp \fi
  2096. }
  2097. \defmarkupstylesetup\markupsetuprq{%
  2098. \expandafter\let\expandafter \temp
  2099. \csname markupsetuprq\currentmarkupstyle\endcsname
  2100. \ifx\temp\relax \markupsetuprqdefault \else \temp \fi
  2101. }
  2102. {
  2103. \catcode`\'=\active
  2104. \catcode`\`=\active
  2105. \gdef\markupsetuplqdefault{\let`\lq}
  2106. \gdef\markupsetuprqdefault{\let'\rq}
  2107. \gdef\markupsetcodequoteleft{\let`\codequoteleft}
  2108. \gdef\markupsetcodequoteright{\let'\codequoteright}
  2109. \gdef\markupsetnoligaturesquoteleft{\let`\noligaturesquoteleft}
  2110. }
  2111. \let\markupsetuplqcode \markupsetcodequoteleft
  2112. \let\markupsetuprqcode \markupsetcodequoteright
  2113. %
  2114. \let\markupsetuplqexample \markupsetcodequoteleft
  2115. \let\markupsetuprqexample \markupsetcodequoteright
  2116. %
  2117. \let\markupsetuplqsamp \markupsetcodequoteleft
  2118. \let\markupsetuprqsamp \markupsetcodequoteright
  2119. %
  2120. \let\markupsetuplqverb \markupsetcodequoteleft
  2121. \let\markupsetuprqverb \markupsetcodequoteright
  2122. %
  2123. \let\markupsetuplqverbatim \markupsetcodequoteleft
  2124. \let\markupsetuprqverbatim \markupsetcodequoteright
  2125. \let\markupsetuplqkbd \markupsetnoligaturesquoteleft
  2126. % Allow an option to not use regular directed right quote/apostrophe
  2127. % (char 0x27), but instead the undirected quote from cmtt (char 0x0d).
  2128. % The undirected quote is ugly, so don't make it the default, but it
  2129. % works for pasting with more pdf viewers (at least evince), the
  2130. % lilypond developers report. xpdf does work with the regular 0x27.
  2131. %
  2132. \def\codequoteright{%
  2133. \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
  2134. \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
  2135. '%
  2136. \else \char'15 \fi
  2137. \else \char'15 \fi
  2138. }
  2139. %
  2140. % and a similar option for the left quote char vs. a grave accent.
  2141. % Modern fonts display ASCII 0x60 as a grave accent, so some people like
  2142. % the code environments to do likewise.
  2143. %
  2144. \def\codequoteleft{%
  2145. \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
  2146. \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
  2147. % [Knuth] pp. 380,381,391
  2148. % \relax disables Spanish ligatures ?` and !` of \tt font.
  2149. \relax`%
  2150. \else \char'22 \fi
  2151. \else \char'22 \fi
  2152. }
  2153. % Commands to set the quote options.
  2154. %
  2155. \parseargdef\codequoteundirected{%
  2156. \def\temp{#1}%
  2157. \ifx\temp\onword
  2158. \expandafter\let\csname SETtxicodequoteundirected\endcsname
  2159. = t%
  2160. \else\ifx\temp\offword
  2161. \expandafter\let\csname SETtxicodequoteundirected\endcsname
  2162. = \relax
  2163. \else
  2164. \errhelp = \EMsimple
  2165. \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}%
  2166. \fi\fi
  2167. }
  2168. %
  2169. \parseargdef\codequotebacktick{%
  2170. \def\temp{#1}%
  2171. \ifx\temp\onword
  2172. \expandafter\let\csname SETtxicodequotebacktick\endcsname
  2173. = t%
  2174. \else\ifx\temp\offword
  2175. \expandafter\let\csname SETtxicodequotebacktick\endcsname
  2176. = \relax
  2177. \else
  2178. \errhelp = \EMsimple
  2179. \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}%
  2180. \fi\fi
  2181. }
  2182. % [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
  2183. \def\noligaturesquoteleft{\relax\lq}
  2184. % Count depth in font-changes, for error checks
  2185. \newcount\fontdepth \fontdepth=0
  2186. % Font commands.
  2187. % #1 is the font command (\sl or \it), #2 is the text to slant.
  2188. % If we are in a monospaced environment, however, 1) always use \ttsl,
  2189. % and 2) do not add an italic correction.
  2190. \def\dosmartslant#1#2{%
  2191. \ifusingtt
  2192. {{\ttsl #2}\let\next=\relax}%
  2193. {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}%
  2194. \next
  2195. }
  2196. \def\smartslanted{\dosmartslant\sl}
  2197. \def\smartitalic{\dosmartslant\it}
  2198. % Output an italic correction unless \next (presumed to be the following
  2199. % character) is such as not to need one.
  2200. \def\smartitaliccorrection{%
  2201. \ifx\next,%
  2202. \else\ifx\next-%
  2203. \else\ifx\next.%
  2204. \else\ptexslash
  2205. \fi\fi\fi}
  2206. % like \smartslanted except unconditionally uses \ttsl, and no ic.
  2207. % @var is set to this for defun arguments.
  2208. \def\ttslanted#1{{\ttsl #1}}
  2209. % @cite is like \smartslanted except unconditionally use \sl. We never want
  2210. % ttsl for book titles, do we?
  2211. \def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection}
  2212. \let\i=\smartitalic
  2213. \let\slanted=\smartslanted
  2214. \def\var#1{\smartslanted{#1}}
  2215. \let\dfn=\smartslanted
  2216. \let\emph=\smartitalic
  2217. % Explicit font changes: @r, @sc, undocumented @ii.
  2218. \def\r#1{{\rm #1}} % roman font
  2219. \def\sc#1{{\smallcaps#1}} % smallcaps font
  2220. \def\ii#1{{\it #1}} % italic font
  2221. % @b, explicit bold. Also @strong.
  2222. \def\b#1{{\bf #1}}
  2223. \let\strong=\b
  2224. % @sansserif, explicit sans.
  2225. \def\sansserif#1{{\sf #1}}
  2226. % We can't just use \exhyphenpenalty, because that only has effect at
  2227. % the end of a paragraph. Restore normal hyphenation at the end of the
  2228. % group within which \nohyphenation is presumably called.
  2229. %
  2230. \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
  2231. \def\restorehyphenation{\hyphenchar\font = `- }
  2232. % Set sfcode to normal for the chars that usually have another value.
  2233. % Can't use plain's \frenchspacing because it uses the `\x notation, and
  2234. % sometimes \x has an active definition that messes things up.
  2235. %
  2236. \catcode`@=11
  2237. \def\plainfrenchspacing{%
  2238. \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m
  2239. \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m
  2240. \def\endofsentencespacefactor{1000}% for @. and friends
  2241. }
  2242. \def\plainnonfrenchspacing{%
  2243. \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000
  2244. \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250
  2245. \def\endofsentencespacefactor{3000}% for @. and friends
  2246. }
  2247. \catcode`@=\other
  2248. \def\endofsentencespacefactor{3000}% default
  2249. % @t, explicit typewriter.
  2250. \def\t#1{%
  2251. {\tt \rawbackslash \plainfrenchspacing #1}%
  2252. \null
  2253. }
  2254. % @samp.
  2255. \def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}}
  2256. % definition of @key that produces a lozenge. Doesn't adjust to text size.
  2257. %\setfont\keyrm\rmshape{8}{1000}{OT1}
  2258. %\font\keysy=cmsy9
  2259. %\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
  2260. % \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
  2261. % \vbox{\hrule\kern-0.4pt
  2262. % \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
  2263. % \kern-0.4pt\hrule}%
  2264. % \kern-.06em\raise0.4pt\hbox{\angleright}}}}
  2265. % definition of @key with no lozenge. If the current font is already
  2266. % monospace, don't change it; that way, we respect @kbdinputstyle. But
  2267. % if it isn't monospace, then use \tt.
  2268. %
  2269. \def\key#1{{\setupmarkupstyle{key}%
  2270. \nohyphenation
  2271. \ifmonospace\else\tt\fi
  2272. #1}\null}
  2273. % ctrl is no longer a Texinfo command.
  2274. \def\ctrl #1{{\tt \rawbackslash \hat}#1}
  2275. % @file, @option are the same as @samp.
  2276. \let\file=\samp
  2277. \let\option=\samp
  2278. % @code is a modification of @t,
  2279. % which makes spaces the same size as normal in the surrounding text.
  2280. \def\tclose#1{%
  2281. {%
  2282. % Change normal interword space to be same as for the current font.
  2283. \spaceskip = \fontdimen2\font
  2284. %
  2285. % Switch to typewriter.
  2286. \tt
  2287. %
  2288. % But `\ ' produces the large typewriter interword space.
  2289. \def\ {{\spaceskip = 0pt{} }}%
  2290. %
  2291. % Turn off hyphenation.
  2292. \nohyphenation
  2293. %
  2294. \rawbackslash
  2295. \plainfrenchspacing
  2296. #1%
  2297. }%
  2298. \null
  2299. }
  2300. % We *must* turn on hyphenation at `-' and `_' in @code.
  2301. % Otherwise, it is too hard to avoid overfull hboxes
  2302. % in the Emacs manual, the Library manual, etc.
  2303. % Unfortunately, TeX uses one parameter (\hyphenchar) to control
  2304. % both hyphenation at - and hyphenation within words.
  2305. % We must therefore turn them both off (\tclose does that)
  2306. % and arrange explicitly to hyphenate at a dash.
  2307. % -- rms.
  2308. {
  2309. \catcode`\-=\active \catcode`\_=\active
  2310. \catcode`\'=\active \catcode`\`=\active
  2311. \global\let'=\rq \global\let`=\lq % default definitions
  2312. %
  2313. \global\def\code{\begingroup
  2314. \setupmarkupstyle{code}%
  2315. % The following should really be moved into \setupmarkupstyle handlers.
  2316. \catcode\dashChar=\active \catcode\underChar=\active
  2317. \ifallowcodebreaks
  2318. \let-\codedash
  2319. \let_\codeunder
  2320. \else
  2321. \let-\realdash
  2322. \let_\realunder
  2323. \fi
  2324. \codex
  2325. }
  2326. }
  2327. \def\codex #1{\tclose{#1}\endgroup}
  2328. \def\realdash{-}
  2329. \def\codedash{-\discretionary{}{}{}}
  2330. \def\codeunder{%
  2331. % this is all so @math{@code{var_name}+1} can work. In math mode, _
  2332. % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
  2333. % will therefore expand the active definition of _, which is us
  2334. % (inside @code that is), therefore an endless loop.
  2335. \ifusingtt{\ifmmode
  2336. \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
  2337. \else\normalunderscore \fi
  2338. \discretionary{}{}{}}%
  2339. {\_}%
  2340. }
  2341. % An additional complication: the above will allow breaks after, e.g.,
  2342. % each of the four underscores in __typeof__. This is undesirable in
  2343. % some manuals, especially if they don't have long identifiers in
  2344. % general. @allowcodebreaks provides a way to control this.
  2345. %
  2346. \newif\ifallowcodebreaks \allowcodebreakstrue
  2347. \def\keywordtrue{true}
  2348. \def\keywordfalse{false}
  2349. \parseargdef\allowcodebreaks{%
  2350. \def\txiarg{#1}%
  2351. \ifx\txiarg\keywordtrue
  2352. \allowcodebreakstrue
  2353. \else\ifx\txiarg\keywordfalse
  2354. \allowcodebreaksfalse
  2355. \else
  2356. \errhelp = \EMsimple
  2357. \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}%
  2358. \fi\fi
  2359. }
  2360. % @uref (abbreviation for `urlref') takes an optional (comma-separated)
  2361. % second argument specifying the text to display and an optional third
  2362. % arg as text to display instead of (rather than in addition to) the url
  2363. % itself. First (mandatory) arg is the url.
  2364. % (This \urefnobreak definition isn't used now, leaving it for a while
  2365. % for comparison.)
  2366. \def\urefnobreak#1{\dourefnobreak #1,,,\finish}
  2367. \def\dourefnobreak#1,#2,#3,#4\finish{\begingroup
  2368. \unsepspaces
  2369. \pdfurl{#1}%
  2370. \setbox0 = \hbox{\ignorespaces #3}%
  2371. \ifdim\wd0 > 0pt
  2372. \unhbox0 % third arg given, show only that
  2373. \else
  2374. \setbox0 = \hbox{\ignorespaces #2}%
  2375. \ifdim\wd0 > 0pt
  2376. \ifpdf
  2377. \unhbox0 % PDF: 2nd arg given, show only it
  2378. \else
  2379. \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
  2380. \fi
  2381. \else
  2382. \code{#1}% only url given, so show it
  2383. \fi
  2384. \fi
  2385. \endlink
  2386. \endgroup}
  2387. % This \urefbreak definition is the active one.
  2388. \def\urefbreak{\begingroup \urefcatcodes \dourefbreak}
  2389. \let\uref=\urefbreak
  2390. \def\dourefbreak#1{\urefbreakfinish #1,,,\finish}
  2391. \def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example
  2392. \unsepspaces
  2393. \pdfurl{#1}%
  2394. \setbox0 = \hbox{\ignorespaces #3}%
  2395. \ifdim\wd0 > 0pt
  2396. \unhbox0 % third arg given, show only that
  2397. \else
  2398. \setbox0 = \hbox{\ignorespaces #2}%
  2399. \ifdim\wd0 > 0pt
  2400. \ifpdf
  2401. \unhbox0 % PDF: 2nd arg given, show only it
  2402. \else
  2403. \unhbox0\ (\urefcode{#1})% DVI: 2nd arg given, show both it and url
  2404. \fi
  2405. \else
  2406. \urefcode{#1}% only url given, so show it
  2407. \fi
  2408. \fi
  2409. \endlink
  2410. \endgroup}
  2411. % Allow line breaks around only a few characters (only).
  2412. \def\urefcatcodes{%
  2413. \catcode\ampChar=\active \catcode\dotChar=\active
  2414. \catcode\hashChar=\active \catcode\questChar=\active
  2415. \catcode\slashChar=\active
  2416. }
  2417. {
  2418. \urefcatcodes
  2419. %
  2420. \global\def\urefcode{\begingroup
  2421. \setupmarkupstyle{code}%
  2422. \urefcatcodes
  2423. \let&\urefcodeamp
  2424. \let.\urefcodedot
  2425. \let#\urefcodehash
  2426. \let?\urefcodequest
  2427. \let/\urefcodeslash
  2428. \codex
  2429. }
  2430. %
  2431. % By default, they are just regular characters.
  2432. \global\def&{\normalamp}
  2433. \global\def.{\normaldot}
  2434. \global\def#{\normalhash}
  2435. \global\def?{\normalquest}
  2436. \global\def/{\normalslash}
  2437. }
  2438. % we put a little stretch before and after the breakable chars, to help
  2439. % line breaking of long url's. The unequal skips make look better in
  2440. % cmtt at least, especially for dots.
  2441. \def\urefprestretch{\urefprebreak \hskip0pt plus.13em }
  2442. \def\urefpoststretch{\urefpostbreak \hskip0pt plus.1em }
  2443. %
  2444. \def\urefcodeamp{\urefprestretch \&\urefpoststretch}
  2445. \def\urefcodedot{\urefprestretch .\urefpoststretch}
  2446. \def\urefcodehash{\urefprestretch \#\urefpoststretch}
  2447. \def\urefcodequest{\urefprestretch ?\urefpoststretch}
  2448. \def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
  2449. {
  2450. \catcode`\/=\active
  2451. \global\def\urefcodeslashfinish{%
  2452. \urefprestretch \slashChar
  2453. % Allow line break only after the final / in a sequence of
  2454. % slashes, to avoid line break between the slashes in http://.
  2455. \ifx\next/\else \urefpoststretch \fi
  2456. }
  2457. }
  2458. % One more complication: by default we'll break after the special
  2459. % characters, but some people like to break before the special chars, so
  2460. % allow that. Also allow no breaking at all, for manual control.
  2461. %
  2462. \parseargdef\urefbreakstyle{%
  2463. \def\txiarg{#1}%
  2464. \ifx\txiarg\wordnone
  2465. \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
  2466. \else\ifx\txiarg\wordbefore
  2467. \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak}
  2468. \else\ifx\txiarg\wordafter
  2469. \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak}
  2470. \else
  2471. \errhelp = \EMsimple
  2472. \errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
  2473. \fi\fi\fi
  2474. }
  2475. \def\wordafter{after}
  2476. \def\wordbefore{before}
  2477. \def\wordnone{none}
  2478. \urefbreakstyle after
  2479. % @url synonym for @uref, since that's how everyone uses it.
  2480. %
  2481. \let\url=\uref
  2482. % rms does not like angle brackets --karl, 17may97.
  2483. % So now @email is just like @uref, unless we are pdf.
  2484. %
  2485. %\def\email#1{\angleleft{\tt #1}\angleright}
  2486. \ifpdf
  2487. \def\email#1{\doemail#1,,\finish}
  2488. \def\doemail#1,#2,#3\finish{\begingroup
  2489. \unsepspaces
  2490. \pdfurl{mailto:#1}%
  2491. \setbox0 = \hbox{\ignorespaces #2}%
  2492. \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
  2493. \endlink
  2494. \endgroup}
  2495. \else
  2496. \let\email=\uref
  2497. \fi
  2498. % @kbd is like @code, except that if the argument is just one @key command,
  2499. % then @kbd has no effect.
  2500. \def\kbd#1{{\setupmarkupstyle{kbd}\def\look{#1}\expandafter\kbdfoo\look??\par}}
  2501. % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
  2502. % `example' (@kbd uses ttsl only inside of @example and friends),
  2503. % or `code' (@kbd uses normal tty font always).
  2504. \parseargdef\kbdinputstyle{%
  2505. \def\txiarg{#1}%
  2506. \ifx\txiarg\worddistinct
  2507. \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
  2508. \else\ifx\txiarg\wordexample
  2509. \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
  2510. \else\ifx\txiarg\wordcode
  2511. \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
  2512. \else
  2513. \errhelp = \EMsimple
  2514. \errmessage{Unknown @kbdinputstyle setting `\txiarg'}%
  2515. \fi\fi\fi
  2516. }
  2517. \def\worddistinct{distinct}
  2518. \def\wordexample{example}
  2519. \def\wordcode{code}
  2520. % Default is `distinct'.
  2521. \kbdinputstyle distinct
  2522. \def\xkey{\key}
  2523. \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
  2524. \ifx\one\xkey\ifx\threex\three \key{#2}%
  2525. \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
  2526. \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi}
  2527. % For @indicateurl, @env, @command quotes seem unnecessary, so use \code.
  2528. \let\indicateurl=\code
  2529. \let\env=\code
  2530. \let\command=\code
  2531. % @clicksequence{File @click{} Open ...}
  2532. \def\clicksequence#1{\begingroup #1\endgroup}
  2533. % @clickstyle @arrow (by default)
  2534. \parseargdef\clickstyle{\def\click{#1}}
  2535. \def\click{\arrow}
  2536. % Typeset a dimension, e.g., `in' or `pt'. The only reason for the
  2537. % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
  2538. %
  2539. \def\dmn#1{\thinspace #1}
  2540. % @l was never documented to mean ``switch to the Lisp font'',
  2541. % and it is not used as such in any manual I can find. We need it for
  2542. % Polish suppressed-l. --karl, 22sep96.
  2543. %\def\l#1{{\li #1}\null}
  2544. % @acronym for "FBI", "NATO", and the like.
  2545. % We print this one point size smaller, since it's intended for
  2546. % all-uppercase.
  2547. %
  2548. \def\acronym#1{\doacronym #1,,\finish}
  2549. \def\doacronym#1,#2,#3\finish{%
  2550. {\selectfonts\lsize #1}%
  2551. \def\temp{#2}%
  2552. \ifx\temp\empty \else
  2553. \space ({\unsepspaces \ignorespaces \temp \unskip})%
  2554. \fi
  2555. }
  2556. % @abbr for "Comput. J." and the like.
  2557. % No font change, but don't do end-of-sentence spacing.
  2558. %
  2559. \def\abbr#1{\doabbr #1,,\finish}
  2560. \def\doabbr#1,#2,#3\finish{%
  2561. {\plainfrenchspacing #1}%
  2562. \def\temp{#2}%
  2563. \ifx\temp\empty \else
  2564. \space ({\unsepspaces \ignorespaces \temp \unskip})%
  2565. \fi
  2566. }
  2567. % @asis just yields its argument. Used with @table, for example.
  2568. %
  2569. \def\asis#1{#1}
  2570. % @math outputs its argument in math mode.
  2571. %
  2572. % One complication: _ usually means subscripts, but it could also mean
  2573. % an actual _ character, as in @math{@var{some_variable} + 1}. So make
  2574. % _ active, and distinguish by seeing if the current family is \slfam,
  2575. % which is what @var uses.
  2576. {
  2577. \catcode`\_ = \active
  2578. \gdef\mathunderscore{%
  2579. \catcode`\_=\active
  2580. \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
  2581. }
  2582. }
  2583. % Another complication: we want \\ (and @\) to output a math (or tt) \.
  2584. % FYI, plain.tex uses \\ as a temporary control sequence (for no
  2585. % particular reason), but this is not advertised and we don't care.
  2586. %
  2587. % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
  2588. \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
  2589. %
  2590. \def\math{%
  2591. \tex
  2592. \mathunderscore
  2593. \let\\ = \mathbackslash
  2594. \mathactive
  2595. % make the texinfo accent commands work in math mode
  2596. \let\"=\ddot
  2597. \let\'=\acute
  2598. \let\==\bar
  2599. \let\^=\hat
  2600. \let\`=\grave
  2601. \let\u=\breve
  2602. \let\v=\check
  2603. \let\~=\tilde
  2604. \let\dotaccent=\dot
  2605. $\finishmath
  2606. }
  2607. \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
  2608. % Some active characters (such as <) are spaced differently in math.
  2609. % We have to reset their definitions in case the @math was an argument
  2610. % to a command which sets the catcodes (such as @item or @section).
  2611. %
  2612. {
  2613. \catcode`^ = \active
  2614. \catcode`< = \active
  2615. \catcode`> = \active
  2616. \catcode`+ = \active
  2617. \catcode`' = \active
  2618. \gdef\mathactive{%
  2619. \let^ = \ptexhat
  2620. \let< = \ptexless
  2621. \let> = \ptexgtr
  2622. \let+ = \ptexplus
  2623. \let' = \ptexquoteright
  2624. }
  2625. }
  2626. \message{glyphs,}
  2627. % and logos.
  2628. % @@ prints an @.
  2629. \def\@{\char64 }
  2630. % Used to generate quoted braces. Unless we're in typewriter, use
  2631. % \ecfont because the CM text fonts do not have braces, and we don't
  2632. % want to switch into math.
  2633. \def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}}
  2634. \def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}}
  2635. \let\{=\mylbrace
  2636. \let\}=\myrbrace
  2637. \begingroup
  2638. % Definitions to produce \{ and \} commands for indices,
  2639. % and @{ and @} for the aux/toc files.
  2640. \catcode`\{ = \other \catcode`\} = \other
  2641. \catcode`\[ = 1 \catcode`\] = 2
  2642. \catcode`\! = 0 \catcode`\\ = \other
  2643. !gdef!lbracecmd[\{]%
  2644. !gdef!rbracecmd[\}]%
  2645. !gdef!lbraceatcmd[@{]%
  2646. !gdef!rbraceatcmd[@}]%
  2647. !endgroup
  2648. % @comma{} to avoid , parsing problems.
  2649. \let\comma = ,
  2650. % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
  2651. % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
  2652. \let\, = \ptexc
  2653. \let\dotaccent = \ptexdot
  2654. \def\ringaccent#1{{\accent23 #1}}
  2655. \let\tieaccent = \ptext
  2656. \let\ubaraccent = \ptexb
  2657. \let\udotaccent = \d
  2658. % Other special characters: @questiondown @exclamdown @ordf @ordm
  2659. % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
  2660. \def\questiondown{?`}
  2661. \def\exclamdown{!`}
  2662. \def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
  2663. \def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
  2664. % Dotless i and dotless j, used for accents.
  2665. \def\imacro{i}
  2666. \def\jmacro{j}
  2667. \def\dotless#1{%
  2668. \def\temp{#1}%
  2669. \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
  2670. \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
  2671. \else \errmessage{@dotless can be used only with i or j}%
  2672. \fi\fi
  2673. }
  2674. % The \TeX{} logo, as in plain, but resetting the spacing so that a
  2675. % period following counts as ending a sentence. (Idea found in latex.)
  2676. %
  2677. \edef\TeX{\TeX \spacefactor=1000 }
  2678. % @LaTeX{} logo. Not quite the same results as the definition in
  2679. % latex.ltx, since we use a different font for the raised A; it's most
  2680. % convenient for us to use an explicitly smaller font, rather than using
  2681. % the \scriptstyle font (since we don't reset \scriptstyle and
  2682. % \scriptscriptstyle).
  2683. %
  2684. \def\LaTeX{%
  2685. L\kern-.36em
  2686. {\setbox0=\hbox{T}%
  2687. \vbox to \ht0{\hbox{%
  2688. \ifx\textnominalsize\xwordpt
  2689. % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX.
  2690. % Revert to plain's \scriptsize, which is 7pt.
  2691. \count255=\the\fam $\fam\count255 \scriptstyle A$%
  2692. \else
  2693. % For 11pt, we can use our lllsize.
  2694. \selectfonts\lllsize A%
  2695. \fi
  2696. }%
  2697. \vss
  2698. }}%
  2699. \kern-.15em
  2700. \TeX
  2701. }
  2702. % Some math mode symbols.
  2703. \def\bullet{$\ptexbullet$}
  2704. \def\geq{\ifmmode \ge\else $\ge$\fi}
  2705. \def\leq{\ifmmode \le\else $\le$\fi}
  2706. \def\minus{\ifmmode -\else $-$\fi}
  2707. % @dots{} outputs an ellipsis using the current font.
  2708. % We do .5em per period so that it has the same spacing in the cm
  2709. % typewriter fonts as three actual period characters; on the other hand,
  2710. % in other typewriter fonts three periods are wider than 1.5em. So do
  2711. % whichever is larger.
  2712. %
  2713. \def\dots{%
  2714. \leavevmode
  2715. \setbox0=\hbox{...}% get width of three periods
  2716. \ifdim\wd0 > 1.5em
  2717. \dimen0 = \wd0
  2718. \else
  2719. \dimen0 = 1.5em
  2720. \fi
  2721. \hbox to \dimen0{%
  2722. \hskip 0pt plus.25fil
  2723. .\hskip 0pt plus1fil
  2724. .\hskip 0pt plus1fil
  2725. .\hskip 0pt plus.5fil
  2726. }%
  2727. }
  2728. % @enddots{} is an end-of-sentence ellipsis.
  2729. %
  2730. \def\enddots{%
  2731. \dots
  2732. \spacefactor=\endofsentencespacefactor
  2733. }
  2734. % @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
  2735. %
  2736. % Since these characters are used in examples, they should be an even number of
  2737. % \tt widths. Each \tt character is 1en, so two makes it 1em.
  2738. %
  2739. \def\point{$\star$}
  2740. \def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}}
  2741. \def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
  2742. \def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}}
  2743. \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
  2744. \def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}}
  2745. % The @error{} command.
  2746. % Adapted from the TeXbook's \boxit.
  2747. %
  2748. \newbox\errorbox
  2749. %
  2750. {\tentt \global\dimen0 = 3em}% Width of the box.
  2751. \dimen2 = .55pt % Thickness of rules
  2752. % The text. (`r' is open on the right, `e' somewhat less so on the left.)
  2753. \setbox0 = \hbox{\kern-.75pt \reducedsf error\kern-1.5pt}
  2754. %
  2755. \setbox\errorbox=\hbox to \dimen0{\hfil
  2756. \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
  2757. \advance\hsize by -2\dimen2 % Rules.
  2758. \vbox{%
  2759. \hrule height\dimen2
  2760. \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
  2761. \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
  2762. \kern3pt\vrule width\dimen2}% Space to right.
  2763. \hrule height\dimen2}
  2764. \hfil}
  2765. %
  2766. \def\error{\leavevmode\lower.7ex\copy\errorbox}
  2767. % @pounds{} is a sterling sign, which Knuth put in the CM italic font.
  2768. %
  2769. \def\pounds{{\it\$}}
  2770. % @euro{} comes from a separate font, depending on the current style.
  2771. % We use the free feym* fonts from the eurosym package by Henrik
  2772. % Theiling, which support regular, slanted, bold and bold slanted (and
  2773. % "outlined" (blackboard board, sort of) versions, which we don't need).
  2774. % It is available from http://www.ctan.org/tex-archive/fonts/eurosym.
  2775. %
  2776. % Although only regular is the truly official Euro symbol, we ignore
  2777. % that. The Euro is designed to be slightly taller than the regular
  2778. % font height.
  2779. %
  2780. % feymr - regular
  2781. % feymo - slanted
  2782. % feybr - bold
  2783. % feybo - bold slanted
  2784. %
  2785. % There is no good (free) typewriter version, to my knowledge.
  2786. % A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
  2787. % Hmm.
  2788. %
  2789. % Also doesn't work in math. Do we need to do math with euro symbols?
  2790. % Hope not.
  2791. %
  2792. %
  2793. \def\euro{{\eurofont e}}
  2794. \def\eurofont{%
  2795. % We set the font at each command, rather than predefining it in
  2796. % \textfonts and the other font-switching commands, so that
  2797. % installations which never need the symbol don't have to have the
  2798. % font installed.
  2799. %
  2800. % There is only one designed size (nominal 10pt), so we always scale
  2801. % that to the current nominal size.
  2802. %
  2803. % By the way, simply using "at 1em" works for cmr10 and the like, but
  2804. % does not work for cmbx10 and other extended/shrunken fonts.
  2805. %
  2806. \def\eurosize{\csname\curfontsize nominalsize\endcsname}%
  2807. %
  2808. \ifx\curfontstyle\bfstylename
  2809. % bold:
  2810. \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
  2811. \else
  2812. % regular:
  2813. \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
  2814. \fi
  2815. \thiseurofont
  2816. }
  2817. % Glyphs from the EC fonts. We don't use \let for the aliases, because
  2818. % sometimes we redefine the original macro, and the alias should reflect
  2819. % the redefinition.
  2820. %
  2821. % Use LaTeX names for the Icelandic letters.
  2822. \def\DH{{\ecfont \char"D0}} % Eth
  2823. \def\dh{{\ecfont \char"F0}} % eth
  2824. \def\TH{{\ecfont \char"DE}} % Thorn
  2825. \def\th{{\ecfont \char"FE}} % thorn
  2826. %
  2827. \def\guillemetleft{{\ecfont \char"13}}
  2828. \def\guillemotleft{\guillemetleft}
  2829. \def\guillemetright{{\ecfont \char"14}}
  2830. \def\guillemotright{\guillemetright}
  2831. \def\guilsinglleft{{\ecfont \char"0E}}
  2832. \def\guilsinglright{{\ecfont \char"0F}}
  2833. \def\quotedblbase{{\ecfont \char"12}}
  2834. \def\quotesinglbase{{\ecfont \char"0D}}
  2835. %
  2836. % This positioning is not perfect (see the ogonek LaTeX package), but
  2837. % we have the precomposed glyphs for the most common cases. We put the
  2838. % tests to use those glyphs in the single \ogonek macro so we have fewer
  2839. % dummy definitions to worry about for index entries, etc.
  2840. %
  2841. % ogonek is also used with other letters in Lithuanian (IOU), but using
  2842. % the precomposed glyphs for those is not so easy since they aren't in
  2843. % the same EC font.
  2844. \def\ogonek#1{{%
  2845. \def\temp{#1}%
  2846. \ifx\temp\macrocharA\Aogonek
  2847. \else\ifx\temp\macrochara\aogonek
  2848. \else\ifx\temp\macrocharE\Eogonek
  2849. \else\ifx\temp\macrochare\eogonek
  2850. \else
  2851. \ecfont \setbox0=\hbox{#1}%
  2852. \ifdim\ht0=1ex\accent"0C #1%
  2853. \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}%
  2854. \fi
  2855. \fi\fi\fi\fi
  2856. }%
  2857. }
  2858. \def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A}
  2859. \def\aogonek{{\ecfont \char"A1}}\def\macrochara{a}
  2860. \def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E}
  2861. \def\eogonek{{\ecfont \char"A6}}\def\macrochare{e}
  2862. %
  2863. % Use the ec* fonts (cm-super in outline format) for non-CM glyphs.
  2864. \def\ecfont{%
  2865. % We can't distinguish serif/sans and italic/slanted, but this
  2866. % is used for crude hacks anyway (like adding French and German
  2867. % quotes to documents typeset with CM, where we lose kerning), so
  2868. % hopefully nobody will notice/care.
  2869. \edef\ecsize{\csname\curfontsize ecsize\endcsname}%
  2870. \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
  2871. \ifx\curfontstyle\bfstylename
  2872. % bold:
  2873. \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize
  2874. \else
  2875. % regular:
  2876. \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize
  2877. \fi
  2878. \thisecfont
  2879. }
  2880. % @registeredsymbol - R in a circle. The font for the R should really
  2881. % be smaller yet, but lllsize is the best we can do for now.
  2882. % Adapted from the plain.tex definition of \copyright.
  2883. %
  2884. \def\registeredsymbol{%
  2885. $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}%
  2886. \hfil\crcr\Orb}}%
  2887. }$%
  2888. }
  2889. % @textdegree - the normal degrees sign.
  2890. %
  2891. \def\textdegree{$^\circ$}
  2892. % Laurent Siebenmann reports \Orb undefined with:
  2893. % Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38
  2894. % so we'll define it if necessary.
  2895. %
  2896. \ifx\Orb\thisisundefined
  2897. \def\Orb{\mathhexbox20D}
  2898. \fi
  2899. % Quotes.
  2900. \chardef\quotedblleft="5C
  2901. \chardef\quotedblright=`\"
  2902. \chardef\quoteleft=`\`
  2903. \chardef\quoteright=`\'
  2904. \message{page headings,}
  2905. \newskip\titlepagetopglue \titlepagetopglue = 1.5in
  2906. \newskip\titlepagebottomglue \titlepagebottomglue = 2pc
  2907. % First the title page. Must do @settitle before @titlepage.
  2908. \newif\ifseenauthor
  2909. \newif\iffinishedtitlepage
  2910. % Do an implicit @contents or @shortcontents after @end titlepage if the
  2911. % user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
  2912. %
  2913. \newif\ifsetcontentsaftertitlepage
  2914. \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
  2915. \newif\ifsetshortcontentsaftertitlepage
  2916. \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
  2917. \parseargdef\shorttitlepage{%
  2918. \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
  2919. \endgroup\page\hbox{}\page}
  2920. \envdef\titlepage{%
  2921. % Open one extra group, as we want to close it in the middle of \Etitlepage.
  2922. \begingroup
  2923. \parindent=0pt \textfonts
  2924. % Leave some space at the very top of the page.
  2925. \vglue\titlepagetopglue
  2926. % No rule at page bottom unless we print one at the top with @title.
  2927. \finishedtitlepagetrue
  2928. %
  2929. % Most title ``pages'' are actually two pages long, with space
  2930. % at the top of the second. We don't want the ragged left on the second.
  2931. \let\oldpage = \page
  2932. \def\page{%
  2933. \iffinishedtitlepage\else
  2934. \finishtitlepage
  2935. \fi
  2936. \let\page = \oldpage
  2937. \page
  2938. \null
  2939. }%
  2940. }
  2941. \def\Etitlepage{%
  2942. \iffinishedtitlepage\else
  2943. \finishtitlepage
  2944. \fi
  2945. % It is important to do the page break before ending the group,
  2946. % because the headline and footline are only empty inside the group.
  2947. % If we use the new definition of \page, we always get a blank page
  2948. % after the title page, which we certainly don't want.
  2949. \oldpage
  2950. \endgroup
  2951. %
  2952. % Need this before the \...aftertitlepage checks so that if they are
  2953. % in effect the toc pages will come out with page numbers.
  2954. \HEADINGSon
  2955. %
  2956. % If they want short, they certainly want long too.
  2957. \ifsetshortcontentsaftertitlepage
  2958. \shortcontents
  2959. \contents
  2960. \global\let\shortcontents = \relax
  2961. \global\let\contents = \relax
  2962. \fi
  2963. %
  2964. \ifsetcontentsaftertitlepage
  2965. \contents
  2966. \global\let\contents = \relax
  2967. \global\let\shortcontents = \relax
  2968. \fi
  2969. }
  2970. \def\finishtitlepage{%
  2971. \vskip4pt \hrule height 2pt width \hsize
  2972. \vskip\titlepagebottomglue
  2973. \finishedtitlepagetrue
  2974. }
  2975. % Macros to be used within @titlepage:
  2976. \let\subtitlerm=\tenrm
  2977. \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
  2978. \parseargdef\title{%
  2979. \checkenv\titlepage
  2980. \leftline{\titlefonts\rmisbold #1}
  2981. % print a rule at the page bottom also.
  2982. \finishedtitlepagefalse
  2983. \vskip4pt \hrule height 4pt width \hsize \vskip4pt
  2984. }
  2985. \parseargdef\subtitle{%
  2986. \checkenv\titlepage
  2987. {\subtitlefont \rightline{#1}}%
  2988. }
  2989. % @author should come last, but may come many times.
  2990. % It can also be used inside @quotation.
  2991. %
  2992. \parseargdef\author{%
  2993. \def\temp{\quotation}%
  2994. \ifx\thisenv\temp
  2995. \def\quotationauthor{#1}% printed in \Equotation.
  2996. \else
  2997. \checkenv\titlepage
  2998. \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
  2999. {\secfonts\rmisbold \leftline{#1}}%
  3000. \fi
  3001. }
  3002. % Set up page headings and footings.
  3003. \let\thispage=\folio
  3004. \newtoks\evenheadline % headline on even pages
  3005. \newtoks\oddheadline % headline on odd pages
  3006. \newtoks\evenfootline % footline on even pages
  3007. \newtoks\oddfootline % footline on odd pages
  3008. % Now make TeX use those variables
  3009. \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
  3010. \else \the\evenheadline \fi}}
  3011. \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
  3012. \else \the\evenfootline \fi}\HEADINGShook}
  3013. \let\HEADINGShook=\relax
  3014. % Commands to set those variables.
  3015. % For example, this is what @headings on does
  3016. % @evenheading @thistitle|@thispage|@thischapter
  3017. % @oddheading @thischapter|@thispage|@thistitle
  3018. % @evenfooting @thisfile||
  3019. % @oddfooting ||@thisfile
  3020. \def\evenheading{\parsearg\evenheadingxxx}
  3021. \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
  3022. \def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
  3023. \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  3024. \def\oddheading{\parsearg\oddheadingxxx}
  3025. \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
  3026. \def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
  3027. \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  3028. \parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
  3029. \def\evenfooting{\parsearg\evenfootingxxx}
  3030. \def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}
  3031. \def\evenfootingyyy #1\|#2\|#3\|#4\finish{%
  3032. \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  3033. \def\oddfooting{\parsearg\oddfootingxxx}
  3034. \def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}
  3035. \def\oddfootingyyy #1\|#2\|#3\|#4\finish{%
  3036. \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
  3037. %
  3038. % Leave some space for the footline. Hopefully ok to assume
  3039. % @evenfooting will not be used by itself.
  3040. \global\advance\pageheight by -12pt
  3041. \global\advance\vsize by -12pt
  3042. }
  3043. \parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
  3044. % @evenheadingmarks top \thischapter <- chapter at the top of a page
  3045. % @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page
  3046. %
  3047. % The same set of arguments for:
  3048. %
  3049. % @oddheadingmarks
  3050. % @evenfootingmarks
  3051. % @oddfootingmarks
  3052. % @everyheadingmarks
  3053. % @everyfootingmarks
  3054. \def\evenheadingmarks{\headingmarks{even}{heading}}
  3055. \def\oddheadingmarks{\headingmarks{odd}{heading}}
  3056. \def\evenfootingmarks{\headingmarks{even}{footing}}
  3057. \def\oddfootingmarks{\headingmarks{odd}{footing}}
  3058. \def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1}
  3059. \headingmarks{odd}{heading}{#1} }
  3060. \def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1}
  3061. \headingmarks{odd}{footing}{#1} }
  3062. % #1 = even/odd, #2 = heading/footing, #3 = top/bottom.
  3063. \def\headingmarks#1#2#3 {%
  3064. \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname
  3065. \global\expandafter\let\csname get#1#2marks\endcsname \temp
  3066. }
  3067. \everyheadingmarks bottom
  3068. \everyfootingmarks bottom
  3069. % @headings double turns headings on for double-sided printing.
  3070. % @headings single turns headings on for single-sided printing.
  3071. % @headings off turns them off.
  3072. % @headings on same as @headings double, retained for compatibility.
  3073. % @headings after turns on double-sided headings after this page.
  3074. % @headings doubleafter turns on double-sided headings after this page.
  3075. % @headings singleafter turns on single-sided headings after this page.
  3076. % By default, they are off at the start of a document,
  3077. % and turned `on' after @end titlepage.
  3078. \def\headings #1 {\csname HEADINGS#1\endcsname}
  3079. \def\headingsoff{% non-global headings elimination
  3080. \evenheadline={\hfil}\evenfootline={\hfil}%
  3081. \oddheadline={\hfil}\oddfootline={\hfil}%
  3082. }
  3083. \def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
  3084. \HEADINGSoff % it's the default
  3085. % When we turn headings on, set the page number to 1.
  3086. % For double-sided printing, put current file name in lower left corner,
  3087. % chapter name on inside top of right hand pages, document
  3088. % title on inside top of left hand pages, and page numbers on outside top
  3089. % edge of all pages.
  3090. \def\HEADINGSdouble{%
  3091. \global\pageno=1
  3092. \global\evenfootline={\hfil}
  3093. \global\oddfootline={\hfil}
  3094. \global\evenheadline={\line{\folio\hfil\thistitle}}
  3095. \global\oddheadline={\line{\thischapter\hfil\folio}}
  3096. \global\let\contentsalignmacro = \chapoddpage
  3097. }
  3098. \let\contentsalignmacro = \chappager
  3099. % For single-sided printing, chapter title goes across top left of page,
  3100. % page number on top right.
  3101. \def\HEADINGSsingle{%
  3102. \global\pageno=1
  3103. \global\evenfootline={\hfil}
  3104. \global\oddfootline={\hfil}
  3105. \global\evenheadline={\line{\thischapter\hfil\folio}}
  3106. \global\oddheadline={\line{\thischapter\hfil\folio}}
  3107. \global\let\contentsalignmacro = \chappager
  3108. }
  3109. \def\HEADINGSon{\HEADINGSdouble}
  3110. \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
  3111. \let\HEADINGSdoubleafter=\HEADINGSafter
  3112. \def\HEADINGSdoublex{%
  3113. \global\evenfootline={\hfil}
  3114. \global\oddfootline={\hfil}
  3115. \global\evenheadline={\line{\folio\hfil\thistitle}}
  3116. \global\oddheadline={\line{\thischapter\hfil\folio}}
  3117. \global\let\contentsalignmacro = \chapoddpage
  3118. }
  3119. \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
  3120. \def\HEADINGSsinglex{%
  3121. \global\evenfootline={\hfil}
  3122. \global\oddfootline={\hfil}
  3123. \global\evenheadline={\line{\thischapter\hfil\folio}}
  3124. \global\oddheadline={\line{\thischapter\hfil\folio}}
  3125. \global\let\contentsalignmacro = \chappager
  3126. }
  3127. % Subroutines used in generating headings
  3128. % This produces Day Month Year style of output.
  3129. % Only define if not already defined, in case a txi-??.tex file has set
  3130. % up a different format (e.g., txi-cs.tex does this).
  3131. \ifx\today\thisisundefined
  3132. \def\today{%
  3133. \number\day\space
  3134. \ifcase\month
  3135. \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
  3136. \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
  3137. \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
  3138. \fi
  3139. \space\number\year}
  3140. \fi
  3141. % @settitle line... specifies the title of the document, for headings.
  3142. % It generates no output of its own.
  3143. \def\thistitle{\putwordNoTitle}
  3144. \def\settitle{\parsearg{\gdef\thistitle}}
  3145. \message{tables,}
  3146. % Tables -- @table, @ftable, @vtable, @item(x).
  3147. % default indentation of table text
  3148. \newdimen\tableindent \tableindent=.8in
  3149. % default indentation of @itemize and @enumerate text
  3150. \newdimen\itemindent \itemindent=.3in
  3151. % margin between end of table item and start of table text.
  3152. \newdimen\itemmargin \itemmargin=.1in
  3153. % used internally for \itemindent minus \itemmargin
  3154. \newdimen\itemmax
  3155. % Note @table, @ftable, and @vtable define @item, @itemx, etc., with
  3156. % these defs.
  3157. % They also define \itemindex
  3158. % to index the item name in whatever manner is desired (perhaps none).
  3159. \newif\ifitemxneedsnegativevskip
  3160. \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
  3161. \def\internalBitem{\smallbreak \parsearg\itemzzz}
  3162. \def\internalBitemx{\itemxpar \parsearg\itemzzz}
  3163. \def\itemzzz #1{\begingroup %
  3164. \advance\hsize by -\rightskip
  3165. \advance\hsize by -\tableindent
  3166. \setbox0=\hbox{\itemindicate{#1}}%
  3167. \itemindex{#1}%
  3168. \nobreak % This prevents a break before @itemx.
  3169. %
  3170. % If the item text does not fit in the space we have, put it on a line
  3171. % by itself, and do not allow a page break either before or after that
  3172. % line. We do not start a paragraph here because then if the next
  3173. % command is, e.g., @kindex, the whatsit would get put into the
  3174. % horizontal list on a line by itself, resulting in extra blank space.
  3175. \ifdim \wd0>\itemmax
  3176. %
  3177. % Make this a paragraph so we get the \parskip glue and wrapping,
  3178. % but leave it ragged-right.
  3179. \begingroup
  3180. \advance\leftskip by-\tableindent
  3181. \advance\hsize by\tableindent
  3182. \advance\rightskip by0pt plus1fil\relax
  3183. \leavevmode\unhbox0\par
  3184. \endgroup
  3185. %
  3186. % We're going to be starting a paragraph, but we don't want the
  3187. % \parskip glue -- logically it's part of the @item we just started.
  3188. \nobreak \vskip-\parskip
  3189. %
  3190. % Stop a page break at the \parskip glue coming up. However, if
  3191. % what follows is an environment such as @example, there will be no
  3192. % \parskip glue; then the negative vskip we just inserted would
  3193. % cause the example and the item to crash together. So we use this
  3194. % bizarre value of 10001 as a signal to \aboveenvbreak to insert
  3195. % \parskip glue after all. Section titles are handled this way also.
  3196. %
  3197. \penalty 10001
  3198. \endgroup
  3199. \itemxneedsnegativevskipfalse
  3200. \else
  3201. % The item text fits into the space. Start a paragraph, so that the
  3202. % following text (if any) will end up on the same line.
  3203. \noindent
  3204. % Do this with kerns and \unhbox so that if there is a footnote in
  3205. % the item text, it can migrate to the main vertical list and
  3206. % eventually be printed.
  3207. \nobreak\kern-\tableindent
  3208. \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
  3209. \unhbox0
  3210. \nobreak\kern\dimen0
  3211. \endgroup
  3212. \itemxneedsnegativevskiptrue
  3213. \fi
  3214. }
  3215. \def\item{\errmessage{@item while not in a list environment}}
  3216. \def\itemx{\errmessage{@itemx while not in a list environment}}
  3217. % @table, @ftable, @vtable.
  3218. \envdef\table{%
  3219. \let\itemindex\gobble
  3220. \tablecheck{table}%
  3221. }
  3222. \envdef\ftable{%
  3223. \def\itemindex ##1{\doind {fn}{\code{##1}}}%
  3224. \tablecheck{ftable}%
  3225. }
  3226. \envdef\vtable{%
  3227. \def\itemindex ##1{\doind {vr}{\code{##1}}}%
  3228. \tablecheck{vtable}%
  3229. }
  3230. \def\tablecheck#1{%
  3231. \ifnum \the\catcode`\^^M=\active
  3232. \endgroup
  3233. \errmessage{This command won't work in this context; perhaps the problem is
  3234. that we are \inenvironment\thisenv}%
  3235. \def\next{\doignore{#1}}%
  3236. \else
  3237. \let\next\tablex
  3238. \fi
  3239. \next
  3240. }
  3241. \def\tablex#1{%
  3242. \def\itemindicate{#1}%
  3243. \parsearg\tabley
  3244. }
  3245. \def\tabley#1{%
  3246. {%
  3247. \makevalueexpandable
  3248. \edef\temp{\noexpand\tablez #1\space\space\space}%
  3249. \expandafter
  3250. }\temp \endtablez
  3251. }
  3252. \def\tablez #1 #2 #3 #4\endtablez{%
  3253. \aboveenvbreak
  3254. \ifnum 0#1>0 \advance \leftskip by #1\mil \fi
  3255. \ifnum 0#2>0 \tableindent=#2\mil \fi
  3256. \ifnum 0#3>0 \advance \rightskip by #3\mil \fi
  3257. \itemmax=\tableindent
  3258. \advance \itemmax by -\itemmargin
  3259. \advance \leftskip by \tableindent
  3260. \exdentamount=\tableindent
  3261. \parindent = 0pt
  3262. \parskip = \smallskipamount
  3263. \ifdim \parskip=0pt \parskip=2pt \fi
  3264. \let\item = \internalBitem
  3265. \let\itemx = \internalBitemx
  3266. }
  3267. \def\Etable{\endgraf\afterenvbreak}
  3268. \let\Eftable\Etable
  3269. \let\Evtable\Etable
  3270. \let\Eitemize\Etable
  3271. \let\Eenumerate\Etable
  3272. % This is the counter used by @enumerate, which is really @itemize
  3273. \newcount \itemno
  3274. \envdef\itemize{\parsearg\doitemize}
  3275. \def\doitemize#1{%
  3276. \aboveenvbreak
  3277. \itemmax=\itemindent
  3278. \advance\itemmax by -\itemmargin
  3279. \advance\leftskip by \itemindent
  3280. \exdentamount=\itemindent
  3281. \parindent=0pt
  3282. \parskip=\smallskipamount
  3283. \ifdim\parskip=0pt \parskip=2pt \fi
  3284. %
  3285. % Try typesetting the item mark that if the document erroneously says
  3286. % something like @itemize @samp (intending @table), there's an error
  3287. % right away at the @itemize. It's not the best error message in the
  3288. % world, but it's better than leaving it to the @item. This means if
  3289. % the user wants an empty mark, they have to say @w{} not just @w.
  3290. \def\itemcontents{#1}%
  3291. \setbox0 = \hbox{\itemcontents}%
  3292. %
  3293. % @itemize with no arg is equivalent to @itemize @bullet.
  3294. \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
  3295. %
  3296. \let\item=\itemizeitem
  3297. }
  3298. % Definition of @item while inside @itemize and @enumerate.
  3299. %
  3300. \def\itemizeitem{%
  3301. \advance\itemno by 1 % for enumerations
  3302. {\let\par=\endgraf \smallbreak}% reasonable place to break
  3303. {%
  3304. % If the document has an @itemize directly after a section title, a
  3305. % \nobreak will be last on the list, and \sectionheading will have
  3306. % done a \vskip-\parskip. In that case, we don't want to zero
  3307. % parskip, or the item text will crash with the heading. On the
  3308. % other hand, when there is normal text preceding the item (as there
  3309. % usually is), we do want to zero parskip, or there would be too much
  3310. % space. In that case, we won't have a \nobreak before. At least
  3311. % that's the theory.
  3312. \ifnum\lastpenalty<10000 \parskip=0in \fi
  3313. \noindent
  3314. \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
  3315. %
  3316. \vadjust{\penalty 1200}}% not good to break after first line of item.
  3317. \flushcr
  3318. }
  3319. % \splitoff TOKENS\endmark defines \first to be the first token in
  3320. % TOKENS, and \rest to be the remainder.
  3321. %
  3322. \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
  3323. % Allow an optional argument of an uppercase letter, lowercase letter,
  3324. % or number, to specify the first label in the enumerated list. No
  3325. % argument is the same as `1'.
  3326. %
  3327. \envparseargdef\enumerate{\enumeratey #1 \endenumeratey}
  3328. \def\enumeratey #1 #2\endenumeratey{%
  3329. % If we were given no argument, pretend we were given `1'.
  3330. \def\thearg{#1}%
  3331. \ifx\thearg\empty \def\thearg{1}\fi
  3332. %
  3333. % Detect if the argument is a single token. If so, it might be a
  3334. % letter. Otherwise, the only valid thing it can be is a number.
  3335. % (We will always have one token, because of the test we just made.
  3336. % This is a good thing, since \splitoff doesn't work given nothing at
  3337. % all -- the first parameter is undelimited.)
  3338. \expandafter\splitoff\thearg\endmark
  3339. \ifx\rest\empty
  3340. % Only one token in the argument. It could still be anything.
  3341. % A ``lowercase letter'' is one whose \lccode is nonzero.
  3342. % An ``uppercase letter'' is one whose \lccode is both nonzero, and
  3343. % not equal to itself.
  3344. % Otherwise, we assume it's a number.
  3345. %
  3346. % We need the \relax at the end of the \ifnum lines to stop TeX from
  3347. % continuing to look for a <number>.
  3348. %
  3349. \ifnum\lccode\expandafter`\thearg=0\relax
  3350. \numericenumerate % a number (we hope)
  3351. \else
  3352. % It's a letter.
  3353. \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
  3354. \lowercaseenumerate % lowercase letter
  3355. \else
  3356. \uppercaseenumerate % uppercase letter
  3357. \fi
  3358. \fi
  3359. \else
  3360. % Multiple tokens in the argument. We hope it's a number.
  3361. \numericenumerate
  3362. \fi
  3363. }
  3364. % An @enumerate whose labels are integers. The starting integer is
  3365. % given in \thearg.
  3366. %
  3367. \def\numericenumerate{%
  3368. \itemno = \thearg
  3369. \startenumeration{\the\itemno}%
  3370. }
  3371. % The starting (lowercase) letter is in \thearg.
  3372. \def\lowercaseenumerate{%
  3373. \itemno = \expandafter`\thearg
  3374. \startenumeration{%
  3375. % Be sure we're not beyond the end of the alphabet.
  3376. \ifnum\itemno=0
  3377. \errmessage{No more lowercase letters in @enumerate; get a bigger
  3378. alphabet}%
  3379. \fi
  3380. \char\lccode\itemno
  3381. }%
  3382. }
  3383. % The starting (uppercase) letter is in \thearg.
  3384. \def\uppercaseenumerate{%
  3385. \itemno = \expandafter`\thearg
  3386. \startenumeration{%
  3387. % Be sure we're not beyond the end of the alphabet.
  3388. \ifnum\itemno=0
  3389. \errmessage{No more uppercase letters in @enumerate; get a bigger
  3390. alphabet}
  3391. \fi
  3392. \char\uccode\itemno
  3393. }%
  3394. }
  3395. % Call \doitemize, adding a period to the first argument and supplying the
  3396. % common last two arguments. Also subtract one from the initial value in
  3397. % \itemno, since @item increments \itemno.
  3398. %
  3399. \def\startenumeration#1{%
  3400. \advance\itemno by -1
  3401. \doitemize{#1.}\flushcr
  3402. }
  3403. % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
  3404. % to @enumerate.
  3405. %
  3406. \def\alphaenumerate{\enumerate{a}}
  3407. \def\capsenumerate{\enumerate{A}}
  3408. \def\Ealphaenumerate{\Eenumerate}
  3409. \def\Ecapsenumerate{\Eenumerate}
  3410. % @multitable macros
  3411. % Amy Hendrickson, 8/18/94, 3/6/96
  3412. %
  3413. % @multitable ... @end multitable will make as many columns as desired.
  3414. % Contents of each column will wrap at width given in preamble. Width
  3415. % can be specified either with sample text given in a template line,
  3416. % or in percent of \hsize, the current width of text on page.
  3417. % Table can continue over pages but will only break between lines.
  3418. % To make preamble:
  3419. %
  3420. % Either define widths of columns in terms of percent of \hsize:
  3421. % @multitable @columnfractions .25 .3 .45
  3422. % @item ...
  3423. %
  3424. % Numbers following @columnfractions are the percent of the total
  3425. % current hsize to be used for each column. You may use as many
  3426. % columns as desired.
  3427. % Or use a template:
  3428. % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
  3429. % @item ...
  3430. % using the widest term desired in each column.
  3431. % Each new table line starts with @item, each subsequent new column
  3432. % starts with @tab. Empty columns may be produced by supplying @tab's
  3433. % with nothing between them for as many times as empty columns are needed,
  3434. % ie, @tab@tab@tab will produce two empty columns.
  3435. % @item, @tab do not need to be on their own lines, but it will not hurt
  3436. % if they are.
  3437. % Sample multitable:
  3438. % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
  3439. % @item first col stuff @tab second col stuff @tab third col
  3440. % @item
  3441. % first col stuff
  3442. % @tab
  3443. % second col stuff
  3444. % @tab
  3445. % third col
  3446. % @item first col stuff @tab second col stuff
  3447. % @tab Many paragraphs of text may be used in any column.
  3448. %
  3449. % They will wrap at the width determined by the template.
  3450. % @item@tab@tab This will be in third column.
  3451. % @end multitable
  3452. % Default dimensions may be reset by user.
  3453. % @multitableparskip is vertical space between paragraphs in table.
  3454. % @multitableparindent is paragraph indent in table.
  3455. % @multitablecolmargin is horizontal space to be left between columns.
  3456. % @multitablelinespace is space to leave between table items, baseline
  3457. % to baseline.
  3458. % 0pt means it depends on current normal line spacing.
  3459. %
  3460. \newskip\multitableparskip
  3461. \newskip\multitableparindent
  3462. \newdimen\multitablecolspace
  3463. \newskip\multitablelinespace
  3464. \multitableparskip=0pt
  3465. \multitableparindent=6pt
  3466. \multitablecolspace=12pt
  3467. \multitablelinespace=0pt
  3468. % Macros used to set up halign preamble:
  3469. %
  3470. \let\endsetuptable\relax
  3471. \def\xendsetuptable{\endsetuptable}
  3472. \let\columnfractions\relax
  3473. \def\xcolumnfractions{\columnfractions}
  3474. \newif\ifsetpercent
  3475. % #1 is the @columnfraction, usually a decimal number like .5, but might
  3476. % be just 1. We just use it, whatever it is.
  3477. %
  3478. \def\pickupwholefraction#1 {%
  3479. \global\advance\colcount by 1
  3480. \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}%
  3481. \setuptable
  3482. }
  3483. \newcount\colcount
  3484. \def\setuptable#1{%
  3485. \def\firstarg{#1}%
  3486. \ifx\firstarg\xendsetuptable
  3487. \let\go = \relax
  3488. \else
  3489. \ifx\firstarg\xcolumnfractions
  3490. \global\setpercenttrue
  3491. \else
  3492. \ifsetpercent
  3493. \let\go\pickupwholefraction
  3494. \else
  3495. \global\advance\colcount by 1
  3496. \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
  3497. % separator; typically that is always in the input, anyway.
  3498. \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
  3499. \fi
  3500. \fi
  3501. \ifx\go\pickupwholefraction
  3502. % Put the argument back for the \pickupwholefraction call, so
  3503. % we'll always have a period there to be parsed.
  3504. \def\go{\pickupwholefraction#1}%
  3505. \else
  3506. \let\go = \setuptable
  3507. \fi%
  3508. \fi
  3509. \go
  3510. }
  3511. % multitable-only commands.
  3512. %
  3513. % @headitem starts a heading row, which we typeset in bold.
  3514. % Assignments have to be global since we are inside the implicit group
  3515. % of an alignment entry. \everycr resets \everytab so we don't have to
  3516. % undo it ourselves.
  3517. \def\headitemfont{\b}% for people to use in the template row; not changeable
  3518. \def\headitem{%
  3519. \checkenv\multitable
  3520. \crcr
  3521. \global\everytab={\bf}% can't use \headitemfont since the parsing differs
  3522. \the\everytab % for the first item
  3523. }%
  3524. %
  3525. % A \tab used to include \hskip1sp. But then the space in a template
  3526. % line is not enough. That is bad. So let's go back to just `&' until
  3527. % we again encounter the problem the 1sp was intended to solve.
  3528. % --karl, nathan@acm.org, 20apr99.
  3529. \def\tab{\checkenv\multitable &\the\everytab}%
  3530. % @multitable ... @end multitable definitions:
  3531. %
  3532. \newtoks\everytab % insert after every tab.
  3533. %
  3534. \envdef\multitable{%
  3535. \vskip\parskip
  3536. \startsavinginserts
  3537. %
  3538. % @item within a multitable starts a normal row.
  3539. % We use \def instead of \let so that if one of the multitable entries
  3540. % contains an @itemize, we don't choke on the \item (seen as \crcr aka
  3541. % \endtemplate) expanding \doitemize.
  3542. \def\item{\crcr}%
  3543. %
  3544. \tolerance=9500
  3545. \hbadness=9500
  3546. \setmultitablespacing
  3547. \parskip=\multitableparskip
  3548. \parindent=\multitableparindent
  3549. \overfullrule=0pt
  3550. \global\colcount=0
  3551. %
  3552. \everycr = {%
  3553. \noalign{%
  3554. \global\everytab={}%
  3555. \global\colcount=0 % Reset the column counter.
  3556. % Check for saved footnotes, etc.
  3557. \checkinserts
  3558. % Keeps underfull box messages off when table breaks over pages.
  3559. %\filbreak
  3560. % Maybe so, but it also creates really weird page breaks when the
  3561. % table breaks over pages. Wouldn't \vfil be better? Wait until the
  3562. % problem manifests itself, so it can be fixed for real --karl.
  3563. }%
  3564. }%
  3565. %
  3566. \parsearg\domultitable
  3567. }
  3568. \def\domultitable#1{%
  3569. % To parse everything between @multitable and @item:
  3570. \setuptable#1 \endsetuptable
  3571. %
  3572. % This preamble sets up a generic column definition, which will
  3573. % be used as many times as user calls for columns.
  3574. % \vtop will set a single line and will also let text wrap and
  3575. % continue for many paragraphs if desired.
  3576. \halign\bgroup &%
  3577. \global\advance\colcount by 1
  3578. \multistrut
  3579. \vtop{%
  3580. % Use the current \colcount to find the correct column width:
  3581. \hsize=\expandafter\csname col\the\colcount\endcsname
  3582. %
  3583. % In order to keep entries from bumping into each other
  3584. % we will add a \leftskip of \multitablecolspace to all columns after
  3585. % the first one.
  3586. %
  3587. % If a template has been used, we will add \multitablecolspace
  3588. % to the width of each template entry.
  3589. %
  3590. % If the user has set preamble in terms of percent of \hsize we will
  3591. % use that dimension as the width of the column, and the \leftskip
  3592. % will keep entries from bumping into each other. Table will start at
  3593. % left margin and final column will justify at right margin.
  3594. %
  3595. % Make sure we don't inherit \rightskip from the outer environment.
  3596. \rightskip=0pt
  3597. \ifnum\colcount=1
  3598. % The first column will be indented with the surrounding text.
  3599. \advance\hsize by\leftskip
  3600. \else
  3601. \ifsetpercent \else
  3602. % If user has not set preamble in terms of percent of \hsize
  3603. % we will advance \hsize by \multitablecolspace.
  3604. \advance\hsize by \multitablecolspace
  3605. \fi
  3606. % In either case we will make \leftskip=\multitablecolspace:
  3607. \leftskip=\multitablecolspace
  3608. \fi
  3609. % Ignoring space at the beginning and end avoids an occasional spurious
  3610. % blank line, when TeX decides to break the line at the space before the
  3611. % box from the multistrut, so the strut ends up on a line by itself.
  3612. % For example:
  3613. % @multitable @columnfractions .11 .89
  3614. % @item @code{#}
  3615. % @tab Legal holiday which is valid in major parts of the whole country.
  3616. % Is automatically provided with highlighting sequences respectively
  3617. % marking characters.
  3618. \noindent\ignorespaces##\unskip\multistrut
  3619. }\cr
  3620. }
  3621. \def\Emultitable{%
  3622. \crcr
  3623. \egroup % end the \halign
  3624. \global\setpercentfalse
  3625. }
  3626. \def\setmultitablespacing{%
  3627. \def\multistrut{\strut}% just use the standard line spacing
  3628. %
  3629. % Compute \multitablelinespace (if not defined by user) for use in
  3630. % \multitableparskip calculation. We used define \multistrut based on
  3631. % this, but (ironically) that caused the spacing to be off.
  3632. % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100.
  3633. \ifdim\multitablelinespace=0pt
  3634. \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
  3635. \global\advance\multitablelinespace by-\ht0
  3636. \fi
  3637. % Test to see if parskip is larger than space between lines of
  3638. % table. If not, do nothing.
  3639. % If so, set to same dimension as multitablelinespace.
  3640. \ifdim\multitableparskip>\multitablelinespace
  3641. \global\multitableparskip=\multitablelinespace
  3642. \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
  3643. % than skip between lines in the table.
  3644. \fi%
  3645. \ifdim\multitableparskip=0pt
  3646. \global\multitableparskip=\multitablelinespace
  3647. \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
  3648. % than skip between lines in the table.
  3649. \fi}
  3650. \message{conditionals,}
  3651. % @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext,
  3652. % @ifnotxml always succeed. They currently do nothing; we don't
  3653. % attempt to check whether the conditionals are properly nested. But we
  3654. % have to remember that they are conditionals, so that @end doesn't
  3655. % attempt to close an environment group.
  3656. %
  3657. \def\makecond#1{%
  3658. \expandafter\let\csname #1\endcsname = \relax
  3659. \expandafter\let\csname iscond.#1\endcsname = 1
  3660. }
  3661. \makecond{iftex}
  3662. \makecond{ifnotdocbook}
  3663. \makecond{ifnothtml}
  3664. \makecond{ifnotinfo}
  3665. \makecond{ifnotplaintext}
  3666. \makecond{ifnotxml}
  3667. % Ignore @ignore, @ifhtml, @ifinfo, and the like.
  3668. %
  3669. \def\direntry{\doignore{direntry}}
  3670. \def\documentdescription{\doignore{documentdescription}}
  3671. \def\docbook{\doignore{docbook}}
  3672. \def\html{\doignore{html}}
  3673. \def\ifdocbook{\doignore{ifdocbook}}
  3674. \def\ifhtml{\doignore{ifhtml}}
  3675. \def\ifinfo{\doignore{ifinfo}}
  3676. \def\ifnottex{\doignore{ifnottex}}
  3677. \def\ifplaintext{\doignore{ifplaintext}}
  3678. \def\ifxml{\doignore{ifxml}}
  3679. \def\ignore{\doignore{ignore}}
  3680. \def\menu{\doignore{menu}}
  3681. \def\xml{\doignore{xml}}
  3682. % Ignore text until a line `@end #1', keeping track of nested conditionals.
  3683. %
  3684. % A count to remember the depth of nesting.
  3685. \newcount\doignorecount
  3686. \def\doignore#1{\begingroup
  3687. % Scan in ``verbatim'' mode:
  3688. \obeylines
  3689. \catcode`\@ = \other
  3690. \catcode`\{ = \other
  3691. \catcode`\} = \other
  3692. %
  3693. % Make sure that spaces turn into tokens that match what \doignoretext wants.
  3694. \spaceisspace
  3695. %
  3696. % Count number of #1's that we've seen.
  3697. \doignorecount = 0
  3698. %
  3699. % Swallow text until we reach the matching `@end #1'.
  3700. \dodoignore{#1}%
  3701. }
  3702. { \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source.
  3703. \obeylines %
  3704. %
  3705. \gdef\dodoignore#1{%
  3706. % #1 contains the command name as a string, e.g., `ifinfo'.
  3707. %
  3708. % Define a command to find the next `@end #1'.
  3709. \long\def\doignoretext##1^^M@end #1{%
  3710. \doignoretextyyy##1^^M@#1\_STOP_}%
  3711. %
  3712. % And this command to find another #1 command, at the beginning of a
  3713. % line. (Otherwise, we would consider a line `@c @ifset', for
  3714. % example, to count as an @ifset for nesting.)
  3715. \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%
  3716. %
  3717. % And now expand that command.
  3718. \doignoretext ^^M%
  3719. }%
  3720. }
  3721. \def\doignoreyyy#1{%
  3722. \def\temp{#1}%
  3723. \ifx\temp\empty % Nothing found.
  3724. \let\next\doignoretextzzz
  3725. \else % Found a nested condition, ...
  3726. \advance\doignorecount by 1
  3727. \let\next\doignoretextyyy % ..., look for another.
  3728. % If we're here, #1 ends with ^^M\ifinfo (for example).
  3729. \fi
  3730. \next #1% the token \_STOP_ is present just after this macro.
  3731. }
  3732. % We have to swallow the remaining "\_STOP_".
  3733. %
  3734. \def\doignoretextzzz#1{%
  3735. \ifnum\doignorecount = 0 % We have just found the outermost @end.
  3736. \let\next\enddoignore
  3737. \else % Still inside a nested condition.
  3738. \advance\doignorecount by -1
  3739. \let\next\doignoretext % Look for the next @end.
  3740. \fi
  3741. \next
  3742. }
  3743. % Finish off ignored text.
  3744. { \obeylines%
  3745. % Ignore anything after the last `@end #1'; this matters in verbatim
  3746. % environments, where otherwise the newline after an ignored conditional
  3747. % would result in a blank line in the output.
  3748. \gdef\enddoignore#1^^M{\endgroup\ignorespaces}%
  3749. }
  3750. % @set VAR sets the variable VAR to an empty value.
  3751. % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
  3752. %
  3753. % Since we want to separate VAR from REST-OF-LINE (which might be
  3754. % empty), we can't just use \parsearg; we have to insert a space of our
  3755. % own to delimit the rest of the line, and then take it out again if we
  3756. % didn't need it.
  3757. % We rely on the fact that \parsearg sets \catcode`\ =10.
  3758. %
  3759. \parseargdef\set{\setyyy#1 \endsetyyy}
  3760. \def\setyyy#1 #2\endsetyyy{%
  3761. {%
  3762. \makevalueexpandable
  3763. \def\temp{#2}%
  3764. \edef\next{\gdef\makecsname{SET#1}}%
  3765. \ifx\temp\empty
  3766. \next{}%
  3767. \else
  3768. \setzzz#2\endsetzzz
  3769. \fi
  3770. }%
  3771. }
  3772. % Remove the trailing space \setxxx inserted.
  3773. \def\setzzz#1 \endsetzzz{\next{#1}}
  3774. % @clear VAR clears (i.e., unsets) the variable VAR.
  3775. %
  3776. \parseargdef\clear{%
  3777. {%
  3778. \makevalueexpandable
  3779. \global\expandafter\let\csname SET#1\endcsname=\relax
  3780. }%
  3781. }
  3782. % @value{foo} gets the text saved in variable foo.
  3783. \def\value{\begingroup\makevalueexpandable\valuexxx}
  3784. \def\valuexxx#1{\expandablevalue{#1}\endgroup}
  3785. {
  3786. \catcode`\- = \active \catcode`\_ = \active
  3787. %
  3788. \gdef\makevalueexpandable{%
  3789. \let\value = \expandablevalue
  3790. % We don't want these characters active, ...
  3791. \catcode`\-=\other \catcode`\_=\other
  3792. % ..., but we might end up with active ones in the argument if
  3793. % we're called from @code, as @code{@value{foo-bar_}}, though.
  3794. % So \let them to their normal equivalents.
  3795. \let-\realdash \let_\normalunderscore
  3796. }
  3797. }
  3798. % We have this subroutine so that we can handle at least some @value's
  3799. % properly in indexes (we call \makevalueexpandable in \indexdummies).
  3800. % The command has to be fully expandable (if the variable is set), since
  3801. % the result winds up in the index file. This means that if the
  3802. % variable's value contains other Texinfo commands, it's almost certain
  3803. % it will fail (although perhaps we could fix that with sufficient work
  3804. % to do a one-level expansion on the result, instead of complete).
  3805. %
  3806. \def\expandablevalue#1{%
  3807. \expandafter\ifx\csname SET#1\endcsname\relax
  3808. {[No value for ``#1'']}%
  3809. \message{Variable `#1', used in @value, is not set.}%
  3810. \else
  3811. \csname SET#1\endcsname
  3812. \fi
  3813. }
  3814. % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
  3815. % with @set.
  3816. %
  3817. % To get special treatment of `@end ifset,' call \makeond and the redefine.
  3818. %
  3819. \makecond{ifset}
  3820. \def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}
  3821. \def\doifset#1#2{%
  3822. {%
  3823. \makevalueexpandable
  3824. \let\next=\empty
  3825. \expandafter\ifx\csname SET#2\endcsname\relax
  3826. #1% If not set, redefine \next.
  3827. \fi
  3828. \expandafter
  3829. }\next
  3830. }
  3831. \def\ifsetfail{\doignore{ifset}}
  3832. % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
  3833. % defined with @set, or has been undefined with @clear.
  3834. %
  3835. % The `\else' inside the `\doifset' parameter is a trick to reuse the
  3836. % above code: if the variable is not set, do nothing, if it is set,
  3837. % then redefine \next to \ifclearfail.
  3838. %
  3839. \makecond{ifclear}
  3840. \def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
  3841. \def\ifclearfail{\doignore{ifclear}}
  3842. % @dircategory CATEGORY -- specify a category of the dir file
  3843. % which this file should belong to. Ignore this in TeX.
  3844. \let\dircategory=\comment
  3845. % @defininfoenclose.
  3846. \let\definfoenclose=\comment
  3847. \message{indexing,}
  3848. % Index generation facilities
  3849. % Define \newwrite to be identical to plain tex's \newwrite
  3850. % except not \outer, so it can be used within macros and \if's.
  3851. \edef\newwrite{\makecsname{ptexnewwrite}}
  3852. % \newindex {foo} defines an index named foo.
  3853. % It automatically defines \fooindex such that
  3854. % \fooindex ...rest of line... puts an entry in the index foo.
  3855. % It also defines \fooindfile to be the number of the output channel for
  3856. % the file that accumulates this index. The file's extension is foo.
  3857. % The name of an index should be no more than 2 characters long
  3858. % for the sake of vms.
  3859. %
  3860. \def\newindex#1{%
  3861. \iflinks
  3862. \expandafter\newwrite \csname#1indfile\endcsname
  3863. \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
  3864. \fi
  3865. \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
  3866. \noexpand\doindex{#1}}
  3867. }
  3868. % @defindex foo == \newindex{foo}
  3869. %
  3870. \def\defindex{\parsearg\newindex}
  3871. % Define @defcodeindex, like @defindex except put all entries in @code.
  3872. %
  3873. \def\defcodeindex{\parsearg\newcodeindex}
  3874. %
  3875. \def\newcodeindex#1{%
  3876. \iflinks
  3877. \expandafter\newwrite \csname#1indfile\endcsname
  3878. \openout \csname#1indfile\endcsname \jobname.#1
  3879. \fi
  3880. \expandafter\xdef\csname#1index\endcsname{%
  3881. \noexpand\docodeindex{#1}}%
  3882. }
  3883. % @synindex foo bar makes index foo feed into index bar.
  3884. % Do this instead of @defindex foo if you don't want it as a separate index.
  3885. %
  3886. % @syncodeindex foo bar similar, but put all entries made for index foo
  3887. % inside @code.
  3888. %
  3889. \def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
  3890. \def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
  3891. % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
  3892. % #3 the target index (bar).
  3893. \def\dosynindex#1#2#3{%
  3894. % Only do \closeout if we haven't already done it, else we'll end up
  3895. % closing the target index.
  3896. \expandafter \ifx\csname donesynindex#2\endcsname \relax
  3897. % The \closeout helps reduce unnecessary open files; the limit on the
  3898. % Acorn RISC OS is a mere 16 files.
  3899. \expandafter\closeout\csname#2indfile\endcsname
  3900. \expandafter\let\csname donesynindex#2\endcsname = 1
  3901. \fi
  3902. % redefine \fooindfile:
  3903. \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
  3904. \expandafter\let\csname#2indfile\endcsname=\temp
  3905. % redefine \fooindex:
  3906. \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
  3907. }
  3908. % Define \doindex, the driver for all \fooindex macros.
  3909. % Argument #1 is generated by the calling \fooindex macro,
  3910. % and it is "foo", the name of the index.
  3911. % \doindex just uses \parsearg; it calls \doind for the actual work.
  3912. % This is because \doind is more useful to call from other macros.
  3913. % There is also \dosubind {index}{topic}{subtopic}
  3914. % which makes an entry in a two-level index such as the operation index.
  3915. \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
  3916. \def\singleindexer #1{\doind{\indexname}{#1}}
  3917. % like the previous two, but they put @code around the argument.
  3918. \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
  3919. \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
  3920. % Take care of Texinfo commands that can appear in an index entry.
  3921. % Since there are some commands we want to expand, and others we don't,
  3922. % we have to laboriously prevent expansion for those that we don't.
  3923. %
  3924. \def\indexdummies{%
  3925. \escapechar = `\\ % use backslash in output files.
  3926. \def\@{@}% change to @@ when we switch to @ as escape char in index files.
  3927. \def\ {\realbackslash\space }%
  3928. %
  3929. % Need these unexpandable (because we define \tt as a dummy)
  3930. % definitions when @{ or @} appear in index entry text. Also, more
  3931. % complicated, when \tex is in effect and \{ is a \delimiter again.
  3932. % We can't use \lbracecmd and \rbracecmd because texindex assumes
  3933. % braces and backslashes are used only as delimiters. Perhaps we
  3934. % should define @lbrace and @rbrace commands a la @comma.
  3935. \def\{{{\tt\char123}}%
  3936. \def\}{{\tt\char125}}%
  3937. %
  3938. % I don't entirely understand this, but when an index entry is
  3939. % generated from a macro call, the \endinput which \scanmacro inserts
  3940. % causes processing to be prematurely terminated. This is,
  3941. % apparently, because \indexsorttmp is fully expanded, and \endinput
  3942. % is an expandable command. The redefinition below makes \endinput
  3943. % disappear altogether for that purpose -- although logging shows that
  3944. % processing continues to some further point. On the other hand, it
  3945. % seems \endinput does not hurt in the printed index arg, since that
  3946. % is still getting written without apparent harm.
  3947. %
  3948. % Sample source (mac-idx3.tex, reported by Graham Percival to
  3949. % help-texinfo, 22may06):
  3950. % @macro funindex {WORD}
  3951. % @findex xyz
  3952. % @end macro
  3953. % ...
  3954. % @funindex commtest
  3955. %
  3956. % The above is not enough to reproduce the bug, but it gives the flavor.
  3957. %
  3958. % Sample whatsit resulting:
  3959. % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}}
  3960. %
  3961. % So:
  3962. \let\endinput = \empty
  3963. %
  3964. % Do the redefinitions.
  3965. \commondummies
  3966. }
  3967. % For the aux and toc files, @ is the escape character. So we want to
  3968. % redefine everything using @ as the escape character (instead of
  3969. % \realbackslash, still used for index files). When everything uses @,
  3970. % this will be simpler.
  3971. %
  3972. \def\atdummies{%
  3973. \def\@{@@}%
  3974. \def\ {@ }%
  3975. \let\{ = \lbraceatcmd
  3976. \let\} = \rbraceatcmd
  3977. %
  3978. % Do the redefinitions.
  3979. \commondummies
  3980. \otherbackslash
  3981. }
  3982. % Called from \indexdummies and \atdummies.
  3983. %
  3984. \def\commondummies{%
  3985. %
  3986. % \definedummyword defines \#1 as \string\#1\space, thus effectively
  3987. % preventing its expansion. This is used only for control words,
  3988. % not control letters, because the \space would be incorrect for
  3989. % control characters, but is needed to separate the control word
  3990. % from whatever follows.
  3991. %
  3992. % For control letters, we have \definedummyletter, which omits the
  3993. % space.
  3994. %
  3995. % These can be used both for control words that take an argument and
  3996. % those that do not. If it is followed by {arg} in the input, then
  3997. % that will dutifully get written to the index (or wherever).
  3998. %
  3999. \def\definedummyword ##1{\def##1{\string##1\space}}%
  4000. \def\definedummyletter##1{\def##1{\string##1}}%
  4001. \let\definedummyaccent\definedummyletter
  4002. %
  4003. \commondummiesnofonts
  4004. %
  4005. \definedummyletter\_%
  4006. \definedummyletter\-%
  4007. %
  4008. % Non-English letters.
  4009. \definedummyword\AA
  4010. \definedummyword\AE
  4011. \definedummyword\DH
  4012. \definedummyword\L
  4013. \definedummyword\O
  4014. \definedummyword\OE
  4015. \definedummyword\TH
  4016. \definedummyword\aa
  4017. \definedummyword\ae
  4018. \definedummyword\dh
  4019. \definedummyword\exclamdown
  4020. \definedummyword\l
  4021. \definedummyword\o
  4022. \definedummyword\oe
  4023. \definedummyword\ordf
  4024. \definedummyword\ordm
  4025. \definedummyword\questiondown
  4026. \definedummyword\ss
  4027. \definedummyword\th
  4028. %
  4029. % Although these internal commands shouldn't show up, sometimes they do.
  4030. \definedummyword\bf
  4031. \definedummyword\gtr
  4032. \definedummyword\hat
  4033. \definedummyword\less
  4034. \definedummyword\sf
  4035. \definedummyword\sl
  4036. \definedummyword\tclose
  4037. \definedummyword\tt
  4038. %
  4039. \definedummyword\LaTeX
  4040. \definedummyword\TeX
  4041. %
  4042. % Assorted special characters.
  4043. \definedummyword\arrow
  4044. \definedummyword\bullet
  4045. \definedummyword\comma
  4046. \definedummyword\copyright
  4047. \definedummyword\registeredsymbol
  4048. \definedummyword\dots
  4049. \definedummyword\enddots
  4050. \definedummyword\entrybreak
  4051. \definedummyword\equiv
  4052. \definedummyword\error
  4053. \definedummyword\euro
  4054. \definedummyword\expansion
  4055. \definedummyword\geq
  4056. \definedummyword\guillemetleft
  4057. \definedummyword\guillemetright
  4058. \definedummyword\guilsinglleft
  4059. \definedummyword\guilsinglright
  4060. \definedummyword\leq
  4061. \definedummyword\minus
  4062. \definedummyword\ogonek
  4063. \definedummyword\pounds
  4064. \definedummyword\point
  4065. \definedummyword\print
  4066. \definedummyword\quotedblbase
  4067. \definedummyword\quotedblleft
  4068. \definedummyword\quotedblright
  4069. \definedummyword\quoteleft
  4070. \definedummyword\quoteright
  4071. \definedummyword\quotesinglbase
  4072. \definedummyword\result
  4073. \definedummyword\textdegree
  4074. %
  4075. % We want to disable all macros so that they are not expanded by \write.
  4076. \macrolist
  4077. %
  4078. \normalturnoffactive
  4079. %
  4080. % Handle some cases of @value -- where it does not contain any
  4081. % (non-fully-expandable) commands.
  4082. \makevalueexpandable
  4083. }
  4084. % \commondummiesnofonts: common to \commondummies and \indexnofonts.
  4085. %
  4086. \def\commondummiesnofonts{%
  4087. % Control letters and accents.
  4088. \definedummyletter\!%
  4089. \definedummyaccent\"%
  4090. \definedummyaccent\'%
  4091. \definedummyletter\*%
  4092. \definedummyaccent\,%
  4093. \definedummyletter\.%
  4094. \definedummyletter\/%
  4095. \definedummyletter\:%
  4096. \definedummyaccent\=%
  4097. \definedummyletter\?%
  4098. \definedummyaccent\^%
  4099. \definedummyaccent\`%
  4100. \definedummyaccent\~%
  4101. \definedummyword\u
  4102. \definedummyword\v
  4103. \definedummyword\H
  4104. \definedummyword\dotaccent
  4105. \definedummyword\ogonek
  4106. \definedummyword\ringaccent
  4107. \definedummyword\tieaccent
  4108. \definedummyword\ubaraccent
  4109. \definedummyword\udotaccent
  4110. \definedummyword\dotless
  4111. %
  4112. % Texinfo font commands.
  4113. \definedummyword\b
  4114. \definedummyword\i
  4115. \definedummyword\r
  4116. \definedummyword\sansserif
  4117. \definedummyword\sc
  4118. \definedummyword\slanted
  4119. \definedummyword\t
  4120. %
  4121. % Commands that take arguments.
  4122. \definedummyword\acronym
  4123. \definedummyword\cite
  4124. \definedummyword\code
  4125. \definedummyword\command
  4126. \definedummyword\dfn
  4127. \definedummyword\dmn
  4128. \definedummyword\email
  4129. \definedummyword\emph
  4130. \definedummyword\env
  4131. \definedummyword\file
  4132. \definedummyword\indicateurl
  4133. \definedummyword\kbd
  4134. \definedummyword\key
  4135. \definedummyword\math
  4136. \definedummyword\option
  4137. \definedummyword\pxref
  4138. \definedummyword\ref
  4139. \definedummyword\samp
  4140. \definedummyword\strong
  4141. \definedummyword\tie
  4142. \definedummyword\uref
  4143. \definedummyword\url
  4144. \definedummyword\var
  4145. \definedummyword\verb
  4146. \definedummyword\w
  4147. \definedummyword\xref
  4148. }
  4149. % \indexnofonts is used when outputting the strings to sort the index
  4150. % by, and when constructing control sequence names. It eliminates all
  4151. % control sequences and just writes whatever the best ASCII sort string
  4152. % would be for a given command (usually its argument).
  4153. %
  4154. \def\indexnofonts{%
  4155. % Accent commands should become @asis.
  4156. \def\definedummyaccent##1{\let##1\asis}%
  4157. % We can just ignore other control letters.
  4158. \def\definedummyletter##1{\let##1\empty}%
  4159. % All control words become @asis by default; overrides below.
  4160. \let\definedummyword\definedummyaccent
  4161. %
  4162. \commondummiesnofonts
  4163. %
  4164. % Don't no-op \tt, since it isn't a user-level command
  4165. % and is used in the definitions of the active chars like <, >, |, etc.
  4166. % Likewise with the other plain tex font commands.
  4167. %\let\tt=\asis
  4168. %
  4169. \def\ { }%
  4170. \def\@{@}%
  4171. \def\_{\normalunderscore}%
  4172. \def\-{}% @- shouldn't affect sorting
  4173. %
  4174. % Unfortunately, texindex is not prepared to handle braces in the
  4175. % content at all. So for index sorting, we map @{ and @} to strings
  4176. % starting with |, since that ASCII character is between ASCII { and }.
  4177. \def\{{|a}%
  4178. \def\}{|b}%
  4179. %
  4180. % Non-English letters.
  4181. \def\AA{AA}%
  4182. \def\AE{AE}%
  4183. \def\DH{DZZ}%
  4184. \def\L{L}%
  4185. \def\OE{OE}%
  4186. \def\O{O}%
  4187. \def\TH{ZZZ}%
  4188. \def\aa{aa}%
  4189. \def\ae{ae}%
  4190. \def\dh{dzz}%
  4191. \def\exclamdown{!}%
  4192. \def\l{l}%
  4193. \def\oe{oe}%
  4194. \def\ordf{a}%
  4195. \def\ordm{o}%
  4196. \def\o{o}%
  4197. \def\questiondown{?}%
  4198. \def\ss{ss}%
  4199. \def\th{zzz}%
  4200. %
  4201. \def\LaTeX{LaTeX}%
  4202. \def\TeX{TeX}%
  4203. %
  4204. % Assorted special characters.
  4205. % (The following {} will end up in the sort string, but that's ok.)
  4206. \def\arrow{->}%
  4207. \def\bullet{bullet}%
  4208. \def\comma{,}%
  4209. \def\copyright{copyright}%
  4210. \def\dots{...}%
  4211. \def\enddots{...}%
  4212. \def\equiv{==}%
  4213. \def\error{error}%
  4214. \def\euro{euro}%
  4215. \def\expansion{==>}%
  4216. \def\geq{>=}%
  4217. \def\guillemetleft{<<}%
  4218. \def\guillemetright{>>}%
  4219. \def\guilsinglleft{<}%
  4220. \def\guilsinglright{>}%
  4221. \def\leq{<=}%
  4222. \def\minus{-}%
  4223. \def\point{.}%
  4224. \def\pounds{pounds}%
  4225. \def\print{-|}%
  4226. \def\quotedblbase{"}%
  4227. \def\quotedblleft{"}%
  4228. \def\quotedblright{"}%
  4229. \def\quoteleft{`}%
  4230. \def\quoteright{'}%
  4231. \def\quotesinglbase{,}%
  4232. \def\registeredsymbol{R}%
  4233. \def\result{=>}%
  4234. \def\textdegree{o}%
  4235. %
  4236. \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax
  4237. \else \indexlquoteignore \fi
  4238. %
  4239. % We need to get rid of all macros, leaving only the arguments (if present).
  4240. % Of course this is not nearly correct, but it is the best we can do for now.
  4241. % makeinfo does not expand macros in the argument to @deffn, which ends up
  4242. % writing an index entry, and texindex isn't prepared for an index sort entry
  4243. % that starts with \.
  4244. %
  4245. % Since macro invocations are followed by braces, we can just redefine them
  4246. % to take a single TeX argument. The case of a macro invocation that
  4247. % goes to end-of-line is not handled.
  4248. %
  4249. \macrolist
  4250. }
  4251. % Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us
  4252. % ignore left quotes in the sort term.
  4253. {\catcode`\`=\active
  4254. \gdef\indexlquoteignore{\let`=\empty}}
  4255. \let\indexbackslash=0 %overridden during \printindex.
  4256. \let\SETmarginindex=\relax % put index entries in margin (undocumented)?
  4257. % Most index entries go through here, but \dosubind is the general case.
  4258. % #1 is the index name, #2 is the entry text.
  4259. \def\doind#1#2{\dosubind{#1}{#2}{}}
  4260. % Workhorse for all \fooindexes.
  4261. % #1 is name of index, #2 is stuff to put there, #3 is subentry --
  4262. % empty if called from \doind, as we usually are (the main exception
  4263. % is with most defuns, which call us directly).
  4264. %
  4265. \def\dosubind#1#2#3{%
  4266. \iflinks
  4267. {%
  4268. % Store the main index entry text (including the third arg).
  4269. \toks0 = {#2}%
  4270. % If third arg is present, precede it with a space.
  4271. \def\thirdarg{#3}%
  4272. \ifx\thirdarg\empty \else
  4273. \toks0 = \expandafter{\the\toks0 \space #3}%
  4274. \fi
  4275. %
  4276. \edef\writeto{\csname#1indfile\endcsname}%
  4277. %
  4278. \safewhatsit\dosubindwrite
  4279. }%
  4280. \fi
  4281. }
  4282. % Write the entry in \toks0 to the index file:
  4283. %
  4284. \def\dosubindwrite{%
  4285. % Put the index entry in the margin if desired.
  4286. \ifx\SETmarginindex\relax\else
  4287. \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}%
  4288. \fi
  4289. %
  4290. % Remember, we are within a group.
  4291. \indexdummies % Must do this here, since \bf, etc expand at this stage
  4292. \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now
  4293. % so it will be output as is; and it will print as backslash.
  4294. %
  4295. % Process the index entry with all font commands turned off, to
  4296. % get the string to sort by.
  4297. {\indexnofonts
  4298. \edef\temp{\the\toks0}% need full expansion
  4299. \xdef\indexsorttmp{\temp}%
  4300. }%
  4301. %
  4302. % Set up the complete index entry, with both the sort key and
  4303. % the original text, including any font commands. We write
  4304. % three arguments to \entry to the .?? file (four in the
  4305. % subentry case), texindex reduces to two when writing the .??s
  4306. % sorted result.
  4307. \edef\temp{%
  4308. \write\writeto{%
  4309. \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}%
  4310. }%
  4311. \temp
  4312. }
  4313. % Take care of unwanted page breaks/skips around a whatsit:
  4314. %
  4315. % If a skip is the last thing on the list now, preserve it
  4316. % by backing up by \lastskip, doing the \write, then inserting
  4317. % the skip again. Otherwise, the whatsit generated by the
  4318. % \write or \pdfdest will make \lastskip zero. The result is that
  4319. % sequences like this:
  4320. % @end defun
  4321. % @tindex whatever
  4322. % @defun ...
  4323. % will have extra space inserted, because the \medbreak in the
  4324. % start of the @defun won't see the skip inserted by the @end of
  4325. % the previous defun.
  4326. %
  4327. % But don't do any of this if we're not in vertical mode. We
  4328. % don't want to do a \vskip and prematurely end a paragraph.
  4329. %
  4330. % Avoid page breaks due to these extra skips, too.
  4331. %
  4332. % But wait, there is a catch there:
  4333. % We'll have to check whether \lastskip is zero skip. \ifdim is not
  4334. % sufficient for this purpose, as it ignores stretch and shrink parts
  4335. % of the skip. The only way seems to be to check the textual
  4336. % representation of the skip.
  4337. %
  4338. % The following is almost like \def\zeroskipmacro{0.0pt} except that
  4339. % the ``p'' and ``t'' characters have catcode \other, not 11 (letter).
  4340. %
  4341. \edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname}
  4342. %
  4343. \newskip\whatsitskip
  4344. \newcount\whatsitpenalty
  4345. %
  4346. % ..., ready, GO:
  4347. %
  4348. \def\safewhatsit#1{%
  4349. \ifhmode
  4350. #1%
  4351. \else
  4352. % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
  4353. \whatsitskip = \lastskip
  4354. \edef\lastskipmacro{\the\lastskip}%
  4355. \whatsitpenalty = \lastpenalty
  4356. %
  4357. % If \lastskip is nonzero, that means the last item was a
  4358. % skip. And since a skip is discardable, that means this
  4359. % -\whatsitskip glue we're inserting is preceded by a
  4360. % non-discardable item, therefore it is not a potential
  4361. % breakpoint, therefore no \nobreak needed.
  4362. \ifx\lastskipmacro\zeroskipmacro
  4363. \else
  4364. \vskip-\whatsitskip
  4365. \fi
  4366. %
  4367. #1%
  4368. %
  4369. \ifx\lastskipmacro\zeroskipmacro
  4370. % If \lastskip was zero, perhaps the last item was a penalty, and
  4371. % perhaps it was >=10000, e.g., a \nobreak. In that case, we want
  4372. % to re-insert the same penalty (values >10000 are used for various
  4373. % signals); since we just inserted a non-discardable item, any
  4374. % following glue (such as a \parskip) would be a breakpoint. For example:
  4375. %
  4376. % @deffn deffn-whatever
  4377. % @vindex index-whatever
  4378. % Description.
  4379. % would allow a break between the index-whatever whatsit
  4380. % and the "Description." paragraph.
  4381. \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi
  4382. \else
  4383. % On the other hand, if we had a nonzero \lastskip,
  4384. % this make-up glue would be preceded by a non-discardable item
  4385. % (the whatsit from the \write), so we must insert a \nobreak.
  4386. \nobreak\vskip\whatsitskip
  4387. \fi
  4388. \fi
  4389. }
  4390. % The index entry written in the file actually looks like
  4391. % \entry {sortstring}{page}{topic}
  4392. % or
  4393. % \entry {sortstring}{page}{topic}{subtopic}
  4394. % The texindex program reads in these files and writes files
  4395. % containing these kinds of lines:
  4396. % \initial {c}
  4397. % before the first topic whose initial is c
  4398. % \entry {topic}{pagelist}
  4399. % for a topic that is used without subtopics
  4400. % \primary {topic}
  4401. % for the beginning of a topic that is used with subtopics
  4402. % \secondary {subtopic}{pagelist}
  4403. % for each subtopic.
  4404. % Define the user-accessible indexing commands
  4405. % @findex, @vindex, @kindex, @cindex.
  4406. \def\findex {\fnindex}
  4407. \def\kindex {\kyindex}
  4408. \def\cindex {\cpindex}
  4409. \def\vindex {\vrindex}
  4410. \def\tindex {\tpindex}
  4411. \def\pindex {\pgindex}
  4412. \def\cindexsub {\begingroup\obeylines\cindexsub}
  4413. {\obeylines %
  4414. \gdef\cindexsub "#1" #2^^M{\endgroup %
  4415. \dosubind{cp}{#2}{#1}}}
  4416. % Define the macros used in formatting output of the sorted index material.
  4417. % @printindex causes a particular index (the ??s file) to get printed.
  4418. % It does not print any chapter heading (usually an @unnumbered).
  4419. %
  4420. \parseargdef\printindex{\begingroup
  4421. \dobreak \chapheadingskip{10000}%
  4422. %
  4423. \smallfonts \rm
  4424. \tolerance = 9500
  4425. \plainfrenchspacing
  4426. \everypar = {}% don't want the \kern\-parindent from indentation suppression.
  4427. %
  4428. % See if the index file exists and is nonempty.
  4429. % Change catcode of @ here so that if the index file contains
  4430. % \initial {@}
  4431. % as its first line, TeX doesn't complain about mismatched braces
  4432. % (because it thinks @} is a control sequence).
  4433. \catcode`\@ = 11
  4434. \openin 1 \jobname.#1s
  4435. \ifeof 1
  4436. % \enddoublecolumns gets confused if there is no text in the index,
  4437. % and it loses the chapter title and the aux file entries for the
  4438. % index. The easiest way to prevent this problem is to make sure
  4439. % there is some text.
  4440. \putwordIndexNonexistent
  4441. \else
  4442. %
  4443. % If the index file exists but is empty, then \openin leaves \ifeof
  4444. % false. We have to make TeX try to read something from the file, so
  4445. % it can discover if there is anything in it.
  4446. \read 1 to \temp
  4447. \ifeof 1
  4448. \putwordIndexIsEmpty
  4449. \else
  4450. % Index files are almost Texinfo source, but we use \ as the escape
  4451. % character. It would be better to use @, but that's too big a change
  4452. % to make right now.
  4453. \def\indexbackslash{\backslashcurfont}%
  4454. \catcode`\\ = 0
  4455. \escapechar = `\\
  4456. \begindoublecolumns
  4457. \input \jobname.#1s
  4458. \enddoublecolumns
  4459. \fi
  4460. \fi
  4461. \closein 1
  4462. \endgroup}
  4463. % These macros are used by the sorted index file itself.
  4464. % Change them to control the appearance of the index.
  4465. \def\initial#1{{%
  4466. % Some minor font changes for the special characters.
  4467. \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
  4468. %
  4469. % Remove any glue we may have, we'll be inserting our own.
  4470. \removelastskip
  4471. %
  4472. % We like breaks before the index initials, so insert a bonus.
  4473. \nobreak
  4474. \vskip 0pt plus 3\baselineskip
  4475. \penalty 0
  4476. \vskip 0pt plus -3\baselineskip
  4477. %
  4478. % Typeset the initial. Making this add up to a whole number of
  4479. % baselineskips increases the chance of the dots lining up from column
  4480. % to column. It still won't often be perfect, because of the stretch
  4481. % we need before each entry, but it's better.
  4482. %
  4483. % No shrink because it confuses \balancecolumns.
  4484. \vskip 1.67\baselineskip plus .5\baselineskip
  4485. \leftline{\secbf #1}%
  4486. % Do our best not to break after the initial.
  4487. \nobreak
  4488. \vskip .33\baselineskip plus .1\baselineskip
  4489. }}
  4490. % \entry typesets a paragraph consisting of the text (#1), dot leaders, and
  4491. % then page number (#2) flushed to the right margin. It is used for index
  4492. % and table of contents entries. The paragraph is indented by \leftskip.
  4493. %
  4494. % A straightforward implementation would start like this:
  4495. % \def\entry#1#2{...
  4496. % But this freezes the catcodes in the argument, and can cause problems to
  4497. % @code, which sets - active. This problem was fixed by a kludge---
  4498. % ``-'' was active throughout whole index, but this isn't really right.
  4499. % The right solution is to prevent \entry from swallowing the whole text.
  4500. % --kasal, 21nov03
  4501. \def\entry{%
  4502. \begingroup
  4503. %
  4504. % Start a new paragraph if necessary, so our assignments below can't
  4505. % affect previous text.
  4506. \par
  4507. %
  4508. % Do not fill out the last line with white space.
  4509. \parfillskip = 0in
  4510. %
  4511. % No extra space above this paragraph.
  4512. \parskip = 0in
  4513. %
  4514. % Do not prefer a separate line ending with a hyphen to fewer lines.
  4515. \finalhyphendemerits = 0
  4516. %
  4517. % \hangindent is only relevant when the entry text and page number
  4518. % don't both fit on one line. In that case, bob suggests starting the
  4519. % dots pretty far over on the line. Unfortunately, a large
  4520. % indentation looks wrong when the entry text itself is broken across
  4521. % lines. So we use a small indentation and put up with long leaders.
  4522. %
  4523. % \hangafter is reset to 1 (which is the value we want) at the start
  4524. % of each paragraph, so we need not do anything with that.
  4525. \hangindent = 2em
  4526. %
  4527. % When the entry text needs to be broken, just fill out the first line
  4528. % with blank space.
  4529. \rightskip = 0pt plus1fil
  4530. %
  4531. % A bit of stretch before each entry for the benefit of balancing
  4532. % columns.
  4533. \vskip 0pt plus1pt
  4534. %
  4535. % When reading the text of entry, convert explicit line breaks
  4536. % from @* into spaces. The user might give these in long section
  4537. % titles, for instance.
  4538. \def\*{\unskip\space\ignorespaces}%
  4539. \def\entrybreak{\hfil\break}%
  4540. %
  4541. % Swallow the left brace of the text (first parameter):
  4542. \afterassignment\doentry
  4543. \let\temp =
  4544. }
  4545. \def\entrybreak{\unskip\space\ignorespaces}%
  4546. \def\doentry{%
  4547. \bgroup % Instead of the swallowed brace.
  4548. \noindent
  4549. \aftergroup\finishentry
  4550. % And now comes the text of the entry.
  4551. }
  4552. \def\finishentry#1{%
  4553. % #1 is the page number.
  4554. %
  4555. % The following is kludged to not output a line of dots in the index if
  4556. % there are no page numbers. The next person who breaks this will be
  4557. % cursed by a Unix daemon.
  4558. \setbox\boxA = \hbox{#1}%
  4559. \ifdim\wd\boxA = 0pt
  4560. \ %
  4561. \else
  4562. %
  4563. % If we must, put the page number on a line of its own, and fill out
  4564. % this line with blank space. (The \hfil is overwhelmed with the
  4565. % fill leaders glue in \indexdotfill if the page number does fit.)
  4566. \hfil\penalty50
  4567. \null\nobreak\indexdotfill % Have leaders before the page number.
  4568. %
  4569. % The `\ ' here is removed by the implicit \unskip that TeX does as
  4570. % part of (the primitive) \par. Without it, a spurious underfull
  4571. % \hbox ensues.
  4572. \ifpdf
  4573. \pdfgettoks#1.%
  4574. \ \the\toksA
  4575. \else
  4576. \ #1%
  4577. \fi
  4578. \fi
  4579. \par
  4580. \endgroup
  4581. }
  4582. % Like plain.tex's \dotfill, except uses up at least 1 em.
  4583. \def\indexdotfill{\cleaders
  4584. \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill}
  4585. \def\primary #1{\line{#1\hfil}}
  4586. \newskip\secondaryindent \secondaryindent=0.5cm
  4587. \def\secondary#1#2{{%
  4588. \parfillskip=0in
  4589. \parskip=0in
  4590. \hangindent=1in
  4591. \hangafter=1
  4592. \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
  4593. \ifpdf
  4594. \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
  4595. \else
  4596. #2
  4597. \fi
  4598. \par
  4599. }}
  4600. % Define two-column mode, which we use to typeset indexes.
  4601. % Adapted from the TeXbook, page 416, which is to say,
  4602. % the manmac.tex format used to print the TeXbook itself.
  4603. \catcode`\@=11
  4604. \newbox\partialpage
  4605. \newdimen\doublecolumnhsize
  4606. \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
  4607. % Grab any single-column material above us.
  4608. \output = {%
  4609. %
  4610. % Here is a possibility not foreseen in manmac: if we accumulate a
  4611. % whole lot of material, we might end up calling this \output
  4612. % routine twice in a row (see the doublecol-lose test, which is
  4613. % essentially a couple of indexes with @setchapternewpage off). In
  4614. % that case we just ship out what is in \partialpage with the normal
  4615. % output routine. Generally, \partialpage will be empty when this
  4616. % runs and this will be a no-op. See the indexspread.tex test case.
  4617. \ifvoid\partialpage \else
  4618. \onepageout{\pagecontents\partialpage}%
  4619. \fi
  4620. %
  4621. \global\setbox\partialpage = \vbox{%
  4622. % Unvbox the main output page.
  4623. \unvbox\PAGE
  4624. \kern-\topskip \kern\baselineskip
  4625. }%
  4626. }%
  4627. \eject % run that output routine to set \partialpage
  4628. %
  4629. % Use the double-column output routine for subsequent pages.
  4630. \output = {\doublecolumnout}%
  4631. %
  4632. % Change the page size parameters. We could do this once outside this
  4633. % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
  4634. % format, but then we repeat the same computation. Repeating a couple
  4635. % of assignments once per index is clearly meaningless for the
  4636. % execution time, so we may as well do it in one place.
  4637. %
  4638. % First we halve the line length, less a little for the gutter between
  4639. % the columns. We compute the gutter based on the line length, so it
  4640. % changes automatically with the paper format. The magic constant
  4641. % below is chosen so that the gutter has the same value (well, +-<1pt)
  4642. % as it did when we hard-coded it.
  4643. %
  4644. % We put the result in a separate register, \doublecolumhsize, so we
  4645. % can restore it in \pagesofar, after \hsize itself has (potentially)
  4646. % been clobbered.
  4647. %
  4648. \doublecolumnhsize = \hsize
  4649. \advance\doublecolumnhsize by -.04154\hsize
  4650. \divide\doublecolumnhsize by 2
  4651. \hsize = \doublecolumnhsize
  4652. %
  4653. % Double the \vsize as well. (We don't need a separate register here,
  4654. % since nobody clobbers \vsize.)
  4655. \vsize = 2\vsize
  4656. }
  4657. % The double-column output routine for all double-column pages except
  4658. % the last.
  4659. %
  4660. \def\doublecolumnout{%
  4661. \splittopskip=\topskip \splitmaxdepth=\maxdepth
  4662. % Get the available space for the double columns -- the normal
  4663. % (undoubled) page height minus any material left over from the
  4664. % previous page.
  4665. \dimen@ = \vsize
  4666. \divide\dimen@ by 2
  4667. \advance\dimen@ by -\ht\partialpage
  4668. %
  4669. % box0 will be the left-hand column, box2 the right.
  4670. \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
  4671. \onepageout\pagesofar
  4672. \unvbox255
  4673. \penalty\outputpenalty
  4674. }
  4675. %
  4676. % Re-output the contents of the output page -- any previous material,
  4677. % followed by the two boxes we just split, in box0 and box2.
  4678. \def\pagesofar{%
  4679. \unvbox\partialpage
  4680. %
  4681. \hsize = \doublecolumnhsize
  4682. \wd0=\hsize \wd2=\hsize
  4683. \hbox to\pagewidth{\box0\hfil\box2}%
  4684. }
  4685. %
  4686. % All done with double columns.
  4687. \def\enddoublecolumns{%
  4688. % The following penalty ensures that the page builder is exercised
  4689. % _before_ we change the output routine. This is necessary in the
  4690. % following situation:
  4691. %
  4692. % The last section of the index consists only of a single entry.
  4693. % Before this section, \pagetotal is less than \pagegoal, so no
  4694. % break occurs before the last section starts. However, the last
  4695. % section, consisting of \initial and the single \entry, does not
  4696. % fit on the page and has to be broken off. Without the following
  4697. % penalty the page builder will not be exercised until \eject
  4698. % below, and by that time we'll already have changed the output
  4699. % routine to the \balancecolumns version, so the next-to-last
  4700. % double-column page will be processed with \balancecolumns, which
  4701. % is wrong: The two columns will go to the main vertical list, with
  4702. % the broken-off section in the recent contributions. As soon as
  4703. % the output routine finishes, TeX starts reconsidering the page
  4704. % break. The two columns and the broken-off section both fit on the
  4705. % page, because the two columns now take up only half of the page
  4706. % goal. When TeX sees \eject from below which follows the final
  4707. % section, it invokes the new output routine that we've set after
  4708. % \balancecolumns below; \onepageout will try to fit the two columns
  4709. % and the final section into the vbox of \pageheight (see
  4710. % \pagebody), causing an overfull box.
  4711. %
  4712. % Note that glue won't work here, because glue does not exercise the
  4713. % page builder, unlike penalties (see The TeXbook, pp. 280-281).
  4714. \penalty0
  4715. %
  4716. \output = {%
  4717. % Split the last of the double-column material. Leave it on the
  4718. % current page, no automatic page break.
  4719. \balancecolumns
  4720. %
  4721. % If we end up splitting too much material for the current page,
  4722. % though, there will be another page break right after this \output
  4723. % invocation ends. Having called \balancecolumns once, we do not
  4724. % want to call it again. Therefore, reset \output to its normal
  4725. % definition right away. (We hope \balancecolumns will never be
  4726. % called on to balance too much material, but if it is, this makes
  4727. % the output somewhat more palatable.)
  4728. \global\output = {\onepageout{\pagecontents\PAGE}}%
  4729. }%
  4730. \eject
  4731. \endgroup % started in \begindoublecolumns
  4732. %
  4733. % \pagegoal was set to the doubled \vsize above, since we restarted
  4734. % the current page. We're now back to normal single-column
  4735. % typesetting, so reset \pagegoal to the normal \vsize (after the
  4736. % \endgroup where \vsize got restored).
  4737. \pagegoal = \vsize
  4738. }
  4739. %
  4740. % Called at the end of the double column material.
  4741. \def\balancecolumns{%
  4742. \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
  4743. \dimen@ = \ht0
  4744. \advance\dimen@ by \topskip
  4745. \advance\dimen@ by-\baselineskip
  4746. \divide\dimen@ by 2 % target to split to
  4747. %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
  4748. \splittopskip = \topskip
  4749. % Loop until we get a decent breakpoint.
  4750. {%
  4751. \vbadness = 10000
  4752. \loop
  4753. \global\setbox3 = \copy0
  4754. \global\setbox1 = \vsplit3 to \dimen@
  4755. \ifdim\ht3>\dimen@
  4756. \global\advance\dimen@ by 1pt
  4757. \repeat
  4758. }%
  4759. %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
  4760. \setbox0=\vbox to\dimen@{\unvbox1}%
  4761. \setbox2=\vbox to\dimen@{\unvbox3}%
  4762. %
  4763. \pagesofar
  4764. }
  4765. \catcode`\@ = \other
  4766. \message{sectioning,}
  4767. % Chapters, sections, etc.
  4768. % Let's start with @part.
  4769. \outer\parseargdef\part{\partzzz{#1}}
  4770. \def\partzzz#1{%
  4771. \chapoddpage
  4772. \null
  4773. \vskip.3\vsize % move it down on the page a bit
  4774. \begingroup
  4775. \noindent \titlefonts\rmisbold #1\par % the text
  4776. \let\lastnode=\empty % no node to associate with
  4777. \writetocentry{part}{#1}{}% but put it in the toc
  4778. \headingsoff % no headline or footline on the part page
  4779. \chapoddpage
  4780. \endgroup
  4781. }
  4782. % \unnumberedno is an oxymoron. But we count the unnumbered
  4783. % sections so that we can refer to them unambiguously in the pdf
  4784. % outlines by their "section number". We avoid collisions with chapter
  4785. % numbers by starting them at 10000. (If a document ever has 10000
  4786. % chapters, we're in trouble anyway, I'm sure.)
  4787. \newcount\unnumberedno \unnumberedno = 10000
  4788. \newcount\chapno
  4789. \newcount\secno \secno=0
  4790. \newcount\subsecno \subsecno=0
  4791. \newcount\subsubsecno \subsubsecno=0
  4792. % This counter is funny since it counts through charcodes of letters A, B, ...
  4793. \newcount\appendixno \appendixno = `\@
  4794. %
  4795. % \def\appendixletter{\char\the\appendixno}
  4796. % We do the following ugly conditional instead of the above simple
  4797. % construct for the sake of pdftex, which needs the actual
  4798. % letter in the expansion, not just typeset.
  4799. %
  4800. \def\appendixletter{%
  4801. \ifnum\appendixno=`A A%
  4802. \else\ifnum\appendixno=`B B%
  4803. \else\ifnum\appendixno=`C C%
  4804. \else\ifnum\appendixno=`D D%
  4805. \else\ifnum\appendixno=`E E%
  4806. \else\ifnum\appendixno=`F F%
  4807. \else\ifnum\appendixno=`G G%
  4808. \else\ifnum\appendixno=`H H%
  4809. \else\ifnum\appendixno=`I I%
  4810. \else\ifnum\appendixno=`J J%
  4811. \else\ifnum\appendixno=`K K%
  4812. \else\ifnum\appendixno=`L L%
  4813. \else\ifnum\appendixno=`M M%
  4814. \else\ifnum\appendixno=`N N%
  4815. \else\ifnum\appendixno=`O O%
  4816. \else\ifnum\appendixno=`P P%
  4817. \else\ifnum\appendixno=`Q Q%
  4818. \else\ifnum\appendixno=`R R%
  4819. \else\ifnum\appendixno=`S S%
  4820. \else\ifnum\appendixno=`T T%
  4821. \else\ifnum\appendixno=`U U%
  4822. \else\ifnum\appendixno=`V V%
  4823. \else\ifnum\appendixno=`W W%
  4824. \else\ifnum\appendixno=`X X%
  4825. \else\ifnum\appendixno=`Y Y%
  4826. \else\ifnum\appendixno=`Z Z%
  4827. % The \the is necessary, despite appearances, because \appendixletter is
  4828. % expanded while writing the .toc file. \char\appendixno is not
  4829. % expandable, thus it is written literally, thus all appendixes come out
  4830. % with the same letter (or @) in the toc without it.
  4831. \else\char\the\appendixno
  4832. \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
  4833. \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
  4834. % Each @chapter defines these (using marks) as the number+name, number
  4835. % and name of the chapter. Page headings and footings can use
  4836. % these. @section does likewise.
  4837. \def\thischapter{}
  4838. \def\thischapternum{}
  4839. \def\thischaptername{}
  4840. \def\thissection{}
  4841. \def\thissectionnum{}
  4842. \def\thissectionname{}
  4843. \newcount\absseclevel % used to calculate proper heading level
  4844. \newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
  4845. % @raisesections: treat @section as chapter, @subsection as section, etc.
  4846. \def\raisesections{\global\advance\secbase by -1}
  4847. \let\up=\raisesections % original BFox name
  4848. % @lowersections: treat @chapter as section, @section as subsection, etc.
  4849. \def\lowersections{\global\advance\secbase by 1}
  4850. \let\down=\lowersections % original BFox name
  4851. % we only have subsub.
  4852. \chardef\maxseclevel = 3
  4853. %
  4854. % A numbered section within an unnumbered changes to unnumbered too.
  4855. % To achieve this, remember the "biggest" unnum. sec. we are currently in:
  4856. \chardef\unnlevel = \maxseclevel
  4857. %
  4858. % Trace whether the current chapter is an appendix or not:
  4859. % \chapheadtype is "N" or "A", unnumbered chapters are ignored.
  4860. \def\chapheadtype{N}
  4861. % Choose a heading macro
  4862. % #1 is heading type
  4863. % #2 is heading level
  4864. % #3 is text for heading
  4865. \def\genhead#1#2#3{%
  4866. % Compute the abs. sec. level:
  4867. \absseclevel=#2
  4868. \advance\absseclevel by \secbase
  4869. % Make sure \absseclevel doesn't fall outside the range:
  4870. \ifnum \absseclevel < 0
  4871. \absseclevel = 0
  4872. \else
  4873. \ifnum \absseclevel > 3
  4874. \absseclevel = 3
  4875. \fi
  4876. \fi
  4877. % The heading type:
  4878. \def\headtype{#1}%
  4879. \if \headtype U%
  4880. \ifnum \absseclevel < \unnlevel
  4881. \chardef\unnlevel = \absseclevel
  4882. \fi
  4883. \else
  4884. % Check for appendix sections:
  4885. \ifnum \absseclevel = 0
  4886. \edef\chapheadtype{\headtype}%
  4887. \else
  4888. \if \headtype A\if \chapheadtype N%
  4889. \errmessage{@appendix... within a non-appendix chapter}%
  4890. \fi\fi
  4891. \fi
  4892. % Check for numbered within unnumbered:
  4893. \ifnum \absseclevel > \unnlevel
  4894. \def\headtype{U}%
  4895. \else
  4896. \chardef\unnlevel = 3
  4897. \fi
  4898. \fi
  4899. % Now print the heading:
  4900. \if \headtype U%
  4901. \ifcase\absseclevel
  4902. \unnumberedzzz{#3}%
  4903. \or \unnumberedseczzz{#3}%
  4904. \or \unnumberedsubseczzz{#3}%
  4905. \or \unnumberedsubsubseczzz{#3}%
  4906. \fi
  4907. \else
  4908. \if \headtype A%
  4909. \ifcase\absseclevel
  4910. \appendixzzz{#3}%
  4911. \or \appendixsectionzzz{#3}%
  4912. \or \appendixsubseczzz{#3}%
  4913. \or \appendixsubsubseczzz{#3}%
  4914. \fi
  4915. \else
  4916. \ifcase\absseclevel
  4917. \chapterzzz{#3}%
  4918. \or \seczzz{#3}%
  4919. \or \numberedsubseczzz{#3}%
  4920. \or \numberedsubsubseczzz{#3}%
  4921. \fi
  4922. \fi
  4923. \fi
  4924. \suppressfirstparagraphindent
  4925. }
  4926. % an interface:
  4927. \def\numhead{\genhead N}
  4928. \def\apphead{\genhead A}
  4929. \def\unnmhead{\genhead U}
  4930. % @chapter, @appendix, @unnumbered. Increment top-level counter, reset
  4931. % all lower-level sectioning counters to zero.
  4932. %
  4933. % Also set \chaplevelprefix, which we prepend to @float sequence numbers
  4934. % (e.g., figures), q.v. By default (before any chapter), that is empty.
  4935. \let\chaplevelprefix = \empty
  4936. %
  4937. \outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz
  4938. \def\chapterzzz#1{%
  4939. % section resetting is \global in case the chapter is in a group, such
  4940. % as an @include file.
  4941. \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
  4942. \global\advance\chapno by 1
  4943. %
  4944. % Used for \float.
  4945. \gdef\chaplevelprefix{\the\chapno.}%
  4946. \resetallfloatnos
  4947. %
  4948. % \putwordChapter can contain complex things in translations.
  4949. \toks0=\expandafter{\putwordChapter}%
  4950. \message{\the\toks0 \space \the\chapno}%
  4951. %
  4952. % Write the actual heading.
  4953. \chapmacro{#1}{Ynumbered}{\the\chapno}%
  4954. %
  4955. % So @section and the like are numbered underneath this chapter.
  4956. \global\let\section = \numberedsec
  4957. \global\let\subsection = \numberedsubsec
  4958. \global\let\subsubsection = \numberedsubsubsec
  4959. }
  4960. \outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz
  4961. %
  4962. \def\appendixzzz#1{%
  4963. \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
  4964. \global\advance\appendixno by 1
  4965. \gdef\chaplevelprefix{\appendixletter.}%
  4966. \resetallfloatnos
  4967. %
  4968. % \putwordAppendix can contain complex things in translations.
  4969. \toks0=\expandafter{\putwordAppendix}%
  4970. \message{\the\toks0 \space \appendixletter}%
  4971. %
  4972. \chapmacro{#1}{Yappendix}{\appendixletter}%
  4973. %
  4974. \global\let\section = \appendixsec
  4975. \global\let\subsection = \appendixsubsec
  4976. \global\let\subsubsection = \appendixsubsubsec
  4977. }
  4978. % normally unnmhead0 calls unnumberedzzz:
  4979. \outer\parseargdef\unnumbered{\unnmhead0{#1}}
  4980. \def\unnumberedzzz#1{%
  4981. \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
  4982. \global\advance\unnumberedno by 1
  4983. %
  4984. % Since an unnumbered has no number, no prefix for figures.
  4985. \global\let\chaplevelprefix = \empty
  4986. \resetallfloatnos
  4987. %
  4988. % This used to be simply \message{#1}, but TeX fully expands the
  4989. % argument to \message. Therefore, if #1 contained @-commands, TeX
  4990. % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
  4991. % expanded @cite (which turns out to cause errors because \cite is meant
  4992. % to be executed, not expanded).
  4993. %
  4994. % Anyway, we don't want the fully-expanded definition of @cite to appear
  4995. % as a result of the \message, we just want `@cite' itself. We use
  4996. % \the<toks register> to achieve this: TeX expands \the<toks> only once,
  4997. % simply yielding the contents of <toks register>. (We also do this for
  4998. % the toc entries.)
  4999. \toks0 = {#1}%
  5000. \message{(\the\toks0)}%
  5001. %
  5002. \chapmacro{#1}{Ynothing}{\the\unnumberedno}%
  5003. %
  5004. \global\let\section = \unnumberedsec
  5005. \global\let\subsection = \unnumberedsubsec
  5006. \global\let\subsubsection = \unnumberedsubsubsec
  5007. }
  5008. % @centerchap is like @unnumbered, but the heading is centered.
  5009. \outer\parseargdef\centerchap{%
  5010. % Well, we could do the following in a group, but that would break
  5011. % an assumption that \chapmacro is called at the outermost level.
  5012. % Thus we are safer this way: --kasal, 24feb04
  5013. \let\centerparametersmaybe = \centerparameters
  5014. \unnmhead0{#1}%
  5015. \let\centerparametersmaybe = \relax
  5016. }
  5017. % @top is like @unnumbered.
  5018. \let\top\unnumbered
  5019. % Sections.
  5020. %
  5021. \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
  5022. \def\seczzz#1{%
  5023. \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
  5024. \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
  5025. }
  5026. % normally calls appendixsectionzzz:
  5027. \outer\parseargdef\appendixsection{\apphead1{#1}}
  5028. \def\appendixsectionzzz#1{%
  5029. \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
  5030. \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
  5031. }
  5032. \let\appendixsec\appendixsection
  5033. % normally calls unnumberedseczzz:
  5034. \outer\parseargdef\unnumberedsec{\unnmhead1{#1}}
  5035. \def\unnumberedseczzz#1{%
  5036. \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
  5037. \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
  5038. }
  5039. % Subsections.
  5040. %
  5041. % normally calls numberedsubseczzz:
  5042. \outer\parseargdef\numberedsubsec{\numhead2{#1}}
  5043. \def\numberedsubseczzz#1{%
  5044. \global\subsubsecno=0 \global\advance\subsecno by 1
  5045. \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
  5046. }
  5047. % normally calls appendixsubseczzz:
  5048. \outer\parseargdef\appendixsubsec{\apphead2{#1}}
  5049. \def\appendixsubseczzz#1{%
  5050. \global\subsubsecno=0 \global\advance\subsecno by 1
  5051. \sectionheading{#1}{subsec}{Yappendix}%
  5052. {\appendixletter.\the\secno.\the\subsecno}%
  5053. }
  5054. % normally calls unnumberedsubseczzz:
  5055. \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}}
  5056. \def\unnumberedsubseczzz#1{%
  5057. \global\subsubsecno=0 \global\advance\subsecno by 1
  5058. \sectionheading{#1}{subsec}{Ynothing}%
  5059. {\the\unnumberedno.\the\secno.\the\subsecno}%
  5060. }
  5061. % Subsubsections.
  5062. %
  5063. % normally numberedsubsubseczzz:
  5064. \outer\parseargdef\numberedsubsubsec{\numhead3{#1}}
  5065. \def\numberedsubsubseczzz#1{%
  5066. \global\advance\subsubsecno by 1
  5067. \sectionheading{#1}{subsubsec}{Ynumbered}%
  5068. {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
  5069. }
  5070. % normally appendixsubsubseczzz:
  5071. \outer\parseargdef\appendixsubsubsec{\apphead3{#1}}
  5072. \def\appendixsubsubseczzz#1{%
  5073. \global\advance\subsubsecno by 1
  5074. \sectionheading{#1}{subsubsec}{Yappendix}%
  5075. {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
  5076. }
  5077. % normally unnumberedsubsubseczzz:
  5078. \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}}
  5079. \def\unnumberedsubsubseczzz#1{%
  5080. \global\advance\subsubsecno by 1
  5081. \sectionheading{#1}{subsubsec}{Ynothing}%
  5082. {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}%
  5083. }
  5084. % These macros control what the section commands do, according
  5085. % to what kind of chapter we are in (ordinary, appendix, or unnumbered).
  5086. % Define them by default for a numbered chapter.
  5087. \let\section = \numberedsec
  5088. \let\subsection = \numberedsubsec
  5089. \let\subsubsection = \numberedsubsubsec
  5090. % Define @majorheading, @heading and @subheading
  5091. % NOTE on use of \vbox for chapter headings, section headings, and such:
  5092. % 1) We use \vbox rather than the earlier \line to permit
  5093. % overlong headings to fold.
  5094. % 2) \hyphenpenalty is set to 10000 because hyphenation in a
  5095. % heading is obnoxious; this forbids it.
  5096. % 3) Likewise, headings look best if no \parindent is used, and
  5097. % if justification is not attempted. Hence \raggedright.
  5098. \def\majorheading{%
  5099. {\advance\chapheadingskip by 10pt \chapbreak }%
  5100. \parsearg\chapheadingzzz
  5101. }
  5102. \def\chapheading{\chapbreak \parsearg\chapheadingzzz}
  5103. \def\chapheadingzzz#1{%
  5104. {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  5105. \parindent=0pt\ptexraggedright
  5106. \rmisbold #1\hfill}}%
  5107. \bigskip \par\penalty 200\relax
  5108. \suppressfirstparagraphindent
  5109. }
  5110. % @heading, @subheading, @subsubheading.
  5111. \parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{}
  5112. \suppressfirstparagraphindent}
  5113. \parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{}
  5114. \suppressfirstparagraphindent}
  5115. \parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
  5116. \suppressfirstparagraphindent}
  5117. % These macros generate a chapter, section, etc. heading only
  5118. % (including whitespace, linebreaking, etc. around it),
  5119. % given all the information in convenient, parsed form.
  5120. % Args are the skip and penalty (usually negative)
  5121. \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
  5122. % Parameter controlling skip before chapter headings (if needed)
  5123. \newskip\chapheadingskip
  5124. % Define plain chapter starts, and page on/off switching for it.
  5125. \def\chapbreak{\dobreak \chapheadingskip {-4000}}
  5126. \def\chappager{\par\vfill\supereject}
  5127. % Because \domark is called before \chapoddpage, the filler page will
  5128. % get the headings for the next chapter, which is wrong. But we don't
  5129. % care -- we just disable all headings on the filler page.
  5130. \def\chapoddpage{%
  5131. \chappager
  5132. \ifodd\pageno \else
  5133. \begingroup
  5134. \headingsoff
  5135. \null
  5136. \chappager
  5137. \endgroup
  5138. \fi
  5139. }
  5140. \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
  5141. \def\CHAPPAGoff{%
  5142. \global\let\contentsalignmacro = \chappager
  5143. \global\let\pchapsepmacro=\chapbreak
  5144. \global\let\pagealignmacro=\chappager}
  5145. \def\CHAPPAGon{%
  5146. \global\let\contentsalignmacro = \chappager
  5147. \global\let\pchapsepmacro=\chappager
  5148. \global\let\pagealignmacro=\chappager
  5149. \global\def\HEADINGSon{\HEADINGSsingle}}
  5150. \def\CHAPPAGodd{%
  5151. \global\let\contentsalignmacro = \chapoddpage
  5152. \global\let\pchapsepmacro=\chapoddpage
  5153. \global\let\pagealignmacro=\chapoddpage
  5154. \global\def\HEADINGSon{\HEADINGSdouble}}
  5155. \CHAPPAGon
  5156. % Chapter opening.
  5157. %
  5158. % #1 is the text, #2 is the section type (Ynumbered, Ynothing,
  5159. % Yappendix, Yomitfromtoc), #3 the chapter number.
  5160. %
  5161. % To test against our argument.
  5162. \def\Ynothingkeyword{Ynothing}
  5163. \def\Yomitfromtockeyword{Yomitfromtoc}
  5164. \def\Yappendixkeyword{Yappendix}
  5165. %
  5166. \def\chapmacro#1#2#3{%
  5167. % Insert the first mark before the heading break (see notes for \domark).
  5168. \let\prevchapterdefs=\lastchapterdefs
  5169. \let\prevsectiondefs=\lastsectiondefs
  5170. \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
  5171. \gdef\thissection{}}%
  5172. %
  5173. \def\temptype{#2}%
  5174. \ifx\temptype\Ynothingkeyword
  5175. \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
  5176. \gdef\thischapter{\thischaptername}}%
  5177. \else\ifx\temptype\Yomitfromtockeyword
  5178. \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
  5179. \gdef\thischapter{}}%
  5180. \else\ifx\temptype\Yappendixkeyword
  5181. \toks0={#1}%
  5182. \xdef\lastchapterdefs{%
  5183. \gdef\noexpand\thischaptername{\the\toks0}%
  5184. \gdef\noexpand\thischapternum{\appendixletter}%
  5185. % \noexpand\putwordAppendix avoids expanding indigestible
  5186. % commands in some of the translations.
  5187. \gdef\noexpand\thischapter{\noexpand\putwordAppendix{}
  5188. \noexpand\thischapternum:
  5189. \noexpand\thischaptername}%
  5190. }%
  5191. \else
  5192. \toks0={#1}%
  5193. \xdef\lastchapterdefs{%
  5194. \gdef\noexpand\thischaptername{\the\toks0}%
  5195. \gdef\noexpand\thischapternum{\the\chapno}%
  5196. % \noexpand\putwordChapter avoids expanding indigestible
  5197. % commands in some of the translations.
  5198. \gdef\noexpand\thischapter{\noexpand\putwordChapter{}
  5199. \noexpand\thischapternum:
  5200. \noexpand\thischaptername}%
  5201. }%
  5202. \fi\fi\fi
  5203. %
  5204. % Output the mark. Pass it through \safewhatsit, to take care of
  5205. % the preceding space.
  5206. \safewhatsit\domark
  5207. %
  5208. % Insert the chapter heading break.
  5209. \pchapsepmacro
  5210. %
  5211. % Now the second mark, after the heading break. No break points
  5212. % between here and the heading.
  5213. \let\prevchapterdefs=\lastchapterdefs
  5214. \let\prevsectiondefs=\lastsectiondefs
  5215. \domark
  5216. %
  5217. {%
  5218. \chapfonts \rmisbold
  5219. %
  5220. % Have to define \lastsection before calling \donoderef, because the
  5221. % xref code eventually uses it. On the other hand, it has to be called
  5222. % after \pchapsepmacro, or the headline will change too soon.
  5223. \gdef\lastsection{#1}%
  5224. %
  5225. % Only insert the separating space if we have a chapter/appendix
  5226. % number, and don't print the unnumbered ``number''.
  5227. \ifx\temptype\Ynothingkeyword
  5228. \setbox0 = \hbox{}%
  5229. \def\toctype{unnchap}%
  5230. \else\ifx\temptype\Yomitfromtockeyword
  5231. \setbox0 = \hbox{}% contents like unnumbered, but no toc entry
  5232. \def\toctype{omit}%
  5233. \else\ifx\temptype\Yappendixkeyword
  5234. \setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
  5235. \def\toctype{app}%
  5236. \else
  5237. \setbox0 = \hbox{#3\enspace}%
  5238. \def\toctype{numchap}%
  5239. \fi\fi\fi
  5240. %
  5241. % Write the toc entry for this chapter. Must come before the
  5242. % \donoderef, because we include the current node name in the toc
  5243. % entry, and \donoderef resets it to empty.
  5244. \writetocentry{\toctype}{#1}{#3}%
  5245. %
  5246. % For pdftex, we have to write out the node definition (aka, make
  5247. % the pdfdest) after any page break, but before the actual text has
  5248. % been typeset. If the destination for the pdf outline is after the
  5249. % text, then jumping from the outline may wind up with the text not
  5250. % being visible, for instance under high magnification.
  5251. \donoderef{#2}%
  5252. %
  5253. % Typeset the actual heading.
  5254. \nobreak % Avoid page breaks at the interline glue.
  5255. \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
  5256. \hangindent=\wd0 \centerparametersmaybe
  5257. \unhbox0 #1\par}%
  5258. }%
  5259. \nobreak\bigskip % no page break after a chapter title
  5260. \nobreak
  5261. }
  5262. % @centerchap -- centered and unnumbered.
  5263. \let\centerparametersmaybe = \relax
  5264. \def\centerparameters{%
  5265. \advance\rightskip by 3\rightskip
  5266. \leftskip = \rightskip
  5267. \parfillskip = 0pt
  5268. }
  5269. % I don't think this chapter style is supported any more, so I'm not
  5270. % updating it with the new noderef stuff. We'll see. --karl, 11aug03.
  5271. %
  5272. \def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
  5273. %
  5274. \def\unnchfopen #1{%
  5275. \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  5276. \parindent=0pt\ptexraggedright
  5277. \rmisbold #1\hfill}}\bigskip \par\nobreak
  5278. }
  5279. \def\chfopen #1#2{\chapoddpage {\chapfonts
  5280. \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
  5281. \par\penalty 5000 %
  5282. }
  5283. \def\centerchfopen #1{%
  5284. \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  5285. \parindent=0pt
  5286. \hfill {\rmisbold #1}\hfill}}\bigskip \par\nobreak
  5287. }
  5288. \def\CHAPFopen{%
  5289. \global\let\chapmacro=\chfopen
  5290. \global\let\centerchapmacro=\centerchfopen}
  5291. % Section titles. These macros combine the section number parts and
  5292. % call the generic \sectionheading to do the printing.
  5293. %
  5294. \newskip\secheadingskip
  5295. \def\secheadingbreak{\dobreak \secheadingskip{-1000}}
  5296. % Subsection titles.
  5297. \newskip\subsecheadingskip
  5298. \def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}}
  5299. % Subsubsection titles.
  5300. \def\subsubsecheadingskip{\subsecheadingskip}
  5301. \def\subsubsecheadingbreak{\subsecheadingbreak}
  5302. % Print any size, any type, section title.
  5303. %
  5304. % #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is
  5305. % the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the
  5306. % section number.
  5307. %
  5308. \def\seckeyword{sec}
  5309. %
  5310. \def\sectionheading#1#2#3#4{%
  5311. {%
  5312. \checkenv{}% should not be in an environment.
  5313. %
  5314. % Switch to the right set of fonts.
  5315. \csname #2fonts\endcsname \rmisbold
  5316. %
  5317. \def\sectionlevel{#2}%
  5318. \def\temptype{#3}%
  5319. %
  5320. % Insert first mark before the heading break (see notes for \domark).
  5321. \let\prevsectiondefs=\lastsectiondefs
  5322. \ifx\temptype\Ynothingkeyword
  5323. \ifx\sectionlevel\seckeyword
  5324. \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
  5325. \gdef\thissection{\thissectionname}}%
  5326. \fi
  5327. \else\ifx\temptype\Yomitfromtockeyword
  5328. % Don't redefine \thissection.
  5329. \else\ifx\temptype\Yappendixkeyword
  5330. \ifx\sectionlevel\seckeyword
  5331. \toks0={#1}%
  5332. \xdef\lastsectiondefs{%
  5333. \gdef\noexpand\thissectionname{\the\toks0}%
  5334. \gdef\noexpand\thissectionnum{#4}%
  5335. % \noexpand\putwordSection avoids expanding indigestible
  5336. % commands in some of the translations.
  5337. \gdef\noexpand\thissection{\noexpand\putwordSection{}
  5338. \noexpand\thissectionnum:
  5339. \noexpand\thissectionname}%
  5340. }%
  5341. \fi
  5342. \else
  5343. \ifx\sectionlevel\seckeyword
  5344. \toks0={#1}%
  5345. \xdef\lastsectiondefs{%
  5346. \gdef\noexpand\thissectionname{\the\toks0}%
  5347. \gdef\noexpand\thissectionnum{#4}%
  5348. % \noexpand\putwordSection avoids expanding indigestible
  5349. % commands in some of the translations.
  5350. \gdef\noexpand\thissection{\noexpand\putwordSection{}
  5351. \noexpand\thissectionnum:
  5352. \noexpand\thissectionname}%
  5353. }%
  5354. \fi
  5355. \fi\fi\fi
  5356. %
  5357. % Go into vertical mode. Usually we'll already be there, but we
  5358. % don't want the following whatsit to end up in a preceding paragraph
  5359. % if the document didn't happen to have a blank line.
  5360. \par
  5361. %
  5362. % Output the mark. Pass it through \safewhatsit, to take care of
  5363. % the preceding space.
  5364. \safewhatsit\domark
  5365. %
  5366. % Insert space above the heading.
  5367. \csname #2headingbreak\endcsname
  5368. %
  5369. % Now the second mark, after the heading break. No break points
  5370. % between here and the heading.
  5371. \let\prevsectiondefs=\lastsectiondefs
  5372. \domark
  5373. %
  5374. % Only insert the space after the number if we have a section number.
  5375. \ifx\temptype\Ynothingkeyword
  5376. \setbox0 = \hbox{}%
  5377. \def\toctype{unn}%
  5378. \gdef\lastsection{#1}%
  5379. \else\ifx\temptype\Yomitfromtockeyword
  5380. % for @headings -- no section number, don't include in toc,
  5381. % and don't redefine \lastsection.
  5382. \setbox0 = \hbox{}%
  5383. \def\toctype{omit}%
  5384. \let\sectionlevel=\empty
  5385. \else\ifx\temptype\Yappendixkeyword
  5386. \setbox0 = \hbox{#4\enspace}%
  5387. \def\toctype{app}%
  5388. \gdef\lastsection{#1}%
  5389. \else
  5390. \setbox0 = \hbox{#4\enspace}%
  5391. \def\toctype{num}%
  5392. \gdef\lastsection{#1}%
  5393. \fi\fi\fi
  5394. %
  5395. % Write the toc entry (before \donoderef). See comments in \chapmacro.
  5396. \writetocentry{\toctype\sectionlevel}{#1}{#4}%
  5397. %
  5398. % Write the node reference (= pdf destination for pdftex).
  5399. % Again, see comments in \chapmacro.
  5400. \donoderef{#3}%
  5401. %
  5402. % Interline glue will be inserted when the vbox is completed.
  5403. % That glue will be a valid breakpoint for the page, since it'll be
  5404. % preceded by a whatsit (usually from the \donoderef, or from the
  5405. % \writetocentry if there was no node). We don't want to allow that
  5406. % break, since then the whatsits could end up on page n while the
  5407. % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000.
  5408. \nobreak
  5409. %
  5410. % Output the actual section heading.
  5411. \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
  5412. \hangindent=\wd0 % zero if no section number
  5413. \unhbox0 #1}%
  5414. }%
  5415. % Add extra space after the heading -- half of whatever came above it.
  5416. % Don't allow stretch, though.
  5417. \kern .5 \csname #2headingskip\endcsname
  5418. %
  5419. % Do not let the kern be a potential breakpoint, as it would be if it
  5420. % was followed by glue.
  5421. \nobreak
  5422. %
  5423. % We'll almost certainly start a paragraph next, so don't let that
  5424. % glue accumulate. (Not a breakpoint because it's preceded by a
  5425. % discardable item.)
  5426. \vskip-\parskip
  5427. %
  5428. % This is purely so the last item on the list is a known \penalty >
  5429. % 10000. This is so \startdefun can avoid allowing breakpoints after
  5430. % section headings. Otherwise, it would insert a valid breakpoint between:
  5431. % @section sec-whatever
  5432. % @deffn def-whatever
  5433. \penalty 10001
  5434. }
  5435. \message{toc,}
  5436. % Table of contents.
  5437. \newwrite\tocfile
  5438. % Write an entry to the toc file, opening it if necessary.
  5439. % Called from @chapter, etc.
  5440. %
  5441. % Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno}
  5442. % We append the current node name (if any) and page number as additional
  5443. % arguments for the \{chap,sec,...}entry macros which will eventually
  5444. % read this. The node name is used in the pdf outlines as the
  5445. % destination to jump to.
  5446. %
  5447. % We open the .toc file for writing here instead of at @setfilename (or
  5448. % any other fixed time) so that @contents can be anywhere in the document.
  5449. % But if #1 is `omit', then we don't do anything. This is used for the
  5450. % table of contents chapter openings themselves.
  5451. %
  5452. \newif\iftocfileopened
  5453. \def\omitkeyword{omit}%
  5454. %
  5455. \def\writetocentry#1#2#3{%
  5456. \edef\writetoctype{#1}%
  5457. \ifx\writetoctype\omitkeyword \else
  5458. \iftocfileopened\else
  5459. \immediate\openout\tocfile = \jobname.toc
  5460. \global\tocfileopenedtrue
  5461. \fi
  5462. %
  5463. \iflinks
  5464. {\atdummies
  5465. \edef\temp{%
  5466. \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}%
  5467. \temp
  5468. }%
  5469. \fi
  5470. \fi
  5471. %
  5472. % Tell \shipout to create a pdf destination on each page, if we're
  5473. % writing pdf. These are used in the table of contents. We can't
  5474. % just write one on every page because the title pages are numbered
  5475. % 1 and 2 (the page numbers aren't printed), and so are the first
  5476. % two pages of the document. Thus, we'd have two destinations named
  5477. % `1', and two named `2'.
  5478. \ifpdf \global\pdfmakepagedesttrue \fi
  5479. }
  5480. % These characters do not print properly in the Computer Modern roman
  5481. % fonts, so we must take special care. This is more or less redundant
  5482. % with the Texinfo input format setup at the end of this file.
  5483. %
  5484. \def\activecatcodes{%
  5485. \catcode`\"=\active
  5486. \catcode`\$=\active
  5487. \catcode`\<=\active
  5488. \catcode`\>=\active
  5489. \catcode`\\=\active
  5490. \catcode`\^=\active
  5491. \catcode`\_=\active
  5492. \catcode`\|=\active
  5493. \catcode`\~=\active
  5494. }
  5495. % Read the toc file, which is essentially Texinfo input.
  5496. \def\readtocfile{%
  5497. \setupdatafile
  5498. \activecatcodes
  5499. \input \tocreadfilename
  5500. }
  5501. \newskip\contentsrightmargin \contentsrightmargin=1in
  5502. \newcount\savepageno
  5503. \newcount\lastnegativepageno \lastnegativepageno = -1
  5504. % Prepare to read what we've written to \tocfile.
  5505. %
  5506. \def\startcontents#1{%
  5507. % If @setchapternewpage on, and @headings double, the contents should
  5508. % start on an odd page, unlike chapters. Thus, we maintain
  5509. % \contentsalignmacro in parallel with \pagealignmacro.
  5510. % From: Torbjorn Granlund <tege@matematik.su.se>
  5511. \contentsalignmacro
  5512. \immediate\closeout\tocfile
  5513. %
  5514. % Don't need to put `Contents' or `Short Contents' in the headline.
  5515. % It is abundantly clear what they are.
  5516. \chapmacro{#1}{Yomitfromtoc}{}%
  5517. %
  5518. \savepageno = \pageno
  5519. \begingroup % Set up to handle contents files properly.
  5520. \raggedbottom % Worry more about breakpoints than the bottom.
  5521. \advance\hsize by -\contentsrightmargin % Don't use the full line length.
  5522. %
  5523. % Roman numerals for page numbers.
  5524. \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
  5525. }
  5526. % redefined for the two-volume lispref. We always output on
  5527. % \jobname.toc even if this is redefined.
  5528. %
  5529. \def\tocreadfilename{\jobname.toc}
  5530. % Normal (long) toc.
  5531. %
  5532. \def\contents{%
  5533. \startcontents{\putwordTOC}%
  5534. \openin 1 \tocreadfilename\space
  5535. \ifeof 1 \else
  5536. \readtocfile
  5537. \fi
  5538. \vfill \eject
  5539. \contentsalignmacro % in case @setchapternewpage odd is in effect
  5540. \ifeof 1 \else
  5541. \pdfmakeoutlines
  5542. \fi
  5543. \closein 1
  5544. \endgroup
  5545. \lastnegativepageno = \pageno
  5546. \global\pageno = \savepageno
  5547. }
  5548. % And just the chapters.
  5549. \def\summarycontents{%
  5550. \startcontents{\putwordShortTOC}%
  5551. %
  5552. \let\partentry = \shortpartentry
  5553. \let\numchapentry = \shortchapentry
  5554. \let\appentry = \shortchapentry
  5555. \let\unnchapentry = \shortunnchapentry
  5556. % We want a true roman here for the page numbers.
  5557. \secfonts
  5558. \let\rm=\shortcontrm \let\bf=\shortcontbf
  5559. \let\sl=\shortcontsl \let\tt=\shortconttt
  5560. \rm
  5561. \hyphenpenalty = 10000
  5562. \advance\baselineskip by 1pt % Open it up a little.
  5563. \def\numsecentry##1##2##3##4{}
  5564. \let\appsecentry = \numsecentry
  5565. \let\unnsecentry = \numsecentry
  5566. \let\numsubsecentry = \numsecentry
  5567. \let\appsubsecentry = \numsecentry
  5568. \let\unnsubsecentry = \numsecentry
  5569. \let\numsubsubsecentry = \numsecentry
  5570. \let\appsubsubsecentry = \numsecentry
  5571. \let\unnsubsubsecentry = \numsecentry
  5572. \openin 1 \tocreadfilename\space
  5573. \ifeof 1 \else
  5574. \readtocfile
  5575. \fi
  5576. \closein 1
  5577. \vfill \eject
  5578. \contentsalignmacro % in case @setchapternewpage odd is in effect
  5579. \endgroup
  5580. \lastnegativepageno = \pageno
  5581. \global\pageno = \savepageno
  5582. }
  5583. \let\shortcontents = \summarycontents
  5584. % Typeset the label for a chapter or appendix for the short contents.
  5585. % The arg is, e.g., `A' for an appendix, or `3' for a chapter.
  5586. %
  5587. \def\shortchaplabel#1{%
  5588. % This space should be enough, since a single number is .5em, and the
  5589. % widest letter (M) is 1em, at least in the Computer Modern fonts.
  5590. % But use \hss just in case.
  5591. % (This space doesn't include the extra space that gets added after
  5592. % the label; that gets put in by \shortchapentry above.)
  5593. %
  5594. % We'd like to right-justify chapter numbers, but that looks strange
  5595. % with appendix letters. And right-justifying numbers and
  5596. % left-justifying letters looks strange when there is less than 10
  5597. % chapters. Have to read the whole toc once to know how many chapters
  5598. % there are before deciding ...
  5599. \hbox to 1em{#1\hss}%
  5600. }
  5601. % These macros generate individual entries in the table of contents.
  5602. % The first argument is the chapter or section name.
  5603. % The last argument is the page number.
  5604. % The arguments in between are the chapter number, section number, ...
  5605. % Parts, in the main contents. Replace the part number, which doesn't
  5606. % exist, with an empty box. Let's hope all the numbers have the same width.
  5607. % Also ignore the page number, which is conventionally not printed.
  5608. \def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}}
  5609. \def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}}
  5610. %
  5611. % Parts, in the short toc.
  5612. \def\shortpartentry#1#2#3#4{%
  5613. \penalty-300
  5614. \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip
  5615. \shortchapentry{{\bf #1}}{\numeralbox}{}{}%
  5616. }
  5617. % Chapters, in the main contents.
  5618. \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
  5619. %
  5620. % Chapters, in the short toc.
  5621. % See comments in \dochapentry re vbox and related settings.
  5622. \def\shortchapentry#1#2#3#4{%
  5623. \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}%
  5624. }
  5625. % Appendices, in the main contents.
  5626. % Need the word Appendix, and a fixed-size box.
  5627. %
  5628. \def\appendixbox#1{%
  5629. % We use M since it's probably the widest letter.
  5630. \setbox0 = \hbox{\putwordAppendix{} M}%
  5631. \hbox to \wd0{\putwordAppendix{} #1\hss}}
  5632. %
  5633. \def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}}
  5634. % Unnumbered chapters.
  5635. \def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}
  5636. \def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}}
  5637. % Sections.
  5638. \def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}}
  5639. \let\appsecentry=\numsecentry
  5640. \def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}}
  5641. % Subsections.
  5642. \def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}}
  5643. \let\appsubsecentry=\numsubsecentry
  5644. \def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}
  5645. % And subsubsections.
  5646. \def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}}
  5647. \let\appsubsubsecentry=\numsubsubsecentry
  5648. \def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}}
  5649. % This parameter controls the indentation of the various levels.
  5650. % Same as \defaultparindent.
  5651. \newdimen\tocindent \tocindent = 15pt
  5652. % Now for the actual typesetting. In all these, #1 is the text and #2 is the
  5653. % page number.
  5654. %
  5655. % If the toc has to be broken over pages, we want it to be at chapters
  5656. % if at all possible; hence the \penalty.
  5657. \def\dochapentry#1#2{%
  5658. \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
  5659. \begingroup
  5660. \chapentryfonts
  5661. \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  5662. \endgroup
  5663. \nobreak\vskip .25\baselineskip plus.1\baselineskip
  5664. }
  5665. \def\dosecentry#1#2{\begingroup
  5666. \secentryfonts \leftskip=\tocindent
  5667. \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  5668. \endgroup}
  5669. \def\dosubsecentry#1#2{\begingroup
  5670. \subsecentryfonts \leftskip=2\tocindent
  5671. \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  5672. \endgroup}
  5673. \def\dosubsubsecentry#1#2{\begingroup
  5674. \subsubsecentryfonts \leftskip=3\tocindent
  5675. \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  5676. \endgroup}
  5677. % We use the same \entry macro as for the index entries.
  5678. \let\tocentry = \entry
  5679. % Space between chapter (or whatever) number and the title.
  5680. \def\labelspace{\hskip1em \relax}
  5681. \def\dopageno#1{{\rm #1}}
  5682. \def\doshortpageno#1{{\rm #1}}
  5683. \def\chapentryfonts{\secfonts \rm}
  5684. \def\secentryfonts{\textfonts}
  5685. \def\subsecentryfonts{\textfonts}
  5686. \def\subsubsecentryfonts{\textfonts}
  5687. \message{environments,}
  5688. % @foo ... @end foo.
  5689. % @tex ... @end tex escapes into raw TeX temporarily.
  5690. % One exception: @ is still an escape character, so that @end tex works.
  5691. % But \@ or @@ will get a plain @ character.
  5692. \envdef\tex{%
  5693. \setupmarkupstyle{tex}%
  5694. \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
  5695. \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
  5696. \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
  5697. \catcode `\%=14
  5698. \catcode `\+=\other
  5699. \catcode `\"=\other
  5700. \catcode `\|=\other
  5701. \catcode `\<=\other
  5702. \catcode `\>=\other
  5703. \catcode`\`=\other
  5704. \catcode`\'=\other
  5705. \escapechar=`\\
  5706. %
  5707. % ' is active in math mode (mathcode"8000). So reset it, and all our
  5708. % other math active characters (just in case), to plain's definitions.
  5709. \mathactive
  5710. %
  5711. \let\b=\ptexb
  5712. \let\bullet=\ptexbullet
  5713. \let\c=\ptexc
  5714. \let\,=\ptexcomma
  5715. \let\.=\ptexdot
  5716. \let\dots=\ptexdots
  5717. \let\equiv=\ptexequiv
  5718. \let\!=\ptexexclam
  5719. \let\i=\ptexi
  5720. \let\indent=\ptexindent
  5721. \let\noindent=\ptexnoindent
  5722. \let\{=\ptexlbrace
  5723. \let\+=\tabalign
  5724. \let\}=\ptexrbrace
  5725. \let\/=\ptexslash
  5726. \let\*=\ptexstar
  5727. \let\t=\ptext
  5728. \expandafter \let\csname top\endcsname=\ptextop % outer
  5729. \let\frenchspacing=\plainfrenchspacing
  5730. %
  5731. \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
  5732. \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
  5733. \def\@{@}%
  5734. }
  5735. % There is no need to define \Etex.
  5736. % Define @lisp ... @end lisp.
  5737. % @lisp environment forms a group so it can rebind things,
  5738. % including the definition of @end lisp (which normally is erroneous).
  5739. % Amount to narrow the margins by for @lisp.
  5740. \newskip\lispnarrowing \lispnarrowing=0.4in
  5741. % This is the definition that ^^M gets inside @lisp, @example, and other
  5742. % such environments. \null is better than a space, since it doesn't
  5743. % have any width.
  5744. \def\lisppar{\null\endgraf}
  5745. % This space is always present above and below environments.
  5746. \newskip\envskipamount \envskipamount = 0pt
  5747. % Make spacing and below environment symmetrical. We use \parskip here
  5748. % to help in doing that, since in @example-like environments \parskip
  5749. % is reset to zero; thus the \afterenvbreak inserts no space -- but the
  5750. % start of the next paragraph will insert \parskip.
  5751. %
  5752. \def\aboveenvbreak{{%
  5753. % =10000 instead of <10000 because of a special case in \itemzzz and
  5754. % \sectionheading, q.v.
  5755. \ifnum \lastpenalty=10000 \else
  5756. \advance\envskipamount by \parskip
  5757. \endgraf
  5758. \ifdim\lastskip<\envskipamount
  5759. \removelastskip
  5760. % it's not a good place to break if the last penalty was \nobreak
  5761. % or better ...
  5762. \ifnum\lastpenalty<10000 \penalty-50 \fi
  5763. \vskip\envskipamount
  5764. \fi
  5765. \fi
  5766. }}
  5767. \let\afterenvbreak = \aboveenvbreak
  5768. % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will
  5769. % also clear it, so that its embedded environments do the narrowing again.
  5770. \let\nonarrowing=\relax
  5771. % @cartouche ... @end cartouche: draw rectangle w/rounded corners around
  5772. % environment contents.
  5773. \font\circle=lcircle10
  5774. \newdimen\circthick
  5775. \newdimen\cartouter\newdimen\cartinner
  5776. \newskip\normbskip\newskip\normpskip\newskip\normlskip
  5777. \circthick=\fontdimen8\circle
  5778. %
  5779. \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
  5780. \def\ctr{{\hskip 6pt\circle\char'010}}
  5781. \def\cbl{{\circle\char'012\hskip -6pt}}
  5782. \def\cbr{{\hskip 6pt\circle\char'011}}
  5783. \def\carttop{\hbox to \cartouter{\hskip\lskip
  5784. \ctl\leaders\hrule height\circthick\hfil\ctr
  5785. \hskip\rskip}}
  5786. \def\cartbot{\hbox to \cartouter{\hskip\lskip
  5787. \cbl\leaders\hrule height\circthick\hfil\cbr
  5788. \hskip\rskip}}
  5789. %
  5790. \newskip\lskip\newskip\rskip
  5791. \envdef\cartouche{%
  5792. \ifhmode\par\fi % can't be in the midst of a paragraph.
  5793. \startsavinginserts
  5794. \lskip=\leftskip \rskip=\rightskip
  5795. \leftskip=0pt\rightskip=0pt % we want these *outside*.
  5796. \cartinner=\hsize \advance\cartinner by-\lskip
  5797. \advance\cartinner by-\rskip
  5798. \cartouter=\hsize
  5799. \advance\cartouter by 18.4pt % allow for 3pt kerns on either
  5800. % side, and for 6pt waste from
  5801. % each corner char, and rule thickness
  5802. \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
  5803. % Flag to tell @lisp, etc., not to narrow margin.
  5804. \let\nonarrowing = t%
  5805. %
  5806. % If this cartouche directly follows a sectioning command, we need the
  5807. % \parskip glue (backspaced over by default) or the cartouche can
  5808. % collide with the section heading.
  5809. \ifnum\lastpenalty>10000 \vskip\parskip \fi
  5810. %
  5811. \vbox\bgroup
  5812. \baselineskip=0pt\parskip=0pt\lineskip=0pt
  5813. \carttop
  5814. \hbox\bgroup
  5815. \hskip\lskip
  5816. \vrule\kern3pt
  5817. \vbox\bgroup
  5818. \kern3pt
  5819. \hsize=\cartinner
  5820. \baselineskip=\normbskip
  5821. \lineskip=\normlskip
  5822. \parskip=\normpskip
  5823. \vskip -\parskip
  5824. \comment % For explanation, see the end of def\group.
  5825. }
  5826. \def\Ecartouche{%
  5827. \ifhmode\par\fi
  5828. \kern3pt
  5829. \egroup
  5830. \kern3pt\vrule
  5831. \hskip\rskip
  5832. \egroup
  5833. \cartbot
  5834. \egroup
  5835. \checkinserts
  5836. }
  5837. % This macro is called at the beginning of all the @example variants,
  5838. % inside a group.
  5839. \newdimen\nonfillparindent
  5840. \def\nonfillstart{%
  5841. \aboveenvbreak
  5842. \hfuzz = 12pt % Don't be fussy
  5843. \sepspaces % Make spaces be word-separators rather than space tokens.
  5844. \let\par = \lisppar % don't ignore blank lines
  5845. \obeylines % each line of input is a line of output
  5846. \parskip = 0pt
  5847. % Turn off paragraph indentation but redefine \indent to emulate
  5848. % the normal \indent.
  5849. \nonfillparindent=\parindent
  5850. \parindent = 0pt
  5851. \let\indent\nonfillindent
  5852. %
  5853. \emergencystretch = 0pt % don't try to avoid overfull boxes
  5854. \ifx\nonarrowing\relax
  5855. \advance \leftskip by \lispnarrowing
  5856. \exdentamount=\lispnarrowing
  5857. \else
  5858. \let\nonarrowing = \relax
  5859. \fi
  5860. \let\exdent=\nofillexdent
  5861. }
  5862. \begingroup
  5863. \obeyspaces
  5864. % We want to swallow spaces (but not other tokens) after the fake
  5865. % @indent in our nonfill-environments, where spaces are normally
  5866. % active and set to @tie, resulting in them not being ignored after
  5867. % @indent.
  5868. \gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}%
  5869. \gdef\nonfillindentcheck{%
  5870. \ifx\temp %
  5871. \expandafter\nonfillindentgobble%
  5872. \else%
  5873. \leavevmode\nonfillindentbox%
  5874. \fi%
  5875. }%
  5876. \endgroup
  5877. \def\nonfillindentgobble#1{\nonfillindent}
  5878. \def\nonfillindentbox{\hbox to \nonfillparindent{\hss}}
  5879. % If you want all examples etc. small: @set dispenvsize small.
  5880. % If you want even small examples the full size: @set dispenvsize nosmall.
  5881. % This affects the following displayed environments:
  5882. % @example, @display, @format, @lisp
  5883. %
  5884. \def\smallword{small}
  5885. \def\nosmallword{nosmall}
  5886. \let\SETdispenvsize\relax
  5887. \def\setnormaldispenv{%
  5888. \ifx\SETdispenvsize\smallword
  5889. % end paragraph for sake of leading, in case document has no blank
  5890. % line. This is redundant with what happens in \aboveenvbreak, but
  5891. % we need to do it before changing the fonts, and it's inconvenient
  5892. % to change the fonts afterward.
  5893. \ifnum \lastpenalty=10000 \else \endgraf \fi
  5894. \smallexamplefonts \rm
  5895. \fi
  5896. }
  5897. \def\setsmalldispenv{%
  5898. \ifx\SETdispenvsize\nosmallword
  5899. \else
  5900. \ifnum \lastpenalty=10000 \else \endgraf \fi
  5901. \smallexamplefonts \rm
  5902. \fi
  5903. }
  5904. % We often define two environments, @foo and @smallfoo.
  5905. % Let's do it in one command. #1 is the env name, #2 the definition.
  5906. \def\makedispenvdef#1#2{%
  5907. \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}%
  5908. \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}%
  5909. \expandafter\let\csname E#1\endcsname \afterenvbreak
  5910. \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
  5911. }
  5912. % Define two environment synonyms (#1 and #2) for an environment.
  5913. \def\maketwodispenvdef#1#2#3{%
  5914. \makedispenvdef{#1}{#3}%
  5915. \makedispenvdef{#2}{#3}%
  5916. }
  5917. %
  5918. % @lisp: indented, narrowed, typewriter font;
  5919. % @example: same as @lisp.
  5920. %
  5921. % @smallexample and @smalllisp: use smaller fonts.
  5922. % Originally contributed by Pavel@xerox.
  5923. %
  5924. \maketwodispenvdef{lisp}{example}{%
  5925. \nonfillstart
  5926. \tt\setupmarkupstyle{example}%
  5927. \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
  5928. \gobble % eat return
  5929. }
  5930. % @display/@smalldisplay: same as @lisp except keep current font.
  5931. %
  5932. \makedispenvdef{display}{%
  5933. \nonfillstart
  5934. \gobble
  5935. }
  5936. % @format/@smallformat: same as @display except don't narrow margins.
  5937. %
  5938. \makedispenvdef{format}{%
  5939. \let\nonarrowing = t%
  5940. \nonfillstart
  5941. \gobble
  5942. }
  5943. % @flushleft: same as @format, but doesn't obey \SETdispenvsize.
  5944. \envdef\flushleft{%
  5945. \let\nonarrowing = t%
  5946. \nonfillstart
  5947. \gobble
  5948. }
  5949. \let\Eflushleft = \afterenvbreak
  5950. % @flushright.
  5951. %
  5952. \envdef\flushright{%
  5953. \let\nonarrowing = t%
  5954. \nonfillstart
  5955. \advance\leftskip by 0pt plus 1fill\relax
  5956. \gobble
  5957. }
  5958. \let\Eflushright = \afterenvbreak
  5959. % @raggedright does more-or-less normal line breaking but no right
  5960. % justification. From plain.tex.
  5961. \envdef\raggedright{%
  5962. \rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax
  5963. }
  5964. \let\Eraggedright\par
  5965. \envdef\raggedleft{%
  5966. \parindent=0pt \leftskip0pt plus2em
  5967. \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
  5968. \hbadness=10000 % Last line will usually be underfull, so turn off
  5969. % badness reporting.
  5970. }
  5971. \let\Eraggedleft\par
  5972. \envdef\raggedcenter{%
  5973. \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em
  5974. \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
  5975. \hbadness=10000 % Last line will usually be underfull, so turn off
  5976. % badness reporting.
  5977. }
  5978. \let\Eraggedcenter\par
  5979. % @quotation does normal linebreaking (hence we can't use \nonfillstart)
  5980. % and narrows the margins. We keep \parskip nonzero in general, since
  5981. % we're doing normal filling. So, when using \aboveenvbreak and
  5982. % \afterenvbreak, temporarily make \parskip 0.
  5983. %
  5984. \makedispenvdef{quotation}{\quotationstart}
  5985. %
  5986. \def\quotationstart{%
  5987. {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
  5988. \parindent=0pt
  5989. %
  5990. % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
  5991. \ifx\nonarrowing\relax
  5992. \advance\leftskip by \lispnarrowing
  5993. \advance\rightskip by \lispnarrowing
  5994. \exdentamount = \lispnarrowing
  5995. \else
  5996. \let\nonarrowing = \relax
  5997. \fi
  5998. \parsearg\quotationlabel
  5999. }
  6000. % We have retained a nonzero parskip for the environment, since we're
  6001. % doing normal filling.
  6002. %
  6003. \def\Equotation{%
  6004. \par
  6005. \ifx\quotationauthor\thisisundefined\else
  6006. % indent a bit.
  6007. \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
  6008. \fi
  6009. {\parskip=0pt \afterenvbreak}%
  6010. }
  6011. \def\Esmallquotation{\Equotation}
  6012. % If we're given an argument, typeset it in bold with a colon after.
  6013. \def\quotationlabel#1{%
  6014. \def\temp{#1}%
  6015. \ifx\temp\empty \else
  6016. {\bf #1: }%
  6017. \fi
  6018. }
  6019. % LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
  6020. % If we want to allow any <char> as delimiter,
  6021. % we need the curly braces so that makeinfo sees the @verb command, eg:
  6022. % `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
  6023. %
  6024. % [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
  6025. %
  6026. % [Knuth] p.344; only we need to do the other characters Texinfo sets
  6027. % active too. Otherwise, they get lost as the first character on a
  6028. % verbatim line.
  6029. \def\dospecials{%
  6030. \do\ \do\\\do\{\do\}\do\$\do\&%
  6031. \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
  6032. \do\<\do\>\do\|\do\@\do+\do\"%
  6033. % Don't do the quotes -- if we do, @set txicodequoteundirected and
  6034. % @set txicodequotebacktick will not have effect on @verb and
  6035. % @verbatim, and ?` and !` ligatures won't get disabled.
  6036. %\do\`\do\'%
  6037. }
  6038. %
  6039. % [Knuth] p. 380
  6040. \def\uncatcodespecials{%
  6041. \def\do##1{\catcode`##1=\other}\dospecials}
  6042. %
  6043. % Setup for the @verb command.
  6044. %
  6045. % Eight spaces for a tab
  6046. \begingroup
  6047. \catcode`\^^I=\active
  6048. \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
  6049. \endgroup
  6050. %
  6051. \def\setupverb{%
  6052. \tt % easiest (and conventionally used) font for verbatim
  6053. \def\par{\leavevmode\endgraf}%
  6054. \setupmarkupstyle{verb}%
  6055. \tabeightspaces
  6056. % Respect line breaks,
  6057. % print special symbols as themselves, and
  6058. % make each space count
  6059. % must do in this order:
  6060. \obeylines \uncatcodespecials \sepspaces
  6061. }
  6062. % Setup for the @verbatim environment
  6063. %
  6064. % Real tab expansion.
  6065. \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
  6066. %
  6067. % We typeset each line of the verbatim in an \hbox, so we can handle
  6068. % tabs. The \global is in case the verbatim line starts with an accent,
  6069. % or some other command that starts with a begin-group. Otherwise, the
  6070. % entire \verbbox would disappear at the corresponding end-group, before
  6071. % it is typeset. Meanwhile, we can't have nested verbatim commands
  6072. % (can we?), so the \global won't be overwriting itself.
  6073. \newbox\verbbox
  6074. \def\starttabbox{\global\setbox\verbbox=\hbox\bgroup}
  6075. %
  6076. \begingroup
  6077. \catcode`\^^I=\active
  6078. \gdef\tabexpand{%
  6079. \catcode`\^^I=\active
  6080. \def^^I{\leavevmode\egroup
  6081. \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab
  6082. \divide\dimen\verbbox by\tabw
  6083. \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw
  6084. \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw
  6085. \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox
  6086. }%
  6087. }
  6088. \endgroup
  6089. % start the verbatim environment.
  6090. \def\setupverbatim{%
  6091. \let\nonarrowing = t%
  6092. \nonfillstart
  6093. \tt % easiest (and conventionally used) font for verbatim
  6094. % The \leavevmode here is for blank lines. Otherwise, we would
  6095. % never \starttabox and the \egroup would end verbatim mode.
  6096. \def\par{\leavevmode\egroup\box\verbbox\endgraf}%
  6097. \tabexpand
  6098. \setupmarkupstyle{verbatim}%
  6099. % Respect line breaks,
  6100. % print special symbols as themselves, and
  6101. % make each space count.
  6102. % Must do in this order:
  6103. \obeylines \uncatcodespecials \sepspaces
  6104. \everypar{\starttabbox}%
  6105. }
  6106. % Do the @verb magic: verbatim text is quoted by unique
  6107. % delimiter characters. Before first delimiter expect a
  6108. % right brace, after last delimiter expect closing brace:
  6109. %
  6110. % \def\doverb'{'<char>#1<char>'}'{#1}
  6111. %
  6112. % [Knuth] p. 382; only eat outer {}
  6113. \begingroup
  6114. \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other
  6115. \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
  6116. \endgroup
  6117. %
  6118. \def\verb{\begingroup\setupverb\doverb}
  6119. %
  6120. %
  6121. % Do the @verbatim magic: define the macro \doverbatim so that
  6122. % the (first) argument ends when '@end verbatim' is reached, ie:
  6123. %
  6124. % \def\doverbatim#1@end verbatim{#1}
  6125. %
  6126. % For Texinfo it's a lot easier than for LaTeX,
  6127. % because texinfo's \verbatim doesn't stop at '\end{verbatim}':
  6128. % we need not redefine '\', '{' and '}'.
  6129. %
  6130. % Inspired by LaTeX's verbatim command set [latex.ltx]
  6131. %
  6132. \begingroup
  6133. \catcode`\ =\active
  6134. \obeylines %
  6135. % ignore everything up to the first ^^M, that's the newline at the end
  6136. % of the @verbatim input line itself. Otherwise we get an extra blank
  6137. % line in the output.
  6138. \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}%
  6139. % We really want {...\end verbatim} in the body of the macro, but
  6140. % without the active space; thus we have to use \xdef and \gobble.
  6141. \endgroup
  6142. %
  6143. \envdef\verbatim{%
  6144. \setupverbatim\doverbatim
  6145. }
  6146. \let\Everbatim = \afterenvbreak
  6147. % @verbatiminclude FILE - insert text of file in verbatim environment.
  6148. %
  6149. \def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude}
  6150. %
  6151. \def\doverbatiminclude#1{%
  6152. {%
  6153. \makevalueexpandable
  6154. \setupverbatim
  6155. \indexnofonts % Allow `@@' and other weird things in file names.
  6156. \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
  6157. \input #1
  6158. \afterenvbreak
  6159. }%
  6160. }
  6161. % @copying ... @end copying.
  6162. % Save the text away for @insertcopying later.
  6163. %
  6164. % We save the uninterpreted tokens, rather than creating a box.
  6165. % Saving the text in a box would be much easier, but then all the
  6166. % typesetting commands (@smallbook, font changes, etc.) have to be done
  6167. % beforehand -- and a) we want @copying to be done first in the source
  6168. % file; b) letting users define the frontmatter in as flexible order as
  6169. % possible is very desirable.
  6170. %
  6171. \def\copying{\checkenv{}\begingroup\scanargctxt\docopying}
  6172. \def\docopying#1@end copying{\endgroup\def\copyingtext{#1}}
  6173. %
  6174. \def\insertcopying{%
  6175. \begingroup
  6176. \parindent = 0pt % paragraph indentation looks wrong on title page
  6177. \scanexp\copyingtext
  6178. \endgroup
  6179. }
  6180. \message{defuns,}
  6181. % @defun etc.
  6182. \newskip\defbodyindent \defbodyindent=.4in
  6183. \newskip\defargsindent \defargsindent=50pt
  6184. \newskip\deflastargmargin \deflastargmargin=18pt
  6185. \newcount\defunpenalty
  6186. % Start the processing of @deffn:
  6187. \def\startdefun{%
  6188. \ifnum\lastpenalty<10000
  6189. \medbreak
  6190. \defunpenalty=10003 % Will keep this @deffn together with the
  6191. % following @def command, see below.
  6192. \else
  6193. % If there are two @def commands in a row, we'll have a \nobreak,
  6194. % which is there to keep the function description together with its
  6195. % header. But if there's nothing but headers, we need to allow a
  6196. % break somewhere. Check specifically for penalty 10002, inserted
  6197. % by \printdefunline, instead of 10000, since the sectioning
  6198. % commands also insert a nobreak penalty, and we don't want to allow
  6199. % a break between a section heading and a defun.
  6200. %
  6201. % As a further refinement, we avoid "club" headers by signalling
  6202. % with penalty of 10003 after the very first @deffn in the
  6203. % sequence (see above), and penalty of 10002 after any following
  6204. % @def command.
  6205. \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi
  6206. %
  6207. % Similarly, after a section heading, do not allow a break.
  6208. % But do insert the glue.
  6209. \medskip % preceded by discardable penalty, so not a breakpoint
  6210. \fi
  6211. %
  6212. \parindent=0in
  6213. \advance\leftskip by \defbodyindent
  6214. \exdentamount=\defbodyindent
  6215. }
  6216. \def\dodefunx#1{%
  6217. % First, check whether we are in the right environment:
  6218. \checkenv#1%
  6219. %
  6220. % As above, allow line break if we have multiple x headers in a row.
  6221. % It's not a great place, though.
  6222. \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi
  6223. %
  6224. % And now, it's time to reuse the body of the original defun:
  6225. \expandafter\gobbledefun#1%
  6226. }
  6227. \def\gobbledefun#1\startdefun{}
  6228. % \printdefunline \deffnheader{text}
  6229. %
  6230. \def\printdefunline#1#2{%
  6231. \begingroup
  6232. % call \deffnheader:
  6233. #1#2 \endheader
  6234. % common ending:
  6235. \interlinepenalty = 10000
  6236. \advance\rightskip by 0pt plus 1fil\relax
  6237. \endgraf
  6238. \nobreak\vskip -\parskip
  6239. \penalty\defunpenalty % signal to \startdefun and \dodefunx
  6240. % Some of the @defun-type tags do not enable magic parentheses,
  6241. % rendering the following check redundant. But we don't optimize.
  6242. \checkparencounts
  6243. \endgroup
  6244. }
  6245. \def\Edefun{\endgraf\medbreak}
  6246. % \makedefun{deffn} creates \deffn, \deffnx and \Edeffn;
  6247. % the only thing remaining is to define \deffnheader.
  6248. %
  6249. \def\makedefun#1{%
  6250. \expandafter\let\csname E#1\endcsname = \Edefun
  6251. \edef\temp{\noexpand\domakedefun
  6252. \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}%
  6253. \temp
  6254. }
  6255. % \domakedefun \deffn \deffnx \deffnheader
  6256. %
  6257. % Define \deffn and \deffnx, without parameters.
  6258. % \deffnheader has to be defined explicitly.
  6259. %
  6260. \def\domakedefun#1#2#3{%
  6261. \envdef#1{%
  6262. \startdefun
  6263. \doingtypefnfalse % distinguish typed functions from all else
  6264. \parseargusing\activeparens{\printdefunline#3}%
  6265. }%
  6266. \def#2{\dodefunx#1}%
  6267. \def#3%
  6268. }
  6269. \newif\ifdoingtypefn % doing typed function?
  6270. \newif\ifrettypeownline % typeset return type on its own line?
  6271. % @deftypefnnewline on|off says whether the return type of typed functions
  6272. % are printed on their own line. This affects @deftypefn, @deftypefun,
  6273. % @deftypeop, and @deftypemethod.
  6274. %
  6275. \parseargdef\deftypefnnewline{%
  6276. \def\temp{#1}%
  6277. \ifx\temp\onword
  6278. \expandafter\let\csname SETtxideftypefnnl\endcsname
  6279. = \empty
  6280. \else\ifx\temp\offword
  6281. \expandafter\let\csname SETtxideftypefnnl\endcsname
  6282. = \relax
  6283. \else
  6284. \errhelp = \EMsimple
  6285. \errmessage{Unknown @txideftypefnnl value `\temp',
  6286. must be on|off}%
  6287. \fi\fi
  6288. }
  6289. % Untyped functions:
  6290. % @deffn category name args
  6291. \makedefun{deffn}{\deffngeneral{}}
  6292. % @deffn category class name args
  6293. \makedefun{defop}#1 {\defopon{#1\ \putwordon}}
  6294. % \defopon {category on}class name args
  6295. \def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
  6296. % \deffngeneral {subind}category name args
  6297. %
  6298. \def\deffngeneral#1#2 #3 #4\endheader{%
  6299. % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}.
  6300. \dosubind{fn}{\code{#3}}{#1}%
  6301. \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
  6302. }
  6303. % Typed functions:
  6304. % @deftypefn category type name args
  6305. \makedefun{deftypefn}{\deftypefngeneral{}}
  6306. % @deftypeop category class type name args
  6307. \makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}}
  6308. % \deftypeopon {category on}class type name args
  6309. \def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
  6310. % \deftypefngeneral {subind}category type name args
  6311. %
  6312. \def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
  6313. \dosubind{fn}{\code{#4}}{#1}%
  6314. \doingtypefntrue
  6315. \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
  6316. }
  6317. % Typed variables:
  6318. % @deftypevr category type var args
  6319. \makedefun{deftypevr}{\deftypecvgeneral{}}
  6320. % @deftypecv category class type var args
  6321. \makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}}
  6322. % \deftypecvof {category of}class type var args
  6323. \def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} }
  6324. % \deftypecvgeneral {subind}category type var args
  6325. %
  6326. \def\deftypecvgeneral#1#2 #3 #4 #5\endheader{%
  6327. \dosubind{vr}{\code{#4}}{#1}%
  6328. \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
  6329. }
  6330. % Untyped variables:
  6331. % @defvr category var args
  6332. \makedefun{defvr}#1 {\deftypevrheader{#1} {} }
  6333. % @defcv category class var args
  6334. \makedefun{defcv}#1 {\defcvof{#1\ \putwordof}}
  6335. % \defcvof {category of}class var args
  6336. \def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
  6337. % Types:
  6338. % @deftp category name args
  6339. \makedefun{deftp}#1 #2 #3\endheader{%
  6340. \doind{tp}{\code{#2}}%
  6341. \defname{#1}{}{#2}\defunargs{#3\unskip}%
  6342. }
  6343. % Remaining @defun-like shortcuts:
  6344. \makedefun{defun}{\deffnheader{\putwordDeffunc} }
  6345. \makedefun{defmac}{\deffnheader{\putwordDefmac} }
  6346. \makedefun{defspec}{\deffnheader{\putwordDefspec} }
  6347. \makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} }
  6348. \makedefun{defvar}{\defvrheader{\putwordDefvar} }
  6349. \makedefun{defopt}{\defvrheader{\putwordDefopt} }
  6350. \makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} }
  6351. \makedefun{defmethod}{\defopon\putwordMethodon}
  6352. \makedefun{deftypemethod}{\deftypeopon\putwordMethodon}
  6353. \makedefun{defivar}{\defcvof\putwordInstanceVariableof}
  6354. \makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof}
  6355. % \defname, which formats the name of the @def (not the args).
  6356. % #1 is the category, such as "Function".
  6357. % #2 is the return type, if any.
  6358. % #3 is the function name.
  6359. %
  6360. % We are followed by (but not passed) the arguments, if any.
  6361. %
  6362. \def\defname#1#2#3{%
  6363. \par
  6364. % Get the values of \leftskip and \rightskip as they were outside the @def...
  6365. \advance\leftskip by -\defbodyindent
  6366. %
  6367. % Determine if we are typesetting the return type of a typed function
  6368. % on a line by itself.
  6369. \rettypeownlinefalse
  6370. \ifdoingtypefn % doing a typed function specifically?
  6371. % then check user option for putting return type on its own line:
  6372. \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else
  6373. \rettypeownlinetrue
  6374. \fi
  6375. \fi
  6376. %
  6377. % How we'll format the category name. Putting it in brackets helps
  6378. % distinguish it from the body text that may end up on the next line
  6379. % just below it.
  6380. \def\temp{#1}%
  6381. \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
  6382. %
  6383. % Figure out line sizes for the paragraph shape. We'll always have at
  6384. % least two.
  6385. \tempnum = 2
  6386. %
  6387. % The first line needs space for \box0; but if \rightskip is nonzero,
  6388. % we need only space for the part of \box0 which exceeds it:
  6389. \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip
  6390. %
  6391. % If doing a return type on its own line, we'll have another line.
  6392. \ifrettypeownline
  6393. \advance\tempnum by 1
  6394. \def\maybeshapeline{0in \hsize}%
  6395. \else
  6396. \def\maybeshapeline{}%
  6397. \fi
  6398. %
  6399. % The continuations:
  6400. \dimen2=\hsize \advance\dimen2 by -\defargsindent
  6401. %
  6402. % The final paragraph shape:
  6403. \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2
  6404. %
  6405. % Put the category name at the right margin.
  6406. \noindent
  6407. \hbox to 0pt{%
  6408. \hfil\box0 \kern-\hsize
  6409. % \hsize has to be shortened this way:
  6410. \kern\leftskip
  6411. % Intentionally do not respect \rightskip, since we need the space.
  6412. }%
  6413. %
  6414. % Allow all lines to be underfull without complaint:
  6415. \tolerance=10000 \hbadness=10000
  6416. \exdentamount=\defbodyindent
  6417. {%
  6418. % defun fonts. We use typewriter by default (used to be bold) because:
  6419. % . we're printing identifiers, they should be in tt in principle.
  6420. % . in languages with many accents, such as Czech or French, it's
  6421. % common to leave accents off identifiers. The result looks ok in
  6422. % tt, but exceedingly strange in rm.
  6423. % . we don't want -- and --- to be treated as ligatures.
  6424. % . this still does not fix the ?` and !` ligatures, but so far no
  6425. % one has made identifiers using them :).
  6426. \df \tt
  6427. \def\temp{#2}% text of the return type
  6428. \ifx\temp\empty\else
  6429. \tclose{\temp}% typeset the return type
  6430. \ifrettypeownline
  6431. % put return type on its own line; prohibit line break following:
  6432. \hfil\vadjust{\nobreak}\break
  6433. \else
  6434. \space % type on same line, so just followed by a space
  6435. \fi
  6436. \fi % no return type
  6437. #3% output function name
  6438. }%
  6439. {\rm\enskip}% hskip 0.5 em of \tenrm
  6440. %
  6441. \boldbrax
  6442. % arguments will be output next, if any.
  6443. }
  6444. % Print arguments in slanted roman (not ttsl), inconsistently with using
  6445. % tt for the name. This is because literal text is sometimes needed in
  6446. % the argument list (groff manual), and ttsl and tt are not very
  6447. % distinguishable. Prevent hyphenation at `-' chars.
  6448. %
  6449. \def\defunargs#1{%
  6450. % use sl by default (not ttsl),
  6451. % tt for the names.
  6452. \df \sl \hyphenchar\font=0
  6453. %
  6454. % On the other hand, if an argument has two dashes (for instance), we
  6455. % want a way to get ttsl. Let's try @var for that.
  6456. \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}%
  6457. #1%
  6458. \sl\hyphenchar\font=45
  6459. }
  6460. % We want ()&[] to print specially on the defun line.
  6461. %
  6462. \def\activeparens{%
  6463. \catcode`\(=\active \catcode`\)=\active
  6464. \catcode`\[=\active \catcode`\]=\active
  6465. \catcode`\&=\active
  6466. }
  6467. % Make control sequences which act like normal parenthesis chars.
  6468. \let\lparen = ( \let\rparen = )
  6469. % Be sure that we always have a definition for `(', etc. For example,
  6470. % if the fn name has parens in it, \boldbrax will not be in effect yet,
  6471. % so TeX would otherwise complain about undefined control sequence.
  6472. {
  6473. \activeparens
  6474. \global\let(=\lparen \global\let)=\rparen
  6475. \global\let[=\lbrack \global\let]=\rbrack
  6476. \global\let& = \&
  6477. \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
  6478. \gdef\magicamp{\let&=\amprm}
  6479. }
  6480. \newcount\parencount
  6481. % If we encounter &foo, then turn on ()-hacking afterwards
  6482. \newif\ifampseen
  6483. \def\amprm#1 {\ampseentrue{\bf\&#1 }}
  6484. \def\parenfont{%
  6485. \ifampseen
  6486. % At the first level, print parens in roman,
  6487. % otherwise use the default font.
  6488. \ifnum \parencount=1 \rm \fi
  6489. \else
  6490. % The \sf parens (in \boldbrax) actually are a little bolder than
  6491. % the contained text. This is especially needed for [ and ] .
  6492. \sf
  6493. \fi
  6494. }
  6495. \def\infirstlevel#1{%
  6496. \ifampseen
  6497. \ifnum\parencount=1
  6498. #1%
  6499. \fi
  6500. \fi
  6501. }
  6502. \def\bfafterword#1 {#1 \bf}
  6503. \def\opnr{%
  6504. \global\advance\parencount by 1
  6505. {\parenfont(}%
  6506. \infirstlevel \bfafterword
  6507. }
  6508. \def\clnr{%
  6509. {\parenfont)}%
  6510. \infirstlevel \sl
  6511. \global\advance\parencount by -1
  6512. }
  6513. \newcount\brackcount
  6514. \def\lbrb{%
  6515. \global\advance\brackcount by 1
  6516. {\bf[}%
  6517. }
  6518. \def\rbrb{%
  6519. {\bf]}%
  6520. \global\advance\brackcount by -1
  6521. }
  6522. \def\checkparencounts{%
  6523. \ifnum\parencount=0 \else \badparencount \fi
  6524. \ifnum\brackcount=0 \else \badbrackcount \fi
  6525. }
  6526. % these should not use \errmessage; the glibc manual, at least, actually
  6527. % has such constructs (when documenting function pointers).
  6528. \def\badparencount{%
  6529. \message{Warning: unbalanced parentheses in @def...}%
  6530. \global\parencount=0
  6531. }
  6532. \def\badbrackcount{%
  6533. \message{Warning: unbalanced square brackets in @def...}%
  6534. \global\brackcount=0
  6535. }
  6536. \message{macros,}
  6537. % @macro.
  6538. % To do this right we need a feature of e-TeX, \scantokens,
  6539. % which we arrange to emulate with a temporary file in ordinary TeX.
  6540. \ifx\eTeXversion\thisisundefined
  6541. \newwrite\macscribble
  6542. \def\scantokens#1{%
  6543. \toks0={#1}%
  6544. \immediate\openout\macscribble=\jobname.tmp
  6545. \immediate\write\macscribble{\the\toks0}%
  6546. \immediate\closeout\macscribble
  6547. \input \jobname.tmp
  6548. }
  6549. \fi
  6550. \def\scanmacro#1{\begingroup
  6551. \newlinechar`\^^M
  6552. \let\xeatspaces\eatspaces
  6553. %
  6554. % Undo catcode changes of \startcontents and \doprintindex
  6555. % When called from @insertcopying or (short)caption, we need active
  6556. % backslash to get it printed correctly. Previously, we had
  6557. % \catcode`\\=\other instead. We'll see whether a problem appears
  6558. % with macro expansion. --kasal, 19aug04
  6559. \catcode`\@=0 \catcode`\\=\active \escapechar=`\@
  6560. %
  6561. % ... and for \example:
  6562. \spaceisspace
  6563. %
  6564. % The \empty here causes a following catcode 5 newline to be eaten as
  6565. % part of reading whitespace after a control sequence. It does not
  6566. % eat a catcode 13 newline. There's no good way to handle the two
  6567. % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX
  6568. % would then have different behavior). See the Macro Details node in
  6569. % the manual for the workaround we recommend for macros and
  6570. % line-oriented commands.
  6571. %
  6572. \scantokens{#1\empty}%
  6573. \endgroup}
  6574. \def\scanexp#1{%
  6575. \edef\temp{\noexpand\scanmacro{#1}}%
  6576. \temp
  6577. }
  6578. \newcount\paramno % Count of parameters
  6579. \newtoks\macname % Macro name
  6580. \newif\ifrecursive % Is it recursive?
  6581. % List of all defined macros in the form
  6582. % \definedummyword\macro1\definedummyword\macro2...
  6583. % Currently is also contains all @aliases; the list can be split
  6584. % if there is a need.
  6585. \def\macrolist{}
  6586. % Add the macro to \macrolist
  6587. \def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname}
  6588. \def\addtomacrolistxxx#1{%
  6589. \toks0 = \expandafter{\macrolist\definedummyword#1}%
  6590. \xdef\macrolist{\the\toks0}%
  6591. }
  6592. % Utility routines.
  6593. % This does \let #1 = #2, with \csnames; that is,
  6594. % \let \csname#1\endcsname = \csname#2\endcsname
  6595. % (except of course we have to play expansion games).
  6596. %
  6597. \def\cslet#1#2{%
  6598. \expandafter\let
  6599. \csname#1\expandafter\endcsname
  6600. \csname#2\endcsname
  6601. }
  6602. % Trim leading and trailing spaces off a string.
  6603. % Concepts from aro-bend problem 15 (see CTAN).
  6604. {\catcode`\@=11
  6605. \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
  6606. \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
  6607. \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
  6608. \def\unbrace#1{#1}
  6609. \unbrace{\gdef\trim@@@ #1 } #2@{#1}
  6610. }
  6611. % Trim a single trailing ^^M off a string.
  6612. {\catcode`\^^M=\other \catcode`\Q=3%
  6613. \gdef\eatcr #1{\eatcra #1Q^^MQ}%
  6614. \gdef\eatcra#1^^MQ{\eatcrb#1Q}%
  6615. \gdef\eatcrb#1Q#2Q{#1}%
  6616. }
  6617. % Macro bodies are absorbed as an argument in a context where
  6618. % all characters are catcode 10, 11 or 12, except \ which is active
  6619. % (as in normal texinfo). It is necessary to change the definition of \
  6620. % to recognize macro arguments; this is the job of \mbodybackslash.
  6621. %
  6622. % Non-ASCII encodings make 8-bit characters active, so un-activate
  6623. % them to avoid their expansion. Must do this non-globally, to
  6624. % confine the change to the current group.
  6625. %
  6626. % It's necessary to have hard CRs when the macro is executed. This is
  6627. % done by making ^^M (\endlinechar) catcode 12 when reading the macro
  6628. % body, and then making it the \newlinechar in \scanmacro.
  6629. %
  6630. \def\scanctxt{% used as subroutine
  6631. \catcode`\"=\other
  6632. \catcode`\+=\other
  6633. \catcode`\<=\other
  6634. \catcode`\>=\other
  6635. \catcode`\@=\other
  6636. \catcode`\^=\other
  6637. \catcode`\_=\other
  6638. \catcode`\|=\other
  6639. \catcode`\~=\other
  6640. \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi
  6641. }
  6642. \def\scanargctxt{% used for copying and captions, not macros.
  6643. \scanctxt
  6644. \catcode`\\=\other
  6645. \catcode`\^^M=\other
  6646. }
  6647. \def\macrobodyctxt{% used for @macro definitions
  6648. \scanctxt
  6649. \catcode`\{=\other
  6650. \catcode`\}=\other
  6651. \catcode`\^^M=\other
  6652. \usembodybackslash
  6653. }
  6654. \def\macroargctxt{% used when scanning invocations
  6655. \scanctxt
  6656. \catcode`\\=0
  6657. }
  6658. % why catcode 0 for \ in the above? To recognize \\ \{ \} as "escapes"
  6659. % for the single characters \ { }. Thus, we end up with the "commands"
  6660. % that would be written @\ @{ @} in a Texinfo document.
  6661. %
  6662. % We already have @{ and @}. For @\, we define it here, and only for
  6663. % this purpose, to produce a typewriter backslash (so, the @\ that we
  6664. % define for @math can't be used with @macro calls):
  6665. %
  6666. \def\\{\normalbackslash}%
  6667. %
  6668. % We would like to do this for \, too, since that is what makeinfo does.
  6669. % But it is not possible, because Texinfo already has a command @, for a
  6670. % cedilla accent. Documents must use @comma{} instead.
  6671. %
  6672. % \anythingelse will almost certainly be an error of some kind.
  6673. % \mbodybackslash is the definition of \ in @macro bodies.
  6674. % It maps \foo\ => \csname macarg.foo\endcsname => #N
  6675. % where N is the macro parameter number.
  6676. % We define \csname macarg.\endcsname to be \realbackslash, so
  6677. % \\ in macro replacement text gets you a backslash.
  6678. %
  6679. {\catcode`@=0 @catcode`@\=@active
  6680. @gdef@usembodybackslash{@let\=@mbodybackslash}
  6681. @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
  6682. }
  6683. \expandafter\def\csname macarg.\endcsname{\realbackslash}
  6684. \def\margbackslash#1{\char`\#1 }
  6685. \def\macro{\recursivefalse\parsearg\macroxxx}
  6686. \def\rmacro{\recursivetrue\parsearg\macroxxx}
  6687. \def\macroxxx#1{%
  6688. \getargs{#1}% now \macname is the macname and \argl the arglist
  6689. \ifx\argl\empty % no arguments
  6690. \paramno=0\relax
  6691. \else
  6692. \expandafter\parsemargdef \argl;%
  6693. \if\paramno>256\relax
  6694. \ifx\eTeXversion\thisisundefined
  6695. \errhelp = \EMsimple
  6696. \errmessage{You need eTeX to compile a file with macros with more than 256 arguments}
  6697. \fi
  6698. \fi
  6699. \fi
  6700. \if1\csname ismacro.\the\macname\endcsname
  6701. \message{Warning: redefining \the\macname}%
  6702. \else
  6703. \expandafter\ifx\csname \the\macname\endcsname \relax
  6704. \else \errmessage{Macro name \the\macname\space already defined}\fi
  6705. \global\cslet{macsave.\the\macname}{\the\macname}%
  6706. \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
  6707. \addtomacrolist{\the\macname}%
  6708. \fi
  6709. \begingroup \macrobodyctxt
  6710. \ifrecursive \expandafter\parsermacbody
  6711. \else \expandafter\parsemacbody
  6712. \fi}
  6713. \parseargdef\unmacro{%
  6714. \if1\csname ismacro.#1\endcsname
  6715. \global\cslet{#1}{macsave.#1}%
  6716. \global\expandafter\let \csname ismacro.#1\endcsname=0%
  6717. % Remove the macro name from \macrolist:
  6718. \begingroup
  6719. \expandafter\let\csname#1\endcsname \relax
  6720. \let\definedummyword\unmacrodo
  6721. \xdef\macrolist{\macrolist}%
  6722. \endgroup
  6723. \else
  6724. \errmessage{Macro #1 not defined}%
  6725. \fi
  6726. }
  6727. % Called by \do from \dounmacro on each macro. The idea is to omit any
  6728. % macro definitions that have been changed to \relax.
  6729. %
  6730. \def\unmacrodo#1{%
  6731. \ifx #1\relax
  6732. % remove this
  6733. \else
  6734. \noexpand\definedummyword \noexpand#1%
  6735. \fi
  6736. }
  6737. % This makes use of the obscure feature that if the last token of a
  6738. % <parameter list> is #, then the preceding argument is delimited by
  6739. % an opening brace, and that opening brace is not consumed.
  6740. \def\getargs#1{\getargsxxx#1{}}
  6741. \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
  6742. \def\getmacname#1 #2\relax{\macname={#1}}
  6743. \def\getmacargs#1{\def\argl{#1}}
  6744. % For macro processing make @ a letter so that we can make Texinfo private macro names.
  6745. \edef\texiatcatcode{\the\catcode`\@}
  6746. \catcode `@=11\relax
  6747. % Parse the optional {params} list. Set up \paramno and \paramlist
  6748. % so \defmacro knows what to do. Define \macarg.BLAH for each BLAH
  6749. % in the params list to some hook where the argument si to be expanded. If
  6750. % there are less than 10 arguments that hook is to be replaced by ##N where N
  6751. % is the position in that list, that is to say the macro arguments are to be
  6752. % defined `a la TeX in the macro body.
  6753. %
  6754. % That gets used by \mbodybackslash (above).
  6755. %
  6756. % We need to get `macro parameter char #' into several definitions.
  6757. % The technique used is stolen from LaTeX: let \hash be something
  6758. % unexpandable, insert that wherever you need a #, and then redefine
  6759. % it to # just before using the token list produced.
  6760. %
  6761. % The same technique is used to protect \eatspaces till just before
  6762. % the macro is used.
  6763. %
  6764. % If there are 10 or more arguments, a different technique is used, where the
  6765. % hook remains in the body, and when macro is to be expanded the body is
  6766. % processed again to replace the arguments.
  6767. %
  6768. % In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the
  6769. % argument N value and then \edef the body (nothing else will expand because of
  6770. % the catcode regime underwhich the body was input).
  6771. %
  6772. % If you compile with TeX (not eTeX), and you have macros with 10 or more
  6773. % arguments, you need that no macro has more than 256 arguments, otherwise an
  6774. % error is produced.
  6775. \def\parsemargdef#1;{%
  6776. \paramno=0\def\paramlist{}%
  6777. \let\hash\relax
  6778. \let\xeatspaces\relax
  6779. \parsemargdefxxx#1,;,%
  6780. % In case that there are 10 or more arguments we parse again the arguments
  6781. % list to set new definitions for the \macarg.BLAH macros corresponding to
  6782. % each BLAH argument. It was anyhow needed to parse already once this list
  6783. % in order to count the arguments, and as macros with at most 9 arguments
  6784. % are by far more frequent than macro with 10 or more arguments, defining
  6785. % twice the \macarg.BLAH macros does not cost too much processing power.
  6786. \ifnum\paramno<10\relax\else
  6787. \paramno0\relax
  6788. \parsemmanyargdef@@#1,;,% 10 or more arguments
  6789. \fi
  6790. }
  6791. \def\parsemargdefxxx#1,{%
  6792. \if#1;\let\next=\relax
  6793. \else \let\next=\parsemargdefxxx
  6794. \advance\paramno by 1
  6795. \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
  6796. {\xeatspaces{\hash\the\paramno}}%
  6797. \edef\paramlist{\paramlist\hash\the\paramno,}%
  6798. \fi\next}
  6799. \def\parsemmanyargdef@@#1,{%
  6800. \if#1;\let\next=\relax
  6801. \else
  6802. \let\next=\parsemmanyargdef@@
  6803. \edef\tempb{\eatspaces{#1}}%
  6804. \expandafter\def\expandafter\tempa
  6805. \expandafter{\csname macarg.\tempb\endcsname}%
  6806. % Note that we need some extra \noexpand\noexpand, this is because we
  6807. % don't want \the to be expanded in the \parsermacbody as it uses an
  6808. % \xdef .
  6809. \expandafter\edef\tempa
  6810. {\noexpand\noexpand\noexpand\the\toks\the\paramno}%
  6811. \advance\paramno by 1\relax
  6812. \fi\next}
  6813. % These two commands read recursive and nonrecursive macro bodies.
  6814. % (They're different since rec and nonrec macros end differently.)
  6815. %
  6816. \catcode `\@\texiatcatcode
  6817. \long\def\parsemacbody#1@end macro%
  6818. {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
  6819. \long\def\parsermacbody#1@end rmacro%
  6820. {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
  6821. \catcode `\@=11\relax
  6822. \let\endargs@\relax
  6823. \let\nil@\relax
  6824. \def\nilm@{\nil@}%
  6825. \long\def\nillm@{\nil@}%
  6826. % This macro is expanded during the Texinfo macro expansion, not during its
  6827. % definition. It gets all the arguments values and assigns them to macros
  6828. % macarg.ARGNAME
  6829. %
  6830. % #1 is the macro name
  6831. % #2 is the list of argument names
  6832. % #3 is the list of argument values
  6833. \def\getargvals@#1#2#3{%
  6834. \def\macargdeflist@{}%
  6835. \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion.
  6836. \def\paramlist{#2,\nil@}%
  6837. \def\macroname{#1}%
  6838. \begingroup
  6839. \macroargctxt
  6840. \def\argvaluelist{#3,\nil@}%
  6841. \def\@tempa{#3}%
  6842. \ifx\@tempa\empty
  6843. \setemptyargvalues@
  6844. \else
  6845. \getargvals@@
  6846. \fi
  6847. }
  6848. %
  6849. \def\getargvals@@{%
  6850. \ifx\paramlist\nilm@
  6851. % Some sanity check needed here that \argvaluelist is also empty.
  6852. \ifx\argvaluelist\nillm@
  6853. \else
  6854. \errhelp = \EMsimple
  6855. \errmessage{Too many arguments in macro `\macroname'!}%
  6856. \fi
  6857. \let\next\macargexpandinbody@
  6858. \else
  6859. \ifx\argvaluelist\nillm@
  6860. % No more arguments values passed to macro. Set remaining named-arg
  6861. % macros to empty.
  6862. \let\next\setemptyargvalues@
  6863. \else
  6864. % pop current arg name into \@tempb
  6865. \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}%
  6866. \expandafter\@tempa\expandafter{\paramlist}%
  6867. % pop current argument value into \@tempc
  6868. \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}%
  6869. \expandafter\@tempa\expandafter{\argvaluelist}%
  6870. % Here \@tempb is the current arg name and \@tempc is the current arg value.
  6871. % First place the new argument macro definition into \@tempd
  6872. \expandafter\macname\expandafter{\@tempc}%
  6873. \expandafter\let\csname macarg.\@tempb\endcsname\relax
  6874. \expandafter\def\expandafter\@tempe\expandafter{%
  6875. \csname macarg.\@tempb\endcsname}%
  6876. \edef\@tempd{\long\def\@tempe{\the\macname}}%
  6877. \push@\@tempd\macargdeflist@
  6878. \let\next\getargvals@@
  6879. \fi
  6880. \fi
  6881. \next
  6882. }
  6883. \def\push@#1#2{%
  6884. \expandafter\expandafter\expandafter\def
  6885. \expandafter\expandafter\expandafter#2%
  6886. \expandafter\expandafter\expandafter{%
  6887. \expandafter#1#2}%
  6888. }
  6889. % Replace arguments by their values in the macro body, and place the result
  6890. % in macro \@tempa
  6891. \def\macvalstoargs@{%
  6892. % To do this we use the property that token registers that are \the'ed
  6893. % within an \edef expand only once. So we are going to place all argument
  6894. % values into respective token registers.
  6895. %
  6896. % First we save the token context, and initialize argument numbering.
  6897. \begingroup
  6898. \paramno0\relax
  6899. % Then, for each argument number #N, we place the corresponding argument
  6900. % value into a new token list register \toks#N
  6901. \expandafter\putargsintokens@\saveparamlist@,;,%
  6902. % Then, we expand the body so that argument are replaced by their
  6903. % values. The trick for values not to be expanded themselves is that they
  6904. % are within tokens and that tokens expand only once in an \edef .
  6905. \edef\@tempc{\csname mac.\macroname .body\endcsname}%
  6906. % Now we restore the token stack pointer to free the token list registers
  6907. % which we have used, but we make sure that expanded body is saved after
  6908. % group.
  6909. \expandafter
  6910. \endgroup
  6911. \expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
  6912. }
  6913. \def\macargexpandinbody@{%
  6914. %% Define the named-macro outside of this group and then close this group.
  6915. \expandafter
  6916. \endgroup
  6917. \macargdeflist@
  6918. % First the replace in body the macro arguments by their values, the result
  6919. % is in \@tempa .
  6920. \macvalstoargs@
  6921. % Then we point at the \norecurse or \gobble (for recursive) macro value
  6922. % with \@tempb .
  6923. \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname
  6924. % Depending on whether it is recursive or not, we need some tailing
  6925. % \egroup .
  6926. \ifx\@tempb\gobble
  6927. \let\@tempc\relax
  6928. \else
  6929. \let\@tempc\egroup
  6930. \fi
  6931. % And now we do the real job:
  6932. \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}%
  6933. \@tempd
  6934. }
  6935. \def\putargsintokens@#1,{%
  6936. \if#1;\let\next\relax
  6937. \else
  6938. \let\next\putargsintokens@
  6939. % First we allocate the new token list register, and give it a temporary
  6940. % alias \@tempb .
  6941. \toksdef\@tempb\the\paramno
  6942. % Then we place the argument value into that token list register.
  6943. \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname
  6944. \expandafter\@tempb\expandafter{\@tempa}%
  6945. \advance\paramno by 1\relax
  6946. \fi
  6947. \next
  6948. }
  6949. % Save the token stack pointer into macro #1
  6950. \def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}}
  6951. % Restore the token stack pointer from number in macro #1
  6952. \def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax}
  6953. % newtoks that can be used non \outer .
  6954. \def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi}
  6955. % Tailing missing arguments are set to empty
  6956. \def\setemptyargvalues@{%
  6957. \ifx\paramlist\nilm@
  6958. \let\next\macargexpandinbody@
  6959. \else
  6960. \expandafter\setemptyargvaluesparser@\paramlist\endargs@
  6961. \let\next\setemptyargvalues@
  6962. \fi
  6963. \next
  6964. }
  6965. \def\setemptyargvaluesparser@#1,#2\endargs@{%
  6966. \expandafter\def\expandafter\@tempa\expandafter{%
  6967. \expandafter\def\csname macarg.#1\endcsname{}}%
  6968. \push@\@tempa\macargdeflist@
  6969. \def\paramlist{#2}%
  6970. }
  6971. % #1 is the element target macro
  6972. % #2 is the list macro
  6973. % #3,#4\endargs@ is the list value
  6974. \def\pop@#1#2#3,#4\endargs@{%
  6975. \def#1{#3}%
  6976. \def#2{#4}%
  6977. }
  6978. \long\def\longpop@#1#2#3,#4\endargs@{%
  6979. \long\def#1{#3}%
  6980. \long\def#2{#4}%
  6981. }
  6982. % This defines a Texinfo @macro. There are eight cases: recursive and
  6983. % nonrecursive macros of zero, one, up to nine, and many arguments.
  6984. % Much magic with \expandafter here.
  6985. % \xdef is used so that macro definitions will survive the file
  6986. % they're defined in; @include reads the file inside a group.
  6987. %
  6988. \def\defmacro{%
  6989. \let\hash=##% convert placeholders to macro parameter chars
  6990. \ifrecursive
  6991. \ifcase\paramno
  6992. % 0
  6993. \expandafter\xdef\csname\the\macname\endcsname{%
  6994. \noexpand\scanmacro{\temp}}%
  6995. \or % 1
  6996. \expandafter\xdef\csname\the\macname\endcsname{%
  6997. \bgroup\noexpand\macroargctxt
  6998. \noexpand\braceorline
  6999. \expandafter\noexpand\csname\the\macname xxx\endcsname}%
  7000. \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
  7001. \egroup\noexpand\scanmacro{\temp}}%
  7002. \else
  7003. \ifnum\paramno<10\relax % at most 9
  7004. \expandafter\xdef\csname\the\macname\endcsname{%
  7005. \bgroup\noexpand\macroargctxt
  7006. \noexpand\csname\the\macname xx\endcsname}%
  7007. \expandafter\xdef\csname\the\macname xx\endcsname##1{%
  7008. \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
  7009. \expandafter\expandafter
  7010. \expandafter\xdef
  7011. \expandafter\expandafter
  7012. \csname\the\macname xxx\endcsname
  7013. \paramlist{\egroup\noexpand\scanmacro{\temp}}%
  7014. \else % 10 or more
  7015. \expandafter\xdef\csname\the\macname\endcsname{%
  7016. \noexpand\getargvals@{\the\macname}{\argl}%
  7017. }%
  7018. \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
  7019. \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble
  7020. \fi
  7021. \fi
  7022. \else
  7023. \ifcase\paramno
  7024. % 0
  7025. \expandafter\xdef\csname\the\macname\endcsname{%
  7026. \noexpand\norecurse{\the\macname}%
  7027. \noexpand\scanmacro{\temp}\egroup}%
  7028. \or % 1
  7029. \expandafter\xdef\csname\the\macname\endcsname{%
  7030. \bgroup\noexpand\macroargctxt
  7031. \noexpand\braceorline
  7032. \expandafter\noexpand\csname\the\macname xxx\endcsname}%
  7033. \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
  7034. \egroup
  7035. \noexpand\norecurse{\the\macname}%
  7036. \noexpand\scanmacro{\temp}\egroup}%
  7037. \else % at most 9
  7038. \ifnum\paramno<10\relax
  7039. \expandafter\xdef\csname\the\macname\endcsname{%
  7040. \bgroup\noexpand\macroargctxt
  7041. \expandafter\noexpand\csname\the\macname xx\endcsname}%
  7042. \expandafter\xdef\csname\the\macname xx\endcsname##1{%
  7043. \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
  7044. \expandafter\expandafter
  7045. \expandafter\xdef
  7046. \expandafter\expandafter
  7047. \csname\the\macname xxx\endcsname
  7048. \paramlist{%
  7049. \egroup
  7050. \noexpand\norecurse{\the\macname}%
  7051. \noexpand\scanmacro{\temp}\egroup}%
  7052. \else % 10 or more:
  7053. \expandafter\xdef\csname\the\macname\endcsname{%
  7054. \noexpand\getargvals@{\the\macname}{\argl}%
  7055. }%
  7056. \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
  7057. \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse
  7058. \fi
  7059. \fi
  7060. \fi}
  7061. \catcode `\@\texiatcatcode\relax
  7062. \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
  7063. % \braceorline decides whether the next nonwhitespace character is a
  7064. % {. If so it reads up to the closing }, if not, it reads the whole
  7065. % line. Whatever was read is then fed to the next control sequence
  7066. % as an argument (by \parsebrace or \parsearg).
  7067. %
  7068. \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
  7069. \def\braceorlinexxx{%
  7070. \ifx\nchar\bgroup\else
  7071. \expandafter\parsearg
  7072. \fi \macnamexxx}
  7073. % @alias.
  7074. % We need some trickery to remove the optional spaces around the equal
  7075. % sign. Make them active and then expand them all to nothing.
  7076. %
  7077. \def\alias{\parseargusing\obeyspaces\aliasxxx}
  7078. \def\aliasxxx #1{\aliasyyy#1\relax}
  7079. \def\aliasyyy #1=#2\relax{%
  7080. {%
  7081. \expandafter\let\obeyedspace=\empty
  7082. \addtomacrolist{#1}%
  7083. \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%
  7084. }%
  7085. \next
  7086. }
  7087. \message{cross references,}
  7088. \newwrite\auxfile
  7089. \newif\ifhavexrefs % True if xref values are known.
  7090. \newif\ifwarnedxrefs % True if we warned once that they aren't known.
  7091. % @inforef is relatively simple.
  7092. \def\inforef #1{\inforefzzz #1,,,,**}
  7093. \def\inforefzzz #1,#2,#3,#4**{%
  7094. \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
  7095. node \samp{\ignorespaces#1{}}}
  7096. % @node's only job in TeX is to define \lastnode, which is used in
  7097. % cross-references. The @node line might or might not have commas, and
  7098. % might or might not have spaces before the first comma, like:
  7099. % @node foo , bar , ...
  7100. % We don't want such trailing spaces in the node name.
  7101. %
  7102. \parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse}
  7103. %
  7104. % also remove a trailing comma, in case of something like this:
  7105. % @node Help-Cross, , , Cross-refs
  7106. \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
  7107. \def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}}
  7108. \let\nwnode=\node
  7109. \let\lastnode=\empty
  7110. % Write a cross-reference definition for the current node. #1 is the
  7111. % type (Ynumbered, Yappendix, Ynothing).
  7112. %
  7113. \def\donoderef#1{%
  7114. \ifx\lastnode\empty\else
  7115. \setref{\lastnode}{#1}%
  7116. \global\let\lastnode=\empty
  7117. \fi
  7118. }
  7119. % @anchor{NAME} -- define xref target at arbitrary point.
  7120. %
  7121. \newcount\savesfregister
  7122. %
  7123. \def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
  7124. \def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
  7125. \def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
  7126. % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
  7127. % anchor), which consists of three parts:
  7128. % 1) NAME-title - the current sectioning name taken from \lastsection,
  7129. % or the anchor name.
  7130. % 2) NAME-snt - section number and type, passed as the SNT arg, or
  7131. % empty for anchors.
  7132. % 3) NAME-pg - the page number.
  7133. %
  7134. % This is called from \donoderef, \anchor, and \dofloat. In the case of
  7135. % floats, there is an additional part, which is not written here:
  7136. % 4) NAME-lof - the text as it should appear in a @listoffloats.
  7137. %
  7138. \def\setref#1#2{%
  7139. \pdfmkdest{#1}%
  7140. \iflinks
  7141. {%
  7142. \atdummies % preserve commands, but don't expand them
  7143. \edef\writexrdef##1##2{%
  7144. \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
  7145. ##1}{##2}}% these are parameters of \writexrdef
  7146. }%
  7147. \toks0 = \expandafter{\lastsection}%
  7148. \immediate \writexrdef{title}{\the\toks0 }%
  7149. \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
  7150. \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout
  7151. }%
  7152. \fi
  7153. }
  7154. % @xrefautosectiontitle on|off says whether @section(ing) names are used
  7155. % automatically in xrefs, if the third arg is not explicitly specified.
  7156. % This was provided as a "secret" @set xref-automatic-section-title
  7157. % variable, now it's official.
  7158. %
  7159. \parseargdef\xrefautomaticsectiontitle{%
  7160. \def\temp{#1}%
  7161. \ifx\temp\onword
  7162. \expandafter\let\csname SETxref-automatic-section-title\endcsname
  7163. = \empty
  7164. \else\ifx\temp\offword
  7165. \expandafter\let\csname SETxref-automatic-section-title\endcsname
  7166. = \relax
  7167. \else
  7168. \errhelp = \EMsimple
  7169. \errmessage{Unknown @xrefautomaticsectiontitle value `\temp',
  7170. must be on|off}%
  7171. \fi\fi
  7172. }
  7173. % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
  7174. % the node name, #2 the name of the Info cross-reference, #3 the printed
  7175. % node name, #4 the name of the Info file, #5 the name of the printed
  7176. % manual. All but the node name can be omitted.
  7177. %
  7178. \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
  7179. \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
  7180. \def\ref#1{\xrefX[#1,,,,,,,]}
  7181. \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
  7182. \unsepspaces
  7183. \def\printedmanual{\ignorespaces #5}%
  7184. \def\printedrefname{\ignorespaces #3}%
  7185. \setbox1=\hbox{\printedmanual\unskip}%
  7186. \setbox0=\hbox{\printedrefname\unskip}%
  7187. \ifdim \wd0 = 0pt
  7188. % No printed node name was explicitly given.
  7189. \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax
  7190. % Use the node name inside the square brackets.
  7191. \def\printedrefname{\ignorespaces #1}%
  7192. \else
  7193. % Use the actual chapter/section title appear inside
  7194. % the square brackets. Use the real section title if we have it.
  7195. \ifdim \wd1 > 0pt
  7196. % It is in another manual, so we don't have it.
  7197. \def\printedrefname{\ignorespaces #1}%
  7198. \else
  7199. \ifhavexrefs
  7200. % We know the real title if we have the xref values.
  7201. \def\printedrefname{\refx{#1-title}{}}%
  7202. \else
  7203. % Otherwise just copy the Info node name.
  7204. \def\printedrefname{\ignorespaces #1}%
  7205. \fi%
  7206. \fi
  7207. \fi
  7208. \fi
  7209. %
  7210. % Make link in pdf output.
  7211. \ifpdf
  7212. {\indexnofonts
  7213. \turnoffactive
  7214. % This expands tokens, so do it after making catcode changes, so _
  7215. % etc. don't get their TeX definitions.
  7216. \getfilename{#4}%
  7217. %
  7218. % See comments at \activebackslashdouble.
  7219. {\activebackslashdouble \xdef\pdfxrefdest{#1}%
  7220. \backslashparens\pdfxrefdest}%
  7221. %
  7222. \leavevmode
  7223. \startlink attr{/Border [0 0 0]}%
  7224. \ifnum\filenamelength>0
  7225. goto file{\the\filename.pdf} name{\pdfxrefdest}%
  7226. \else
  7227. goto name{\pdfmkpgn{\pdfxrefdest}}%
  7228. \fi
  7229. }%
  7230. \setcolor{\linkcolor}%
  7231. \fi
  7232. %
  7233. % Float references are printed completely differently: "Figure 1.2"
  7234. % instead of "[somenode], p.3". We distinguish them by the
  7235. % LABEL-title being set to a magic string.
  7236. {%
  7237. % Have to otherify everything special to allow the \csname to
  7238. % include an _ in the xref name, etc.
  7239. \indexnofonts
  7240. \turnoffactive
  7241. \expandafter\global\expandafter\let\expandafter\Xthisreftitle
  7242. \csname XR#1-title\endcsname
  7243. }%
  7244. \iffloat\Xthisreftitle
  7245. % If the user specified the print name (third arg) to the ref,
  7246. % print it instead of our usual "Figure 1.2".
  7247. \ifdim\wd0 = 0pt
  7248. \refx{#1-snt}{}%
  7249. \else
  7250. \printedrefname
  7251. \fi
  7252. %
  7253. % if the user also gave the printed manual name (fifth arg), append
  7254. % "in MANUALNAME".
  7255. \ifdim \wd1 > 0pt
  7256. \space \putwordin{} \cite{\printedmanual}%
  7257. \fi
  7258. \else
  7259. % node/anchor (non-float) references.
  7260. %
  7261. % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
  7262. % insert empty discretionaries after hyphens, which means that it will
  7263. % not find a line break at a hyphen in a node names. Since some manuals
  7264. % are best written with fairly long node names, containing hyphens, this
  7265. % is a loss. Therefore, we give the text of the node name again, so it
  7266. % is as if TeX is seeing it for the first time.
  7267. \ifdim \wd1 > 0pt
  7268. \putwordSection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}%
  7269. \else
  7270. % _ (for example) has to be the character _ for the purposes of the
  7271. % control sequence corresponding to the node, but it has to expand
  7272. % into the usual \leavevmode...\vrule stuff for purposes of
  7273. % printing. So we \turnoffactive for the \refx-snt, back on for the
  7274. % printing, back off for the \refx-pg.
  7275. {\turnoffactive
  7276. % Only output a following space if the -snt ref is nonempty; for
  7277. % @unnumbered and @anchor, it won't be.
  7278. \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
  7279. \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
  7280. }%
  7281. % output the `[mynode]' via a macro so it can be overridden.
  7282. \xrefprintnodename\printedrefname
  7283. %
  7284. % But we always want a comma and a space:
  7285. ,\space
  7286. %
  7287. % output the `page 3'.
  7288. \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
  7289. \fi
  7290. \fi
  7291. \endlink
  7292. \endgroup}
  7293. % This macro is called from \xrefX for the `[nodename]' part of xref
  7294. % output. It's a separate macro only so it can be changed more easily,
  7295. % since square brackets don't work well in some documents. Particularly
  7296. % one that Bob is working on :).
  7297. %
  7298. \def\xrefprintnodename#1{[#1]}
  7299. % Things referred to by \setref.
  7300. %
  7301. \def\Ynothing{}
  7302. \def\Yomitfromtoc{}
  7303. \def\Ynumbered{%
  7304. \ifnum\secno=0
  7305. \putwordChapter@tie \the\chapno
  7306. \else \ifnum\subsecno=0
  7307. \putwordSection@tie \the\chapno.\the\secno
  7308. \else \ifnum\subsubsecno=0
  7309. \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
  7310. \else
  7311. \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
  7312. \fi\fi\fi
  7313. }
  7314. \def\Yappendix{%
  7315. \ifnum\secno=0
  7316. \putwordAppendix@tie @char\the\appendixno{}%
  7317. \else \ifnum\subsecno=0
  7318. \putwordSection@tie @char\the\appendixno.\the\secno
  7319. \else \ifnum\subsubsecno=0
  7320. \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
  7321. \else
  7322. \putwordSection@tie
  7323. @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
  7324. \fi\fi\fi
  7325. }
  7326. % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
  7327. % If its value is nonempty, SUFFIX is output afterward.
  7328. %
  7329. \def\refx#1#2{%
  7330. {%
  7331. \indexnofonts
  7332. \otherbackslash
  7333. \expandafter\global\expandafter\let\expandafter\thisrefX
  7334. \csname XR#1\endcsname
  7335. }%
  7336. \ifx\thisrefX\relax
  7337. % If not defined, say something at least.
  7338. \angleleft un\-de\-fined\angleright
  7339. \iflinks
  7340. \ifhavexrefs
  7341. {\toks0 = {#1}% avoid expansion of possibly-complex value
  7342. \message{\linenumber Undefined cross reference `\the\toks0'.}}%
  7343. \else
  7344. \ifwarnedxrefs\else
  7345. \global\warnedxrefstrue
  7346. \message{Cross reference values unknown; you must run TeX again.}%
  7347. \fi
  7348. \fi
  7349. \fi
  7350. \else
  7351. % It's defined, so just use it.
  7352. \thisrefX
  7353. \fi
  7354. #2% Output the suffix in any case.
  7355. }
  7356. % This is the macro invoked by entries in the aux file. Usually it's
  7357. % just a \def (we prepend XR to the control sequence name to avoid
  7358. % collisions). But if this is a float type, we have more work to do.
  7359. %
  7360. \def\xrdef#1#2{%
  7361. {% The node name might contain 8-bit characters, which in our current
  7362. % implementation are changed to commands like @'e. Don't let these
  7363. % mess up the control sequence name.
  7364. \indexnofonts
  7365. \turnoffactive
  7366. \xdef\safexrefname{#1}%
  7367. }%
  7368. %
  7369. \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref
  7370. %
  7371. % Was that xref control sequence that we just defined for a float?
  7372. \expandafter\iffloat\csname XR\safexrefname\endcsname
  7373. % it was a float, and we have the (safe) float type in \iffloattype.
  7374. \expandafter\let\expandafter\floatlist
  7375. \csname floatlist\iffloattype\endcsname
  7376. %
  7377. % Is this the first time we've seen this float type?
  7378. \expandafter\ifx\floatlist\relax
  7379. \toks0 = {\do}% yes, so just \do
  7380. \else
  7381. % had it before, so preserve previous elements in list.
  7382. \toks0 = \expandafter{\floatlist\do}%
  7383. \fi
  7384. %
  7385. % Remember this xref in the control sequence \floatlistFLOATTYPE,
  7386. % for later use in \listoffloats.
  7387. \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0
  7388. {\safexrefname}}%
  7389. \fi
  7390. }
  7391. % Read the last existing aux file, if any. No error if none exists.
  7392. %
  7393. \def\tryauxfile{%
  7394. \openin 1 \jobname.aux
  7395. \ifeof 1 \else
  7396. \readdatafile{aux}%
  7397. \global\havexrefstrue
  7398. \fi
  7399. \closein 1
  7400. }
  7401. \def\setupdatafile{%
  7402. \catcode`\^^@=\other
  7403. \catcode`\^^A=\other
  7404. \catcode`\^^B=\other
  7405. \catcode`\^^C=\other
  7406. \catcode`\^^D=\other
  7407. \catcode`\^^E=\other
  7408. \catcode`\^^F=\other
  7409. \catcode`\^^G=\other
  7410. \catcode`\^^H=\other
  7411. \catcode`\^^K=\other
  7412. \catcode`\^^L=\other
  7413. \catcode`\^^N=\other
  7414. \catcode`\^^P=\other
  7415. \catcode`\^^Q=\other
  7416. \catcode`\^^R=\other
  7417. \catcode`\^^S=\other
  7418. \catcode`\^^T=\other
  7419. \catcode`\^^U=\other
  7420. \catcode`\^^V=\other
  7421. \catcode`\^^W=\other
  7422. \catcode`\^^X=\other
  7423. \catcode`\^^Z=\other
  7424. \catcode`\^^[=\other
  7425. \catcode`\^^\=\other
  7426. \catcode`\^^]=\other
  7427. \catcode`\^^^=\other
  7428. \catcode`\^^_=\other
  7429. % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
  7430. % in xref tags, i.e., node names. But since ^^e4 notation isn't
  7431. % supported in the main text, it doesn't seem desirable. Furthermore,
  7432. % that is not enough: for node names that actually contain a ^
  7433. % character, we would end up writing a line like this: 'xrdef {'hat
  7434. % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
  7435. % argument, and \hat is not an expandable control sequence. It could
  7436. % all be worked out, but why? Either we support ^^ or we don't.
  7437. %
  7438. % The other change necessary for this was to define \auxhat:
  7439. % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
  7440. % and then to call \auxhat in \setq.
  7441. %
  7442. \catcode`\^=\other
  7443. %
  7444. % Special characters. Should be turned off anyway, but...
  7445. \catcode`\~=\other
  7446. \catcode`\[=\other
  7447. \catcode`\]=\other
  7448. \catcode`\"=\other
  7449. \catcode`\_=\other
  7450. \catcode`\|=\other
  7451. \catcode`\<=\other
  7452. \catcode`\>=\other
  7453. \catcode`\$=\other
  7454. \catcode`\#=\other
  7455. \catcode`\&=\other
  7456. \catcode`\%=\other
  7457. \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
  7458. %
  7459. % This is to support \ in node names and titles, since the \
  7460. % characters end up in a \csname. It's easier than
  7461. % leaving it active and making its active definition an actual \
  7462. % character. What I don't understand is why it works in the *value*
  7463. % of the xrdef. Seems like it should be a catcode12 \, and that
  7464. % should not typeset properly. But it works, so I'm moving on for
  7465. % now. --karl, 15jan04.
  7466. \catcode`\\=\other
  7467. %
  7468. % Make the characters 128-255 be printing characters.
  7469. {%
  7470. \count1=128
  7471. \def\loop{%
  7472. \catcode\count1=\other
  7473. \advance\count1 by 1
  7474. \ifnum \count1<256 \loop \fi
  7475. }%
  7476. }%
  7477. %
  7478. % @ is our escape character in .aux files, and we need braces.
  7479. \catcode`\{=1
  7480. \catcode`\}=2
  7481. \catcode`\@=0
  7482. }
  7483. \def\readdatafile#1{%
  7484. \begingroup
  7485. \setupdatafile
  7486. \input\jobname.#1
  7487. \endgroup}
  7488. \message{insertions,}
  7489. % including footnotes.
  7490. \newcount \footnoteno
  7491. % The trailing space in the following definition for supereject is
  7492. % vital for proper filling; pages come out unaligned when you do a
  7493. % pagealignmacro call if that space before the closing brace is
  7494. % removed. (Generally, numeric constants should always be followed by a
  7495. % space to prevent strange expansion errors.)
  7496. \def\supereject{\par\penalty -20000\footnoteno =0 }
  7497. % @footnotestyle is meaningful for info output only.
  7498. \let\footnotestyle=\comment
  7499. {\catcode `\@=11
  7500. %
  7501. % Auto-number footnotes. Otherwise like plain.
  7502. \gdef\footnote{%
  7503. \let\indent=\ptexindent
  7504. \let\noindent=\ptexnoindent
  7505. \global\advance\footnoteno by \@ne
  7506. \edef\thisfootno{$^{\the\footnoteno}$}%
  7507. %
  7508. % In case the footnote comes at the end of a sentence, preserve the
  7509. % extra spacing after we do the footnote number.
  7510. \let\@sf\empty
  7511. \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
  7512. %
  7513. % Remove inadvertent blank space before typesetting the footnote number.
  7514. \unskip
  7515. \thisfootno\@sf
  7516. \dofootnote
  7517. }%
  7518. % Don't bother with the trickery in plain.tex to not require the
  7519. % footnote text as a parameter. Our footnotes don't need to be so general.
  7520. %
  7521. % Oh yes, they do; otherwise, @ifset (and anything else that uses
  7522. % \parseargline) fails inside footnotes because the tokens are fixed when
  7523. % the footnote is read. --karl, 16nov96.
  7524. %
  7525. \gdef\dofootnote{%
  7526. \insert\footins\bgroup
  7527. % We want to typeset this text as a normal paragraph, even if the
  7528. % footnote reference occurs in (for example) a display environment.
  7529. % So reset some parameters.
  7530. \hsize=\pagewidth
  7531. \interlinepenalty\interfootnotelinepenalty
  7532. \splittopskip\ht\strutbox % top baseline for broken footnotes
  7533. \splitmaxdepth\dp\strutbox
  7534. \floatingpenalty\@MM
  7535. \leftskip\z@skip
  7536. \rightskip\z@skip
  7537. \spaceskip\z@skip
  7538. \xspaceskip\z@skip
  7539. \parindent\defaultparindent
  7540. %
  7541. \smallfonts \rm
  7542. %
  7543. % Because we use hanging indentation in footnotes, a @noindent appears
  7544. % to exdent this text, so make it be a no-op. makeinfo does not use
  7545. % hanging indentation so @noindent can still be needed within footnote
  7546. % text after an @example or the like (not that this is good style).
  7547. \let\noindent = \relax
  7548. %
  7549. % Hang the footnote text off the number. Use \everypar in case the
  7550. % footnote extends for more than one paragraph.
  7551. \everypar = {\hang}%
  7552. \textindent{\thisfootno}%
  7553. %
  7554. % Don't crash into the line above the footnote text. Since this
  7555. % expands into a box, it must come within the paragraph, lest it
  7556. % provide a place where TeX can split the footnote.
  7557. \footstrut
  7558. \futurelet\next\fo@t
  7559. }
  7560. }%end \catcode `\@=11
  7561. % In case a @footnote appears in a vbox, save the footnote text and create
  7562. % the real \insert just after the vbox finished. Otherwise, the insertion
  7563. % would be lost.
  7564. % Similarly, if a @footnote appears inside an alignment, save the footnote
  7565. % text to a box and make the \insert when a row of the table is finished.
  7566. % And the same can be done for other insert classes. --kasal, 16nov03.
  7567. % Replace the \insert primitive by a cheating macro.
  7568. % Deeper inside, just make sure that the saved insertions are not spilled
  7569. % out prematurely.
  7570. %
  7571. \def\startsavinginserts{%
  7572. \ifx \insert\ptexinsert
  7573. \let\insert\saveinsert
  7574. \else
  7575. \let\checkinserts\relax
  7576. \fi
  7577. }
  7578. % This \insert replacement works for both \insert\footins{foo} and
  7579. % \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}.
  7580. %
  7581. \def\saveinsert#1{%
  7582. \edef\next{\noexpand\savetobox \makeSAVEname#1}%
  7583. \afterassignment\next
  7584. % swallow the left brace
  7585. \let\temp =
  7586. }
  7587. \def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}}
  7588. \def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1}
  7589. \def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi}
  7590. \def\placesaveins#1{%
  7591. \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname
  7592. {\box#1}%
  7593. }
  7594. % eat @SAVE -- beware, all of them have catcode \other:
  7595. {
  7596. \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-)
  7597. \gdef\gobblesave @SAVE{}
  7598. }
  7599. % initialization:
  7600. \def\newsaveins #1{%
  7601. \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}%
  7602. \next
  7603. }
  7604. \def\newsaveinsX #1{%
  7605. \csname newbox\endcsname #1%
  7606. \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts
  7607. \checksaveins #1}%
  7608. }
  7609. % initialize:
  7610. \let\checkinserts\empty
  7611. \newsaveins\footins
  7612. \newsaveins\margin
  7613. % @image. We use the macros from epsf.tex to support this.
  7614. % If epsf.tex is not installed and @image is used, we complain.
  7615. %
  7616. % Check for and read epsf.tex up front. If we read it only at @image
  7617. % time, we might be inside a group, and then its definitions would get
  7618. % undone and the next image would fail.
  7619. \openin 1 = epsf.tex
  7620. \ifeof 1 \else
  7621. % Do not bother showing banner with epsf.tex v2.7k (available in
  7622. % doc/epsf.tex and on ctan).
  7623. \def\epsfannounce{\toks0 = }%
  7624. \input epsf.tex
  7625. \fi
  7626. \closein 1
  7627. %
  7628. % We will only complain once about lack of epsf.tex.
  7629. \newif\ifwarnednoepsf
  7630. \newhelp\noepsfhelp{epsf.tex must be installed for images to
  7631. work. It is also included in the Texinfo distribution, or you can get
  7632. it from ftp://tug.org/tex/epsf.tex.}
  7633. %
  7634. \def\image#1{%
  7635. \ifx\epsfbox\thisiundefined
  7636. \ifwarnednoepsf \else
  7637. \errhelp = \noepsfhelp
  7638. \errmessage{epsf.tex not found, images will be ignored}%
  7639. \global\warnednoepsftrue
  7640. \fi
  7641. \else
  7642. \imagexxx #1,,,,,\finish
  7643. \fi
  7644. }
  7645. %
  7646. % Arguments to @image:
  7647. % #1 is (mandatory) image filename; we tack on .eps extension.
  7648. % #2 is (optional) width, #3 is (optional) height.
  7649. % #4 is (ignored optional) html alt text.
  7650. % #5 is (ignored optional) extension.
  7651. % #6 is just the usual extra ignored arg for parsing stuff.
  7652. \newif\ifimagevmode
  7653. \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
  7654. \catcode`\^^M = 5 % in case we're inside an example
  7655. \normalturnoffactive % allow _ et al. in names
  7656. % If the image is by itself, center it.
  7657. \ifvmode
  7658. \imagevmodetrue
  7659. \nobreak\medskip
  7660. % Usually we'll have text after the image which will insert
  7661. % \parskip glue, so insert it here too to equalize the space
  7662. % above and below.
  7663. \nobreak\vskip\parskip
  7664. \nobreak
  7665. \fi
  7666. %
  7667. % Leave vertical mode so that indentation from an enclosing
  7668. % environment such as @quotation is respected. On the other hand, if
  7669. % it's at the top level, we don't want the normal paragraph indentation.
  7670. \noindent
  7671. %
  7672. % Output the image.
  7673. \ifpdf
  7674. \dopdfimage{#1}{#2}{#3}%
  7675. \else
  7676. % \epsfbox itself resets \epsf?size at each figure.
  7677. \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
  7678. \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
  7679. \epsfbox{#1.eps}%
  7680. \fi
  7681. %
  7682. \ifimagevmode \medskip \fi % space after the standalone image
  7683. \endgroup}
  7684. % @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables,
  7685. % etc. We don't actually implement floating yet, we always include the
  7686. % float "here". But it seemed the best name for the future.
  7687. %
  7688. \envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish}
  7689. % There may be a space before second and/or third parameter; delete it.
  7690. \def\eatcommaspace#1, {#1,}
  7691. % #1 is the optional FLOATTYPE, the text label for this float, typically
  7692. % "Figure", "Table", "Example", etc. Can't contain commas. If omitted,
  7693. % this float will not be numbered and cannot be referred to.
  7694. %
  7695. % #2 is the optional xref label. Also must be present for the float to
  7696. % be referable.
  7697. %
  7698. % #3 is the optional positioning argument; for now, it is ignored. It
  7699. % will somehow specify the positions allowed to float to (here, top, bottom).
  7700. %
  7701. % We keep a separate counter for each FLOATTYPE, which we reset at each
  7702. % chapter-level command.
  7703. \let\resetallfloatnos=\empty
  7704. %
  7705. \def\dofloat#1,#2,#3,#4\finish{%
  7706. \let\thiscaption=\empty
  7707. \let\thisshortcaption=\empty
  7708. %
  7709. % don't lose footnotes inside @float.
  7710. %
  7711. % BEWARE: when the floats start float, we have to issue warning whenever an
  7712. % insert appears inside a float which could possibly float. --kasal, 26may04
  7713. %
  7714. \startsavinginserts
  7715. %
  7716. % We can't be used inside a paragraph.
  7717. \par
  7718. %
  7719. \vtop\bgroup
  7720. \def\floattype{#1}%
  7721. \def\floatlabel{#2}%
  7722. \def\floatloc{#3}% we do nothing with this yet.
  7723. %
  7724. \ifx\floattype\empty
  7725. \let\safefloattype=\empty
  7726. \else
  7727. {%
  7728. % the floattype might have accents or other special characters,
  7729. % but we need to use it in a control sequence name.
  7730. \indexnofonts
  7731. \turnoffactive
  7732. \xdef\safefloattype{\floattype}%
  7733. }%
  7734. \fi
  7735. %
  7736. % If label is given but no type, we handle that as the empty type.
  7737. \ifx\floatlabel\empty \else
  7738. % We want each FLOATTYPE to be numbered separately (Figure 1,
  7739. % Table 1, Figure 2, ...). (And if no label, no number.)
  7740. %
  7741. \expandafter\getfloatno\csname\safefloattype floatno\endcsname
  7742. \global\advance\floatno by 1
  7743. %
  7744. {%
  7745. % This magic value for \lastsection is output by \setref as the
  7746. % XREFLABEL-title value. \xrefX uses it to distinguish float
  7747. % labels (which have a completely different output format) from
  7748. % node and anchor labels. And \xrdef uses it to construct the
  7749. % lists of floats.
  7750. %
  7751. \edef\lastsection{\floatmagic=\safefloattype}%
  7752. \setref{\floatlabel}{Yfloat}%
  7753. }%
  7754. \fi
  7755. %
  7756. % start with \parskip glue, I guess.
  7757. \vskip\parskip
  7758. %
  7759. % Don't suppress indentation if a float happens to start a section.
  7760. \restorefirstparagraphindent
  7761. }
  7762. % we have these possibilities:
  7763. % @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap
  7764. % @float Foo,lbl & no caption: Foo 1.1
  7765. % @float Foo & @caption{Cap}: Foo: Cap
  7766. % @float Foo & no caption: Foo
  7767. % @float ,lbl & Caption{Cap}: 1.1: Cap
  7768. % @float ,lbl & no caption: 1.1
  7769. % @float & @caption{Cap}: Cap
  7770. % @float & no caption:
  7771. %
  7772. \def\Efloat{%
  7773. \let\floatident = \empty
  7774. %
  7775. % In all cases, if we have a float type, it comes first.
  7776. \ifx\floattype\empty \else \def\floatident{\floattype}\fi
  7777. %
  7778. % If we have an xref label, the number comes next.
  7779. \ifx\floatlabel\empty \else
  7780. \ifx\floattype\empty \else % if also had float type, need tie first.
  7781. \appendtomacro\floatident{\tie}%
  7782. \fi
  7783. % the number.
  7784. \appendtomacro\floatident{\chaplevelprefix\the\floatno}%
  7785. \fi
  7786. %
  7787. % Start the printed caption with what we've constructed in
  7788. % \floatident, but keep it separate; we need \floatident again.
  7789. \let\captionline = \floatident
  7790. %
  7791. \ifx\thiscaption\empty \else
  7792. \ifx\floatident\empty \else
  7793. \appendtomacro\captionline{: }% had ident, so need a colon between
  7794. \fi
  7795. %
  7796. % caption text.
  7797. \appendtomacro\captionline{\scanexp\thiscaption}%
  7798. \fi
  7799. %
  7800. % If we have anything to print, print it, with space before.
  7801. % Eventually this needs to become an \insert.
  7802. \ifx\captionline\empty \else
  7803. \vskip.5\parskip
  7804. \captionline
  7805. %
  7806. % Space below caption.
  7807. \vskip\parskip
  7808. \fi
  7809. %
  7810. % If have an xref label, write the list of floats info. Do this
  7811. % after the caption, to avoid chance of it being a breakpoint.
  7812. \ifx\floatlabel\empty \else
  7813. % Write the text that goes in the lof to the aux file as
  7814. % \floatlabel-lof. Besides \floatident, we include the short
  7815. % caption if specified, else the full caption if specified, else nothing.
  7816. {%
  7817. \atdummies
  7818. %
  7819. % since we read the caption text in the macro world, where ^^M
  7820. % is turned into a normal character, we have to scan it back, so
  7821. % we don't write the literal three characters "^^M" into the aux file.
  7822. \scanexp{%
  7823. \xdef\noexpand\gtemp{%
  7824. \ifx\thisshortcaption\empty
  7825. \thiscaption
  7826. \else
  7827. \thisshortcaption
  7828. \fi
  7829. }%
  7830. }%
  7831. \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident
  7832. \ifx\gtemp\empty \else : \gtemp \fi}}%
  7833. }%
  7834. \fi
  7835. \egroup % end of \vtop
  7836. %
  7837. % place the captured inserts
  7838. %
  7839. % BEWARE: when the floats start floating, we have to issue warning
  7840. % whenever an insert appears inside a float which could possibly
  7841. % float. --kasal, 26may04
  7842. %
  7843. \checkinserts
  7844. }
  7845. % Append the tokens #2 to the definition of macro #1, not expanding either.
  7846. %
  7847. \def\appendtomacro#1#2{%
  7848. \expandafter\def\expandafter#1\expandafter{#1#2}%
  7849. }
  7850. % @caption, @shortcaption
  7851. %
  7852. \def\caption{\docaption\thiscaption}
  7853. \def\shortcaption{\docaption\thisshortcaption}
  7854. \def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption}
  7855. \def\defcaption#1#2{\egroup \def#1{#2}}
  7856. % The parameter is the control sequence identifying the counter we are
  7857. % going to use. Create it if it doesn't exist and assign it to \floatno.
  7858. \def\getfloatno#1{%
  7859. \ifx#1\relax
  7860. % Haven't seen this figure type before.
  7861. \csname newcount\endcsname #1%
  7862. %
  7863. % Remember to reset this floatno at the next chap.
  7864. \expandafter\gdef\expandafter\resetallfloatnos
  7865. \expandafter{\resetallfloatnos #1=0 }%
  7866. \fi
  7867. \let\floatno#1%
  7868. }
  7869. % \setref calls this to get the XREFLABEL-snt value. We want an @xref
  7870. % to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we
  7871. % first read the @float command.
  7872. %
  7873. \def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}%
  7874. % Magic string used for the XREFLABEL-title value, so \xrefX can
  7875. % distinguish floats from other xref types.
  7876. \def\floatmagic{!!float!!}
  7877. % #1 is the control sequence we are passed; we expand into a conditional
  7878. % which is true if #1 represents a float ref. That is, the magic
  7879. % \lastsection value which we \setref above.
  7880. %
  7881. \def\iffloat#1{\expandafter\doiffloat#1==\finish}
  7882. %
  7883. % #1 is (maybe) the \floatmagic string. If so, #2 will be the
  7884. % (safe) float type for this float. We set \iffloattype to #2.
  7885. %
  7886. \def\doiffloat#1=#2=#3\finish{%
  7887. \def\temp{#1}%
  7888. \def\iffloattype{#2}%
  7889. \ifx\temp\floatmagic
  7890. }
  7891. % @listoffloats FLOATTYPE - print a list of floats like a table of contents.
  7892. %
  7893. \parseargdef\listoffloats{%
  7894. \def\floattype{#1}% floattype
  7895. {%
  7896. % the floattype might have accents or other special characters,
  7897. % but we need to use it in a control sequence name.
  7898. \indexnofonts
  7899. \turnoffactive
  7900. \xdef\safefloattype{\floattype}%
  7901. }%
  7902. %
  7903. % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE.
  7904. \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax
  7905. \ifhavexrefs
  7906. % if the user said @listoffloats foo but never @float foo.
  7907. \message{\linenumber No `\safefloattype' floats to list.}%
  7908. \fi
  7909. \else
  7910. \begingroup
  7911. \leftskip=\tocindent % indent these entries like a toc
  7912. \let\do=\listoffloatsdo
  7913. \csname floatlist\safefloattype\endcsname
  7914. \endgroup
  7915. \fi
  7916. }
  7917. % This is called on each entry in a list of floats. We're passed the
  7918. % xref label, in the form LABEL-title, which is how we save it in the
  7919. % aux file. We strip off the -title and look up \XRLABEL-lof, which
  7920. % has the text we're supposed to typeset here.
  7921. %
  7922. % Figures without xref labels will not be included in the list (since
  7923. % they won't appear in the aux file).
  7924. %
  7925. \def\listoffloatsdo#1{\listoffloatsdoentry#1\finish}
  7926. \def\listoffloatsdoentry#1-title\finish{{%
  7927. % Can't fully expand XR#1-lof because it can contain anything. Just
  7928. % pass the control sequence. On the other hand, XR#1-pg is just the
  7929. % page number, and we want to fully expand that so we can get a link
  7930. % in pdf output.
  7931. \toksA = \expandafter{\csname XR#1-lof\endcsname}%
  7932. %
  7933. % use the same \entry macro we use to generate the TOC and index.
  7934. \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}%
  7935. \writeentry
  7936. }}
  7937. \message{localization,}
  7938. % For single-language documents, @documentlanguage is usually given very
  7939. % early, just after @documentencoding. Single argument is the language
  7940. % (de) or locale (de_DE) abbreviation.
  7941. %
  7942. {
  7943. \catcode`\_ = \active
  7944. \globaldefs=1
  7945. \parseargdef\documentlanguage{\begingroup
  7946. \let_=\normalunderscore % normal _ character for filenames
  7947. \tex % read txi-??.tex file in plain TeX.
  7948. % Read the file by the name they passed if it exists.
  7949. \openin 1 txi-#1.tex
  7950. \ifeof 1
  7951. \documentlanguagetrywithoutunderscore{#1_\finish}%
  7952. \else
  7953. \globaldefs = 1 % everything in the txi-LL files needs to persist
  7954. \input txi-#1.tex
  7955. \fi
  7956. \closein 1
  7957. \endgroup % end raw TeX
  7958. \endgroup}
  7959. %
  7960. % If they passed de_DE, and txi-de_DE.tex doesn't exist,
  7961. % try txi-de.tex.
  7962. %
  7963. \gdef\documentlanguagetrywithoutunderscore#1_#2\finish{%
  7964. \openin 1 txi-#1.tex
  7965. \ifeof 1
  7966. \errhelp = \nolanghelp
  7967. \errmessage{Cannot read language file txi-#1.tex}%
  7968. \else
  7969. \globaldefs = 1 % everything in the txi-LL files needs to persist
  7970. \input txi-#1.tex
  7971. \fi
  7972. \closein 1
  7973. }
  7974. }% end of special _ catcode
  7975. %
  7976. \newhelp\nolanghelp{The given language definition file cannot be found or
  7977. is empty. Maybe you need to install it? Putting it in the current
  7978. directory should work if nowhere else does.}
  7979. % This macro is called from txi-??.tex files; the first argument is the
  7980. % \language name to set (without the "\lang@" prefix), the second and
  7981. % third args are \{left,right}hyphenmin.
  7982. %
  7983. % The language names to pass are determined when the format is built.
  7984. % See the etex.log file created at that time, e.g.,
  7985. % /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log.
  7986. %
  7987. % With TeX Live 2008, etex now includes hyphenation patterns for all
  7988. % available languages. This means we can support hyphenation in
  7989. % Texinfo, at least to some extent. (This still doesn't solve the
  7990. % accented characters problem.)
  7991. %
  7992. \catcode`@=11
  7993. \def\txisetlanguage#1#2#3{%
  7994. % do not set the language if the name is undefined in the current TeX.
  7995. \expandafter\ifx\csname lang@#1\endcsname \relax
  7996. \message{no patterns for #1}%
  7997. \else
  7998. \global\language = \csname lang@#1\endcsname
  7999. \fi
  8000. % but there is no harm in adjusting the hyphenmin values regardless.
  8001. \global\lefthyphenmin = #2\relax
  8002. \global\righthyphenmin = #3\relax
  8003. }
  8004. % Helpers for encodings.
  8005. % Set the catcode of characters 128 through 255 to the specified number.
  8006. %
  8007. \def\setnonasciicharscatcode#1{%
  8008. \count255=128
  8009. \loop\ifnum\count255<256
  8010. \global\catcode\count255=#1\relax
  8011. \advance\count255 by 1
  8012. \repeat
  8013. }
  8014. \def\setnonasciicharscatcodenonglobal#1{%
  8015. \count255=128
  8016. \loop\ifnum\count255<256
  8017. \catcode\count255=#1\relax
  8018. \advance\count255 by 1
  8019. \repeat
  8020. }
  8021. % @documentencoding sets the definition of non-ASCII characters
  8022. % according to the specified encoding.
  8023. %
  8024. \parseargdef\documentencoding{%
  8025. % Encoding being declared for the document.
  8026. \def\declaredencoding{\csname #1.enc\endcsname}%
  8027. %
  8028. % Supported encodings: names converted to tokens in order to be able
  8029. % to compare them with \ifx.
  8030. \def\ascii{\csname US-ASCII.enc\endcsname}%
  8031. \def\latnine{\csname ISO-8859-15.enc\endcsname}%
  8032. \def\latone{\csname ISO-8859-1.enc\endcsname}%
  8033. \def\lattwo{\csname ISO-8859-2.enc\endcsname}%
  8034. \def\utfeight{\csname UTF-8.enc\endcsname}%
  8035. %
  8036. \ifx \declaredencoding \ascii
  8037. \asciichardefs
  8038. %
  8039. \else \ifx \declaredencoding \lattwo
  8040. \setnonasciicharscatcode\active
  8041. \lattwochardefs
  8042. %
  8043. \else \ifx \declaredencoding \latone
  8044. \setnonasciicharscatcode\active
  8045. \latonechardefs
  8046. %
  8047. \else \ifx \declaredencoding \latnine
  8048. \setnonasciicharscatcode\active
  8049. \latninechardefs
  8050. %
  8051. \else \ifx \declaredencoding \utfeight
  8052. \setnonasciicharscatcode\active
  8053. \utfeightchardefs
  8054. %
  8055. \else
  8056. \message{Unknown document encoding #1, ignoring.}%
  8057. %
  8058. \fi % utfeight
  8059. \fi % latnine
  8060. \fi % latone
  8061. \fi % lattwo
  8062. \fi % ascii
  8063. }
  8064. % A message to be logged when using a character that isn't available
  8065. % the default font encoding (OT1).
  8066. %
  8067. \def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}}
  8068. % Take account of \c (plain) vs. \, (Texinfo) difference.
  8069. \def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
  8070. % First, make active non-ASCII characters in order for them to be
  8071. % correctly categorized when TeX reads the replacement text of
  8072. % macros containing the character definitions.
  8073. \setnonasciicharscatcode\active
  8074. %
  8075. % Latin1 (ISO-8859-1) character definitions.
  8076. \def\latonechardefs{%
  8077. \gdef^^a0{\tie}
  8078. \gdef^^a1{\exclamdown}
  8079. \gdef^^a2{\missingcharmsg{CENT SIGN}}
  8080. \gdef^^a3{{\pounds}}
  8081. \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
  8082. \gdef^^a5{\missingcharmsg{YEN SIGN}}
  8083. \gdef^^a6{\missingcharmsg{BROKEN BAR}}
  8084. \gdef^^a7{\S}
  8085. \gdef^^a8{\"{}}
  8086. \gdef^^a9{\copyright}
  8087. \gdef^^aa{\ordf}
  8088. \gdef^^ab{\guillemetleft}
  8089. \gdef^^ac{$\lnot$}
  8090. \gdef^^ad{\-}
  8091. \gdef^^ae{\registeredsymbol}
  8092. \gdef^^af{\={}}
  8093. %
  8094. \gdef^^b0{\textdegree}
  8095. \gdef^^b1{$\pm$}
  8096. \gdef^^b2{$^2$}
  8097. \gdef^^b3{$^3$}
  8098. \gdef^^b4{\'{}}
  8099. \gdef^^b5{$\mu$}
  8100. \gdef^^b6{\P}
  8101. %
  8102. \gdef^^b7{$^.$}
  8103. \gdef^^b8{\cedilla\ }
  8104. \gdef^^b9{$^1$}
  8105. \gdef^^ba{\ordm}
  8106. %
  8107. \gdef^^bb{\guillemetright}
  8108. \gdef^^bc{$1\over4$}
  8109. \gdef^^bd{$1\over2$}
  8110. \gdef^^be{$3\over4$}
  8111. \gdef^^bf{\questiondown}
  8112. %
  8113. \gdef^^c0{\`A}
  8114. \gdef^^c1{\'A}
  8115. \gdef^^c2{\^A}
  8116. \gdef^^c3{\~A}
  8117. \gdef^^c4{\"A}
  8118. \gdef^^c5{\ringaccent A}
  8119. \gdef^^c6{\AE}
  8120. \gdef^^c7{\cedilla C}
  8121. \gdef^^c8{\`E}
  8122. \gdef^^c9{\'E}
  8123. \gdef^^ca{\^E}
  8124. \gdef^^cb{\"E}
  8125. \gdef^^cc{\`I}
  8126. \gdef^^cd{\'I}
  8127. \gdef^^ce{\^I}
  8128. \gdef^^cf{\"I}
  8129. %
  8130. \gdef^^d0{\DH}
  8131. \gdef^^d1{\~N}
  8132. \gdef^^d2{\`O}
  8133. \gdef^^d3{\'O}
  8134. \gdef^^d4{\^O}
  8135. \gdef^^d5{\~O}
  8136. \gdef^^d6{\"O}
  8137. \gdef^^d7{$\times$}
  8138. \gdef^^d8{\O}
  8139. \gdef^^d9{\`U}
  8140. \gdef^^da{\'U}
  8141. \gdef^^db{\^U}
  8142. \gdef^^dc{\"U}
  8143. \gdef^^dd{\'Y}
  8144. \gdef^^de{\TH}
  8145. \gdef^^df{\ss}
  8146. %
  8147. \gdef^^e0{\`a}
  8148. \gdef^^e1{\'a}
  8149. \gdef^^e2{\^a}
  8150. \gdef^^e3{\~a}
  8151. \gdef^^e4{\"a}
  8152. \gdef^^e5{\ringaccent a}
  8153. \gdef^^e6{\ae}
  8154. \gdef^^e7{\cedilla c}
  8155. \gdef^^e8{\`e}
  8156. \gdef^^e9{\'e}
  8157. \gdef^^ea{\^e}
  8158. \gdef^^eb{\"e}
  8159. \gdef^^ec{\`{\dotless i}}
  8160. \gdef^^ed{\'{\dotless i}}
  8161. \gdef^^ee{\^{\dotless i}}
  8162. \gdef^^ef{\"{\dotless i}}
  8163. %
  8164. \gdef^^f0{\dh}
  8165. \gdef^^f1{\~n}
  8166. \gdef^^f2{\`o}
  8167. \gdef^^f3{\'o}
  8168. \gdef^^f4{\^o}
  8169. \gdef^^f5{\~o}
  8170. \gdef^^f6{\"o}
  8171. \gdef^^f7{$\div$}
  8172. \gdef^^f8{\o}
  8173. \gdef^^f9{\`u}
  8174. \gdef^^fa{\'u}
  8175. \gdef^^fb{\^u}
  8176. \gdef^^fc{\"u}
  8177. \gdef^^fd{\'y}
  8178. \gdef^^fe{\th}
  8179. \gdef^^ff{\"y}
  8180. }
  8181. % Latin9 (ISO-8859-15) encoding character definitions.
  8182. \def\latninechardefs{%
  8183. % Encoding is almost identical to Latin1.
  8184. \latonechardefs
  8185. %
  8186. \gdef^^a4{\euro}
  8187. \gdef^^a6{\v S}
  8188. \gdef^^a8{\v s}
  8189. \gdef^^b4{\v Z}
  8190. \gdef^^b8{\v z}
  8191. \gdef^^bc{\OE}
  8192. \gdef^^bd{\oe}
  8193. \gdef^^be{\"Y}
  8194. }
  8195. % Latin2 (ISO-8859-2) character definitions.
  8196. \def\lattwochardefs{%
  8197. \gdef^^a0{\tie}
  8198. \gdef^^a1{\ogonek{A}}
  8199. \gdef^^a2{\u{}}
  8200. \gdef^^a3{\L}
  8201. \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
  8202. \gdef^^a5{\v L}
  8203. \gdef^^a6{\'S}
  8204. \gdef^^a7{\S}
  8205. \gdef^^a8{\"{}}
  8206. \gdef^^a9{\v S}
  8207. \gdef^^aa{\cedilla S}
  8208. \gdef^^ab{\v T}
  8209. \gdef^^ac{\'Z}
  8210. \gdef^^ad{\-}
  8211. \gdef^^ae{\v Z}
  8212. \gdef^^af{\dotaccent Z}
  8213. %
  8214. \gdef^^b0{\textdegree}
  8215. \gdef^^b1{\ogonek{a}}
  8216. \gdef^^b2{\ogonek{ }}
  8217. \gdef^^b3{\l}
  8218. \gdef^^b4{\'{}}
  8219. \gdef^^b5{\v l}
  8220. \gdef^^b6{\'s}
  8221. \gdef^^b7{\v{}}
  8222. \gdef^^b8{\cedilla\ }
  8223. \gdef^^b9{\v s}
  8224. \gdef^^ba{\cedilla s}
  8225. \gdef^^bb{\v t}
  8226. \gdef^^bc{\'z}
  8227. \gdef^^bd{\H{}}
  8228. \gdef^^be{\v z}
  8229. \gdef^^bf{\dotaccent z}
  8230. %
  8231. \gdef^^c0{\'R}
  8232. \gdef^^c1{\'A}
  8233. \gdef^^c2{\^A}
  8234. \gdef^^c3{\u A}
  8235. \gdef^^c4{\"A}
  8236. \gdef^^c5{\'L}
  8237. \gdef^^c6{\'C}
  8238. \gdef^^c7{\cedilla C}
  8239. \gdef^^c8{\v C}
  8240. \gdef^^c9{\'E}
  8241. \gdef^^ca{\ogonek{E}}
  8242. \gdef^^cb{\"E}
  8243. \gdef^^cc{\v E}
  8244. \gdef^^cd{\'I}
  8245. \gdef^^ce{\^I}
  8246. \gdef^^cf{\v D}
  8247. %
  8248. \gdef^^d0{\DH}
  8249. \gdef^^d1{\'N}
  8250. \gdef^^d2{\v N}
  8251. \gdef^^d3{\'O}
  8252. \gdef^^d4{\^O}
  8253. \gdef^^d5{\H O}
  8254. \gdef^^d6{\"O}
  8255. \gdef^^d7{$\times$}
  8256. \gdef^^d8{\v R}
  8257. \gdef^^d9{\ringaccent U}
  8258. \gdef^^da{\'U}
  8259. \gdef^^db{\H U}
  8260. \gdef^^dc{\"U}
  8261. \gdef^^dd{\'Y}
  8262. \gdef^^de{\cedilla T}
  8263. \gdef^^df{\ss}
  8264. %
  8265. \gdef^^e0{\'r}
  8266. \gdef^^e1{\'a}
  8267. \gdef^^e2{\^a}
  8268. \gdef^^e3{\u a}
  8269. \gdef^^e4{\"a}
  8270. \gdef^^e5{\'l}
  8271. \gdef^^e6{\'c}
  8272. \gdef^^e7{\cedilla c}
  8273. \gdef^^e8{\v c}
  8274. \gdef^^e9{\'e}
  8275. \gdef^^ea{\ogonek{e}}
  8276. \gdef^^eb{\"e}
  8277. \gdef^^ec{\v e}
  8278. \gdef^^ed{\'{\dotless{i}}}
  8279. \gdef^^ee{\^{\dotless{i}}}
  8280. \gdef^^ef{\v d}
  8281. %
  8282. \gdef^^f0{\dh}
  8283. \gdef^^f1{\'n}
  8284. \gdef^^f2{\v n}
  8285. \gdef^^f3{\'o}
  8286. \gdef^^f4{\^o}
  8287. \gdef^^f5{\H o}
  8288. \gdef^^f6{\"o}
  8289. \gdef^^f7{$\div$}
  8290. \gdef^^f8{\v r}
  8291. \gdef^^f9{\ringaccent u}
  8292. \gdef^^fa{\'u}
  8293. \gdef^^fb{\H u}
  8294. \gdef^^fc{\"u}
  8295. \gdef^^fd{\'y}
  8296. \gdef^^fe{\cedilla t}
  8297. \gdef^^ff{\dotaccent{}}
  8298. }
  8299. % UTF-8 character definitions.
  8300. %
  8301. % This code to support UTF-8 is based on LaTeX's utf8.def, with some
  8302. % changes for Texinfo conventions. It is included here under the GPL by
  8303. % permission from Frank Mittelbach and the LaTeX team.
  8304. %
  8305. \newcount\countUTFx
  8306. \newcount\countUTFy
  8307. \newcount\countUTFz
  8308. \gdef\UTFviiiTwoOctets#1#2{\expandafter
  8309. \UTFviiiDefined\csname u8:#1\string #2\endcsname}
  8310. %
  8311. \gdef\UTFviiiThreeOctets#1#2#3{\expandafter
  8312. \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname}
  8313. %
  8314. \gdef\UTFviiiFourOctets#1#2#3#4{\expandafter
  8315. \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname}
  8316. \gdef\UTFviiiDefined#1{%
  8317. \ifx #1\relax
  8318. \message{\linenumber Unicode char \string #1 not defined for Texinfo}%
  8319. \else
  8320. \expandafter #1%
  8321. \fi
  8322. }
  8323. \begingroup
  8324. \catcode`\~13
  8325. \catcode`\"12
  8326. \def\UTFviiiLoop{%
  8327. \global\catcode\countUTFx\active
  8328. \uccode`\~\countUTFx
  8329. \uppercase\expandafter{\UTFviiiTmp}%
  8330. \advance\countUTFx by 1
  8331. \ifnum\countUTFx < \countUTFy
  8332. \expandafter\UTFviiiLoop
  8333. \fi}
  8334. \countUTFx = "C2
  8335. \countUTFy = "E0
  8336. \def\UTFviiiTmp{%
  8337. \xdef~{\noexpand\UTFviiiTwoOctets\string~}}
  8338. \UTFviiiLoop
  8339. \countUTFx = "E0
  8340. \countUTFy = "F0
  8341. \def\UTFviiiTmp{%
  8342. \xdef~{\noexpand\UTFviiiThreeOctets\string~}}
  8343. \UTFviiiLoop
  8344. \countUTFx = "F0
  8345. \countUTFy = "F4
  8346. \def\UTFviiiTmp{%
  8347. \xdef~{\noexpand\UTFviiiFourOctets\string~}}
  8348. \UTFviiiLoop
  8349. \endgroup
  8350. \begingroup
  8351. \catcode`\"=12
  8352. \catcode`\<=12
  8353. \catcode`\.=12
  8354. \catcode`\,=12
  8355. \catcode`\;=12
  8356. \catcode`\!=12
  8357. \catcode`\~=13
  8358. \gdef\DeclareUnicodeCharacter#1#2{%
  8359. \countUTFz = "#1\relax
  8360. %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%
  8361. \begingroup
  8362. \parseXMLCharref
  8363. \def\UTFviiiTwoOctets##1##2{%
  8364. \csname u8:##1\string ##2\endcsname}%
  8365. \def\UTFviiiThreeOctets##1##2##3{%
  8366. \csname u8:##1\string ##2\string ##3\endcsname}%
  8367. \def\UTFviiiFourOctets##1##2##3##4{%
  8368. \csname u8:##1\string ##2\string ##3\string ##4\endcsname}%
  8369. \expandafter\expandafter\expandafter\expandafter
  8370. \expandafter\expandafter\expandafter
  8371. \gdef\UTFviiiTmp{#2}%
  8372. \endgroup}
  8373. \gdef\parseXMLCharref{%
  8374. \ifnum\countUTFz < "A0\relax
  8375. \errhelp = \EMsimple
  8376. \errmessage{Cannot define Unicode char value < 00A0}%
  8377. \else\ifnum\countUTFz < "800\relax
  8378. \parseUTFviiiA,%
  8379. \parseUTFviiiB C\UTFviiiTwoOctets.,%
  8380. \else\ifnum\countUTFz < "10000\relax
  8381. \parseUTFviiiA;%
  8382. \parseUTFviiiA,%
  8383. \parseUTFviiiB E\UTFviiiThreeOctets.{,;}%
  8384. \else
  8385. \parseUTFviiiA;%
  8386. \parseUTFviiiA,%
  8387. \parseUTFviiiA!%
  8388. \parseUTFviiiB F\UTFviiiFourOctets.{!,;}%
  8389. \fi\fi\fi
  8390. }
  8391. \gdef\parseUTFviiiA#1{%
  8392. \countUTFx = \countUTFz
  8393. \divide\countUTFz by 64
  8394. \countUTFy = \countUTFz
  8395. \multiply\countUTFz by 64
  8396. \advance\countUTFx by -\countUTFz
  8397. \advance\countUTFx by 128
  8398. \uccode `#1\countUTFx
  8399. \countUTFz = \countUTFy}
  8400. \gdef\parseUTFviiiB#1#2#3#4{%
  8401. \advance\countUTFz by "#10\relax
  8402. \uccode `#3\countUTFz
  8403. \uppercase{\gdef\UTFviiiTmp{#2#3#4}}}
  8404. \endgroup
  8405. \def\utfeightchardefs{%
  8406. \DeclareUnicodeCharacter{00A0}{\tie}
  8407. \DeclareUnicodeCharacter{00A1}{\exclamdown}
  8408. \DeclareUnicodeCharacter{00A3}{\pounds}
  8409. \DeclareUnicodeCharacter{00A8}{\"{ }}
  8410. \DeclareUnicodeCharacter{00A9}{\copyright}
  8411. \DeclareUnicodeCharacter{00AA}{\ordf}
  8412. \DeclareUnicodeCharacter{00AB}{\guillemetleft}
  8413. \DeclareUnicodeCharacter{00AD}{\-}
  8414. \DeclareUnicodeCharacter{00AE}{\registeredsymbol}
  8415. \DeclareUnicodeCharacter{00AF}{\={ }}
  8416. \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}
  8417. \DeclareUnicodeCharacter{00B4}{\'{ }}
  8418. \DeclareUnicodeCharacter{00B8}{\cedilla{ }}
  8419. \DeclareUnicodeCharacter{00BA}{\ordm}
  8420. \DeclareUnicodeCharacter{00BB}{\guillemetright}
  8421. \DeclareUnicodeCharacter{00BF}{\questiondown}
  8422. \DeclareUnicodeCharacter{00C0}{\`A}
  8423. \DeclareUnicodeCharacter{00C1}{\'A}
  8424. \DeclareUnicodeCharacter{00C2}{\^A}
  8425. \DeclareUnicodeCharacter{00C3}{\~A}
  8426. \DeclareUnicodeCharacter{00C4}{\"A}
  8427. \DeclareUnicodeCharacter{00C5}{\AA}
  8428. \DeclareUnicodeCharacter{00C6}{\AE}
  8429. \DeclareUnicodeCharacter{00C7}{\cedilla{C}}
  8430. \DeclareUnicodeCharacter{00C8}{\`E}
  8431. \DeclareUnicodeCharacter{00C9}{\'E}
  8432. \DeclareUnicodeCharacter{00CA}{\^E}
  8433. \DeclareUnicodeCharacter{00CB}{\"E}
  8434. \DeclareUnicodeCharacter{00CC}{\`I}
  8435. \DeclareUnicodeCharacter{00CD}{\'I}
  8436. \DeclareUnicodeCharacter{00CE}{\^I}
  8437. \DeclareUnicodeCharacter{00CF}{\"I}
  8438. \DeclareUnicodeCharacter{00D0}{\DH}
  8439. \DeclareUnicodeCharacter{00D1}{\~N}
  8440. \DeclareUnicodeCharacter{00D2}{\`O}
  8441. \DeclareUnicodeCharacter{00D3}{\'O}
  8442. \DeclareUnicodeCharacter{00D4}{\^O}
  8443. \DeclareUnicodeCharacter{00D5}{\~O}
  8444. \DeclareUnicodeCharacter{00D6}{\"O}
  8445. \DeclareUnicodeCharacter{00D8}{\O}
  8446. \DeclareUnicodeCharacter{00D9}{\`U}
  8447. \DeclareUnicodeCharacter{00DA}{\'U}
  8448. \DeclareUnicodeCharacter{00DB}{\^U}
  8449. \DeclareUnicodeCharacter{00DC}{\"U}
  8450. \DeclareUnicodeCharacter{00DD}{\'Y}
  8451. \DeclareUnicodeCharacter{00DE}{\TH}
  8452. \DeclareUnicodeCharacter{00DF}{\ss}
  8453. \DeclareUnicodeCharacter{00E0}{\`a}
  8454. \DeclareUnicodeCharacter{00E1}{\'a}
  8455. \DeclareUnicodeCharacter{00E2}{\^a}
  8456. \DeclareUnicodeCharacter{00E3}{\~a}
  8457. \DeclareUnicodeCharacter{00E4}{\"a}
  8458. \DeclareUnicodeCharacter{00E5}{\aa}
  8459. \DeclareUnicodeCharacter{00E6}{\ae}
  8460. \DeclareUnicodeCharacter{00E7}{\cedilla{c}}
  8461. \DeclareUnicodeCharacter{00E8}{\`e}
  8462. \DeclareUnicodeCharacter{00E9}{\'e}
  8463. \DeclareUnicodeCharacter{00EA}{\^e}
  8464. \DeclareUnicodeCharacter{00EB}{\"e}
  8465. \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}
  8466. \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}
  8467. \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}
  8468. \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}
  8469. \DeclareUnicodeCharacter{00F0}{\dh}
  8470. \DeclareUnicodeCharacter{00F1}{\~n}
  8471. \DeclareUnicodeCharacter{00F2}{\`o}
  8472. \DeclareUnicodeCharacter{00F3}{\'o}
  8473. \DeclareUnicodeCharacter{00F4}{\^o}
  8474. \DeclareUnicodeCharacter{00F5}{\~o}
  8475. \DeclareUnicodeCharacter{00F6}{\"o}
  8476. \DeclareUnicodeCharacter{00F8}{\o}
  8477. \DeclareUnicodeCharacter{00F9}{\`u}
  8478. \DeclareUnicodeCharacter{00FA}{\'u}
  8479. \DeclareUnicodeCharacter{00FB}{\^u}
  8480. \DeclareUnicodeCharacter{00FC}{\"u}
  8481. \DeclareUnicodeCharacter{00FD}{\'y}
  8482. \DeclareUnicodeCharacter{00FE}{\th}
  8483. \DeclareUnicodeCharacter{00FF}{\"y}
  8484. \DeclareUnicodeCharacter{0100}{\=A}
  8485. \DeclareUnicodeCharacter{0101}{\=a}
  8486. \DeclareUnicodeCharacter{0102}{\u{A}}
  8487. \DeclareUnicodeCharacter{0103}{\u{a}}
  8488. \DeclareUnicodeCharacter{0104}{\ogonek{A}}
  8489. \DeclareUnicodeCharacter{0105}{\ogonek{a}}
  8490. \DeclareUnicodeCharacter{0106}{\'C}
  8491. \DeclareUnicodeCharacter{0107}{\'c}
  8492. \DeclareUnicodeCharacter{0108}{\^C}
  8493. \DeclareUnicodeCharacter{0109}{\^c}
  8494. \DeclareUnicodeCharacter{0118}{\ogonek{E}}
  8495. \DeclareUnicodeCharacter{0119}{\ogonek{e}}
  8496. \DeclareUnicodeCharacter{010A}{\dotaccent{C}}
  8497. \DeclareUnicodeCharacter{010B}{\dotaccent{c}}
  8498. \DeclareUnicodeCharacter{010C}{\v{C}}
  8499. \DeclareUnicodeCharacter{010D}{\v{c}}
  8500. \DeclareUnicodeCharacter{010E}{\v{D}}
  8501. \DeclareUnicodeCharacter{0112}{\=E}
  8502. \DeclareUnicodeCharacter{0113}{\=e}
  8503. \DeclareUnicodeCharacter{0114}{\u{E}}
  8504. \DeclareUnicodeCharacter{0115}{\u{e}}
  8505. \DeclareUnicodeCharacter{0116}{\dotaccent{E}}
  8506. \DeclareUnicodeCharacter{0117}{\dotaccent{e}}
  8507. \DeclareUnicodeCharacter{011A}{\v{E}}
  8508. \DeclareUnicodeCharacter{011B}{\v{e}}
  8509. \DeclareUnicodeCharacter{011C}{\^G}
  8510. \DeclareUnicodeCharacter{011D}{\^g}
  8511. \DeclareUnicodeCharacter{011E}{\u{G}}
  8512. \DeclareUnicodeCharacter{011F}{\u{g}}
  8513. \DeclareUnicodeCharacter{0120}{\dotaccent{G}}
  8514. \DeclareUnicodeCharacter{0121}{\dotaccent{g}}
  8515. \DeclareUnicodeCharacter{0124}{\^H}
  8516. \DeclareUnicodeCharacter{0125}{\^h}
  8517. \DeclareUnicodeCharacter{0128}{\~I}
  8518. \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}
  8519. \DeclareUnicodeCharacter{012A}{\=I}
  8520. \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}
  8521. \DeclareUnicodeCharacter{012C}{\u{I}}
  8522. \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}
  8523. \DeclareUnicodeCharacter{0130}{\dotaccent{I}}
  8524. \DeclareUnicodeCharacter{0131}{\dotless{i}}
  8525. \DeclareUnicodeCharacter{0132}{IJ}
  8526. \DeclareUnicodeCharacter{0133}{ij}
  8527. \DeclareUnicodeCharacter{0134}{\^J}
  8528. \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}
  8529. \DeclareUnicodeCharacter{0139}{\'L}
  8530. \DeclareUnicodeCharacter{013A}{\'l}
  8531. \DeclareUnicodeCharacter{0141}{\L}
  8532. \DeclareUnicodeCharacter{0142}{\l}
  8533. \DeclareUnicodeCharacter{0143}{\'N}
  8534. \DeclareUnicodeCharacter{0144}{\'n}
  8535. \DeclareUnicodeCharacter{0147}{\v{N}}
  8536. \DeclareUnicodeCharacter{0148}{\v{n}}
  8537. \DeclareUnicodeCharacter{014C}{\=O}
  8538. \DeclareUnicodeCharacter{014D}{\=o}
  8539. \DeclareUnicodeCharacter{014E}{\u{O}}
  8540. \DeclareUnicodeCharacter{014F}{\u{o}}
  8541. \DeclareUnicodeCharacter{0150}{\H{O}}
  8542. \DeclareUnicodeCharacter{0151}{\H{o}}
  8543. \DeclareUnicodeCharacter{0152}{\OE}
  8544. \DeclareUnicodeCharacter{0153}{\oe}
  8545. \DeclareUnicodeCharacter{0154}{\'R}
  8546. \DeclareUnicodeCharacter{0155}{\'r}
  8547. \DeclareUnicodeCharacter{0158}{\v{R}}
  8548. \DeclareUnicodeCharacter{0159}{\v{r}}
  8549. \DeclareUnicodeCharacter{015A}{\'S}
  8550. \DeclareUnicodeCharacter{015B}{\'s}
  8551. \DeclareUnicodeCharacter{015C}{\^S}
  8552. \DeclareUnicodeCharacter{015D}{\^s}
  8553. \DeclareUnicodeCharacter{015E}{\cedilla{S}}
  8554. \DeclareUnicodeCharacter{015F}{\cedilla{s}}
  8555. \DeclareUnicodeCharacter{0160}{\v{S}}
  8556. \DeclareUnicodeCharacter{0161}{\v{s}}
  8557. \DeclareUnicodeCharacter{0162}{\cedilla{t}}
  8558. \DeclareUnicodeCharacter{0163}{\cedilla{T}}
  8559. \DeclareUnicodeCharacter{0164}{\v{T}}
  8560. \DeclareUnicodeCharacter{0168}{\~U}
  8561. \DeclareUnicodeCharacter{0169}{\~u}
  8562. \DeclareUnicodeCharacter{016A}{\=U}
  8563. \DeclareUnicodeCharacter{016B}{\=u}
  8564. \DeclareUnicodeCharacter{016C}{\u{U}}
  8565. \DeclareUnicodeCharacter{016D}{\u{u}}
  8566. \DeclareUnicodeCharacter{016E}{\ringaccent{U}}
  8567. \DeclareUnicodeCharacter{016F}{\ringaccent{u}}
  8568. \DeclareUnicodeCharacter{0170}{\H{U}}
  8569. \DeclareUnicodeCharacter{0171}{\H{u}}
  8570. \DeclareUnicodeCharacter{0174}{\^W}
  8571. \DeclareUnicodeCharacter{0175}{\^w}
  8572. \DeclareUnicodeCharacter{0176}{\^Y}
  8573. \DeclareUnicodeCharacter{0177}{\^y}
  8574. \DeclareUnicodeCharacter{0178}{\"Y}
  8575. \DeclareUnicodeCharacter{0179}{\'Z}
  8576. \DeclareUnicodeCharacter{017A}{\'z}
  8577. \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}
  8578. \DeclareUnicodeCharacter{017C}{\dotaccent{z}}
  8579. \DeclareUnicodeCharacter{017D}{\v{Z}}
  8580. \DeclareUnicodeCharacter{017E}{\v{z}}
  8581. \DeclareUnicodeCharacter{01C4}{D\v{Z}}
  8582. \DeclareUnicodeCharacter{01C5}{D\v{z}}
  8583. \DeclareUnicodeCharacter{01C6}{d\v{z}}
  8584. \DeclareUnicodeCharacter{01C7}{LJ}
  8585. \DeclareUnicodeCharacter{01C8}{Lj}
  8586. \DeclareUnicodeCharacter{01C9}{lj}
  8587. \DeclareUnicodeCharacter{01CA}{NJ}
  8588. \DeclareUnicodeCharacter{01CB}{Nj}
  8589. \DeclareUnicodeCharacter{01CC}{nj}
  8590. \DeclareUnicodeCharacter{01CD}{\v{A}}
  8591. \DeclareUnicodeCharacter{01CE}{\v{a}}
  8592. \DeclareUnicodeCharacter{01CF}{\v{I}}
  8593. \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}
  8594. \DeclareUnicodeCharacter{01D1}{\v{O}}
  8595. \DeclareUnicodeCharacter{01D2}{\v{o}}
  8596. \DeclareUnicodeCharacter{01D3}{\v{U}}
  8597. \DeclareUnicodeCharacter{01D4}{\v{u}}
  8598. \DeclareUnicodeCharacter{01E2}{\={\AE}}
  8599. \DeclareUnicodeCharacter{01E3}{\={\ae}}
  8600. \DeclareUnicodeCharacter{01E6}{\v{G}}
  8601. \DeclareUnicodeCharacter{01E7}{\v{g}}
  8602. \DeclareUnicodeCharacter{01E8}{\v{K}}
  8603. \DeclareUnicodeCharacter{01E9}{\v{k}}
  8604. \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}
  8605. \DeclareUnicodeCharacter{01F1}{DZ}
  8606. \DeclareUnicodeCharacter{01F2}{Dz}
  8607. \DeclareUnicodeCharacter{01F3}{dz}
  8608. \DeclareUnicodeCharacter{01F4}{\'G}
  8609. \DeclareUnicodeCharacter{01F5}{\'g}
  8610. \DeclareUnicodeCharacter{01F8}{\`N}
  8611. \DeclareUnicodeCharacter{01F9}{\`n}
  8612. \DeclareUnicodeCharacter{01FC}{\'{\AE}}
  8613. \DeclareUnicodeCharacter{01FD}{\'{\ae}}
  8614. \DeclareUnicodeCharacter{01FE}{\'{\O}}
  8615. \DeclareUnicodeCharacter{01FF}{\'{\o}}
  8616. \DeclareUnicodeCharacter{021E}{\v{H}}
  8617. \DeclareUnicodeCharacter{021F}{\v{h}}
  8618. \DeclareUnicodeCharacter{0226}{\dotaccent{A}}
  8619. \DeclareUnicodeCharacter{0227}{\dotaccent{a}}
  8620. \DeclareUnicodeCharacter{0228}{\cedilla{E}}
  8621. \DeclareUnicodeCharacter{0229}{\cedilla{e}}
  8622. \DeclareUnicodeCharacter{022E}{\dotaccent{O}}
  8623. \DeclareUnicodeCharacter{022F}{\dotaccent{o}}
  8624. \DeclareUnicodeCharacter{0232}{\=Y}
  8625. \DeclareUnicodeCharacter{0233}{\=y}
  8626. \DeclareUnicodeCharacter{0237}{\dotless{j}}
  8627. \DeclareUnicodeCharacter{02DB}{\ogonek{ }}
  8628. \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}
  8629. \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}
  8630. \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}
  8631. \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}
  8632. \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}
  8633. \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}
  8634. \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}
  8635. \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}
  8636. \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}
  8637. \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}
  8638. \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}
  8639. \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}
  8640. \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}
  8641. \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}
  8642. \DeclareUnicodeCharacter{1E20}{\=G}
  8643. \DeclareUnicodeCharacter{1E21}{\=g}
  8644. \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}
  8645. \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}
  8646. \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}
  8647. \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}
  8648. \DeclareUnicodeCharacter{1E26}{\"H}
  8649. \DeclareUnicodeCharacter{1E27}{\"h}
  8650. \DeclareUnicodeCharacter{1E30}{\'K}
  8651. \DeclareUnicodeCharacter{1E31}{\'k}
  8652. \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}
  8653. \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}
  8654. \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}
  8655. \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}
  8656. \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}
  8657. \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}
  8658. \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}
  8659. \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}
  8660. \DeclareUnicodeCharacter{1E3E}{\'M}
  8661. \DeclareUnicodeCharacter{1E3F}{\'m}
  8662. \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}
  8663. \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}
  8664. \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}
  8665. \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}
  8666. \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}
  8667. \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}
  8668. \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}
  8669. \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}
  8670. \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}
  8671. \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}
  8672. \DeclareUnicodeCharacter{1E54}{\'P}
  8673. \DeclareUnicodeCharacter{1E55}{\'p}
  8674. \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}
  8675. \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}
  8676. \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}
  8677. \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}
  8678. \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}
  8679. \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}
  8680. \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}
  8681. \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}
  8682. \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}
  8683. \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}
  8684. \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}
  8685. \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}
  8686. \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}
  8687. \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}
  8688. \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}
  8689. \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}
  8690. \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}
  8691. \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}
  8692. \DeclareUnicodeCharacter{1E7C}{\~V}
  8693. \DeclareUnicodeCharacter{1E7D}{\~v}
  8694. \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}
  8695. \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}
  8696. \DeclareUnicodeCharacter{1E80}{\`W}
  8697. \DeclareUnicodeCharacter{1E81}{\`w}
  8698. \DeclareUnicodeCharacter{1E82}{\'W}
  8699. \DeclareUnicodeCharacter{1E83}{\'w}
  8700. \DeclareUnicodeCharacter{1E84}{\"W}
  8701. \DeclareUnicodeCharacter{1E85}{\"w}
  8702. \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}
  8703. \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}
  8704. \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}
  8705. \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}
  8706. \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}
  8707. \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}
  8708. \DeclareUnicodeCharacter{1E8C}{\"X}
  8709. \DeclareUnicodeCharacter{1E8D}{\"x}
  8710. \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}
  8711. \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}
  8712. \DeclareUnicodeCharacter{1E90}{\^Z}
  8713. \DeclareUnicodeCharacter{1E91}{\^z}
  8714. \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}
  8715. \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}
  8716. \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}
  8717. \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}
  8718. \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}
  8719. \DeclareUnicodeCharacter{1E97}{\"t}
  8720. \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}
  8721. \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}
  8722. \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}
  8723. \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}
  8724. \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}
  8725. \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}
  8726. \DeclareUnicodeCharacter{1EBC}{\~E}
  8727. \DeclareUnicodeCharacter{1EBD}{\~e}
  8728. \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}
  8729. \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}
  8730. \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}
  8731. \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}
  8732. \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}
  8733. \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}
  8734. \DeclareUnicodeCharacter{1EF2}{\`Y}
  8735. \DeclareUnicodeCharacter{1EF3}{\`y}
  8736. \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}
  8737. \DeclareUnicodeCharacter{1EF8}{\~Y}
  8738. \DeclareUnicodeCharacter{1EF9}{\~y}
  8739. \DeclareUnicodeCharacter{2013}{--}
  8740. \DeclareUnicodeCharacter{2014}{---}
  8741. \DeclareUnicodeCharacter{2018}{\quoteleft}
  8742. \DeclareUnicodeCharacter{2019}{\quoteright}
  8743. \DeclareUnicodeCharacter{201A}{\quotesinglbase}
  8744. \DeclareUnicodeCharacter{201C}{\quotedblleft}
  8745. \DeclareUnicodeCharacter{201D}{\quotedblright}
  8746. \DeclareUnicodeCharacter{201E}{\quotedblbase}
  8747. \DeclareUnicodeCharacter{2022}{\bullet}
  8748. \DeclareUnicodeCharacter{2026}{\dots}
  8749. \DeclareUnicodeCharacter{2039}{\guilsinglleft}
  8750. \DeclareUnicodeCharacter{203A}{\guilsinglright}
  8751. \DeclareUnicodeCharacter{20AC}{\euro}
  8752. \DeclareUnicodeCharacter{2192}{\expansion}
  8753. \DeclareUnicodeCharacter{21D2}{\result}
  8754. \DeclareUnicodeCharacter{2212}{\minus}
  8755. \DeclareUnicodeCharacter{2217}{\point}
  8756. \DeclareUnicodeCharacter{2261}{\equiv}
  8757. }% end of \utfeightchardefs
  8758. % US-ASCII character definitions.
  8759. \def\asciichardefs{% nothing need be done
  8760. \relax
  8761. }
  8762. % Make non-ASCII characters printable again for compatibility with
  8763. % existing Texinfo documents that may use them, even without declaring a
  8764. % document encoding.
  8765. %
  8766. \setnonasciicharscatcode \other
  8767. \message{formatting,}
  8768. \newdimen\defaultparindent \defaultparindent = 15pt
  8769. \chapheadingskip = 15pt plus 4pt minus 2pt
  8770. \secheadingskip = 12pt plus 3pt minus 2pt
  8771. \subsecheadingskip = 9pt plus 2pt minus 2pt
  8772. % Prevent underfull vbox error messages.
  8773. \vbadness = 10000
  8774. % Don't be very finicky about underfull hboxes, either.
  8775. \hbadness = 6666
  8776. % Following George Bush, get rid of widows and orphans.
  8777. \widowpenalty=10000
  8778. \clubpenalty=10000
  8779. % Use TeX 3.0's \emergencystretch to help line breaking, but if we're
  8780. % using an old version of TeX, don't do anything. We want the amount of
  8781. % stretch added to depend on the line length, hence the dependence on
  8782. % \hsize. We call this whenever the paper size is set.
  8783. %
  8784. \def\setemergencystretch{%
  8785. \ifx\emergencystretch\thisisundefined
  8786. % Allow us to assign to \emergencystretch anyway.
  8787. \def\emergencystretch{\dimen0}%
  8788. \else
  8789. \emergencystretch = .15\hsize
  8790. \fi
  8791. }
  8792. % Parameters in order: 1) textheight; 2) textwidth;
  8793. % 3) voffset; 4) hoffset; 5) binding offset; 6) topskip;
  8794. % 7) physical page height; 8) physical page width.
  8795. %
  8796. % We also call \setleading{\textleading}, so the caller should define
  8797. % \textleading. The caller should also set \parskip.
  8798. %
  8799. \def\internalpagesizes#1#2#3#4#5#6#7#8{%
  8800. \voffset = #3\relax
  8801. \topskip = #6\relax
  8802. \splittopskip = \topskip
  8803. %
  8804. \vsize = #1\relax
  8805. \advance\vsize by \topskip
  8806. \outervsize = \vsize
  8807. \advance\outervsize by 2\topandbottommargin
  8808. \pageheight = \vsize
  8809. %
  8810. \hsize = #2\relax
  8811. \outerhsize = \hsize
  8812. \advance\outerhsize by 0.5in
  8813. \pagewidth = \hsize
  8814. %
  8815. \normaloffset = #4\relax
  8816. \bindingoffset = #5\relax
  8817. %
  8818. \ifpdf
  8819. \pdfpageheight #7\relax
  8820. \pdfpagewidth #8\relax
  8821. % if we don't reset these, they will remain at "1 true in" of
  8822. % whatever layout pdftex was dumped with.
  8823. \pdfhorigin = 1 true in
  8824. \pdfvorigin = 1 true in
  8825. \fi
  8826. %
  8827. \setleading{\textleading}
  8828. %
  8829. \parindent = \defaultparindent
  8830. \setemergencystretch
  8831. }
  8832. % @letterpaper (the default).
  8833. \def\letterpaper{{\globaldefs = 1
  8834. \parskip = 3pt plus 2pt minus 1pt
  8835. \textleading = 13.2pt
  8836. %
  8837. % If page is nothing but text, make it come out even.
  8838. \internalpagesizes{607.2pt}{6in}% that's 46 lines
  8839. {\voffset}{.25in}%
  8840. {\bindingoffset}{36pt}%
  8841. {11in}{8.5in}%
  8842. }}
  8843. % Use @smallbook to reset parameters for 7x9.25 trim size.
  8844. \def\smallbook{{\globaldefs = 1
  8845. \parskip = 2pt plus 1pt
  8846. \textleading = 12pt
  8847. %
  8848. \internalpagesizes{7.5in}{5in}%
  8849. {-.2in}{0in}%
  8850. {\bindingoffset}{16pt}%
  8851. {9.25in}{7in}%
  8852. %
  8853. \lispnarrowing = 0.3in
  8854. \tolerance = 700
  8855. \hfuzz = 1pt
  8856. \contentsrightmargin = 0pt
  8857. \defbodyindent = .5cm
  8858. }}
  8859. % Use @smallerbook to reset parameters for 6x9 trim size.
  8860. % (Just testing, parameters still in flux.)
  8861. \def\smallerbook{{\globaldefs = 1
  8862. \parskip = 1.5pt plus 1pt
  8863. \textleading = 12pt
  8864. %
  8865. \internalpagesizes{7.4in}{4.8in}%
  8866. {-.2in}{-.4in}%
  8867. {0pt}{14pt}%
  8868. {9in}{6in}%
  8869. %
  8870. \lispnarrowing = 0.25in
  8871. \tolerance = 700
  8872. \hfuzz = 1pt
  8873. \contentsrightmargin = 0pt
  8874. \defbodyindent = .4cm
  8875. }}
  8876. % Use @afourpaper to print on European A4 paper.
  8877. \def\afourpaper{{\globaldefs = 1
  8878. \parskip = 3pt plus 2pt minus 1pt
  8879. \textleading = 13.2pt
  8880. %
  8881. % Double-side printing via postscript on Laserjet 4050
  8882. % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
  8883. % To change the settings for a different printer or situation, adjust
  8884. % \normaloffset until the front-side and back-side texts align. Then
  8885. % do the same for \bindingoffset. You can set these for testing in
  8886. % your texinfo source file like this:
  8887. % @tex
  8888. % \global\normaloffset = -6mm
  8889. % \global\bindingoffset = 10mm
  8890. % @end tex
  8891. \internalpagesizes{673.2pt}{160mm}% that's 51 lines
  8892. {\voffset}{\hoffset}%
  8893. {\bindingoffset}{44pt}%
  8894. {297mm}{210mm}%
  8895. %
  8896. \tolerance = 700
  8897. \hfuzz = 1pt
  8898. \contentsrightmargin = 0pt
  8899. \defbodyindent = 5mm
  8900. }}
  8901. % Use @afivepaper to print on European A5 paper.
  8902. % From romildo@urano.iceb.ufop.br, 2 July 2000.
  8903. % He also recommends making @example and @lisp be small.
  8904. \def\afivepaper{{\globaldefs = 1
  8905. \parskip = 2pt plus 1pt minus 0.1pt
  8906. \textleading = 12.5pt
  8907. %
  8908. \internalpagesizes{160mm}{120mm}%
  8909. {\voffset}{\hoffset}%
  8910. {\bindingoffset}{8pt}%
  8911. {210mm}{148mm}%
  8912. %
  8913. \lispnarrowing = 0.2in
  8914. \tolerance = 800
  8915. \hfuzz = 1.2pt
  8916. \contentsrightmargin = 0pt
  8917. \defbodyindent = 2mm
  8918. \tableindent = 12mm
  8919. }}
  8920. % A specific text layout, 24x15cm overall, intended for A4 paper.
  8921. \def\afourlatex{{\globaldefs = 1
  8922. \afourpaper
  8923. \internalpagesizes{237mm}{150mm}%
  8924. {\voffset}{4.6mm}%
  8925. {\bindingoffset}{7mm}%
  8926. {297mm}{210mm}%
  8927. %
  8928. % Must explicitly reset to 0 because we call \afourpaper.
  8929. \globaldefs = 0
  8930. }}
  8931. % Use @afourwide to print on A4 paper in landscape format.
  8932. \def\afourwide{{\globaldefs = 1
  8933. \afourpaper
  8934. \internalpagesizes{241mm}{165mm}%
  8935. {\voffset}{-2.95mm}%
  8936. {\bindingoffset}{7mm}%
  8937. {297mm}{210mm}%
  8938. \globaldefs = 0
  8939. }}
  8940. % @pagesizes TEXTHEIGHT[,TEXTWIDTH]
  8941. % Perhaps we should allow setting the margins, \topskip, \parskip,
  8942. % and/or leading, also. Or perhaps we should compute them somehow.
  8943. %
  8944. \parseargdef\pagesizes{\pagesizesyyy #1,,\finish}
  8945. \def\pagesizesyyy#1,#2,#3\finish{{%
  8946. \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
  8947. \globaldefs = 1
  8948. %
  8949. \parskip = 3pt plus 2pt minus 1pt
  8950. \setleading{\textleading}%
  8951. %
  8952. \dimen0 = #1\relax
  8953. \advance\dimen0 by \voffset
  8954. %
  8955. \dimen2 = \hsize
  8956. \advance\dimen2 by \normaloffset
  8957. %
  8958. \internalpagesizes{#1}{\hsize}%
  8959. {\voffset}{\normaloffset}%
  8960. {\bindingoffset}{44pt}%
  8961. {\dimen0}{\dimen2}%
  8962. }}
  8963. % Set default to letter.
  8964. %
  8965. \letterpaper
  8966. \message{and turning on texinfo input format.}
  8967. \def^^L{\par} % remove \outer, so ^L can appear in an @comment
  8968. % DEL is a comment character, in case @c does not suffice.
  8969. \catcode`\^^? = 14
  8970. % Define macros to output various characters with catcode for normal text.
  8971. \catcode`\"=\other \def\normaldoublequote{"}
  8972. \catcode`\$=\other \def\normaldollar{$}%$ font-lock fix
  8973. \catcode`\+=\other \def\normalplus{+}
  8974. \catcode`\<=\other \def\normalless{<}
  8975. \catcode`\>=\other \def\normalgreater{>}
  8976. \catcode`\^=\other \def\normalcaret{^}
  8977. \catcode`\_=\other \def\normalunderscore{_}
  8978. \catcode`\|=\other \def\normalverticalbar{|}
  8979. \catcode`\~=\other \def\normaltilde{~}
  8980. % This macro is used to make a character print one way in \tt
  8981. % (where it can probably be output as-is), and another way in other fonts,
  8982. % where something hairier probably needs to be done.
  8983. %
  8984. % #1 is what to print if we are indeed using \tt; #2 is what to print
  8985. % otherwise. Since all the Computer Modern typewriter fonts have zero
  8986. % interword stretch (and shrink), and it is reasonable to expect all
  8987. % typewriter fonts to have this, we can check that font parameter.
  8988. %
  8989. \def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
  8990. % Same as above, but check for italic font. Actually this also catches
  8991. % non-italic slanted fonts since it is impossible to distinguish them from
  8992. % italic fonts. But since this is only used by $ and it uses \sl anyway
  8993. % this is not a problem.
  8994. \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
  8995. % Turn off all special characters except @
  8996. % (and those which the user can use as if they were ordinary).
  8997. % Most of these we simply print from the \tt font, but for some, we can
  8998. % use math or other variants that look better in normal text.
  8999. \catcode`\"=\active
  9000. \def\activedoublequote{{\tt\char34}}
  9001. \let"=\activedoublequote
  9002. \catcode`\~=\active
  9003. \def~{{\tt\char126}}
  9004. \chardef\hat=`\^
  9005. \catcode`\^=\active
  9006. \def^{{\tt \hat}}
  9007. \catcode`\_=\active
  9008. \def_{\ifusingtt\normalunderscore\_}
  9009. \let\realunder=_
  9010. % Subroutine for the previous macro.
  9011. \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
  9012. \catcode`\|=\active
  9013. \def|{{\tt\char124}}
  9014. \chardef \less=`\<
  9015. \catcode`\<=\active
  9016. \def<{{\tt \less}}
  9017. \chardef \gtr=`\>
  9018. \catcode`\>=\active
  9019. \def>{{\tt \gtr}}
  9020. \catcode`\+=\active
  9021. \def+{{\tt \char 43}}
  9022. \catcode`\$=\active
  9023. \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
  9024. % If a .fmt file is being used, characters that might appear in a file
  9025. % name cannot be active until we have parsed the command line.
  9026. % So turn them off again, and have \everyjob (or @setfilename) turn them on.
  9027. % \otherifyactive is called near the end of this file.
  9028. \def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
  9029. % Used sometimes to turn off (effectively) the active characters even after
  9030. % parsing them.
  9031. \def\turnoffactive{%
  9032. \normalturnoffactive
  9033. \otherbackslash
  9034. }
  9035. \catcode`\@=0
  9036. % \backslashcurfont outputs one backslash character in current font,
  9037. % as in \char`\\.
  9038. \global\chardef\backslashcurfont=`\\
  9039. \global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work
  9040. % \realbackslash is an actual character `\' with catcode other, and
  9041. % \doublebackslash is two of them (for the pdf outlines).
  9042. {\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}}
  9043. % In texinfo, backslash is an active character; it prints the backslash
  9044. % in fixed width font.
  9045. \catcode`\\=\active
  9046. @def@normalbackslash{{@tt@backslashcurfont}}
  9047. % On startup, @fixbackslash assigns:
  9048. % @let \ = @normalbackslash
  9049. % \rawbackslash defines an active \ to do \backslashcurfont.
  9050. % \otherbackslash defines an active \ to be a literal `\' character with
  9051. % catcode other.
  9052. @gdef@rawbackslash{@let\=@backslashcurfont}
  9053. @gdef@otherbackslash{@let\=@realbackslash}
  9054. % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
  9055. % the literal character `\'.
  9056. %
  9057. @def@normalturnoffactive{%
  9058. @let"=@normaldoublequote
  9059. @let$=@normaldollar %$ font-lock fix
  9060. @let+=@normalplus
  9061. @let<=@normalless
  9062. @let>=@normalgreater
  9063. @let\=@normalbackslash
  9064. @let^=@normalcaret
  9065. @let_=@normalunderscore
  9066. @let|=@normalverticalbar
  9067. @let~=@normaltilde
  9068. @markupsetuplqdefault
  9069. @markupsetuprqdefault
  9070. @unsepspaces
  9071. }
  9072. % Make _ and + \other characters, temporarily.
  9073. % This is canceled by @fixbackslash.
  9074. @otherifyactive
  9075. % If a .fmt file is being used, we don't want the `\input texinfo' to show up.
  9076. % That is what \eatinput is for; after that, the `\' should revert to printing
  9077. % a backslash.
  9078. %
  9079. @gdef@eatinput input texinfo{@fixbackslash}
  9080. @global@let\ = @eatinput
  9081. % On the other hand, perhaps the file did not have a `\input texinfo'. Then
  9082. % the first `\' in the file would cause an error. This macro tries to fix
  9083. % that, assuming it is called before the first `\' could plausibly occur.
  9084. % Also turn back on active characters that might appear in the input
  9085. % file name, in case not using a pre-dumped format.
  9086. %
  9087. @gdef@fixbackslash{%
  9088. @ifx\@eatinput @let\ = @normalbackslash @fi
  9089. @catcode`+=@active
  9090. @catcode`@_=@active
  9091. }
  9092. % Say @foo, not \foo, in error messages.
  9093. @escapechar = `@@
  9094. % These (along with & and #) are made active for url-breaking, so need
  9095. % active definitions as the normal characters.
  9096. @def@normaldot{.}
  9097. @def@normalquest{?}
  9098. @def@normalslash{/}
  9099. % These look ok in all fonts, so just make them not special.
  9100. @catcode`@& = @other @def@normalamp{&}
  9101. @catcode`@# = @other @def@normalhash{#}
  9102. @catcode`@% = @other @def@normalpercent{%}
  9103. @c Finally, make ` and ' active, so that txicodequoteundirected and
  9104. @c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we
  9105. @c don't make ` and ' active, @code will not get them as active chars.
  9106. @c Do this last of all since we use ` in the previous @catcode assignments.
  9107. @catcode`@'=@active
  9108. @catcode`@`=@active
  9109. @markupsetuplqdefault
  9110. @markupsetuprqdefault
  9111. @c Local variables:
  9112. @c eval: (add-hook 'write-file-hooks 'time-stamp)
  9113. @c page-delimiter: "^\\\\message"
  9114. @c time-stamp-start: "def\\\\texinfoversion{"
  9115. @c time-stamp-format: "%:y-%02m-%02d.%02H"
  9116. @c time-stamp-end: "}"
  9117. @c End:
  9118. @c vim:sw=2:
  9119. @ignore
  9120. arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115
  9121. @end ignore