texinfo.tex 326 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308
  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{2015-02-05.16}
  7. %
  8. % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
  9. % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
  10. % 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
  11. % Free Software Foundation, Inc.
  12. %
  13. % This texinfo.tex file is free software: you can redistribute it and/or
  14. % modify it under the terms of the GNU General Public License as
  15. % published by the Free Software Foundation, either version 3 of the
  16. % License, or (at your option) any later version.
  17. %
  18. % This texinfo.tex file is distributed in the hope that it will be
  19. % useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  20. % of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  21. % General Public License for more details.
  22. %
  23. % You should have received a copy of the GNU General Public License
  24. % along with this program. If not, see <http://www.gnu.org/licenses/>.
  25. %
  26. % As a special exception, when this file is read by TeX when processing
  27. % a Texinfo source document, you may use the result without
  28. % restriction. This Exception is an additional permission under section 7
  29. % of the GNU General Public License, version 3 ("GPLv3").
  30. %
  31. % Please try the latest version of texinfo.tex before submitting bug
  32. % reports; you can get the latest version from:
  33. % http://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or
  34. % http://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or
  35. % http://www.gnu.org/software/texinfo/ (the Texinfo home page)
  36. % The texinfo.tex in any given distribution could well be out
  37. % of date, so if that's what you're using, please check.
  38. %
  39. % Send bug reports to bug-texinfo@gnu.org. Please include including a
  40. % complete document in each bug report with which we can reproduce the
  41. % problem. Patches are, of course, greatly appreciated.
  42. %
  43. % To process a Texinfo manual with TeX, it's most reliable to use the
  44. % texi2dvi shell script that comes with the distribution. For a simple
  45. % manual foo.texi, however, you can get away with this:
  46. % tex foo.texi
  47. % texindex foo.??
  48. % tex foo.texi
  49. % tex foo.texi
  50. % dvips foo.dvi -o # or whatever; this makes foo.ps.
  51. % The extra TeX runs get the cross-reference information correct.
  52. % Sometimes one run after texindex suffices, and sometimes you need more
  53. % than two; texi2dvi does it as many times as necessary.
  54. %
  55. % It is possible to adapt texinfo.tex for other languages, to some
  56. % extent. You can get the existing language-specific files from the
  57. % full Texinfo distribution.
  58. %
  59. % The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
  60. \message{Loading texinfo [version \texinfoversion]:}
  61. % If in a .fmt file, print the version number
  62. % and turn on active characters that we couldn't do earlier because
  63. % they might have appeared in the input file name.
  64. \everyjob{\message{[Texinfo version \texinfoversion]}%
  65. \catcode`+=\active \catcode`\_=\active}
  66. \chardef\other=12
  67. % We never want plain's \outer definition of \+ in Texinfo.
  68. % For @tex, we can use \tabalign.
  69. \let\+ = \relax
  70. % Save some plain tex macros whose names we will redefine.
  71. \let\ptexb=\b
  72. \let\ptexbullet=\bullet
  73. \let\ptexc=\c
  74. \let\ptexcomma=\,
  75. \let\ptexdot=\.
  76. \let\ptexdots=\dots
  77. \let\ptexend=\end
  78. \let\ptexequiv=\equiv
  79. \let\ptexexclam=\!
  80. \let\ptexfootnote=\footnote
  81. \let\ptexgtr=>
  82. \let\ptexhat=^
  83. \let\ptexi=\i
  84. \let\ptexindent=\indent
  85. \let\ptexinsert=\insert
  86. \let\ptexlbrace=\{
  87. \let\ptexless=<
  88. \let\ptexnewwrite\newwrite
  89. \let\ptexnoindent=\noindent
  90. \let\ptexplus=+
  91. \let\ptexraggedright=\raggedright
  92. \let\ptexrbrace=\}
  93. \let\ptexslash=\/
  94. \let\ptexsp=\sp
  95. \let\ptexstar=\*
  96. \let\ptexsup=\sup
  97. \let\ptext=\t
  98. \let\ptextop=\top
  99. {\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode
  100. % If this character appears in an error message or help string, it
  101. % starts a new line in the output.
  102. \newlinechar = `^^J
  103. % Use TeX 3.0's \inputlineno to get the line number, for better error
  104. % messages, but if we're using an old version of TeX, don't do anything.
  105. %
  106. \ifx\inputlineno\thisisundefined
  107. \let\linenumber = \empty % Pre-3.0.
  108. \else
  109. \def\linenumber{l.\the\inputlineno:\space}
  110. \fi
  111. % Set up fixed words for English if not already set.
  112. \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
  113. \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
  114. \ifx\putworderror\undefined \gdef\putworderror{error}\fi
  115. \ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
  116. \ifx\putwordin\undefined \gdef\putwordin{in}\fi
  117. \ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
  118. \ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
  119. \ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
  120. \ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
  121. \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
  122. \ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi
  123. \ifx\putwordof\undefined \gdef\putwordof{of}\fi
  124. \ifx\putwordon\undefined \gdef\putwordon{on}\fi
  125. \ifx\putwordpage\undefined \gdef\putwordpage{page}\fi
  126. \ifx\putwordsection\undefined \gdef\putwordsection{section}\fi
  127. \ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi
  128. \ifx\putwordsee\undefined \gdef\putwordsee{see}\fi
  129. \ifx\putwordSee\undefined \gdef\putwordSee{See}\fi
  130. \ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi
  131. \ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi
  132. %
  133. \ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
  134. \ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
  135. \ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
  136. \ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
  137. \ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
  138. \ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
  139. \ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
  140. \ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
  141. \ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
  142. \ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
  143. \ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
  144. \ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
  145. %
  146. \ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi
  147. \ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi
  148. \ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi
  149. \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
  150. \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
  151. % Since the category of space is not known, we have to be careful.
  152. \chardef\spacecat = 10
  153. \def\spaceisspace{\catcode`\ =\spacecat}
  154. % sometimes characters are active, so we need control sequences.
  155. \chardef\ampChar = `\&
  156. \chardef\colonChar = `\:
  157. \chardef\commaChar = `\,
  158. \chardef\dashChar = `\-
  159. \chardef\dotChar = `\.
  160. \chardef\exclamChar= `\!
  161. \chardef\hashChar = `\#
  162. \chardef\lquoteChar= `\`
  163. \chardef\questChar = `\?
  164. \chardef\rquoteChar= `\'
  165. \chardef\semiChar = `\;
  166. \chardef\slashChar = `\/
  167. \chardef\underChar = `\_
  168. % Ignore a token.
  169. %
  170. \def\gobble#1{}
  171. % The following is used inside several \edef's.
  172. \def\makecsname#1{\expandafter\noexpand\csname#1\endcsname}
  173. % Hyphenation fixes.
  174. \hyphenation{
  175. Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script
  176. ap-pen-dix bit-map bit-maps
  177. data-base data-bases eshell fall-ing half-way long-est man-u-script
  178. man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm
  179. par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces
  180. spell-ing spell-ings
  181. stand-alone strong-est time-stamp time-stamps which-ever white-space
  182. wide-spread wrap-around
  183. }
  184. % Margin to add to right of even pages, to left of odd pages.
  185. \newdimen\bindingoffset
  186. \newdimen\normaloffset
  187. \newdimen\pagewidth \newdimen\pageheight
  188. % For a final copy, take out the rectangles
  189. % that mark overfull boxes (in case you have decided
  190. % that the text looks ok even though it passes the margin).
  191. %
  192. \def\finalout{\overfullrule=0pt }
  193. % Sometimes it is convenient to have everything in the transcript file
  194. % and nothing on the terminal. We don't just call \tracingall here,
  195. % since that produces some useless output on the terminal. We also make
  196. % some effort to order the tracing commands to reduce output in the log
  197. % file; cf. trace.sty in LaTeX.
  198. %
  199. \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
  200. \def\loggingall{%
  201. \tracingstats2
  202. \tracingpages1
  203. \tracinglostchars2 % 2 gives us more in etex
  204. \tracingparagraphs1
  205. \tracingoutput1
  206. \tracingmacros2
  207. \tracingrestores1
  208. \showboxbreadth\maxdimen \showboxdepth\maxdimen
  209. \ifx\eTeXversion\thisisundefined\else % etex gives us more logging
  210. \tracingscantokens1
  211. \tracingifs1
  212. \tracinggroups1
  213. \tracingnesting2
  214. \tracingassigns1
  215. \fi
  216. \tracingcommands3 % 3 gives us more in etex
  217. \errorcontextlines16
  218. }%
  219. % @errormsg{MSG}. Do the index-like expansions on MSG, but if things
  220. % aren't perfect, it's not the end of the world, being an error message,
  221. % after all.
  222. %
  223. \def\errormsg{\begingroup \indexnofonts \doerrormsg}
  224. \def\doerrormsg#1{\errmessage{#1}}
  225. % add check for \lastpenalty to plain's definitions. If the last thing
  226. % we did was a \nobreak, we don't want to insert more space.
  227. %
  228. \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
  229. \removelastskip\penalty-50\smallskip\fi\fi}
  230. \def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
  231. \removelastskip\penalty-100\medskip\fi\fi}
  232. \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
  233. \removelastskip\penalty-200\bigskip\fi\fi}
  234. % Do @cropmarks to get crop marks.
  235. %
  236. \newif\ifcropmarks
  237. \let\cropmarks = \cropmarkstrue
  238. %
  239. % Dimensions to add cropmarks at corners.
  240. % Added by P. A. MacKay, 12 Nov. 1986
  241. %
  242. \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
  243. \newdimen\cornerlong \cornerlong=1pc
  244. \newdimen\cornerthick \cornerthick=.3pt
  245. \newdimen\topandbottommargin \topandbottommargin=.75in
  246. % Output a mark which sets \thischapter, \thissection and \thiscolor.
  247. % We dump everything together because we only have one kind of mark.
  248. % This works because we only use \botmark / \topmark, not \firstmark.
  249. %
  250. % A mark contains a subexpression of the \ifcase ... \fi construct.
  251. % \get*marks macros below extract the needed part using \ifcase.
  252. %
  253. % Another complication is to let the user choose whether \thischapter
  254. % (\thissection) refers to the chapter (section) in effect at the top
  255. % of a page, or that at the bottom of a page. The solution is
  256. % described on page 260 of The TeXbook. It involves outputting two
  257. % marks for the sectioning macros, one before the section break, and
  258. % one after. I won't pretend I can describe this better than DEK...
  259. \def\domark{%
  260. \toks0=\expandafter{\lastchapterdefs}%
  261. \toks2=\expandafter{\lastsectiondefs}%
  262. \toks4=\expandafter{\prevchapterdefs}%
  263. \toks6=\expandafter{\prevsectiondefs}%
  264. \toks8=\expandafter{\lastcolordefs}%
  265. \mark{%
  266. \the\toks0 \the\toks2 % 0: top marks (\last...)
  267. \noexpand\or \the\toks4 \the\toks6 % 1: bottom marks (default, \prev...)
  268. \noexpand\else \the\toks8 % 2: color marks
  269. }%
  270. }
  271. % \topmark doesn't work for the very first chapter (after the title
  272. % page or the contents), so we use \firstmark there -- this gets us
  273. % the mark with the chapter defs, unless the user sneaks in, e.g.,
  274. % @setcolor (or @url, or @link, etc.) between @contents and the very
  275. % first @chapter.
  276. \def\gettopheadingmarks{%
  277. \ifcase0\topmark\fi
  278. \ifx\thischapter\empty \ifcase0\firstmark\fi \fi
  279. }
  280. \def\getbottomheadingmarks{\ifcase1\botmark\fi}
  281. \def\getcolormarks{\ifcase2\topmark\fi}
  282. % Avoid "undefined control sequence" errors.
  283. \def\lastchapterdefs{}
  284. \def\lastsectiondefs{}
  285. \def\prevchapterdefs{}
  286. \def\prevsectiondefs{}
  287. \def\lastcolordefs{}
  288. % Main output routine.
  289. \chardef\PAGE = 255
  290. \output = {\onepageout{\pagecontents\PAGE}}
  291. \newbox\headlinebox
  292. \newbox\footlinebox
  293. % \onepageout takes a vbox as an argument. Note that \pagecontents
  294. % does insertions, but you have to call it yourself.
  295. \def\onepageout#1{%
  296. \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
  297. %
  298. \ifodd\pageno \advance\hoffset by \bindingoffset
  299. \else \advance\hoffset by -\bindingoffset\fi
  300. %
  301. % Do this outside of the \shipout so @code etc. will be expanded in
  302. % the headline as they should be, not taken literally (outputting ''code).
  303. \def\commmonheadfootline{\let\hsize=\pagewidth \texinfochars}
  304. %
  305. \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
  306. \global\setbox\headlinebox = \vbox{\commmonheadfootline \makeheadline}%
  307. %
  308. \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
  309. \global\setbox\footlinebox = \vbox{\commmonheadfootline \makefootline}%
  310. %
  311. {%
  312. % Have to do this stuff outside the \shipout because we want it to
  313. % take effect in \write's, yet the group defined by the \vbox ends
  314. % before the \shipout runs.
  315. %
  316. \indexdummies % don't expand commands in the output.
  317. \normalturnoffactive % \ in index entries must not stay \, e.g., if
  318. % the page break happens to be in the middle of an example.
  319. % We don't want .vr (or whatever) entries like this:
  320. % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}}
  321. % "\acronym" won't work when it's read back in;
  322. % it needs to be
  323. % {\code {{\tt \backslashcurfont }acronym}
  324. \shipout\vbox{%
  325. % Do this early so pdf references go to the beginning of the page.
  326. \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
  327. %
  328. \ifcropmarks \vbox to \outervsize\bgroup
  329. \hsize = \outerhsize
  330. \vskip-\topandbottommargin
  331. \vtop to0pt{%
  332. \line{\ewtop\hfil\ewtop}%
  333. \nointerlineskip
  334. \line{%
  335. \vbox{\moveleft\cornerthick\nstop}%
  336. \hfill
  337. \vbox{\moveright\cornerthick\nstop}%
  338. }%
  339. \vss}%
  340. \vskip\topandbottommargin
  341. \line\bgroup
  342. \hfil % center the page within the outer (page) hsize.
  343. \ifodd\pageno\hskip\bindingoffset\fi
  344. \vbox\bgroup
  345. \fi
  346. %
  347. \unvbox\headlinebox
  348. \pagebody{#1}%
  349. \ifdim\ht\footlinebox > 0pt
  350. % Only leave this space if the footline is nonempty.
  351. % (We lessened \vsize for it in \oddfootingyyy.)
  352. % The \baselineskip=24pt in plain's \makefootline has no effect.
  353. \vskip 24pt
  354. \unvbox\footlinebox
  355. \fi
  356. %
  357. \ifcropmarks
  358. \egroup % end of \vbox\bgroup
  359. \hfil\egroup % end of (centering) \line\bgroup
  360. \vskip\topandbottommargin plus1fill minus1fill
  361. \boxmaxdepth = \cornerthick
  362. \vbox to0pt{\vss
  363. \line{%
  364. \vbox{\moveleft\cornerthick\nsbot}%
  365. \hfill
  366. \vbox{\moveright\cornerthick\nsbot}%
  367. }%
  368. \nointerlineskip
  369. \line{\ewbot\hfil\ewbot}%
  370. }%
  371. \egroup % \vbox from first cropmarks clause
  372. \fi
  373. }% end of \shipout\vbox
  374. }% end of group with \indexdummies
  375. \advancepageno
  376. \ifnum\outputpenalty>-20000 \else\dosupereject\fi
  377. }
  378. \newinsert\margin \dimen\margin=\maxdimen
  379. \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
  380. {\catcode`\@ =11
  381. \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
  382. % marginal hacks, juha@viisa.uucp (Juha Takala)
  383. \ifvoid\margin\else % marginal info is present
  384. \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
  385. \dimen@=\dp#1\relax \unvbox#1\relax
  386. \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
  387. \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
  388. }
  389. % Here are the rules for the cropmarks. Note that they are
  390. % offset so that the space between them is truly \outerhsize or \outervsize
  391. % (P. A. MacKay, 12 November, 1986)
  392. %
  393. \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
  394. \def\nstop{\vbox
  395. {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
  396. \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
  397. \def\nsbot{\vbox
  398. {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
  399. % Parse an argument, then pass it to #1. The argument is the rest of
  400. % the input line (except we remove a trailing comment). #1 should be a
  401. % macro which expects an ordinary undelimited TeX argument.
  402. %
  403. \def\parsearg{\parseargusing{}}
  404. \def\parseargusing#1#2{%
  405. \def\argtorun{#2}%
  406. \begingroup
  407. \obeylines
  408. \spaceisspace
  409. #1%
  410. \parseargline\empty% Insert the \empty token, see \finishparsearg below.
  411. }
  412. {\obeylines %
  413. \gdef\parseargline#1^^M{%
  414. \endgroup % End of the group started in \parsearg.
  415. \argremovecomment #1\comment\ArgTerm%
  416. }%
  417. }
  418. % First remove any @comment, then any @c comment.
  419. \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
  420. \def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
  421. % Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space.
  422. %
  423. % \argremovec might leave us with trailing space, e.g.,
  424. % @end itemize @c foo
  425. % This space token undergoes the same procedure and is eventually removed
  426. % by \finishparsearg.
  427. %
  428. \def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M}
  429. \def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M}
  430. \def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
  431. \def\temp{#3}%
  432. \ifx\temp\empty
  433. % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp:
  434. \let\temp\finishparsearg
  435. \else
  436. \let\temp\argcheckspaces
  437. \fi
  438. % Put the space token in:
  439. \temp#1 #3\ArgTerm
  440. }
  441. % If a _delimited_ argument is enclosed in braces, they get stripped; so
  442. % to get _exactly_ the rest of the line, we had to prevent such situation.
  443. % We prepended an \empty token at the very beginning and we expand it now,
  444. % just before passing the control to \argtorun.
  445. % (Similarly, we have to think about #3 of \argcheckspacesY above: it is
  446. % either the null string, or it ends with \^^M---thus there is no danger
  447. % that a pair of braces would be stripped.
  448. %
  449. % But first, we have to remove the trailing space token.
  450. %
  451. \def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}}
  452. % \parseargdef\foo{...}
  453. % is roughly equivalent to
  454. % \def\foo{\parsearg\Xfoo}
  455. % \def\Xfoo#1{...}
  456. %
  457. % Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my
  458. % favourite TeX trick. --kasal, 16nov03
  459. \def\parseargdef#1{%
  460. \expandafter \doparseargdef \csname\string#1\endcsname #1%
  461. }
  462. \def\doparseargdef#1#2{%
  463. \def#2{\parsearg#1}%
  464. \def#1##1%
  465. }
  466. % Several utility definitions with active space:
  467. {
  468. \obeyspaces
  469. \gdef\obeyedspace{ }
  470. % Make each space character in the input produce a normal interword
  471. % space in the output. Don't allow a line break at this space, as this
  472. % is used only in environments like @example, where each line of input
  473. % should produce a line of output anyway.
  474. %
  475. \gdef\sepspaces{\obeyspaces\let =\tie}
  476. % If an index command is used in an @example environment, any spaces
  477. % therein should become regular spaces in the raw index file, not the
  478. % expansion of \tie (\leavevmode \penalty \@M \ ).
  479. \gdef\unsepspaces{\let =\space}
  480. }
  481. \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
  482. % Define the framework for environments in texinfo.tex. It's used like this:
  483. %
  484. % \envdef\foo{...}
  485. % \def\Efoo{...}
  486. %
  487. % It's the responsibility of \envdef to insert \begingroup before the
  488. % actual body; @end closes the group after calling \Efoo. \envdef also
  489. % defines \thisenv, so the current environment is known; @end checks
  490. % whether the environment name matches. The \checkenv macro can also be
  491. % used to check whether the current environment is the one expected.
  492. %
  493. % Non-false conditionals (@iftex, @ifset) don't fit into this, so they
  494. % are not treated as environments; they don't open a group. (The
  495. % implementation of @end takes care not to call \endgroup in this
  496. % special case.)
  497. % At run-time, environments start with this:
  498. \def\startenvironment#1{\begingroup\def\thisenv{#1}}
  499. % initialize
  500. \let\thisenv\empty
  501. % ... but they get defined via ``\envdef\foo{...}'':
  502. \long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
  503. \def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
  504. % Check whether we're in the right environment:
  505. \def\checkenv#1{%
  506. \def\temp{#1}%
  507. \ifx\thisenv\temp
  508. \else
  509. \badenverr
  510. \fi
  511. }
  512. % Environment mismatch, #1 expected:
  513. \def\badenverr{%
  514. \errhelp = \EMsimple
  515. \errmessage{This command can appear only \inenvironment\temp,
  516. not \inenvironment\thisenv}%
  517. }
  518. \def\inenvironment#1{%
  519. \ifx#1\empty
  520. outside of any environment%
  521. \else
  522. in environment \expandafter\string#1%
  523. \fi
  524. }
  525. % @end foo executes the definition of \Efoo.
  526. % But first, it executes a specialized version of \checkenv
  527. %
  528. \parseargdef\end{%
  529. \if 1\csname iscond.#1\endcsname
  530. \else
  531. % The general wording of \badenverr may not be ideal.
  532. \expandafter\checkenv\csname#1\endcsname
  533. \csname E#1\endcsname
  534. \endgroup
  535. \fi
  536. }
  537. \newhelp\EMsimple{Press RETURN to continue.}
  538. % Be sure we're in horizontal mode when doing a tie, since we make space
  539. % equivalent to this in @example-like environments. Otherwise, a space
  540. % at the beginning of a line will start with \penalty -- and
  541. % since \penalty is valid in vertical mode, we'd end up putting the
  542. % penalty on the vertical list instead of in the new paragraph.
  543. {\catcode`@ = 11
  544. % Avoid using \@M directly, because that causes trouble
  545. % if the definition is written into an index file.
  546. \global\let\tiepenalty = \@M
  547. \gdef\tie{\leavevmode\penalty\tiepenalty\ }
  548. }
  549. % @: forces normal size whitespace following.
  550. \def\:{\spacefactor=1000 }
  551. % @* forces a line break.
  552. \def\*{\unskip\hfil\break\hbox{}\ignorespaces}
  553. % @/ allows a line break.
  554. \let\/=\allowbreak
  555. % @. is an end-of-sentence period.
  556. \def\.{.\spacefactor=\endofsentencespacefactor\space}
  557. % @! is an end-of-sentence bang.
  558. \def\!{!\spacefactor=\endofsentencespacefactor\space}
  559. % @? is an end-of-sentence query.
  560. \def\?{?\spacefactor=\endofsentencespacefactor\space}
  561. % @frenchspacing on|off says whether to put extra space after punctuation.
  562. %
  563. \def\onword{on}
  564. \def\offword{off}
  565. %
  566. \parseargdef\frenchspacing{%
  567. \def\temp{#1}%
  568. \ifx\temp\onword \plainfrenchspacing
  569. \else\ifx\temp\offword \plainnonfrenchspacing
  570. \else
  571. \errhelp = \EMsimple
  572. \errmessage{Unknown @frenchspacing option `\temp', must be on|off}%
  573. \fi\fi
  574. }
  575. % @w prevents a word break. Without the \leavevmode, @w at the
  576. % beginning of a paragraph, when TeX is still in vertical mode, would
  577. % produce a whole line of output instead of starting the paragraph.
  578. \def\w#1{\leavevmode\hbox{#1}}
  579. % @group ... @end group forces ... to be all on one page, by enclosing
  580. % it in a TeX vbox. We use \vtop instead of \vbox to construct the box
  581. % to keep its height that of a normal line. According to the rules for
  582. % \topskip (p.114 of the TeXbook), the glue inserted is
  583. % max (\topskip - \ht (first item), 0). If that height is large,
  584. % therefore, no glue is inserted, and the space between the headline and
  585. % the text is small, which looks bad.
  586. %
  587. % Another complication is that the group might be very large. This can
  588. % cause the glue on the previous page to be unduly stretched, because it
  589. % does not have much material. In this case, it's better to add an
  590. % explicit \vfill so that the extra space is at the bottom. The
  591. % threshold for doing this is if the group is more than \vfilllimit
  592. % percent of a page (\vfilllimit can be changed inside of @tex).
  593. %
  594. \newbox\groupbox
  595. \def\vfilllimit{0.7}
  596. %
  597. \envdef\group{%
  598. \ifnum\catcode`\^^M=\active \else
  599. \errhelp = \groupinvalidhelp
  600. \errmessage{@group invalid in context where filling is enabled}%
  601. \fi
  602. \startsavinginserts
  603. %
  604. \setbox\groupbox = \vtop\bgroup
  605. % Do @comment since we are called inside an environment such as
  606. % @example, where each end-of-line in the input causes an
  607. % end-of-line in the output. We don't want the end-of-line after
  608. % the `@group' to put extra space in the output. Since @group
  609. % should appear on a line by itself (according to the Texinfo
  610. % manual), we don't worry about eating any user text.
  611. \comment
  612. }
  613. %
  614. % The \vtop produces a box with normal height and large depth; thus, TeX puts
  615. % \baselineskip glue before it, and (when the next line of text is done)
  616. % \lineskip glue after it. Thus, space below is not quite equal to space
  617. % above. But it's pretty close.
  618. \def\Egroup{%
  619. % To get correct interline space between the last line of the group
  620. % and the first line afterwards, we have to propagate \prevdepth.
  621. \endgraf % Not \par, as it may have been set to \lisppar.
  622. \global\dimen1 = \prevdepth
  623. \egroup % End the \vtop.
  624. % \dimen0 is the vertical size of the group's box.
  625. \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox
  626. % \dimen2 is how much space is left on the page (more or less).
  627. \dimen2 = \pageheight \advance\dimen2 by -\pagetotal
  628. % if the group doesn't fit on the current page, and it's a big big
  629. % group, force a page break.
  630. \ifdim \dimen0 > \dimen2
  631. \ifdim \pagetotal < \vfilllimit\pageheight
  632. \page
  633. \fi
  634. \fi
  635. \box\groupbox
  636. \prevdepth = \dimen1
  637. \checkinserts
  638. }
  639. %
  640. % TeX puts in an \escapechar (i.e., `@') at the beginning of the help
  641. % message, so this ends up printing `@group can only ...'.
  642. %
  643. \newhelp\groupinvalidhelp{%
  644. group can only be used in environments such as @example,^^J%
  645. where each line of input produces a line of output.}
  646. % @need space-in-mils
  647. % forces a page break if there is not space-in-mils remaining.
  648. \newdimen\mil \mil=0.001in
  649. \parseargdef\need{%
  650. % Ensure vertical mode, so we don't make a big box in the middle of a
  651. % paragraph.
  652. \par
  653. %
  654. % If the @need value is less than one line space, it's useless.
  655. \dimen0 = #1\mil
  656. \dimen2 = \ht\strutbox
  657. \advance\dimen2 by \dp\strutbox
  658. \ifdim\dimen0 > \dimen2
  659. %
  660. % Do a \strut just to make the height of this box be normal, so the
  661. % normal leading is inserted relative to the preceding line.
  662. % And a page break here is fine.
  663. \vtop to #1\mil{\strut\vfil}%
  664. %
  665. % TeX does not even consider page breaks if a penalty added to the
  666. % main vertical list is 10000 or more. But in order to see if the
  667. % empty box we just added fits on the page, we must make it consider
  668. % page breaks. On the other hand, we don't want to actually break the
  669. % page after the empty box. So we use a penalty of 9999.
  670. %
  671. % There is an extremely small chance that TeX will actually break the
  672. % page at this \penalty, if there are no other feasible breakpoints in
  673. % sight. (If the user is using lots of big @group commands, which
  674. % almost-but-not-quite fill up a page, TeX will have a hard time doing
  675. % good page breaking, for example.) However, I could not construct an
  676. % example where a page broke at this \penalty; if it happens in a real
  677. % document, then we can reconsider our strategy.
  678. \penalty9999
  679. %
  680. % Back up by the size of the box, whether we did a page break or not.
  681. \kern -#1\mil
  682. %
  683. % Do not allow a page break right after this kern.
  684. \nobreak
  685. \fi
  686. }
  687. % @br forces paragraph break (and is undocumented).
  688. \let\br = \par
  689. % @page forces the start of a new page.
  690. %
  691. \def\page{\par\vfill\supereject}
  692. % @exdent text....
  693. % outputs text on separate line in roman font, starting at standard page margin
  694. % This records the amount of indent in the innermost environment.
  695. % That's how much \exdent should take out.
  696. \newskip\exdentamount
  697. % This defn is used inside fill environments such as @defun.
  698. \parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
  699. % This defn is used inside nofill environments such as @example.
  700. \parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount
  701. \leftline{\hskip\leftskip{\rm#1}}}}
  702. % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
  703. % paragraph. For more general purposes, use the \margin insertion
  704. % class. WHICH is `l' or `r'. Not documented, written for gawk manual.
  705. %
  706. \newskip\inmarginspacing \inmarginspacing=1cm
  707. \def\strutdepth{\dp\strutbox}
  708. %
  709. \def\doinmargin#1#2{\strut\vadjust{%
  710. \nobreak
  711. \kern-\strutdepth
  712. \vtop to \strutdepth{%
  713. \baselineskip=\strutdepth
  714. \vss
  715. % if you have multiple lines of stuff to put here, you'll need to
  716. % make the vbox yourself of the appropriate size.
  717. \ifx#1l%
  718. \llap{\ignorespaces #2\hskip\inmarginspacing}%
  719. \else
  720. \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
  721. \fi
  722. \null
  723. }%
  724. }}
  725. \def\inleftmargin{\doinmargin l}
  726. \def\inrightmargin{\doinmargin r}
  727. %
  728. % @inmargin{TEXT [, RIGHT-TEXT]}
  729. % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
  730. % else use TEXT for both).
  731. %
  732. \def\inmargin#1{\parseinmargin #1,,\finish}
  733. \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
  734. \setbox0 = \hbox{\ignorespaces #2}%
  735. \ifdim\wd0 > 0pt
  736. \def\lefttext{#1}% have both texts
  737. \def\righttext{#2}%
  738. \else
  739. \def\lefttext{#1}% have only one text
  740. \def\righttext{#1}%
  741. \fi
  742. %
  743. \ifodd\pageno
  744. \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
  745. \else
  746. \def\temp{\inleftmargin\lefttext}%
  747. \fi
  748. \temp
  749. }
  750. % @| inserts a changebar to the left of the current line. It should
  751. % surround any changed text. This approach does *not* work if the
  752. % change spans more than two lines of output. To handle that, we would
  753. % have adopt a much more difficult approach (putting marks into the main
  754. % vertical list for the beginning and end of each change). This command
  755. % is not documented, not supported, and doesn't work.
  756. %
  757. \def\|{%
  758. % \vadjust can only be used in horizontal mode.
  759. \leavevmode
  760. %
  761. % Append this vertical mode material after the current line in the output.
  762. \vadjust{%
  763. % We want to insert a rule with the height and depth of the current
  764. % leading; that is exactly what \strutbox is supposed to record.
  765. \vskip-\baselineskip
  766. %
  767. % \vadjust-items are inserted at the left edge of the type. So
  768. % the \llap here moves out into the left-hand margin.
  769. \llap{%
  770. %
  771. % For a thicker or thinner bar, change the `1pt'.
  772. \vrule height\baselineskip width1pt
  773. %
  774. % This is the space between the bar and the text.
  775. \hskip 12pt
  776. }%
  777. }%
  778. }
  779. % @include FILE -- \input text of FILE.
  780. %
  781. \def\include{\parseargusing\filenamecatcodes\includezzz}
  782. \def\includezzz#1{%
  783. \pushthisfilestack
  784. \def\thisfile{#1}%
  785. {%
  786. \makevalueexpandable % we want to expand any @value in FILE.
  787. \turnoffactive % and allow special characters in the expansion
  788. \indexnofonts % Allow `@@' and other weird things in file names.
  789. \wlog{texinfo.tex: doing @include of #1^^J}%
  790. \edef\temp{\noexpand\input #1 }%
  791. %
  792. % This trickery is to read FILE outside of a group, in case it makes
  793. % definitions, etc.
  794. \expandafter
  795. }\temp
  796. \popthisfilestack
  797. }
  798. \def\filenamecatcodes{%
  799. \catcode`\\=\other
  800. \catcode`~=\other
  801. \catcode`^=\other
  802. \catcode`_=\other
  803. \catcode`|=\other
  804. \catcode`<=\other
  805. \catcode`>=\other
  806. \catcode`+=\other
  807. \catcode`-=\other
  808. \catcode`\`=\other
  809. \catcode`\'=\other
  810. }
  811. \def\pushthisfilestack{%
  812. \expandafter\pushthisfilestackX\popthisfilestack\StackTerm
  813. }
  814. \def\pushthisfilestackX{%
  815. \expandafter\pushthisfilestackY\thisfile\StackTerm
  816. }
  817. \def\pushthisfilestackY #1\StackTerm #2\StackTerm {%
  818. \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}%
  819. }
  820. \def\popthisfilestack{\errthisfilestackempty}
  821. \def\errthisfilestackempty{\errmessage{Internal error:
  822. the stack of filenames is empty.}}
  823. %
  824. \def\thisfile{}
  825. % @center line
  826. % outputs that line, centered.
  827. %
  828. \parseargdef\center{%
  829. \ifhmode
  830. \let\centersub\centerH
  831. \else
  832. \let\centersub\centerV
  833. \fi
  834. \centersub{\hfil \ignorespaces#1\unskip \hfil}%
  835. \let\centersub\relax % don't let the definition persist, just in case
  836. }
  837. \def\centerH#1{{%
  838. \hfil\break
  839. \advance\hsize by -\leftskip
  840. \advance\hsize by -\rightskip
  841. \line{#1}%
  842. \break
  843. }}
  844. %
  845. \newcount\centerpenalty
  846. \def\centerV#1{%
  847. % The idea here is the same as in \startdefun, \cartouche, etc.: if
  848. % @center is the first thing after a section heading, we need to wipe
  849. % out the negative parskip inserted by \sectionheading, but still
  850. % prevent a page break here.
  851. \centerpenalty = \lastpenalty
  852. \ifnum\centerpenalty>10000 \vskip\parskip \fi
  853. \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi
  854. \line{\kern\leftskip #1\kern\rightskip}%
  855. }
  856. % @sp n outputs n lines of vertical space
  857. %
  858. \parseargdef\sp{\vskip #1\baselineskip}
  859. % @comment ...line which is ignored...
  860. % @c is the same as @comment
  861. % @ignore ... @end ignore is another way to write a comment
  862. %
  863. \def\comment{\begingroup \catcode`\^^M=\other%
  864. \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
  865. \commentxxx}
  866. {\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
  867. %
  868. \let\c=\comment
  869. % @paragraphindent NCHARS
  870. % We'll use ems for NCHARS, close enough.
  871. % NCHARS can also be the word `asis' or `none'.
  872. % We cannot feasibly implement @paragraphindent asis, though.
  873. %
  874. \def\asisword{asis} % no translation, these are keywords
  875. \def\noneword{none}
  876. %
  877. \parseargdef\paragraphindent{%
  878. \def\temp{#1}%
  879. \ifx\temp\asisword
  880. \else
  881. \ifx\temp\noneword
  882. \defaultparindent = 0pt
  883. \else
  884. \defaultparindent = #1em
  885. \fi
  886. \fi
  887. \parindent = \defaultparindent
  888. }
  889. % @exampleindent NCHARS
  890. % We'll use ems for NCHARS like @paragraphindent.
  891. % It seems @exampleindent asis isn't necessary, but
  892. % I preserve it to make it similar to @paragraphindent.
  893. \parseargdef\exampleindent{%
  894. \def\temp{#1}%
  895. \ifx\temp\asisword
  896. \else
  897. \ifx\temp\noneword
  898. \lispnarrowing = 0pt
  899. \else
  900. \lispnarrowing = #1em
  901. \fi
  902. \fi
  903. }
  904. % @firstparagraphindent WORD
  905. % If WORD is `none', then suppress indentation of the first paragraph
  906. % after a section heading. If WORD is `insert', then do indent at such
  907. % paragraphs.
  908. %
  909. % The paragraph indentation is suppressed or not by calling
  910. % \suppressfirstparagraphindent, which the sectioning commands do.
  911. % We switch the definition of this back and forth according to WORD.
  912. % By default, we suppress indentation.
  913. %
  914. \def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
  915. \def\insertword{insert}
  916. %
  917. \parseargdef\firstparagraphindent{%
  918. \def\temp{#1}%
  919. \ifx\temp\noneword
  920. \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
  921. \else\ifx\temp\insertword
  922. \let\suppressfirstparagraphindent = \relax
  923. \else
  924. \errhelp = \EMsimple
  925. \errmessage{Unknown @firstparagraphindent option `\temp'}%
  926. \fi\fi
  927. }
  928. % Here is how we actually suppress indentation. Redefine \everypar to
  929. % \kern backwards by \parindent, and then reset itself to empty.
  930. %
  931. % We also make \indent itself not actually do anything until the next
  932. % paragraph.
  933. %
  934. \gdef\dosuppressfirstparagraphindent{%
  935. \gdef\indent {\restorefirstparagraphindent \indent}%
  936. \gdef\noindent{\restorefirstparagraphindent \noindent}%
  937. \global\everypar = {\kern -\parindent \restorefirstparagraphindent}%
  938. }
  939. %
  940. \gdef\restorefirstparagraphindent{%
  941. \global\let\indent = \ptexindent
  942. \global\let\noindent = \ptexnoindent
  943. \global\everypar = {}%
  944. }
  945. % @refill is a no-op.
  946. \let\refill=\relax
  947. % If working on a large document in chapters, it is convenient to
  948. % be able to disable indexing, cross-referencing, and contents, for test runs.
  949. % This is done with @novalidate (before @setfilename).
  950. %
  951. \newif\iflinks \linkstrue % by default we want the aux files.
  952. \let\novalidate = \linksfalse
  953. % @setfilename is done at the beginning of every texinfo file.
  954. % So open here the files we need to have open while reading the input.
  955. % This makes it possible to make a .fmt file for texinfo.
  956. \def\setfilename{%
  957. \fixbackslash % Turn off hack to swallow `\input texinfo'.
  958. \iflinks
  959. \tryauxfile
  960. % Open the new aux file. TeX will close it automatically at exit.
  961. \immediate\openout\auxfile=\jobname.aux
  962. \fi % \openindices needs to do some work in any case.
  963. \openindices
  964. \let\setfilename=\comment % Ignore extra @setfilename cmds.
  965. %
  966. % If texinfo.cnf is present on the system, read it.
  967. % Useful for site-wide @afourpaper, etc.
  968. \openin 1 texinfo.cnf
  969. \ifeof 1 \else \input texinfo.cnf \fi
  970. \closein 1
  971. %
  972. \comment % Ignore the actual filename.
  973. }
  974. % Called from \setfilename.
  975. %
  976. \def\openindices{%
  977. \newindex{cp}%
  978. \newcodeindex{fn}%
  979. \newcodeindex{vr}%
  980. \newcodeindex{tp}%
  981. \newcodeindex{ky}%
  982. \newcodeindex{pg}%
  983. }
  984. % @bye.
  985. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
  986. \message{pdf,}
  987. % adobe `portable' document format
  988. \newcount\tempnum
  989. \newcount\lnkcount
  990. \newtoks\filename
  991. \newcount\filenamelength
  992. \newcount\pgn
  993. \newtoks\toksA
  994. \newtoks\toksB
  995. \newtoks\toksC
  996. \newtoks\toksD
  997. \newbox\boxA
  998. \newcount\countA
  999. \newif\ifpdf
  1000. \newif\ifpdfmakepagedest
  1001. % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
  1002. % can be set). So we test for \relax and 0 as well as being undefined.
  1003. \ifx\pdfoutput\thisisundefined
  1004. \else
  1005. \ifx\pdfoutput\relax
  1006. \else
  1007. \ifcase\pdfoutput
  1008. \else
  1009. \pdftrue
  1010. \fi
  1011. \fi
  1012. \fi
  1013. % PDF uses PostScript string constants for the names of xref targets,
  1014. % for display in the outlines, and in other places. Thus, we have to
  1015. % double any backslashes. Otherwise, a name like "\node" will be
  1016. % interpreted as a newline (\n), followed by o, d, e. Not good.
  1017. %
  1018. % See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and
  1019. % related messages. The final outcome is that it is up to the TeX user
  1020. % to double the backslashes and otherwise make the string valid, so
  1021. % that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to
  1022. % do this reliably, so we use it.
  1023. % #1 is a control sequence in which to do the replacements,
  1024. % which we \xdef.
  1025. \def\txiescapepdf#1{%
  1026. \ifx\pdfescapestring\thisisundefined
  1027. % No primitive available; should we give a warning or log?
  1028. % Many times it won't matter.
  1029. \else
  1030. % The expandable \pdfescapestring primitive escapes parentheses,
  1031. % backslashes, and other special chars.
  1032. \xdef#1{\pdfescapestring{#1}}%
  1033. \fi
  1034. }
  1035. \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
  1036. with PDF output, and none of those formats could be found. (.eps cannot
  1037. be supported due to the design of the PDF format; use regular TeX (DVI
  1038. output) for that.)}
  1039. \ifpdf
  1040. %
  1041. % Color manipulation macros using ideas from pdfcolor.tex,
  1042. % except using rgb instead of cmyk; the latter is said to render as a
  1043. % very dark gray on-screen and a very dark halftone in print, instead
  1044. % of actual black. The dark red here is dark enough to print on paper as
  1045. % nearly black, but still distinguishable for online viewing. We use
  1046. % black by default, though.
  1047. \def\rgbDarkRed{0.50 0.09 0.12}
  1048. \def\rgbBlack{0 0 0}
  1049. %
  1050. % k sets the color for filling (usual text, etc.);
  1051. % K sets the color for stroking (thin rules, e.g., normal _'s).
  1052. \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}}
  1053. %
  1054. % Set color, and create a mark which defines \thiscolor accordingly,
  1055. % so that \makeheadline knows which color to restore.
  1056. \def\setcolor#1{%
  1057. \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}%
  1058. \domark
  1059. \pdfsetcolor{#1}%
  1060. }
  1061. %
  1062. \def\maincolor{\rgbBlack}
  1063. \pdfsetcolor{\maincolor}
  1064. \edef\thiscolor{\maincolor}
  1065. \def\lastcolordefs{}
  1066. %
  1067. \def\makefootline{%
  1068. \baselineskip24pt
  1069. \line{\pdfsetcolor{\maincolor}\the\footline}%
  1070. }
  1071. %
  1072. \def\makeheadline{%
  1073. \vbox to 0pt{%
  1074. \vskip-22.5pt
  1075. \line{%
  1076. \vbox to8.5pt{}%
  1077. % Extract \thiscolor definition from the marks.
  1078. \getcolormarks
  1079. % Typeset the headline with \maincolor, then restore the color.
  1080. \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
  1081. }%
  1082. \vss
  1083. }%
  1084. \nointerlineskip
  1085. }
  1086. %
  1087. %
  1088. \pdfcatalog{/PageMode /UseOutlines}
  1089. %
  1090. % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
  1091. \def\dopdfimage#1#2#3{%
  1092. \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
  1093. \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
  1094. %
  1095. % pdftex (and the PDF format) support .pdf, .png, .jpg (among
  1096. % others). Let's try in that order, PDF first since if
  1097. % someone has a scalable image, presumably better to use that than a
  1098. % bitmap.
  1099. \let\pdfimgext=\empty
  1100. \begingroup
  1101. \openin 1 #1.pdf \ifeof 1
  1102. \openin 1 #1.PDF \ifeof 1
  1103. \openin 1 #1.png \ifeof 1
  1104. \openin 1 #1.jpg \ifeof 1
  1105. \openin 1 #1.jpeg \ifeof 1
  1106. \openin 1 #1.JPG \ifeof 1
  1107. \errhelp = \nopdfimagehelp
  1108. \errmessage{Could not find image file #1 for pdf}%
  1109. \else \gdef\pdfimgext{JPG}%
  1110. \fi
  1111. \else \gdef\pdfimgext{jpeg}%
  1112. \fi
  1113. \else \gdef\pdfimgext{jpg}%
  1114. \fi
  1115. \else \gdef\pdfimgext{png}%
  1116. \fi
  1117. \else \gdef\pdfimgext{PDF}%
  1118. \fi
  1119. \else \gdef\pdfimgext{pdf}%
  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 \pdfimagewidth \fi
  1132. \ifdim \wd2 >0pt height \pdfimageheight \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. \makevalueexpandable
  1148. \def\pdfdestname{#1}%
  1149. \txiescapepdf\pdfdestname
  1150. \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
  1151. }}
  1152. %
  1153. % used to mark target names; must be expandable.
  1154. \def\pdfmkpgn#1{#1}
  1155. %
  1156. % by default, use black for everything.
  1157. \def\urlcolor{\rgbBlack}
  1158. \def\linkcolor{\rgbBlack}
  1159. \def\endlink{\setcolor{\maincolor}\pdfendlink}
  1160. %
  1161. % Adding outlines to PDF; macros for calculating structure of outlines
  1162. % come from Petr Olsak
  1163. \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
  1164. \else \csname#1\endcsname \fi}
  1165. \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
  1166. \advance\tempnum by 1
  1167. \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
  1168. %
  1169. % #1 is the section text, which is what will be displayed in the
  1170. % outline by the pdf viewer. #2 is the pdf expression for the number
  1171. % of subentries (or empty, for subsubsections). #3 is the node text,
  1172. % which might be empty if this toc entry had no corresponding node.
  1173. % #4 is the page number
  1174. %
  1175. \def\dopdfoutline#1#2#3#4{%
  1176. % Generate a link to the node text if that exists; else, use the
  1177. % page number. We could generate a destination for the section
  1178. % text in the case where a section has no node, but it doesn't
  1179. % seem worth the trouble, since most documents are normally structured.
  1180. \edef\pdfoutlinedest{#3}%
  1181. \ifx\pdfoutlinedest\empty
  1182. \def\pdfoutlinedest{#4}%
  1183. \else
  1184. \txiescapepdf\pdfoutlinedest
  1185. \fi
  1186. %
  1187. % Also escape PDF chars in the display string.
  1188. \edef\pdfoutlinetext{#1}%
  1189. \txiescapepdf\pdfoutlinetext
  1190. %
  1191. \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
  1192. }
  1193. %
  1194. \def\pdfmakeoutlines{%
  1195. \begingroup
  1196. % Read toc silently, to get counts of subentries for \pdfoutline.
  1197. \def\partentry##1##2##3##4{}% ignore parts in the outlines
  1198. \def\numchapentry##1##2##3##4{%
  1199. \def\thischapnum{##2}%
  1200. \def\thissecnum{0}%
  1201. \def\thissubsecnum{0}%
  1202. }%
  1203. \def\numsecentry##1##2##3##4{%
  1204. \advancenumber{chap\thischapnum}%
  1205. \def\thissecnum{##2}%
  1206. \def\thissubsecnum{0}%
  1207. }%
  1208. \def\numsubsecentry##1##2##3##4{%
  1209. \advancenumber{sec\thissecnum}%
  1210. \def\thissubsecnum{##2}%
  1211. }%
  1212. \def\numsubsubsecentry##1##2##3##4{%
  1213. \advancenumber{subsec\thissubsecnum}%
  1214. }%
  1215. \def\thischapnum{0}%
  1216. \def\thissecnum{0}%
  1217. \def\thissubsecnum{0}%
  1218. %
  1219. % use \def rather than \let here because we redefine \chapentry et
  1220. % al. a second time, below.
  1221. \def\appentry{\numchapentry}%
  1222. \def\appsecentry{\numsecentry}%
  1223. \def\appsubsecentry{\numsubsecentry}%
  1224. \def\appsubsubsecentry{\numsubsubsecentry}%
  1225. \def\unnchapentry{\numchapentry}%
  1226. \def\unnsecentry{\numsecentry}%
  1227. \def\unnsubsecentry{\numsubsecentry}%
  1228. \def\unnsubsubsecentry{\numsubsubsecentry}%
  1229. \readdatafile{toc}%
  1230. %
  1231. % Read toc second time, this time actually producing the outlines.
  1232. % The `-' means take the \expnumber as the absolute number of
  1233. % subentries, which we calculated on our first read of the .toc above.
  1234. %
  1235. % We use the node names as the destinations.
  1236. \def\numchapentry##1##2##3##4{%
  1237. \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
  1238. \def\numsecentry##1##2##3##4{%
  1239. \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
  1240. \def\numsubsecentry##1##2##3##4{%
  1241. \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%
  1242. \def\numsubsubsecentry##1##2##3##4{% count is always zero
  1243. \dopdfoutline{##1}{}{##3}{##4}}%
  1244. %
  1245. % PDF outlines are displayed using system fonts, instead of
  1246. % document fonts. Therefore we cannot use special characters,
  1247. % since the encoding is unknown. For example, the eogonek from
  1248. % Latin 2 (0xea) gets translated to a | character. Info from
  1249. % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
  1250. %
  1251. % TODO this right, we have to translate 8-bit characters to
  1252. % their "best" equivalent, based on the @documentencoding. Too
  1253. % much work for too little return. Just use the ASCII equivalents
  1254. % we use for the index sort strings.
  1255. %
  1256. \indexnofonts
  1257. \setupdatafile
  1258. % We can have normal brace characters in the PDF outlines, unlike
  1259. % Texinfo index files. So set that up.
  1260. \def\{{\lbracecharliteral}%
  1261. \def\}{\rbracecharliteral}%
  1262. \catcode`\\=\active \otherbackslash
  1263. \input \tocreadfilename
  1264. \endgroup
  1265. }
  1266. {\catcode`[=1 \catcode`]=2
  1267. \catcode`{=\other \catcode`}=\other
  1268. \gdef\lbracecharliteral[{]%
  1269. \gdef\rbracecharliteral[}]%
  1270. ]
  1271. %
  1272. \def\skipspaces#1{\def\PP{#1}\def\D{|}%
  1273. \ifx\PP\D\let\nextsp\relax
  1274. \else\let\nextsp\skipspaces
  1275. \addtokens{\filename}{\PP}%
  1276. \advance\filenamelength by 1
  1277. \fi
  1278. \nextsp}
  1279. \def\getfilename#1{%
  1280. \filenamelength=0
  1281. % If we don't expand the argument now, \skipspaces will get
  1282. % snagged on things like "@value{foo}".
  1283. \edef\temp{#1}%
  1284. \expandafter\skipspaces\temp|\relax
  1285. }
  1286. \ifnum\pdftexversion < 14
  1287. \let \startlink \pdfannotlink
  1288. \else
  1289. \let \startlink \pdfstartlink
  1290. \fi
  1291. % make a live url in pdf output.
  1292. \def\pdfurl#1{%
  1293. \begingroup
  1294. % it seems we really need yet another set of dummies; have not
  1295. % tried to figure out what each command should do in the context
  1296. % of @url. for now, just make @/ a no-op, that's the only one
  1297. % people have actually reported a problem with.
  1298. %
  1299. \normalturnoffactive
  1300. \def\@{@}%
  1301. \let\/=\empty
  1302. \makevalueexpandable
  1303. % do we want to go so far as to use \indexnofonts instead of just
  1304. % special-casing \var here?
  1305. \def\var##1{##1}%
  1306. %
  1307. \leavevmode\setcolor{\urlcolor}%
  1308. \startlink attr{/Border [0 0 0]}%
  1309. user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
  1310. \endgroup}
  1311. \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
  1312. \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
  1313. \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
  1314. \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
  1315. \def\maketoks{%
  1316. \expandafter\poptoks\the\toksA|ENDTOKS|\relax
  1317. \ifx\first0\adn0
  1318. \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
  1319. \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
  1320. \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
  1321. \else
  1322. \ifnum0=\countA\else\makelink\fi
  1323. \ifx\first.\let\next=\done\else
  1324. \let\next=\maketoks
  1325. \addtokens{\toksB}{\the\toksD}
  1326. \ifx\first,\addtokens{\toksB}{\space}\fi
  1327. \fi
  1328. \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
  1329. \next}
  1330. \def\makelink{\addtokens{\toksB}%
  1331. {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
  1332. \def\pdflink#1{%
  1333. \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
  1334. \setcolor{\linkcolor}#1\endlink}
  1335. \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
  1336. \else
  1337. % non-pdf mode
  1338. \let\pdfmkdest = \gobble
  1339. \let\pdfurl = \gobble
  1340. \let\endlink = \relax
  1341. \let\setcolor = \gobble
  1342. \let\pdfsetcolor = \gobble
  1343. \let\pdfmakeoutlines = \relax
  1344. \fi % \ifx\pdfoutput
  1345. \message{fonts,}
  1346. % Change the current font style to #1, remembering it in \curfontstyle.
  1347. % For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
  1348. % italics, not bold italics.
  1349. %
  1350. \def\setfontstyle#1{%
  1351. \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
  1352. \csname ten#1\endcsname % change the current font
  1353. }
  1354. % Select #1 fonts with the current style.
  1355. %
  1356. \def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname}
  1357. \def\rm{\fam=0 \setfontstyle{rm}}
  1358. \def\it{\fam=\itfam \setfontstyle{it}}
  1359. \def\sl{\fam=\slfam \setfontstyle{sl}}
  1360. \def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
  1361. \def\tt{\fam=\ttfam \setfontstyle{tt}}
  1362. % Unfortunately, we have to override this for titles and the like, since
  1363. % in those cases "rm" is bold. Sigh.
  1364. \def\rmisbold{\rm\def\curfontstyle{bf}}
  1365. % Texinfo sort of supports the sans serif font style, which plain TeX does not.
  1366. % So we set up a \sf.
  1367. \newfam\sffam
  1368. \def\sf{\fam=\sffam \setfontstyle{sf}}
  1369. \let\li = \sf % Sometimes we call it \li, not \sf.
  1370. % We don't need math for this font style.
  1371. \def\ttsl{\setfontstyle{ttsl}}
  1372. % Set the baselineskip to #1, and the lineskip and strut size
  1373. % correspondingly. There is no deep meaning behind these magic numbers
  1374. % used as factors; they just match (closely enough) what Knuth defined.
  1375. %
  1376. \def\lineskipfactor{.08333}
  1377. \def\strutheightpercent{.70833}
  1378. \def\strutdepthpercent {.29167}
  1379. %
  1380. % can get a sort of poor man's double spacing by redefining this.
  1381. \def\baselinefactor{1}
  1382. %
  1383. \newdimen\textleading
  1384. \def\setleading#1{%
  1385. \dimen0 = #1\relax
  1386. \normalbaselineskip = \baselinefactor\dimen0
  1387. \normallineskip = \lineskipfactor\normalbaselineskip
  1388. \normalbaselines
  1389. \setbox\strutbox =\hbox{%
  1390. \vrule width0pt height\strutheightpercent\baselineskip
  1391. depth \strutdepthpercent \baselineskip
  1392. }%
  1393. }
  1394. % PDF CMaps. See also LaTeX's t1.cmap.
  1395. %
  1396. % do nothing with this by default.
  1397. \expandafter\let\csname cmapOT1\endcsname\gobble
  1398. \expandafter\let\csname cmapOT1IT\endcsname\gobble
  1399. \expandafter\let\csname cmapOT1TT\endcsname\gobble
  1400. % if we are producing pdf, and we have \pdffontattr, then define cmaps.
  1401. % (\pdffontattr was introduced many years ago, but people still run
  1402. % older pdftex's; it's easy to conditionalize, so we do.)
  1403. \ifpdf \ifx\pdffontattr\thisisundefined \else
  1404. \begingroup
  1405. \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
  1406. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
  1407. %%DocumentNeededResources: ProcSet (CIDInit)
  1408. %%IncludeResource: ProcSet (CIDInit)
  1409. %%BeginResource: CMap (TeX-OT1-0)
  1410. %%Title: (TeX-OT1-0 TeX OT1 0)
  1411. %%Version: 1.000
  1412. %%EndComments
  1413. /CIDInit /ProcSet findresource begin
  1414. 12 dict begin
  1415. begincmap
  1416. /CIDSystemInfo
  1417. << /Registry (TeX)
  1418. /Ordering (OT1)
  1419. /Supplement 0
  1420. >> def
  1421. /CMapName /TeX-OT1-0 def
  1422. /CMapType 2 def
  1423. 1 begincodespacerange
  1424. <00> <7F>
  1425. endcodespacerange
  1426. 8 beginbfrange
  1427. <00> <01> <0393>
  1428. <09> <0A> <03A8>
  1429. <23> <26> <0023>
  1430. <28> <3B> <0028>
  1431. <3F> <5B> <003F>
  1432. <5D> <5E> <005D>
  1433. <61> <7A> <0061>
  1434. <7B> <7C> <2013>
  1435. endbfrange
  1436. 40 beginbfchar
  1437. <02> <0398>
  1438. <03> <039B>
  1439. <04> <039E>
  1440. <05> <03A0>
  1441. <06> <03A3>
  1442. <07> <03D2>
  1443. <08> <03A6>
  1444. <0B> <00660066>
  1445. <0C> <00660069>
  1446. <0D> <0066006C>
  1447. <0E> <006600660069>
  1448. <0F> <00660066006C>
  1449. <10> <0131>
  1450. <11> <0237>
  1451. <12> <0060>
  1452. <13> <00B4>
  1453. <14> <02C7>
  1454. <15> <02D8>
  1455. <16> <00AF>
  1456. <17> <02DA>
  1457. <18> <00B8>
  1458. <19> <00DF>
  1459. <1A> <00E6>
  1460. <1B> <0153>
  1461. <1C> <00F8>
  1462. <1D> <00C6>
  1463. <1E> <0152>
  1464. <1F> <00D8>
  1465. <21> <0021>
  1466. <22> <201D>
  1467. <27> <2019>
  1468. <3C> <00A1>
  1469. <3D> <003D>
  1470. <3E> <00BF>
  1471. <5C> <201C>
  1472. <5F> <02D9>
  1473. <60> <2018>
  1474. <7D> <02DD>
  1475. <7E> <007E>
  1476. <7F> <00A8>
  1477. endbfchar
  1478. endcmap
  1479. CMapName currentdict /CMap defineresource pop
  1480. end
  1481. end
  1482. %%EndResource
  1483. %%EOF
  1484. }\endgroup
  1485. \expandafter\edef\csname cmapOT1\endcsname#1{%
  1486. \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
  1487. }%
  1488. %
  1489. % \cmapOT1IT
  1490. \begingroup
  1491. \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
  1492. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
  1493. %%DocumentNeededResources: ProcSet (CIDInit)
  1494. %%IncludeResource: ProcSet (CIDInit)
  1495. %%BeginResource: CMap (TeX-OT1IT-0)
  1496. %%Title: (TeX-OT1IT-0 TeX OT1IT 0)
  1497. %%Version: 1.000
  1498. %%EndComments
  1499. /CIDInit /ProcSet findresource begin
  1500. 12 dict begin
  1501. begincmap
  1502. /CIDSystemInfo
  1503. << /Registry (TeX)
  1504. /Ordering (OT1IT)
  1505. /Supplement 0
  1506. >> def
  1507. /CMapName /TeX-OT1IT-0 def
  1508. /CMapType 2 def
  1509. 1 begincodespacerange
  1510. <00> <7F>
  1511. endcodespacerange
  1512. 8 beginbfrange
  1513. <00> <01> <0393>
  1514. <09> <0A> <03A8>
  1515. <25> <26> <0025>
  1516. <28> <3B> <0028>
  1517. <3F> <5B> <003F>
  1518. <5D> <5E> <005D>
  1519. <61> <7A> <0061>
  1520. <7B> <7C> <2013>
  1521. endbfrange
  1522. 42 beginbfchar
  1523. <02> <0398>
  1524. <03> <039B>
  1525. <04> <039E>
  1526. <05> <03A0>
  1527. <06> <03A3>
  1528. <07> <03D2>
  1529. <08> <03A6>
  1530. <0B> <00660066>
  1531. <0C> <00660069>
  1532. <0D> <0066006C>
  1533. <0E> <006600660069>
  1534. <0F> <00660066006C>
  1535. <10> <0131>
  1536. <11> <0237>
  1537. <12> <0060>
  1538. <13> <00B4>
  1539. <14> <02C7>
  1540. <15> <02D8>
  1541. <16> <00AF>
  1542. <17> <02DA>
  1543. <18> <00B8>
  1544. <19> <00DF>
  1545. <1A> <00E6>
  1546. <1B> <0153>
  1547. <1C> <00F8>
  1548. <1D> <00C6>
  1549. <1E> <0152>
  1550. <1F> <00D8>
  1551. <21> <0021>
  1552. <22> <201D>
  1553. <23> <0023>
  1554. <24> <00A3>
  1555. <27> <2019>
  1556. <3C> <00A1>
  1557. <3D> <003D>
  1558. <3E> <00BF>
  1559. <5C> <201C>
  1560. <5F> <02D9>
  1561. <60> <2018>
  1562. <7D> <02DD>
  1563. <7E> <007E>
  1564. <7F> <00A8>
  1565. endbfchar
  1566. endcmap
  1567. CMapName currentdict /CMap defineresource pop
  1568. end
  1569. end
  1570. %%EndResource
  1571. %%EOF
  1572. }\endgroup
  1573. \expandafter\edef\csname cmapOT1IT\endcsname#1{%
  1574. \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
  1575. }%
  1576. %
  1577. % \cmapOT1TT
  1578. \begingroup
  1579. \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
  1580. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
  1581. %%DocumentNeededResources: ProcSet (CIDInit)
  1582. %%IncludeResource: ProcSet (CIDInit)
  1583. %%BeginResource: CMap (TeX-OT1TT-0)
  1584. %%Title: (TeX-OT1TT-0 TeX OT1TT 0)
  1585. %%Version: 1.000
  1586. %%EndComments
  1587. /CIDInit /ProcSet findresource begin
  1588. 12 dict begin
  1589. begincmap
  1590. /CIDSystemInfo
  1591. << /Registry (TeX)
  1592. /Ordering (OT1TT)
  1593. /Supplement 0
  1594. >> def
  1595. /CMapName /TeX-OT1TT-0 def
  1596. /CMapType 2 def
  1597. 1 begincodespacerange
  1598. <00> <7F>
  1599. endcodespacerange
  1600. 5 beginbfrange
  1601. <00> <01> <0393>
  1602. <09> <0A> <03A8>
  1603. <21> <26> <0021>
  1604. <28> <5F> <0028>
  1605. <61> <7E> <0061>
  1606. endbfrange
  1607. 32 beginbfchar
  1608. <02> <0398>
  1609. <03> <039B>
  1610. <04> <039E>
  1611. <05> <03A0>
  1612. <06> <03A3>
  1613. <07> <03D2>
  1614. <08> <03A6>
  1615. <0B> <2191>
  1616. <0C> <2193>
  1617. <0D> <0027>
  1618. <0E> <00A1>
  1619. <0F> <00BF>
  1620. <10> <0131>
  1621. <11> <0237>
  1622. <12> <0060>
  1623. <13> <00B4>
  1624. <14> <02C7>
  1625. <15> <02D8>
  1626. <16> <00AF>
  1627. <17> <02DA>
  1628. <18> <00B8>
  1629. <19> <00DF>
  1630. <1A> <00E6>
  1631. <1B> <0153>
  1632. <1C> <00F8>
  1633. <1D> <00C6>
  1634. <1E> <0152>
  1635. <1F> <00D8>
  1636. <20> <2423>
  1637. <27> <2019>
  1638. <60> <2018>
  1639. <7F> <00A8>
  1640. endbfchar
  1641. endcmap
  1642. CMapName currentdict /CMap defineresource pop
  1643. end
  1644. end
  1645. %%EndResource
  1646. %%EOF
  1647. }\endgroup
  1648. \expandafter\edef\csname cmapOT1TT\endcsname#1{%
  1649. \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
  1650. }%
  1651. \fi\fi
  1652. % Set the font macro #1 to the font named \fontprefix#2.
  1653. % #3 is the font's design size, #4 is a scale factor, #5 is the CMap
  1654. % encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit).
  1655. % Example:
  1656. % #1 = \textrm
  1657. % #2 = \rmshape
  1658. % #3 = 10
  1659. % #4 = \mainmagstep
  1660. % #5 = OT1
  1661. %
  1662. \def\setfont#1#2#3#4#5{%
  1663. \font#1=\fontprefix#2#3 scaled #4
  1664. \csname cmap#5\endcsname#1%
  1665. }
  1666. % This is what gets called when #5 of \setfont is empty.
  1667. \let\cmap\gobble
  1668. %
  1669. % (end of cmaps)
  1670. % Use cm as the default font prefix.
  1671. % To specify the font prefix, you must define \fontprefix
  1672. % before you read in texinfo.tex.
  1673. \ifx\fontprefix\thisisundefined
  1674. \def\fontprefix{cm}
  1675. \fi
  1676. % Support font families that don't use the same naming scheme as CM.
  1677. \def\rmshape{r}
  1678. \def\rmbshape{bx} % where the normal face is bold
  1679. \def\bfshape{b}
  1680. \def\bxshape{bx}
  1681. \def\ttshape{tt}
  1682. \def\ttbshape{tt}
  1683. \def\ttslshape{sltt}
  1684. \def\itshape{ti}
  1685. \def\itbshape{bxti}
  1686. \def\slshape{sl}
  1687. \def\slbshape{bxsl}
  1688. \def\sfshape{ss}
  1689. \def\sfbshape{ss}
  1690. \def\scshape{csc}
  1691. \def\scbshape{csc}
  1692. % Definitions for a main text size of 11pt. (The default in Texinfo.)
  1693. %
  1694. \def\definetextfontsizexi{%
  1695. % Text fonts (11.2pt, magstep1).
  1696. \def\textnominalsize{11pt}
  1697. \edef\mainmagstep{\magstephalf}
  1698. \setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
  1699. \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
  1700. \setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
  1701. \setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
  1702. \setfont\textsl\slshape{10}{\mainmagstep}{OT1}
  1703. \setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
  1704. \setfont\textsc\scshape{10}{\mainmagstep}{OT1}
  1705. \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
  1706. \font\texti=cmmi10 scaled \mainmagstep
  1707. \font\textsy=cmsy10 scaled \mainmagstep
  1708. \def\textecsize{1095}
  1709. % A few fonts for @defun names and args.
  1710. \setfont\defbf\bfshape{10}{\magstep1}{OT1}
  1711. \setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
  1712. \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
  1713. \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
  1714. % Fonts for indices, footnotes, small examples (9pt).
  1715. \def\smallnominalsize{9pt}
  1716. \setfont\smallrm\rmshape{9}{1000}{OT1}
  1717. \setfont\smalltt\ttshape{9}{1000}{OT1TT}
  1718. \setfont\smallbf\bfshape{10}{900}{OT1}
  1719. \setfont\smallit\itshape{9}{1000}{OT1IT}
  1720. \setfont\smallsl\slshape{9}{1000}{OT1}
  1721. \setfont\smallsf\sfshape{9}{1000}{OT1}
  1722. \setfont\smallsc\scshape{10}{900}{OT1}
  1723. \setfont\smallttsl\ttslshape{10}{900}{OT1TT}
  1724. \font\smalli=cmmi9
  1725. \font\smallsy=cmsy9
  1726. \def\smallecsize{0900}
  1727. % Fonts for small examples (8pt).
  1728. \def\smallernominalsize{8pt}
  1729. \setfont\smallerrm\rmshape{8}{1000}{OT1}
  1730. \setfont\smallertt\ttshape{8}{1000}{OT1TT}
  1731. \setfont\smallerbf\bfshape{10}{800}{OT1}
  1732. \setfont\smallerit\itshape{8}{1000}{OT1IT}
  1733. \setfont\smallersl\slshape{8}{1000}{OT1}
  1734. \setfont\smallersf\sfshape{8}{1000}{OT1}
  1735. \setfont\smallersc\scshape{10}{800}{OT1}
  1736. \setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
  1737. \font\smalleri=cmmi8
  1738. \font\smallersy=cmsy8
  1739. \def\smallerecsize{0800}
  1740. % Fonts for title page (20.4pt):
  1741. \def\titlenominalsize{20pt}
  1742. \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
  1743. \setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
  1744. \setfont\titlesl\slbshape{10}{\magstep4}{OT1}
  1745. \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
  1746. \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
  1747. \setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
  1748. \let\titlebf=\titlerm
  1749. \setfont\titlesc\scbshape{10}{\magstep4}{OT1}
  1750. \font\titlei=cmmi12 scaled \magstep3
  1751. \font\titlesy=cmsy10 scaled \magstep4
  1752. \def\titleecsize{2074}
  1753. % Chapter (and unnumbered) fonts (17.28pt).
  1754. \def\chapnominalsize{17pt}
  1755. \setfont\chaprm\rmbshape{12}{\magstep2}{OT1}
  1756. \setfont\chapit\itbshape{10}{\magstep3}{OT1IT}
  1757. \setfont\chapsl\slbshape{10}{\magstep3}{OT1}
  1758. \setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT}
  1759. \setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT}
  1760. \setfont\chapsf\sfbshape{17}{1000}{OT1}
  1761. \let\chapbf=\chaprm
  1762. \setfont\chapsc\scbshape{10}{\magstep3}{OT1}
  1763. \font\chapi=cmmi12 scaled \magstep2
  1764. \font\chapsy=cmsy10 scaled \magstep3
  1765. \def\chapecsize{1728}
  1766. % Section fonts (14.4pt).
  1767. \def\secnominalsize{14pt}
  1768. \setfont\secrm\rmbshape{12}{\magstep1}{OT1}
  1769. \setfont\secit\itbshape{10}{\magstep2}{OT1IT}
  1770. \setfont\secsl\slbshape{10}{\magstep2}{OT1}
  1771. \setfont\sectt\ttbshape{12}{\magstep1}{OT1TT}
  1772. \setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT}
  1773. \setfont\secsf\sfbshape{12}{\magstep1}{OT1}
  1774. \let\secbf\secrm
  1775. \setfont\secsc\scbshape{10}{\magstep2}{OT1}
  1776. \font\seci=cmmi12 scaled \magstep1
  1777. \font\secsy=cmsy10 scaled \magstep2
  1778. \def\sececsize{1440}
  1779. % Subsection fonts (13.15pt).
  1780. \def\ssecnominalsize{13pt}
  1781. \setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1}
  1782. \setfont\ssecit\itbshape{10}{1315}{OT1IT}
  1783. \setfont\ssecsl\slbshape{10}{1315}{OT1}
  1784. \setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT}
  1785. \setfont\ssecttsl\ttslshape{10}{1315}{OT1TT}
  1786. \setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1}
  1787. \let\ssecbf\ssecrm
  1788. \setfont\ssecsc\scbshape{10}{1315}{OT1}
  1789. \font\sseci=cmmi12 scaled \magstephalf
  1790. \font\ssecsy=cmsy10 scaled 1315
  1791. \def\ssececsize{1200}
  1792. % Reduced fonts for @acro in text (10pt).
  1793. \def\reducednominalsize{10pt}
  1794. \setfont\reducedrm\rmshape{10}{1000}{OT1}
  1795. \setfont\reducedtt\ttshape{10}{1000}{OT1TT}
  1796. \setfont\reducedbf\bfshape{10}{1000}{OT1}
  1797. \setfont\reducedit\itshape{10}{1000}{OT1IT}
  1798. \setfont\reducedsl\slshape{10}{1000}{OT1}
  1799. \setfont\reducedsf\sfshape{10}{1000}{OT1}
  1800. \setfont\reducedsc\scshape{10}{1000}{OT1}
  1801. \setfont\reducedttsl\ttslshape{10}{1000}{OT1TT}
  1802. \font\reducedi=cmmi10
  1803. \font\reducedsy=cmsy10
  1804. \def\reducedecsize{1000}
  1805. \textleading = 13.2pt % line spacing for 11pt CM
  1806. \textfonts % reset the current fonts
  1807. \rm
  1808. } % end of 11pt text font size definitions, \definetextfontsizexi
  1809. % Definitions to make the main text be 10pt Computer Modern, with
  1810. % section, chapter, etc., sizes following suit. This is for the GNU
  1811. % Press printing of the Emacs 22 manual. Maybe other manuals in the
  1812. % future. Used with @smallbook, which sets the leading to 12pt.
  1813. %
  1814. \def\definetextfontsizex{%
  1815. % Text fonts (10pt).
  1816. \def\textnominalsize{10pt}
  1817. \edef\mainmagstep{1000}
  1818. \setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
  1819. \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
  1820. \setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
  1821. \setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
  1822. \setfont\textsl\slshape{10}{\mainmagstep}{OT1}
  1823. \setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
  1824. \setfont\textsc\scshape{10}{\mainmagstep}{OT1}
  1825. \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
  1826. \font\texti=cmmi10 scaled \mainmagstep
  1827. \font\textsy=cmsy10 scaled \mainmagstep
  1828. \def\textecsize{1000}
  1829. % A few fonts for @defun names and args.
  1830. \setfont\defbf\bfshape{10}{\magstephalf}{OT1}
  1831. \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
  1832. \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
  1833. \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
  1834. % Fonts for indices, footnotes, small examples (9pt).
  1835. \def\smallnominalsize{9pt}
  1836. \setfont\smallrm\rmshape{9}{1000}{OT1}
  1837. \setfont\smalltt\ttshape{9}{1000}{OT1TT}
  1838. \setfont\smallbf\bfshape{10}{900}{OT1}
  1839. \setfont\smallit\itshape{9}{1000}{OT1IT}
  1840. \setfont\smallsl\slshape{9}{1000}{OT1}
  1841. \setfont\smallsf\sfshape{9}{1000}{OT1}
  1842. \setfont\smallsc\scshape{10}{900}{OT1}
  1843. \setfont\smallttsl\ttslshape{10}{900}{OT1TT}
  1844. \font\smalli=cmmi9
  1845. \font\smallsy=cmsy9
  1846. \def\smallecsize{0900}
  1847. % Fonts for small examples (8pt).
  1848. \def\smallernominalsize{8pt}
  1849. \setfont\smallerrm\rmshape{8}{1000}{OT1}
  1850. \setfont\smallertt\ttshape{8}{1000}{OT1TT}
  1851. \setfont\smallerbf\bfshape{10}{800}{OT1}
  1852. \setfont\smallerit\itshape{8}{1000}{OT1IT}
  1853. \setfont\smallersl\slshape{8}{1000}{OT1}
  1854. \setfont\smallersf\sfshape{8}{1000}{OT1}
  1855. \setfont\smallersc\scshape{10}{800}{OT1}
  1856. \setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
  1857. \font\smalleri=cmmi8
  1858. \font\smallersy=cmsy8
  1859. \def\smallerecsize{0800}
  1860. % Fonts for title page (20.4pt):
  1861. \def\titlenominalsize{20pt}
  1862. \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
  1863. \setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
  1864. \setfont\titlesl\slbshape{10}{\magstep4}{OT1}
  1865. \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
  1866. \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
  1867. \setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
  1868. \let\titlebf=\titlerm
  1869. \setfont\titlesc\scbshape{10}{\magstep4}{OT1}
  1870. \font\titlei=cmmi12 scaled \magstep3
  1871. \font\titlesy=cmsy10 scaled \magstep4
  1872. \def\titleecsize{2074}
  1873. % Chapter fonts (14.4pt).
  1874. \def\chapnominalsize{14pt}
  1875. \setfont\chaprm\rmbshape{12}{\magstep1}{OT1}
  1876. \setfont\chapit\itbshape{10}{\magstep2}{OT1IT}
  1877. \setfont\chapsl\slbshape{10}{\magstep2}{OT1}
  1878. \setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT}
  1879. \setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT}
  1880. \setfont\chapsf\sfbshape{12}{\magstep1}{OT1}
  1881. \let\chapbf\chaprm
  1882. \setfont\chapsc\scbshape{10}{\magstep2}{OT1}
  1883. \font\chapi=cmmi12 scaled \magstep1
  1884. \font\chapsy=cmsy10 scaled \magstep2
  1885. \def\chapecsize{1440}
  1886. % Section fonts (12pt).
  1887. \def\secnominalsize{12pt}
  1888. \setfont\secrm\rmbshape{12}{1000}{OT1}
  1889. \setfont\secit\itbshape{10}{\magstep1}{OT1IT}
  1890. \setfont\secsl\slbshape{10}{\magstep1}{OT1}
  1891. \setfont\sectt\ttbshape{12}{1000}{OT1TT}
  1892. \setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT}
  1893. \setfont\secsf\sfbshape{12}{1000}{OT1}
  1894. \let\secbf\secrm
  1895. \setfont\secsc\scbshape{10}{\magstep1}{OT1}
  1896. \font\seci=cmmi12
  1897. \font\secsy=cmsy10 scaled \magstep1
  1898. \def\sececsize{1200}
  1899. % Subsection fonts (10pt).
  1900. \def\ssecnominalsize{10pt}
  1901. \setfont\ssecrm\rmbshape{10}{1000}{OT1}
  1902. \setfont\ssecit\itbshape{10}{1000}{OT1IT}
  1903. \setfont\ssecsl\slbshape{10}{1000}{OT1}
  1904. \setfont\ssectt\ttbshape{10}{1000}{OT1TT}
  1905. \setfont\ssecttsl\ttslshape{10}{1000}{OT1TT}
  1906. \setfont\ssecsf\sfbshape{10}{1000}{OT1}
  1907. \let\ssecbf\ssecrm
  1908. \setfont\ssecsc\scbshape{10}{1000}{OT1}
  1909. \font\sseci=cmmi10
  1910. \font\ssecsy=cmsy10
  1911. \def\ssececsize{1000}
  1912. % Reduced fonts for @acro in text (9pt).
  1913. \def\reducednominalsize{9pt}
  1914. \setfont\reducedrm\rmshape{9}{1000}{OT1}
  1915. \setfont\reducedtt\ttshape{9}{1000}{OT1TT}
  1916. \setfont\reducedbf\bfshape{10}{900}{OT1}
  1917. \setfont\reducedit\itshape{9}{1000}{OT1IT}
  1918. \setfont\reducedsl\slshape{9}{1000}{OT1}
  1919. \setfont\reducedsf\sfshape{9}{1000}{OT1}
  1920. \setfont\reducedsc\scshape{10}{900}{OT1}
  1921. \setfont\reducedttsl\ttslshape{10}{900}{OT1TT}
  1922. \font\reducedi=cmmi9
  1923. \font\reducedsy=cmsy9
  1924. \def\reducedecsize{0900}
  1925. \divide\parskip by 2 % reduce space between paragraphs
  1926. \textleading = 12pt % line spacing for 10pt CM
  1927. \textfonts % reset the current fonts
  1928. \rm
  1929. } % end of 10pt text font size definitions, \definetextfontsizex
  1930. % We provide the user-level command
  1931. % @fonttextsize 10
  1932. % (or 11) to redefine the text font size. pt is assumed.
  1933. %
  1934. \def\xiword{11}
  1935. \def\xword{10}
  1936. \def\xwordpt{10pt}
  1937. %
  1938. \parseargdef\fonttextsize{%
  1939. \def\textsizearg{#1}%
  1940. %\wlog{doing @fonttextsize \textsizearg}%
  1941. %
  1942. % Set \globaldefs so that documents can use this inside @tex, since
  1943. % makeinfo 4.8 does not support it, but we need it nonetheless.
  1944. %
  1945. \begingroup \globaldefs=1
  1946. \ifx\textsizearg\xword \definetextfontsizex
  1947. \else \ifx\textsizearg\xiword \definetextfontsizexi
  1948. \else
  1949. \errhelp=\EMsimple
  1950. \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
  1951. \fi\fi
  1952. \endgroup
  1953. }
  1954. % In order for the font changes to affect most math symbols and letters,
  1955. % we have to define the \textfont of the standard families. We don't
  1956. % bother to reset \scriptfont and \scriptscriptfont; awaiting user need.
  1957. %
  1958. \def\resetmathfonts{%
  1959. \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy
  1960. \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf
  1961. \textfont\ttfam=\tentt \textfont\sffam=\tensf
  1962. }
  1963. % The font-changing commands redefine the meanings of \tenSTYLE, instead
  1964. % of just \STYLE. We do this because \STYLE needs to also set the
  1965. % current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire
  1966. % \tenSTYLE to set the current font.
  1967. %
  1968. % Each font-changing command also sets the names \lsize (one size lower)
  1969. % and \lllsize (three sizes lower). These relative commands are used
  1970. % in, e.g., the LaTeX logo and acronyms.
  1971. %
  1972. % This all needs generalizing, badly.
  1973. %
  1974. \def\textfonts{%
  1975. \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
  1976. \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
  1977. \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
  1978. \let\tenttsl=\textttsl
  1979. \def\curfontsize{text}%
  1980. \def\lsize{reduced}\def\lllsize{smaller}%
  1981. \resetmathfonts \setleading{\textleading}}
  1982. \def\titlefonts{%
  1983. \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
  1984. \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
  1985. \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
  1986. \let\tenttsl=\titlettsl
  1987. \def\curfontsize{title}%
  1988. \def\lsize{chap}\def\lllsize{subsec}%
  1989. \resetmathfonts \setleading{27pt}}
  1990. \def\titlefont#1{{\titlefonts\rmisbold #1}}
  1991. \def\chapfonts{%
  1992. \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
  1993. \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
  1994. \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
  1995. \let\tenttsl=\chapttsl
  1996. \def\curfontsize{chap}%
  1997. \def\lsize{sec}\def\lllsize{text}%
  1998. \resetmathfonts \setleading{19pt}}
  1999. \def\secfonts{%
  2000. \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
  2001. \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
  2002. \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
  2003. \let\tenttsl=\secttsl
  2004. \def\curfontsize{sec}%
  2005. \def\lsize{subsec}\def\lllsize{reduced}%
  2006. \resetmathfonts \setleading{17pt}}
  2007. \def\subsecfonts{%
  2008. \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
  2009. \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
  2010. \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
  2011. \let\tenttsl=\ssecttsl
  2012. \def\curfontsize{ssec}%
  2013. \def\lsize{text}\def\lllsize{small}%
  2014. \resetmathfonts \setleading{15pt}}
  2015. \let\subsubsecfonts = \subsecfonts
  2016. \def\reducedfonts{%
  2017. \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl
  2018. \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc
  2019. \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy
  2020. \let\tenttsl=\reducedttsl
  2021. \def\curfontsize{reduced}%
  2022. \def\lsize{small}\def\lllsize{smaller}%
  2023. \resetmathfonts \setleading{10.5pt}}
  2024. \def\smallfonts{%
  2025. \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
  2026. \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
  2027. \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
  2028. \let\tenttsl=\smallttsl
  2029. \def\curfontsize{small}%
  2030. \def\lsize{smaller}\def\lllsize{smaller}%
  2031. \resetmathfonts \setleading{10.5pt}}
  2032. \def\smallerfonts{%
  2033. \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
  2034. \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
  2035. \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
  2036. \let\tenttsl=\smallerttsl
  2037. \def\curfontsize{smaller}%
  2038. \def\lsize{smaller}\def\lllsize{smaller}%
  2039. \resetmathfonts \setleading{9.5pt}}
  2040. % Fonts for short table of contents.
  2041. \setfont\shortcontrm\rmshape{12}{1000}{OT1}
  2042. \setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12
  2043. \setfont\shortcontsl\slshape{12}{1000}{OT1}
  2044. \setfont\shortconttt\ttshape{12}{1000}{OT1TT}
  2045. % Define these just so they can be easily changed for other fonts.
  2046. \def\angleleft{$\langle$}
  2047. \def\angleright{$\rangle$}
  2048. % Set the fonts to use with the @small... environments.
  2049. \let\smallexamplefonts = \smallfonts
  2050. % About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample
  2051. % can fit this many characters:
  2052. % 8.5x11=86 smallbook=72 a4=90 a5=69
  2053. % If we use \scriptfonts (8pt), then we can fit this many characters:
  2054. % 8.5x11=90+ smallbook=80 a4=90+ a5=77
  2055. % For me, subjectively, the few extra characters that fit aren't worth
  2056. % the additional smallness of 8pt. So I'm making the default 9pt.
  2057. %
  2058. % By the way, for comparison, here's what fits with @example (10pt):
  2059. % 8.5x11=71 smallbook=60 a4=75 a5=58
  2060. % --karl, 24jan03.
  2061. % Set up the default fonts, so we can use them for creating boxes.
  2062. %
  2063. \definetextfontsizexi
  2064. \message{markup,}
  2065. % Check if we are currently using a typewriter font. Since all the
  2066. % Computer Modern typewriter fonts have zero interword stretch (and
  2067. % shrink), and it is reasonable to expect all typewriter fonts to have
  2068. % this property, we can check that font parameter.
  2069. %
  2070. \def\ifmonospace{\ifdim\fontdimen3\font=0pt }
  2071. % Markup style infrastructure. \defmarkupstylesetup\INITMACRO will
  2072. % define and register \INITMACRO to be called on markup style changes.
  2073. % \INITMACRO can check \currentmarkupstyle for the innermost
  2074. % style and the set of \ifmarkupSTYLE switches for all styles
  2075. % currently in effect.
  2076. \newif\ifmarkupvar
  2077. \newif\ifmarkupsamp
  2078. \newif\ifmarkupkey
  2079. %\newif\ifmarkupfile % @file == @samp.
  2080. %\newif\ifmarkupoption % @option == @samp.
  2081. \newif\ifmarkupcode
  2082. \newif\ifmarkupkbd
  2083. %\newif\ifmarkupenv % @env == @code.
  2084. %\newif\ifmarkupcommand % @command == @code.
  2085. \newif\ifmarkuptex % @tex (and part of @math, for now).
  2086. \newif\ifmarkupexample
  2087. \newif\ifmarkupverb
  2088. \newif\ifmarkupverbatim
  2089. \let\currentmarkupstyle\empty
  2090. \def\setupmarkupstyle#1{%
  2091. \csname markup#1true\endcsname
  2092. \def\currentmarkupstyle{#1}%
  2093. \markupstylesetup
  2094. }
  2095. \let\markupstylesetup\empty
  2096. \def\defmarkupstylesetup#1{%
  2097. \expandafter\def\expandafter\markupstylesetup
  2098. \expandafter{\markupstylesetup #1}%
  2099. \def#1%
  2100. }
  2101. % Markup style setup for left and right quotes.
  2102. \defmarkupstylesetup\markupsetuplq{%
  2103. \expandafter\let\expandafter \temp
  2104. \csname markupsetuplq\currentmarkupstyle\endcsname
  2105. \ifx\temp\relax \markupsetuplqdefault \else \temp \fi
  2106. }
  2107. \defmarkupstylesetup\markupsetuprq{%
  2108. \expandafter\let\expandafter \temp
  2109. \csname markupsetuprq\currentmarkupstyle\endcsname
  2110. \ifx\temp\relax \markupsetuprqdefault \else \temp \fi
  2111. }
  2112. {
  2113. \catcode`\'=\active
  2114. \catcode`\`=\active
  2115. \gdef\markupsetuplqdefault{\let`\lq}
  2116. \gdef\markupsetuprqdefault{\let'\rq}
  2117. \gdef\markupsetcodequoteleft{\let`\codequoteleft}
  2118. \gdef\markupsetcodequoteright{\let'\codequoteright}
  2119. }
  2120. \let\markupsetuplqcode \markupsetcodequoteleft
  2121. \let\markupsetuprqcode \markupsetcodequoteright
  2122. %
  2123. \let\markupsetuplqexample \markupsetcodequoteleft
  2124. \let\markupsetuprqexample \markupsetcodequoteright
  2125. %
  2126. \let\markupsetuplqkbd \markupsetcodequoteleft
  2127. \let\markupsetuprqkbd \markupsetcodequoteright
  2128. %
  2129. \let\markupsetuplqsamp \markupsetcodequoteleft
  2130. \let\markupsetuprqsamp \markupsetcodequoteright
  2131. %
  2132. \let\markupsetuplqverb \markupsetcodequoteleft
  2133. \let\markupsetuprqverb \markupsetcodequoteright
  2134. %
  2135. \let\markupsetuplqverbatim \markupsetcodequoteleft
  2136. \let\markupsetuprqverbatim \markupsetcodequoteright
  2137. % Allow an option to not use regular directed right quote/apostrophe
  2138. % (char 0x27), but instead the undirected quote from cmtt (char 0x0d).
  2139. % The undirected quote is ugly, so don't make it the default, but it
  2140. % works for pasting with more pdf viewers (at least evince), the
  2141. % lilypond developers report. xpdf does work with the regular 0x27.
  2142. %
  2143. \def\codequoteright{%
  2144. \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
  2145. \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
  2146. '%
  2147. \else \char'15 \fi
  2148. \else \char'15 \fi
  2149. }
  2150. %
  2151. % and a similar option for the left quote char vs. a grave accent.
  2152. % Modern fonts display ASCII 0x60 as a grave accent, so some people like
  2153. % the code environments to do likewise.
  2154. %
  2155. \def\codequoteleft{%
  2156. \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
  2157. \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
  2158. % [Knuth] pp. 380,381,391
  2159. % \relax disables Spanish ligatures ?` and !` of \tt font.
  2160. \relax`%
  2161. \else \char'22 \fi
  2162. \else \char'22 \fi
  2163. }
  2164. % Commands to set the quote options.
  2165. %
  2166. \parseargdef\codequoteundirected{%
  2167. \def\temp{#1}%
  2168. \ifx\temp\onword
  2169. \expandafter\let\csname SETtxicodequoteundirected\endcsname
  2170. = t%
  2171. \else\ifx\temp\offword
  2172. \expandafter\let\csname SETtxicodequoteundirected\endcsname
  2173. = \relax
  2174. \else
  2175. \errhelp = \EMsimple
  2176. \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}%
  2177. \fi\fi
  2178. }
  2179. %
  2180. \parseargdef\codequotebacktick{%
  2181. \def\temp{#1}%
  2182. \ifx\temp\onword
  2183. \expandafter\let\csname SETtxicodequotebacktick\endcsname
  2184. = t%
  2185. \else\ifx\temp\offword
  2186. \expandafter\let\csname SETtxicodequotebacktick\endcsname
  2187. = \relax
  2188. \else
  2189. \errhelp = \EMsimple
  2190. \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}%
  2191. \fi\fi
  2192. }
  2193. % [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
  2194. \def\noligaturesquoteleft{\relax\lq}
  2195. % Count depth in font-changes, for error checks
  2196. \newcount\fontdepth \fontdepth=0
  2197. % Font commands.
  2198. % #1 is the font command (\sl or \it), #2 is the text to slant.
  2199. % If we are in a monospaced environment, however, 1) always use \ttsl,
  2200. % and 2) do not add an italic correction.
  2201. \def\dosmartslant#1#2{%
  2202. \ifusingtt
  2203. {{\ttsl #2}\let\next=\relax}%
  2204. {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}%
  2205. \next
  2206. }
  2207. \def\smartslanted{\dosmartslant\sl}
  2208. \def\smartitalic{\dosmartslant\it}
  2209. % Output an italic correction unless \next (presumed to be the following
  2210. % character) is such as not to need one.
  2211. \def\smartitaliccorrection{%
  2212. \ifx\next,%
  2213. \else\ifx\next-%
  2214. \else\ifx\next.%
  2215. \else\ifx\next\.%
  2216. \else\ifx\next\comma%
  2217. \else\ptexslash
  2218. \fi\fi\fi\fi\fi
  2219. \aftersmartic
  2220. }
  2221. % Unconditional use \ttsl, and no ic. @var is set to this for defuns.
  2222. \def\ttslanted#1{{\ttsl #1}}
  2223. % @cite is like \smartslanted except unconditionally use \sl. We never want
  2224. % ttsl for book titles, do we?
  2225. \def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection}
  2226. \def\aftersmartic{}
  2227. \def\var#1{%
  2228. \let\saveaftersmartic = \aftersmartic
  2229. \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}%
  2230. \smartslanted{#1}%
  2231. }
  2232. \let\i=\smartitalic
  2233. \let\slanted=\smartslanted
  2234. \let\dfn=\smartslanted
  2235. \let\emph=\smartitalic
  2236. % Explicit font changes: @r, @sc, undocumented @ii.
  2237. \def\r#1{{\rm #1}} % roman font
  2238. \def\sc#1{{\smallcaps#1}} % smallcaps font
  2239. \def\ii#1{{\it #1}} % italic font
  2240. % @b, explicit bold. Also @strong.
  2241. \def\b#1{{\bf #1}}
  2242. \let\strong=\b
  2243. % @sansserif, explicit sans.
  2244. \def\sansserif#1{{\sf #1}}
  2245. % We can't just use \exhyphenpenalty, because that only has effect at
  2246. % the end of a paragraph. Restore normal hyphenation at the end of the
  2247. % group within which \nohyphenation is presumably called.
  2248. %
  2249. \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
  2250. \def\restorehyphenation{\hyphenchar\font = `- }
  2251. % Set sfcode to normal for the chars that usually have another value.
  2252. % Can't use plain's \frenchspacing because it uses the `\x notation, and
  2253. % sometimes \x has an active definition that messes things up.
  2254. %
  2255. \catcode`@=11
  2256. \def\plainfrenchspacing{%
  2257. \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m
  2258. \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m
  2259. \def\endofsentencespacefactor{1000}% for @. and friends
  2260. }
  2261. \def\plainnonfrenchspacing{%
  2262. \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000
  2263. \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250
  2264. \def\endofsentencespacefactor{3000}% for @. and friends
  2265. }
  2266. \catcode`@=\other
  2267. \def\endofsentencespacefactor{3000}% default
  2268. % @t, explicit typewriter.
  2269. \def\t#1{%
  2270. {\tt \rawbackslash \plainfrenchspacing #1}%
  2271. \null
  2272. }
  2273. % @samp.
  2274. \def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}}
  2275. % @indicateurl is \samp, that is, with quotes.
  2276. \let\indicateurl=\samp
  2277. % @code (and similar) prints in typewriter, but with spaces the same
  2278. % size as normal in the surrounding text, without hyphenation, etc.
  2279. % This is a subroutine for that.
  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 % reset spacefactor to 1000
  2299. }
  2300. % We *must* turn on hyphenation at `-' and `_' in @code.
  2301. % (But see \codedashfinish below.)
  2302. % Otherwise, it is too hard to avoid overfull hboxes
  2303. % in the Emacs manual, the Library manual, etc.
  2304. %
  2305. % Unfortunately, TeX uses one parameter (\hyphenchar) to control
  2306. % both hyphenation at - and hyphenation within words.
  2307. % We must therefore turn them both off (\tclose does that)
  2308. % and arrange explicitly to hyphenate at a dash. -- rms.
  2309. {
  2310. \catcode`\-=\active \catcode`\_=\active
  2311. \catcode`\'=\active \catcode`\`=\active
  2312. \global\let'=\rq \global\let`=\lq % default definitions
  2313. %
  2314. \global\def\code{\begingroup
  2315. \setupmarkupstyle{code}%
  2316. % The following should really be moved into \setupmarkupstyle handlers.
  2317. \catcode\dashChar=\active \catcode\underChar=\active
  2318. \ifallowcodebreaks
  2319. \let-\codedash
  2320. \let_\codeunder
  2321. \else
  2322. \let-\normaldash
  2323. \let_\realunder
  2324. \fi
  2325. % Given -foo (with a single dash), we do not want to allow a break
  2326. % after the hyphen.
  2327. \global\let\codedashprev=\codedash
  2328. %
  2329. \codex
  2330. }
  2331. %
  2332. \gdef\codedash{\futurelet\next\codedashfinish}
  2333. \gdef\codedashfinish{%
  2334. \normaldash % always output the dash character itself.
  2335. %
  2336. % Now, output a discretionary to allow a line break, unless
  2337. % (a) the next character is a -, or
  2338. % (b) the preceding character is a -.
  2339. % E.g., given --posix, we do not want to allow a break after either -.
  2340. % Given --foo-bar, we do want to allow a break between the - and the b.
  2341. \ifx\next\codedash \else
  2342. \ifx\codedashprev\codedash
  2343. \else \discretionary{}{}{}\fi
  2344. \fi
  2345. % we need the space after the = for the case when \next itself is a
  2346. % space token; it would get swallowed otherwise. As in @code{- a}.
  2347. \global\let\codedashprev= \next
  2348. }
  2349. }
  2350. \def\normaldash{-}
  2351. %
  2352. \def\codex #1{\tclose{#1}\endgroup}
  2353. \def\codeunder{%
  2354. % this is all so @math{@code{var_name}+1} can work. In math mode, _
  2355. % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
  2356. % will therefore expand the active definition of _, which is us
  2357. % (inside @code that is), therefore an endless loop.
  2358. \ifusingtt{\ifmmode
  2359. \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
  2360. \else\normalunderscore \fi
  2361. \discretionary{}{}{}}%
  2362. {\_}%
  2363. }
  2364. % An additional complication: the above will allow breaks after, e.g.,
  2365. % each of the four underscores in __typeof__. This is bad.
  2366. % @allowcodebreaks provides a document-level way to turn breaking at -
  2367. % and _ on and off.
  2368. %
  2369. \newif\ifallowcodebreaks \allowcodebreakstrue
  2370. \def\keywordtrue{true}
  2371. \def\keywordfalse{false}
  2372. \parseargdef\allowcodebreaks{%
  2373. \def\txiarg{#1}%
  2374. \ifx\txiarg\keywordtrue
  2375. \allowcodebreakstrue
  2376. \else\ifx\txiarg\keywordfalse
  2377. \allowcodebreaksfalse
  2378. \else
  2379. \errhelp = \EMsimple
  2380. \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}%
  2381. \fi\fi
  2382. }
  2383. % For @command, @env, @file, @option quotes seem unnecessary,
  2384. % so use \code rather than \samp.
  2385. \let\command=\code
  2386. \let\env=\code
  2387. \let\file=\code
  2388. \let\option=\code
  2389. % @uref (abbreviation for `urlref') aka @url takes an optional
  2390. % (comma-separated) second argument specifying the text to display and
  2391. % an optional third arg as text to display instead of (rather than in
  2392. % addition to) the url itself. First (mandatory) arg is the url.
  2393. % TeX-only option to allow changing PDF output to show only the second
  2394. % arg (if given), and not the url (which is then just the link target).
  2395. \newif\ifurefurlonlylink
  2396. % The main macro is \urefbreak, which allows breaking at expected
  2397. % places within the url. (There used to be another version, which
  2398. % didn't support automatic breaking.)
  2399. \def\urefbreak{\begingroup \urefcatcodes \dourefbreak}
  2400. \let\uref=\urefbreak
  2401. %
  2402. \def\dourefbreak#1{\urefbreakfinish #1,,,\finish}
  2403. \def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example
  2404. \unsepspaces
  2405. \pdfurl{#1}%
  2406. \setbox0 = \hbox{\ignorespaces #3}%
  2407. \ifdim\wd0 > 0pt
  2408. \unhbox0 % third arg given, show only that
  2409. \else
  2410. \setbox0 = \hbox{\ignorespaces #2}% look for second arg
  2411. \ifdim\wd0 > 0pt
  2412. \ifpdf
  2413. \ifurefurlonlylink
  2414. % PDF plus option to not display url, show just arg
  2415. \unhbox0
  2416. \else
  2417. % PDF, normally display both arg and url for consistency,
  2418. % visibility, if the pdf is eventually used to print, etc.
  2419. \unhbox0\ (\urefcode{#1})%
  2420. \fi
  2421. \else
  2422. \unhbox0\ (\urefcode{#1})% DVI, always show arg and url
  2423. \fi
  2424. \else
  2425. \urefcode{#1}% only url given, so show it
  2426. \fi
  2427. \fi
  2428. \endlink
  2429. \endgroup}
  2430. % Allow line breaks around only a few characters (only).
  2431. \def\urefcatcodes{%
  2432. \catcode\ampChar=\active \catcode\dotChar=\active
  2433. \catcode\hashChar=\active \catcode\questChar=\active
  2434. \catcode\slashChar=\active
  2435. }
  2436. {
  2437. \urefcatcodes
  2438. %
  2439. \global\def\urefcode{\begingroup
  2440. \setupmarkupstyle{code}%
  2441. \urefcatcodes
  2442. \let&\urefcodeamp
  2443. \let.\urefcodedot
  2444. \let#\urefcodehash
  2445. \let?\urefcodequest
  2446. \let/\urefcodeslash
  2447. \codex
  2448. }
  2449. %
  2450. % By default, they are just regular characters.
  2451. \global\def&{\normalamp}
  2452. \global\def.{\normaldot}
  2453. \global\def#{\normalhash}
  2454. \global\def?{\normalquest}
  2455. \global\def/{\normalslash}
  2456. }
  2457. % we put a little stretch before and after the breakable chars, to help
  2458. % line breaking of long url's. The unequal skips make look better in
  2459. % cmtt at least, especially for dots.
  2460. \def\urefprestretchamount{.13em}
  2461. \def\urefpoststretchamount{.1em}
  2462. \def\urefprestretch{\urefprebreak \hskip0pt plus\urefprestretchamount\relax}
  2463. \def\urefpoststretch{\urefpostbreak \hskip0pt plus\urefprestretchamount\relax}
  2464. %
  2465. \def\urefcodeamp{\urefprestretch \&\urefpoststretch}
  2466. \def\urefcodedot{\urefprestretch .\urefpoststretch}
  2467. \def\urefcodehash{\urefprestretch \#\urefpoststretch}
  2468. \def\urefcodequest{\urefprestretch ?\urefpoststretch}
  2469. \def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
  2470. {
  2471. \catcode`\/=\active
  2472. \global\def\urefcodeslashfinish{%
  2473. \urefprestretch \slashChar
  2474. % Allow line break only after the final / in a sequence of
  2475. % slashes, to avoid line break between the slashes in http://.
  2476. \ifx\next/\else \urefpoststretch \fi
  2477. }
  2478. }
  2479. % One more complication: by default we'll break after the special
  2480. % characters, but some people like to break before the special chars, so
  2481. % allow that. Also allow no breaking at all, for manual control.
  2482. %
  2483. \parseargdef\urefbreakstyle{%
  2484. \def\txiarg{#1}%
  2485. \ifx\txiarg\wordnone
  2486. \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
  2487. \else\ifx\txiarg\wordbefore
  2488. \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak}
  2489. \else\ifx\txiarg\wordafter
  2490. \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak}
  2491. \else
  2492. \errhelp = \EMsimple
  2493. \errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
  2494. \fi\fi\fi
  2495. }
  2496. \def\wordafter{after}
  2497. \def\wordbefore{before}
  2498. \def\wordnone{none}
  2499. \urefbreakstyle after
  2500. % @url synonym for @uref, since that's how everyone uses it.
  2501. %
  2502. \let\url=\uref
  2503. % rms does not like angle brackets --karl, 17may97.
  2504. % So now @email is just like @uref, unless we are pdf.
  2505. %
  2506. %\def\email#1{\angleleft{\tt #1}\angleright}
  2507. \ifpdf
  2508. \def\email#1{\doemail#1,,\finish}
  2509. \def\doemail#1,#2,#3\finish{\begingroup
  2510. \unsepspaces
  2511. \pdfurl{mailto:#1}%
  2512. \setbox0 = \hbox{\ignorespaces #2}%
  2513. \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
  2514. \endlink
  2515. \endgroup}
  2516. \else
  2517. \let\email=\uref
  2518. \fi
  2519. % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
  2520. % `example' (@kbd uses ttsl only inside of @example and friends),
  2521. % or `code' (@kbd uses normal tty font always).
  2522. \parseargdef\kbdinputstyle{%
  2523. \def\txiarg{#1}%
  2524. \ifx\txiarg\worddistinct
  2525. \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
  2526. \else\ifx\txiarg\wordexample
  2527. \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
  2528. \else\ifx\txiarg\wordcode
  2529. \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
  2530. \else
  2531. \errhelp = \EMsimple
  2532. \errmessage{Unknown @kbdinputstyle setting `\txiarg'}%
  2533. \fi\fi\fi
  2534. }
  2535. \def\worddistinct{distinct}
  2536. \def\wordexample{example}
  2537. \def\wordcode{code}
  2538. % Default is `distinct'.
  2539. \kbdinputstyle distinct
  2540. % @kbd is like @code, except that if the argument is just one @key command,
  2541. % then @kbd has no effect.
  2542. \def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}}
  2543. \def\xkey{\key}
  2544. \def\kbdsub#1#2#3\par{%
  2545. \def\one{#1}\def\three{#3}\def\threex{??}%
  2546. \ifx\one\xkey\ifx\threex\three \key{#2}%
  2547. \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
  2548. \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
  2549. }
  2550. % definition of @key that produces a lozenge. Doesn't adjust to text size.
  2551. %\setfont\keyrm\rmshape{8}{1000}{OT1}
  2552. %\font\keysy=cmsy9
  2553. %\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
  2554. % \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
  2555. % \vbox{\hrule\kern-0.4pt
  2556. % \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
  2557. % \kern-0.4pt\hrule}%
  2558. % \kern-.06em\raise0.4pt\hbox{\angleright}}}}
  2559. % definition of @key with no lozenge. If the current font is already
  2560. % monospace, don't change it; that way, we respect @kbdinputstyle. But
  2561. % if it isn't monospace, then use \tt.
  2562. %
  2563. \def\key#1{{\setupmarkupstyle{key}%
  2564. \nohyphenation
  2565. \ifmonospace\else\tt\fi
  2566. #1}\null}
  2567. % @clicksequence{File @click{} Open ...}
  2568. \def\clicksequence#1{\begingroup #1\endgroup}
  2569. % @clickstyle @arrow (by default)
  2570. \parseargdef\clickstyle{\def\click{#1}}
  2571. \def\click{\arrow}
  2572. % Typeset a dimension, e.g., `in' or `pt'. The only reason for the
  2573. % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
  2574. %
  2575. \def\dmn#1{\thinspace #1}
  2576. % @l was never documented to mean ``switch to the Lisp font'',
  2577. % and it is not used as such in any manual I can find. We need it for
  2578. % Polish suppressed-l. --karl, 22sep96.
  2579. %\def\l#1{{\li #1}\null}
  2580. % @acronym for "FBI", "NATO", and the like.
  2581. % We print this one point size smaller, since it's intended for
  2582. % all-uppercase.
  2583. %
  2584. \def\acronym#1{\doacronym #1,,\finish}
  2585. \def\doacronym#1,#2,#3\finish{%
  2586. {\selectfonts\lsize #1}%
  2587. \def\temp{#2}%
  2588. \ifx\temp\empty \else
  2589. \space ({\unsepspaces \ignorespaces \temp \unskip})%
  2590. \fi
  2591. \null % reset \spacefactor=1000
  2592. }
  2593. % @abbr for "Comput. J." and the like.
  2594. % No font change, but don't do end-of-sentence spacing.
  2595. %
  2596. \def\abbr#1{\doabbr #1,,\finish}
  2597. \def\doabbr#1,#2,#3\finish{%
  2598. {\plainfrenchspacing #1}%
  2599. \def\temp{#2}%
  2600. \ifx\temp\empty \else
  2601. \space ({\unsepspaces \ignorespaces \temp \unskip})%
  2602. \fi
  2603. \null % reset \spacefactor=1000
  2604. }
  2605. % @asis just yields its argument. Used with @table, for example.
  2606. %
  2607. \def\asis#1{#1}
  2608. % @math outputs its argument in math mode.
  2609. %
  2610. % One complication: _ usually means subscripts, but it could also mean
  2611. % an actual _ character, as in @math{@var{some_variable} + 1}. So make
  2612. % _ active, and distinguish by seeing if the current family is \slfam,
  2613. % which is what @var uses.
  2614. {
  2615. \catcode`\_ = \active
  2616. \gdef\mathunderscore{%
  2617. \catcode`\_=\active
  2618. \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
  2619. }
  2620. }
  2621. % Another complication: we want \\ (and @\) to output a math (or tt) \.
  2622. % FYI, plain.tex uses \\ as a temporary control sequence (for no
  2623. % particular reason), but this is not advertised and we don't care.
  2624. %
  2625. % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
  2626. \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
  2627. %
  2628. \def\math{%
  2629. \tex
  2630. \mathunderscore
  2631. \let\\ = \mathbackslash
  2632. \mathactive
  2633. % make the texinfo accent commands work in math mode
  2634. \let\"=\ddot
  2635. \let\'=\acute
  2636. \let\==\bar
  2637. \let\^=\hat
  2638. \let\`=\grave
  2639. \let\u=\breve
  2640. \let\v=\check
  2641. \let\~=\tilde
  2642. \let\dotaccent=\dot
  2643. % have to provide another name for sup operator
  2644. \let\mathopsup=\sup
  2645. $\finishmath
  2646. }
  2647. \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
  2648. % Some active characters (such as <) are spaced differently in math.
  2649. % We have to reset their definitions in case the @math was an argument
  2650. % to a command which sets the catcodes (such as @item or @section).
  2651. %
  2652. {
  2653. \catcode`^ = \active
  2654. \catcode`< = \active
  2655. \catcode`> = \active
  2656. \catcode`+ = \active
  2657. \catcode`' = \active
  2658. \gdef\mathactive{%
  2659. \let^ = \ptexhat
  2660. \let< = \ptexless
  2661. \let> = \ptexgtr
  2662. \let+ = \ptexplus
  2663. \let' = \ptexquoteright
  2664. }
  2665. }
  2666. % for @sub and @sup, if in math mode, just do a normal sub/superscript.
  2667. % If in text, use math to place as sub/superscript, but switch
  2668. % into text mode, with smaller fonts. This is a different font than the
  2669. % one used for real math sub/superscripts (8pt vs. 7pt), but let's not
  2670. % fix it (significant additions to font machinery) until someone notices.
  2671. %
  2672. \def\sub{\ifmmode \expandafter\sb \else \expandafter\finishsub\fi}
  2673. \def\finishsub#1{$\sb{\hbox{\selectfonts\lllsize #1}}$}%
  2674. %
  2675. \def\sup{\ifmmode \expandafter\ptexsp \else \expandafter\finishsup\fi}
  2676. \def\finishsup#1{$\ptexsp{\hbox{\selectfonts\lllsize #1}}$}%
  2677. % ctrl is no longer a Texinfo command, but leave this definition for fun.
  2678. \def\ctrl #1{{\tt \rawbackslash \hat}#1}
  2679. % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
  2680. % Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
  2681. % except specified as a normal braced arg, so no newlines to worry about.
  2682. %
  2683. \def\outfmtnametex{tex}
  2684. %
  2685. \long\def\inlinefmt#1{\doinlinefmt #1,\finish}
  2686. \long\def\doinlinefmt#1,#2,\finish{%
  2687. \def\inlinefmtname{#1}%
  2688. \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
  2689. }
  2690. %
  2691. % @inlinefmtifelse{FMTNAME,THEN-TEXT,ELSE-TEXT} expands THEN-TEXT if
  2692. % FMTNAME is tex, else ELSE-TEXT.
  2693. \long\def\inlinefmtifelse#1{\doinlinefmtifelse #1,,,\finish}
  2694. \long\def\doinlinefmtifelse#1,#2,#3,#4,\finish{%
  2695. \def\inlinefmtname{#1}%
  2696. \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\else \ignorespaces #3\fi
  2697. }
  2698. %
  2699. % For raw, must switch into @tex before parsing the argument, to avoid
  2700. % setting catcodes prematurely. Doing it this way means that, for
  2701. % example, @inlineraw{html, foo{bar} gets a parse error instead of being
  2702. % ignored. But this isn't important because if people want a literal
  2703. % *right* brace they would have to use a command anyway, so they may as
  2704. % well use a command to get a left brace too. We could re-use the
  2705. % delimiter character idea from \verb, but it seems like overkill.
  2706. %
  2707. \long\def\inlineraw{\tex \doinlineraw}
  2708. \long\def\doinlineraw#1{\doinlinerawtwo #1,\finish}
  2709. \def\doinlinerawtwo#1,#2,\finish{%
  2710. \def\inlinerawname{#1}%
  2711. \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi
  2712. \endgroup % close group opened by \tex.
  2713. }
  2714. % @inlineifset{VAR, TEXT} expands TEXT if VAR is @set.
  2715. %
  2716. \long\def\inlineifset#1{\doinlineifset #1,\finish}
  2717. \long\def\doinlineifset#1,#2,\finish{%
  2718. \def\inlinevarname{#1}%
  2719. \expandafter\ifx\csname SET\inlinevarname\endcsname\relax
  2720. \else\ignorespaces#2\fi
  2721. }
  2722. % @inlineifclear{VAR, TEXT} expands TEXT if VAR is not @set.
  2723. %
  2724. \long\def\inlineifclear#1{\doinlineifclear #1,\finish}
  2725. \long\def\doinlineifclear#1,#2,\finish{%
  2726. \def\inlinevarname{#1}%
  2727. \expandafter\ifx\csname SET\inlinevarname\endcsname\relax \ignorespaces#2\fi
  2728. }
  2729. \message{glyphs,}
  2730. % and logos.
  2731. % @@ prints an @, as does @atchar{}.
  2732. \def\@{\char64 }
  2733. \let\atchar=\@
  2734. % @{ @} @lbracechar{} @rbracechar{} all generate brace characters.
  2735. % Unless we're in typewriter, use \ecfont because the CM text fonts do
  2736. % not have braces, and we don't want to switch into math.
  2737. \def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}}
  2738. \def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}}
  2739. \let\{=\mylbrace \let\lbracechar=\{
  2740. \let\}=\myrbrace \let\rbracechar=\}
  2741. \begingroup
  2742. % Definitions to produce \{ and \} commands for indices,
  2743. % and @{ and @} for the aux/toc files.
  2744. \catcode`\{ = \other \catcode`\} = \other
  2745. \catcode`\[ = 1 \catcode`\] = 2
  2746. \catcode`\! = 0 \catcode`\\ = \other
  2747. !gdef!lbracecmd[\{]%
  2748. !gdef!rbracecmd[\}]%
  2749. !gdef!lbraceatcmd[@{]%
  2750. !gdef!rbraceatcmd[@}]%
  2751. !endgroup
  2752. % @comma{} to avoid , parsing problems.
  2753. \let\comma = ,
  2754. % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
  2755. % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
  2756. \let\, = \ptexc
  2757. \let\dotaccent = \ptexdot
  2758. \def\ringaccent#1{{\accent23 #1}}
  2759. \let\tieaccent = \ptext
  2760. \let\ubaraccent = \ptexb
  2761. \let\udotaccent = \d
  2762. % Other special characters: @questiondown @exclamdown @ordf @ordm
  2763. % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
  2764. \def\questiondown{?`}
  2765. \def\exclamdown{!`}
  2766. \def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
  2767. \def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
  2768. % Dotless i and dotless j, used for accents.
  2769. \def\imacro{i}
  2770. \def\jmacro{j}
  2771. \def\dotless#1{%
  2772. \def\temp{#1}%
  2773. \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
  2774. \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
  2775. \else \errmessage{@dotless can be used only with i or j}%
  2776. \fi\fi
  2777. }
  2778. % The \TeX{} logo, as in plain, but resetting the spacing so that a
  2779. % period following counts as ending a sentence. (Idea found in latex.)
  2780. %
  2781. \edef\TeX{\TeX \spacefactor=1000 }
  2782. % @LaTeX{} logo. Not quite the same results as the definition in
  2783. % latex.ltx, since we use a different font for the raised A; it's most
  2784. % convenient for us to use an explicitly smaller font, rather than using
  2785. % the \scriptstyle font (since we don't reset \scriptstyle and
  2786. % \scriptscriptstyle).
  2787. %
  2788. \def\LaTeX{%
  2789. L\kern-.36em
  2790. {\setbox0=\hbox{T}%
  2791. \vbox to \ht0{\hbox{%
  2792. \ifx\textnominalsize\xwordpt
  2793. % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX.
  2794. % Revert to plain's \scriptsize, which is 7pt.
  2795. \count255=\the\fam $\fam\count255 \scriptstyle A$%
  2796. \else
  2797. % For 11pt, we can use our lllsize.
  2798. \selectfonts\lllsize A%
  2799. \fi
  2800. }%
  2801. \vss
  2802. }}%
  2803. \kern-.15em
  2804. \TeX
  2805. }
  2806. % Some math mode symbols.
  2807. \def\bullet{$\ptexbullet$}
  2808. \def\geq{\ifmmode \ge\else $\ge$\fi}
  2809. \def\leq{\ifmmode \le\else $\le$\fi}
  2810. \def\minus{\ifmmode -\else $-$\fi}
  2811. % @dots{} outputs an ellipsis using the current font.
  2812. % We do .5em per period so that it has the same spacing in the cm
  2813. % typewriter fonts as three actual period characters; on the other hand,
  2814. % in other typewriter fonts three periods are wider than 1.5em. So do
  2815. % whichever is larger.
  2816. %
  2817. \def\dots{%
  2818. \leavevmode
  2819. \setbox0=\hbox{...}% get width of three periods
  2820. \ifdim\wd0 > 1.5em
  2821. \dimen0 = \wd0
  2822. \else
  2823. \dimen0 = 1.5em
  2824. \fi
  2825. \hbox to \dimen0{%
  2826. \hskip 0pt plus.25fil
  2827. .\hskip 0pt plus1fil
  2828. .\hskip 0pt plus1fil
  2829. .\hskip 0pt plus.5fil
  2830. }%
  2831. }
  2832. % @enddots{} is an end-of-sentence ellipsis.
  2833. %
  2834. \def\enddots{%
  2835. \dots
  2836. \spacefactor=\endofsentencespacefactor
  2837. }
  2838. % @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
  2839. %
  2840. % Since these characters are used in examples, they should be an even number of
  2841. % \tt widths. Each \tt character is 1en, so two makes it 1em.
  2842. %
  2843. \def\point{$\star$}
  2844. \def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}}
  2845. \def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
  2846. \def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}}
  2847. \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
  2848. \def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}}
  2849. % The @error{} command.
  2850. % Adapted from the TeXbook's \boxit.
  2851. %
  2852. \newbox\errorbox
  2853. %
  2854. {\tentt \global\dimen0 = 3em}% Width of the box.
  2855. \dimen2 = .55pt % Thickness of rules
  2856. % The text. (`r' is open on the right, `e' somewhat less so on the left.)
  2857. \setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt}
  2858. %
  2859. \setbox\errorbox=\hbox to \dimen0{\hfil
  2860. \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
  2861. \advance\hsize by -2\dimen2 % Rules.
  2862. \vbox{%
  2863. \hrule height\dimen2
  2864. \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
  2865. \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
  2866. \kern3pt\vrule width\dimen2}% Space to right.
  2867. \hrule height\dimen2}
  2868. \hfil}
  2869. %
  2870. \def\error{\leavevmode\lower.7ex\copy\errorbox}
  2871. % @pounds{} is a sterling sign, which Knuth put in the CM italic font.
  2872. %
  2873. \def\pounds{{\it\$}}
  2874. % @euro{} comes from a separate font, depending on the current style.
  2875. % We use the free feym* fonts from the eurosym package by Henrik
  2876. % Theiling, which support regular, slanted, bold and bold slanted (and
  2877. % "outlined" (blackboard board, sort of) versions, which we don't need).
  2878. % It is available from http://www.ctan.org/tex-archive/fonts/eurosym.
  2879. %
  2880. % Although only regular is the truly official Euro symbol, we ignore
  2881. % that. The Euro is designed to be slightly taller than the regular
  2882. % font height.
  2883. %
  2884. % feymr - regular
  2885. % feymo - slanted
  2886. % feybr - bold
  2887. % feybo - bold slanted
  2888. %
  2889. % There is no good (free) typewriter version, to my knowledge.
  2890. % A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
  2891. % Hmm.
  2892. %
  2893. % Also doesn't work in math. Do we need to do math with euro symbols?
  2894. % Hope not.
  2895. %
  2896. %
  2897. \def\euro{{\eurofont e}}
  2898. \def\eurofont{%
  2899. % We set the font at each command, rather than predefining it in
  2900. % \textfonts and the other font-switching commands, so that
  2901. % installations which never need the symbol don't have to have the
  2902. % font installed.
  2903. %
  2904. % There is only one designed size (nominal 10pt), so we always scale
  2905. % that to the current nominal size.
  2906. %
  2907. % By the way, simply using "at 1em" works for cmr10 and the like, but
  2908. % does not work for cmbx10 and other extended/shrunken fonts.
  2909. %
  2910. \def\eurosize{\csname\curfontsize nominalsize\endcsname}%
  2911. %
  2912. \ifx\curfontstyle\bfstylename
  2913. % bold:
  2914. \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
  2915. \else
  2916. % regular:
  2917. \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
  2918. \fi
  2919. \thiseurofont
  2920. }
  2921. % Glyphs from the EC fonts. We don't use \let for the aliases, because
  2922. % sometimes we redefine the original macro, and the alias should reflect
  2923. % the redefinition.
  2924. %
  2925. % Use LaTeX names for the Icelandic letters.
  2926. \def\DH{{\ecfont \char"D0}} % Eth
  2927. \def\dh{{\ecfont \char"F0}} % eth
  2928. \def\TH{{\ecfont \char"DE}} % Thorn
  2929. \def\th{{\ecfont \char"FE}} % thorn
  2930. %
  2931. \def\guillemetleft{{\ecfont \char"13}}
  2932. \def\guillemotleft{\guillemetleft}
  2933. \def\guillemetright{{\ecfont \char"14}}
  2934. \def\guillemotright{\guillemetright}
  2935. \def\guilsinglleft{{\ecfont \char"0E}}
  2936. \def\guilsinglright{{\ecfont \char"0F}}
  2937. \def\quotedblbase{{\ecfont \char"12}}
  2938. \def\quotesinglbase{{\ecfont \char"0D}}
  2939. %
  2940. % This positioning is not perfect (see the ogonek LaTeX package), but
  2941. % we have the precomposed glyphs for the most common cases. We put the
  2942. % tests to use those glyphs in the single \ogonek macro so we have fewer
  2943. % dummy definitions to worry about for index entries, etc.
  2944. %
  2945. % ogonek is also used with other letters in Lithuanian (IOU), but using
  2946. % the precomposed glyphs for those is not so easy since they aren't in
  2947. % the same EC font.
  2948. \def\ogonek#1{{%
  2949. \def\temp{#1}%
  2950. \ifx\temp\macrocharA\Aogonek
  2951. \else\ifx\temp\macrochara\aogonek
  2952. \else\ifx\temp\macrocharE\Eogonek
  2953. \else\ifx\temp\macrochare\eogonek
  2954. \else
  2955. \ecfont \setbox0=\hbox{#1}%
  2956. \ifdim\ht0=1ex\accent"0C #1%
  2957. \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}%
  2958. \fi
  2959. \fi\fi\fi\fi
  2960. }%
  2961. }
  2962. \def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A}
  2963. \def\aogonek{{\ecfont \char"A1}}\def\macrochara{a}
  2964. \def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E}
  2965. \def\eogonek{{\ecfont \char"A6}}\def\macrochare{e}
  2966. %
  2967. % Use the ec* fonts (cm-super in outline format) for non-CM glyphs.
  2968. \def\ecfont{%
  2969. % We can't distinguish serif/sans and italic/slanted, but this
  2970. % is used for crude hacks anyway (like adding French and German
  2971. % quotes to documents typeset with CM, where we lose kerning), so
  2972. % hopefully nobody will notice/care.
  2973. \edef\ecsize{\csname\curfontsize ecsize\endcsname}%
  2974. \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
  2975. \ifmonospace
  2976. % typewriter:
  2977. \font\thisecfont = ectt\ecsize \space at \nominalsize
  2978. \else
  2979. \ifx\curfontstyle\bfstylename
  2980. % bold:
  2981. \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize
  2982. \else
  2983. % regular:
  2984. \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize
  2985. \fi
  2986. \fi
  2987. \thisecfont
  2988. }
  2989. % @registeredsymbol - R in a circle. The font for the R should really
  2990. % be smaller yet, but lllsize is the best we can do for now.
  2991. % Adapted from the plain.tex definition of \copyright.
  2992. %
  2993. \def\registeredsymbol{%
  2994. $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}%
  2995. \hfil\crcr\Orb}}%
  2996. }$%
  2997. }
  2998. % @textdegree - the normal degrees sign.
  2999. %
  3000. \def\textdegree{$^\circ$}
  3001. % Laurent Siebenmann reports \Orb undefined with:
  3002. % Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38
  3003. % so we'll define it if necessary.
  3004. %
  3005. \ifx\Orb\thisisundefined
  3006. \def\Orb{\mathhexbox20D}
  3007. \fi
  3008. % Quotes.
  3009. \chardef\quotedblleft="5C
  3010. \chardef\quotedblright=`\"
  3011. \chardef\quoteleft=`\`
  3012. \chardef\quoteright=`\'
  3013. \message{page headings,}
  3014. \newskip\titlepagetopglue \titlepagetopglue = 1.5in
  3015. \newskip\titlepagebottomglue \titlepagebottomglue = 2pc
  3016. % First the title page. Must do @settitle before @titlepage.
  3017. \newif\ifseenauthor
  3018. \newif\iffinishedtitlepage
  3019. % Do an implicit @contents or @shortcontents after @end titlepage if the
  3020. % user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
  3021. %
  3022. \newif\ifsetcontentsaftertitlepage
  3023. \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
  3024. \newif\ifsetshortcontentsaftertitlepage
  3025. \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
  3026. \parseargdef\shorttitlepage{%
  3027. \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
  3028. \endgroup\page\hbox{}\page}
  3029. \envdef\titlepage{%
  3030. % Open one extra group, as we want to close it in the middle of \Etitlepage.
  3031. \begingroup
  3032. \parindent=0pt \textfonts
  3033. % Leave some space at the very top of the page.
  3034. \vglue\titlepagetopglue
  3035. % No rule at page bottom unless we print one at the top with @title.
  3036. \finishedtitlepagetrue
  3037. %
  3038. % Most title ``pages'' are actually two pages long, with space
  3039. % at the top of the second. We don't want the ragged left on the second.
  3040. \let\oldpage = \page
  3041. \def\page{%
  3042. \iffinishedtitlepage\else
  3043. \finishtitlepage
  3044. \fi
  3045. \let\page = \oldpage
  3046. \page
  3047. \null
  3048. }%
  3049. }
  3050. \def\Etitlepage{%
  3051. \iffinishedtitlepage\else
  3052. \finishtitlepage
  3053. \fi
  3054. % It is important to do the page break before ending the group,
  3055. % because the headline and footline are only empty inside the group.
  3056. % If we use the new definition of \page, we always get a blank page
  3057. % after the title page, which we certainly don't want.
  3058. \oldpage
  3059. \endgroup
  3060. %
  3061. % Need this before the \...aftertitlepage checks so that if they are
  3062. % in effect the toc pages will come out with page numbers.
  3063. \HEADINGSon
  3064. %
  3065. % If they want short, they certainly want long too.
  3066. \ifsetshortcontentsaftertitlepage
  3067. \shortcontents
  3068. \contents
  3069. \global\let\shortcontents = \relax
  3070. \global\let\contents = \relax
  3071. \fi
  3072. %
  3073. \ifsetcontentsaftertitlepage
  3074. \contents
  3075. \global\let\contents = \relax
  3076. \global\let\shortcontents = \relax
  3077. \fi
  3078. }
  3079. \def\finishtitlepage{%
  3080. \vskip4pt \hrule height 2pt width \hsize
  3081. \vskip\titlepagebottomglue
  3082. \finishedtitlepagetrue
  3083. }
  3084. % Settings used for typesetting titles: no hyphenation, no indentation,
  3085. % don't worry much about spacing, ragged right. This should be used
  3086. % inside a \vbox, and fonts need to be set appropriately first. Because
  3087. % it is always used for titles, nothing else, we call \rmisbold. \par
  3088. % should be specified before the end of the \vbox, since a vbox is a group.
  3089. %
  3090. \def\raggedtitlesettings{%
  3091. \rmisbold
  3092. \hyphenpenalty=10000
  3093. \parindent=0pt
  3094. \tolerance=5000
  3095. \ptexraggedright
  3096. }
  3097. % Macros to be used within @titlepage:
  3098. \let\subtitlerm=\tenrm
  3099. \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
  3100. \parseargdef\title{%
  3101. \checkenv\titlepage
  3102. \vbox{\titlefonts \raggedtitlesettings #1\par}%
  3103. % print a rule at the page bottom also.
  3104. \finishedtitlepagefalse
  3105. \vskip4pt \hrule height 4pt width \hsize \vskip4pt
  3106. }
  3107. \parseargdef\subtitle{%
  3108. \checkenv\titlepage
  3109. {\subtitlefont \rightline{#1}}%
  3110. }
  3111. % @author should come last, but may come many times.
  3112. % It can also be used inside @quotation.
  3113. %
  3114. \parseargdef\author{%
  3115. \def\temp{\quotation}%
  3116. \ifx\thisenv\temp
  3117. \def\quotationauthor{#1}% printed in \Equotation.
  3118. \else
  3119. \checkenv\titlepage
  3120. \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
  3121. {\secfonts\rmisbold \leftline{#1}}%
  3122. \fi
  3123. }
  3124. % Set up page headings and footings.
  3125. \let\thispage=\folio
  3126. \newtoks\evenheadline % headline on even pages
  3127. \newtoks\oddheadline % headline on odd pages
  3128. \newtoks\evenfootline % footline on even pages
  3129. \newtoks\oddfootline % footline on odd pages
  3130. % Now make TeX use those variables
  3131. \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
  3132. \else \the\evenheadline \fi}}
  3133. \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
  3134. \else \the\evenfootline \fi}\HEADINGShook}
  3135. \let\HEADINGShook=\relax
  3136. % Commands to set those variables.
  3137. % For example, this is what @headings on does
  3138. % @evenheading @thistitle|@thispage|@thischapter
  3139. % @oddheading @thischapter|@thispage|@thistitle
  3140. % @evenfooting @thisfile||
  3141. % @oddfooting ||@thisfile
  3142. \def\evenheading{\parsearg\evenheadingxxx}
  3143. \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
  3144. \def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
  3145. \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  3146. \def\oddheading{\parsearg\oddheadingxxx}
  3147. \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
  3148. \def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
  3149. \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  3150. \parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
  3151. \def\evenfooting{\parsearg\evenfootingxxx}
  3152. \def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}
  3153. \def\evenfootingyyy #1\|#2\|#3\|#4\finish{%
  3154. \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  3155. \def\oddfooting{\parsearg\oddfootingxxx}
  3156. \def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}
  3157. \def\oddfootingyyy #1\|#2\|#3\|#4\finish{%
  3158. \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
  3159. %
  3160. % Leave some space for the footline. Hopefully ok to assume
  3161. % @evenfooting will not be used by itself.
  3162. \global\advance\pageheight by -12pt
  3163. \global\advance\vsize by -12pt
  3164. }
  3165. \parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
  3166. % @evenheadingmarks top \thischapter <- chapter at the top of a page
  3167. % @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page
  3168. %
  3169. % The same set of arguments for:
  3170. %
  3171. % @oddheadingmarks
  3172. % @evenfootingmarks
  3173. % @oddfootingmarks
  3174. % @everyheadingmarks
  3175. % @everyfootingmarks
  3176. \def\evenheadingmarks{\headingmarks{even}{heading}}
  3177. \def\oddheadingmarks{\headingmarks{odd}{heading}}
  3178. \def\evenfootingmarks{\headingmarks{even}{footing}}
  3179. \def\oddfootingmarks{\headingmarks{odd}{footing}}
  3180. \def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1}
  3181. \headingmarks{odd}{heading}{#1} }
  3182. \def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1}
  3183. \headingmarks{odd}{footing}{#1} }
  3184. % #1 = even/odd, #2 = heading/footing, #3 = top/bottom.
  3185. \def\headingmarks#1#2#3 {%
  3186. \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname
  3187. \global\expandafter\let\csname get#1#2marks\endcsname \temp
  3188. }
  3189. \everyheadingmarks bottom
  3190. \everyfootingmarks bottom
  3191. % @headings double turns headings on for double-sided printing.
  3192. % @headings single turns headings on for single-sided printing.
  3193. % @headings off turns them off.
  3194. % @headings on same as @headings double, retained for compatibility.
  3195. % @headings after turns on double-sided headings after this page.
  3196. % @headings doubleafter turns on double-sided headings after this page.
  3197. % @headings singleafter turns on single-sided headings after this page.
  3198. % By default, they are off at the start of a document,
  3199. % and turned `on' after @end titlepage.
  3200. \def\headings #1 {\csname HEADINGS#1\endcsname}
  3201. \def\headingsoff{% non-global headings elimination
  3202. \evenheadline={\hfil}\evenfootline={\hfil}%
  3203. \oddheadline={\hfil}\oddfootline={\hfil}%
  3204. }
  3205. \def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
  3206. \HEADINGSoff % it's the default
  3207. % When we turn headings on, set the page number to 1.
  3208. % For double-sided printing, put current file name in lower left corner,
  3209. % chapter name on inside top of right hand pages, document
  3210. % title on inside top of left hand pages, and page numbers on outside top
  3211. % edge of all pages.
  3212. \def\HEADINGSdouble{%
  3213. \global\pageno=1
  3214. \global\evenfootline={\hfil}
  3215. \global\oddfootline={\hfil}
  3216. \global\evenheadline={\line{\folio\hfil\thistitle}}
  3217. \global\oddheadline={\line{\thischapter\hfil\folio}}
  3218. \global\let\contentsalignmacro = \chapoddpage
  3219. }
  3220. \let\contentsalignmacro = \chappager
  3221. % For single-sided printing, chapter title goes across top left of page,
  3222. % page number on top right.
  3223. \def\HEADINGSsingle{%
  3224. \global\pageno=1
  3225. \global\evenfootline={\hfil}
  3226. \global\oddfootline={\hfil}
  3227. \global\evenheadline={\line{\thischapter\hfil\folio}}
  3228. \global\oddheadline={\line{\thischapter\hfil\folio}}
  3229. \global\let\contentsalignmacro = \chappager
  3230. }
  3231. \def\HEADINGSon{\HEADINGSdouble}
  3232. \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
  3233. \let\HEADINGSdoubleafter=\HEADINGSafter
  3234. \def\HEADINGSdoublex{%
  3235. \global\evenfootline={\hfil}
  3236. \global\oddfootline={\hfil}
  3237. \global\evenheadline={\line{\folio\hfil\thistitle}}
  3238. \global\oddheadline={\line{\thischapter\hfil\folio}}
  3239. \global\let\contentsalignmacro = \chapoddpage
  3240. }
  3241. \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
  3242. \def\HEADINGSsinglex{%
  3243. \global\evenfootline={\hfil}
  3244. \global\oddfootline={\hfil}
  3245. \global\evenheadline={\line{\thischapter\hfil\folio}}
  3246. \global\oddheadline={\line{\thischapter\hfil\folio}}
  3247. \global\let\contentsalignmacro = \chappager
  3248. }
  3249. % Subroutines used in generating headings
  3250. % This produces Day Month Year style of output.
  3251. % Only define if not already defined, in case a txi-??.tex file has set
  3252. % up a different format (e.g., txi-cs.tex does this).
  3253. \ifx\today\thisisundefined
  3254. \def\today{%
  3255. \number\day\space
  3256. \ifcase\month
  3257. \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
  3258. \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
  3259. \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
  3260. \fi
  3261. \space\number\year}
  3262. \fi
  3263. % @settitle line... specifies the title of the document, for headings.
  3264. % It generates no output of its own.
  3265. \def\thistitle{\putwordNoTitle}
  3266. \def\settitle{\parsearg{\gdef\thistitle}}
  3267. \message{tables,}
  3268. % Tables -- @table, @ftable, @vtable, @item(x).
  3269. % default indentation of table text
  3270. \newdimen\tableindent \tableindent=.8in
  3271. % default indentation of @itemize and @enumerate text
  3272. \newdimen\itemindent \itemindent=.3in
  3273. % margin between end of table item and start of table text.
  3274. \newdimen\itemmargin \itemmargin=.1in
  3275. % used internally for \itemindent minus \itemmargin
  3276. \newdimen\itemmax
  3277. % Note @table, @ftable, and @vtable define @item, @itemx, etc., with
  3278. % these defs.
  3279. % They also define \itemindex
  3280. % to index the item name in whatever manner is desired (perhaps none).
  3281. \newif\ifitemxneedsnegativevskip
  3282. \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
  3283. \def\internalBitem{\smallbreak \parsearg\itemzzz}
  3284. \def\internalBitemx{\itemxpar \parsearg\itemzzz}
  3285. \def\itemzzz #1{\begingroup %
  3286. \advance\hsize by -\rightskip
  3287. \advance\hsize by -\tableindent
  3288. \setbox0=\hbox{\itemindicate{#1}}%
  3289. \itemindex{#1}%
  3290. \nobreak % This prevents a break before @itemx.
  3291. %
  3292. % If the item text does not fit in the space we have, put it on a line
  3293. % by itself, and do not allow a page break either before or after that
  3294. % line. We do not start a paragraph here because then if the next
  3295. % command is, e.g., @kindex, the whatsit would get put into the
  3296. % horizontal list on a line by itself, resulting in extra blank space.
  3297. \ifdim \wd0>\itemmax
  3298. %
  3299. % Make this a paragraph so we get the \parskip glue and wrapping,
  3300. % but leave it ragged-right.
  3301. \begingroup
  3302. \advance\leftskip by-\tableindent
  3303. \advance\hsize by\tableindent
  3304. \advance\rightskip by0pt plus1fil\relax
  3305. \leavevmode\unhbox0\par
  3306. \endgroup
  3307. %
  3308. % We're going to be starting a paragraph, but we don't want the
  3309. % \parskip glue -- logically it's part of the @item we just started.
  3310. \nobreak \vskip-\parskip
  3311. %
  3312. % Stop a page break at the \parskip glue coming up. However, if
  3313. % what follows is an environment such as @example, there will be no
  3314. % \parskip glue; then the negative vskip we just inserted would
  3315. % cause the example and the item to crash together. So we use this
  3316. % bizarre value of 10001 as a signal to \aboveenvbreak to insert
  3317. % \parskip glue after all. Section titles are handled this way also.
  3318. %
  3319. \penalty 10001
  3320. \endgroup
  3321. \itemxneedsnegativevskipfalse
  3322. \else
  3323. % The item text fits into the space. Start a paragraph, so that the
  3324. % following text (if any) will end up on the same line.
  3325. \noindent
  3326. % Do this with kerns and \unhbox so that if there is a footnote in
  3327. % the item text, it can migrate to the main vertical list and
  3328. % eventually be printed.
  3329. \nobreak\kern-\tableindent
  3330. \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
  3331. \unhbox0
  3332. \nobreak\kern\dimen0
  3333. \endgroup
  3334. \itemxneedsnegativevskiptrue
  3335. \fi
  3336. }
  3337. \def\item{\errmessage{@item while not in a list environment}}
  3338. \def\itemx{\errmessage{@itemx while not in a list environment}}
  3339. % @table, @ftable, @vtable.
  3340. \envdef\table{%
  3341. \let\itemindex\gobble
  3342. \tablecheck{table}%
  3343. }
  3344. \envdef\ftable{%
  3345. \def\itemindex ##1{\doind {fn}{\code{##1}}}%
  3346. \tablecheck{ftable}%
  3347. }
  3348. \envdef\vtable{%
  3349. \def\itemindex ##1{\doind {vr}{\code{##1}}}%
  3350. \tablecheck{vtable}%
  3351. }
  3352. \def\tablecheck#1{%
  3353. \ifnum \the\catcode`\^^M=\active
  3354. \endgroup
  3355. \errmessage{This command won't work in this context; perhaps the problem is
  3356. that we are \inenvironment\thisenv}%
  3357. \def\next{\doignore{#1}}%
  3358. \else
  3359. \let\next\tablex
  3360. \fi
  3361. \next
  3362. }
  3363. \def\tablex#1{%
  3364. \def\itemindicate{#1}%
  3365. \parsearg\tabley
  3366. }
  3367. \def\tabley#1{%
  3368. {%
  3369. \makevalueexpandable
  3370. \edef\temp{\noexpand\tablez #1\space\space\space}%
  3371. \expandafter
  3372. }\temp \endtablez
  3373. }
  3374. \def\tablez #1 #2 #3 #4\endtablez{%
  3375. \aboveenvbreak
  3376. \ifnum 0#1>0 \advance \leftskip by #1\mil \fi
  3377. \ifnum 0#2>0 \tableindent=#2\mil \fi
  3378. \ifnum 0#3>0 \advance \rightskip by #3\mil \fi
  3379. \itemmax=\tableindent
  3380. \advance \itemmax by -\itemmargin
  3381. \advance \leftskip by \tableindent
  3382. \exdentamount=\tableindent
  3383. \parindent = 0pt
  3384. \parskip = \smallskipamount
  3385. \ifdim \parskip=0pt \parskip=2pt \fi
  3386. \let\item = \internalBitem
  3387. \let\itemx = \internalBitemx
  3388. }
  3389. \def\Etable{\endgraf\afterenvbreak}
  3390. \let\Eftable\Etable
  3391. \let\Evtable\Etable
  3392. \let\Eitemize\Etable
  3393. \let\Eenumerate\Etable
  3394. % This is the counter used by @enumerate, which is really @itemize
  3395. \newcount \itemno
  3396. \envdef\itemize{\parsearg\doitemize}
  3397. \def\doitemize#1{%
  3398. \aboveenvbreak
  3399. \itemmax=\itemindent
  3400. \advance\itemmax by -\itemmargin
  3401. \advance\leftskip by \itemindent
  3402. \exdentamount=\itemindent
  3403. \parindent=0pt
  3404. \parskip=\smallskipamount
  3405. \ifdim\parskip=0pt \parskip=2pt \fi
  3406. %
  3407. % Try typesetting the item mark so that if the document erroneously says
  3408. % something like @itemize @samp (intending @table), there's an error
  3409. % right away at the @itemize. It's not the best error message in the
  3410. % world, but it's better than leaving it to the @item. This means if
  3411. % the user wants an empty mark, they have to say @w{} not just @w.
  3412. \def\itemcontents{#1}%
  3413. \setbox0 = \hbox{\itemcontents}%
  3414. %
  3415. % @itemize with no arg is equivalent to @itemize @bullet.
  3416. \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
  3417. %
  3418. \let\item=\itemizeitem
  3419. }
  3420. % Definition of @item while inside @itemize and @enumerate.
  3421. %
  3422. \def\itemizeitem{%
  3423. \advance\itemno by 1 % for enumerations
  3424. {\let\par=\endgraf \smallbreak}% reasonable place to break
  3425. {%
  3426. % If the document has an @itemize directly after a section title, a
  3427. % \nobreak will be last on the list, and \sectionheading will have
  3428. % done a \vskip-\parskip. In that case, we don't want to zero
  3429. % parskip, or the item text will crash with the heading. On the
  3430. % other hand, when there is normal text preceding the item (as there
  3431. % usually is), we do want to zero parskip, or there would be too much
  3432. % space. In that case, we won't have a \nobreak before. At least
  3433. % that's the theory.
  3434. \ifnum\lastpenalty<10000 \parskip=0in \fi
  3435. \noindent
  3436. \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
  3437. %
  3438. \vadjust{\penalty 1200}}% not good to break after first line of item.
  3439. \flushcr
  3440. }
  3441. % \splitoff TOKENS\endmark defines \first to be the first token in
  3442. % TOKENS, and \rest to be the remainder.
  3443. %
  3444. \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
  3445. % Allow an optional argument of an uppercase letter, lowercase letter,
  3446. % or number, to specify the first label in the enumerated list. No
  3447. % argument is the same as `1'.
  3448. %
  3449. \envparseargdef\enumerate{\enumeratey #1 \endenumeratey}
  3450. \def\enumeratey #1 #2\endenumeratey{%
  3451. % If we were given no argument, pretend we were given `1'.
  3452. \def\thearg{#1}%
  3453. \ifx\thearg\empty \def\thearg{1}\fi
  3454. %
  3455. % Detect if the argument is a single token. If so, it might be a
  3456. % letter. Otherwise, the only valid thing it can be is a number.
  3457. % (We will always have one token, because of the test we just made.
  3458. % This is a good thing, since \splitoff doesn't work given nothing at
  3459. % all -- the first parameter is undelimited.)
  3460. \expandafter\splitoff\thearg\endmark
  3461. \ifx\rest\empty
  3462. % Only one token in the argument. It could still be anything.
  3463. % A ``lowercase letter'' is one whose \lccode is nonzero.
  3464. % An ``uppercase letter'' is one whose \lccode is both nonzero, and
  3465. % not equal to itself.
  3466. % Otherwise, we assume it's a number.
  3467. %
  3468. % We need the \relax at the end of the \ifnum lines to stop TeX from
  3469. % continuing to look for a <number>.
  3470. %
  3471. \ifnum\lccode\expandafter`\thearg=0\relax
  3472. \numericenumerate % a number (we hope)
  3473. \else
  3474. % It's a letter.
  3475. \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
  3476. \lowercaseenumerate % lowercase letter
  3477. \else
  3478. \uppercaseenumerate % uppercase letter
  3479. \fi
  3480. \fi
  3481. \else
  3482. % Multiple tokens in the argument. We hope it's a number.
  3483. \numericenumerate
  3484. \fi
  3485. }
  3486. % An @enumerate whose labels are integers. The starting integer is
  3487. % given in \thearg.
  3488. %
  3489. \def\numericenumerate{%
  3490. \itemno = \thearg
  3491. \startenumeration{\the\itemno}%
  3492. }
  3493. % The starting (lowercase) letter is in \thearg.
  3494. \def\lowercaseenumerate{%
  3495. \itemno = \expandafter`\thearg
  3496. \startenumeration{%
  3497. % Be sure we're not beyond the end of the alphabet.
  3498. \ifnum\itemno=0
  3499. \errmessage{No more lowercase letters in @enumerate; get a bigger
  3500. alphabet}%
  3501. \fi
  3502. \char\lccode\itemno
  3503. }%
  3504. }
  3505. % The starting (uppercase) letter is in \thearg.
  3506. \def\uppercaseenumerate{%
  3507. \itemno = \expandafter`\thearg
  3508. \startenumeration{%
  3509. % Be sure we're not beyond the end of the alphabet.
  3510. \ifnum\itemno=0
  3511. \errmessage{No more uppercase letters in @enumerate; get a bigger
  3512. alphabet}
  3513. \fi
  3514. \char\uccode\itemno
  3515. }%
  3516. }
  3517. % Call \doitemize, adding a period to the first argument and supplying the
  3518. % common last two arguments. Also subtract one from the initial value in
  3519. % \itemno, since @item increments \itemno.
  3520. %
  3521. \def\startenumeration#1{%
  3522. \advance\itemno by -1
  3523. \doitemize{#1.}\flushcr
  3524. }
  3525. % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
  3526. % to @enumerate.
  3527. %
  3528. \def\alphaenumerate{\enumerate{a}}
  3529. \def\capsenumerate{\enumerate{A}}
  3530. \def\Ealphaenumerate{\Eenumerate}
  3531. \def\Ecapsenumerate{\Eenumerate}
  3532. % @multitable macros
  3533. % Amy Hendrickson, 8/18/94, 3/6/96
  3534. %
  3535. % @multitable ... @end multitable will make as many columns as desired.
  3536. % Contents of each column will wrap at width given in preamble. Width
  3537. % can be specified either with sample text given in a template line,
  3538. % or in percent of \hsize, the current width of text on page.
  3539. % Table can continue over pages but will only break between lines.
  3540. % To make preamble:
  3541. %
  3542. % Either define widths of columns in terms of percent of \hsize:
  3543. % @multitable @columnfractions .25 .3 .45
  3544. % @item ...
  3545. %
  3546. % Numbers following @columnfractions are the percent of the total
  3547. % current hsize to be used for each column. You may use as many
  3548. % columns as desired.
  3549. % Or use a template:
  3550. % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
  3551. % @item ...
  3552. % using the widest term desired in each column.
  3553. % Each new table line starts with @item, each subsequent new column
  3554. % starts with @tab. Empty columns may be produced by supplying @tab's
  3555. % with nothing between them for as many times as empty columns are needed,
  3556. % ie, @tab@tab@tab will produce two empty columns.
  3557. % @item, @tab do not need to be on their own lines, but it will not hurt
  3558. % if they are.
  3559. % Sample multitable:
  3560. % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
  3561. % @item first col stuff @tab second col stuff @tab third col
  3562. % @item
  3563. % first col stuff
  3564. % @tab
  3565. % second col stuff
  3566. % @tab
  3567. % third col
  3568. % @item first col stuff @tab second col stuff
  3569. % @tab Many paragraphs of text may be used in any column.
  3570. %
  3571. % They will wrap at the width determined by the template.
  3572. % @item@tab@tab This will be in third column.
  3573. % @end multitable
  3574. % Default dimensions may be reset by user.
  3575. % @multitableparskip is vertical space between paragraphs in table.
  3576. % @multitableparindent is paragraph indent in table.
  3577. % @multitablecolmargin is horizontal space to be left between columns.
  3578. % @multitablelinespace is space to leave between table items, baseline
  3579. % to baseline.
  3580. % 0pt means it depends on current normal line spacing.
  3581. %
  3582. \newskip\multitableparskip
  3583. \newskip\multitableparindent
  3584. \newdimen\multitablecolspace
  3585. \newskip\multitablelinespace
  3586. \multitableparskip=0pt
  3587. \multitableparindent=6pt
  3588. \multitablecolspace=12pt
  3589. \multitablelinespace=0pt
  3590. % Macros used to set up halign preamble:
  3591. %
  3592. \let\endsetuptable\relax
  3593. \def\xendsetuptable{\endsetuptable}
  3594. \let\columnfractions\relax
  3595. \def\xcolumnfractions{\columnfractions}
  3596. \newif\ifsetpercent
  3597. % #1 is the @columnfraction, usually a decimal number like .5, but might
  3598. % be just 1. We just use it, whatever it is.
  3599. %
  3600. \def\pickupwholefraction#1 {%
  3601. \global\advance\colcount by 1
  3602. \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}%
  3603. \setuptable
  3604. }
  3605. \newcount\colcount
  3606. \def\setuptable#1{%
  3607. \def\firstarg{#1}%
  3608. \ifx\firstarg\xendsetuptable
  3609. \let\go = \relax
  3610. \else
  3611. \ifx\firstarg\xcolumnfractions
  3612. \global\setpercenttrue
  3613. \else
  3614. \ifsetpercent
  3615. \let\go\pickupwholefraction
  3616. \else
  3617. \global\advance\colcount by 1
  3618. \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
  3619. % separator; typically that is always in the input, anyway.
  3620. \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
  3621. \fi
  3622. \fi
  3623. \ifx\go\pickupwholefraction
  3624. % Put the argument back for the \pickupwholefraction call, so
  3625. % we'll always have a period there to be parsed.
  3626. \def\go{\pickupwholefraction#1}%
  3627. \else
  3628. \let\go = \setuptable
  3629. \fi%
  3630. \fi
  3631. \go
  3632. }
  3633. % multitable-only commands.
  3634. %
  3635. % @headitem starts a heading row, which we typeset in bold. Assignments
  3636. % have to be global since we are inside the implicit group of an
  3637. % alignment entry. \everycr below resets \everytab so we don't have to
  3638. % undo it ourselves.
  3639. \def\headitemfont{\b}% for people to use in the template row; not changeable
  3640. \def\headitem{%
  3641. \checkenv\multitable
  3642. \crcr
  3643. \gdef\headitemcrhook{\nobreak}% attempt to avoid page break after headings
  3644. \global\everytab={\bf}% can't use \headitemfont since the parsing differs
  3645. \the\everytab % for the first item
  3646. }%
  3647. %
  3648. % default for tables with no headings.
  3649. \let\headitemcrhook=\relax
  3650. %
  3651. % A \tab used to include \hskip1sp. But then the space in a template
  3652. % line is not enough. That is bad. So let's go back to just `&' until
  3653. % we again encounter the problem the 1sp was intended to solve.
  3654. % --karl, nathan@acm.org, 20apr99.
  3655. \def\tab{\checkenv\multitable &\the\everytab}%
  3656. % @multitable ... @end multitable definitions:
  3657. %
  3658. \newtoks\everytab % insert after every tab.
  3659. %
  3660. \envdef\multitable{%
  3661. \vskip\parskip
  3662. \startsavinginserts
  3663. %
  3664. % @item within a multitable starts a normal row.
  3665. % We use \def instead of \let so that if one of the multitable entries
  3666. % contains an @itemize, we don't choke on the \item (seen as \crcr aka
  3667. % \endtemplate) expanding \doitemize.
  3668. \def\item{\crcr}%
  3669. %
  3670. \tolerance=9500
  3671. \hbadness=9500
  3672. \setmultitablespacing
  3673. \parskip=\multitableparskip
  3674. \parindent=\multitableparindent
  3675. \overfullrule=0pt
  3676. \global\colcount=0
  3677. %
  3678. \everycr = {%
  3679. \noalign{%
  3680. \global\everytab={}% Reset from possible headitem.
  3681. \global\colcount=0 % Reset the column counter.
  3682. %
  3683. % Check for saved footnotes, etc.:
  3684. \checkinserts
  3685. %
  3686. % Perhaps a \nobreak, then reset:
  3687. \headitemcrhook
  3688. \global\let\headitemcrhook=\relax
  3689. }%
  3690. }%
  3691. %
  3692. \parsearg\domultitable
  3693. }
  3694. \def\domultitable#1{%
  3695. % To parse everything between @multitable and @item:
  3696. \setuptable#1 \endsetuptable
  3697. %
  3698. % This preamble sets up a generic column definition, which will
  3699. % be used as many times as user calls for columns.
  3700. % \vtop will set a single line and will also let text wrap and
  3701. % continue for many paragraphs if desired.
  3702. \halign\bgroup &%
  3703. \global\advance\colcount by 1
  3704. \multistrut
  3705. \vtop{%
  3706. % Use the current \colcount to find the correct column width:
  3707. \hsize=\expandafter\csname col\the\colcount\endcsname
  3708. %
  3709. % In order to keep entries from bumping into each other
  3710. % we will add a \leftskip of \multitablecolspace to all columns after
  3711. % the first one.
  3712. %
  3713. % If a template has been used, we will add \multitablecolspace
  3714. % to the width of each template entry.
  3715. %
  3716. % If the user has set preamble in terms of percent of \hsize we will
  3717. % use that dimension as the width of the column, and the \leftskip
  3718. % will keep entries from bumping into each other. Table will start at
  3719. % left margin and final column will justify at right margin.
  3720. %
  3721. % Make sure we don't inherit \rightskip from the outer environment.
  3722. \rightskip=0pt
  3723. \ifnum\colcount=1
  3724. % The first column will be indented with the surrounding text.
  3725. \advance\hsize by\leftskip
  3726. \else
  3727. \ifsetpercent \else
  3728. % If user has not set preamble in terms of percent of \hsize
  3729. % we will advance \hsize by \multitablecolspace.
  3730. \advance\hsize by \multitablecolspace
  3731. \fi
  3732. % In either case we will make \leftskip=\multitablecolspace:
  3733. \leftskip=\multitablecolspace
  3734. \fi
  3735. % Ignoring space at the beginning and end avoids an occasional spurious
  3736. % blank line, when TeX decides to break the line at the space before the
  3737. % box from the multistrut, so the strut ends up on a line by itself.
  3738. % For example:
  3739. % @multitable @columnfractions .11 .89
  3740. % @item @code{#}
  3741. % @tab Legal holiday which is valid in major parts of the whole country.
  3742. % Is automatically provided with highlighting sequences respectively
  3743. % marking characters.
  3744. \noindent\ignorespaces##\unskip\multistrut
  3745. }\cr
  3746. }
  3747. \def\Emultitable{%
  3748. \crcr
  3749. \egroup % end the \halign
  3750. \global\setpercentfalse
  3751. }
  3752. \def\setmultitablespacing{%
  3753. \def\multistrut{\strut}% just use the standard line spacing
  3754. %
  3755. % Compute \multitablelinespace (if not defined by user) for use in
  3756. % \multitableparskip calculation. We used define \multistrut based on
  3757. % this, but (ironically) that caused the spacing to be off.
  3758. % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100.
  3759. \ifdim\multitablelinespace=0pt
  3760. \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
  3761. \global\advance\multitablelinespace by-\ht0
  3762. \fi
  3763. % Test to see if parskip is larger than space between lines of
  3764. % table. If not, do nothing.
  3765. % If so, set to same dimension as multitablelinespace.
  3766. \ifdim\multitableparskip>\multitablelinespace
  3767. \global\multitableparskip=\multitablelinespace
  3768. \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
  3769. % than skip between lines in the table.
  3770. \fi%
  3771. \ifdim\multitableparskip=0pt
  3772. \global\multitableparskip=\multitablelinespace
  3773. \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
  3774. % than skip between lines in the table.
  3775. \fi}
  3776. \message{conditionals,}
  3777. % @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext,
  3778. % @ifnotxml always succeed. They currently do nothing; we don't
  3779. % attempt to check whether the conditionals are properly nested. But we
  3780. % have to remember that they are conditionals, so that @end doesn't
  3781. % attempt to close an environment group.
  3782. %
  3783. \def\makecond#1{%
  3784. \expandafter\let\csname #1\endcsname = \relax
  3785. \expandafter\let\csname iscond.#1\endcsname = 1
  3786. }
  3787. \makecond{iftex}
  3788. \makecond{ifnotdocbook}
  3789. \makecond{ifnothtml}
  3790. \makecond{ifnotinfo}
  3791. \makecond{ifnotplaintext}
  3792. \makecond{ifnotxml}
  3793. % Ignore @ignore, @ifhtml, @ifinfo, and the like.
  3794. %
  3795. \def\direntry{\doignore{direntry}}
  3796. \def\documentdescription{\doignore{documentdescription}}
  3797. \def\docbook{\doignore{docbook}}
  3798. \def\html{\doignore{html}}
  3799. \def\ifdocbook{\doignore{ifdocbook}}
  3800. \def\ifhtml{\doignore{ifhtml}}
  3801. \def\ifinfo{\doignore{ifinfo}}
  3802. \def\ifnottex{\doignore{ifnottex}}
  3803. \def\ifplaintext{\doignore{ifplaintext}}
  3804. \def\ifxml{\doignore{ifxml}}
  3805. \def\ignore{\doignore{ignore}}
  3806. \def\menu{\doignore{menu}}
  3807. \def\xml{\doignore{xml}}
  3808. % Ignore text until a line `@end #1', keeping track of nested conditionals.
  3809. %
  3810. % A count to remember the depth of nesting.
  3811. \newcount\doignorecount
  3812. \def\doignore#1{\begingroup
  3813. % Scan in ``verbatim'' mode:
  3814. \obeylines
  3815. \catcode`\@ = \other
  3816. \catcode`\{ = \other
  3817. \catcode`\} = \other
  3818. %
  3819. % Make sure that spaces turn into tokens that match what \doignoretext wants.
  3820. \spaceisspace
  3821. %
  3822. % Count number of #1's that we've seen.
  3823. \doignorecount = 0
  3824. %
  3825. % Swallow text until we reach the matching `@end #1'.
  3826. \dodoignore{#1}%
  3827. }
  3828. { \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source.
  3829. \obeylines %
  3830. %
  3831. \gdef\dodoignore#1{%
  3832. % #1 contains the command name as a string, e.g., `ifinfo'.
  3833. %
  3834. % Define a command to find the next `@end #1'.
  3835. \long\def\doignoretext##1^^M@end #1{%
  3836. \doignoretextyyy##1^^M@#1\_STOP_}%
  3837. %
  3838. % And this command to find another #1 command, at the beginning of a
  3839. % line. (Otherwise, we would consider a line `@c @ifset', for
  3840. % example, to count as an @ifset for nesting.)
  3841. \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%
  3842. %
  3843. % And now expand that command.
  3844. \doignoretext ^^M%
  3845. }%
  3846. }
  3847. \def\doignoreyyy#1{%
  3848. \def\temp{#1}%
  3849. \ifx\temp\empty % Nothing found.
  3850. \let\next\doignoretextzzz
  3851. \else % Found a nested condition, ...
  3852. \advance\doignorecount by 1
  3853. \let\next\doignoretextyyy % ..., look for another.
  3854. % If we're here, #1 ends with ^^M\ifinfo (for example).
  3855. \fi
  3856. \next #1% the token \_STOP_ is present just after this macro.
  3857. }
  3858. % We have to swallow the remaining "\_STOP_".
  3859. %
  3860. \def\doignoretextzzz#1{%
  3861. \ifnum\doignorecount = 0 % We have just found the outermost @end.
  3862. \let\next\enddoignore
  3863. \else % Still inside a nested condition.
  3864. \advance\doignorecount by -1
  3865. \let\next\doignoretext % Look for the next @end.
  3866. \fi
  3867. \next
  3868. }
  3869. % Finish off ignored text.
  3870. { \obeylines%
  3871. % Ignore anything after the last `@end #1'; this matters in verbatim
  3872. % environments, where otherwise the newline after an ignored conditional
  3873. % would result in a blank line in the output.
  3874. \gdef\enddoignore#1^^M{\endgroup\ignorespaces}%
  3875. }
  3876. % @set VAR sets the variable VAR to an empty value.
  3877. % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
  3878. %
  3879. % Since we want to separate VAR from REST-OF-LINE (which might be
  3880. % empty), we can't just use \parsearg; we have to insert a space of our
  3881. % own to delimit the rest of the line, and then take it out again if we
  3882. % didn't need it.
  3883. % We rely on the fact that \parsearg sets \catcode`\ =10.
  3884. %
  3885. \parseargdef\set{\setyyy#1 \endsetyyy}
  3886. \def\setyyy#1 #2\endsetyyy{%
  3887. {%
  3888. \makevalueexpandable
  3889. \def\temp{#2}%
  3890. \edef\next{\gdef\makecsname{SET#1}}%
  3891. \ifx\temp\empty
  3892. \next{}%
  3893. \else
  3894. \setzzz#2\endsetzzz
  3895. \fi
  3896. }%
  3897. }
  3898. % Remove the trailing space \setxxx inserted.
  3899. \def\setzzz#1 \endsetzzz{\next{#1}}
  3900. % @clear VAR clears (i.e., unsets) the variable VAR.
  3901. %
  3902. \parseargdef\clear{%
  3903. {%
  3904. \makevalueexpandable
  3905. \global\expandafter\let\csname SET#1\endcsname=\relax
  3906. }%
  3907. }
  3908. % @value{foo} gets the text saved in variable foo.
  3909. \def\value{\begingroup\makevalueexpandable\valuexxx}
  3910. \def\valuexxx#1{\expandablevalue{#1}\endgroup}
  3911. {
  3912. \catcode`\-=\active \catcode`\_=\active
  3913. %
  3914. \gdef\makevalueexpandable{%
  3915. \let\value = \expandablevalue
  3916. % We don't want these characters active, ...
  3917. \catcode`\-=\other \catcode`\_=\other
  3918. % ..., but we might end up with active ones in the argument if
  3919. % we're called from @code, as @code{@value{foo-bar_}}, though.
  3920. % So \let them to their normal equivalents.
  3921. \let-\normaldash \let_\normalunderscore
  3922. }
  3923. }
  3924. % We have this subroutine so that we can handle at least some @value's
  3925. % properly in indexes (we call \makevalueexpandable in \indexdummies).
  3926. % The command has to be fully expandable (if the variable is set), since
  3927. % the result winds up in the index file. This means that if the
  3928. % variable's value contains other Texinfo commands, it's almost certain
  3929. % it will fail (although perhaps we could fix that with sufficient work
  3930. % to do a one-level expansion on the result, instead of complete).
  3931. %
  3932. % Unfortunately, this has the consequence that when _ is in the *value*
  3933. % of an @set, it does not print properly in the roman fonts (get the cmr
  3934. % dot accent at position 126 instead). No fix comes to mind, and it's
  3935. % been this way since 2003 or earlier, so just ignore it.
  3936. %
  3937. \def\expandablevalue#1{%
  3938. \expandafter\ifx\csname SET#1\endcsname\relax
  3939. {[No value for ``#1'']}%
  3940. \message{Variable `#1', used in @value, is not set.}%
  3941. \else
  3942. \csname SET#1\endcsname
  3943. \fi
  3944. }
  3945. % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
  3946. % with @set.
  3947. %
  3948. % To get the special treatment we need for `@end ifset,' we call
  3949. % \makecond and then redefine.
  3950. %
  3951. \makecond{ifset}
  3952. \def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}
  3953. \def\doifset#1#2{%
  3954. {%
  3955. \makevalueexpandable
  3956. \let\next=\empty
  3957. \expandafter\ifx\csname SET#2\endcsname\relax
  3958. #1% If not set, redefine \next.
  3959. \fi
  3960. \expandafter
  3961. }\next
  3962. }
  3963. \def\ifsetfail{\doignore{ifset}}
  3964. % @ifclear VAR ... @end executes the `...' iff VAR has never been
  3965. % defined with @set, or has been undefined with @clear.
  3966. %
  3967. % The `\else' inside the `\doifset' parameter is a trick to reuse the
  3968. % above code: if the variable is not set, do nothing, if it is set,
  3969. % then redefine \next to \ifclearfail.
  3970. %
  3971. \makecond{ifclear}
  3972. \def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
  3973. \def\ifclearfail{\doignore{ifclear}}
  3974. % @ifcommandisdefined CMD ... @end executes the `...' if CMD (written
  3975. % without the @) is in fact defined. We can only feasibly check at the
  3976. % TeX level, so something like `mathcode' is going to considered
  3977. % defined even though it is not a Texinfo command.
  3978. %
  3979. \makecond{ifcommanddefined}
  3980. \def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}}
  3981. %
  3982. \def\doifcmddefined#1#2{{%
  3983. \makevalueexpandable
  3984. \let\next=\empty
  3985. \expandafter\ifx\csname #2\endcsname\relax
  3986. #1% If not defined, \let\next as above.
  3987. \fi
  3988. \expandafter
  3989. }\next
  3990. }
  3991. \def\ifcmddefinedfail{\doignore{ifcommanddefined}}
  3992. % @ifcommandnotdefined CMD ... handled similar to @ifclear above.
  3993. \makecond{ifcommandnotdefined}
  3994. \def\ifcommandnotdefined{%
  3995. \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}}
  3996. \def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}}
  3997. % Set the `txicommandconditionals' variable, so documents have a way to
  3998. % test if the @ifcommand...defined conditionals are available.
  3999. \set txicommandconditionals
  4000. % @dircategory CATEGORY -- specify a category of the dir file
  4001. % which this file should belong to. Ignore this in TeX.
  4002. \let\dircategory=\comment
  4003. % @defininfoenclose.
  4004. \let\definfoenclose=\comment
  4005. \message{indexing,}
  4006. % Index generation facilities
  4007. % Define \newwrite to be identical to plain tex's \newwrite
  4008. % except not \outer, so it can be used within macros and \if's.
  4009. \edef\newwrite{\makecsname{ptexnewwrite}}
  4010. % \newindex {foo} defines an index named foo.
  4011. % It automatically defines \fooindex such that
  4012. % \fooindex ...rest of line... puts an entry in the index foo.
  4013. % It also defines \fooindfile to be the number of the output channel for
  4014. % the file that accumulates this index. The file's extension is foo.
  4015. % The name of an index should be no more than 2 characters long
  4016. % for the sake of vms.
  4017. %
  4018. \def\newindex#1{%
  4019. \iflinks
  4020. \expandafter\newwrite \csname#1indfile\endcsname
  4021. \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
  4022. \fi
  4023. \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
  4024. \noexpand\doindex{#1}}
  4025. }
  4026. % @defindex foo == \newindex{foo}
  4027. %
  4028. \def\defindex{\parsearg\newindex}
  4029. % Define @defcodeindex, like @defindex except put all entries in @code.
  4030. %
  4031. \def\defcodeindex{\parsearg\newcodeindex}
  4032. %
  4033. \def\newcodeindex#1{%
  4034. \iflinks
  4035. \expandafter\newwrite \csname#1indfile\endcsname
  4036. \openout \csname#1indfile\endcsname \jobname.#1
  4037. \fi
  4038. \expandafter\xdef\csname#1index\endcsname{%
  4039. \noexpand\docodeindex{#1}}%
  4040. }
  4041. % @synindex foo bar makes index foo feed into index bar.
  4042. % Do this instead of @defindex foo if you don't want it as a separate index.
  4043. %
  4044. % @syncodeindex foo bar similar, but put all entries made for index foo
  4045. % inside @code.
  4046. %
  4047. \def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
  4048. \def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
  4049. % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
  4050. % #3 the target index (bar).
  4051. \def\dosynindex#1#2#3{%
  4052. % Only do \closeout if we haven't already done it, else we'll end up
  4053. % closing the target index.
  4054. \expandafter \ifx\csname donesynindex#2\endcsname \relax
  4055. % The \closeout helps reduce unnecessary open files; the limit on the
  4056. % Acorn RISC OS is a mere 16 files.
  4057. \expandafter\closeout\csname#2indfile\endcsname
  4058. \expandafter\let\csname donesynindex#2\endcsname = 1
  4059. \fi
  4060. % redefine \fooindfile:
  4061. \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
  4062. \expandafter\let\csname#2indfile\endcsname=\temp
  4063. % redefine \fooindex:
  4064. \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
  4065. }
  4066. % Define \doindex, the driver for all \fooindex macros.
  4067. % Argument #1 is generated by the calling \fooindex macro,
  4068. % and it is "foo", the name of the index.
  4069. % \doindex just uses \parsearg; it calls \doind for the actual work.
  4070. % This is because \doind is more useful to call from other macros.
  4071. % There is also \dosubind {index}{topic}{subtopic}
  4072. % which makes an entry in a two-level index such as the operation index.
  4073. \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
  4074. \def\singleindexer #1{\doind{\indexname}{#1}}
  4075. % like the previous two, but they put @code around the argument.
  4076. \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
  4077. \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
  4078. % Take care of Texinfo commands that can appear in an index entry.
  4079. % Since there are some commands we want to expand, and others we don't,
  4080. % we have to laboriously prevent expansion for those that we don't.
  4081. %
  4082. \def\indexdummies{%
  4083. \escapechar = `\\ % use backslash in output files.
  4084. \def\@{@}% change to @@ when we switch to @ as escape char in index files.
  4085. \def\ {\realbackslash\space }%
  4086. %
  4087. % Need these unexpandable (because we define \tt as a dummy)
  4088. % definitions when @{ or @} appear in index entry text. Also, more
  4089. % complicated, when \tex is in effect and \{ is a \delimiter again.
  4090. % We can't use \lbracecmd and \rbracecmd because texindex assumes
  4091. % braces and backslashes are used only as delimiters. Perhaps we
  4092. % should use @lbracechar and @rbracechar?
  4093. \def\{{{\tt\char123}}%
  4094. \def\}{{\tt\char125}}%
  4095. %
  4096. % I don't entirely understand this, but when an index entry is
  4097. % generated from a macro call, the \endinput which \scanmacro inserts
  4098. % causes processing to be prematurely terminated. This is,
  4099. % apparently, because \indexsorttmp is fully expanded, and \endinput
  4100. % is an expandable command. The redefinition below makes \endinput
  4101. % disappear altogether for that purpose -- although logging shows that
  4102. % processing continues to some further point. On the other hand, it
  4103. % seems \endinput does not hurt in the printed index arg, since that
  4104. % is still getting written without apparent harm.
  4105. %
  4106. % Sample source (mac-idx3.tex, reported by Graham Percival to
  4107. % help-texinfo, 22may06):
  4108. % @macro funindex {WORD}
  4109. % @findex xyz
  4110. % @end macro
  4111. % ...
  4112. % @funindex commtest
  4113. % This is not enough to reproduce the bug, but it gives the flavor.
  4114. %
  4115. % Sample whatsit resulting:
  4116. % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}}
  4117. %
  4118. % So:
  4119. \let\endinput = \empty
  4120. %
  4121. % Do the redefinitions.
  4122. \commondummies
  4123. }
  4124. % For the aux and toc files, @ is the escape character. So we want to
  4125. % redefine everything using @ as the escape character (instead of
  4126. % \realbackslash, still used for index files). When everything uses @,
  4127. % this will be simpler.
  4128. %
  4129. \def\atdummies{%
  4130. \def\@{@@}%
  4131. \def\ {@ }%
  4132. \let\{ = \lbraceatcmd
  4133. \let\} = \rbraceatcmd
  4134. %
  4135. % Do the redefinitions.
  4136. \commondummies
  4137. \otherbackslash
  4138. }
  4139. % Called from \indexdummies and \atdummies.
  4140. %
  4141. \def\commondummies{%
  4142. % \definedummyword defines \#1 as \string\#1\space, thus effectively
  4143. % preventing its expansion. This is used only for control words,
  4144. % not control letters, because the \space would be incorrect for
  4145. % control characters, but is needed to separate the control word
  4146. % from whatever follows.
  4147. %
  4148. % For control letters, we have \definedummyletter, which omits the
  4149. % space.
  4150. %
  4151. % These can be used both for control words that take an argument and
  4152. % those that do not. If it is followed by {arg} in the input, then
  4153. % that will dutifully get written to the index (or wherever).
  4154. %
  4155. \def\definedummyword ##1{\def##1{\string##1\space}}%
  4156. \def\definedummyletter##1{\def##1{\string##1}}%
  4157. \let\definedummyaccent\definedummyletter
  4158. %
  4159. \commondummiesnofonts
  4160. %
  4161. \definedummyletter\_%
  4162. \definedummyletter\-%
  4163. %
  4164. % Non-English letters.
  4165. \definedummyword\AA
  4166. \definedummyword\AE
  4167. \definedummyword\DH
  4168. \definedummyword\L
  4169. \definedummyword\O
  4170. \definedummyword\OE
  4171. \definedummyword\TH
  4172. \definedummyword\aa
  4173. \definedummyword\ae
  4174. \definedummyword\dh
  4175. \definedummyword\exclamdown
  4176. \definedummyword\l
  4177. \definedummyword\o
  4178. \definedummyword\oe
  4179. \definedummyword\ordf
  4180. \definedummyword\ordm
  4181. \definedummyword\questiondown
  4182. \definedummyword\ss
  4183. \definedummyword\th
  4184. %
  4185. % Although these internal commands shouldn't show up, sometimes they do.
  4186. \definedummyword\bf
  4187. \definedummyword\gtr
  4188. \definedummyword\hat
  4189. \definedummyword\less
  4190. \definedummyword\sf
  4191. \definedummyword\sl
  4192. \definedummyword\tclose
  4193. \definedummyword\tt
  4194. %
  4195. \definedummyword\LaTeX
  4196. \definedummyword\TeX
  4197. %
  4198. % Assorted special characters.
  4199. \definedummyword\arrow
  4200. \definedummyword\bullet
  4201. \definedummyword\comma
  4202. \definedummyword\copyright
  4203. \definedummyword\registeredsymbol
  4204. \definedummyword\dots
  4205. \definedummyword\enddots
  4206. \definedummyword\entrybreak
  4207. \definedummyword\equiv
  4208. \definedummyword\error
  4209. \definedummyword\euro
  4210. \definedummyword\expansion
  4211. \definedummyword\geq
  4212. \definedummyword\guillemetleft
  4213. \definedummyword\guillemetright
  4214. \definedummyword\guilsinglleft
  4215. \definedummyword\guilsinglright
  4216. \definedummyword\lbracechar
  4217. \definedummyword\leq
  4218. \definedummyword\mathopsup
  4219. \definedummyword\minus
  4220. \definedummyword\ogonek
  4221. \definedummyword\pounds
  4222. \definedummyword\point
  4223. \definedummyword\print
  4224. \definedummyword\quotedblbase
  4225. \definedummyword\quotedblleft
  4226. \definedummyword\quotedblright
  4227. \definedummyword\quoteleft
  4228. \definedummyword\quoteright
  4229. \definedummyword\quotesinglbase
  4230. \definedummyword\rbracechar
  4231. \definedummyword\result
  4232. \definedummyword\sub
  4233. \definedummyword\sup
  4234. \definedummyword\textdegree
  4235. %
  4236. % We want to disable all macros so that they are not expanded by \write.
  4237. \macrolist
  4238. %
  4239. \normalturnoffactive
  4240. %
  4241. % Handle some cases of @value -- where it does not contain any
  4242. % (non-fully-expandable) commands.
  4243. \makevalueexpandable
  4244. }
  4245. % \commondummiesnofonts: common to \commondummies and \indexnofonts.
  4246. %
  4247. \def\commondummiesnofonts{%
  4248. % Control letters and accents.
  4249. \definedummyletter\!%
  4250. \definedummyaccent\"%
  4251. \definedummyaccent\'%
  4252. \definedummyletter\*%
  4253. \definedummyaccent\,%
  4254. \definedummyletter\.%
  4255. \definedummyletter\/%
  4256. \definedummyletter\:%
  4257. \definedummyaccent\=%
  4258. \definedummyletter\?%
  4259. \definedummyaccent\^%
  4260. \definedummyaccent\`%
  4261. \definedummyaccent\~%
  4262. \definedummyword\u
  4263. \definedummyword\v
  4264. \definedummyword\H
  4265. \definedummyword\dotaccent
  4266. \definedummyword\ogonek
  4267. \definedummyword\ringaccent
  4268. \definedummyword\tieaccent
  4269. \definedummyword\ubaraccent
  4270. \definedummyword\udotaccent
  4271. \definedummyword\dotless
  4272. %
  4273. % Texinfo font commands.
  4274. \definedummyword\b
  4275. \definedummyword\i
  4276. \definedummyword\r
  4277. \definedummyword\sansserif
  4278. \definedummyword\sc
  4279. \definedummyword\slanted
  4280. \definedummyword\t
  4281. %
  4282. % Commands that take arguments.
  4283. \definedummyword\abbr
  4284. \definedummyword\acronym
  4285. \definedummyword\anchor
  4286. \definedummyword\cite
  4287. \definedummyword\code
  4288. \definedummyword\command
  4289. \definedummyword\dfn
  4290. \definedummyword\dmn
  4291. \definedummyword\email
  4292. \definedummyword\emph
  4293. \definedummyword\env
  4294. \definedummyword\file
  4295. \definedummyword\image
  4296. \definedummyword\indicateurl
  4297. \definedummyword\inforef
  4298. \definedummyword\kbd
  4299. \definedummyword\key
  4300. \definedummyword\math
  4301. \definedummyword\option
  4302. \definedummyword\pxref
  4303. \definedummyword\ref
  4304. \definedummyword\samp
  4305. \definedummyword\strong
  4306. \definedummyword\tie
  4307. \definedummyword\U
  4308. \definedummyword\uref
  4309. \definedummyword\url
  4310. \definedummyword\var
  4311. \definedummyword\verb
  4312. \definedummyword\w
  4313. \definedummyword\xref
  4314. %
  4315. % Consider:
  4316. % @macro mkind{arg1,arg2}
  4317. % @cindex \arg2\
  4318. % @end macro
  4319. % @mkind{foo, bar}
  4320. % The space after the comma will end up in the temporary definition
  4321. % that we make for arg2 (see \parsemargdef ff.). We want all this to be
  4322. % expanded for the sake of the index, so we end up just seeing "bar".
  4323. \let\xeatspaces = \eatspaces
  4324. }
  4325. % For testing: output @{ and @} in index sort strings as \{ and \}.
  4326. \newif\ifusebracesinindexes
  4327. % \indexnofonts is used when outputting the strings to sort the index
  4328. % by, and when constructing control sequence names. It eliminates all
  4329. % control sequences and just writes whatever the best ASCII sort string
  4330. % would be for a given command (usually its argument).
  4331. %
  4332. \def\indexnofonts{%
  4333. % Accent commands should become @asis.
  4334. \def\definedummyaccent##1{\let##1\asis}%
  4335. % We can just ignore other control letters.
  4336. \def\definedummyletter##1{\let##1\empty}%
  4337. % All control words become @asis by default; overrides below.
  4338. \let\definedummyword\definedummyaccent
  4339. %
  4340. \commondummiesnofonts
  4341. %
  4342. % Don't no-op \tt, since it isn't a user-level command
  4343. % and is used in the definitions of the active chars like <, >, |, etc.
  4344. % Likewise with the other plain tex font commands.
  4345. %\let\tt=\asis
  4346. %
  4347. \def\ { }%
  4348. \def\@{@}%
  4349. \def\_{\normalunderscore}%
  4350. \def\-{}% @- shouldn't affect sorting
  4351. %
  4352. % Unfortunately, texindex is not prepared to handle braces in the
  4353. % content at all. So for index sorting, we map @{ and @} to strings
  4354. % starting with |, since that ASCII character is between ASCII { and }.
  4355. \ifusebracesinindexes
  4356. \def\lbracechar{\lbracecmd}%
  4357. \def\rbracechar{\rbracecmd}%
  4358. \else
  4359. \def\lbracechar{|a}%
  4360. \def\rbracechar{|b}%
  4361. \fi
  4362. \let\{=\lbracechar
  4363. \let\}=\rbracechar
  4364. %
  4365. %
  4366. % Non-English letters.
  4367. \def\AA{AA}%
  4368. \def\AE{AE}%
  4369. \def\DH{DZZ}%
  4370. \def\L{L}%
  4371. \def\OE{OE}%
  4372. \def\O{O}%
  4373. \def\TH{ZZZ}%
  4374. \def\aa{aa}%
  4375. \def\ae{ae}%
  4376. \def\dh{dzz}%
  4377. \def\exclamdown{!}%
  4378. \def\l{l}%
  4379. \def\oe{oe}%
  4380. \def\ordf{a}%
  4381. \def\ordm{o}%
  4382. \def\o{o}%
  4383. \def\questiondown{?}%
  4384. \def\ss{ss}%
  4385. \def\th{zzz}%
  4386. %
  4387. \def\LaTeX{LaTeX}%
  4388. \def\TeX{TeX}%
  4389. %
  4390. % Assorted special characters.
  4391. % (The following {} will end up in the sort string, but that's ok.)
  4392. \def\arrow{->}%
  4393. \def\bullet{bullet}%
  4394. \def\comma{,}%
  4395. \def\copyright{copyright}%
  4396. \def\dots{...}%
  4397. \def\enddots{...}%
  4398. \def\equiv{==}%
  4399. \def\error{error}%
  4400. \def\euro{euro}%
  4401. \def\expansion{==>}%
  4402. \def\geq{>=}%
  4403. \def\guillemetleft{<<}%
  4404. \def\guillemetright{>>}%
  4405. \def\guilsinglleft{<}%
  4406. \def\guilsinglright{>}%
  4407. \def\leq{<=}%
  4408. \def\minus{-}%
  4409. \def\point{.}%
  4410. \def\pounds{pounds}%
  4411. \def\print{-|}%
  4412. \def\quotedblbase{"}%
  4413. \def\quotedblleft{"}%
  4414. \def\quotedblright{"}%
  4415. \def\quoteleft{`}%
  4416. \def\quoteright{'}%
  4417. \def\quotesinglbase{,}%
  4418. \def\registeredsymbol{R}%
  4419. \def\result{=>}%
  4420. \def\textdegree{o}%
  4421. %
  4422. \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax
  4423. \else \indexlquoteignore \fi
  4424. %
  4425. % We need to get rid of all macros, leaving only the arguments (if present).
  4426. % Of course this is not nearly correct, but it is the best we can do for now.
  4427. % makeinfo does not expand macros in the argument to @deffn, which ends up
  4428. % writing an index entry, and texindex isn't prepared for an index sort entry
  4429. % that starts with \.
  4430. %
  4431. % Since macro invocations are followed by braces, we can just redefine them
  4432. % to take a single TeX argument. The case of a macro invocation that
  4433. % goes to end-of-line is not handled.
  4434. %
  4435. \macrolist
  4436. }
  4437. % Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us
  4438. % ignore left quotes in the sort term.
  4439. {\catcode`\`=\active
  4440. \gdef\indexlquoteignore{\let`=\empty}}
  4441. \let\indexbackslash=0 %overridden during \printindex.
  4442. \let\SETmarginindex=\relax % put index entries in margin (undocumented)?
  4443. % Most index entries go through here, but \dosubind is the general case.
  4444. % #1 is the index name, #2 is the entry text.
  4445. \def\doind#1#2{\dosubind{#1}{#2}{}}
  4446. % Workhorse for all \fooindexes.
  4447. % #1 is name of index, #2 is stuff to put there, #3 is subentry --
  4448. % empty if called from \doind, as we usually are (the main exception
  4449. % is with most defuns, which call us directly).
  4450. %
  4451. \def\dosubind#1#2#3{%
  4452. \iflinks
  4453. {%
  4454. % Store the main index entry text (including the third arg).
  4455. \toks0 = {#2}%
  4456. % If third arg is present, precede it with a space.
  4457. \def\thirdarg{#3}%
  4458. \ifx\thirdarg\empty \else
  4459. \toks0 = \expandafter{\the\toks0 \space #3}%
  4460. \fi
  4461. %
  4462. \edef\writeto{\csname#1indfile\endcsname}%
  4463. %
  4464. \safewhatsit\dosubindwrite
  4465. }%
  4466. \fi
  4467. }
  4468. % Write the entry in \toks0 to the index file:
  4469. %
  4470. \def\dosubindwrite{%
  4471. % Put the index entry in the margin if desired.
  4472. \ifx\SETmarginindex\relax\else
  4473. \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}%
  4474. \fi
  4475. %
  4476. % Remember, we are within a group.
  4477. \indexdummies % Must do this here, since \bf, etc expand at this stage
  4478. \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now
  4479. % so it will be output as is; and it will print as backslash.
  4480. %
  4481. % Process the index entry with all font commands turned off, to
  4482. % get the string to sort by.
  4483. {\indexnofonts
  4484. \edef\temp{\the\toks0}% need full expansion
  4485. \xdef\indexsorttmp{\temp}%
  4486. }%
  4487. %
  4488. % Set up the complete index entry, with both the sort key and
  4489. % the original text, including any font commands. We write
  4490. % three arguments to \entry to the .?? file (four in the
  4491. % subentry case), texindex reduces to two when writing the .??s
  4492. % sorted result.
  4493. \edef\temp{%
  4494. \write\writeto{%
  4495. \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}%
  4496. }%
  4497. \temp
  4498. }
  4499. % Take care of unwanted page breaks/skips around a whatsit:
  4500. %
  4501. % If a skip is the last thing on the list now, preserve it
  4502. % by backing up by \lastskip, doing the \write, then inserting
  4503. % the skip again. Otherwise, the whatsit generated by the
  4504. % \write or \pdfdest will make \lastskip zero. The result is that
  4505. % sequences like this:
  4506. % @end defun
  4507. % @tindex whatever
  4508. % @defun ...
  4509. % will have extra space inserted, because the \medbreak in the
  4510. % start of the @defun won't see the skip inserted by the @end of
  4511. % the previous defun.
  4512. %
  4513. % But don't do any of this if we're not in vertical mode. We
  4514. % don't want to do a \vskip and prematurely end a paragraph.
  4515. %
  4516. % Avoid page breaks due to these extra skips, too.
  4517. %
  4518. % But wait, there is a catch there:
  4519. % We'll have to check whether \lastskip is zero skip. \ifdim is not
  4520. % sufficient for this purpose, as it ignores stretch and shrink parts
  4521. % of the skip. The only way seems to be to check the textual
  4522. % representation of the skip.
  4523. %
  4524. % The following is almost like \def\zeroskipmacro{0.0pt} except that
  4525. % the ``p'' and ``t'' characters have catcode \other, not 11 (letter).
  4526. %
  4527. \edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname}
  4528. %
  4529. \newskip\whatsitskip
  4530. \newcount\whatsitpenalty
  4531. %
  4532. % ..., ready, GO:
  4533. %
  4534. \def\safewhatsit#1{\ifhmode
  4535. #1%
  4536. \else
  4537. % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
  4538. \whatsitskip = \lastskip
  4539. \edef\lastskipmacro{\the\lastskip}%
  4540. \whatsitpenalty = \lastpenalty
  4541. %
  4542. % If \lastskip is nonzero, that means the last item was a
  4543. % skip. And since a skip is discardable, that means this
  4544. % -\whatsitskip glue we're inserting is preceded by a
  4545. % non-discardable item, therefore it is not a potential
  4546. % breakpoint, therefore no \nobreak needed.
  4547. \ifx\lastskipmacro\zeroskipmacro
  4548. \else
  4549. \vskip-\whatsitskip
  4550. \fi
  4551. %
  4552. #1%
  4553. %
  4554. \ifx\lastskipmacro\zeroskipmacro
  4555. % If \lastskip was zero, perhaps the last item was a penalty, and
  4556. % perhaps it was >=10000, e.g., a \nobreak. In that case, we want
  4557. % to re-insert the same penalty (values >10000 are used for various
  4558. % signals); since we just inserted a non-discardable item, any
  4559. % following glue (such as a \parskip) would be a breakpoint. For example:
  4560. % @deffn deffn-whatever
  4561. % @vindex index-whatever
  4562. % Description.
  4563. % would allow a break between the index-whatever whatsit
  4564. % and the "Description." paragraph.
  4565. \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi
  4566. \else
  4567. % On the other hand, if we had a nonzero \lastskip,
  4568. % this make-up glue would be preceded by a non-discardable item
  4569. % (the whatsit from the \write), so we must insert a \nobreak.
  4570. \nobreak\vskip\whatsitskip
  4571. \fi
  4572. \fi}
  4573. % The index entry written in the file actually looks like
  4574. % \entry {sortstring}{page}{topic}
  4575. % or
  4576. % \entry {sortstring}{page}{topic}{subtopic}
  4577. % The texindex program reads in these files and writes files
  4578. % containing these kinds of lines:
  4579. % \initial {c}
  4580. % before the first topic whose initial is c
  4581. % \entry {topic}{pagelist}
  4582. % for a topic that is used without subtopics
  4583. % \primary {topic}
  4584. % for the beginning of a topic that is used with subtopics
  4585. % \secondary {subtopic}{pagelist}
  4586. % for each subtopic.
  4587. % Define the user-accessible indexing commands
  4588. % @findex, @vindex, @kindex, @cindex.
  4589. \def\findex {\fnindex}
  4590. \def\kindex {\kyindex}
  4591. \def\cindex {\cpindex}
  4592. \def\vindex {\vrindex}
  4593. \def\tindex {\tpindex}
  4594. \def\pindex {\pgindex}
  4595. \def\cindexsub {\begingroup\obeylines\cindexsub}
  4596. {\obeylines %
  4597. \gdef\cindexsub "#1" #2^^M{\endgroup %
  4598. \dosubind{cp}{#2}{#1}}}
  4599. % Define the macros used in formatting output of the sorted index material.
  4600. % @printindex causes a particular index (the ??s file) to get printed.
  4601. % It does not print any chapter heading (usually an @unnumbered).
  4602. %
  4603. \parseargdef\printindex{\begingroup
  4604. \dobreak \chapheadingskip{10000}%
  4605. %
  4606. \smallfonts \rm
  4607. \tolerance = 9500
  4608. \plainfrenchspacing
  4609. \everypar = {}% don't want the \kern\-parindent from indentation suppression.
  4610. %
  4611. % See if the index file exists and is nonempty.
  4612. % Change catcode of @ here so that if the index file contains
  4613. % \initial {@}
  4614. % as its first line, TeX doesn't complain about mismatched braces
  4615. % (because it thinks @} is a control sequence).
  4616. \catcode`\@ = 11
  4617. \openin 1 \jobname.#1s
  4618. \ifeof 1
  4619. % \enddoublecolumns gets confused if there is no text in the index,
  4620. % and it loses the chapter title and the aux file entries for the
  4621. % index. The easiest way to prevent this problem is to make sure
  4622. % there is some text.
  4623. \putwordIndexNonexistent
  4624. \else
  4625. %
  4626. % If the index file exists but is empty, then \openin leaves \ifeof
  4627. % false. We have to make TeX try to read something from the file, so
  4628. % it can discover if there is anything in it.
  4629. \read 1 to \temp
  4630. \ifeof 1
  4631. \putwordIndexIsEmpty
  4632. \else
  4633. % Index files are almost Texinfo source, but we use \ as the escape
  4634. % character. It would be better to use @, but that's too big a change
  4635. % to make right now.
  4636. \def\indexbackslash{\backslashcurfont}%
  4637. \catcode`\\ = 0
  4638. \escapechar = `\\
  4639. \begindoublecolumns
  4640. \input \jobname.#1s
  4641. \enddoublecolumns
  4642. \fi
  4643. \fi
  4644. \closein 1
  4645. \endgroup}
  4646. % These macros are used by the sorted index file itself.
  4647. % Change them to control the appearance of the index.
  4648. \def\initial#1{{%
  4649. % Some minor font changes for the special characters.
  4650. \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
  4651. %
  4652. % Remove any glue we may have, we'll be inserting our own.
  4653. \removelastskip
  4654. %
  4655. % We like breaks before the index initials, so insert a bonus.
  4656. \nobreak
  4657. \vskip 0pt plus 3\baselineskip
  4658. \penalty 0
  4659. \vskip 0pt plus -3\baselineskip
  4660. %
  4661. % Typeset the initial. Making this add up to a whole number of
  4662. % baselineskips increases the chance of the dots lining up from column
  4663. % to column. It still won't often be perfect, because of the stretch
  4664. % we need before each entry, but it's better.
  4665. %
  4666. % No shrink because it confuses \balancecolumns.
  4667. \vskip 1.67\baselineskip plus .5\baselineskip
  4668. \leftline{\secbf #1}%
  4669. % Do our best not to break after the initial.
  4670. \nobreak
  4671. \vskip .33\baselineskip plus .1\baselineskip
  4672. }}
  4673. % \entry typesets a paragraph consisting of the text (#1), dot leaders, and
  4674. % then page number (#2) flushed to the right margin. It is used for index
  4675. % and table of contents entries. The paragraph is indented by \leftskip.
  4676. %
  4677. % A straightforward implementation would start like this:
  4678. % \def\entry#1#2{...
  4679. % But this freezes the catcodes in the argument, and can cause problems to
  4680. % @code, which sets - active. This problem was fixed by a kludge---
  4681. % ``-'' was active throughout whole index, but this isn't really right.
  4682. % The right solution is to prevent \entry from swallowing the whole text.
  4683. % --kasal, 21nov03
  4684. \def\entry{%
  4685. \begingroup
  4686. %
  4687. % Start a new paragraph if necessary, so our assignments below can't
  4688. % affect previous text.
  4689. \par
  4690. %
  4691. % Do not fill out the last line with white space.
  4692. \parfillskip = 0in
  4693. %
  4694. % No extra space above this paragraph.
  4695. \parskip = 0in
  4696. %
  4697. % Do not prefer a separate line ending with a hyphen to fewer lines.
  4698. \finalhyphendemerits = 0
  4699. %
  4700. % \hangindent is only relevant when the entry text and page number
  4701. % don't both fit on one line. In that case, bob suggests starting the
  4702. % dots pretty far over on the line. Unfortunately, a large
  4703. % indentation looks wrong when the entry text itself is broken across
  4704. % lines. So we use a small indentation and put up with long leaders.
  4705. %
  4706. % \hangafter is reset to 1 (which is the value we want) at the start
  4707. % of each paragraph, so we need not do anything with that.
  4708. \hangindent = 2em
  4709. %
  4710. % When the entry text needs to be broken, just fill out the first line
  4711. % with blank space.
  4712. \rightskip = 0pt plus1fil
  4713. %
  4714. % A bit of stretch before each entry for the benefit of balancing
  4715. % columns.
  4716. \vskip 0pt plus1pt
  4717. %
  4718. % When reading the text of entry, convert explicit line breaks
  4719. % from @* into spaces. The user might give these in long section
  4720. % titles, for instance.
  4721. \def\*{\unskip\space\ignorespaces}%
  4722. \def\entrybreak{\hfil\break}%
  4723. %
  4724. % Swallow the left brace of the text (first parameter):
  4725. \afterassignment\doentry
  4726. \let\temp =
  4727. }
  4728. \def\entrybreak{\unskip\space\ignorespaces}%
  4729. \def\doentry{%
  4730. \bgroup % Instead of the swallowed brace.
  4731. \noindent
  4732. \aftergroup\finishentry
  4733. % And now comes the text of the entry.
  4734. }
  4735. \def\finishentry#1{%
  4736. % #1 is the page number.
  4737. %
  4738. % The following is kludged to not output a line of dots in the index if
  4739. % there are no page numbers. The next person who breaks this will be
  4740. % cursed by a Unix daemon.
  4741. \setbox\boxA = \hbox{#1}%
  4742. \ifdim\wd\boxA = 0pt
  4743. \ %
  4744. \else
  4745. %
  4746. % If we must, put the page number on a line of its own, and fill out
  4747. % this line with blank space. (The \hfil is overwhelmed with the
  4748. % fill leaders glue in \indexdotfill if the page number does fit.)
  4749. \hfil\penalty50
  4750. \null\nobreak\indexdotfill % Have leaders before the page number.
  4751. %
  4752. % The `\ ' here is removed by the implicit \unskip that TeX does as
  4753. % part of (the primitive) \par. Without it, a spurious underfull
  4754. % \hbox ensues.
  4755. \ifpdf
  4756. \pdfgettoks#1.%
  4757. \ \the\toksA
  4758. \else
  4759. \ #1%
  4760. \fi
  4761. \fi
  4762. \par
  4763. \endgroup
  4764. }
  4765. % Like plain.tex's \dotfill, except uses up at least 1 em.
  4766. \def\indexdotfill{\cleaders
  4767. \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill}
  4768. \def\primary #1{\line{#1\hfil}}
  4769. \newskip\secondaryindent \secondaryindent=0.5cm
  4770. \def\secondary#1#2{{%
  4771. \parfillskip=0in
  4772. \parskip=0in
  4773. \hangindent=1in
  4774. \hangafter=1
  4775. \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
  4776. \ifpdf
  4777. \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
  4778. \else
  4779. #2
  4780. \fi
  4781. \par
  4782. }}
  4783. % Define two-column mode, which we use to typeset indexes.
  4784. % Adapted from the TeXbook, page 416, which is to say,
  4785. % the manmac.tex format used to print the TeXbook itself.
  4786. \catcode`\@=11
  4787. \newbox\partialpage
  4788. \newdimen\doublecolumnhsize
  4789. \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
  4790. % Grab any single-column material above us.
  4791. \output = {%
  4792. %
  4793. % Here is a possibility not foreseen in manmac: if we accumulate a
  4794. % whole lot of material, we might end up calling this \output
  4795. % routine twice in a row (see the doublecol-lose test, which is
  4796. % essentially a couple of indexes with @setchapternewpage off). In
  4797. % that case we just ship out what is in \partialpage with the normal
  4798. % output routine. Generally, \partialpage will be empty when this
  4799. % runs and this will be a no-op. See the indexspread.tex test case.
  4800. \ifvoid\partialpage \else
  4801. \onepageout{\pagecontents\partialpage}%
  4802. \fi
  4803. %
  4804. \global\setbox\partialpage = \vbox{%
  4805. % Unvbox the main output page.
  4806. \unvbox\PAGE
  4807. \kern-\topskip \kern\baselineskip
  4808. }%
  4809. }%
  4810. \eject % run that output routine to set \partialpage
  4811. %
  4812. % Use the double-column output routine for subsequent pages.
  4813. \output = {\doublecolumnout}%
  4814. %
  4815. % Change the page size parameters. We could do this once outside this
  4816. % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
  4817. % format, but then we repeat the same computation. Repeating a couple
  4818. % of assignments once per index is clearly meaningless for the
  4819. % execution time, so we may as well do it in one place.
  4820. %
  4821. % First we halve the line length, less a little for the gutter between
  4822. % the columns. We compute the gutter based on the line length, so it
  4823. % changes automatically with the paper format. The magic constant
  4824. % below is chosen so that the gutter has the same value (well, +-<1pt)
  4825. % as it did when we hard-coded it.
  4826. %
  4827. % We put the result in a separate register, \doublecolumhsize, so we
  4828. % can restore it in \pagesofar, after \hsize itself has (potentially)
  4829. % been clobbered.
  4830. %
  4831. \doublecolumnhsize = \hsize
  4832. \advance\doublecolumnhsize by -.04154\hsize
  4833. \divide\doublecolumnhsize by 2
  4834. \hsize = \doublecolumnhsize
  4835. %
  4836. % Double the \vsize as well. (We don't need a separate register here,
  4837. % since nobody clobbers \vsize.)
  4838. \vsize = 2\vsize
  4839. }
  4840. % The double-column output routine for all double-column pages except
  4841. % the last.
  4842. %
  4843. \def\doublecolumnout{%
  4844. \splittopskip=\topskip \splitmaxdepth=\maxdepth
  4845. % Get the available space for the double columns -- the normal
  4846. % (undoubled) page height minus any material left over from the
  4847. % previous page.
  4848. \dimen@ = \vsize
  4849. \divide\dimen@ by 2
  4850. \advance\dimen@ by -\ht\partialpage
  4851. %
  4852. % box0 will be the left-hand column, box2 the right.
  4853. \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
  4854. \onepageout\pagesofar
  4855. \unvbox255
  4856. \penalty\outputpenalty
  4857. }
  4858. %
  4859. % Re-output the contents of the output page -- any previous material,
  4860. % followed by the two boxes we just split, in box0 and box2.
  4861. \def\pagesofar{%
  4862. \unvbox\partialpage
  4863. %
  4864. \hsize = \doublecolumnhsize
  4865. \wd0=\hsize \wd2=\hsize
  4866. \hbox to\pagewidth{\box0\hfil\box2}%
  4867. }
  4868. %
  4869. % All done with double columns.
  4870. \def\enddoublecolumns{%
  4871. % The following penalty ensures that the page builder is exercised
  4872. % _before_ we change the output routine. This is necessary in the
  4873. % following situation:
  4874. %
  4875. % The last section of the index consists only of a single entry.
  4876. % Before this section, \pagetotal is less than \pagegoal, so no
  4877. % break occurs before the last section starts. However, the last
  4878. % section, consisting of \initial and the single \entry, does not
  4879. % fit on the page and has to be broken off. Without the following
  4880. % penalty the page builder will not be exercised until \eject
  4881. % below, and by that time we'll already have changed the output
  4882. % routine to the \balancecolumns version, so the next-to-last
  4883. % double-column page will be processed with \balancecolumns, which
  4884. % is wrong: The two columns will go to the main vertical list, with
  4885. % the broken-off section in the recent contributions. As soon as
  4886. % the output routine finishes, TeX starts reconsidering the page
  4887. % break. The two columns and the broken-off section both fit on the
  4888. % page, because the two columns now take up only half of the page
  4889. % goal. When TeX sees \eject from below which follows the final
  4890. % section, it invokes the new output routine that we've set after
  4891. % \balancecolumns below; \onepageout will try to fit the two columns
  4892. % and the final section into the vbox of \pageheight (see
  4893. % \pagebody), causing an overfull box.
  4894. %
  4895. % Note that glue won't work here, because glue does not exercise the
  4896. % page builder, unlike penalties (see The TeXbook, pp. 280-281).
  4897. \penalty0
  4898. %
  4899. \output = {%
  4900. % Split the last of the double-column material. Leave it on the
  4901. % current page, no automatic page break.
  4902. \balancecolumns
  4903. %
  4904. % If we end up splitting too much material for the current page,
  4905. % though, there will be another page break right after this \output
  4906. % invocation ends. Having called \balancecolumns once, we do not
  4907. % want to call it again. Therefore, reset \output to its normal
  4908. % definition right away. (We hope \balancecolumns will never be
  4909. % called on to balance too much material, but if it is, this makes
  4910. % the output somewhat more palatable.)
  4911. \global\output = {\onepageout{\pagecontents\PAGE}}%
  4912. }%
  4913. \eject
  4914. \endgroup % started in \begindoublecolumns
  4915. %
  4916. % \pagegoal was set to the doubled \vsize above, since we restarted
  4917. % the current page. We're now back to normal single-column
  4918. % typesetting, so reset \pagegoal to the normal \vsize (after the
  4919. % \endgroup where \vsize got restored).
  4920. \pagegoal = \vsize
  4921. }
  4922. %
  4923. % Called at the end of the double column material.
  4924. \def\balancecolumns{%
  4925. \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
  4926. \dimen@ = \ht0
  4927. \advance\dimen@ by \topskip
  4928. \advance\dimen@ by-\baselineskip
  4929. \divide\dimen@ by 2 % target to split to
  4930. %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
  4931. \splittopskip = \topskip
  4932. % Loop until we get a decent breakpoint.
  4933. {%
  4934. \vbadness = 10000
  4935. \loop
  4936. \global\setbox3 = \copy0
  4937. \global\setbox1 = \vsplit3 to \dimen@
  4938. \ifdim\ht3>\dimen@
  4939. \global\advance\dimen@ by 1pt
  4940. \repeat
  4941. }%
  4942. %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
  4943. \setbox0=\vbox to\dimen@{\unvbox1}%
  4944. \setbox2=\vbox to\dimen@{\unvbox3}%
  4945. %
  4946. \pagesofar
  4947. }
  4948. \catcode`\@ = \other
  4949. \message{sectioning,}
  4950. % Chapters, sections, etc.
  4951. % Let's start with @part.
  4952. \outer\parseargdef\part{\partzzz{#1}}
  4953. \def\partzzz#1{%
  4954. \chapoddpage
  4955. \null
  4956. \vskip.3\vsize % move it down on the page a bit
  4957. \begingroup
  4958. \noindent \titlefonts\rmisbold #1\par % the text
  4959. \let\lastnode=\empty % no node to associate with
  4960. \writetocentry{part}{#1}{}% but put it in the toc
  4961. \headingsoff % no headline or footline on the part page
  4962. \chapoddpage
  4963. \endgroup
  4964. }
  4965. % \unnumberedno is an oxymoron. But we count the unnumbered
  4966. % sections so that we can refer to them unambiguously in the pdf
  4967. % outlines by their "section number". We avoid collisions with chapter
  4968. % numbers by starting them at 10000. (If a document ever has 10000
  4969. % chapters, we're in trouble anyway, I'm sure.)
  4970. \newcount\unnumberedno \unnumberedno = 10000
  4971. \newcount\chapno
  4972. \newcount\secno \secno=0
  4973. \newcount\subsecno \subsecno=0
  4974. \newcount\subsubsecno \subsubsecno=0
  4975. % This counter is funny since it counts through charcodes of letters A, B, ...
  4976. \newcount\appendixno \appendixno = `\@
  4977. %
  4978. % \def\appendixletter{\char\the\appendixno}
  4979. % We do the following ugly conditional instead of the above simple
  4980. % construct for the sake of pdftex, which needs the actual
  4981. % letter in the expansion, not just typeset.
  4982. %
  4983. \def\appendixletter{%
  4984. \ifnum\appendixno=`A A%
  4985. \else\ifnum\appendixno=`B B%
  4986. \else\ifnum\appendixno=`C C%
  4987. \else\ifnum\appendixno=`D D%
  4988. \else\ifnum\appendixno=`E E%
  4989. \else\ifnum\appendixno=`F F%
  4990. \else\ifnum\appendixno=`G G%
  4991. \else\ifnum\appendixno=`H H%
  4992. \else\ifnum\appendixno=`I I%
  4993. \else\ifnum\appendixno=`J J%
  4994. \else\ifnum\appendixno=`K K%
  4995. \else\ifnum\appendixno=`L L%
  4996. \else\ifnum\appendixno=`M M%
  4997. \else\ifnum\appendixno=`N N%
  4998. \else\ifnum\appendixno=`O O%
  4999. \else\ifnum\appendixno=`P P%
  5000. \else\ifnum\appendixno=`Q Q%
  5001. \else\ifnum\appendixno=`R R%
  5002. \else\ifnum\appendixno=`S S%
  5003. \else\ifnum\appendixno=`T T%
  5004. \else\ifnum\appendixno=`U U%
  5005. \else\ifnum\appendixno=`V V%
  5006. \else\ifnum\appendixno=`W W%
  5007. \else\ifnum\appendixno=`X X%
  5008. \else\ifnum\appendixno=`Y Y%
  5009. \else\ifnum\appendixno=`Z Z%
  5010. % The \the is necessary, despite appearances, because \appendixletter is
  5011. % expanded while writing the .toc file. \char\appendixno is not
  5012. % expandable, thus it is written literally, thus all appendixes come out
  5013. % with the same letter (or @) in the toc without it.
  5014. \else\char\the\appendixno
  5015. \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
  5016. \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
  5017. % Each @chapter defines these (using marks) as the number+name, number
  5018. % and name of the chapter. Page headings and footings can use
  5019. % these. @section does likewise.
  5020. \def\thischapter{}
  5021. \def\thischapternum{}
  5022. \def\thischaptername{}
  5023. \def\thissection{}
  5024. \def\thissectionnum{}
  5025. \def\thissectionname{}
  5026. \newcount\absseclevel % used to calculate proper heading level
  5027. \newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
  5028. % @raisesections: treat @section as chapter, @subsection as section, etc.
  5029. \def\raisesections{\global\advance\secbase by -1}
  5030. \let\up=\raisesections % original BFox name
  5031. % @lowersections: treat @chapter as section, @section as subsection, etc.
  5032. \def\lowersections{\global\advance\secbase by 1}
  5033. \let\down=\lowersections % original BFox name
  5034. % we only have subsub.
  5035. \chardef\maxseclevel = 3
  5036. %
  5037. % A numbered section within an unnumbered changes to unnumbered too.
  5038. % To achieve this, remember the "biggest" unnum. sec. we are currently in:
  5039. \chardef\unnlevel = \maxseclevel
  5040. %
  5041. % Trace whether the current chapter is an appendix or not:
  5042. % \chapheadtype is "N" or "A", unnumbered chapters are ignored.
  5043. \def\chapheadtype{N}
  5044. % Choose a heading macro
  5045. % #1 is heading type
  5046. % #2 is heading level
  5047. % #3 is text for heading
  5048. \def\genhead#1#2#3{%
  5049. % Compute the abs. sec. level:
  5050. \absseclevel=#2
  5051. \advance\absseclevel by \secbase
  5052. % Make sure \absseclevel doesn't fall outside the range:
  5053. \ifnum \absseclevel < 0
  5054. \absseclevel = 0
  5055. \else
  5056. \ifnum \absseclevel > 3
  5057. \absseclevel = 3
  5058. \fi
  5059. \fi
  5060. % The heading type:
  5061. \def\headtype{#1}%
  5062. \if \headtype U%
  5063. \ifnum \absseclevel < \unnlevel
  5064. \chardef\unnlevel = \absseclevel
  5065. \fi
  5066. \else
  5067. % Check for appendix sections:
  5068. \ifnum \absseclevel = 0
  5069. \edef\chapheadtype{\headtype}%
  5070. \else
  5071. \if \headtype A\if \chapheadtype N%
  5072. \errmessage{@appendix... within a non-appendix chapter}%
  5073. \fi\fi
  5074. \fi
  5075. % Check for numbered within unnumbered:
  5076. \ifnum \absseclevel > \unnlevel
  5077. \def\headtype{U}%
  5078. \else
  5079. \chardef\unnlevel = 3
  5080. \fi
  5081. \fi
  5082. % Now print the heading:
  5083. \if \headtype U%
  5084. \ifcase\absseclevel
  5085. \unnumberedzzz{#3}%
  5086. \or \unnumberedseczzz{#3}%
  5087. \or \unnumberedsubseczzz{#3}%
  5088. \or \unnumberedsubsubseczzz{#3}%
  5089. \fi
  5090. \else
  5091. \if \headtype A%
  5092. \ifcase\absseclevel
  5093. \appendixzzz{#3}%
  5094. \or \appendixsectionzzz{#3}%
  5095. \or \appendixsubseczzz{#3}%
  5096. \or \appendixsubsubseczzz{#3}%
  5097. \fi
  5098. \else
  5099. \ifcase\absseclevel
  5100. \chapterzzz{#3}%
  5101. \or \seczzz{#3}%
  5102. \or \numberedsubseczzz{#3}%
  5103. \or \numberedsubsubseczzz{#3}%
  5104. \fi
  5105. \fi
  5106. \fi
  5107. \suppressfirstparagraphindent
  5108. }
  5109. % an interface:
  5110. \def\numhead{\genhead N}
  5111. \def\apphead{\genhead A}
  5112. \def\unnmhead{\genhead U}
  5113. % @chapter, @appendix, @unnumbered. Increment top-level counter, reset
  5114. % all lower-level sectioning counters to zero.
  5115. %
  5116. % Also set \chaplevelprefix, which we prepend to @float sequence numbers
  5117. % (e.g., figures), q.v. By default (before any chapter), that is empty.
  5118. \let\chaplevelprefix = \empty
  5119. %
  5120. \outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz
  5121. \def\chapterzzz#1{%
  5122. % section resetting is \global in case the chapter is in a group, such
  5123. % as an @include file.
  5124. \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
  5125. \global\advance\chapno by 1
  5126. %
  5127. % Used for \float.
  5128. \gdef\chaplevelprefix{\the\chapno.}%
  5129. \resetallfloatnos
  5130. %
  5131. % \putwordChapter can contain complex things in translations.
  5132. \toks0=\expandafter{\putwordChapter}%
  5133. \message{\the\toks0 \space \the\chapno}%
  5134. %
  5135. % Write the actual heading.
  5136. \chapmacro{#1}{Ynumbered}{\the\chapno}%
  5137. %
  5138. % So @section and the like are numbered underneath this chapter.
  5139. \global\let\section = \numberedsec
  5140. \global\let\subsection = \numberedsubsec
  5141. \global\let\subsubsection = \numberedsubsubsec
  5142. }
  5143. \outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz
  5144. %
  5145. \def\appendixzzz#1{%
  5146. \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
  5147. \global\advance\appendixno by 1
  5148. \gdef\chaplevelprefix{\appendixletter.}%
  5149. \resetallfloatnos
  5150. %
  5151. % \putwordAppendix can contain complex things in translations.
  5152. \toks0=\expandafter{\putwordAppendix}%
  5153. \message{\the\toks0 \space \appendixletter}%
  5154. %
  5155. \chapmacro{#1}{Yappendix}{\appendixletter}%
  5156. %
  5157. \global\let\section = \appendixsec
  5158. \global\let\subsection = \appendixsubsec
  5159. \global\let\subsubsection = \appendixsubsubsec
  5160. }
  5161. % normally unnmhead0 calls unnumberedzzz:
  5162. \outer\parseargdef\unnumbered{\unnmhead0{#1}}
  5163. \def\unnumberedzzz#1{%
  5164. \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
  5165. \global\advance\unnumberedno by 1
  5166. %
  5167. % Since an unnumbered has no number, no prefix for figures.
  5168. \global\let\chaplevelprefix = \empty
  5169. \resetallfloatnos
  5170. %
  5171. % This used to be simply \message{#1}, but TeX fully expands the
  5172. % argument to \message. Therefore, if #1 contained @-commands, TeX
  5173. % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
  5174. % expanded @cite (which turns out to cause errors because \cite is meant
  5175. % to be executed, not expanded).
  5176. %
  5177. % Anyway, we don't want the fully-expanded definition of @cite to appear
  5178. % as a result of the \message, we just want `@cite' itself. We use
  5179. % \the<toks register> to achieve this: TeX expands \the<toks> only once,
  5180. % simply yielding the contents of <toks register>. (We also do this for
  5181. % the toc entries.)
  5182. \toks0 = {#1}%
  5183. \message{(\the\toks0)}%
  5184. %
  5185. \chapmacro{#1}{Ynothing}{\the\unnumberedno}%
  5186. %
  5187. \global\let\section = \unnumberedsec
  5188. \global\let\subsection = \unnumberedsubsec
  5189. \global\let\subsubsection = \unnumberedsubsubsec
  5190. }
  5191. % @centerchap is like @unnumbered, but the heading is centered.
  5192. \outer\parseargdef\centerchap{%
  5193. % Well, we could do the following in a group, but that would break
  5194. % an assumption that \chapmacro is called at the outermost level.
  5195. % Thus we are safer this way: --kasal, 24feb04
  5196. \let\centerparametersmaybe = \centerparameters
  5197. \unnmhead0{#1}%
  5198. \let\centerparametersmaybe = \relax
  5199. }
  5200. % @top is like @unnumbered.
  5201. \let\top\unnumbered
  5202. % Sections.
  5203. %
  5204. \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
  5205. \def\seczzz#1{%
  5206. \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
  5207. \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
  5208. }
  5209. % normally calls appendixsectionzzz:
  5210. \outer\parseargdef\appendixsection{\apphead1{#1}}
  5211. \def\appendixsectionzzz#1{%
  5212. \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
  5213. \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
  5214. }
  5215. \let\appendixsec\appendixsection
  5216. % normally calls unnumberedseczzz:
  5217. \outer\parseargdef\unnumberedsec{\unnmhead1{#1}}
  5218. \def\unnumberedseczzz#1{%
  5219. \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
  5220. \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
  5221. }
  5222. % Subsections.
  5223. %
  5224. % normally calls numberedsubseczzz:
  5225. \outer\parseargdef\numberedsubsec{\numhead2{#1}}
  5226. \def\numberedsubseczzz#1{%
  5227. \global\subsubsecno=0 \global\advance\subsecno by 1
  5228. \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
  5229. }
  5230. % normally calls appendixsubseczzz:
  5231. \outer\parseargdef\appendixsubsec{\apphead2{#1}}
  5232. \def\appendixsubseczzz#1{%
  5233. \global\subsubsecno=0 \global\advance\subsecno by 1
  5234. \sectionheading{#1}{subsec}{Yappendix}%
  5235. {\appendixletter.\the\secno.\the\subsecno}%
  5236. }
  5237. % normally calls unnumberedsubseczzz:
  5238. \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}}
  5239. \def\unnumberedsubseczzz#1{%
  5240. \global\subsubsecno=0 \global\advance\subsecno by 1
  5241. \sectionheading{#1}{subsec}{Ynothing}%
  5242. {\the\unnumberedno.\the\secno.\the\subsecno}%
  5243. }
  5244. % Subsubsections.
  5245. %
  5246. % normally numberedsubsubseczzz:
  5247. \outer\parseargdef\numberedsubsubsec{\numhead3{#1}}
  5248. \def\numberedsubsubseczzz#1{%
  5249. \global\advance\subsubsecno by 1
  5250. \sectionheading{#1}{subsubsec}{Ynumbered}%
  5251. {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
  5252. }
  5253. % normally appendixsubsubseczzz:
  5254. \outer\parseargdef\appendixsubsubsec{\apphead3{#1}}
  5255. \def\appendixsubsubseczzz#1{%
  5256. \global\advance\subsubsecno by 1
  5257. \sectionheading{#1}{subsubsec}{Yappendix}%
  5258. {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
  5259. }
  5260. % normally unnumberedsubsubseczzz:
  5261. \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}}
  5262. \def\unnumberedsubsubseczzz#1{%
  5263. \global\advance\subsubsecno by 1
  5264. \sectionheading{#1}{subsubsec}{Ynothing}%
  5265. {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}%
  5266. }
  5267. % These macros control what the section commands do, according
  5268. % to what kind of chapter we are in (ordinary, appendix, or unnumbered).
  5269. % Define them by default for a numbered chapter.
  5270. \let\section = \numberedsec
  5271. \let\subsection = \numberedsubsec
  5272. \let\subsubsection = \numberedsubsubsec
  5273. % Define @majorheading, @heading and @subheading
  5274. \def\majorheading{%
  5275. {\advance\chapheadingskip by 10pt \chapbreak }%
  5276. \parsearg\chapheadingzzz
  5277. }
  5278. \def\chapheading{\chapbreak \parsearg\chapheadingzzz}
  5279. \def\chapheadingzzz#1{%
  5280. \vbox{\chapfonts \raggedtitlesettings #1\par}%
  5281. \nobreak\bigskip \nobreak
  5282. \suppressfirstparagraphindent
  5283. }
  5284. % @heading, @subheading, @subsubheading.
  5285. \parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{}
  5286. \suppressfirstparagraphindent}
  5287. \parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{}
  5288. \suppressfirstparagraphindent}
  5289. \parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
  5290. \suppressfirstparagraphindent}
  5291. % These macros generate a chapter, section, etc. heading only
  5292. % (including whitespace, linebreaking, etc. around it),
  5293. % given all the information in convenient, parsed form.
  5294. % Args are the skip and penalty (usually negative)
  5295. \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
  5296. % Parameter controlling skip before chapter headings (if needed)
  5297. \newskip\chapheadingskip
  5298. % Define plain chapter starts, and page on/off switching for it.
  5299. \def\chapbreak{\dobreak \chapheadingskip {-4000}}
  5300. \def\chappager{\par\vfill\supereject}
  5301. % Because \domark is called before \chapoddpage, the filler page will
  5302. % get the headings for the next chapter, which is wrong. But we don't
  5303. % care -- we just disable all headings on the filler page.
  5304. \def\chapoddpage{%
  5305. \chappager
  5306. \ifodd\pageno \else
  5307. \begingroup
  5308. \headingsoff
  5309. \null
  5310. \chappager
  5311. \endgroup
  5312. \fi
  5313. }
  5314. \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
  5315. \def\CHAPPAGoff{%
  5316. \global\let\contentsalignmacro = \chappager
  5317. \global\let\pchapsepmacro=\chapbreak
  5318. \global\let\pagealignmacro=\chappager}
  5319. \def\CHAPPAGon{%
  5320. \global\let\contentsalignmacro = \chappager
  5321. \global\let\pchapsepmacro=\chappager
  5322. \global\let\pagealignmacro=\chappager
  5323. \global\def\HEADINGSon{\HEADINGSsingle}}
  5324. \def\CHAPPAGodd{%
  5325. \global\let\contentsalignmacro = \chapoddpage
  5326. \global\let\pchapsepmacro=\chapoddpage
  5327. \global\let\pagealignmacro=\chapoddpage
  5328. \global\def\HEADINGSon{\HEADINGSdouble}}
  5329. \CHAPPAGon
  5330. % Chapter opening.
  5331. %
  5332. % #1 is the text, #2 is the section type (Ynumbered, Ynothing,
  5333. % Yappendix, Yomitfromtoc), #3 the chapter number.
  5334. % Not used for @heading series.
  5335. %
  5336. % To test against our argument.
  5337. \def\Ynothingkeyword{Ynothing}
  5338. \def\Yappendixkeyword{Yappendix}
  5339. \def\Yomitfromtockeyword{Yomitfromtoc}
  5340. %
  5341. \def\chapmacro#1#2#3{%
  5342. \checkenv{}% chapters, etc., should not start inside an environment.
  5343. %
  5344. % Insert the first mark before the heading break (see notes for \domark).
  5345. \let\prevchapterdefs=\lastchapterdefs
  5346. \let\prevsectiondefs=\lastsectiondefs
  5347. \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
  5348. \gdef\thissection{}}%
  5349. %
  5350. \def\temptype{#2}%
  5351. \ifx\temptype\Ynothingkeyword
  5352. \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
  5353. \gdef\thischapter{\thischaptername}}%
  5354. \else\ifx\temptype\Yomitfromtockeyword
  5355. \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
  5356. \gdef\thischapter{}}%
  5357. \else\ifx\temptype\Yappendixkeyword
  5358. \toks0={#1}%
  5359. \xdef\lastchapterdefs{%
  5360. \gdef\noexpand\thischaptername{\the\toks0}%
  5361. \gdef\noexpand\thischapternum{\appendixletter}%
  5362. % \noexpand\putwordAppendix avoids expanding indigestible
  5363. % commands in some of the translations.
  5364. \gdef\noexpand\thischapter{\noexpand\putwordAppendix{}
  5365. \noexpand\thischapternum:
  5366. \noexpand\thischaptername}%
  5367. }%
  5368. \else
  5369. \toks0={#1}%
  5370. \xdef\lastchapterdefs{%
  5371. \gdef\noexpand\thischaptername{\the\toks0}%
  5372. \gdef\noexpand\thischapternum{\the\chapno}%
  5373. % \noexpand\putwordChapter avoids expanding indigestible
  5374. % commands in some of the translations.
  5375. \gdef\noexpand\thischapter{\noexpand\putwordChapter{}
  5376. \noexpand\thischapternum:
  5377. \noexpand\thischaptername}%
  5378. }%
  5379. \fi\fi\fi
  5380. %
  5381. % Output the mark. Pass it through \safewhatsit, to take care of
  5382. % the preceding space.
  5383. \safewhatsit\domark
  5384. %
  5385. % Insert the chapter heading break.
  5386. \pchapsepmacro
  5387. %
  5388. % Now the second mark, after the heading break. No break points
  5389. % between here and the heading.
  5390. \let\prevchapterdefs=\lastchapterdefs
  5391. \let\prevsectiondefs=\lastsectiondefs
  5392. \domark
  5393. %
  5394. {%
  5395. \chapfonts \rmisbold
  5396. \let\footnote=\errfootnoteheading % give better error message
  5397. %
  5398. % Have to define \lastsection before calling \donoderef, because the
  5399. % xref code eventually uses it. On the other hand, it has to be called
  5400. % after \pchapsepmacro, or the headline will change too soon.
  5401. \gdef\lastsection{#1}%
  5402. %
  5403. % Only insert the separating space if we have a chapter/appendix
  5404. % number, and don't print the unnumbered ``number''.
  5405. \ifx\temptype\Ynothingkeyword
  5406. \setbox0 = \hbox{}%
  5407. \def\toctype{unnchap}%
  5408. \else\ifx\temptype\Yomitfromtockeyword
  5409. \setbox0 = \hbox{}% contents like unnumbered, but no toc entry
  5410. \def\toctype{omit}%
  5411. \else\ifx\temptype\Yappendixkeyword
  5412. \setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
  5413. \def\toctype{app}%
  5414. \else
  5415. \setbox0 = \hbox{#3\enspace}%
  5416. \def\toctype{numchap}%
  5417. \fi\fi\fi
  5418. %
  5419. % Write the toc entry for this chapter. Must come before the
  5420. % \donoderef, because we include the current node name in the toc
  5421. % entry, and \donoderef resets it to empty.
  5422. \writetocentry{\toctype}{#1}{#3}%
  5423. %
  5424. % For pdftex, we have to write out the node definition (aka, make
  5425. % the pdfdest) after any page break, but before the actual text has
  5426. % been typeset. If the destination for the pdf outline is after the
  5427. % text, then jumping from the outline may wind up with the text not
  5428. % being visible, for instance under high magnification.
  5429. \donoderef{#2}%
  5430. %
  5431. % Typeset the actual heading.
  5432. \nobreak % Avoid page breaks at the interline glue.
  5433. \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe
  5434. \unhbox0 #1\par}%
  5435. }%
  5436. \nobreak\bigskip % no page break after a chapter title
  5437. \nobreak
  5438. }
  5439. % @centerchap -- centered and unnumbered.
  5440. \let\centerparametersmaybe = \relax
  5441. \def\centerparameters{%
  5442. \advance\rightskip by 3\rightskip
  5443. \leftskip = \rightskip
  5444. \parfillskip = 0pt
  5445. }
  5446. % I don't think this chapter style is supported any more, so I'm not
  5447. % updating it with the new noderef stuff. We'll see. --karl, 11aug03.
  5448. %
  5449. \def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
  5450. %
  5451. \def\unnchfopen #1{%
  5452. \chapoddpage
  5453. \vbox{\chapfonts \raggedtitlesettings #1\par}%
  5454. \nobreak\bigskip\nobreak
  5455. }
  5456. \def\chfopen #1#2{\chapoddpage {\chapfonts
  5457. \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
  5458. \par\penalty 5000 %
  5459. }
  5460. \def\centerchfopen #1{%
  5461. \chapoddpage
  5462. \vbox{\chapfonts \raggedtitlesettings \hfill #1\hfill}%
  5463. \nobreak\bigskip \nobreak
  5464. }
  5465. \def\CHAPFopen{%
  5466. \global\let\chapmacro=\chfopen
  5467. \global\let\centerchapmacro=\centerchfopen}
  5468. % Section titles. These macros combine the section number parts and
  5469. % call the generic \sectionheading to do the printing.
  5470. %
  5471. \newskip\secheadingskip
  5472. \def\secheadingbreak{\dobreak \secheadingskip{-1000}}
  5473. % Subsection titles.
  5474. \newskip\subsecheadingskip
  5475. \def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}}
  5476. % Subsubsection titles.
  5477. \def\subsubsecheadingskip{\subsecheadingskip}
  5478. \def\subsubsecheadingbreak{\subsecheadingbreak}
  5479. % Print any size, any type, section title.
  5480. %
  5481. % #1 is the text of the title,
  5482. % #2 is the section level (sec/subsec/subsubsec),
  5483. % #3 is the section type (Ynumbered, Ynothing, Yappendix, Yomitfromtoc),
  5484. % #4 is the section number.
  5485. %
  5486. \def\seckeyword{sec}
  5487. %
  5488. \def\sectionheading#1#2#3#4{%
  5489. {%
  5490. \def\sectionlevel{#2}%
  5491. \def\temptype{#3}%
  5492. %
  5493. % It is ok for the @heading series commands to appear inside an
  5494. % environment (it's been historically allowed, though the logic is
  5495. % dubious), but not the others.
  5496. \ifx\temptype\Yomitfromtockeyword\else
  5497. \checkenv{}% non-@*heading should not be in an environment.
  5498. \fi
  5499. \let\footnote=\errfootnoteheading
  5500. %
  5501. % Switch to the right set of fonts.
  5502. \csname #2fonts\endcsname \rmisbold
  5503. %
  5504. % Insert first mark before the heading break (see notes for \domark).
  5505. \let\prevsectiondefs=\lastsectiondefs
  5506. \ifx\temptype\Ynothingkeyword
  5507. \ifx\sectionlevel\seckeyword
  5508. \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
  5509. \gdef\thissection{\thissectionname}}%
  5510. \fi
  5511. \else\ifx\temptype\Yomitfromtockeyword
  5512. % Don't redefine \thissection.
  5513. \else\ifx\temptype\Yappendixkeyword
  5514. \ifx\sectionlevel\seckeyword
  5515. \toks0={#1}%
  5516. \xdef\lastsectiondefs{%
  5517. \gdef\noexpand\thissectionname{\the\toks0}%
  5518. \gdef\noexpand\thissectionnum{#4}%
  5519. % \noexpand\putwordSection avoids expanding indigestible
  5520. % commands in some of the translations.
  5521. \gdef\noexpand\thissection{\noexpand\putwordSection{}
  5522. \noexpand\thissectionnum:
  5523. \noexpand\thissectionname}%
  5524. }%
  5525. \fi
  5526. \else
  5527. \ifx\sectionlevel\seckeyword
  5528. \toks0={#1}%
  5529. \xdef\lastsectiondefs{%
  5530. \gdef\noexpand\thissectionname{\the\toks0}%
  5531. \gdef\noexpand\thissectionnum{#4}%
  5532. % \noexpand\putwordSection avoids expanding indigestible
  5533. % commands in some of the translations.
  5534. \gdef\noexpand\thissection{\noexpand\putwordSection{}
  5535. \noexpand\thissectionnum:
  5536. \noexpand\thissectionname}%
  5537. }%
  5538. \fi
  5539. \fi\fi\fi
  5540. %
  5541. % Go into vertical mode. Usually we'll already be there, but we
  5542. % don't want the following whatsit to end up in a preceding paragraph
  5543. % if the document didn't happen to have a blank line.
  5544. \par
  5545. %
  5546. % Output the mark. Pass it through \safewhatsit, to take care of
  5547. % the preceding space.
  5548. \safewhatsit\domark
  5549. %
  5550. % Insert space above the heading.
  5551. \csname #2headingbreak\endcsname
  5552. %
  5553. % Now the second mark, after the heading break. No break points
  5554. % between here and the heading.
  5555. \global\let\prevsectiondefs=\lastsectiondefs
  5556. \domark
  5557. %
  5558. % Only insert the space after the number if we have a section number.
  5559. \ifx\temptype\Ynothingkeyword
  5560. \setbox0 = \hbox{}%
  5561. \def\toctype{unn}%
  5562. \gdef\lastsection{#1}%
  5563. \else\ifx\temptype\Yomitfromtockeyword
  5564. % for @headings -- no section number, don't include in toc,
  5565. % and don't redefine \lastsection.
  5566. \setbox0 = \hbox{}%
  5567. \def\toctype{omit}%
  5568. \let\sectionlevel=\empty
  5569. \else\ifx\temptype\Yappendixkeyword
  5570. \setbox0 = \hbox{#4\enspace}%
  5571. \def\toctype{app}%
  5572. \gdef\lastsection{#1}%
  5573. \else
  5574. \setbox0 = \hbox{#4\enspace}%
  5575. \def\toctype{num}%
  5576. \gdef\lastsection{#1}%
  5577. \fi\fi\fi
  5578. %
  5579. % Write the toc entry (before \donoderef). See comments in \chapmacro.
  5580. \writetocentry{\toctype\sectionlevel}{#1}{#4}%
  5581. %
  5582. % Write the node reference (= pdf destination for pdftex).
  5583. % Again, see comments in \chapmacro.
  5584. \donoderef{#3}%
  5585. %
  5586. % Interline glue will be inserted when the vbox is completed.
  5587. % That glue will be a valid breakpoint for the page, since it'll be
  5588. % preceded by a whatsit (usually from the \donoderef, or from the
  5589. % \writetocentry if there was no node). We don't want to allow that
  5590. % break, since then the whatsits could end up on page n while the
  5591. % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000.
  5592. \nobreak
  5593. %
  5594. % Output the actual section heading.
  5595. \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
  5596. \hangindent=\wd0 % zero if no section number
  5597. \unhbox0 #1}%
  5598. }%
  5599. % Add extra space after the heading -- half of whatever came above it.
  5600. % Don't allow stretch, though.
  5601. \kern .5 \csname #2headingskip\endcsname
  5602. %
  5603. % Do not let the kern be a potential breakpoint, as it would be if it
  5604. % was followed by glue.
  5605. \nobreak
  5606. %
  5607. % We'll almost certainly start a paragraph next, so don't let that
  5608. % glue accumulate. (Not a breakpoint because it's preceded by a
  5609. % discardable item.) However, when a paragraph is not started next
  5610. % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out
  5611. % or the negative glue will cause weirdly wrong output, typically
  5612. % obscuring the section heading with something else.
  5613. \vskip-\parskip
  5614. %
  5615. % This is so the last item on the main vertical list is a known
  5616. % \penalty > 10000, so \startdefun, etc., can recognize the situation
  5617. % and do the needful.
  5618. \penalty 10001
  5619. }
  5620. \message{toc,}
  5621. % Table of contents.
  5622. \newwrite\tocfile
  5623. % Write an entry to the toc file, opening it if necessary.
  5624. % Called from @chapter, etc.
  5625. %
  5626. % Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno}
  5627. % We append the current node name (if any) and page number as additional
  5628. % arguments for the \{chap,sec,...}entry macros which will eventually
  5629. % read this. The node name is used in the pdf outlines as the
  5630. % destination to jump to.
  5631. %
  5632. % We open the .toc file for writing here instead of at @setfilename (or
  5633. % any other fixed time) so that @contents can be anywhere in the document.
  5634. % But if #1 is `omit', then we don't do anything. This is used for the
  5635. % table of contents chapter openings themselves.
  5636. %
  5637. \newif\iftocfileopened
  5638. \def\omitkeyword{omit}%
  5639. %
  5640. \def\writetocentry#1#2#3{%
  5641. \edef\writetoctype{#1}%
  5642. \ifx\writetoctype\omitkeyword \else
  5643. \iftocfileopened\else
  5644. \immediate\openout\tocfile = \jobname.toc
  5645. \global\tocfileopenedtrue
  5646. \fi
  5647. %
  5648. \iflinks
  5649. {\atdummies
  5650. \edef\temp{%
  5651. \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}%
  5652. \temp
  5653. }%
  5654. \fi
  5655. \fi
  5656. %
  5657. % Tell \shipout to create a pdf destination on each page, if we're
  5658. % writing pdf. These are used in the table of contents. We can't
  5659. % just write one on every page because the title pages are numbered
  5660. % 1 and 2 (the page numbers aren't printed), and so are the first
  5661. % two pages of the document. Thus, we'd have two destinations named
  5662. % `1', and two named `2'.
  5663. \ifpdf \global\pdfmakepagedesttrue \fi
  5664. }
  5665. % These characters do not print properly in the Computer Modern roman
  5666. % fonts, so we must take special care. This is more or less redundant
  5667. % with the Texinfo input format setup at the end of this file.
  5668. %
  5669. \def\activecatcodes{%
  5670. \catcode`\"=\active
  5671. \catcode`\$=\active
  5672. \catcode`\<=\active
  5673. \catcode`\>=\active
  5674. \catcode`\\=\active
  5675. \catcode`\^=\active
  5676. \catcode`\_=\active
  5677. \catcode`\|=\active
  5678. \catcode`\~=\active
  5679. }
  5680. % Read the toc file, which is essentially Texinfo input.
  5681. \def\readtocfile{%
  5682. \setupdatafile
  5683. \activecatcodes
  5684. \input \tocreadfilename
  5685. }
  5686. \newskip\contentsrightmargin \contentsrightmargin=1in
  5687. \newcount\savepageno
  5688. \newcount\lastnegativepageno \lastnegativepageno = -1
  5689. % Prepare to read what we've written to \tocfile.
  5690. %
  5691. \def\startcontents#1{%
  5692. % If @setchapternewpage on, and @headings double, the contents should
  5693. % start on an odd page, unlike chapters. Thus, we maintain
  5694. % \contentsalignmacro in parallel with \pagealignmacro.
  5695. % From: Torbjorn Granlund <tege@matematik.su.se>
  5696. \contentsalignmacro
  5697. \immediate\closeout\tocfile
  5698. %
  5699. % Don't need to put `Contents' or `Short Contents' in the headline.
  5700. % It is abundantly clear what they are.
  5701. \chapmacro{#1}{Yomitfromtoc}{}%
  5702. %
  5703. \savepageno = \pageno
  5704. \begingroup % Set up to handle contents files properly.
  5705. \raggedbottom % Worry more about breakpoints than the bottom.
  5706. \advance\hsize by -\contentsrightmargin % Don't use the full line length.
  5707. %
  5708. % Roman numerals for page numbers.
  5709. \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
  5710. }
  5711. % redefined for the two-volume lispref. We always output on
  5712. % \jobname.toc even if this is redefined.
  5713. %
  5714. \def\tocreadfilename{\jobname.toc}
  5715. % Normal (long) toc.
  5716. %
  5717. \def\contents{%
  5718. \startcontents{\putwordTOC}%
  5719. \openin 1 \tocreadfilename\space
  5720. \ifeof 1 \else
  5721. \readtocfile
  5722. \fi
  5723. \vfill \eject
  5724. \contentsalignmacro % in case @setchapternewpage odd is in effect
  5725. \ifeof 1 \else
  5726. \pdfmakeoutlines
  5727. \fi
  5728. \closein 1
  5729. \endgroup
  5730. \lastnegativepageno = \pageno
  5731. \global\pageno = \savepageno
  5732. }
  5733. % And just the chapters.
  5734. \def\summarycontents{%
  5735. \startcontents{\putwordShortTOC}%
  5736. %
  5737. \let\partentry = \shortpartentry
  5738. \let\numchapentry = \shortchapentry
  5739. \let\appentry = \shortchapentry
  5740. \let\unnchapentry = \shortunnchapentry
  5741. % We want a true roman here for the page numbers.
  5742. \secfonts
  5743. \let\rm=\shortcontrm \let\bf=\shortcontbf
  5744. \let\sl=\shortcontsl \let\tt=\shortconttt
  5745. \rm
  5746. \hyphenpenalty = 10000
  5747. \advance\baselineskip by 1pt % Open it up a little.
  5748. \def\numsecentry##1##2##3##4{}
  5749. \let\appsecentry = \numsecentry
  5750. \let\unnsecentry = \numsecentry
  5751. \let\numsubsecentry = \numsecentry
  5752. \let\appsubsecentry = \numsecentry
  5753. \let\unnsubsecentry = \numsecentry
  5754. \let\numsubsubsecentry = \numsecentry
  5755. \let\appsubsubsecentry = \numsecentry
  5756. \let\unnsubsubsecentry = \numsecentry
  5757. \openin 1 \tocreadfilename\space
  5758. \ifeof 1 \else
  5759. \readtocfile
  5760. \fi
  5761. \closein 1
  5762. \vfill \eject
  5763. \contentsalignmacro % in case @setchapternewpage odd is in effect
  5764. \endgroup
  5765. \lastnegativepageno = \pageno
  5766. \global\pageno = \savepageno
  5767. }
  5768. \let\shortcontents = \summarycontents
  5769. % Typeset the label for a chapter or appendix for the short contents.
  5770. % The arg is, e.g., `A' for an appendix, or `3' for a chapter.
  5771. %
  5772. \def\shortchaplabel#1{%
  5773. % This space should be enough, since a single number is .5em, and the
  5774. % widest letter (M) is 1em, at least in the Computer Modern fonts.
  5775. % But use \hss just in case.
  5776. % (This space doesn't include the extra space that gets added after
  5777. % the label; that gets put in by \shortchapentry above.)
  5778. %
  5779. % We'd like to right-justify chapter numbers, but that looks strange
  5780. % with appendix letters. And right-justifying numbers and
  5781. % left-justifying letters looks strange when there is less than 10
  5782. % chapters. Have to read the whole toc once to know how many chapters
  5783. % there are before deciding ...
  5784. \hbox to 1em{#1\hss}%
  5785. }
  5786. % These macros generate individual entries in the table of contents.
  5787. % The first argument is the chapter or section name.
  5788. % The last argument is the page number.
  5789. % The arguments in between are the chapter number, section number, ...
  5790. % Parts, in the main contents. Replace the part number, which doesn't
  5791. % exist, with an empty box. Let's hope all the numbers have the same width.
  5792. % Also ignore the page number, which is conventionally not printed.
  5793. \def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}}
  5794. \def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}}
  5795. %
  5796. % Parts, in the short toc.
  5797. \def\shortpartentry#1#2#3#4{%
  5798. \penalty-300
  5799. \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip
  5800. \shortchapentry{{\bf #1}}{\numeralbox}{}{}%
  5801. }
  5802. % Chapters, in the main contents.
  5803. \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
  5804. %
  5805. % Chapters, in the short toc.
  5806. % See comments in \dochapentry re vbox and related settings.
  5807. \def\shortchapentry#1#2#3#4{%
  5808. \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}%
  5809. }
  5810. % Appendices, in the main contents.
  5811. % Need the word Appendix, and a fixed-size box.
  5812. %
  5813. \def\appendixbox#1{%
  5814. % We use M since it's probably the widest letter.
  5815. \setbox0 = \hbox{\putwordAppendix{} M}%
  5816. \hbox to \wd0{\putwordAppendix{} #1\hss}}
  5817. %
  5818. \def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}}
  5819. % Unnumbered chapters.
  5820. \def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}
  5821. \def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}}
  5822. % Sections.
  5823. \def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}}
  5824. \let\appsecentry=\numsecentry
  5825. \def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}}
  5826. % Subsections.
  5827. \def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}}
  5828. \let\appsubsecentry=\numsubsecentry
  5829. \def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}
  5830. % And subsubsections.
  5831. \def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}}
  5832. \let\appsubsubsecentry=\numsubsubsecentry
  5833. \def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}}
  5834. % This parameter controls the indentation of the various levels.
  5835. % Same as \defaultparindent.
  5836. \newdimen\tocindent \tocindent = 15pt
  5837. % Now for the actual typesetting. In all these, #1 is the text and #2 is the
  5838. % page number.
  5839. %
  5840. % If the toc has to be broken over pages, we want it to be at chapters
  5841. % if at all possible; hence the \penalty.
  5842. \def\dochapentry#1#2{%
  5843. \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
  5844. \begingroup
  5845. \chapentryfonts
  5846. \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  5847. \endgroup
  5848. \nobreak\vskip .25\baselineskip plus.1\baselineskip
  5849. }
  5850. \def\dosecentry#1#2{\begingroup
  5851. \secentryfonts \leftskip=\tocindent
  5852. \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  5853. \endgroup}
  5854. \def\dosubsecentry#1#2{\begingroup
  5855. \subsecentryfonts \leftskip=2\tocindent
  5856. \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  5857. \endgroup}
  5858. \def\dosubsubsecentry#1#2{\begingroup
  5859. \subsubsecentryfonts \leftskip=3\tocindent
  5860. \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  5861. \endgroup}
  5862. % We use the same \entry macro as for the index entries.
  5863. \let\tocentry = \entry
  5864. % Space between chapter (or whatever) number and the title.
  5865. \def\labelspace{\hskip1em \relax}
  5866. \def\dopageno#1{{\rm #1}}
  5867. \def\doshortpageno#1{{\rm #1}}
  5868. \def\chapentryfonts{\secfonts \rm}
  5869. \def\secentryfonts{\textfonts}
  5870. \def\subsecentryfonts{\textfonts}
  5871. \def\subsubsecentryfonts{\textfonts}
  5872. \message{environments,}
  5873. % @foo ... @end foo.
  5874. % @tex ... @end tex escapes into raw TeX temporarily.
  5875. % One exception: @ is still an escape character, so that @end tex works.
  5876. % But \@ or @@ will get a plain @ character.
  5877. \envdef\tex{%
  5878. \setupmarkupstyle{tex}%
  5879. \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
  5880. \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
  5881. \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
  5882. \catcode `\%=14
  5883. \catcode `\+=\other
  5884. \catcode `\"=\other
  5885. \catcode `\|=\other
  5886. \catcode `\<=\other
  5887. \catcode `\>=\other
  5888. \catcode `\`=\other
  5889. \catcode `\'=\other
  5890. \escapechar=`\\
  5891. %
  5892. % ' is active in math mode (mathcode"8000). So reset it, and all our
  5893. % other math active characters (just in case), to plain's definitions.
  5894. \mathactive
  5895. %
  5896. % Inverse of the list at the beginning of the file.
  5897. \let\b=\ptexb
  5898. \let\bullet=\ptexbullet
  5899. \let\c=\ptexc
  5900. \let\,=\ptexcomma
  5901. \let\.=\ptexdot
  5902. \let\dots=\ptexdots
  5903. \let\equiv=\ptexequiv
  5904. \let\!=\ptexexclam
  5905. \let\i=\ptexi
  5906. \let\indent=\ptexindent
  5907. \let\noindent=\ptexnoindent
  5908. \let\{=\ptexlbrace
  5909. \let\+=\tabalign
  5910. \let\}=\ptexrbrace
  5911. \let\/=\ptexslash
  5912. \let\sp=\ptexsp
  5913. \let\*=\ptexstar
  5914. %\let\sup=\ptexsup % do not redefine, we want @sup to work in math mode
  5915. \let\t=\ptext
  5916. \expandafter \let\csname top\endcsname=\ptextop % we've made it outer
  5917. \let\frenchspacing=\plainfrenchspacing
  5918. %
  5919. \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
  5920. \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
  5921. \def\@{@}%
  5922. }
  5923. % There is no need to define \Etex.
  5924. % Define @lisp ... @end lisp.
  5925. % @lisp environment forms a group so it can rebind things,
  5926. % including the definition of @end lisp (which normally is erroneous).
  5927. % Amount to narrow the margins by for @lisp.
  5928. \newskip\lispnarrowing \lispnarrowing=0.4in
  5929. % This is the definition that ^^M gets inside @lisp, @example, and other
  5930. % such environments. \null is better than a space, since it doesn't
  5931. % have any width.
  5932. \def\lisppar{\null\endgraf}
  5933. % This space is always present above and below environments.
  5934. \newskip\envskipamount \envskipamount = 0pt
  5935. % Make spacing and below environment symmetrical. We use \parskip here
  5936. % to help in doing that, since in @example-like environments \parskip
  5937. % is reset to zero; thus the \afterenvbreak inserts no space -- but the
  5938. % start of the next paragraph will insert \parskip.
  5939. %
  5940. \def\aboveenvbreak{{%
  5941. % =10000 instead of <10000 because of a special case in \itemzzz and
  5942. % \sectionheading, q.v.
  5943. \ifnum \lastpenalty=10000 \else
  5944. \advance\envskipamount by \parskip
  5945. \endgraf
  5946. \ifdim\lastskip<\envskipamount
  5947. \removelastskip
  5948. % it's not a good place to break if the last penalty was \nobreak
  5949. % or better ...
  5950. \ifnum\lastpenalty<10000 \penalty-50 \fi
  5951. \vskip\envskipamount
  5952. \fi
  5953. \fi
  5954. }}
  5955. \let\afterenvbreak = \aboveenvbreak
  5956. % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will
  5957. % also clear it, so that its embedded environments do the narrowing again.
  5958. \let\nonarrowing=\relax
  5959. % @cartouche ... @end cartouche: draw rectangle w/rounded corners around
  5960. % environment contents.
  5961. \font\circle=lcircle10
  5962. \newdimen\circthick
  5963. \newdimen\cartouter\newdimen\cartinner
  5964. \newskip\normbskip\newskip\normpskip\newskip\normlskip
  5965. \circthick=\fontdimen8\circle
  5966. %
  5967. \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
  5968. \def\ctr{{\hskip 6pt\circle\char'010}}
  5969. \def\cbl{{\circle\char'012\hskip -6pt}}
  5970. \def\cbr{{\hskip 6pt\circle\char'011}}
  5971. \def\carttop{\hbox to \cartouter{\hskip\lskip
  5972. \ctl\leaders\hrule height\circthick\hfil\ctr
  5973. \hskip\rskip}}
  5974. \def\cartbot{\hbox to \cartouter{\hskip\lskip
  5975. \cbl\leaders\hrule height\circthick\hfil\cbr
  5976. \hskip\rskip}}
  5977. %
  5978. \newskip\lskip\newskip\rskip
  5979. \envdef\cartouche{%
  5980. \ifhmode\par\fi % can't be in the midst of a paragraph.
  5981. \startsavinginserts
  5982. \lskip=\leftskip \rskip=\rightskip
  5983. \leftskip=0pt\rightskip=0pt % we want these *outside*.
  5984. \cartinner=\hsize \advance\cartinner by-\lskip
  5985. \advance\cartinner by-\rskip
  5986. \cartouter=\hsize
  5987. \advance\cartouter by 18.4pt % allow for 3pt kerns on either
  5988. % side, and for 6pt waste from
  5989. % each corner char, and rule thickness
  5990. \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
  5991. %
  5992. % If this cartouche directly follows a sectioning command, we need the
  5993. % \parskip glue (backspaced over by default) or the cartouche can
  5994. % collide with the section heading.
  5995. \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi
  5996. %
  5997. \vbox\bgroup
  5998. \baselineskip=0pt\parskip=0pt\lineskip=0pt
  5999. \carttop
  6000. \hbox\bgroup
  6001. \hskip\lskip
  6002. \vrule\kern3pt
  6003. \vbox\bgroup
  6004. \kern3pt
  6005. \hsize=\cartinner
  6006. \baselineskip=\normbskip
  6007. \lineskip=\normlskip
  6008. \parskip=\normpskip
  6009. \vskip -\parskip
  6010. \comment % For explanation, see the end of def\group.
  6011. }
  6012. \def\Ecartouche{%
  6013. \ifhmode\par\fi
  6014. \kern3pt
  6015. \egroup
  6016. \kern3pt\vrule
  6017. \hskip\rskip
  6018. \egroup
  6019. \cartbot
  6020. \egroup
  6021. \checkinserts
  6022. }
  6023. % This macro is called at the beginning of all the @example variants,
  6024. % inside a group.
  6025. \newdimen\nonfillparindent
  6026. \def\nonfillstart{%
  6027. \aboveenvbreak
  6028. \ifdim\hfuzz < 12pt \hfuzz = 12pt \fi % Don't be fussy
  6029. \sepspaces % Make spaces be word-separators rather than space tokens.
  6030. \let\par = \lisppar % don't ignore blank lines
  6031. \obeylines % each line of input is a line of output
  6032. \parskip = 0pt
  6033. % Turn off paragraph indentation but redefine \indent to emulate
  6034. % the normal \indent.
  6035. \nonfillparindent=\parindent
  6036. \parindent = 0pt
  6037. \let\indent\nonfillindent
  6038. %
  6039. \emergencystretch = 0pt % don't try to avoid overfull boxes
  6040. \ifx\nonarrowing\relax
  6041. \advance \leftskip by \lispnarrowing
  6042. \exdentamount=\lispnarrowing
  6043. \else
  6044. \let\nonarrowing = \relax
  6045. \fi
  6046. \let\exdent=\nofillexdent
  6047. }
  6048. \begingroup
  6049. \obeyspaces
  6050. % We want to swallow spaces (but not other tokens) after the fake
  6051. % @indent in our nonfill-environments, where spaces are normally
  6052. % active and set to @tie, resulting in them not being ignored after
  6053. % @indent.
  6054. \gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}%
  6055. \gdef\nonfillindentcheck{%
  6056. \ifx\temp %
  6057. \expandafter\nonfillindentgobble%
  6058. \else%
  6059. \leavevmode\nonfillindentbox%
  6060. \fi%
  6061. }%
  6062. \endgroup
  6063. \def\nonfillindentgobble#1{\nonfillindent}
  6064. \def\nonfillindentbox{\hbox to \nonfillparindent{\hss}}
  6065. % If you want all examples etc. small: @set dispenvsize small.
  6066. % If you want even small examples the full size: @set dispenvsize nosmall.
  6067. % This affects the following displayed environments:
  6068. % @example, @display, @format, @lisp
  6069. %
  6070. \def\smallword{small}
  6071. \def\nosmallword{nosmall}
  6072. \let\SETdispenvsize\relax
  6073. \def\setnormaldispenv{%
  6074. \ifx\SETdispenvsize\smallword
  6075. % end paragraph for sake of leading, in case document has no blank
  6076. % line. This is redundant with what happens in \aboveenvbreak, but
  6077. % we need to do it before changing the fonts, and it's inconvenient
  6078. % to change the fonts afterward.
  6079. \ifnum \lastpenalty=10000 \else \endgraf \fi
  6080. \smallexamplefonts \rm
  6081. \fi
  6082. }
  6083. \def\setsmalldispenv{%
  6084. \ifx\SETdispenvsize\nosmallword
  6085. \else
  6086. \ifnum \lastpenalty=10000 \else \endgraf \fi
  6087. \smallexamplefonts \rm
  6088. \fi
  6089. }
  6090. % We often define two environments, @foo and @smallfoo.
  6091. % Let's do it in one command. #1 is the env name, #2 the definition.
  6092. \def\makedispenvdef#1#2{%
  6093. \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}%
  6094. \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}%
  6095. \expandafter\let\csname E#1\endcsname \afterenvbreak
  6096. \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
  6097. }
  6098. % Define two environment synonyms (#1 and #2) for an environment.
  6099. \def\maketwodispenvdef#1#2#3{%
  6100. \makedispenvdef{#1}{#3}%
  6101. \makedispenvdef{#2}{#3}%
  6102. }
  6103. %
  6104. % @lisp: indented, narrowed, typewriter font;
  6105. % @example: same as @lisp.
  6106. %
  6107. % @smallexample and @smalllisp: use smaller fonts.
  6108. % Originally contributed by Pavel@xerox.
  6109. %
  6110. \maketwodispenvdef{lisp}{example}{%
  6111. \nonfillstart
  6112. \tt\setupmarkupstyle{example}%
  6113. \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
  6114. \gobble % eat return
  6115. }
  6116. % @display/@smalldisplay: same as @lisp except keep current font.
  6117. %
  6118. \makedispenvdef{display}{%
  6119. \nonfillstart
  6120. \gobble
  6121. }
  6122. % @format/@smallformat: same as @display except don't narrow margins.
  6123. %
  6124. \makedispenvdef{format}{%
  6125. \let\nonarrowing = t%
  6126. \nonfillstart
  6127. \gobble
  6128. }
  6129. % @flushleft: same as @format, but doesn't obey \SETdispenvsize.
  6130. \envdef\flushleft{%
  6131. \let\nonarrowing = t%
  6132. \nonfillstart
  6133. \gobble
  6134. }
  6135. \let\Eflushleft = \afterenvbreak
  6136. % @flushright.
  6137. %
  6138. \envdef\flushright{%
  6139. \let\nonarrowing = t%
  6140. \nonfillstart
  6141. \advance\leftskip by 0pt plus 1fill\relax
  6142. \gobble
  6143. }
  6144. \let\Eflushright = \afterenvbreak
  6145. % @raggedright does more-or-less normal line breaking but no right
  6146. % justification. From plain.tex. Don't stretch around special
  6147. % characters in urls in this environment, since the stretch at the right
  6148. % should be enough.
  6149. \envdef\raggedright{%
  6150. \rightskip0pt plus2.4em \spaceskip.3333em \xspaceskip.5em\relax
  6151. \def\urefprestretchamount{0pt}%
  6152. \def\urefpoststretchamount{0pt}%
  6153. }
  6154. \let\Eraggedright\par
  6155. \envdef\raggedleft{%
  6156. \parindent=0pt \leftskip0pt plus2em
  6157. \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
  6158. \hbadness=10000 % Last line will usually be underfull, so turn off
  6159. % badness reporting.
  6160. }
  6161. \let\Eraggedleft\par
  6162. \envdef\raggedcenter{%
  6163. \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em
  6164. \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
  6165. \hbadness=10000 % Last line will usually be underfull, so turn off
  6166. % badness reporting.
  6167. }
  6168. \let\Eraggedcenter\par
  6169. % @quotation does normal linebreaking (hence we can't use \nonfillstart)
  6170. % and narrows the margins. We keep \parskip nonzero in general, since
  6171. % we're doing normal filling. So, when using \aboveenvbreak and
  6172. % \afterenvbreak, temporarily make \parskip 0.
  6173. %
  6174. \makedispenvdef{quotation}{\quotationstart}
  6175. %
  6176. \def\quotationstart{%
  6177. \indentedblockstart % same as \indentedblock, but increase right margin too.
  6178. \ifx\nonarrowing\relax
  6179. \advance\rightskip by \lispnarrowing
  6180. \fi
  6181. \parsearg\quotationlabel
  6182. }
  6183. % We have retained a nonzero parskip for the environment, since we're
  6184. % doing normal filling.
  6185. %
  6186. \def\Equotation{%
  6187. \par
  6188. \ifx\quotationauthor\thisisundefined\else
  6189. % indent a bit.
  6190. \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
  6191. \fi
  6192. {\parskip=0pt \afterenvbreak}%
  6193. }
  6194. \def\Esmallquotation{\Equotation}
  6195. % If we're given an argument, typeset it in bold with a colon after.
  6196. \def\quotationlabel#1{%
  6197. \def\temp{#1}%
  6198. \ifx\temp\empty \else
  6199. {\bf #1: }%
  6200. \fi
  6201. }
  6202. % @indentedblock is like @quotation, but indents only on the left and
  6203. % has no optional argument.
  6204. %
  6205. \makedispenvdef{indentedblock}{\indentedblockstart}
  6206. %
  6207. \def\indentedblockstart{%
  6208. {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
  6209. \parindent=0pt
  6210. %
  6211. % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
  6212. \ifx\nonarrowing\relax
  6213. \advance\leftskip by \lispnarrowing
  6214. \exdentamount = \lispnarrowing
  6215. \else
  6216. \let\nonarrowing = \relax
  6217. \fi
  6218. }
  6219. % Keep a nonzero parskip for the environment, since we're doing normal filling.
  6220. %
  6221. \def\Eindentedblock{%
  6222. \par
  6223. {\parskip=0pt \afterenvbreak}%
  6224. }
  6225. \def\Esmallindentedblock{\Eindentedblock}
  6226. % LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
  6227. % If we want to allow any <char> as delimiter,
  6228. % we need the curly braces so that makeinfo sees the @verb command, eg:
  6229. % `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
  6230. %
  6231. % [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
  6232. %
  6233. % [Knuth] p.344; only we need to do the other characters Texinfo sets
  6234. % active too. Otherwise, they get lost as the first character on a
  6235. % verbatim line.
  6236. \def\dospecials{%
  6237. \do\ \do\\\do\{\do\}\do\$\do\&%
  6238. \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
  6239. \do\<\do\>\do\|\do\@\do+\do\"%
  6240. % Don't do the quotes -- if we do, @set txicodequoteundirected and
  6241. % @set txicodequotebacktick will not have effect on @verb and
  6242. % @verbatim, and ?` and !` ligatures won't get disabled.
  6243. %\do\`\do\'%
  6244. }
  6245. %
  6246. % [Knuth] p. 380
  6247. \def\uncatcodespecials{%
  6248. \def\do##1{\catcode`##1=\other}\dospecials}
  6249. %
  6250. % Setup for the @verb command.
  6251. %
  6252. % Eight spaces for a tab
  6253. \begingroup
  6254. \catcode`\^^I=\active
  6255. \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
  6256. \endgroup
  6257. %
  6258. \def\setupverb{%
  6259. \tt % easiest (and conventionally used) font for verbatim
  6260. \def\par{\leavevmode\endgraf}%
  6261. \setupmarkupstyle{verb}%
  6262. \tabeightspaces
  6263. % Respect line breaks,
  6264. % print special symbols as themselves, and
  6265. % make each space count
  6266. % must do in this order:
  6267. \obeylines \uncatcodespecials \sepspaces
  6268. }
  6269. % Setup for the @verbatim environment
  6270. %
  6271. % Real tab expansion.
  6272. \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
  6273. %
  6274. % We typeset each line of the verbatim in an \hbox, so we can handle
  6275. % tabs. The \global is in case the verbatim line starts with an accent,
  6276. % or some other command that starts with a begin-group. Otherwise, the
  6277. % entire \verbbox would disappear at the corresponding end-group, before
  6278. % it is typeset. Meanwhile, we can't have nested verbatim commands
  6279. % (can we?), so the \global won't be overwriting itself.
  6280. \newbox\verbbox
  6281. \def\starttabbox{\global\setbox\verbbox=\hbox\bgroup}
  6282. %
  6283. \begingroup
  6284. \catcode`\^^I=\active
  6285. \gdef\tabexpand{%
  6286. \catcode`\^^I=\active
  6287. \def^^I{\leavevmode\egroup
  6288. \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab
  6289. \divide\dimen\verbbox by\tabw
  6290. \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw
  6291. \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw
  6292. \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox
  6293. }%
  6294. }
  6295. \endgroup
  6296. % start the verbatim environment.
  6297. \def\setupverbatim{%
  6298. \let\nonarrowing = t%
  6299. \nonfillstart
  6300. \tt % easiest (and conventionally used) font for verbatim
  6301. % The \leavevmode here is for blank lines. Otherwise, we would
  6302. % never \starttabox and the \egroup would end verbatim mode.
  6303. \def\par{\leavevmode\egroup\box\verbbox\endgraf}%
  6304. \tabexpand
  6305. \setupmarkupstyle{verbatim}%
  6306. % Respect line breaks,
  6307. % print special symbols as themselves, and
  6308. % make each space count.
  6309. % Must do in this order:
  6310. \obeylines \uncatcodespecials \sepspaces
  6311. \everypar{\starttabbox}%
  6312. }
  6313. % Do the @verb magic: verbatim text is quoted by unique
  6314. % delimiter characters. Before first delimiter expect a
  6315. % right brace, after last delimiter expect closing brace:
  6316. %
  6317. % \def\doverb'{'<char>#1<char>'}'{#1}
  6318. %
  6319. % [Knuth] p. 382; only eat outer {}
  6320. \begingroup
  6321. \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other
  6322. \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
  6323. \endgroup
  6324. %
  6325. \def\verb{\begingroup\setupverb\doverb}
  6326. %
  6327. %
  6328. % Do the @verbatim magic: define the macro \doverbatim so that
  6329. % the (first) argument ends when '@end verbatim' is reached, ie:
  6330. %
  6331. % \def\doverbatim#1@end verbatim{#1}
  6332. %
  6333. % For Texinfo it's a lot easier than for LaTeX,
  6334. % because texinfo's \verbatim doesn't stop at '\end{verbatim}':
  6335. % we need not redefine '\', '{' and '}'.
  6336. %
  6337. % Inspired by LaTeX's verbatim command set [latex.ltx]
  6338. %
  6339. \begingroup
  6340. \catcode`\ =\active
  6341. \obeylines %
  6342. % ignore everything up to the first ^^M, that's the newline at the end
  6343. % of the @verbatim input line itself. Otherwise we get an extra blank
  6344. % line in the output.
  6345. \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}%
  6346. % We really want {...\end verbatim} in the body of the macro, but
  6347. % without the active space; thus we have to use \xdef and \gobble.
  6348. \endgroup
  6349. %
  6350. \envdef\verbatim{%
  6351. \setupverbatim\doverbatim
  6352. }
  6353. \let\Everbatim = \afterenvbreak
  6354. % @verbatiminclude FILE - insert text of file in verbatim environment.
  6355. %
  6356. \def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude}
  6357. %
  6358. \def\doverbatiminclude#1{%
  6359. {%
  6360. \makevalueexpandable
  6361. \setupverbatim
  6362. \indexnofonts % Allow `@@' and other weird things in file names.
  6363. \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
  6364. \input #1
  6365. \afterenvbreak
  6366. }%
  6367. }
  6368. % @copying ... @end copying.
  6369. % Save the text away for @insertcopying later.
  6370. %
  6371. % We save the uninterpreted tokens, rather than creating a box.
  6372. % Saving the text in a box would be much easier, but then all the
  6373. % typesetting commands (@smallbook, font changes, etc.) have to be done
  6374. % beforehand -- and a) we want @copying to be done first in the source
  6375. % file; b) letting users define the frontmatter in as flexible order as
  6376. % possible is very desirable.
  6377. %
  6378. \def\copying{\checkenv{}\begingroup\scanargctxt\docopying}
  6379. \def\docopying#1@end copying{\endgroup\def\copyingtext{#1}}
  6380. %
  6381. \def\insertcopying{%
  6382. \begingroup
  6383. \parindent = 0pt % paragraph indentation looks wrong on title page
  6384. \scanexp\copyingtext
  6385. \endgroup
  6386. }
  6387. \message{defuns,}
  6388. % @defun etc.
  6389. \newskip\defbodyindent \defbodyindent=.4in
  6390. \newskip\defargsindent \defargsindent=50pt
  6391. \newskip\deflastargmargin \deflastargmargin=18pt
  6392. \newcount\defunpenalty
  6393. % Start the processing of @deffn:
  6394. \def\startdefun{%
  6395. \ifnum\lastpenalty<10000
  6396. \medbreak
  6397. \defunpenalty=10003 % Will keep this @deffn together with the
  6398. % following @def command, see below.
  6399. \else
  6400. % If there are two @def commands in a row, we'll have a \nobreak,
  6401. % which is there to keep the function description together with its
  6402. % header. But if there's nothing but headers, we need to allow a
  6403. % break somewhere. Check specifically for penalty 10002, inserted
  6404. % by \printdefunline, instead of 10000, since the sectioning
  6405. % commands also insert a nobreak penalty, and we don't want to allow
  6406. % a break between a section heading and a defun.
  6407. %
  6408. % As a further refinement, we avoid "club" headers by signalling
  6409. % with penalty of 10003 after the very first @deffn in the
  6410. % sequence (see above), and penalty of 10002 after any following
  6411. % @def command.
  6412. \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi
  6413. %
  6414. % Similarly, after a section heading, do not allow a break.
  6415. % But do insert the glue.
  6416. \medskip % preceded by discardable penalty, so not a breakpoint
  6417. \fi
  6418. %
  6419. \parindent=0in
  6420. \advance\leftskip by \defbodyindent
  6421. \exdentamount=\defbodyindent
  6422. }
  6423. \def\dodefunx#1{%
  6424. % First, check whether we are in the right environment:
  6425. \checkenv#1%
  6426. %
  6427. % As above, allow line break if we have multiple x headers in a row.
  6428. % It's not a great place, though.
  6429. \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi
  6430. %
  6431. % And now, it's time to reuse the body of the original defun:
  6432. \expandafter\gobbledefun#1%
  6433. }
  6434. \def\gobbledefun#1\startdefun{}
  6435. % \printdefunline \deffnheader{text}
  6436. %
  6437. \def\printdefunline#1#2{%
  6438. \begingroup
  6439. % call \deffnheader:
  6440. #1#2 \endheader
  6441. % common ending:
  6442. \interlinepenalty = 10000
  6443. \advance\rightskip by 0pt plus 1fil\relax
  6444. \endgraf
  6445. \nobreak\vskip -\parskip
  6446. \penalty\defunpenalty % signal to \startdefun and \dodefunx
  6447. % Some of the @defun-type tags do not enable magic parentheses,
  6448. % rendering the following check redundant. But we don't optimize.
  6449. \checkparencounts
  6450. \endgroup
  6451. }
  6452. \def\Edefun{\endgraf\medbreak}
  6453. % \makedefun{deffn} creates \deffn, \deffnx and \Edeffn;
  6454. % the only thing remaining is to define \deffnheader.
  6455. %
  6456. \def\makedefun#1{%
  6457. \expandafter\let\csname E#1\endcsname = \Edefun
  6458. \edef\temp{\noexpand\domakedefun
  6459. \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}%
  6460. \temp
  6461. }
  6462. % \domakedefun \deffn \deffnx \deffnheader
  6463. %
  6464. % Define \deffn and \deffnx, without parameters.
  6465. % \deffnheader has to be defined explicitly.
  6466. %
  6467. \def\domakedefun#1#2#3{%
  6468. \envdef#1{%
  6469. \startdefun
  6470. \doingtypefnfalse % distinguish typed functions from all else
  6471. \parseargusing\activeparens{\printdefunline#3}%
  6472. }%
  6473. \def#2{\dodefunx#1}%
  6474. \def#3%
  6475. }
  6476. \newif\ifdoingtypefn % doing typed function?
  6477. \newif\ifrettypeownline % typeset return type on its own line?
  6478. % @deftypefnnewline on|off says whether the return type of typed functions
  6479. % are printed on their own line. This affects @deftypefn, @deftypefun,
  6480. % @deftypeop, and @deftypemethod.
  6481. %
  6482. \parseargdef\deftypefnnewline{%
  6483. \def\temp{#1}%
  6484. \ifx\temp\onword
  6485. \expandafter\let\csname SETtxideftypefnnl\endcsname
  6486. = \empty
  6487. \else\ifx\temp\offword
  6488. \expandafter\let\csname SETtxideftypefnnl\endcsname
  6489. = \relax
  6490. \else
  6491. \errhelp = \EMsimple
  6492. \errmessage{Unknown @txideftypefnnl value `\temp',
  6493. must be on|off}%
  6494. \fi\fi
  6495. }
  6496. % Untyped functions:
  6497. % @deffn category name args
  6498. \makedefun{deffn}{\deffngeneral{}}
  6499. % @deffn category class name args
  6500. \makedefun{defop}#1 {\defopon{#1\ \putwordon}}
  6501. % \defopon {category on}class name args
  6502. \def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
  6503. % \deffngeneral {subind}category name args
  6504. %
  6505. \def\deffngeneral#1#2 #3 #4\endheader{%
  6506. % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}.
  6507. \dosubind{fn}{\code{#3}}{#1}%
  6508. \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
  6509. }
  6510. % Typed functions:
  6511. % @deftypefn category type name args
  6512. \makedefun{deftypefn}{\deftypefngeneral{}}
  6513. % @deftypeop category class type name args
  6514. \makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}}
  6515. % \deftypeopon {category on}class type name args
  6516. \def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
  6517. % \deftypefngeneral {subind}category type name args
  6518. %
  6519. \def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
  6520. \dosubind{fn}{\code{#4}}{#1}%
  6521. \doingtypefntrue
  6522. \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
  6523. }
  6524. % Typed variables:
  6525. % @deftypevr category type var args
  6526. \makedefun{deftypevr}{\deftypecvgeneral{}}
  6527. % @deftypecv category class type var args
  6528. \makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}}
  6529. % \deftypecvof {category of}class type var args
  6530. \def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} }
  6531. % \deftypecvgeneral {subind}category type var args
  6532. %
  6533. \def\deftypecvgeneral#1#2 #3 #4 #5\endheader{%
  6534. \dosubind{vr}{\code{#4}}{#1}%
  6535. \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
  6536. }
  6537. % Untyped variables:
  6538. % @defvr category var args
  6539. \makedefun{defvr}#1 {\deftypevrheader{#1} {} }
  6540. % @defcv category class var args
  6541. \makedefun{defcv}#1 {\defcvof{#1\ \putwordof}}
  6542. % \defcvof {category of}class var args
  6543. \def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
  6544. % Types:
  6545. % @deftp category name args
  6546. \makedefun{deftp}#1 #2 #3\endheader{%
  6547. \doind{tp}{\code{#2}}%
  6548. \defname{#1}{}{#2}\defunargs{#3\unskip}%
  6549. }
  6550. % Remaining @defun-like shortcuts:
  6551. \makedefun{defun}{\deffnheader{\putwordDeffunc} }
  6552. \makedefun{defmac}{\deffnheader{\putwordDefmac} }
  6553. \makedefun{defspec}{\deffnheader{\putwordDefspec} }
  6554. \makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} }
  6555. \makedefun{defvar}{\defvrheader{\putwordDefvar} }
  6556. \makedefun{defopt}{\defvrheader{\putwordDefopt} }
  6557. \makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} }
  6558. \makedefun{defmethod}{\defopon\putwordMethodon}
  6559. \makedefun{deftypemethod}{\deftypeopon\putwordMethodon}
  6560. \makedefun{defivar}{\defcvof\putwordInstanceVariableof}
  6561. \makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof}
  6562. % \defname, which formats the name of the @def (not the args).
  6563. % #1 is the category, such as "Function".
  6564. % #2 is the return type, if any.
  6565. % #3 is the function name.
  6566. %
  6567. % We are followed by (but not passed) the arguments, if any.
  6568. %
  6569. \def\defname#1#2#3{%
  6570. \par
  6571. % Get the values of \leftskip and \rightskip as they were outside the @def...
  6572. \advance\leftskip by -\defbodyindent
  6573. %
  6574. % Determine if we are typesetting the return type of a typed function
  6575. % on a line by itself.
  6576. \rettypeownlinefalse
  6577. \ifdoingtypefn % doing a typed function specifically?
  6578. % then check user option for putting return type on its own line:
  6579. \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else
  6580. \rettypeownlinetrue
  6581. \fi
  6582. \fi
  6583. %
  6584. % How we'll format the category name. Putting it in brackets helps
  6585. % distinguish it from the body text that may end up on the next line
  6586. % just below it.
  6587. \def\temp{#1}%
  6588. \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
  6589. %
  6590. % Figure out line sizes for the paragraph shape. We'll always have at
  6591. % least two.
  6592. \tempnum = 2
  6593. %
  6594. % The first line needs space for \box0; but if \rightskip is nonzero,
  6595. % we need only space for the part of \box0 which exceeds it:
  6596. \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip
  6597. %
  6598. % If doing a return type on its own line, we'll have another line.
  6599. \ifrettypeownline
  6600. \advance\tempnum by 1
  6601. \def\maybeshapeline{0in \hsize}%
  6602. \else
  6603. \def\maybeshapeline{}%
  6604. \fi
  6605. %
  6606. % The continuations:
  6607. \dimen2=\hsize \advance\dimen2 by -\defargsindent
  6608. %
  6609. % The final paragraph shape:
  6610. \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2
  6611. %
  6612. % Put the category name at the right margin.
  6613. \noindent
  6614. \hbox to 0pt{%
  6615. \hfil\box0 \kern-\hsize
  6616. % \hsize has to be shortened this way:
  6617. \kern\leftskip
  6618. % Intentionally do not respect \rightskip, since we need the space.
  6619. }%
  6620. %
  6621. % Allow all lines to be underfull without complaint:
  6622. \tolerance=10000 \hbadness=10000
  6623. \exdentamount=\defbodyindent
  6624. {%
  6625. % defun fonts. We use typewriter by default (used to be bold) because:
  6626. % . we're printing identifiers, they should be in tt in principle.
  6627. % . in languages with many accents, such as Czech or French, it's
  6628. % common to leave accents off identifiers. The result looks ok in
  6629. % tt, but exceedingly strange in rm.
  6630. % . we don't want -- and --- to be treated as ligatures.
  6631. % . this still does not fix the ?` and !` ligatures, but so far no
  6632. % one has made identifiers using them :).
  6633. \df \tt
  6634. \def\temp{#2}% text of the return type
  6635. \ifx\temp\empty\else
  6636. \tclose{\temp}% typeset the return type
  6637. \ifrettypeownline
  6638. % put return type on its own line; prohibit line break following:
  6639. \hfil\vadjust{\nobreak}\break
  6640. \else
  6641. \space % type on same line, so just followed by a space
  6642. \fi
  6643. \fi % no return type
  6644. #3% output function name
  6645. }%
  6646. {\rm\enskip}% hskip 0.5 em of \tenrm
  6647. %
  6648. \boldbrax
  6649. % arguments will be output next, if any.
  6650. }
  6651. % Print arguments in slanted roman (not ttsl), inconsistently with using
  6652. % tt for the name. This is because literal text is sometimes needed in
  6653. % the argument list (groff manual), and ttsl and tt are not very
  6654. % distinguishable. Prevent hyphenation at `-' chars.
  6655. %
  6656. \def\defunargs#1{%
  6657. % use sl by default (not ttsl),
  6658. % tt for the names.
  6659. \df \sl \hyphenchar\font=0
  6660. %
  6661. % On the other hand, if an argument has two dashes (for instance), we
  6662. % want a way to get ttsl. We used to recommend @var for that, so
  6663. % leave the code in, but it's strange for @var to lead to typewriter.
  6664. % Nowadays we recommend @code, since the difference between a ttsl hyphen
  6665. % and a tt hyphen is pretty tiny. @code also disables ?` !`.
  6666. \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}%
  6667. #1%
  6668. \sl\hyphenchar\font=45
  6669. }
  6670. % We want ()&[] to print specially on the defun line.
  6671. %
  6672. \def\activeparens{%
  6673. \catcode`\(=\active \catcode`\)=\active
  6674. \catcode`\[=\active \catcode`\]=\active
  6675. \catcode`\&=\active
  6676. }
  6677. % Make control sequences which act like normal parenthesis chars.
  6678. \let\lparen = ( \let\rparen = )
  6679. % Be sure that we always have a definition for `(', etc. For example,
  6680. % if the fn name has parens in it, \boldbrax will not be in effect yet,
  6681. % so TeX would otherwise complain about undefined control sequence.
  6682. {
  6683. \activeparens
  6684. \global\let(=\lparen \global\let)=\rparen
  6685. \global\let[=\lbrack \global\let]=\rbrack
  6686. \global\let& = \&
  6687. \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
  6688. \gdef\magicamp{\let&=\amprm}
  6689. }
  6690. \newcount\parencount
  6691. % If we encounter &foo, then turn on ()-hacking afterwards
  6692. \newif\ifampseen
  6693. \def\amprm#1 {\ampseentrue{\bf\&#1 }}
  6694. \def\parenfont{%
  6695. \ifampseen
  6696. % At the first level, print parens in roman,
  6697. % otherwise use the default font.
  6698. \ifnum \parencount=1 \rm \fi
  6699. \else
  6700. % The \sf parens (in \boldbrax) actually are a little bolder than
  6701. % the contained text. This is especially needed for [ and ] .
  6702. \sf
  6703. \fi
  6704. }
  6705. \def\infirstlevel#1{%
  6706. \ifampseen
  6707. \ifnum\parencount=1
  6708. #1%
  6709. \fi
  6710. \fi
  6711. }
  6712. \def\bfafterword#1 {#1 \bf}
  6713. \def\opnr{%
  6714. \global\advance\parencount by 1
  6715. {\parenfont(}%
  6716. \infirstlevel \bfafterword
  6717. }
  6718. \def\clnr{%
  6719. {\parenfont)}%
  6720. \infirstlevel \sl
  6721. \global\advance\parencount by -1
  6722. }
  6723. \newcount\brackcount
  6724. \def\lbrb{%
  6725. \global\advance\brackcount by 1
  6726. {\bf[}%
  6727. }
  6728. \def\rbrb{%
  6729. {\bf]}%
  6730. \global\advance\brackcount by -1
  6731. }
  6732. \def\checkparencounts{%
  6733. \ifnum\parencount=0 \else \badparencount \fi
  6734. \ifnum\brackcount=0 \else \badbrackcount \fi
  6735. }
  6736. % these should not use \errmessage; the glibc manual, at least, actually
  6737. % has such constructs (when documenting function pointers).
  6738. \def\badparencount{%
  6739. \message{Warning: unbalanced parentheses in @def...}%
  6740. \global\parencount=0
  6741. }
  6742. \def\badbrackcount{%
  6743. \message{Warning: unbalanced square brackets in @def...}%
  6744. \global\brackcount=0
  6745. }
  6746. \message{macros,}
  6747. % @macro.
  6748. % To do this right we need a feature of e-TeX, \scantokens,
  6749. % which we arrange to emulate with a temporary file in ordinary TeX.
  6750. \ifx\eTeXversion\thisisundefined
  6751. \newwrite\macscribble
  6752. \def\scantokens#1{%
  6753. \toks0={#1}%
  6754. \immediate\openout\macscribble=\jobname.tmp
  6755. \immediate\write\macscribble{\the\toks0}%
  6756. \immediate\closeout\macscribble
  6757. \input \jobname.tmp
  6758. }
  6759. \fi
  6760. \def\scanmacro#1{\begingroup
  6761. \newlinechar`\^^M
  6762. \let\xeatspaces\eatspaces
  6763. %
  6764. % Undo catcode changes of \startcontents and \doprintindex
  6765. % When called from @insertcopying or (short)caption, we need active
  6766. % backslash to get it printed correctly. Previously, we had
  6767. % \catcode`\\=\other instead. We'll see whether a problem appears
  6768. % with macro expansion. --kasal, 19aug04
  6769. \catcode`\@=0 \catcode`\\=\active \escapechar=`\@
  6770. %
  6771. % ... and for \example:
  6772. \spaceisspace
  6773. %
  6774. % The \empty here causes a following catcode 5 newline to be eaten as
  6775. % part of reading whitespace after a control sequence. It does not
  6776. % eat a catcode 13 newline. There's no good way to handle the two
  6777. % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX
  6778. % would then have different behavior). See the Macro Details node in
  6779. % the manual for the workaround we recommend for macros and
  6780. % line-oriented commands.
  6781. %
  6782. \scantokens{#1\empty}%
  6783. \endgroup}
  6784. \def\scanexp#1{%
  6785. \edef\temp{\noexpand\scanmacro{#1}}%
  6786. \temp
  6787. }
  6788. \newcount\paramno % Count of parameters
  6789. \newtoks\macname % Macro name
  6790. \newif\ifrecursive % Is it recursive?
  6791. % List of all defined macros in the form
  6792. % \definedummyword\macro1\definedummyword\macro2...
  6793. % Currently is also contains all @aliases; the list can be split
  6794. % if there is a need.
  6795. \def\macrolist{}
  6796. % Add the macro to \macrolist
  6797. \def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname}
  6798. \def\addtomacrolistxxx#1{%
  6799. \toks0 = \expandafter{\macrolist\definedummyword#1}%
  6800. \xdef\macrolist{\the\toks0}%
  6801. }
  6802. % Utility routines.
  6803. % This does \let #1 = #2, with \csnames; that is,
  6804. % \let \csname#1\endcsname = \csname#2\endcsname
  6805. % (except of course we have to play expansion games).
  6806. %
  6807. \def\cslet#1#2{%
  6808. \expandafter\let
  6809. \csname#1\expandafter\endcsname
  6810. \csname#2\endcsname
  6811. }
  6812. % Trim leading and trailing spaces off a string.
  6813. % Concepts from aro-bend problem 15 (see CTAN).
  6814. {\catcode`\@=11
  6815. \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
  6816. \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
  6817. \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
  6818. \def\unbrace#1{#1}
  6819. \unbrace{\gdef\trim@@@ #1 } #2@{#1}
  6820. }
  6821. % Trim a single trailing ^^M off a string.
  6822. {\catcode`\^^M=\other \catcode`\Q=3%
  6823. \gdef\eatcr #1{\eatcra #1Q^^MQ}%
  6824. \gdef\eatcra#1^^MQ{\eatcrb#1Q}%
  6825. \gdef\eatcrb#1Q#2Q{#1}%
  6826. }
  6827. % Macro bodies are absorbed as an argument in a context where
  6828. % all characters are catcode 10, 11 or 12, except \ which is active
  6829. % (as in normal texinfo). It is necessary to change the definition of \
  6830. % to recognize macro arguments; this is the job of \mbodybackslash.
  6831. %
  6832. % Non-ASCII encodings make 8-bit characters active, so un-activate
  6833. % them to avoid their expansion. Must do this non-globally, to
  6834. % confine the change to the current group.
  6835. %
  6836. % It's necessary to have hard CRs when the macro is executed. This is
  6837. % done by making ^^M (\endlinechar) catcode 12 when reading the macro
  6838. % body, and then making it the \newlinechar in \scanmacro.
  6839. %
  6840. \def\scanctxt{% used as subroutine
  6841. \catcode`\"=\other
  6842. \catcode`\+=\other
  6843. \catcode`\<=\other
  6844. \catcode`\>=\other
  6845. \catcode`\@=\other
  6846. \catcode`\^=\other
  6847. \catcode`\_=\other
  6848. \catcode`\|=\other
  6849. \catcode`\~=\other
  6850. \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi
  6851. }
  6852. \def\scanargctxt{% used for copying and captions, not macros.
  6853. \scanctxt
  6854. \catcode`\\=\other
  6855. \catcode`\^^M=\other
  6856. }
  6857. \def\macrobodyctxt{% used for @macro definitions
  6858. \scanctxt
  6859. \catcode`\{=\other
  6860. \catcode`\}=\other
  6861. \catcode`\^^M=\other
  6862. \usembodybackslash
  6863. }
  6864. \def\macroargctxt{% used when scanning invocations
  6865. \scanctxt
  6866. \catcode`\\=0
  6867. }
  6868. % why catcode 0 for \ in the above? To recognize \\ \{ \} as "escapes"
  6869. % for the single characters \ { }. Thus, we end up with the "commands"
  6870. % that would be written @\ @{ @} in a Texinfo document.
  6871. %
  6872. % We already have @{ and @}. For @\, we define it here, and only for
  6873. % this purpose, to produce a typewriter backslash (so, the @\ that we
  6874. % define for @math can't be used with @macro calls):
  6875. %
  6876. \def\\{\normalbackslash}%
  6877. %
  6878. % We would like to do this for \, too, since that is what makeinfo does.
  6879. % But it is not possible, because Texinfo already has a command @, for a
  6880. % cedilla accent. Documents must use @comma{} instead.
  6881. %
  6882. % \anythingelse will almost certainly be an error of some kind.
  6883. % \mbodybackslash is the definition of \ in @macro bodies.
  6884. % It maps \foo\ => \csname macarg.foo\endcsname => #N
  6885. % where N is the macro parameter number.
  6886. % We define \csname macarg.\endcsname to be \realbackslash, so
  6887. % \\ in macro replacement text gets you a backslash.
  6888. %
  6889. {\catcode`@=0 @catcode`@\=@active
  6890. @gdef@usembodybackslash{@let\=@mbodybackslash}
  6891. @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
  6892. }
  6893. \expandafter\def\csname macarg.\endcsname{\realbackslash}
  6894. \def\margbackslash#1{\char`\#1 }
  6895. \def\macro{\recursivefalse\parsearg\macroxxx}
  6896. \def\rmacro{\recursivetrue\parsearg\macroxxx}
  6897. \def\macroxxx#1{%
  6898. \getargs{#1}% now \macname is the macname and \argl the arglist
  6899. \ifx\argl\empty % no arguments
  6900. \paramno=0\relax
  6901. \else
  6902. \expandafter\parsemargdef \argl;%
  6903. \if\paramno>256\relax
  6904. \ifx\eTeXversion\thisisundefined
  6905. \errhelp = \EMsimple
  6906. \errmessage{You need eTeX to compile a file with macros with more than 256 arguments}
  6907. \fi
  6908. \fi
  6909. \fi
  6910. \if1\csname ismacro.\the\macname\endcsname
  6911. \message{Warning: redefining \the\macname}%
  6912. \else
  6913. \expandafter\ifx\csname \the\macname\endcsname \relax
  6914. \else \errmessage{Macro name \the\macname\space already defined}\fi
  6915. \global\cslet{macsave.\the\macname}{\the\macname}%
  6916. \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
  6917. \addtomacrolist{\the\macname}%
  6918. \fi
  6919. \begingroup \macrobodyctxt
  6920. \ifrecursive \expandafter\parsermacbody
  6921. \else \expandafter\parsemacbody
  6922. \fi}
  6923. \parseargdef\unmacro{%
  6924. \if1\csname ismacro.#1\endcsname
  6925. \global\cslet{#1}{macsave.#1}%
  6926. \global\expandafter\let \csname ismacro.#1\endcsname=0%
  6927. % Remove the macro name from \macrolist:
  6928. \begingroup
  6929. \expandafter\let\csname#1\endcsname \relax
  6930. \let\definedummyword\unmacrodo
  6931. \xdef\macrolist{\macrolist}%
  6932. \endgroup
  6933. \else
  6934. \errmessage{Macro #1 not defined}%
  6935. \fi
  6936. }
  6937. % Called by \do from \dounmacro on each macro. The idea is to omit any
  6938. % macro definitions that have been changed to \relax.
  6939. %
  6940. \def\unmacrodo#1{%
  6941. \ifx #1\relax
  6942. % remove this
  6943. \else
  6944. \noexpand\definedummyword \noexpand#1%
  6945. \fi
  6946. }
  6947. % This makes use of the obscure feature that if the last token of a
  6948. % <parameter list> is #, then the preceding argument is delimited by
  6949. % an opening brace, and that opening brace is not consumed.
  6950. \def\getargs#1{\getargsxxx#1{}}
  6951. \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
  6952. \def\getmacname#1 #2\relax{\macname={#1}}
  6953. \def\getmacargs#1{\def\argl{#1}}
  6954. % For macro processing make @ a letter so that we can make Texinfo private macro names.
  6955. \edef\texiatcatcode{\the\catcode`\@}
  6956. \catcode `@=11\relax
  6957. % Parse the optional {params} list. Set up \paramno and \paramlist
  6958. % so \defmacro knows what to do. Define \macarg.BLAH for each BLAH
  6959. % in the params list to some hook where the argument is to be expanded. If
  6960. % there are less than 10 arguments that hook is to be replaced by ##N where N
  6961. % is the position in that list, that is to say the macro arguments are to be
  6962. % defined `a la TeX in the macro body.
  6963. %
  6964. % That gets used by \mbodybackslash (above).
  6965. %
  6966. % We need to get `macro parameter char #' into several definitions.
  6967. % The technique used is stolen from LaTeX: let \hash be something
  6968. % unexpandable, insert that wherever you need a #, and then redefine
  6969. % it to # just before using the token list produced.
  6970. %
  6971. % The same technique is used to protect \eatspaces till just before
  6972. % the macro is used.
  6973. %
  6974. % If there are 10 or more arguments, a different technique is used, where the
  6975. % hook remains in the body, and when macro is to be expanded the body is
  6976. % processed again to replace the arguments.
  6977. %
  6978. % In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the
  6979. % argument N value and then \edef the body (nothing else will expand because of
  6980. % the catcode regime underwhich the body was input).
  6981. %
  6982. % If you compile with TeX (not eTeX), and you have macros with 10 or more
  6983. % arguments, no macro can have more than 256 arguments (else error).
  6984. \def\parsemargdef#1;{%
  6985. \paramno=0\def\paramlist{}%
  6986. \let\hash\relax
  6987. \let\xeatspaces\relax
  6988. \parsemargdefxxx#1,;,%
  6989. % In case that there are 10 or more arguments we parse again the arguments
  6990. % list to set new definitions for the \macarg.BLAH macros corresponding to
  6991. % each BLAH argument. It was anyhow needed to parse already once this list
  6992. % in order to count the arguments, and as macros with at most 9 arguments
  6993. % are by far more frequent than macro with 10 or more arguments, defining
  6994. % twice the \macarg.BLAH macros does not cost too much processing power.
  6995. \ifnum\paramno<10\relax\else
  6996. \paramno0\relax
  6997. \parsemmanyargdef@@#1,;,% 10 or more arguments
  6998. \fi
  6999. }
  7000. \def\parsemargdefxxx#1,{%
  7001. \if#1;\let\next=\relax
  7002. \else \let\next=\parsemargdefxxx
  7003. \advance\paramno by 1
  7004. \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
  7005. {\xeatspaces{\hash\the\paramno}}%
  7006. \edef\paramlist{\paramlist\hash\the\paramno,}%
  7007. \fi\next}
  7008. \def\parsemmanyargdef@@#1,{%
  7009. \if#1;\let\next=\relax
  7010. \else
  7011. \let\next=\parsemmanyargdef@@
  7012. \edef\tempb{\eatspaces{#1}}%
  7013. \expandafter\def\expandafter\tempa
  7014. \expandafter{\csname macarg.\tempb\endcsname}%
  7015. % Note that we need some extra \noexpand\noexpand, this is because we
  7016. % don't want \the to be expanded in the \parsermacbody as it uses an
  7017. % \xdef .
  7018. \expandafter\edef\tempa
  7019. {\noexpand\noexpand\noexpand\the\toks\the\paramno}%
  7020. \advance\paramno by 1\relax
  7021. \fi\next}
  7022. % These two commands read recursive and nonrecursive macro bodies.
  7023. % (They're different since rec and nonrec macros end differently.)
  7024. %
  7025. \catcode `\@\texiatcatcode
  7026. \long\def\parsemacbody#1@end macro%
  7027. {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
  7028. \long\def\parsermacbody#1@end rmacro%
  7029. {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
  7030. \catcode `\@=11\relax
  7031. \let\endargs@\relax
  7032. \let\nil@\relax
  7033. \def\nilm@{\nil@}%
  7034. \long\def\nillm@{\nil@}%
  7035. % This macro is expanded during the Texinfo macro expansion, not during its
  7036. % definition. It gets all the arguments values and assigns them to macros
  7037. % macarg.ARGNAME
  7038. %
  7039. % #1 is the macro name
  7040. % #2 is the list of argument names
  7041. % #3 is the list of argument values
  7042. \def\getargvals@#1#2#3{%
  7043. \def\macargdeflist@{}%
  7044. \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion.
  7045. \def\paramlist{#2,\nil@}%
  7046. \def\macroname{#1}%
  7047. \begingroup
  7048. \macroargctxt
  7049. \def\argvaluelist{#3,\nil@}%
  7050. \def\@tempa{#3}%
  7051. \ifx\@tempa\empty
  7052. \setemptyargvalues@
  7053. \else
  7054. \getargvals@@
  7055. \fi
  7056. }
  7057. %
  7058. \def\getargvals@@{%
  7059. \ifx\paramlist\nilm@
  7060. % Some sanity check needed here that \argvaluelist is also empty.
  7061. \ifx\argvaluelist\nillm@
  7062. \else
  7063. \errhelp = \EMsimple
  7064. \errmessage{Too many arguments in macro `\macroname'!}%
  7065. \fi
  7066. \let\next\macargexpandinbody@
  7067. \else
  7068. \ifx\argvaluelist\nillm@
  7069. % No more arguments values passed to macro. Set remaining named-arg
  7070. % macros to empty.
  7071. \let\next\setemptyargvalues@
  7072. \else
  7073. % pop current arg name into \@tempb
  7074. \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}%
  7075. \expandafter\@tempa\expandafter{\paramlist}%
  7076. % pop current argument value into \@tempc
  7077. \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}%
  7078. \expandafter\@tempa\expandafter{\argvaluelist}%
  7079. % Here \@tempb is the current arg name and \@tempc is the current arg value.
  7080. % First place the new argument macro definition into \@tempd
  7081. \expandafter\macname\expandafter{\@tempc}%
  7082. \expandafter\let\csname macarg.\@tempb\endcsname\relax
  7083. \expandafter\def\expandafter\@tempe\expandafter{%
  7084. \csname macarg.\@tempb\endcsname}%
  7085. \edef\@tempd{\long\def\@tempe{\the\macname}}%
  7086. \push@\@tempd\macargdeflist@
  7087. \let\next\getargvals@@
  7088. \fi
  7089. \fi
  7090. \next
  7091. }
  7092. \def\push@#1#2{%
  7093. \expandafter\expandafter\expandafter\def
  7094. \expandafter\expandafter\expandafter#2%
  7095. \expandafter\expandafter\expandafter{%
  7096. \expandafter#1#2}%
  7097. }
  7098. % Replace arguments by their values in the macro body, and place the result
  7099. % in macro \@tempa
  7100. \def\macvalstoargs@{%
  7101. % To do this we use the property that token registers that are \the'ed
  7102. % within an \edef expand only once. So we are going to place all argument
  7103. % values into respective token registers.
  7104. %
  7105. % First we save the token context, and initialize argument numbering.
  7106. \begingroup
  7107. \paramno0\relax
  7108. % Then, for each argument number #N, we place the corresponding argument
  7109. % value into a new token list register \toks#N
  7110. \expandafter\putargsintokens@\saveparamlist@,;,%
  7111. % Then, we expand the body so that argument are replaced by their
  7112. % values. The trick for values not to be expanded themselves is that they
  7113. % are within tokens and that tokens expand only once in an \edef .
  7114. \edef\@tempc{\csname mac.\macroname .body\endcsname}%
  7115. % Now we restore the token stack pointer to free the token list registers
  7116. % which we have used, but we make sure that expanded body is saved after
  7117. % group.
  7118. \expandafter
  7119. \endgroup
  7120. \expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
  7121. }
  7122. \def\macargexpandinbody@{%
  7123. %% Define the named-macro outside of this group and then close this group.
  7124. \expandafter
  7125. \endgroup
  7126. \macargdeflist@
  7127. % First the replace in body the macro arguments by their values, the result
  7128. % is in \@tempa .
  7129. \macvalstoargs@
  7130. % Then we point at the \norecurse or \gobble (for recursive) macro value
  7131. % with \@tempb .
  7132. \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname
  7133. % Depending on whether it is recursive or not, we need some tailing
  7134. % \egroup .
  7135. \ifx\@tempb\gobble
  7136. \let\@tempc\relax
  7137. \else
  7138. \let\@tempc\egroup
  7139. \fi
  7140. % And now we do the real job:
  7141. \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}%
  7142. \@tempd
  7143. }
  7144. \def\putargsintokens@#1,{%
  7145. \if#1;\let\next\relax
  7146. \else
  7147. \let\next\putargsintokens@
  7148. % First we allocate the new token list register, and give it a temporary
  7149. % alias \@tempb .
  7150. \toksdef\@tempb\the\paramno
  7151. % Then we place the argument value into that token list register.
  7152. \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname
  7153. \expandafter\@tempb\expandafter{\@tempa}%
  7154. \advance\paramno by 1\relax
  7155. \fi
  7156. \next
  7157. }
  7158. % Save the token stack pointer into macro #1
  7159. \def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}}
  7160. % Restore the token stack pointer from number in macro #1
  7161. \def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax}
  7162. % newtoks that can be used non \outer .
  7163. \def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi}
  7164. % Tailing missing arguments are set to empty
  7165. \def\setemptyargvalues@{%
  7166. \ifx\paramlist\nilm@
  7167. \let\next\macargexpandinbody@
  7168. \else
  7169. \expandafter\setemptyargvaluesparser@\paramlist\endargs@
  7170. \let\next\setemptyargvalues@
  7171. \fi
  7172. \next
  7173. }
  7174. \def\setemptyargvaluesparser@#1,#2\endargs@{%
  7175. \expandafter\def\expandafter\@tempa\expandafter{%
  7176. \expandafter\def\csname macarg.#1\endcsname{}}%
  7177. \push@\@tempa\macargdeflist@
  7178. \def\paramlist{#2}%
  7179. }
  7180. % #1 is the element target macro
  7181. % #2 is the list macro
  7182. % #3,#4\endargs@ is the list value
  7183. \def\pop@#1#2#3,#4\endargs@{%
  7184. \def#1{#3}%
  7185. \def#2{#4}%
  7186. }
  7187. \long\def\longpop@#1#2#3,#4\endargs@{%
  7188. \long\def#1{#3}%
  7189. \long\def#2{#4}%
  7190. }
  7191. % This defines a Texinfo @macro. There are eight cases: recursive and
  7192. % nonrecursive macros of zero, one, up to nine, and many arguments.
  7193. % Much magic with \expandafter here.
  7194. % \xdef is used so that macro definitions will survive the file
  7195. % they're defined in; @include reads the file inside a group.
  7196. %
  7197. \def\defmacro{%
  7198. \let\hash=##% convert placeholders to macro parameter chars
  7199. \ifrecursive
  7200. \ifcase\paramno
  7201. % 0
  7202. \expandafter\xdef\csname\the\macname\endcsname{%
  7203. \noexpand\scanmacro{\temp}}%
  7204. \or % 1
  7205. \expandafter\xdef\csname\the\macname\endcsname{%
  7206. \bgroup\noexpand\macroargctxt
  7207. \noexpand\braceorline
  7208. \expandafter\noexpand\csname\the\macname xxx\endcsname}%
  7209. \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
  7210. \egroup\noexpand\scanmacro{\temp}}%
  7211. \else
  7212. \ifnum\paramno<10\relax % at most 9
  7213. \expandafter\xdef\csname\the\macname\endcsname{%
  7214. \bgroup\noexpand\macroargctxt
  7215. \noexpand\csname\the\macname xx\endcsname}%
  7216. \expandafter\xdef\csname\the\macname xx\endcsname##1{%
  7217. \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
  7218. \expandafter\expandafter
  7219. \expandafter\xdef
  7220. \expandafter\expandafter
  7221. \csname\the\macname xxx\endcsname
  7222. \paramlist{\egroup\noexpand\scanmacro{\temp}}%
  7223. \else % 10 or more
  7224. \expandafter\xdef\csname\the\macname\endcsname{%
  7225. \noexpand\getargvals@{\the\macname}{\argl}%
  7226. }%
  7227. \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
  7228. \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble
  7229. \fi
  7230. \fi
  7231. \else
  7232. \ifcase\paramno
  7233. % 0
  7234. \expandafter\xdef\csname\the\macname\endcsname{%
  7235. \noexpand\norecurse{\the\macname}%
  7236. \noexpand\scanmacro{\temp}\egroup}%
  7237. \or % 1
  7238. \expandafter\xdef\csname\the\macname\endcsname{%
  7239. \bgroup\noexpand\macroargctxt
  7240. \noexpand\braceorline
  7241. \expandafter\noexpand\csname\the\macname xxx\endcsname}%
  7242. \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
  7243. \egroup
  7244. \noexpand\norecurse{\the\macname}%
  7245. \noexpand\scanmacro{\temp}\egroup}%
  7246. \else % at most 9
  7247. \ifnum\paramno<10\relax
  7248. \expandafter\xdef\csname\the\macname\endcsname{%
  7249. \bgroup\noexpand\macroargctxt
  7250. \expandafter\noexpand\csname\the\macname xx\endcsname}%
  7251. \expandafter\xdef\csname\the\macname xx\endcsname##1{%
  7252. \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
  7253. \expandafter\expandafter
  7254. \expandafter\xdef
  7255. \expandafter\expandafter
  7256. \csname\the\macname xxx\endcsname
  7257. \paramlist{%
  7258. \egroup
  7259. \noexpand\norecurse{\the\macname}%
  7260. \noexpand\scanmacro{\temp}\egroup}%
  7261. \else % 10 or more:
  7262. \expandafter\xdef\csname\the\macname\endcsname{%
  7263. \noexpand\getargvals@{\the\macname}{\argl}%
  7264. }%
  7265. \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
  7266. \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse
  7267. \fi
  7268. \fi
  7269. \fi}
  7270. \catcode `\@\texiatcatcode\relax
  7271. \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
  7272. % \braceorline decides whether the next nonwhitespace character is a
  7273. % {. If so it reads up to the closing }, if not, it reads the whole
  7274. % line. Whatever was read is then fed to the next control sequence
  7275. % as an argument (by \parsebrace or \parsearg).
  7276. %
  7277. \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
  7278. \def\braceorlinexxx{%
  7279. \ifx\nchar\bgroup\else
  7280. \expandafter\parsearg
  7281. \fi \macnamexxx}
  7282. % @alias.
  7283. % We need some trickery to remove the optional spaces around the equal
  7284. % sign. Make them active and then expand them all to nothing.
  7285. %
  7286. \def\alias{\parseargusing\obeyspaces\aliasxxx}
  7287. \def\aliasxxx #1{\aliasyyy#1\relax}
  7288. \def\aliasyyy #1=#2\relax{%
  7289. {%
  7290. \expandafter\let\obeyedspace=\empty
  7291. \addtomacrolist{#1}%
  7292. \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%
  7293. }%
  7294. \next
  7295. }
  7296. \message{cross references,}
  7297. \newwrite\auxfile
  7298. \newif\ifhavexrefs % True if xref values are known.
  7299. \newif\ifwarnedxrefs % True if we warned once that they aren't known.
  7300. % @inforef is relatively simple.
  7301. \def\inforef #1{\inforefzzz #1,,,,**}
  7302. \def\inforefzzz #1,#2,#3,#4**{%
  7303. \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
  7304. node \samp{\ignorespaces#1{}}}
  7305. % @node's only job in TeX is to define \lastnode, which is used in
  7306. % cross-references. The @node line might or might not have commas, and
  7307. % might or might not have spaces before the first comma, like:
  7308. % @node foo , bar , ...
  7309. % We don't want such trailing spaces in the node name.
  7310. %
  7311. \parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse}
  7312. %
  7313. % also remove a trailing comma, in case of something like this:
  7314. % @node Help-Cross, , , Cross-refs
  7315. \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
  7316. \def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}}
  7317. \let\nwnode=\node
  7318. \let\lastnode=\empty
  7319. % Write a cross-reference definition for the current node. #1 is the
  7320. % type (Ynumbered, Yappendix, Ynothing).
  7321. %
  7322. \def\donoderef#1{%
  7323. \ifx\lastnode\empty\else
  7324. \setref{\lastnode}{#1}%
  7325. \global\let\lastnode=\empty
  7326. \fi
  7327. }
  7328. % @anchor{NAME} -- define xref target at arbitrary point.
  7329. %
  7330. \newcount\savesfregister
  7331. %
  7332. \def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
  7333. \def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
  7334. \def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
  7335. % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
  7336. % anchor), which consists of three parts:
  7337. % 1) NAME-title - the current sectioning name taken from \lastsection,
  7338. % or the anchor name.
  7339. % 2) NAME-snt - section number and type, passed as the SNT arg, or
  7340. % empty for anchors.
  7341. % 3) NAME-pg - the page number.
  7342. %
  7343. % This is called from \donoderef, \anchor, and \dofloat. In the case of
  7344. % floats, there is an additional part, which is not written here:
  7345. % 4) NAME-lof - the text as it should appear in a @listoffloats.
  7346. %
  7347. \def\setref#1#2{%
  7348. \pdfmkdest{#1}%
  7349. \iflinks
  7350. {%
  7351. \atdummies % preserve commands, but don't expand them
  7352. \edef\writexrdef##1##2{%
  7353. \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
  7354. ##1}{##2}}% these are parameters of \writexrdef
  7355. }%
  7356. \toks0 = \expandafter{\lastsection}%
  7357. \immediate \writexrdef{title}{\the\toks0 }%
  7358. \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
  7359. \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout
  7360. }%
  7361. \fi
  7362. }
  7363. % @xrefautosectiontitle on|off says whether @section(ing) names are used
  7364. % automatically in xrefs, if the third arg is not explicitly specified.
  7365. % This was provided as a "secret" @set xref-automatic-section-title
  7366. % variable, now it's official.
  7367. %
  7368. \parseargdef\xrefautomaticsectiontitle{%
  7369. \def\temp{#1}%
  7370. \ifx\temp\onword
  7371. \expandafter\let\csname SETxref-automatic-section-title\endcsname
  7372. = \empty
  7373. \else\ifx\temp\offword
  7374. \expandafter\let\csname SETxref-automatic-section-title\endcsname
  7375. = \relax
  7376. \else
  7377. \errhelp = \EMsimple
  7378. \errmessage{Unknown @xrefautomaticsectiontitle value `\temp',
  7379. must be on|off}%
  7380. \fi\fi
  7381. }
  7382. %
  7383. % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
  7384. % the node name, #2 the name of the Info cross-reference, #3 the printed
  7385. % node name, #4 the name of the Info file, #5 the name of the printed
  7386. % manual. All but the node name can be omitted.
  7387. %
  7388. \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
  7389. \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
  7390. \def\ref#1{\xrefX[#1,,,,,,,]}
  7391. %
  7392. \newbox\toprefbox
  7393. \newbox\printedrefnamebox
  7394. \newbox\infofilenamebox
  7395. \newbox\printedmanualbox
  7396. %
  7397. \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
  7398. \unsepspaces
  7399. %
  7400. % Get args without leading/trailing spaces.
  7401. \def\printedrefname{\ignorespaces #3}%
  7402. \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}%
  7403. %
  7404. \def\infofilename{\ignorespaces #4}%
  7405. \setbox\infofilenamebox = \hbox{\infofilename\unskip}%
  7406. %
  7407. \def\printedmanual{\ignorespaces #5}%
  7408. \setbox\printedmanualbox = \hbox{\printedmanual\unskip}%
  7409. %
  7410. % If the printed reference name (arg #3) was not explicitly given in
  7411. % the @xref, figure out what we want to use.
  7412. \ifdim \wd\printedrefnamebox = 0pt
  7413. % No printed node name was explicitly given.
  7414. \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax
  7415. % Not auto section-title: use node name inside the square brackets.
  7416. \def\printedrefname{\ignorespaces #1}%
  7417. \else
  7418. % Auto section-title: use chapter/section title inside
  7419. % the square brackets if we have it.
  7420. \ifdim \wd\printedmanualbox > 0pt
  7421. % It is in another manual, so we don't have it; use node name.
  7422. \def\printedrefname{\ignorespaces #1}%
  7423. \else
  7424. \ifhavexrefs
  7425. % We (should) know the real title if we have the xref values.
  7426. \def\printedrefname{\refx{#1-title}{}}%
  7427. \else
  7428. % Otherwise just copy the Info node name.
  7429. \def\printedrefname{\ignorespaces #1}%
  7430. \fi%
  7431. \fi
  7432. \fi
  7433. \fi
  7434. %
  7435. % Make link in pdf output.
  7436. \ifpdf
  7437. {\indexnofonts
  7438. \turnoffactive
  7439. \makevalueexpandable
  7440. % This expands tokens, so do it after making catcode changes, so _
  7441. % etc. don't get their TeX definitions. This ignores all spaces in
  7442. % #4, including (wrongly) those in the middle of the filename.
  7443. \getfilename{#4}%
  7444. %
  7445. % This (wrongly) does not take account of leading or trailing
  7446. % spaces in #1, which should be ignored.
  7447. \edef\pdfxrefdest{#1}%
  7448. \ifx\pdfxrefdest\empty
  7449. \def\pdfxrefdest{Top}% no empty targets
  7450. \else
  7451. \txiescapepdf\pdfxrefdest % escape PDF special chars
  7452. \fi
  7453. %
  7454. \leavevmode
  7455. \startlink attr{/Border [0 0 0]}%
  7456. \ifnum\filenamelength>0
  7457. goto file{\the\filename.pdf} name{\pdfxrefdest}%
  7458. \else
  7459. goto name{\pdfmkpgn{\pdfxrefdest}}%
  7460. \fi
  7461. }%
  7462. \setcolor{\linkcolor}%
  7463. \fi
  7464. %
  7465. % Float references are printed completely differently: "Figure 1.2"
  7466. % instead of "[somenode], p.3". We distinguish them by the
  7467. % LABEL-title being set to a magic string.
  7468. {%
  7469. % Have to otherify everything special to allow the \csname to
  7470. % include an _ in the xref name, etc.
  7471. \indexnofonts
  7472. \turnoffactive
  7473. \expandafter\global\expandafter\let\expandafter\Xthisreftitle
  7474. \csname XR#1-title\endcsname
  7475. }%
  7476. \iffloat\Xthisreftitle
  7477. % If the user specified the print name (third arg) to the ref,
  7478. % print it instead of our usual "Figure 1.2".
  7479. \ifdim\wd\printedrefnamebox = 0pt
  7480. \refx{#1-snt}{}%
  7481. \else
  7482. \printedrefname
  7483. \fi
  7484. %
  7485. % If the user also gave the printed manual name (fifth arg), append
  7486. % "in MANUALNAME".
  7487. \ifdim \wd\printedmanualbox > 0pt
  7488. \space \putwordin{} \cite{\printedmanual}%
  7489. \fi
  7490. \else
  7491. % node/anchor (non-float) references.
  7492. %
  7493. % If we use \unhbox to print the node names, TeX does not insert
  7494. % empty discretionaries after hyphens, which means that it will not
  7495. % find a line break at a hyphen in a node names. Since some manuals
  7496. % are best written with fairly long node names, containing hyphens,
  7497. % this is a loss. Therefore, we give the text of the node name
  7498. % again, so it is as if TeX is seeing it for the first time.
  7499. %
  7500. \ifdim \wd\printedmanualbox > 0pt
  7501. % Cross-manual reference with a printed manual name.
  7502. %
  7503. \crossmanualxref{\cite{\printedmanual\unskip}}%
  7504. %
  7505. \else\ifdim \wd\infofilenamebox > 0pt
  7506. % Cross-manual reference with only an info filename (arg 4), no
  7507. % printed manual name (arg 5). This is essentially the same as
  7508. % the case above; we output the filename, since we have nothing else.
  7509. %
  7510. \crossmanualxref{\code{\infofilename\unskip}}%
  7511. %
  7512. \else
  7513. % Reference within this manual.
  7514. %
  7515. % _ (for example) has to be the character _ for the purposes of the
  7516. % control sequence corresponding to the node, but it has to expand
  7517. % into the usual \leavevmode...\vrule stuff for purposes of
  7518. % printing. So we \turnoffactive for the \refx-snt, back on for the
  7519. % printing, back off for the \refx-pg.
  7520. {\turnoffactive
  7521. % Only output a following space if the -snt ref is nonempty; for
  7522. % @unnumbered and @anchor, it won't be.
  7523. \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
  7524. \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
  7525. }%
  7526. % output the `[mynode]' via the macro below so it can be overridden.
  7527. \xrefprintnodename\printedrefname
  7528. %
  7529. % But we always want a comma and a space:
  7530. ,\space
  7531. %
  7532. % output the `page 3'.
  7533. \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
  7534. \fi\fi
  7535. \fi
  7536. \endlink
  7537. \endgroup}
  7538. % Output a cross-manual xref to #1. Used just above (twice).
  7539. %
  7540. % Only include the text "Section ``foo'' in" if the foo is neither
  7541. % missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply
  7542. % "see The Foo Manual", the idea being to refer to the whole manual.
  7543. %
  7544. % But, this being TeX, we can't easily compare our node name against the
  7545. % string "Top" while ignoring the possible spaces before and after in
  7546. % the input. By adding the arbitrary 7sp below, we make it much less
  7547. % likely that a real node name would have the same width as "Top" (e.g.,
  7548. % in a monospaced font). Hopefully it will never happen in practice.
  7549. %
  7550. % For the same basic reason, we retypeset the "Top" at every
  7551. % reference, since the current font is indeterminate.
  7552. %
  7553. \def\crossmanualxref#1{%
  7554. \setbox\toprefbox = \hbox{Top\kern7sp}%
  7555. \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
  7556. \ifdim \wd2 > 7sp % nonempty?
  7557. \ifdim \wd2 = \wd\toprefbox \else % same as Top?
  7558. \putwordSection{} ``\printedrefname'' \putwordin{}\space
  7559. \fi
  7560. \fi
  7561. #1%
  7562. }
  7563. % This macro is called from \xrefX for the `[nodename]' part of xref
  7564. % output. It's a separate macro only so it can be changed more easily,
  7565. % since square brackets don't work well in some documents. Particularly
  7566. % one that Bob is working on :).
  7567. %
  7568. \def\xrefprintnodename#1{[#1]}
  7569. % Things referred to by \setref.
  7570. %
  7571. \def\Ynothing{}
  7572. \def\Yomitfromtoc{}
  7573. \def\Ynumbered{%
  7574. \ifnum\secno=0
  7575. \putwordChapter@tie \the\chapno
  7576. \else \ifnum\subsecno=0
  7577. \putwordSection@tie \the\chapno.\the\secno
  7578. \else \ifnum\subsubsecno=0
  7579. \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
  7580. \else
  7581. \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
  7582. \fi\fi\fi
  7583. }
  7584. \def\Yappendix{%
  7585. \ifnum\secno=0
  7586. \putwordAppendix@tie @char\the\appendixno{}%
  7587. \else \ifnum\subsecno=0
  7588. \putwordSection@tie @char\the\appendixno.\the\secno
  7589. \else \ifnum\subsubsecno=0
  7590. \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
  7591. \else
  7592. \putwordSection@tie
  7593. @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
  7594. \fi\fi\fi
  7595. }
  7596. % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
  7597. % If its value is nonempty, SUFFIX is output afterward.
  7598. %
  7599. \def\refx#1#2{%
  7600. {%
  7601. \indexnofonts
  7602. \otherbackslash
  7603. \expandafter\global\expandafter\let\expandafter\thisrefX
  7604. \csname XR#1\endcsname
  7605. }%
  7606. \ifx\thisrefX\relax
  7607. % If not defined, say something at least.
  7608. \angleleft un\-de\-fined\angleright
  7609. \iflinks
  7610. \ifhavexrefs
  7611. {\toks0 = {#1}% avoid expansion of possibly-complex value
  7612. \message{\linenumber Undefined cross reference `\the\toks0'.}}%
  7613. \else
  7614. \ifwarnedxrefs\else
  7615. \global\warnedxrefstrue
  7616. \message{Cross reference values unknown; you must run TeX again.}%
  7617. \fi
  7618. \fi
  7619. \fi
  7620. \else
  7621. % It's defined, so just use it.
  7622. \thisrefX
  7623. \fi
  7624. #2% Output the suffix in any case.
  7625. }
  7626. % This is the macro invoked by entries in the aux file. Usually it's
  7627. % just a \def (we prepend XR to the control sequence name to avoid
  7628. % collisions). But if this is a float type, we have more work to do.
  7629. %
  7630. \def\xrdef#1#2{%
  7631. {% The node name might contain 8-bit characters, which in our current
  7632. % implementation are changed to commands like @'e. Don't let these
  7633. % mess up the control sequence name.
  7634. \indexnofonts
  7635. \turnoffactive
  7636. \xdef\safexrefname{#1}%
  7637. }%
  7638. %
  7639. \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref
  7640. %
  7641. % Was that xref control sequence that we just defined for a float?
  7642. \expandafter\iffloat\csname XR\safexrefname\endcsname
  7643. % it was a float, and we have the (safe) float type in \iffloattype.
  7644. \expandafter\let\expandafter\floatlist
  7645. \csname floatlist\iffloattype\endcsname
  7646. %
  7647. % Is this the first time we've seen this float type?
  7648. \expandafter\ifx\floatlist\relax
  7649. \toks0 = {\do}% yes, so just \do
  7650. \else
  7651. % had it before, so preserve previous elements in list.
  7652. \toks0 = \expandafter{\floatlist\do}%
  7653. \fi
  7654. %
  7655. % Remember this xref in the control sequence \floatlistFLOATTYPE,
  7656. % for later use in \listoffloats.
  7657. \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0
  7658. {\safexrefname}}%
  7659. \fi
  7660. }
  7661. % Read the last existing aux file, if any. No error if none exists.
  7662. %
  7663. \def\tryauxfile{%
  7664. \openin 1 \jobname.aux
  7665. \ifeof 1 \else
  7666. \readdatafile{aux}%
  7667. \global\havexrefstrue
  7668. \fi
  7669. \closein 1
  7670. }
  7671. \def\setupdatafile{%
  7672. \catcode`\^^@=\other
  7673. \catcode`\^^A=\other
  7674. \catcode`\^^B=\other
  7675. \catcode`\^^C=\other
  7676. \catcode`\^^D=\other
  7677. \catcode`\^^E=\other
  7678. \catcode`\^^F=\other
  7679. \catcode`\^^G=\other
  7680. \catcode`\^^H=\other
  7681. \catcode`\^^K=\other
  7682. \catcode`\^^L=\other
  7683. \catcode`\^^N=\other
  7684. \catcode`\^^P=\other
  7685. \catcode`\^^Q=\other
  7686. \catcode`\^^R=\other
  7687. \catcode`\^^S=\other
  7688. \catcode`\^^T=\other
  7689. \catcode`\^^U=\other
  7690. \catcode`\^^V=\other
  7691. \catcode`\^^W=\other
  7692. \catcode`\^^X=\other
  7693. \catcode`\^^Z=\other
  7694. \catcode`\^^[=\other
  7695. \catcode`\^^\=\other
  7696. \catcode`\^^]=\other
  7697. \catcode`\^^^=\other
  7698. \catcode`\^^_=\other
  7699. % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
  7700. % in xref tags, i.e., node names. But since ^^e4 notation isn't
  7701. % supported in the main text, it doesn't seem desirable. Furthermore,
  7702. % that is not enough: for node names that actually contain a ^
  7703. % character, we would end up writing a line like this: 'xrdef {'hat
  7704. % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
  7705. % argument, and \hat is not an expandable control sequence. It could
  7706. % all be worked out, but why? Either we support ^^ or we don't.
  7707. %
  7708. % The other change necessary for this was to define \auxhat:
  7709. % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
  7710. % and then to call \auxhat in \setq.
  7711. %
  7712. \catcode`\^=\other
  7713. %
  7714. % Special characters. Should be turned off anyway, but...
  7715. \catcode`\~=\other
  7716. \catcode`\[=\other
  7717. \catcode`\]=\other
  7718. \catcode`\"=\other
  7719. \catcode`\_=\other
  7720. \catcode`\|=\other
  7721. \catcode`\<=\other
  7722. \catcode`\>=\other
  7723. \catcode`\$=\other
  7724. \catcode`\#=\other
  7725. \catcode`\&=\other
  7726. \catcode`\%=\other
  7727. \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
  7728. %
  7729. % This is to support \ in node names and titles, since the \
  7730. % characters end up in a \csname. It's easier than
  7731. % leaving it active and making its active definition an actual \
  7732. % character. What I don't understand is why it works in the *value*
  7733. % of the xrdef. Seems like it should be a catcode12 \, and that
  7734. % should not typeset properly. But it works, so I'm moving on for
  7735. % now. --karl, 15jan04.
  7736. \catcode`\\=\other
  7737. %
  7738. % Make the characters 128-255 be printing characters.
  7739. {\setnonasciicharscatcodenonglobal\other}%
  7740. %
  7741. % @ is our escape character in .aux files, and we need braces.
  7742. \catcode`\{=1
  7743. \catcode`\}=2
  7744. \catcode`\@=0
  7745. }
  7746. \def\readdatafile#1{%
  7747. \begingroup
  7748. \setupdatafile
  7749. \input\jobname.#1
  7750. \endgroup}
  7751. \message{insertions,}
  7752. % including footnotes.
  7753. \newcount \footnoteno
  7754. % The trailing space in the following definition for supereject is
  7755. % vital for proper filling; pages come out unaligned when you do a
  7756. % pagealignmacro call if that space before the closing brace is
  7757. % removed. (Generally, numeric constants should always be followed by a
  7758. % space to prevent strange expansion errors.)
  7759. \def\supereject{\par\penalty -20000\footnoteno =0 }
  7760. % @footnotestyle is meaningful for Info output only.
  7761. \let\footnotestyle=\comment
  7762. {\catcode `\@=11
  7763. %
  7764. % Auto-number footnotes. Otherwise like plain.
  7765. \gdef\footnote{%
  7766. \global\advance\footnoteno by \@ne
  7767. \edef\thisfootno{$^{\the\footnoteno}$}%
  7768. %
  7769. % In case the footnote comes at the end of a sentence, preserve the
  7770. % extra spacing after we do the footnote number.
  7771. \let\@sf\empty
  7772. \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
  7773. %
  7774. % Remove inadvertent blank space before typesetting the footnote number.
  7775. \unskip
  7776. \thisfootno\@sf
  7777. \dofootnote
  7778. }%
  7779. % Don't bother with the trickery in plain.tex to not require the
  7780. % footnote text as a parameter. Our footnotes don't need to be so general.
  7781. %
  7782. % Oh yes, they do; otherwise, @ifset (and anything else that uses
  7783. % \parseargline) fails inside footnotes because the tokens are fixed when
  7784. % the footnote is read. --karl, 16nov96.
  7785. %
  7786. \gdef\dofootnote{%
  7787. \insert\footins\bgroup
  7788. %
  7789. % Nested footnotes are not supported in TeX, that would take a lot
  7790. % more work. (\startsavinginserts does not suffice.)
  7791. \let\footnote=\errfootnotenest
  7792. %
  7793. % We want to typeset this text as a normal paragraph, even if the
  7794. % footnote reference occurs in (for example) a display environment.
  7795. % So reset some parameters.
  7796. \hsize=\pagewidth
  7797. \interlinepenalty\interfootnotelinepenalty
  7798. \splittopskip\ht\strutbox % top baseline for broken footnotes
  7799. \splitmaxdepth\dp\strutbox
  7800. \floatingpenalty\@MM
  7801. \leftskip\z@skip
  7802. \rightskip\z@skip
  7803. \spaceskip\z@skip
  7804. \xspaceskip\z@skip
  7805. \parindent\defaultparindent
  7806. %
  7807. \smallfonts \rm
  7808. %
  7809. % Because we use hanging indentation in footnotes, a @noindent appears
  7810. % to exdent this text, so make it be a no-op. makeinfo does not use
  7811. % hanging indentation so @noindent can still be needed within footnote
  7812. % text after an @example or the like (not that this is good style).
  7813. \let\noindent = \relax
  7814. %
  7815. % Hang the footnote text off the number. Use \everypar in case the
  7816. % footnote extends for more than one paragraph.
  7817. \everypar = {\hang}%
  7818. \textindent{\thisfootno}%
  7819. %
  7820. % Don't crash into the line above the footnote text. Since this
  7821. % expands into a box, it must come within the paragraph, lest it
  7822. % provide a place where TeX can split the footnote.
  7823. \footstrut
  7824. %
  7825. % Invoke rest of plain TeX footnote routine.
  7826. \futurelet\next\fo@t
  7827. }
  7828. }%end \catcode `\@=11
  7829. \def\errfootnotenest{%
  7830. \errhelp=\EMsimple
  7831. \errmessage{Nested footnotes not supported in texinfo.tex,
  7832. even though they work in makeinfo; sorry}
  7833. }
  7834. \def\errfootnoteheading{%
  7835. \errhelp=\EMsimple
  7836. \errmessage{Footnotes in chapters, sections, etc., are not supported}
  7837. }
  7838. % In case a @footnote appears in a vbox, save the footnote text and create
  7839. % the real \insert just after the vbox finished. Otherwise, the insertion
  7840. % would be lost.
  7841. % Similarly, if a @footnote appears inside an alignment, save the footnote
  7842. % text to a box and make the \insert when a row of the table is finished.
  7843. % And the same can be done for other insert classes. --kasal, 16nov03.
  7844. %
  7845. % Replace the \insert primitive by a cheating macro.
  7846. % Deeper inside, just make sure that the saved insertions are not spilled
  7847. % out prematurely.
  7848. %
  7849. \def\startsavinginserts{%
  7850. \ifx \insert\ptexinsert
  7851. \let\insert\saveinsert
  7852. \else
  7853. \let\checkinserts\relax
  7854. \fi
  7855. }
  7856. % This \insert replacement works for both \insert\footins{foo} and
  7857. % \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}.
  7858. %
  7859. \def\saveinsert#1{%
  7860. \edef\next{\noexpand\savetobox \makeSAVEname#1}%
  7861. \afterassignment\next
  7862. % swallow the left brace
  7863. \let\temp =
  7864. }
  7865. \def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}}
  7866. \def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1}
  7867. \def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi}
  7868. \def\placesaveins#1{%
  7869. \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname
  7870. {\box#1}%
  7871. }
  7872. % eat @SAVE -- beware, all of them have catcode \other:
  7873. {
  7874. \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-)
  7875. \gdef\gobblesave @SAVE{}
  7876. }
  7877. % initialization:
  7878. \def\newsaveins #1{%
  7879. \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}%
  7880. \next
  7881. }
  7882. \def\newsaveinsX #1{%
  7883. \csname newbox\endcsname #1%
  7884. \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts
  7885. \checksaveins #1}%
  7886. }
  7887. % initialize:
  7888. \let\checkinserts\empty
  7889. \newsaveins\footins
  7890. \newsaveins\margin
  7891. % @image. We use the macros from epsf.tex to support this.
  7892. % If epsf.tex is not installed and @image is used, we complain.
  7893. %
  7894. % Check for and read epsf.tex up front. If we read it only at @image
  7895. % time, we might be inside a group, and then its definitions would get
  7896. % undone and the next image would fail.
  7897. \openin 1 = epsf.tex
  7898. \ifeof 1 \else
  7899. % Do not bother showing banner with epsf.tex v2.7k (available in
  7900. % doc/epsf.tex and on ctan).
  7901. \def\epsfannounce{\toks0 = }%
  7902. \input epsf.tex
  7903. \fi
  7904. \closein 1
  7905. %
  7906. % We will only complain once about lack of epsf.tex.
  7907. \newif\ifwarnednoepsf
  7908. \newhelp\noepsfhelp{epsf.tex must be installed for images to
  7909. work. It is also included in the Texinfo distribution, or you can get
  7910. it from ftp://tug.org/tex/epsf.tex.}
  7911. %
  7912. \def\image#1{%
  7913. \ifx\epsfbox\thisisundefined
  7914. \ifwarnednoepsf \else
  7915. \errhelp = \noepsfhelp
  7916. \errmessage{epsf.tex not found, images will be ignored}%
  7917. \global\warnednoepsftrue
  7918. \fi
  7919. \else
  7920. \imagexxx #1,,,,,\finish
  7921. \fi
  7922. }
  7923. %
  7924. % Arguments to @image:
  7925. % #1 is (mandatory) image filename; we tack on .eps extension.
  7926. % #2 is (optional) width, #3 is (optional) height.
  7927. % #4 is (ignored optional) html alt text.
  7928. % #5 is (ignored optional) extension.
  7929. % #6 is just the usual extra ignored arg for parsing stuff.
  7930. \newif\ifimagevmode
  7931. \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
  7932. \catcode`\^^M = 5 % in case we're inside an example
  7933. \normalturnoffactive % allow _ et al. in names
  7934. % If the image is by itself, center it.
  7935. \ifvmode
  7936. \imagevmodetrue
  7937. \else \ifx\centersub\centerV
  7938. % for @center @image, we need a vbox so we can have our vertical space
  7939. \imagevmodetrue
  7940. \vbox\bgroup % vbox has better behavior than vtop herev
  7941. \fi\fi
  7942. %
  7943. \ifimagevmode
  7944. \nobreak\medskip
  7945. % Usually we'll have text after the image which will insert
  7946. % \parskip glue, so insert it here too to equalize the space
  7947. % above and below.
  7948. \nobreak\vskip\parskip
  7949. \nobreak
  7950. \fi
  7951. %
  7952. % Leave vertical mode so that indentation from an enclosing
  7953. % environment such as @quotation is respected.
  7954. % However, if we're at the top level, we don't want the
  7955. % normal paragraph indentation.
  7956. % On the other hand, if we are in the case of @center @image, we don't
  7957. % want to start a paragraph, which will create a hsize-width box and
  7958. % eradicate the centering.
  7959. \ifx\centersub\centerV\else \noindent \fi
  7960. %
  7961. % Output the image.
  7962. \ifpdf
  7963. \dopdfimage{#1}{#2}{#3}%
  7964. \else
  7965. % \epsfbox itself resets \epsf?size at each figure.
  7966. \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
  7967. \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
  7968. \epsfbox{#1.eps}%
  7969. \fi
  7970. %
  7971. \ifimagevmode
  7972. \medskip % space after a standalone image
  7973. \fi
  7974. \ifx\centersub\centerV \egroup \fi
  7975. \endgroup}
  7976. % @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables,
  7977. % etc. We don't actually implement floating yet, we always include the
  7978. % float "here". But it seemed the best name for the future.
  7979. %
  7980. \envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish}
  7981. % There may be a space before second and/or third parameter; delete it.
  7982. \def\eatcommaspace#1, {#1,}
  7983. % #1 is the optional FLOATTYPE, the text label for this float, typically
  7984. % "Figure", "Table", "Example", etc. Can't contain commas. If omitted,
  7985. % this float will not be numbered and cannot be referred to.
  7986. %
  7987. % #2 is the optional xref label. Also must be present for the float to
  7988. % be referable.
  7989. %
  7990. % #3 is the optional positioning argument; for now, it is ignored. It
  7991. % will somehow specify the positions allowed to float to (here, top, bottom).
  7992. %
  7993. % We keep a separate counter for each FLOATTYPE, which we reset at each
  7994. % chapter-level command.
  7995. \let\resetallfloatnos=\empty
  7996. %
  7997. \def\dofloat#1,#2,#3,#4\finish{%
  7998. \let\thiscaption=\empty
  7999. \let\thisshortcaption=\empty
  8000. %
  8001. % don't lose footnotes inside @float.
  8002. %
  8003. % BEWARE: when the floats start float, we have to issue warning whenever an
  8004. % insert appears inside a float which could possibly float. --kasal, 26may04
  8005. %
  8006. \startsavinginserts
  8007. %
  8008. % We can't be used inside a paragraph.
  8009. \par
  8010. %
  8011. \vtop\bgroup
  8012. \def\floattype{#1}%
  8013. \def\floatlabel{#2}%
  8014. \def\floatloc{#3}% we do nothing with this yet.
  8015. %
  8016. \ifx\floattype\empty
  8017. \let\safefloattype=\empty
  8018. \else
  8019. {%
  8020. % the floattype might have accents or other special characters,
  8021. % but we need to use it in a control sequence name.
  8022. \indexnofonts
  8023. \turnoffactive
  8024. \xdef\safefloattype{\floattype}%
  8025. }%
  8026. \fi
  8027. %
  8028. % If label is given but no type, we handle that as the empty type.
  8029. \ifx\floatlabel\empty \else
  8030. % We want each FLOATTYPE to be numbered separately (Figure 1,
  8031. % Table 1, Figure 2, ...). (And if no label, no number.)
  8032. %
  8033. \expandafter\getfloatno\csname\safefloattype floatno\endcsname
  8034. \global\advance\floatno by 1
  8035. %
  8036. {%
  8037. % This magic value for \lastsection is output by \setref as the
  8038. % XREFLABEL-title value. \xrefX uses it to distinguish float
  8039. % labels (which have a completely different output format) from
  8040. % node and anchor labels. And \xrdef uses it to construct the
  8041. % lists of floats.
  8042. %
  8043. \edef\lastsection{\floatmagic=\safefloattype}%
  8044. \setref{\floatlabel}{Yfloat}%
  8045. }%
  8046. \fi
  8047. %
  8048. % start with \parskip glue, I guess.
  8049. \vskip\parskip
  8050. %
  8051. % Don't suppress indentation if a float happens to start a section.
  8052. \restorefirstparagraphindent
  8053. }
  8054. % we have these possibilities:
  8055. % @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap
  8056. % @float Foo,lbl & no caption: Foo 1.1
  8057. % @float Foo & @caption{Cap}: Foo: Cap
  8058. % @float Foo & no caption: Foo
  8059. % @float ,lbl & Caption{Cap}: 1.1: Cap
  8060. % @float ,lbl & no caption: 1.1
  8061. % @float & @caption{Cap}: Cap
  8062. % @float & no caption:
  8063. %
  8064. \def\Efloat{%
  8065. \let\floatident = \empty
  8066. %
  8067. % In all cases, if we have a float type, it comes first.
  8068. \ifx\floattype\empty \else \def\floatident{\floattype}\fi
  8069. %
  8070. % If we have an xref label, the number comes next.
  8071. \ifx\floatlabel\empty \else
  8072. \ifx\floattype\empty \else % if also had float type, need tie first.
  8073. \appendtomacro\floatident{\tie}%
  8074. \fi
  8075. % the number.
  8076. \appendtomacro\floatident{\chaplevelprefix\the\floatno}%
  8077. \fi
  8078. %
  8079. % Start the printed caption with what we've constructed in
  8080. % \floatident, but keep it separate; we need \floatident again.
  8081. \let\captionline = \floatident
  8082. %
  8083. \ifx\thiscaption\empty \else
  8084. \ifx\floatident\empty \else
  8085. \appendtomacro\captionline{: }% had ident, so need a colon between
  8086. \fi
  8087. %
  8088. % caption text.
  8089. \appendtomacro\captionline{\scanexp\thiscaption}%
  8090. \fi
  8091. %
  8092. % If we have anything to print, print it, with space before.
  8093. % Eventually this needs to become an \insert.
  8094. \ifx\captionline\empty \else
  8095. \vskip.5\parskip
  8096. \captionline
  8097. %
  8098. % Space below caption.
  8099. \vskip\parskip
  8100. \fi
  8101. %
  8102. % If have an xref label, write the list of floats info. Do this
  8103. % after the caption, to avoid chance of it being a breakpoint.
  8104. \ifx\floatlabel\empty \else
  8105. % Write the text that goes in the lof to the aux file as
  8106. % \floatlabel-lof. Besides \floatident, we include the short
  8107. % caption if specified, else the full caption if specified, else nothing.
  8108. {%
  8109. \atdummies
  8110. %
  8111. % since we read the caption text in the macro world, where ^^M
  8112. % is turned into a normal character, we have to scan it back, so
  8113. % we don't write the literal three characters "^^M" into the aux file.
  8114. \scanexp{%
  8115. \xdef\noexpand\gtemp{%
  8116. \ifx\thisshortcaption\empty
  8117. \thiscaption
  8118. \else
  8119. \thisshortcaption
  8120. \fi
  8121. }%
  8122. }%
  8123. \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident
  8124. \ifx\gtemp\empty \else : \gtemp \fi}}%
  8125. }%
  8126. \fi
  8127. \egroup % end of \vtop
  8128. %
  8129. % place the captured inserts
  8130. %
  8131. % BEWARE: when the floats start floating, we have to issue warning
  8132. % whenever an insert appears inside a float which could possibly
  8133. % float. --kasal, 26may04
  8134. %
  8135. \checkinserts
  8136. }
  8137. % Append the tokens #2 to the definition of macro #1, not expanding either.
  8138. %
  8139. \def\appendtomacro#1#2{%
  8140. \expandafter\def\expandafter#1\expandafter{#1#2}%
  8141. }
  8142. % @caption, @shortcaption
  8143. %
  8144. \def\caption{\docaption\thiscaption}
  8145. \def\shortcaption{\docaption\thisshortcaption}
  8146. \def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption}
  8147. \def\defcaption#1#2{\egroup \def#1{#2}}
  8148. % The parameter is the control sequence identifying the counter we are
  8149. % going to use. Create it if it doesn't exist and assign it to \floatno.
  8150. \def\getfloatno#1{%
  8151. \ifx#1\relax
  8152. % Haven't seen this figure type before.
  8153. \csname newcount\endcsname #1%
  8154. %
  8155. % Remember to reset this floatno at the next chap.
  8156. \expandafter\gdef\expandafter\resetallfloatnos
  8157. \expandafter{\resetallfloatnos #1=0 }%
  8158. \fi
  8159. \let\floatno#1%
  8160. }
  8161. % \setref calls this to get the XREFLABEL-snt value. We want an @xref
  8162. % to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we
  8163. % first read the @float command.
  8164. %
  8165. \def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}%
  8166. % Magic string used for the XREFLABEL-title value, so \xrefX can
  8167. % distinguish floats from other xref types.
  8168. \def\floatmagic{!!float!!}
  8169. % #1 is the control sequence we are passed; we expand into a conditional
  8170. % which is true if #1 represents a float ref. That is, the magic
  8171. % \lastsection value which we \setref above.
  8172. %
  8173. \def\iffloat#1{\expandafter\doiffloat#1==\finish}
  8174. %
  8175. % #1 is (maybe) the \floatmagic string. If so, #2 will be the
  8176. % (safe) float type for this float. We set \iffloattype to #2.
  8177. %
  8178. \def\doiffloat#1=#2=#3\finish{%
  8179. \def\temp{#1}%
  8180. \def\iffloattype{#2}%
  8181. \ifx\temp\floatmagic
  8182. }
  8183. % @listoffloats FLOATTYPE - print a list of floats like a table of contents.
  8184. %
  8185. \parseargdef\listoffloats{%
  8186. \def\floattype{#1}% floattype
  8187. {%
  8188. % the floattype might have accents or other special characters,
  8189. % but we need to use it in a control sequence name.
  8190. \indexnofonts
  8191. \turnoffactive
  8192. \xdef\safefloattype{\floattype}%
  8193. }%
  8194. %
  8195. % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE.
  8196. \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax
  8197. \ifhavexrefs
  8198. % if the user said @listoffloats foo but never @float foo.
  8199. \message{\linenumber No `\safefloattype' floats to list.}%
  8200. \fi
  8201. \else
  8202. \begingroup
  8203. \leftskip=\tocindent % indent these entries like a toc
  8204. \let\do=\listoffloatsdo
  8205. \csname floatlist\safefloattype\endcsname
  8206. \endgroup
  8207. \fi
  8208. }
  8209. % This is called on each entry in a list of floats. We're passed the
  8210. % xref label, in the form LABEL-title, which is how we save it in the
  8211. % aux file. We strip off the -title and look up \XRLABEL-lof, which
  8212. % has the text we're supposed to typeset here.
  8213. %
  8214. % Figures without xref labels will not be included in the list (since
  8215. % they won't appear in the aux file).
  8216. %
  8217. \def\listoffloatsdo#1{\listoffloatsdoentry#1\finish}
  8218. \def\listoffloatsdoentry#1-title\finish{{%
  8219. % Can't fully expand XR#1-lof because it can contain anything. Just
  8220. % pass the control sequence. On the other hand, XR#1-pg is just the
  8221. % page number, and we want to fully expand that so we can get a link
  8222. % in pdf output.
  8223. \toksA = \expandafter{\csname XR#1-lof\endcsname}%
  8224. %
  8225. % use the same \entry macro we use to generate the TOC and index.
  8226. \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}%
  8227. \writeentry
  8228. }}
  8229. \message{localization,}
  8230. % For single-language documents, @documentlanguage is usually given very
  8231. % early, just after @documentencoding. Single argument is the language
  8232. % (de) or locale (de_DE) abbreviation.
  8233. %
  8234. {
  8235. \catcode`\_ = \active
  8236. \globaldefs=1
  8237. \parseargdef\documentlanguage{%
  8238. \tex % read txi-??.tex file in plain TeX.
  8239. % Read the file by the name they passed if it exists.
  8240. \let_ = \normalunderscore % normal _ character for filename test
  8241. \openin 1 txi-#1.tex
  8242. \ifeof 1
  8243. \documentlanguagetrywithoutunderscore #1_\finish
  8244. \else
  8245. \globaldefs = 1 % everything in the txi-LL files needs to persist
  8246. \input txi-#1.tex
  8247. \fi
  8248. \closein 1
  8249. \endgroup % end raw TeX
  8250. }
  8251. %
  8252. % If they passed de_DE, and txi-de_DE.tex doesn't exist,
  8253. % try txi-de.tex.
  8254. %
  8255. \gdef\documentlanguagetrywithoutunderscore#1_#2\finish{%
  8256. \openin 1 txi-#1.tex
  8257. \ifeof 1
  8258. \errhelp = \nolanghelp
  8259. \errmessage{Cannot read language file txi-#1.tex}%
  8260. \else
  8261. \globaldefs = 1 % everything in the txi-LL files needs to persist
  8262. \input txi-#1.tex
  8263. \fi
  8264. \closein 1
  8265. }
  8266. }% end of special _ catcode
  8267. %
  8268. \newhelp\nolanghelp{The given language definition file cannot be found or
  8269. is empty. Maybe you need to install it? Putting it in the current
  8270. directory should work if nowhere else does.}
  8271. % This macro is called from txi-??.tex files; the first argument is the
  8272. % \language name to set (without the "\lang@" prefix), the second and
  8273. % third args are \{left,right}hyphenmin.
  8274. %
  8275. % The language names to pass are determined when the format is built.
  8276. % See the etex.log file created at that time, e.g.,
  8277. % /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log.
  8278. %
  8279. % With TeX Live 2008, etex now includes hyphenation patterns for all
  8280. % available languages. This means we can support hyphenation in
  8281. % Texinfo, at least to some extent. (This still doesn't solve the
  8282. % accented characters problem.)
  8283. %
  8284. \catcode`@=11
  8285. \def\txisetlanguage#1#2#3{%
  8286. % do not set the language if the name is undefined in the current TeX.
  8287. \expandafter\ifx\csname lang@#1\endcsname \relax
  8288. \message{no patterns for #1}%
  8289. \else
  8290. \global\language = \csname lang@#1\endcsname
  8291. \fi
  8292. % but there is no harm in adjusting the hyphenmin values regardless.
  8293. \global\lefthyphenmin = #2\relax
  8294. \global\righthyphenmin = #3\relax
  8295. }
  8296. % Helpers for encodings.
  8297. % Set the catcode of characters 128 through 255 to the specified number.
  8298. %
  8299. \def\setnonasciicharscatcode#1{%
  8300. \count255=128
  8301. \loop\ifnum\count255<256
  8302. \global\catcode\count255=#1\relax
  8303. \advance\count255 by 1
  8304. \repeat
  8305. }
  8306. \def\setnonasciicharscatcodenonglobal#1{%
  8307. \count255=128
  8308. \loop\ifnum\count255<256
  8309. \catcode\count255=#1\relax
  8310. \advance\count255 by 1
  8311. \repeat
  8312. }
  8313. % @documentencoding sets the definition of non-ASCII characters
  8314. % according to the specified encoding.
  8315. %
  8316. \parseargdef\documentencoding{%
  8317. % Encoding being declared for the document.
  8318. \def\declaredencoding{\csname #1.enc\endcsname}%
  8319. %
  8320. % Supported encodings: names converted to tokens in order to be able
  8321. % to compare them with \ifx.
  8322. \def\ascii{\csname US-ASCII.enc\endcsname}%
  8323. \def\latnine{\csname ISO-8859-15.enc\endcsname}%
  8324. \def\latone{\csname ISO-8859-1.enc\endcsname}%
  8325. \def\lattwo{\csname ISO-8859-2.enc\endcsname}%
  8326. \def\utfeight{\csname UTF-8.enc\endcsname}%
  8327. %
  8328. \ifx \declaredencoding \ascii
  8329. \asciichardefs
  8330. %
  8331. \else \ifx \declaredencoding \lattwo
  8332. \setnonasciicharscatcode\active
  8333. \lattwochardefs
  8334. %
  8335. \else \ifx \declaredencoding \latone
  8336. \setnonasciicharscatcode\active
  8337. \latonechardefs
  8338. %
  8339. \else \ifx \declaredencoding \latnine
  8340. \setnonasciicharscatcode\active
  8341. \latninechardefs
  8342. %
  8343. \else \ifx \declaredencoding \utfeight
  8344. \setnonasciicharscatcode\active
  8345. % since we already invoked \utfeightchardefs at the top level
  8346. % (below), do not re-invoke it, then our check for duplicated
  8347. % definitions triggers. Making non-ascii chars active is enough.
  8348. %
  8349. \else
  8350. \message{Ignoring unknown document encoding: #1.}%
  8351. %
  8352. \fi % utfeight
  8353. \fi % latnine
  8354. \fi % latone
  8355. \fi % lattwo
  8356. \fi % ascii
  8357. }
  8358. % emacs-page
  8359. % A message to be logged when using a character that isn't available
  8360. % the default font encoding (OT1).
  8361. %
  8362. \def\missingcharmsg#1{\message{Character missing, sorry: #1.}}
  8363. % Take account of \c (plain) vs. \, (Texinfo) difference.
  8364. \def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
  8365. % First, make active non-ASCII characters in order for them to be
  8366. % correctly categorized when TeX reads the replacement text of
  8367. % macros containing the character definitions.
  8368. \setnonasciicharscatcode\active
  8369. %
  8370. % Latin1 (ISO-8859-1) character definitions.
  8371. \def\latonechardefs{%
  8372. \gdef^^a0{\tie}
  8373. \gdef^^a1{\exclamdown}
  8374. \gdef^^a2{\missingcharmsg{CENT SIGN}}
  8375. \gdef^^a3{{\pounds}}
  8376. \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
  8377. \gdef^^a5{\missingcharmsg{YEN SIGN}}
  8378. \gdef^^a6{\missingcharmsg{BROKEN BAR}}
  8379. \gdef^^a7{\S}
  8380. \gdef^^a8{\"{}}
  8381. \gdef^^a9{\copyright}
  8382. \gdef^^aa{\ordf}
  8383. \gdef^^ab{\guillemetleft}
  8384. \gdef^^ac{$\lnot$}
  8385. \gdef^^ad{\-}
  8386. \gdef^^ae{\registeredsymbol}
  8387. \gdef^^af{\={}}
  8388. %
  8389. \gdef^^b0{\textdegree}
  8390. \gdef^^b1{$\pm$}
  8391. \gdef^^b2{$^2$}
  8392. \gdef^^b3{$^3$}
  8393. \gdef^^b4{\'{}}
  8394. \gdef^^b5{$\mu$}
  8395. \gdef^^b6{\P}
  8396. \gdef^^b7{\ifmmode\cdot\else $\cdot$\fi}
  8397. \gdef^^b8{\cedilla\ }
  8398. \gdef^^b9{$^1$}
  8399. \gdef^^ba{\ordm}
  8400. \gdef^^bb{\guillemetright}
  8401. \gdef^^bc{$1\over4$}
  8402. \gdef^^bd{$1\over2$}
  8403. \gdef^^be{$3\over4$}
  8404. \gdef^^bf{\questiondown}
  8405. %
  8406. \gdef^^c0{\`A}
  8407. \gdef^^c1{\'A}
  8408. \gdef^^c2{\^A}
  8409. \gdef^^c3{\~A}
  8410. \gdef^^c4{\"A}
  8411. \gdef^^c5{\ringaccent A}
  8412. \gdef^^c6{\AE}
  8413. \gdef^^c7{\cedilla C}
  8414. \gdef^^c8{\`E}
  8415. \gdef^^c9{\'E}
  8416. \gdef^^ca{\^E}
  8417. \gdef^^cb{\"E}
  8418. \gdef^^cc{\`I}
  8419. \gdef^^cd{\'I}
  8420. \gdef^^ce{\^I}
  8421. \gdef^^cf{\"I}
  8422. %
  8423. \gdef^^d0{\DH}
  8424. \gdef^^d1{\~N}
  8425. \gdef^^d2{\`O}
  8426. \gdef^^d3{\'O}
  8427. \gdef^^d4{\^O}
  8428. \gdef^^d5{\~O}
  8429. \gdef^^d6{\"O}
  8430. \gdef^^d7{$\times$}
  8431. \gdef^^d8{\O}
  8432. \gdef^^d9{\`U}
  8433. \gdef^^da{\'U}
  8434. \gdef^^db{\^U}
  8435. \gdef^^dc{\"U}
  8436. \gdef^^dd{\'Y}
  8437. \gdef^^de{\TH}
  8438. \gdef^^df{\ss}
  8439. %
  8440. \gdef^^e0{\`a}
  8441. \gdef^^e1{\'a}
  8442. \gdef^^e2{\^a}
  8443. \gdef^^e3{\~a}
  8444. \gdef^^e4{\"a}
  8445. \gdef^^e5{\ringaccent a}
  8446. \gdef^^e6{\ae}
  8447. \gdef^^e7{\cedilla c}
  8448. \gdef^^e8{\`e}
  8449. \gdef^^e9{\'e}
  8450. \gdef^^ea{\^e}
  8451. \gdef^^eb{\"e}
  8452. \gdef^^ec{\`{\dotless i}}
  8453. \gdef^^ed{\'{\dotless i}}
  8454. \gdef^^ee{\^{\dotless i}}
  8455. \gdef^^ef{\"{\dotless i}}
  8456. %
  8457. \gdef^^f0{\dh}
  8458. \gdef^^f1{\~n}
  8459. \gdef^^f2{\`o}
  8460. \gdef^^f3{\'o}
  8461. \gdef^^f4{\^o}
  8462. \gdef^^f5{\~o}
  8463. \gdef^^f6{\"o}
  8464. \gdef^^f7{$\div$}
  8465. \gdef^^f8{\o}
  8466. \gdef^^f9{\`u}
  8467. \gdef^^fa{\'u}
  8468. \gdef^^fb{\^u}
  8469. \gdef^^fc{\"u}
  8470. \gdef^^fd{\'y}
  8471. \gdef^^fe{\th}
  8472. \gdef^^ff{\"y}
  8473. }
  8474. % Latin9 (ISO-8859-15) encoding character definitions.
  8475. \def\latninechardefs{%
  8476. % Encoding is almost identical to Latin1.
  8477. \latonechardefs
  8478. %
  8479. \gdef^^a4{\euro}
  8480. \gdef^^a6{\v S}
  8481. \gdef^^a8{\v s}
  8482. \gdef^^b4{\v Z}
  8483. \gdef^^b8{\v z}
  8484. \gdef^^bc{\OE}
  8485. \gdef^^bd{\oe}
  8486. \gdef^^be{\"Y}
  8487. }
  8488. % Latin2 (ISO-8859-2) character definitions.
  8489. \def\lattwochardefs{%
  8490. \gdef^^a0{\tie}
  8491. \gdef^^a1{\ogonek{A}}
  8492. \gdef^^a2{\u{}}
  8493. \gdef^^a3{\L}
  8494. \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
  8495. \gdef^^a5{\v L}
  8496. \gdef^^a6{\'S}
  8497. \gdef^^a7{\S}
  8498. \gdef^^a8{\"{}}
  8499. \gdef^^a9{\v S}
  8500. \gdef^^aa{\cedilla S}
  8501. \gdef^^ab{\v T}
  8502. \gdef^^ac{\'Z}
  8503. \gdef^^ad{\-}
  8504. \gdef^^ae{\v Z}
  8505. \gdef^^af{\dotaccent Z}
  8506. %
  8507. \gdef^^b0{\textdegree}
  8508. \gdef^^b1{\ogonek{a}}
  8509. \gdef^^b2{\ogonek{ }}
  8510. \gdef^^b3{\l}
  8511. \gdef^^b4{\'{}}
  8512. \gdef^^b5{\v l}
  8513. \gdef^^b6{\'s}
  8514. \gdef^^b7{\v{}}
  8515. \gdef^^b8{\cedilla\ }
  8516. \gdef^^b9{\v s}
  8517. \gdef^^ba{\cedilla s}
  8518. \gdef^^bb{\v t}
  8519. \gdef^^bc{\'z}
  8520. \gdef^^bd{\H{}}
  8521. \gdef^^be{\v z}
  8522. \gdef^^bf{\dotaccent z}
  8523. %
  8524. \gdef^^c0{\'R}
  8525. \gdef^^c1{\'A}
  8526. \gdef^^c2{\^A}
  8527. \gdef^^c3{\u A}
  8528. \gdef^^c4{\"A}
  8529. \gdef^^c5{\'L}
  8530. \gdef^^c6{\'C}
  8531. \gdef^^c7{\cedilla C}
  8532. \gdef^^c8{\v C}
  8533. \gdef^^c9{\'E}
  8534. \gdef^^ca{\ogonek{E}}
  8535. \gdef^^cb{\"E}
  8536. \gdef^^cc{\v E}
  8537. \gdef^^cd{\'I}
  8538. \gdef^^ce{\^I}
  8539. \gdef^^cf{\v D}
  8540. %
  8541. \gdef^^d0{\DH}
  8542. \gdef^^d1{\'N}
  8543. \gdef^^d2{\v N}
  8544. \gdef^^d3{\'O}
  8545. \gdef^^d4{\^O}
  8546. \gdef^^d5{\H O}
  8547. \gdef^^d6{\"O}
  8548. \gdef^^d7{$\times$}
  8549. \gdef^^d8{\v R}
  8550. \gdef^^d9{\ringaccent U}
  8551. \gdef^^da{\'U}
  8552. \gdef^^db{\H U}
  8553. \gdef^^dc{\"U}
  8554. \gdef^^dd{\'Y}
  8555. \gdef^^de{\cedilla T}
  8556. \gdef^^df{\ss}
  8557. %
  8558. \gdef^^e0{\'r}
  8559. \gdef^^e1{\'a}
  8560. \gdef^^e2{\^a}
  8561. \gdef^^e3{\u a}
  8562. \gdef^^e4{\"a}
  8563. \gdef^^e5{\'l}
  8564. \gdef^^e6{\'c}
  8565. \gdef^^e7{\cedilla c}
  8566. \gdef^^e8{\v c}
  8567. \gdef^^e9{\'e}
  8568. \gdef^^ea{\ogonek{e}}
  8569. \gdef^^eb{\"e}
  8570. \gdef^^ec{\v e}
  8571. \gdef^^ed{\'{\dotless{i}}}
  8572. \gdef^^ee{\^{\dotless{i}}}
  8573. \gdef^^ef{\v d}
  8574. %
  8575. \gdef^^f0{\dh}
  8576. \gdef^^f1{\'n}
  8577. \gdef^^f2{\v n}
  8578. \gdef^^f3{\'o}
  8579. \gdef^^f4{\^o}
  8580. \gdef^^f5{\H o}
  8581. \gdef^^f6{\"o}
  8582. \gdef^^f7{$\div$}
  8583. \gdef^^f8{\v r}
  8584. \gdef^^f9{\ringaccent u}
  8585. \gdef^^fa{\'u}
  8586. \gdef^^fb{\H u}
  8587. \gdef^^fc{\"u}
  8588. \gdef^^fd{\'y}
  8589. \gdef^^fe{\cedilla t}
  8590. \gdef^^ff{\dotaccent{}}
  8591. }
  8592. % UTF-8 character definitions.
  8593. %
  8594. % This code to support UTF-8 is based on LaTeX's utf8.def, with some
  8595. % changes for Texinfo conventions. It is included here under the GPL by
  8596. % permission from Frank Mittelbach and the LaTeX team.
  8597. %
  8598. \newcount\countUTFx
  8599. \newcount\countUTFy
  8600. \newcount\countUTFz
  8601. \gdef\UTFviiiTwoOctets#1#2{\expandafter
  8602. \UTFviiiDefined\csname u8:#1\string #2\endcsname}
  8603. %
  8604. \gdef\UTFviiiThreeOctets#1#2#3{\expandafter
  8605. \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname}
  8606. %
  8607. \gdef\UTFviiiFourOctets#1#2#3#4{\expandafter
  8608. \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname}
  8609. \gdef\UTFviiiDefined#1{%
  8610. \ifx #1\relax
  8611. \message{\linenumber Unicode char \string #1 not defined for Texinfo}%
  8612. \else
  8613. \expandafter #1%
  8614. \fi
  8615. }
  8616. \begingroup
  8617. \catcode`\~13
  8618. \catcode`\"12
  8619. \def\UTFviiiLoop{%
  8620. \global\catcode\countUTFx\active
  8621. \uccode`\~\countUTFx
  8622. \uppercase\expandafter{\UTFviiiTmp}%
  8623. \advance\countUTFx by 1
  8624. \ifnum\countUTFx < \countUTFy
  8625. \expandafter\UTFviiiLoop
  8626. \fi}
  8627. \countUTFx = "C2
  8628. \countUTFy = "E0
  8629. \def\UTFviiiTmp{%
  8630. \xdef~{\noexpand\UTFviiiTwoOctets\string~}}
  8631. \UTFviiiLoop
  8632. \countUTFx = "E0
  8633. \countUTFy = "F0
  8634. \def\UTFviiiTmp{%
  8635. \xdef~{\noexpand\UTFviiiThreeOctets\string~}}
  8636. \UTFviiiLoop
  8637. \countUTFx = "F0
  8638. \countUTFy = "F4
  8639. \def\UTFviiiTmp{%
  8640. \xdef~{\noexpand\UTFviiiFourOctets\string~}}
  8641. \UTFviiiLoop
  8642. \endgroup
  8643. \def\globallet{\global\let} % save some \expandafter's below
  8644. % @U{xxxx} to produce U+xxxx, if we support it.
  8645. \def\U#1{%
  8646. \expandafter\ifx\csname uni:#1\endcsname \relax
  8647. \errhelp = \EMsimple
  8648. \errmessage{Unicode character U+#1 not supported, sorry}%
  8649. \else
  8650. \csname uni:#1\endcsname
  8651. \fi
  8652. }
  8653. \begingroup
  8654. \catcode`\"=12
  8655. \catcode`\<=12
  8656. \catcode`\.=12
  8657. \catcode`\,=12
  8658. \catcode`\;=12
  8659. \catcode`\!=12
  8660. \catcode`\~=13
  8661. \gdef\DeclareUnicodeCharacter#1#2{%
  8662. \countUTFz = "#1\relax
  8663. %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%
  8664. \begingroup
  8665. \parseXMLCharref
  8666. \def\UTFviiiTwoOctets##1##2{%
  8667. \csname u8:##1\string ##2\endcsname}%
  8668. \def\UTFviiiThreeOctets##1##2##3{%
  8669. \csname u8:##1\string ##2\string ##3\endcsname}%
  8670. \def\UTFviiiFourOctets##1##2##3##4{%
  8671. \csname u8:##1\string ##2\string ##3\string ##4\endcsname}%
  8672. \expandafter\expandafter\expandafter\expandafter
  8673. \expandafter\expandafter\expandafter
  8674. \gdef\UTFviiiTmp{#2}%
  8675. %
  8676. \expandafter\ifx\csname uni:#1\endcsname \relax \else
  8677. \errmessage{Internal error, already defined: #1}%
  8678. \fi
  8679. %
  8680. % define an additional control sequence for this code point.
  8681. \expandafter\globallet\csname uni:#1\endcsname \UTFviiiTmp
  8682. \endgroup}
  8683. \gdef\parseXMLCharref{%
  8684. \ifnum\countUTFz < "A0\relax
  8685. \errhelp = \EMsimple
  8686. \errmessage{Cannot define Unicode char value < 00A0}%
  8687. \else\ifnum\countUTFz < "800\relax
  8688. \parseUTFviiiA,%
  8689. \parseUTFviiiB C\UTFviiiTwoOctets.,%
  8690. \else\ifnum\countUTFz < "10000\relax
  8691. \parseUTFviiiA;%
  8692. \parseUTFviiiA,%
  8693. \parseUTFviiiB E\UTFviiiThreeOctets.{,;}%
  8694. \else
  8695. \parseUTFviiiA;%
  8696. \parseUTFviiiA,%
  8697. \parseUTFviiiA!%
  8698. \parseUTFviiiB F\UTFviiiFourOctets.{!,;}%
  8699. \fi\fi\fi
  8700. }
  8701. \gdef\parseUTFviiiA#1{%
  8702. \countUTFx = \countUTFz
  8703. \divide\countUTFz by 64
  8704. \countUTFy = \countUTFz
  8705. \multiply\countUTFz by 64
  8706. \advance\countUTFx by -\countUTFz
  8707. \advance\countUTFx by 128
  8708. \uccode `#1\countUTFx
  8709. \countUTFz = \countUTFy}
  8710. \gdef\parseUTFviiiB#1#2#3#4{%
  8711. \advance\countUTFz by "#10\relax
  8712. \uccode `#3\countUTFz
  8713. \uppercase{\gdef\UTFviiiTmp{#2#3#4}}}
  8714. \endgroup
  8715. % https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_M
  8716. % U+0000..U+007F = https://en.wikipedia.org/wiki/Basic_Latin_(Unicode_block)
  8717. % U+0080..U+00FF = https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)
  8718. % U+0100..U+017F = https://en.wikipedia.org/wiki/Latin_Extended-A
  8719. % U+0180..U+024F = https://en.wikipedia.org/wiki/Latin_Extended-B
  8720. %
  8721. % Many of our renditions are less than wonderful, and all the missing
  8722. % characters are available somewhere. Loading the necessary fonts
  8723. % awaits user request. We can't truly support Unicode without
  8724. % reimplementing everything that's been done in LaTeX for many years,
  8725. % plus probably using luatex or xetex, and who knows what else.
  8726. % We won't be doing that here in this simple file. But we can try to at
  8727. % least make most of the characters not bomb out.
  8728. %
  8729. \def\utfeightchardefs{%
  8730. \DeclareUnicodeCharacter{00A0}{\tie}
  8731. \DeclareUnicodeCharacter{00A1}{\exclamdown}
  8732. \DeclareUnicodeCharacter{00A3}{\pounds}
  8733. \DeclareUnicodeCharacter{00A7}{\S}
  8734. \DeclareUnicodeCharacter{00A8}{\"{ }}
  8735. \DeclareUnicodeCharacter{00A9}{\copyright}
  8736. \DeclareUnicodeCharacter{00AA}{\ordf}
  8737. \DeclareUnicodeCharacter{00AB}{\guillemetleft}
  8738. \DeclareUnicodeCharacter{00AC}{\ifmmode\lnot\else $\lnot$\fi}
  8739. \DeclareUnicodeCharacter{00AD}{\-}
  8740. \DeclareUnicodeCharacter{00AE}{\registeredsymbol}
  8741. \DeclareUnicodeCharacter{00AF}{\={ }}
  8742. \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}
  8743. \DeclareUnicodeCharacter{00B1}{\ifmmode\pm\else $\pm$\fi}
  8744. \DeclareUnicodeCharacter{00B2}{$^2$}
  8745. \DeclareUnicodeCharacter{00B3}{$^3$}
  8746. \DeclareUnicodeCharacter{00B4}{\'{ }}
  8747. \DeclareUnicodeCharacter{00B5}{$\mu$}
  8748. \DeclareUnicodeCharacter{00B6}{\P}
  8749. \DeclareUnicodeCharacter{00B7}{\ifmmode\cdot\else $\cdot$\fi}
  8750. \DeclareUnicodeCharacter{00B8}{\cedilla{ }}
  8751. \DeclareUnicodeCharacter{00B9}{$^1$}
  8752. \DeclareUnicodeCharacter{00BA}{\ordm}
  8753. \DeclareUnicodeCharacter{00BB}{\guillemetright}
  8754. \DeclareUnicodeCharacter{00BC}{$1\over4$}
  8755. \DeclareUnicodeCharacter{00BD}{$1\over2$}
  8756. \DeclareUnicodeCharacter{00BE}{$3\over4$}
  8757. \DeclareUnicodeCharacter{00BF}{\questiondown}
  8758. \DeclareUnicodeCharacter{00C0}{\`A}
  8759. \DeclareUnicodeCharacter{00C1}{\'A}
  8760. \DeclareUnicodeCharacter{00C2}{\^A}
  8761. \DeclareUnicodeCharacter{00C3}{\~A}
  8762. \DeclareUnicodeCharacter{00C4}{\"A}
  8763. \DeclareUnicodeCharacter{00C5}{\AA}
  8764. \DeclareUnicodeCharacter{00C6}{\AE}
  8765. \DeclareUnicodeCharacter{00C7}{\cedilla{C}}
  8766. \DeclareUnicodeCharacter{00C8}{\`E}
  8767. \DeclareUnicodeCharacter{00C9}{\'E}
  8768. \DeclareUnicodeCharacter{00CA}{\^E}
  8769. \DeclareUnicodeCharacter{00CB}{\"E}
  8770. \DeclareUnicodeCharacter{00CC}{\`I}
  8771. \DeclareUnicodeCharacter{00CD}{\'I}
  8772. \DeclareUnicodeCharacter{00CE}{\^I}
  8773. \DeclareUnicodeCharacter{00CF}{\"I}
  8774. \DeclareUnicodeCharacter{00D0}{\DH}
  8775. \DeclareUnicodeCharacter{00D1}{\~N}
  8776. \DeclareUnicodeCharacter{00D2}{\`O}
  8777. \DeclareUnicodeCharacter{00D3}{\'O}
  8778. \DeclareUnicodeCharacter{00D4}{\^O}
  8779. \DeclareUnicodeCharacter{00D5}{\~O}
  8780. \DeclareUnicodeCharacter{00D6}{\"O}
  8781. \DeclareUnicodeCharacter{00D7}{\ifmmode\times\else $\times$\fi}
  8782. \DeclareUnicodeCharacter{00D8}{\O}
  8783. \DeclareUnicodeCharacter{00D9}{\`U}
  8784. \DeclareUnicodeCharacter{00DA}{\'U}
  8785. \DeclareUnicodeCharacter{00DB}{\^U}
  8786. \DeclareUnicodeCharacter{00DC}{\"U}
  8787. \DeclareUnicodeCharacter{00DD}{\'Y}
  8788. \DeclareUnicodeCharacter{00DE}{\TH}
  8789. \DeclareUnicodeCharacter{00DF}{\ss}
  8790. \DeclareUnicodeCharacter{00E0}{\`a}
  8791. \DeclareUnicodeCharacter{00E1}{\'a}
  8792. \DeclareUnicodeCharacter{00E2}{\^a}
  8793. \DeclareUnicodeCharacter{00E3}{\~a}
  8794. \DeclareUnicodeCharacter{00E4}{\"a}
  8795. \DeclareUnicodeCharacter{00E5}{\aa}
  8796. \DeclareUnicodeCharacter{00E6}{\ae}
  8797. \DeclareUnicodeCharacter{00E7}{\cedilla{c}}
  8798. \DeclareUnicodeCharacter{00E8}{\`e}
  8799. \DeclareUnicodeCharacter{00E9}{\'e}
  8800. \DeclareUnicodeCharacter{00EA}{\^e}
  8801. \DeclareUnicodeCharacter{00EB}{\"e}
  8802. \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}
  8803. \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}
  8804. \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}
  8805. \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}
  8806. \DeclareUnicodeCharacter{00F0}{\dh}
  8807. \DeclareUnicodeCharacter{00F1}{\~n}
  8808. \DeclareUnicodeCharacter{00F2}{\`o}
  8809. \DeclareUnicodeCharacter{00F3}{\'o}
  8810. \DeclareUnicodeCharacter{00F4}{\^o}
  8811. \DeclareUnicodeCharacter{00F5}{\~o}
  8812. \DeclareUnicodeCharacter{00F6}{\"o}
  8813. \DeclareUnicodeCharacter{00F7}{\ifmmode\div\else $\div$\fi}
  8814. \DeclareUnicodeCharacter{00F8}{\o}
  8815. \DeclareUnicodeCharacter{00F9}{\`u}
  8816. \DeclareUnicodeCharacter{00FA}{\'u}
  8817. \DeclareUnicodeCharacter{00FB}{\^u}
  8818. \DeclareUnicodeCharacter{00FC}{\"u}
  8819. \DeclareUnicodeCharacter{00FD}{\'y}
  8820. \DeclareUnicodeCharacter{00FE}{\th}
  8821. \DeclareUnicodeCharacter{00FF}{\"y}
  8822. \DeclareUnicodeCharacter{0100}{\=A}
  8823. \DeclareUnicodeCharacter{0101}{\=a}
  8824. \DeclareUnicodeCharacter{0102}{\u{A}}
  8825. \DeclareUnicodeCharacter{0103}{\u{a}}
  8826. \DeclareUnicodeCharacter{0104}{\ogonek{A}}
  8827. \DeclareUnicodeCharacter{0105}{\ogonek{a}}
  8828. \DeclareUnicodeCharacter{0106}{\'C}
  8829. \DeclareUnicodeCharacter{0107}{\'c}
  8830. \DeclareUnicodeCharacter{0108}{\^C}
  8831. \DeclareUnicodeCharacter{0109}{\^c}
  8832. \DeclareUnicodeCharacter{010A}{\dotaccent{C}}
  8833. \DeclareUnicodeCharacter{010B}{\dotaccent{c}}
  8834. \DeclareUnicodeCharacter{010C}{\v{C}}
  8835. \DeclareUnicodeCharacter{010D}{\v{c}}
  8836. \DeclareUnicodeCharacter{010E}{\v{D}}
  8837. \DeclareUnicodeCharacter{010F}{d'}
  8838. \DeclareUnicodeCharacter{0110}{\DH}
  8839. \DeclareUnicodeCharacter{0111}{\dh}
  8840. \DeclareUnicodeCharacter{0112}{\=E}
  8841. \DeclareUnicodeCharacter{0113}{\=e}
  8842. \DeclareUnicodeCharacter{0114}{\u{E}}
  8843. \DeclareUnicodeCharacter{0115}{\u{e}}
  8844. \DeclareUnicodeCharacter{0116}{\dotaccent{E}}
  8845. \DeclareUnicodeCharacter{0117}{\dotaccent{e}}
  8846. \DeclareUnicodeCharacter{0118}{\ogonek{E}}
  8847. \DeclareUnicodeCharacter{0119}{\ogonek{e}}
  8848. \DeclareUnicodeCharacter{011A}{\v{E}}
  8849. \DeclareUnicodeCharacter{011B}{\v{e}}
  8850. \DeclareUnicodeCharacter{011C}{\^G}
  8851. \DeclareUnicodeCharacter{011D}{\^g}
  8852. \DeclareUnicodeCharacter{011E}{\u{G}}
  8853. \DeclareUnicodeCharacter{011F}{\u{g}}
  8854. \DeclareUnicodeCharacter{0120}{\dotaccent{G}}
  8855. \DeclareUnicodeCharacter{0121}{\dotaccent{g}}
  8856. \DeclareUnicodeCharacter{0122}{\cedilla{G}}
  8857. \DeclareUnicodeCharacter{0123}{\cedilla{g}}
  8858. \DeclareUnicodeCharacter{0124}{\^H}
  8859. \DeclareUnicodeCharacter{0125}{\^h}
  8860. \DeclareUnicodeCharacter{0126}{\missingcharmsg{H WITH STROKE}}
  8861. \DeclareUnicodeCharacter{0127}{\missingcharmsg{h WITH STROKE}}
  8862. \DeclareUnicodeCharacter{0128}{\~I}
  8863. \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}
  8864. \DeclareUnicodeCharacter{012A}{\=I}
  8865. \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}
  8866. \DeclareUnicodeCharacter{012C}{\u{I}}
  8867. \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}
  8868. \DeclareUnicodeCharacter{012E}{\ogonek{I}}
  8869. \DeclareUnicodeCharacter{012F}{\ogonek{i}}
  8870. \DeclareUnicodeCharacter{0130}{\dotaccent{I}}
  8871. \DeclareUnicodeCharacter{0131}{\dotless{i}}
  8872. \DeclareUnicodeCharacter{0132}{IJ}
  8873. \DeclareUnicodeCharacter{0133}{ij}
  8874. \DeclareUnicodeCharacter{0134}{\^J}
  8875. \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}
  8876. \DeclareUnicodeCharacter{0136}{\cedilla{K}}
  8877. \DeclareUnicodeCharacter{0137}{\cedilla{k}}
  8878. \DeclareUnicodeCharacter{0138}{\ifmmode\kappa\else $\kappa$\fi}
  8879. \DeclareUnicodeCharacter{0139}{\'L}
  8880. \DeclareUnicodeCharacter{013A}{\'l}
  8881. \DeclareUnicodeCharacter{013B}{\cedilla{L}}
  8882. \DeclareUnicodeCharacter{013C}{\cedilla{l}}
  8883. \DeclareUnicodeCharacter{013D}{L'}% should kern
  8884. \DeclareUnicodeCharacter{013E}{l'}% should kern
  8885. \DeclareUnicodeCharacter{013F}{L\U{00B7}}
  8886. \DeclareUnicodeCharacter{0140}{l\U{00B7}}
  8887. \DeclareUnicodeCharacter{0141}{\L}
  8888. \DeclareUnicodeCharacter{0142}{\l}
  8889. \DeclareUnicodeCharacter{0143}{\'N}
  8890. \DeclareUnicodeCharacter{0144}{\'n}
  8891. \DeclareUnicodeCharacter{0145}{\cedilla{N}}
  8892. \DeclareUnicodeCharacter{0146}{\cedilla{n}}
  8893. \DeclareUnicodeCharacter{0147}{\v{N}}
  8894. \DeclareUnicodeCharacter{0148}{\v{n}}
  8895. \DeclareUnicodeCharacter{0149}{'n}
  8896. \DeclareUnicodeCharacter{014A}{\missingcharmsg{ENG}}
  8897. \DeclareUnicodeCharacter{014B}{\missingcharmsg{eng}}
  8898. \DeclareUnicodeCharacter{014C}{\=O}
  8899. \DeclareUnicodeCharacter{014D}{\=o}
  8900. \DeclareUnicodeCharacter{014E}{\u{O}}
  8901. \DeclareUnicodeCharacter{014F}{\u{o}}
  8902. \DeclareUnicodeCharacter{0150}{\H{O}}
  8903. \DeclareUnicodeCharacter{0151}{\H{o}}
  8904. \DeclareUnicodeCharacter{0152}{\OE}
  8905. \DeclareUnicodeCharacter{0153}{\oe}
  8906. \DeclareUnicodeCharacter{0154}{\'R}
  8907. \DeclareUnicodeCharacter{0155}{\'r}
  8908. \DeclareUnicodeCharacter{0156}{\cedilla{R}}
  8909. \DeclareUnicodeCharacter{0157}{\cedilla{r}}
  8910. \DeclareUnicodeCharacter{0158}{\v{R}}
  8911. \DeclareUnicodeCharacter{0159}{\v{r}}
  8912. \DeclareUnicodeCharacter{015A}{\'S}
  8913. \DeclareUnicodeCharacter{015B}{\'s}
  8914. \DeclareUnicodeCharacter{015C}{\^S}
  8915. \DeclareUnicodeCharacter{015D}{\^s}
  8916. \DeclareUnicodeCharacter{015E}{\cedilla{S}}
  8917. \DeclareUnicodeCharacter{015F}{\cedilla{s}}
  8918. \DeclareUnicodeCharacter{0160}{\v{S}}
  8919. \DeclareUnicodeCharacter{0161}{\v{s}}
  8920. \DeclareUnicodeCharacter{0162}{\cedilla{T}}
  8921. \DeclareUnicodeCharacter{0163}{\cedilla{t}}
  8922. \DeclareUnicodeCharacter{0164}{\v{T}}
  8923. \DeclareUnicodeCharacter{0165}{\v{t}}
  8924. \DeclareUnicodeCharacter{0166}{\missingcharmsg{H WITH STROKE}}
  8925. \DeclareUnicodeCharacter{0167}{\missingcharmsg{h WITH STROKE}}
  8926. \DeclareUnicodeCharacter{0168}{\~U}
  8927. \DeclareUnicodeCharacter{0169}{\~u}
  8928. \DeclareUnicodeCharacter{016A}{\=U}
  8929. \DeclareUnicodeCharacter{016B}{\=u}
  8930. \DeclareUnicodeCharacter{016C}{\u{U}}
  8931. \DeclareUnicodeCharacter{016D}{\u{u}}
  8932. \DeclareUnicodeCharacter{016E}{\ringaccent{U}}
  8933. \DeclareUnicodeCharacter{016F}{\ringaccent{u}}
  8934. \DeclareUnicodeCharacter{0170}{\H{U}}
  8935. \DeclareUnicodeCharacter{0171}{\H{u}}
  8936. \DeclareUnicodeCharacter{0172}{\ogonek{U}}
  8937. \DeclareUnicodeCharacter{0173}{\ogonek{u}}
  8938. \DeclareUnicodeCharacter{0174}{\^W}
  8939. \DeclareUnicodeCharacter{0175}{\^w}
  8940. \DeclareUnicodeCharacter{0176}{\^Y}
  8941. \DeclareUnicodeCharacter{0177}{\^y}
  8942. \DeclareUnicodeCharacter{0178}{\"Y}
  8943. \DeclareUnicodeCharacter{0179}{\'Z}
  8944. \DeclareUnicodeCharacter{017A}{\'z}
  8945. \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}
  8946. \DeclareUnicodeCharacter{017C}{\dotaccent{z}}
  8947. \DeclareUnicodeCharacter{017D}{\v{Z}}
  8948. \DeclareUnicodeCharacter{017E}{\v{z}}
  8949. \DeclareUnicodeCharacter{017F}{\missingcharmsg{LONG S}}
  8950. \DeclareUnicodeCharacter{01C4}{D\v{Z}}
  8951. \DeclareUnicodeCharacter{01C5}{D\v{z}}
  8952. \DeclareUnicodeCharacter{01C6}{d\v{z}}
  8953. \DeclareUnicodeCharacter{01C7}{LJ}
  8954. \DeclareUnicodeCharacter{01C8}{Lj}
  8955. \DeclareUnicodeCharacter{01C9}{lj}
  8956. \DeclareUnicodeCharacter{01CA}{NJ}
  8957. \DeclareUnicodeCharacter{01CB}{Nj}
  8958. \DeclareUnicodeCharacter{01CC}{nj}
  8959. \DeclareUnicodeCharacter{01CD}{\v{A}}
  8960. \DeclareUnicodeCharacter{01CE}{\v{a}}
  8961. \DeclareUnicodeCharacter{01CF}{\v{I}}
  8962. \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}
  8963. \DeclareUnicodeCharacter{01D1}{\v{O}}
  8964. \DeclareUnicodeCharacter{01D2}{\v{o}}
  8965. \DeclareUnicodeCharacter{01D3}{\v{U}}
  8966. \DeclareUnicodeCharacter{01D4}{\v{u}}
  8967. \DeclareUnicodeCharacter{01E2}{\={\AE}}
  8968. \DeclareUnicodeCharacter{01E3}{\={\ae}}
  8969. \DeclareUnicodeCharacter{01E6}{\v{G}}
  8970. \DeclareUnicodeCharacter{01E7}{\v{g}}
  8971. \DeclareUnicodeCharacter{01E8}{\v{K}}
  8972. \DeclareUnicodeCharacter{01E9}{\v{k}}
  8973. \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}
  8974. \DeclareUnicodeCharacter{01F1}{DZ}
  8975. \DeclareUnicodeCharacter{01F2}{Dz}
  8976. \DeclareUnicodeCharacter{01F3}{dz}
  8977. \DeclareUnicodeCharacter{01F4}{\'G}
  8978. \DeclareUnicodeCharacter{01F5}{\'g}
  8979. \DeclareUnicodeCharacter{01F8}{\`N}
  8980. \DeclareUnicodeCharacter{01F9}{\`n}
  8981. \DeclareUnicodeCharacter{01FC}{\'{\AE}}
  8982. \DeclareUnicodeCharacter{01FD}{\'{\ae}}
  8983. \DeclareUnicodeCharacter{01FE}{\'{\O}}
  8984. \DeclareUnicodeCharacter{01FF}{\'{\o}}
  8985. \DeclareUnicodeCharacter{021E}{\v{H}}
  8986. \DeclareUnicodeCharacter{021F}{\v{h}}
  8987. \DeclareUnicodeCharacter{0226}{\dotaccent{A}}
  8988. \DeclareUnicodeCharacter{0227}{\dotaccent{a}}
  8989. \DeclareUnicodeCharacter{0228}{\cedilla{E}}
  8990. \DeclareUnicodeCharacter{0229}{\cedilla{e}}
  8991. \DeclareUnicodeCharacter{022E}{\dotaccent{O}}
  8992. \DeclareUnicodeCharacter{022F}{\dotaccent{o}}
  8993. \DeclareUnicodeCharacter{0232}{\=Y}
  8994. \DeclareUnicodeCharacter{0233}{\=y}
  8995. \DeclareUnicodeCharacter{0237}{\dotless{j}}
  8996. \DeclareUnicodeCharacter{02DB}{\ogonek{ }}
  8997. \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}
  8998. \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}
  8999. \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}
  9000. \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}
  9001. \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}
  9002. \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}
  9003. \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}
  9004. \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}
  9005. \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}
  9006. \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}
  9007. \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}
  9008. \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}
  9009. \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}
  9010. \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}
  9011. \DeclareUnicodeCharacter{1E20}{\=G}
  9012. \DeclareUnicodeCharacter{1E21}{\=g}
  9013. \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}
  9014. \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}
  9015. \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}
  9016. \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}
  9017. \DeclareUnicodeCharacter{1E26}{\"H}
  9018. \DeclareUnicodeCharacter{1E27}{\"h}
  9019. \DeclareUnicodeCharacter{1E30}{\'K}
  9020. \DeclareUnicodeCharacter{1E31}{\'k}
  9021. \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}
  9022. \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}
  9023. \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}
  9024. \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}
  9025. \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}
  9026. \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}
  9027. \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}
  9028. \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}
  9029. \DeclareUnicodeCharacter{1E3E}{\'M}
  9030. \DeclareUnicodeCharacter{1E3F}{\'m}
  9031. \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}
  9032. \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}
  9033. \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}
  9034. \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}
  9035. \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}
  9036. \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}
  9037. \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}
  9038. \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}
  9039. \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}
  9040. \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}
  9041. \DeclareUnicodeCharacter{1E54}{\'P}
  9042. \DeclareUnicodeCharacter{1E55}{\'p}
  9043. \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}
  9044. \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}
  9045. \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}
  9046. \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}
  9047. \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}
  9048. \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}
  9049. \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}
  9050. \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}
  9051. \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}
  9052. \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}
  9053. \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}
  9054. \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}
  9055. \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}
  9056. \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}
  9057. \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}
  9058. \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}
  9059. \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}
  9060. \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}
  9061. \DeclareUnicodeCharacter{1E7C}{\~V}
  9062. \DeclareUnicodeCharacter{1E7D}{\~v}
  9063. \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}
  9064. \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}
  9065. \DeclareUnicodeCharacter{1E80}{\`W}
  9066. \DeclareUnicodeCharacter{1E81}{\`w}
  9067. \DeclareUnicodeCharacter{1E82}{\'W}
  9068. \DeclareUnicodeCharacter{1E83}{\'w}
  9069. \DeclareUnicodeCharacter{1E84}{\"W}
  9070. \DeclareUnicodeCharacter{1E85}{\"w}
  9071. \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}
  9072. \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}
  9073. \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}
  9074. \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}
  9075. \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}
  9076. \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}
  9077. \DeclareUnicodeCharacter{1E8C}{\"X}
  9078. \DeclareUnicodeCharacter{1E8D}{\"x}
  9079. \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}
  9080. \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}
  9081. \DeclareUnicodeCharacter{1E90}{\^Z}
  9082. \DeclareUnicodeCharacter{1E91}{\^z}
  9083. \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}
  9084. \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}
  9085. \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}
  9086. \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}
  9087. \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}
  9088. \DeclareUnicodeCharacter{1E97}{\"t}
  9089. \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}
  9090. \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}
  9091. \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}
  9092. \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}
  9093. \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}
  9094. \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}
  9095. \DeclareUnicodeCharacter{1EBC}{\~E}
  9096. \DeclareUnicodeCharacter{1EBD}{\~e}
  9097. \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}
  9098. \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}
  9099. \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}
  9100. \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}
  9101. \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}
  9102. \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}
  9103. \DeclareUnicodeCharacter{1EF2}{\`Y}
  9104. \DeclareUnicodeCharacter{1EF3}{\`y}
  9105. \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}
  9106. \DeclareUnicodeCharacter{1EF8}{\~Y}
  9107. \DeclareUnicodeCharacter{1EF9}{\~y}
  9108. \DeclareUnicodeCharacter{2013}{--}
  9109. \DeclareUnicodeCharacter{2014}{---}
  9110. \DeclareUnicodeCharacter{2018}{\quoteleft}
  9111. \DeclareUnicodeCharacter{2019}{\quoteright}
  9112. \DeclareUnicodeCharacter{201A}{\quotesinglbase}
  9113. \DeclareUnicodeCharacter{201C}{\quotedblleft}
  9114. \DeclareUnicodeCharacter{201D}{\quotedblright}
  9115. \DeclareUnicodeCharacter{201E}{\quotedblbase}
  9116. \DeclareUnicodeCharacter{2022}{\bullet}
  9117. \DeclareUnicodeCharacter{2026}{\dots}
  9118. \DeclareUnicodeCharacter{2039}{\guilsinglleft}
  9119. \DeclareUnicodeCharacter{203A}{\guilsinglright}
  9120. \DeclareUnicodeCharacter{20AC}{\euro}
  9121. \DeclareUnicodeCharacter{2192}{\expansion}
  9122. \DeclareUnicodeCharacter{21D2}{\result}
  9123. \DeclareUnicodeCharacter{2212}{\minus}
  9124. \DeclareUnicodeCharacter{2217}{\point}
  9125. \DeclareUnicodeCharacter{2261}{\equiv}
  9126. }% end of \utfeightchardefs
  9127. % US-ASCII character definitions.
  9128. \def\asciichardefs{% nothing need be done
  9129. \relax
  9130. }
  9131. % Latin1 (ISO-8859-1) character definitions.
  9132. \def\nonasciistringdefs{%
  9133. \setnonasciicharscatcode\active
  9134. \def\defstringchar##1{\def##1{\string##1}}%
  9135. \defstringchar^^a0\defstringchar^^a1\defstringchar^^a2\defstringchar^^a3%
  9136. \defstringchar^^a4\defstringchar^^a5\defstringchar^^a6\defstringchar^^a7%
  9137. \defstringchar^^a8\defstringchar^^a9\defstringchar^^aa\defstringchar^^ab%
  9138. \defstringchar^^ac\defstringchar^^ad\defstringchar^^ae\defstringchar^^af%
  9139. %
  9140. \defstringchar^^b0\defstringchar^^b1\defstringchar^^b2\defstringchar^^b3%
  9141. \defstringchar^^b4\defstringchar^^b5\defstringchar^^b6\defstringchar^^b7%
  9142. \defstringchar^^b8\defstringchar^^b9\defstringchar^^ba\defstringchar^^bb%
  9143. \defstringchar^^bc\defstringchar^^bd\defstringchar^^be\defstringchar^^bf%
  9144. %
  9145. \defstringchar^^c0\defstringchar^^c1\defstringchar^^c2\defstringchar^^c3%
  9146. \defstringchar^^c4\defstringchar^^c5\defstringchar^^c6\defstringchar^^c7%
  9147. \defstringchar^^c8\defstringchar^^c9\defstringchar^^ca\defstringchar^^cb%
  9148. \defstringchar^^cc\defstringchar^^cd\defstringchar^^ce\defstringchar^^cf%
  9149. %
  9150. \defstringchar^^d0\defstringchar^^d1\defstringchar^^d2\defstringchar^^d3%
  9151. \defstringchar^^d4\defstringchar^^d5\defstringchar^^d6\defstringchar^^d7%
  9152. \defstringchar^^d8\defstringchar^^d9\defstringchar^^da\defstringchar^^db%
  9153. \defstringchar^^dc\defstringchar^^dd\defstringchar^^de\defstringchar^^df%
  9154. %
  9155. \defstringchar^^e0\defstringchar^^e1\defstringchar^^e2\defstringchar^^e3%
  9156. \defstringchar^^e4\defstringchar^^e5\defstringchar^^e6\defstringchar^^e7%
  9157. \defstringchar^^e8\defstringchar^^e9\defstringchar^^ea\defstringchar^^eb%
  9158. \defstringchar^^ec\defstringchar^^ed\defstringchar^^ee\defstringchar^^ef%
  9159. %
  9160. \defstringchar^^f0\defstringchar^^f1\defstringchar^^f2\defstringchar^^f3%
  9161. \defstringchar^^f4\defstringchar^^f5\defstringchar^^f6\defstringchar^^f7%
  9162. \defstringchar^^f8\defstringchar^^f9\defstringchar^^fa\defstringchar^^fb%
  9163. \defstringchar^^fc\defstringchar^^fd\defstringchar^^fe\defstringchar^^ff%
  9164. }
  9165. % define all the unicode characters we know about, for the sake of @U.
  9166. \utfeightchardefs
  9167. % Make non-ASCII characters printable again for compatibility with
  9168. % existing Texinfo documents that may use them, even without declaring a
  9169. % document encoding.
  9170. %
  9171. \setnonasciicharscatcode \other
  9172. \message{formatting,}
  9173. \newdimen\defaultparindent \defaultparindent = 15pt
  9174. \chapheadingskip = 15pt plus 4pt minus 2pt
  9175. \secheadingskip = 12pt plus 3pt minus 2pt
  9176. \subsecheadingskip = 9pt plus 2pt minus 2pt
  9177. % Prevent underfull vbox error messages.
  9178. \vbadness = 10000
  9179. % Don't be very finicky about underfull hboxes, either.
  9180. \hbadness = 6666
  9181. % Following George Bush, get rid of widows and orphans.
  9182. \widowpenalty=10000
  9183. \clubpenalty=10000
  9184. % Use TeX 3.0's \emergencystretch to help line breaking, but if we're
  9185. % using an old version of TeX, don't do anything. We want the amount of
  9186. % stretch added to depend on the line length, hence the dependence on
  9187. % \hsize. We call this whenever the paper size is set.
  9188. %
  9189. \def\setemergencystretch{%
  9190. \ifx\emergencystretch\thisisundefined
  9191. % Allow us to assign to \emergencystretch anyway.
  9192. \def\emergencystretch{\dimen0}%
  9193. \else
  9194. \emergencystretch = .15\hsize
  9195. \fi
  9196. }
  9197. % Parameters in order: 1) textheight; 2) textwidth;
  9198. % 3) voffset; 4) hoffset; 5) binding offset; 6) topskip;
  9199. % 7) physical page height; 8) physical page width.
  9200. %
  9201. % We also call \setleading{\textleading}, so the caller should define
  9202. % \textleading. The caller should also set \parskip.
  9203. %
  9204. \def\internalpagesizes#1#2#3#4#5#6#7#8{%
  9205. \voffset = #3\relax
  9206. \topskip = #6\relax
  9207. \splittopskip = \topskip
  9208. %
  9209. \vsize = #1\relax
  9210. \advance\vsize by \topskip
  9211. \outervsize = \vsize
  9212. \advance\outervsize by 2\topandbottommargin
  9213. \pageheight = \vsize
  9214. %
  9215. \hsize = #2\relax
  9216. \outerhsize = \hsize
  9217. \advance\outerhsize by 0.5in
  9218. \pagewidth = \hsize
  9219. %
  9220. \normaloffset = #4\relax
  9221. \bindingoffset = #5\relax
  9222. %
  9223. \ifpdf
  9224. \pdfpageheight #7\relax
  9225. \pdfpagewidth #8\relax
  9226. % if we don't reset these, they will remain at "1 true in" of
  9227. % whatever layout pdftex was dumped with.
  9228. \pdfhorigin = 1 true in
  9229. \pdfvorigin = 1 true in
  9230. \fi
  9231. %
  9232. \setleading{\textleading}
  9233. %
  9234. \parindent = \defaultparindent
  9235. \setemergencystretch
  9236. }
  9237. % @letterpaper (the default).
  9238. \def\letterpaper{{\globaldefs = 1
  9239. \parskip = 3pt plus 2pt minus 1pt
  9240. \textleading = 13.2pt
  9241. %
  9242. % If page is nothing but text, make it come out even.
  9243. \internalpagesizes{607.2pt}{6in}% that's 46 lines
  9244. {\voffset}{.25in}%
  9245. {\bindingoffset}{36pt}%
  9246. {11in}{8.5in}%
  9247. }}
  9248. % Use @smallbook to reset parameters for 7x9.25 trim size.
  9249. \def\smallbook{{\globaldefs = 1
  9250. \parskip = 2pt plus 1pt
  9251. \textleading = 12pt
  9252. %
  9253. \internalpagesizes{7.5in}{5in}%
  9254. {-.2in}{0in}%
  9255. {\bindingoffset}{16pt}%
  9256. {9.25in}{7in}%
  9257. %
  9258. \lispnarrowing = 0.3in
  9259. \tolerance = 700
  9260. \hfuzz = 1pt
  9261. \contentsrightmargin = 0pt
  9262. \defbodyindent = .5cm
  9263. }}
  9264. % Use @smallerbook to reset parameters for 6x9 trim size.
  9265. % (Just testing, parameters still in flux.)
  9266. \def\smallerbook{{\globaldefs = 1
  9267. \parskip = 1.5pt plus 1pt
  9268. \textleading = 12pt
  9269. %
  9270. \internalpagesizes{7.4in}{4.8in}%
  9271. {-.2in}{-.4in}%
  9272. {0pt}{14pt}%
  9273. {9in}{6in}%
  9274. %
  9275. \lispnarrowing = 0.25in
  9276. \tolerance = 700
  9277. \hfuzz = 1pt
  9278. \contentsrightmargin = 0pt
  9279. \defbodyindent = .4cm
  9280. }}
  9281. % Use @afourpaper to print on European A4 paper.
  9282. \def\afourpaper{{\globaldefs = 1
  9283. \parskip = 3pt plus 2pt minus 1pt
  9284. \textleading = 13.2pt
  9285. %
  9286. % Double-side printing via postscript on Laserjet 4050
  9287. % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
  9288. % To change the settings for a different printer or situation, adjust
  9289. % \normaloffset until the front-side and back-side texts align. Then
  9290. % do the same for \bindingoffset. You can set these for testing in
  9291. % your texinfo source file like this:
  9292. % @tex
  9293. % \global\normaloffset = -6mm
  9294. % \global\bindingoffset = 10mm
  9295. % @end tex
  9296. \internalpagesizes{673.2pt}{160mm}% that's 51 lines
  9297. {\voffset}{\hoffset}%
  9298. {\bindingoffset}{44pt}%
  9299. {297mm}{210mm}%
  9300. %
  9301. \tolerance = 700
  9302. \hfuzz = 1pt
  9303. \contentsrightmargin = 0pt
  9304. \defbodyindent = 5mm
  9305. }}
  9306. % Use @afivepaper to print on European A5 paper.
  9307. % From romildo@urano.iceb.ufop.br, 2 July 2000.
  9308. % He also recommends making @example and @lisp be small.
  9309. \def\afivepaper{{\globaldefs = 1
  9310. \parskip = 2pt plus 1pt minus 0.1pt
  9311. \textleading = 12.5pt
  9312. %
  9313. \internalpagesizes{160mm}{120mm}%
  9314. {\voffset}{\hoffset}%
  9315. {\bindingoffset}{8pt}%
  9316. {210mm}{148mm}%
  9317. %
  9318. \lispnarrowing = 0.2in
  9319. \tolerance = 800
  9320. \hfuzz = 1.2pt
  9321. \contentsrightmargin = 0pt
  9322. \defbodyindent = 2mm
  9323. \tableindent = 12mm
  9324. }}
  9325. % A specific text layout, 24x15cm overall, intended for A4 paper.
  9326. \def\afourlatex{{\globaldefs = 1
  9327. \afourpaper
  9328. \internalpagesizes{237mm}{150mm}%
  9329. {\voffset}{4.6mm}%
  9330. {\bindingoffset}{7mm}%
  9331. {297mm}{210mm}%
  9332. %
  9333. % Must explicitly reset to 0 because we call \afourpaper.
  9334. \globaldefs = 0
  9335. }}
  9336. % Use @afourwide to print on A4 paper in landscape format.
  9337. \def\afourwide{{\globaldefs = 1
  9338. \afourpaper
  9339. \internalpagesizes{241mm}{165mm}%
  9340. {\voffset}{-2.95mm}%
  9341. {\bindingoffset}{7mm}%
  9342. {297mm}{210mm}%
  9343. \globaldefs = 0
  9344. }}
  9345. % @pagesizes TEXTHEIGHT[,TEXTWIDTH]
  9346. % Perhaps we should allow setting the margins, \topskip, \parskip,
  9347. % and/or leading, also. Or perhaps we should compute them somehow.
  9348. %
  9349. \parseargdef\pagesizes{\pagesizesyyy #1,,\finish}
  9350. \def\pagesizesyyy#1,#2,#3\finish{{%
  9351. \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
  9352. \globaldefs = 1
  9353. %
  9354. \parskip = 3pt plus 2pt minus 1pt
  9355. \setleading{\textleading}%
  9356. %
  9357. \dimen0 = #1\relax
  9358. \advance\dimen0 by \voffset
  9359. %
  9360. \dimen2 = \hsize
  9361. \advance\dimen2 by \normaloffset
  9362. %
  9363. \internalpagesizes{#1}{\hsize}%
  9364. {\voffset}{\normaloffset}%
  9365. {\bindingoffset}{44pt}%
  9366. {\dimen0}{\dimen2}%
  9367. }}
  9368. % Set default to letter.
  9369. %
  9370. \letterpaper
  9371. \message{and turning on texinfo input format.}
  9372. \def^^L{\par} % remove \outer, so ^L can appear in an @comment
  9373. % DEL is a comment character, in case @c does not suffice.
  9374. \catcode`\^^? = 14
  9375. % Define macros to output various characters with catcode for normal text.
  9376. \catcode`\"=\other \def\normaldoublequote{"}
  9377. \catcode`\$=\other \def\normaldollar{$}%$ font-lock fix
  9378. \catcode`\+=\other \def\normalplus{+}
  9379. \catcode`\<=\other \def\normalless{<}
  9380. \catcode`\>=\other \def\normalgreater{>}
  9381. \catcode`\^=\other \def\normalcaret{^}
  9382. \catcode`\_=\other \def\normalunderscore{_}
  9383. \catcode`\|=\other \def\normalverticalbar{|}
  9384. \catcode`\~=\other \def\normaltilde{~}
  9385. % This macro is used to make a character print one way in \tt
  9386. % (where it can probably be output as-is), and another way in other fonts,
  9387. % where something hairier probably needs to be done.
  9388. %
  9389. % #1 is what to print if we are indeed using \tt; #2 is what to print
  9390. % otherwise. Since all the Computer Modern typewriter fonts have zero
  9391. % interword stretch (and shrink), and it is reasonable to expect all
  9392. % typewriter fonts to have this, we can check that font parameter.
  9393. %
  9394. \def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
  9395. % Same as above, but check for italic font. Actually this also catches
  9396. % non-italic slanted fonts since it is impossible to distinguish them from
  9397. % italic fonts. But since this is only used by $ and it uses \sl anyway
  9398. % this is not a problem.
  9399. \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
  9400. % Turn off all special characters except @
  9401. % (and those which the user can use as if they were ordinary).
  9402. % Most of these we simply print from the \tt font, but for some, we can
  9403. % use math or other variants that look better in normal text.
  9404. \catcode`\"=\active
  9405. \def\activedoublequote{{\tt\char34}}
  9406. \let"=\activedoublequote
  9407. \catcode`\~=\active \def\activetilde{{\tt\char126}} \let~ = \activetilde
  9408. \chardef\hat=`\^
  9409. \catcode`\^=\active \def\activehat{{\tt \hat}} \let^ = \activehat
  9410. \catcode`\_=\active
  9411. \def_{\ifusingtt\normalunderscore\_}
  9412. \let\realunder=_
  9413. % Subroutine for the previous macro.
  9414. \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
  9415. \catcode`\|=\active
  9416. \def|{{\tt\char124}}
  9417. \chardef \less=`\<
  9418. \catcode`\<=\active \def\activeless{{\tt \less}}\let< = \activeless
  9419. \chardef \gtr=`\>
  9420. \catcode`\>=\active \def\activegtr{{\tt \gtr}}\let> = \activegtr
  9421. \catcode`\+=\active \def+{{\tt \char 43}}
  9422. \catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
  9423. % used for headline/footline in the output routine, in case the page
  9424. % breaks in the middle of an @tex block.
  9425. \def\texinfochars{%
  9426. \let< = \activeless
  9427. \let> = \activegtr
  9428. \let~ = \activetilde
  9429. \let^ = \activehat
  9430. \markupsetuplqdefault \markupsetuprqdefault
  9431. \let\b = \strong
  9432. \let\i = \smartitalic
  9433. % in principle, all other definitions in \tex have to be undone too.
  9434. }
  9435. % If a .fmt file is being used, characters that might appear in a file
  9436. % name cannot be active until we have parsed the command line.
  9437. % So turn them off again, and have \everyjob (or @setfilename) turn them on.
  9438. % \otherifyactive is called near the end of this file.
  9439. \def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
  9440. % Used sometimes to turn off (effectively) the active characters even after
  9441. % parsing them.
  9442. \def\turnoffactive{%
  9443. \normalturnoffactive
  9444. \otherbackslash
  9445. }
  9446. \catcode`\@=0
  9447. % \backslashcurfont outputs one backslash character in current font,
  9448. % as in \char`\\.
  9449. \global\chardef\backslashcurfont=`\\
  9450. \global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work
  9451. % \realbackslash is an actual character `\' with catcode other, and
  9452. % \doublebackslash is two of them (for the pdf outlines).
  9453. {\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}}
  9454. % In texinfo, backslash is an active character; it prints the backslash
  9455. % in fixed width font.
  9456. \catcode`\\=\active % @ for escape char from now on.
  9457. % The story here is that in math mode, the \char of \backslashcurfont
  9458. % ends up printing the roman \ from the math symbol font (because \char
  9459. % in math mode uses the \mathcode, and plain.tex sets
  9460. % \mathcode`\\="026E). It seems better for @backslashchar{} to always
  9461. % print a typewriter backslash, hence we use an explicit \mathchar,
  9462. % which is the decimal equivalent of "715c (class 7, e.g., use \fam;
  9463. % ignored family value; char position "5C). We can't use " for the
  9464. % usual hex value because it has already been made active.
  9465. @def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}}
  9466. @let@backslashchar = @normalbackslash % @backslashchar{} is for user documents.
  9467. % On startup, @fixbackslash assigns:
  9468. % @let \ = @normalbackslash
  9469. % \rawbackslash defines an active \ to do \backslashcurfont.
  9470. % \otherbackslash defines an active \ to be a literal `\' character with
  9471. % catcode other. We switch back and forth between these.
  9472. @gdef@rawbackslash{@let\=@backslashcurfont}
  9473. @gdef@otherbackslash{@let\=@realbackslash}
  9474. % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
  9475. % the literal character `\'. Also revert - to its normal character, in
  9476. % case the active - from code has slipped in.
  9477. %
  9478. {@catcode`- = @active
  9479. @gdef@normalturnoffactive{%
  9480. @nonasciistringdefs
  9481. @let-=@normaldash
  9482. @let"=@normaldoublequote
  9483. @let$=@normaldollar %$ font-lock fix
  9484. @let+=@normalplus
  9485. @let<=@normalless
  9486. @let>=@normalgreater
  9487. @let\=@normalbackslash
  9488. @let^=@normalcaret
  9489. @let_=@normalunderscore
  9490. @let|=@normalverticalbar
  9491. @let~=@normaltilde
  9492. @markupsetuplqdefault
  9493. @markupsetuprqdefault
  9494. @unsepspaces
  9495. }
  9496. }
  9497. % Make _ and + \other characters, temporarily.
  9498. % This is canceled by @fixbackslash.
  9499. @otherifyactive
  9500. % If a .fmt file is being used, we don't want the `\input texinfo' to show up.
  9501. % That is what \eatinput is for; after that, the `\' should revert to printing
  9502. % a backslash.
  9503. %
  9504. @gdef@eatinput input texinfo{@fixbackslash}
  9505. @global@let\ = @eatinput
  9506. % On the other hand, perhaps the file did not have a `\input texinfo'. Then
  9507. % the first `\' in the file would cause an error. This macro tries to fix
  9508. % that, assuming it is called before the first `\' could plausibly occur.
  9509. % Also turn back on active characters that might appear in the input
  9510. % file name, in case not using a pre-dumped format.
  9511. %
  9512. @gdef@fixbackslash{%
  9513. @ifx\@eatinput @let\ = @normalbackslash @fi
  9514. @catcode`+=@active
  9515. @catcode`@_=@active
  9516. }
  9517. % Say @foo, not \foo, in error messages.
  9518. @escapechar = `@@
  9519. % These (along with & and #) are made active for url-breaking, so need
  9520. % active definitions as the normal characters.
  9521. @def@normaldot{.}
  9522. @def@normalquest{?}
  9523. @def@normalslash{/}
  9524. % These look ok in all fonts, so just make them not special.
  9525. % @hashchar{} gets its own user-level command, because of #line.
  9526. @catcode`@& = @other @def@normalamp{&}
  9527. @catcode`@# = @other @def@normalhash{#}
  9528. @catcode`@% = @other @def@normalpercent{%}
  9529. @let @hashchar = @normalhash
  9530. @c Finally, make ` and ' active, so that txicodequoteundirected and
  9531. @c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we
  9532. @c don't make ` and ' active, @code will not get them as active chars.
  9533. @c Do this last of all since we use ` in the previous @catcode assignments.
  9534. @catcode`@'=@active
  9535. @catcode`@`=@active
  9536. @markupsetuplqdefault
  9537. @markupsetuprqdefault
  9538. @c Local variables:
  9539. @c eval: (add-hook 'write-file-hooks 'time-stamp)
  9540. @c page-delimiter: "^\\\\message\\|emacs-page"
  9541. @c time-stamp-start: "def\\\\texinfoversion{"
  9542. @c time-stamp-format: "%:y-%02m-%02d.%02H"
  9543. @c time-stamp-end: "}"
  9544. @c End:
  9545. @c vim:sw=2:
  9546. @ignore
  9547. arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115
  9548. @end ignore