texinfo.tex 352 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016
  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-10-29.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. % Sometimes it is convenient to have everything in the transcript file
  185. % and nothing on the terminal. We don't just call \tracingall here,
  186. % since that produces some useless output on the terminal. We also make
  187. % some effort to order the tracing commands to reduce output in the log
  188. % file; cf. trace.sty in LaTeX.
  189. %
  190. \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
  191. \def\loggingall{%
  192. \tracingstats2
  193. \tracingpages1
  194. \tracinglostchars2 % 2 gives us more in etex
  195. \tracingparagraphs1
  196. \tracingoutput1
  197. \tracingmacros2
  198. \tracingrestores1
  199. \showboxbreadth\maxdimen \showboxdepth\maxdimen
  200. \ifx\eTeXversion\thisisundefined\else % etex gives us more logging
  201. \tracingscantokens1
  202. \tracingifs1
  203. \tracinggroups1
  204. \tracingnesting2
  205. \tracingassigns1
  206. \fi
  207. \tracingcommands3 % 3 gives us more in etex
  208. \errorcontextlines16
  209. }%
  210. % @errormsg{MSG}. Do the index-like expansions on MSG, but if things
  211. % aren't perfect, it's not the end of the world, being an error message,
  212. % after all.
  213. %
  214. \def\errormsg{\begingroup \indexnofonts \doerrormsg}
  215. \def\doerrormsg#1{\errmessage{#1}}
  216. % add check for \lastpenalty to plain's definitions. If the last thing
  217. % we did was a \nobreak, we don't want to insert more space.
  218. %
  219. \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
  220. \removelastskip\penalty-50\smallskip\fi\fi}
  221. \def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
  222. \removelastskip\penalty-100\medskip\fi\fi}
  223. \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
  224. \removelastskip\penalty-200\bigskip\fi\fi}
  225. % Output routine
  226. %
  227. % For a final copy, take out the rectangles
  228. % that mark overfull boxes (in case you have decided
  229. % that the text looks ok even though it passes the margin).
  230. %
  231. \def\finalout{\overfullrule=0pt }
  232. % Do @cropmarks to get crop marks.
  233. %
  234. \newif\ifcropmarks
  235. \let\cropmarks = \cropmarkstrue
  236. %
  237. % Dimensions to add cropmarks at corners.
  238. % Added by P. A. MacKay, 12 Nov. 1986
  239. %
  240. \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
  241. \newdimen\cornerlong \cornerlong=1pc
  242. \newdimen\cornerthick \cornerthick=.3pt
  243. \newdimen\topandbottommargin \topandbottommargin=.75in
  244. % Output a mark which sets \thischapter, \thissection and \thiscolor.
  245. % We dump everything together because we only have one kind of mark.
  246. % This works because we only use \botmark / \topmark, not \firstmark.
  247. %
  248. % A mark contains a subexpression of the \ifcase ... \fi construct.
  249. % \get*marks macros below extract the needed part using \ifcase.
  250. %
  251. % Another complication is to let the user choose whether \thischapter
  252. % (\thissection) refers to the chapter (section) in effect at the top
  253. % of a page, or that at the bottom of a page. The solution is
  254. % described on page 260 of The TeXbook. It involves outputting two
  255. % marks for the sectioning macros, one before the section break, and
  256. % one after. I won't pretend I can describe this better than DEK...
  257. %
  258. \def\domark{%
  259. \toks0=\expandafter{\lastchapterdefs}%
  260. \toks2=\expandafter{\lastsectiondefs}%
  261. \toks4=\expandafter{\prevchapterdefs}%
  262. \toks6=\expandafter{\prevsectiondefs}%
  263. \toks8=\expandafter{\lastcolordefs}%
  264. \mark{%
  265. \the\toks0 \the\toks2 % 0: top marks (\last...)
  266. \noexpand\or \the\toks4 \the\toks6 % 1: bottom marks (default, \prev...)
  267. \noexpand\else \the\toks8 % 2: color marks
  268. }%
  269. }
  270. % \gettopheadingmarks, \getbottomheadingmarks - extract needed part of mark.
  271. %
  272. % \topmark doesn't work for the very first chapter (after the title
  273. % page or the contents), so we use \firstmark there -- this gets us
  274. % the mark with the chapter defs, unless the user sneaks in, e.g.,
  275. % @setcolor (or @url, or @link, etc.) between @contents and the very
  276. % first @chapter.
  277. \def\gettopheadingmarks{%
  278. \ifcase0\topmark\fi
  279. \ifx\thischapter\empty \ifcase0\firstmark\fi \fi
  280. }
  281. \def\getbottomheadingmarks{\ifcase1\botmark\fi}
  282. \def\getcolormarks{\ifcase2\topmark\fi}
  283. % Avoid "undefined control sequence" errors.
  284. \def\lastchapterdefs{}
  285. \def\lastsectiondefs{}
  286. \def\lastsection{}
  287. \def\prevchapterdefs{}
  288. \def\prevsectiondefs{}
  289. \def\lastcolordefs{}
  290. % Margin to add to right of even pages, to left of odd pages.
  291. \newdimen\bindingoffset
  292. \newdimen\normaloffset
  293. \newdimen\pagewidth \newdimen\pageheight
  294. % Main output routine.
  295. %
  296. \chardef\PAGE = 255
  297. \output = {\onepageout{\pagecontents\PAGE}}
  298. \newbox\headlinebox
  299. \newbox\footlinebox
  300. % \onepageout takes a vbox as an argument.
  301. % \shipout a vbox for a single page, adding an optional header, footer,
  302. % cropmarks, and footnote. This also causes index entries for this page
  303. % to be written to the auxiliary files.
  304. %
  305. \def\onepageout#1{%
  306. \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
  307. %
  308. \ifodd\pageno \advance\hoffset by \bindingoffset
  309. \else \advance\hoffset by -\bindingoffset\fi
  310. %
  311. % Common context changes for both heading and footing.
  312. % Do this outside of the \shipout so @code etc. will be expanded in
  313. % the headline as they should be, not taken literally (outputting ''code).
  314. \def\commmonheadfootline{\let\hsize=\pagewidth \texinfochars}
  315. %
  316. % Retrieve the information for the headings from the marks in the page,
  317. % and call Plain TeX's \makeheadline and \makefootline, which use the
  318. % values in \headline and \footline.
  319. %
  320. % This is used to check if we are on the first page of a chapter.
  321. \ifcase0\topmark\fi
  322. \ifx\thischapter\empty
  323. % See comment for \gettopheadingmarks
  324. \ifcase0\firstmark\fi
  325. \let\curchaptername\thischaptername
  326. \ifcase1\firstmark\fi
  327. \let\prevchaptername\thischaptername
  328. \else
  329. \let\curchaptername\thischaptername
  330. \ifcase1\topmark\fi
  331. \let\prevchaptername\thischaptername
  332. \fi
  333. %
  334. \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
  335. \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
  336. %
  337. \ifx\curchaptername\prevchaptername
  338. \else
  339. % If on the first page of a chapter, clear @thischapter so it
  340. % doesn't appear in the headline, because the chapter is already
  341. % shown in the chapter heading.
  342. \def\thischapter{}%
  343. \fi
  344. %
  345. \global\setbox\headlinebox = \vbox{\commmonheadfootline \makeheadline}%
  346. \global\setbox\footlinebox = \vbox{\commmonheadfootline \makefootline}%
  347. %
  348. {%
  349. % Set context for writing to auxiliary files like index files.
  350. % Have to do this stuff outside the \shipout because we want it to
  351. % take effect in \write's, yet the group defined by the \vbox ends
  352. % before the \shipout runs.
  353. %
  354. \indexdummies % don't expand commands in the output.
  355. \normalturnoffactive % \ in index entries must not stay \, e.g., if
  356. % the page break happens to be in the middle of an example.
  357. % We don't want .vr (or whatever) entries like this:
  358. % \entry{{\indexbackslash }acronym}{32}{\code {\acronym}}
  359. % "\acronym" won't work when it's read back in;
  360. % it needs to be
  361. % {\code {{\backslashcurfont }acronym}
  362. \shipout\vbox{%
  363. % Do this early so pdf references go to the beginning of the page.
  364. \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
  365. %
  366. \ifcropmarks \vbox to \outervsize\bgroup
  367. \hsize = \outerhsize
  368. \vskip-\topandbottommargin
  369. \vtop to0pt{%
  370. \line{\ewtop\hfil\ewtop}%
  371. \nointerlineskip
  372. \line{%
  373. \vbox{\moveleft\cornerthick\nstop}%
  374. \hfill
  375. \vbox{\moveright\cornerthick\nstop}%
  376. }%
  377. \vss}%
  378. \vskip\topandbottommargin
  379. \line\bgroup
  380. \hfil % center the page within the outer (page) hsize.
  381. \ifodd\pageno\hskip\bindingoffset\fi
  382. \vbox\bgroup
  383. \fi
  384. %
  385. \unvbox\headlinebox
  386. \pagebody{#1}%
  387. \ifdim\ht\footlinebox > 0pt
  388. % Only leave this space if the footline is nonempty.
  389. % (We lessened \vsize for it in \oddfootingyyy.)
  390. % The \baselineskip=24pt in plain's \makefootline has no effect.
  391. \vskip 24pt
  392. \unvbox\footlinebox
  393. \fi
  394. %
  395. \ifcropmarks
  396. \egroup % end of \vbox\bgroup
  397. \hfil\egroup % end of (centering) \line\bgroup
  398. \vskip\topandbottommargin plus1fill minus1fill
  399. \boxmaxdepth = \cornerthick
  400. \vbox to0pt{\vss
  401. \line{%
  402. \vbox{\moveleft\cornerthick\nsbot}%
  403. \hfill
  404. \vbox{\moveright\cornerthick\nsbot}%
  405. }%
  406. \nointerlineskip
  407. \line{\ewbot\hfil\ewbot}%
  408. }%
  409. \egroup % \vbox from first cropmarks clause
  410. \fi
  411. }% end of \shipout\vbox
  412. }% end of group with \indexdummies
  413. \advancepageno
  414. \ifnum\outputpenalty>-20000 \else\dosupereject\fi
  415. }
  416. \newinsert\margin \dimen\margin=\maxdimen
  417. % Main part of page, including any footnotes
  418. \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
  419. {\catcode`\@ =11
  420. \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
  421. % marginal hacks, juha@viisa.uucp (Juha Takala)
  422. \ifvoid\margin\else % marginal info is present
  423. \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
  424. \dimen@=\dp#1\relax \unvbox#1\relax
  425. \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
  426. \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
  427. }
  428. % Here are the rules for the cropmarks. Note that they are
  429. % offset so that the space between them is truly \outerhsize or \outervsize
  430. % (P. A. MacKay, 12 November, 1986)
  431. %
  432. \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
  433. \def\nstop{\vbox
  434. {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
  435. \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
  436. \def\nsbot{\vbox
  437. {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
  438. % Argument parsing
  439. % Parse an argument, then pass it to #1. The argument is the rest of
  440. % the input line (except we remove a trailing comment). #1 should be a
  441. % macro which expects an ordinary undelimited TeX argument.
  442. % For example, \def\foo{\parsearg\fooxxx}.
  443. %
  444. \def\parsearg{\parseargusing{}}
  445. \def\parseargusing#1#2{%
  446. \def\argtorun{#2}%
  447. \begingroup
  448. \obeylines
  449. \spaceisspace
  450. #1%
  451. \parseargline\empty% Insert the \empty token, see \finishparsearg below.
  452. }
  453. {\obeylines %
  454. \gdef\parseargline#1^^M{%
  455. \endgroup % End of the group started in \parsearg.
  456. \argremovecomment #1\comment\ArgTerm%
  457. }%
  458. }
  459. % First remove any @comment, then any @c comment. Also remove a @texinfoc
  460. % comment (see \scanmacro for details). Pass the result on to \argcheckspaces.
  461. \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
  462. \def\argremovec#1\c#2\ArgTerm{\argremovetexinfoc #1\texinfoc\ArgTerm}
  463. \def\argremovetexinfoc#1\texinfoc#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
  464. % Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space.
  465. %
  466. % \argremovec might leave us with trailing space, e.g.,
  467. % @end itemize @c foo
  468. % This space token undergoes the same procedure and is eventually removed
  469. % by \finishparsearg.
  470. %
  471. \def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M}
  472. \def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M}
  473. \def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
  474. \def\temp{#3}%
  475. \ifx\temp\empty
  476. % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp:
  477. \let\temp\finishparsearg
  478. \else
  479. \let\temp\argcheckspaces
  480. \fi
  481. % Put the space token in:
  482. \temp#1 #3\ArgTerm
  483. }
  484. % If a _delimited_ argument is enclosed in braces, they get stripped; so
  485. % to get _exactly_ the rest of the line, we had to prevent such situation.
  486. % We prepended an \empty token at the very beginning and we expand it now,
  487. % just before passing the control to \argtorun.
  488. % (Similarly, we have to think about #3 of \argcheckspacesY above: it is
  489. % either the null string, or it ends with \^^M---thus there is no danger
  490. % that a pair of braces would be stripped.
  491. %
  492. % But first, we have to remove the trailing space token.
  493. %
  494. \def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}}
  495. % \parseargdef - define a command taking an argument on the line
  496. %
  497. % \parseargdef\foo{...}
  498. % is roughly equivalent to
  499. % \def\foo{\parsearg\Xfoo}
  500. % \def\Xfoo#1{...}
  501. \def\parseargdef#1{%
  502. \expandafter \doparseargdef \csname\string#1\endcsname #1%
  503. }
  504. \def\doparseargdef#1#2{%
  505. \def#2{\parsearg#1}%
  506. \def#1##1%
  507. }
  508. % Several utility definitions with active space:
  509. {
  510. \obeyspaces
  511. \gdef\obeyedspace{ }
  512. % Make each space character in the input produce a normal interword
  513. % space in the output. Don't allow a line break at this space, as this
  514. % is used only in environments like @example, where each line of input
  515. % should produce a line of output anyway.
  516. %
  517. \gdef\sepspaces{\obeyspaces\let =\tie}
  518. % If an index command is used in an @example environment, any spaces
  519. % therein should become regular spaces in the raw index file, not the
  520. % expansion of \tie (\leavevmode \penalty \@M \ ).
  521. \gdef\unsepspaces{\let =\space}
  522. }
  523. \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
  524. % Define the framework for environments in texinfo.tex. It's used like this:
  525. %
  526. % \envdef\foo{...}
  527. % \def\Efoo{...}
  528. %
  529. % It's the responsibility of \envdef to insert \begingroup before the
  530. % actual body; @end closes the group after calling \Efoo. \envdef also
  531. % defines \thisenv, so the current environment is known; @end checks
  532. % whether the environment name matches. The \checkenv macro can also be
  533. % used to check whether the current environment is the one expected.
  534. %
  535. % Non-false conditionals (@iftex, @ifset) don't fit into this, so they
  536. % are not treated as environments; they don't open a group. (The
  537. % implementation of @end takes care not to call \endgroup in this
  538. % special case.)
  539. % At run-time, environments start with this:
  540. \def\startenvironment#1{\begingroup\def\thisenv{#1}}
  541. % initialize
  542. \let\thisenv\empty
  543. % ... but they get defined via ``\envdef\foo{...}'':
  544. \long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
  545. \def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
  546. % Check whether we're in the right environment:
  547. \def\checkenv#1{%
  548. \def\temp{#1}%
  549. \ifx\thisenv\temp
  550. \else
  551. \badenverr
  552. \fi
  553. }
  554. % Environment mismatch, #1 expected:
  555. \def\badenverr{%
  556. \errhelp = \EMsimple
  557. \errmessage{This command can appear only \inenvironment\temp,
  558. not \inenvironment\thisenv}%
  559. }
  560. \def\inenvironment#1{%
  561. \ifx#1\empty
  562. outside of any environment%
  563. \else
  564. in environment \expandafter\string#1%
  565. \fi
  566. }
  567. % @end foo executes the definition of \Efoo.
  568. % But first, it executes a specialized version of \checkenv
  569. %
  570. \parseargdef\end{%
  571. \if 1\csname iscond.#1\endcsname
  572. \else
  573. % The general wording of \badenverr may not be ideal.
  574. \expandafter\checkenv\csname#1\endcsname
  575. \csname E#1\endcsname
  576. \endgroup
  577. \fi
  578. }
  579. \newhelp\EMsimple{Press RETURN to continue.}
  580. % Be sure we're in horizontal mode when doing a tie, since we make space
  581. % equivalent to this in @example-like environments. Otherwise, a space
  582. % at the beginning of a line will start with \penalty -- and
  583. % since \penalty is valid in vertical mode, we'd end up putting the
  584. % penalty on the vertical list instead of in the new paragraph.
  585. {\catcode`@ = 11
  586. % Avoid using \@M directly, because that causes trouble
  587. % if the definition is written into an index file.
  588. \global\let\tiepenalty = \@M
  589. \gdef\tie{\leavevmode\penalty\tiepenalty\ }
  590. }
  591. % @: forces normal size whitespace following.
  592. \def\:{\spacefactor=1000 }
  593. % @* forces a line break.
  594. \def\*{\unskip\hfil\break\hbox{}\ignorespaces}
  595. % @/ allows a line break.
  596. \let\/=\allowbreak
  597. % @. is an end-of-sentence period.
  598. \def\.{.\spacefactor=\endofsentencespacefactor\space}
  599. % @! is an end-of-sentence bang.
  600. \def\!{!\spacefactor=\endofsentencespacefactor\space}
  601. % @? is an end-of-sentence query.
  602. \def\?{?\spacefactor=\endofsentencespacefactor\space}
  603. % @frenchspacing on|off says whether to put extra space after punctuation.
  604. %
  605. \def\onword{on}
  606. \def\offword{off}
  607. %
  608. \parseargdef\frenchspacing{%
  609. \def\temp{#1}%
  610. \ifx\temp\onword \plainfrenchspacing
  611. \else\ifx\temp\offword \plainnonfrenchspacing
  612. \else
  613. \errhelp = \EMsimple
  614. \errmessage{Unknown @frenchspacing option `\temp', must be on|off}%
  615. \fi\fi
  616. }
  617. % @w prevents a word break. Without the \leavevmode, @w at the
  618. % beginning of a paragraph, when TeX is still in vertical mode, would
  619. % produce a whole line of output instead of starting the paragraph.
  620. \def\w#1{\leavevmode\hbox{#1}}
  621. % @group ... @end group forces ... to be all on one page, by enclosing
  622. % it in a TeX vbox. We use \vtop instead of \vbox to construct the box
  623. % to keep its height that of a normal line. According to the rules for
  624. % \topskip (p.114 of the TeXbook), the glue inserted is
  625. % max (\topskip - \ht (first item), 0). If that height is large,
  626. % therefore, no glue is inserted, and the space between the headline and
  627. % the text is small, which looks bad.
  628. %
  629. % Another complication is that the group might be very large. This can
  630. % cause the glue on the previous page to be unduly stretched, because it
  631. % does not have much material. In this case, it's better to add an
  632. % explicit \vfill so that the extra space is at the bottom. The
  633. % threshold for doing this is if the group is more than \vfilllimit
  634. % percent of a page (\vfilllimit can be changed inside of @tex).
  635. %
  636. \newbox\groupbox
  637. \def\vfilllimit{0.7}
  638. %
  639. \envdef\group{%
  640. \ifnum\catcode`\^^M=\active \else
  641. \errhelp = \groupinvalidhelp
  642. \errmessage{@group invalid in context where filling is enabled}%
  643. \fi
  644. \startsavinginserts
  645. %
  646. \setbox\groupbox = \vtop\bgroup
  647. % Do @comment since we are called inside an environment such as
  648. % @example, where each end-of-line in the input causes an
  649. % end-of-line in the output. We don't want the end-of-line after
  650. % the `@group' to put extra space in the output. Since @group
  651. % should appear on a line by itself (according to the Texinfo
  652. % manual), we don't worry about eating any user text.
  653. \comment
  654. }
  655. %
  656. % The \vtop produces a box with normal height and large depth; thus, TeX puts
  657. % \baselineskip glue before it, and (when the next line of text is done)
  658. % \lineskip glue after it. Thus, space below is not quite equal to space
  659. % above. But it's pretty close.
  660. \def\Egroup{%
  661. % To get correct interline space between the last line of the group
  662. % and the first line afterwards, we have to propagate \prevdepth.
  663. \endgraf % Not \par, as it may have been set to \lisppar.
  664. \global\dimen1 = \prevdepth
  665. \egroup % End the \vtop.
  666. \addgroupbox
  667. \prevdepth = \dimen1
  668. \checkinserts
  669. }
  670. \def\addgroupbox{
  671. % \dimen0 is the vertical size of the group's box.
  672. \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox
  673. % \dimen2 is how much space is left on the page (more or less).
  674. \dimen2 = \pageheight \advance\dimen2 by -\pagetotal
  675. % if the group doesn't fit on the current page, and it's a big big
  676. % group, force a page break.
  677. \ifdim \dimen0 > \dimen2
  678. \ifdim \pagetotal < \vfilllimit\pageheight
  679. \page
  680. \fi
  681. \fi
  682. \box\groupbox
  683. }
  684. %
  685. % TeX puts in an \escapechar (i.e., `@') at the beginning of the help
  686. % message, so this ends up printing `@group can only ...'.
  687. %
  688. \newhelp\groupinvalidhelp{%
  689. group can only be used in environments such as @example,^^J%
  690. where each line of input produces a line of output.}
  691. % @need space-in-mils
  692. % forces a page break if there is not space-in-mils remaining.
  693. \newdimen\mil \mil=0.001in
  694. \parseargdef\need{%
  695. % Ensure vertical mode, so we don't make a big box in the middle of a
  696. % paragraph.
  697. \par
  698. %
  699. % If the @need value is less than one line space, it's useless.
  700. \dimen0 = #1\mil
  701. \dimen2 = \ht\strutbox
  702. \advance\dimen2 by \dp\strutbox
  703. \ifdim\dimen0 > \dimen2
  704. %
  705. % Do a \strut just to make the height of this box be normal, so the
  706. % normal leading is inserted relative to the preceding line.
  707. % And a page break here is fine.
  708. \vtop to #1\mil{\strut\vfil}%
  709. %
  710. % TeX does not even consider page breaks if a penalty added to the
  711. % main vertical list is 10000 or more. But in order to see if the
  712. % empty box we just added fits on the page, we must make it consider
  713. % page breaks. On the other hand, we don't want to actually break the
  714. % page after the empty box. So we use a penalty of 9999.
  715. %
  716. % There is an extremely small chance that TeX will actually break the
  717. % page at this \penalty, if there are no other feasible breakpoints in
  718. % sight. (If the user is using lots of big @group commands, which
  719. % almost-but-not-quite fill up a page, TeX will have a hard time doing
  720. % good page breaking, for example.) However, I could not construct an
  721. % example where a page broke at this \penalty; if it happens in a real
  722. % document, then we can reconsider our strategy.
  723. \penalty9999
  724. %
  725. % Back up by the size of the box, whether we did a page break or not.
  726. \kern -#1\mil
  727. %
  728. % Do not allow a page break right after this kern.
  729. \nobreak
  730. \fi
  731. }
  732. % @br forces paragraph break (and is undocumented).
  733. \let\br = \par
  734. % @page forces the start of a new page.
  735. %
  736. \def\page{\par\vfill\supereject}
  737. % @exdent text....
  738. % outputs text on separate line in roman font, starting at standard page margin
  739. % This records the amount of indent in the innermost environment.
  740. % That's how much \exdent should take out.
  741. \newskip\exdentamount
  742. % This defn is used inside fill environments such as @defun.
  743. \parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
  744. % This defn is used inside nofill environments such as @example.
  745. \parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount
  746. \leftline{\hskip\leftskip{\rm#1}}}}
  747. % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
  748. % paragraph. For more general purposes, use the \margin insertion
  749. % class. WHICH is `l' or `r'. Not documented, written for gawk manual.
  750. %
  751. \newskip\inmarginspacing \inmarginspacing=1cm
  752. \def\strutdepth{\dp\strutbox}
  753. %
  754. \def\doinmargin#1#2{\strut\vadjust{%
  755. \nobreak
  756. \kern-\strutdepth
  757. \vtop to \strutdepth{%
  758. \baselineskip=\strutdepth
  759. \vss
  760. % if you have multiple lines of stuff to put here, you'll need to
  761. % make the vbox yourself of the appropriate size.
  762. \ifx#1l%
  763. \llap{\ignorespaces #2\hskip\inmarginspacing}%
  764. \else
  765. \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
  766. \fi
  767. \null
  768. }%
  769. }}
  770. \def\inleftmargin{\doinmargin l}
  771. \def\inrightmargin{\doinmargin r}
  772. %
  773. % @inmargin{TEXT [, RIGHT-TEXT]}
  774. % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
  775. % else use TEXT for both).
  776. %
  777. \def\inmargin#1{\parseinmargin #1,,\finish}
  778. \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
  779. \setbox0 = \hbox{\ignorespaces #2}%
  780. \ifdim\wd0 > 0pt
  781. \def\lefttext{#1}% have both texts
  782. \def\righttext{#2}%
  783. \else
  784. \def\lefttext{#1}% have only one text
  785. \def\righttext{#1}%
  786. \fi
  787. %
  788. \ifodd\pageno
  789. \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
  790. \else
  791. \def\temp{\inleftmargin\lefttext}%
  792. \fi
  793. \temp
  794. }
  795. % @| inserts a changebar to the left of the current line. It should
  796. % surround any changed text. This approach does *not* work if the
  797. % change spans more than two lines of output. To handle that, we would
  798. % have adopt a much more difficult approach (putting marks into the main
  799. % vertical list for the beginning and end of each change). This command
  800. % is not documented, not supported, and doesn't work.
  801. %
  802. \def\|{%
  803. % \vadjust can only be used in horizontal mode.
  804. \leavevmode
  805. %
  806. % Append this vertical mode material after the current line in the output.
  807. \vadjust{%
  808. % We want to insert a rule with the height and depth of the current
  809. % leading; that is exactly what \strutbox is supposed to record.
  810. \vskip-\baselineskip
  811. %
  812. % \vadjust-items are inserted at the left edge of the type. So
  813. % the \llap here moves out into the left-hand margin.
  814. \llap{%
  815. %
  816. % For a thicker or thinner bar, change the `1pt'.
  817. \vrule height\baselineskip width1pt
  818. %
  819. % This is the space between the bar and the text.
  820. \hskip 12pt
  821. }%
  822. }%
  823. }
  824. % @include FILE -- \input text of FILE.
  825. %
  826. \def\include{\parseargusing\filenamecatcodes\includezzz}
  827. \def\includezzz#1{%
  828. \pushthisfilestack
  829. \def\thisfile{#1}%
  830. {%
  831. \makevalueexpandable % we want to expand any @value in FILE.
  832. \turnoffactive % and allow special characters in the expansion
  833. \indexnofonts % Allow `@@' and other weird things in file names.
  834. \wlog{texinfo.tex: doing @include of #1^^J}%
  835. \edef\temp{\noexpand\input #1 }%
  836. %
  837. % This trickery is to read FILE outside of a group, in case it makes
  838. % definitions, etc.
  839. \expandafter
  840. }\temp
  841. \popthisfilestack
  842. }
  843. \def\filenamecatcodes{%
  844. \catcode`\\=\other
  845. \catcode`~=\other
  846. \catcode`^=\other
  847. \catcode`_=\other
  848. \catcode`|=\other
  849. \catcode`<=\other
  850. \catcode`>=\other
  851. \catcode`+=\other
  852. \catcode`-=\other
  853. \catcode`\`=\other
  854. \catcode`\'=\other
  855. }
  856. \def\pushthisfilestack{%
  857. \expandafter\pushthisfilestackX\popthisfilestack\StackTerm
  858. }
  859. \def\pushthisfilestackX{%
  860. \expandafter\pushthisfilestackY\thisfile\StackTerm
  861. }
  862. \def\pushthisfilestackY #1\StackTerm #2\StackTerm {%
  863. \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}%
  864. }
  865. \def\popthisfilestack{\errthisfilestackempty}
  866. \def\errthisfilestackempty{\errmessage{Internal error:
  867. the stack of filenames is empty.}}
  868. %
  869. \def\thisfile{}
  870. % @center line
  871. % outputs that line, centered.
  872. %
  873. \parseargdef\center{%
  874. \ifhmode
  875. \let\centersub\centerH
  876. \else
  877. \let\centersub\centerV
  878. \fi
  879. \centersub{\hfil \ignorespaces#1\unskip \hfil}%
  880. \let\centersub\relax % don't let the definition persist, just in case
  881. }
  882. \def\centerH#1{{%
  883. \hfil\break
  884. \advance\hsize by -\leftskip
  885. \advance\hsize by -\rightskip
  886. \line{#1}%
  887. \break
  888. }}
  889. %
  890. \newcount\centerpenalty
  891. \def\centerV#1{%
  892. % The idea here is the same as in \startdefun, \cartouche, etc.: if
  893. % @center is the first thing after a section heading, we need to wipe
  894. % out the negative parskip inserted by \sectionheading, but still
  895. % prevent a page break here.
  896. \centerpenalty = \lastpenalty
  897. \ifnum\centerpenalty>10000 \vskip\parskip \fi
  898. \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi
  899. \line{\kern\leftskip #1\kern\rightskip}%
  900. }
  901. % @sp n outputs n lines of vertical space
  902. %
  903. \parseargdef\sp{\vskip #1\baselineskip}
  904. % @comment ...line which is ignored...
  905. % @c is the same as @comment
  906. % @ignore ... @end ignore is another way to write a comment
  907. %
  908. \def\comment{\begingroup \catcode`\^^M=\active%
  909. \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other\commentxxx}%
  910. {\catcode`\^^M=\active%
  911. \gdef\commentxxx#1^^M{\endgroup%
  912. \futurelet\nexttoken\commentxxxx}%
  913. \gdef\commentxxxx{\ifx\nexttoken\aftermacro\expandafter\comment\fi}%
  914. }
  915. \def\c{\begingroup \catcode`\^^M=\active%
  916. \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
  917. \cxxx}
  918. {\catcode`\^^M=\active \gdef\cxxx#1^^M{\endgroup}}
  919. % See comment in \scanmacro about why the definitions of @c and @comment differ
  920. % @paragraphindent NCHARS
  921. % We'll use ems for NCHARS, close enough.
  922. % NCHARS can also be the word `asis' or `none'.
  923. % We cannot feasibly implement @paragraphindent asis, though.
  924. %
  925. \def\asisword{asis} % no translation, these are keywords
  926. \def\noneword{none}
  927. %
  928. \parseargdef\paragraphindent{%
  929. \def\temp{#1}%
  930. \ifx\temp\asisword
  931. \else
  932. \ifx\temp\noneword
  933. \defaultparindent = 0pt
  934. \else
  935. \defaultparindent = #1em
  936. \fi
  937. \fi
  938. \parindent = \defaultparindent
  939. }
  940. % @exampleindent NCHARS
  941. % We'll use ems for NCHARS like @paragraphindent.
  942. % It seems @exampleindent asis isn't necessary, but
  943. % I preserve it to make it similar to @paragraphindent.
  944. \parseargdef\exampleindent{%
  945. \def\temp{#1}%
  946. \ifx\temp\asisword
  947. \else
  948. \ifx\temp\noneword
  949. \lispnarrowing = 0pt
  950. \else
  951. \lispnarrowing = #1em
  952. \fi
  953. \fi
  954. }
  955. % @firstparagraphindent WORD
  956. % If WORD is `none', then suppress indentation of the first paragraph
  957. % after a section heading. If WORD is `insert', then do indent at such
  958. % paragraphs.
  959. %
  960. % The paragraph indentation is suppressed or not by calling
  961. % \suppressfirstparagraphindent, which the sectioning commands do.
  962. % We switch the definition of this back and forth according to WORD.
  963. % By default, we suppress indentation.
  964. %
  965. \def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
  966. \def\insertword{insert}
  967. %
  968. \parseargdef\firstparagraphindent{%
  969. \def\temp{#1}%
  970. \ifx\temp\noneword
  971. \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
  972. \else\ifx\temp\insertword
  973. \let\suppressfirstparagraphindent = \relax
  974. \else
  975. \errhelp = \EMsimple
  976. \errmessage{Unknown @firstparagraphindent option `\temp'}%
  977. \fi\fi
  978. }
  979. % Here is how we actually suppress indentation. Redefine \everypar to
  980. % \kern backwards by \parindent, and then reset itself to empty.
  981. %
  982. % We also make \indent itself not actually do anything until the next
  983. % paragraph.
  984. %
  985. \gdef\dosuppressfirstparagraphindent{%
  986. \gdef\indent {\restorefirstparagraphindent \indent}%
  987. \gdef\noindent{\restorefirstparagraphindent \noindent}%
  988. \global\everypar = {\kern -\parindent \restorefirstparagraphindent}%
  989. }
  990. %
  991. \gdef\restorefirstparagraphindent{%
  992. \global\let\indent = \ptexindent
  993. \global\let\noindent = \ptexnoindent
  994. \global\everypar = {}%
  995. }
  996. % @refill is a no-op.
  997. \let\refill=\relax
  998. % @setfilename INFO-FILENAME - ignored
  999. \let\setfilename=\comment
  1000. % @bye.
  1001. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
  1002. \message{pdf,}
  1003. % adobe `portable' document format
  1004. \newcount\tempnum
  1005. \newcount\lnkcount
  1006. \newtoks\filename
  1007. \newcount\filenamelength
  1008. \newcount\pgn
  1009. \newtoks\toksA
  1010. \newtoks\toksB
  1011. \newtoks\toksC
  1012. \newtoks\toksD
  1013. \newbox\boxA
  1014. \newbox\boxB
  1015. \newcount\countA
  1016. \newif\ifpdf
  1017. \newif\ifpdfmakepagedest
  1018. % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
  1019. % can be set). So we test for \relax and 0 as well as being undefined.
  1020. \ifx\pdfoutput\thisisundefined
  1021. \else
  1022. \ifx\pdfoutput\relax
  1023. \else
  1024. \ifcase\pdfoutput
  1025. \else
  1026. \pdftrue
  1027. \fi
  1028. \fi
  1029. \fi
  1030. % PDF uses PostScript string constants for the names of xref targets,
  1031. % for display in the outlines, and in other places. Thus, we have to
  1032. % double any backslashes. Otherwise, a name like "\node" will be
  1033. % interpreted as a newline (\n), followed by o, d, e. Not good.
  1034. %
  1035. % See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and
  1036. % related messages. The final outcome is that it is up to the TeX user
  1037. % to double the backslashes and otherwise make the string valid, so
  1038. % that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to
  1039. % do this reliably, so we use it.
  1040. % #1 is a control sequence in which to do the replacements,
  1041. % which we \xdef.
  1042. \def\txiescapepdf#1{%
  1043. \ifx\pdfescapestring\thisisundefined
  1044. % No primitive available; should we give a warning or log?
  1045. % Many times it won't matter.
  1046. \else
  1047. % The expandable \pdfescapestring primitive escapes parentheses,
  1048. % backslashes, and other special chars.
  1049. \xdef#1{\pdfescapestring{#1}}%
  1050. \fi
  1051. }
  1052. \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
  1053. with PDF output, and none of those formats could be found. (.eps cannot
  1054. be supported due to the design of the PDF format; use regular TeX (DVI
  1055. output) for that.)}
  1056. \ifpdf
  1057. %
  1058. % Color manipulation macros using ideas from pdfcolor.tex,
  1059. % except using rgb instead of cmyk; the latter is said to render as a
  1060. % very dark gray on-screen and a very dark halftone in print, instead
  1061. % of actual black. The dark red here is dark enough to print on paper as
  1062. % nearly black, but still distinguishable for online viewing. We use
  1063. % black by default, though.
  1064. \def\rgbDarkRed{0.50 0.09 0.12}
  1065. \def\rgbBlack{0 0 0}
  1066. %
  1067. % k sets the color for filling (usual text, etc.);
  1068. % K sets the color for stroking (thin rules, e.g., normal _'s).
  1069. \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}}
  1070. %
  1071. % Set color, and create a mark which defines \thiscolor accordingly,
  1072. % so that \makeheadline knows which color to restore.
  1073. \def\setcolor#1{%
  1074. \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}%
  1075. \domark
  1076. \pdfsetcolor{#1}%
  1077. }
  1078. %
  1079. \def\maincolor{\rgbBlack}
  1080. \pdfsetcolor{\maincolor}
  1081. \edef\thiscolor{\maincolor}
  1082. \def\lastcolordefs{}
  1083. %
  1084. \def\makefootline{%
  1085. \baselineskip24pt
  1086. \line{\pdfsetcolor{\maincolor}\the\footline}%
  1087. }
  1088. %
  1089. \def\makeheadline{%
  1090. \vbox to 0pt{%
  1091. \vskip-22.5pt
  1092. \line{%
  1093. \vbox to8.5pt{}%
  1094. % Extract \thiscolor definition from the marks.
  1095. \getcolormarks
  1096. % Typeset the headline with \maincolor, then restore the color.
  1097. \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
  1098. }%
  1099. \vss
  1100. }%
  1101. \nointerlineskip
  1102. }
  1103. %
  1104. %
  1105. \pdfcatalog{/PageMode /UseOutlines}
  1106. %
  1107. % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
  1108. \def\dopdfimage#1#2#3{%
  1109. \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
  1110. \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
  1111. %
  1112. % pdftex (and the PDF format) support .pdf, .png, .jpg (among
  1113. % others). Let's try in that order, PDF first since if
  1114. % someone has a scalable image, presumably better to use that than a
  1115. % bitmap.
  1116. \let\pdfimgext=\empty
  1117. \begingroup
  1118. \openin 1 #1.pdf \ifeof 1
  1119. \openin 1 #1.PDF \ifeof 1
  1120. \openin 1 #1.png \ifeof 1
  1121. \openin 1 #1.jpg \ifeof 1
  1122. \openin 1 #1.jpeg \ifeof 1
  1123. \openin 1 #1.JPG \ifeof 1
  1124. \errhelp = \nopdfimagehelp
  1125. \errmessage{Could not find image file #1 for pdf}%
  1126. \else \gdef\pdfimgext{JPG}%
  1127. \fi
  1128. \else \gdef\pdfimgext{jpeg}%
  1129. \fi
  1130. \else \gdef\pdfimgext{jpg}%
  1131. \fi
  1132. \else \gdef\pdfimgext{png}%
  1133. \fi
  1134. \else \gdef\pdfimgext{PDF}%
  1135. \fi
  1136. \else \gdef\pdfimgext{pdf}%
  1137. \fi
  1138. \closein 1
  1139. \endgroup
  1140. %
  1141. % without \immediate, ancient pdftex seg faults when the same image is
  1142. % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.)
  1143. \ifnum\pdftexversion < 14
  1144. \immediate\pdfimage
  1145. \else
  1146. \immediate\pdfximage
  1147. \fi
  1148. \ifdim \wd0 >0pt width \pdfimagewidth \fi
  1149. \ifdim \wd2 >0pt height \pdfimageheight \fi
  1150. \ifnum\pdftexversion<13
  1151. #1.\pdfimgext
  1152. \else
  1153. {#1.\pdfimgext}%
  1154. \fi
  1155. \ifnum\pdftexversion < 14 \else
  1156. \pdfrefximage \pdflastximage
  1157. \fi}
  1158. %
  1159. \def\pdfmkdest#1{{%
  1160. % We have to set dummies so commands such as @code, and characters
  1161. % such as \, aren't expanded when present in a section title.
  1162. \indexnofonts
  1163. \turnoffactive
  1164. \makevalueexpandable
  1165. \def\pdfdestname{#1}%
  1166. \txiescapepdf\pdfdestname
  1167. \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
  1168. }}
  1169. %
  1170. % used to mark target names; must be expandable.
  1171. \def\pdfmkpgn#1{#1}
  1172. %
  1173. % by default, use black for everything.
  1174. \def\urlcolor{\rgbBlack}
  1175. \def\linkcolor{\rgbBlack}
  1176. \def\endlink{\setcolor{\maincolor}\pdfendlink}
  1177. %
  1178. % Adding outlines to PDF; macros for calculating structure of outlines
  1179. % come from Petr Olsak
  1180. \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
  1181. \else \csname#1\endcsname \fi}
  1182. \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
  1183. \advance\tempnum by 1
  1184. \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
  1185. %
  1186. % #1 is the section text, which is what will be displayed in the
  1187. % outline by the pdf viewer. #2 is the pdf expression for the number
  1188. % of subentries (or empty, for subsubsections). #3 is the node text,
  1189. % which might be empty if this toc entry had no corresponding node.
  1190. % #4 is the page number
  1191. %
  1192. \def\dopdfoutline#1#2#3#4{%
  1193. % Generate a link to the node text if that exists; else, use the
  1194. % page number. We could generate a destination for the section
  1195. % text in the case where a section has no node, but it doesn't
  1196. % seem worth the trouble, since most documents are normally structured.
  1197. \edef\pdfoutlinedest{#3}%
  1198. \ifx\pdfoutlinedest\empty
  1199. \def\pdfoutlinedest{#4}%
  1200. \else
  1201. \txiescapepdf\pdfoutlinedest
  1202. \fi
  1203. %
  1204. % Also escape PDF chars in the display string.
  1205. \edef\pdfoutlinetext{#1}%
  1206. \txiescapepdf\pdfoutlinetext
  1207. %
  1208. \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
  1209. }
  1210. %
  1211. \def\pdfmakeoutlines{%
  1212. \begingroup
  1213. % Read toc silently, to get counts of subentries for \pdfoutline.
  1214. \def\partentry##1##2##3##4{}% ignore parts in the outlines
  1215. \def\numchapentry##1##2##3##4{%
  1216. \def\thischapnum{##2}%
  1217. \def\thissecnum{0}%
  1218. \def\thissubsecnum{0}%
  1219. }%
  1220. \def\numsecentry##1##2##3##4{%
  1221. \advancenumber{chap\thischapnum}%
  1222. \def\thissecnum{##2}%
  1223. \def\thissubsecnum{0}%
  1224. }%
  1225. \def\numsubsecentry##1##2##3##4{%
  1226. \advancenumber{sec\thissecnum}%
  1227. \def\thissubsecnum{##2}%
  1228. }%
  1229. \def\numsubsubsecentry##1##2##3##4{%
  1230. \advancenumber{subsec\thissubsecnum}%
  1231. }%
  1232. \def\thischapnum{0}%
  1233. \def\thissecnum{0}%
  1234. \def\thissubsecnum{0}%
  1235. %
  1236. % use \def rather than \let here because we redefine \chapentry et
  1237. % al. a second time, below.
  1238. \def\appentry{\numchapentry}%
  1239. \def\appsecentry{\numsecentry}%
  1240. \def\appsubsecentry{\numsubsecentry}%
  1241. \def\appsubsubsecentry{\numsubsubsecentry}%
  1242. \def\unnchapentry{\numchapentry}%
  1243. \def\unnsecentry{\numsecentry}%
  1244. \def\unnsubsecentry{\numsubsecentry}%
  1245. \def\unnsubsubsecentry{\numsubsubsecentry}%
  1246. \readdatafile{toc}%
  1247. %
  1248. % Read toc second time, this time actually producing the outlines.
  1249. % The `-' means take the \expnumber as the absolute number of
  1250. % subentries, which we calculated on our first read of the .toc above.
  1251. %
  1252. % We use the node names as the destinations.
  1253. \def\numchapentry##1##2##3##4{%
  1254. \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
  1255. \def\numsecentry##1##2##3##4{%
  1256. \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
  1257. \def\numsubsecentry##1##2##3##4{%
  1258. \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%
  1259. \def\numsubsubsecentry##1##2##3##4{% count is always zero
  1260. \dopdfoutline{##1}{}{##3}{##4}}%
  1261. %
  1262. % PDF outlines are displayed using system fonts, instead of
  1263. % document fonts. Therefore we cannot use special characters,
  1264. % since the encoding is unknown. For example, the eogonek from
  1265. % Latin 2 (0xea) gets translated to a | character. Info from
  1266. % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
  1267. %
  1268. % TODO this right, we have to translate 8-bit characters to
  1269. % their "best" equivalent, based on the @documentencoding. Too
  1270. % much work for too little return. Just use the ASCII equivalents
  1271. % we use for the index sort strings.
  1272. %
  1273. \indexnofonts
  1274. \setupdatafile
  1275. % We can have normal brace characters in the PDF outlines, unlike
  1276. % Texinfo index files. So set that up.
  1277. \def\{{\lbracecharliteral}%
  1278. \def\}{\rbracecharliteral}%
  1279. \catcode`\\=\active \otherbackslash
  1280. \input \tocreadfilename
  1281. \endgroup
  1282. }
  1283. {\catcode`[=1 \catcode`]=2
  1284. \catcode`{=\other \catcode`}=\other
  1285. \gdef\lbracecharliteral[{]%
  1286. \gdef\rbracecharliteral[}]%
  1287. ]
  1288. %
  1289. \def\skipspaces#1{\def\PP{#1}\def\D{|}%
  1290. \ifx\PP\D\let\nextsp\relax
  1291. \else\let\nextsp\skipspaces
  1292. \addtokens{\filename}{\PP}%
  1293. \advance\filenamelength by 1
  1294. \fi
  1295. \nextsp}
  1296. \def\getfilename#1{%
  1297. \filenamelength=0
  1298. % If we don't expand the argument now, \skipspaces will get
  1299. % snagged on things like "@value{foo}".
  1300. \edef\temp{#1}%
  1301. \expandafter\skipspaces\temp|\relax
  1302. }
  1303. \ifnum\pdftexversion < 14
  1304. \let \startlink \pdfannotlink
  1305. \else
  1306. \let \startlink \pdfstartlink
  1307. \fi
  1308. % make a live url in pdf output.
  1309. \def\pdfurl#1{%
  1310. \begingroup
  1311. % it seems we really need yet another set of dummies; have not
  1312. % tried to figure out what each command should do in the context
  1313. % of @url. for now, just make @/ a no-op, that's the only one
  1314. % people have actually reported a problem with.
  1315. %
  1316. \normalturnoffactive
  1317. \def\@{@}%
  1318. \let\/=\empty
  1319. \let\xprocessmacroarg=\eatspaces % in case we are in a macro expansion
  1320. \makevalueexpandable
  1321. % do we want to go so far as to use \indexnofonts instead of just
  1322. % special-casing \var here?
  1323. \def\var##1{##1}%
  1324. %
  1325. \leavevmode\setcolor{\urlcolor}%
  1326. \startlink attr{/Border [0 0 0]}%
  1327. user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
  1328. \endgroup}
  1329. \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
  1330. \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
  1331. \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
  1332. \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
  1333. \def\maketoks{%
  1334. \expandafter\poptoks\the\toksA|ENDTOKS|\relax
  1335. \ifx\first0\adn0
  1336. \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
  1337. \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
  1338. \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
  1339. \else
  1340. \ifnum0=\countA\else\makelink\fi
  1341. \ifx\first.\let\next=\done\else
  1342. \let\next=\maketoks
  1343. \addtokens{\toksB}{\the\toksD}
  1344. \ifx\first,\addtokens{\toksB}{\space}\fi
  1345. \fi
  1346. \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
  1347. \next}
  1348. \def\makelink{\addtokens{\toksB}%
  1349. {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
  1350. \def\pdflink#1{%
  1351. \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
  1352. \setcolor{\linkcolor}#1\endlink}
  1353. \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
  1354. \else
  1355. % non-pdf mode
  1356. \let\pdfmkdest = \gobble
  1357. \let\pdfurl = \gobble
  1358. \let\endlink = \relax
  1359. \let\setcolor = \gobble
  1360. \let\pdfsetcolor = \gobble
  1361. \let\pdfmakeoutlines = \relax
  1362. \fi % \ifx\pdfoutput
  1363. \message{fonts,}
  1364. % Change the current font style to #1, remembering it in \curfontstyle.
  1365. % For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
  1366. % italics, not bold italics.
  1367. %
  1368. \def\setfontstyle#1{%
  1369. \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
  1370. \csname ten#1\endcsname % change the current font
  1371. }
  1372. % Select #1 fonts with the current style.
  1373. %
  1374. \def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname}
  1375. \def\rm{\fam=0 \setfontstyle{rm}}
  1376. \def\it{\fam=\itfam \setfontstyle{it}}
  1377. \def\sl{\fam=\slfam \setfontstyle{sl}}
  1378. \def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
  1379. \def\tt{\fam=\ttfam \setfontstyle{tt}}
  1380. % Unfortunately, we have to override this for titles and the like, since
  1381. % in those cases "rm" is bold. Sigh.
  1382. \def\rmisbold{\rm\def\curfontstyle{bf}}
  1383. % Texinfo sort of supports the sans serif font style, which plain TeX does not.
  1384. % So we set up a \sf.
  1385. \newfam\sffam
  1386. \def\sf{\fam=\sffam \setfontstyle{sf}}
  1387. \let\li = \sf % Sometimes we call it \li, not \sf.
  1388. % We don't need math for this font style.
  1389. \def\ttsl{\setfontstyle{ttsl}}
  1390. % Set the baselineskip to #1, and the lineskip and strut size
  1391. % correspondingly. There is no deep meaning behind these magic numbers
  1392. % used as factors; they just match (closely enough) what Knuth defined.
  1393. %
  1394. \def\lineskipfactor{.08333}
  1395. \def\strutheightpercent{.70833}
  1396. \def\strutdepthpercent {.29167}
  1397. %
  1398. % can get a sort of poor man's double spacing by redefining this.
  1399. \def\baselinefactor{1}
  1400. %
  1401. \newdimen\textleading
  1402. \def\setleading#1{%
  1403. \dimen0 = #1\relax
  1404. \normalbaselineskip = \baselinefactor\dimen0
  1405. \normallineskip = \lineskipfactor\normalbaselineskip
  1406. \normalbaselines
  1407. \setbox\strutbox =\hbox{%
  1408. \vrule width0pt height\strutheightpercent\baselineskip
  1409. depth \strutdepthpercent \baselineskip
  1410. }%
  1411. }
  1412. % PDF CMaps. See also LaTeX's t1.cmap.
  1413. %
  1414. % do nothing with this by default.
  1415. \expandafter\let\csname cmapOT1\endcsname\gobble
  1416. \expandafter\let\csname cmapOT1IT\endcsname\gobble
  1417. \expandafter\let\csname cmapOT1TT\endcsname\gobble
  1418. % if we are producing pdf, and we have \pdffontattr, then define cmaps.
  1419. % (\pdffontattr was introduced many years ago, but people still run
  1420. % older pdftex's; it's easy to conditionalize, so we do.)
  1421. \ifpdf \ifx\pdffontattr\thisisundefined \else
  1422. \begingroup
  1423. \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
  1424. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
  1425. %%DocumentNeededResources: ProcSet (CIDInit)
  1426. %%IncludeResource: ProcSet (CIDInit)
  1427. %%BeginResource: CMap (TeX-OT1-0)
  1428. %%Title: (TeX-OT1-0 TeX OT1 0)
  1429. %%Version: 1.000
  1430. %%EndComments
  1431. /CIDInit /ProcSet findresource begin
  1432. 12 dict begin
  1433. begincmap
  1434. /CIDSystemInfo
  1435. << /Registry (TeX)
  1436. /Ordering (OT1)
  1437. /Supplement 0
  1438. >> def
  1439. /CMapName /TeX-OT1-0 def
  1440. /CMapType 2 def
  1441. 1 begincodespacerange
  1442. <00> <7F>
  1443. endcodespacerange
  1444. 8 beginbfrange
  1445. <00> <01> <0393>
  1446. <09> <0A> <03A8>
  1447. <23> <26> <0023>
  1448. <28> <3B> <0028>
  1449. <3F> <5B> <003F>
  1450. <5D> <5E> <005D>
  1451. <61> <7A> <0061>
  1452. <7B> <7C> <2013>
  1453. endbfrange
  1454. 40 beginbfchar
  1455. <02> <0398>
  1456. <03> <039B>
  1457. <04> <039E>
  1458. <05> <03A0>
  1459. <06> <03A3>
  1460. <07> <03D2>
  1461. <08> <03A6>
  1462. <0B> <00660066>
  1463. <0C> <00660069>
  1464. <0D> <0066006C>
  1465. <0E> <006600660069>
  1466. <0F> <00660066006C>
  1467. <10> <0131>
  1468. <11> <0237>
  1469. <12> <0060>
  1470. <13> <00B4>
  1471. <14> <02C7>
  1472. <15> <02D8>
  1473. <16> <00AF>
  1474. <17> <02DA>
  1475. <18> <00B8>
  1476. <19> <00DF>
  1477. <1A> <00E6>
  1478. <1B> <0153>
  1479. <1C> <00F8>
  1480. <1D> <00C6>
  1481. <1E> <0152>
  1482. <1F> <00D8>
  1483. <21> <0021>
  1484. <22> <201D>
  1485. <27> <2019>
  1486. <3C> <00A1>
  1487. <3D> <003D>
  1488. <3E> <00BF>
  1489. <5C> <201C>
  1490. <5F> <02D9>
  1491. <60> <2018>
  1492. <7D> <02DD>
  1493. <7E> <007E>
  1494. <7F> <00A8>
  1495. endbfchar
  1496. endcmap
  1497. CMapName currentdict /CMap defineresource pop
  1498. end
  1499. end
  1500. %%EndResource
  1501. %%EOF
  1502. }\endgroup
  1503. \expandafter\edef\csname cmapOT1\endcsname#1{%
  1504. \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
  1505. }%
  1506. %
  1507. % \cmapOT1IT
  1508. \begingroup
  1509. \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
  1510. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
  1511. %%DocumentNeededResources: ProcSet (CIDInit)
  1512. %%IncludeResource: ProcSet (CIDInit)
  1513. %%BeginResource: CMap (TeX-OT1IT-0)
  1514. %%Title: (TeX-OT1IT-0 TeX OT1IT 0)
  1515. %%Version: 1.000
  1516. %%EndComments
  1517. /CIDInit /ProcSet findresource begin
  1518. 12 dict begin
  1519. begincmap
  1520. /CIDSystemInfo
  1521. << /Registry (TeX)
  1522. /Ordering (OT1IT)
  1523. /Supplement 0
  1524. >> def
  1525. /CMapName /TeX-OT1IT-0 def
  1526. /CMapType 2 def
  1527. 1 begincodespacerange
  1528. <00> <7F>
  1529. endcodespacerange
  1530. 8 beginbfrange
  1531. <00> <01> <0393>
  1532. <09> <0A> <03A8>
  1533. <25> <26> <0025>
  1534. <28> <3B> <0028>
  1535. <3F> <5B> <003F>
  1536. <5D> <5E> <005D>
  1537. <61> <7A> <0061>
  1538. <7B> <7C> <2013>
  1539. endbfrange
  1540. 42 beginbfchar
  1541. <02> <0398>
  1542. <03> <039B>
  1543. <04> <039E>
  1544. <05> <03A0>
  1545. <06> <03A3>
  1546. <07> <03D2>
  1547. <08> <03A6>
  1548. <0B> <00660066>
  1549. <0C> <00660069>
  1550. <0D> <0066006C>
  1551. <0E> <006600660069>
  1552. <0F> <00660066006C>
  1553. <10> <0131>
  1554. <11> <0237>
  1555. <12> <0060>
  1556. <13> <00B4>
  1557. <14> <02C7>
  1558. <15> <02D8>
  1559. <16> <00AF>
  1560. <17> <02DA>
  1561. <18> <00B8>
  1562. <19> <00DF>
  1563. <1A> <00E6>
  1564. <1B> <0153>
  1565. <1C> <00F8>
  1566. <1D> <00C6>
  1567. <1E> <0152>
  1568. <1F> <00D8>
  1569. <21> <0021>
  1570. <22> <201D>
  1571. <23> <0023>
  1572. <24> <00A3>
  1573. <27> <2019>
  1574. <3C> <00A1>
  1575. <3D> <003D>
  1576. <3E> <00BF>
  1577. <5C> <201C>
  1578. <5F> <02D9>
  1579. <60> <2018>
  1580. <7D> <02DD>
  1581. <7E> <007E>
  1582. <7F> <00A8>
  1583. endbfchar
  1584. endcmap
  1585. CMapName currentdict /CMap defineresource pop
  1586. end
  1587. end
  1588. %%EndResource
  1589. %%EOF
  1590. }\endgroup
  1591. \expandafter\edef\csname cmapOT1IT\endcsname#1{%
  1592. \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
  1593. }%
  1594. %
  1595. % \cmapOT1TT
  1596. \begingroup
  1597. \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
  1598. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
  1599. %%DocumentNeededResources: ProcSet (CIDInit)
  1600. %%IncludeResource: ProcSet (CIDInit)
  1601. %%BeginResource: CMap (TeX-OT1TT-0)
  1602. %%Title: (TeX-OT1TT-0 TeX OT1TT 0)
  1603. %%Version: 1.000
  1604. %%EndComments
  1605. /CIDInit /ProcSet findresource begin
  1606. 12 dict begin
  1607. begincmap
  1608. /CIDSystemInfo
  1609. << /Registry (TeX)
  1610. /Ordering (OT1TT)
  1611. /Supplement 0
  1612. >> def
  1613. /CMapName /TeX-OT1TT-0 def
  1614. /CMapType 2 def
  1615. 1 begincodespacerange
  1616. <00> <7F>
  1617. endcodespacerange
  1618. 5 beginbfrange
  1619. <00> <01> <0393>
  1620. <09> <0A> <03A8>
  1621. <21> <26> <0021>
  1622. <28> <5F> <0028>
  1623. <61> <7E> <0061>
  1624. endbfrange
  1625. 32 beginbfchar
  1626. <02> <0398>
  1627. <03> <039B>
  1628. <04> <039E>
  1629. <05> <03A0>
  1630. <06> <03A3>
  1631. <07> <03D2>
  1632. <08> <03A6>
  1633. <0B> <2191>
  1634. <0C> <2193>
  1635. <0D> <0027>
  1636. <0E> <00A1>
  1637. <0F> <00BF>
  1638. <10> <0131>
  1639. <11> <0237>
  1640. <12> <0060>
  1641. <13> <00B4>
  1642. <14> <02C7>
  1643. <15> <02D8>
  1644. <16> <00AF>
  1645. <17> <02DA>
  1646. <18> <00B8>
  1647. <19> <00DF>
  1648. <1A> <00E6>
  1649. <1B> <0153>
  1650. <1C> <00F8>
  1651. <1D> <00C6>
  1652. <1E> <0152>
  1653. <1F> <00D8>
  1654. <20> <2423>
  1655. <27> <2019>
  1656. <60> <2018>
  1657. <7F> <00A8>
  1658. endbfchar
  1659. endcmap
  1660. CMapName currentdict /CMap defineresource pop
  1661. end
  1662. end
  1663. %%EndResource
  1664. %%EOF
  1665. }\endgroup
  1666. \expandafter\edef\csname cmapOT1TT\endcsname#1{%
  1667. \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
  1668. }%
  1669. \fi\fi
  1670. % Set the font macro #1 to the font named \fontprefix#2.
  1671. % #3 is the font's design size, #4 is a scale factor, #5 is the CMap
  1672. % encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit).
  1673. % Example:
  1674. % #1 = \textrm
  1675. % #2 = \rmshape
  1676. % #3 = 10
  1677. % #4 = \mainmagstep
  1678. % #5 = OT1
  1679. %
  1680. \def\setfont#1#2#3#4#5{%
  1681. \font#1=\fontprefix#2#3 scaled #4
  1682. \csname cmap#5\endcsname#1%
  1683. }
  1684. % This is what gets called when #5 of \setfont is empty.
  1685. \let\cmap\gobble
  1686. %
  1687. % (end of cmaps)
  1688. % Use cm as the default font prefix.
  1689. % To specify the font prefix, you must define \fontprefix
  1690. % before you read in texinfo.tex.
  1691. \ifx\fontprefix\thisisundefined
  1692. \def\fontprefix{cm}
  1693. \fi
  1694. % Support font families that don't use the same naming scheme as CM.
  1695. \def\rmshape{r}
  1696. \def\rmbshape{bx} % where the normal face is bold
  1697. \def\bfshape{b}
  1698. \def\bxshape{bx}
  1699. \def\ttshape{tt}
  1700. \def\ttbshape{tt}
  1701. \def\ttslshape{sltt}
  1702. \def\itshape{ti}
  1703. \def\itbshape{bxti}
  1704. \def\slshape{sl}
  1705. \def\slbshape{bxsl}
  1706. \def\sfshape{ss}
  1707. \def\sfbshape{ss}
  1708. \def\scshape{csc}
  1709. \def\scbshape{csc}
  1710. % Definitions for a main text size of 11pt. (The default in Texinfo.)
  1711. %
  1712. \def\definetextfontsizexi{%
  1713. % Text fonts (11.2pt, magstep1).
  1714. \def\textnominalsize{11pt}
  1715. \edef\mainmagstep{\magstephalf}
  1716. \setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
  1717. \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
  1718. \setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
  1719. \setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
  1720. \setfont\textsl\slshape{10}{\mainmagstep}{OT1}
  1721. \setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
  1722. \setfont\textsc\scshape{10}{\mainmagstep}{OT1}
  1723. \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
  1724. \font\texti=cmmi10 scaled \mainmagstep
  1725. \font\textsy=cmsy10 scaled \mainmagstep
  1726. \def\textecsize{1095}
  1727. % A few fonts for @defun names and args.
  1728. \setfont\defbf\bfshape{10}{\magstep1}{OT1}
  1729. \setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
  1730. \setfont\defsl\slshape{10}{\magstep1}{OT1TT}
  1731. \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
  1732. \def\df{\let\tentt=\deftt \let\tenbf = \defbf
  1733. \let\tenttsl=\defttsl \let\tensl=\defsl \bf}
  1734. % Fonts for indices, footnotes, small examples (9pt).
  1735. \def\smallnominalsize{9pt}
  1736. \setfont\smallrm\rmshape{9}{1000}{OT1}
  1737. \setfont\smalltt\ttshape{9}{1000}{OT1TT}
  1738. \setfont\smallbf\bfshape{10}{900}{OT1}
  1739. \setfont\smallit\itshape{9}{1000}{OT1IT}
  1740. \setfont\smallsl\slshape{9}{1000}{OT1}
  1741. \setfont\smallsf\sfshape{9}{1000}{OT1}
  1742. \setfont\smallsc\scshape{10}{900}{OT1}
  1743. \setfont\smallttsl\ttslshape{10}{900}{OT1TT}
  1744. \font\smalli=cmmi9
  1745. \font\smallsy=cmsy9
  1746. \def\smallecsize{0900}
  1747. % Fonts for small examples (8pt).
  1748. \def\smallernominalsize{8pt}
  1749. \setfont\smallerrm\rmshape{8}{1000}{OT1}
  1750. \setfont\smallertt\ttshape{8}{1000}{OT1TT}
  1751. \setfont\smallerbf\bfshape{10}{800}{OT1}
  1752. \setfont\smallerit\itshape{8}{1000}{OT1IT}
  1753. \setfont\smallersl\slshape{8}{1000}{OT1}
  1754. \setfont\smallersf\sfshape{8}{1000}{OT1}
  1755. \setfont\smallersc\scshape{10}{800}{OT1}
  1756. \setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
  1757. \font\smalleri=cmmi8
  1758. \font\smallersy=cmsy8
  1759. \def\smallerecsize{0800}
  1760. % Fonts for title page (20.4pt):
  1761. \def\titlenominalsize{20pt}
  1762. \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
  1763. \setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
  1764. \setfont\titlesl\slbshape{10}{\magstep4}{OT1}
  1765. \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
  1766. \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
  1767. \setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
  1768. \let\titlebf=\titlerm
  1769. \setfont\titlesc\scbshape{10}{\magstep4}{OT1}
  1770. \font\titlei=cmmi12 scaled \magstep3
  1771. \font\titlesy=cmsy10 scaled \magstep4
  1772. \def\titleecsize{2074}
  1773. % Chapter (and unnumbered) fonts (17.28pt).
  1774. \def\chapnominalsize{17pt}
  1775. \setfont\chaprm\rmbshape{12}{\magstep2}{OT1}
  1776. \setfont\chapit\itbshape{10}{\magstep3}{OT1IT}
  1777. \setfont\chapsl\slbshape{10}{\magstep3}{OT1}
  1778. \setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT}
  1779. \setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT}
  1780. \setfont\chapsf\sfbshape{17}{1000}{OT1}
  1781. \let\chapbf=\chaprm
  1782. \setfont\chapsc\scbshape{10}{\magstep3}{OT1}
  1783. \font\chapi=cmmi12 scaled \magstep2
  1784. \font\chapsy=cmsy10 scaled \magstep3
  1785. \def\chapecsize{1728}
  1786. % Section fonts (14.4pt).
  1787. \def\secnominalsize{14pt}
  1788. \setfont\secrm\rmbshape{12}{\magstep1}{OT1}
  1789. \setfont\secrmnotbold\rmshape{12}{\magstep1}{OT1}
  1790. \setfont\secit\itbshape{10}{\magstep2}{OT1IT}
  1791. \setfont\secsl\slbshape{10}{\magstep2}{OT1}
  1792. \setfont\sectt\ttbshape{12}{\magstep1}{OT1TT}
  1793. \setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT}
  1794. \setfont\secsf\sfbshape{12}{\magstep1}{OT1}
  1795. \let\secbf\secrm
  1796. \setfont\secsc\scbshape{10}{\magstep2}{OT1}
  1797. \font\seci=cmmi12 scaled \magstep1
  1798. \font\secsy=cmsy10 scaled \magstep2
  1799. \def\sececsize{1440}
  1800. % Subsection fonts (13.15pt).
  1801. \def\ssecnominalsize{13pt}
  1802. \setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1}
  1803. \setfont\ssecit\itbshape{10}{1315}{OT1IT}
  1804. \setfont\ssecsl\slbshape{10}{1315}{OT1}
  1805. \setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT}
  1806. \setfont\ssecttsl\ttslshape{10}{1315}{OT1TT}
  1807. \setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1}
  1808. \let\ssecbf\ssecrm
  1809. \setfont\ssecsc\scbshape{10}{1315}{OT1}
  1810. \font\sseci=cmmi12 scaled \magstephalf
  1811. \font\ssecsy=cmsy10 scaled 1315
  1812. \def\ssececsize{1200}
  1813. % Reduced fonts for @acro in text (10pt).
  1814. \def\reducednominalsize{10pt}
  1815. \setfont\reducedrm\rmshape{10}{1000}{OT1}
  1816. \setfont\reducedtt\ttshape{10}{1000}{OT1TT}
  1817. \setfont\reducedbf\bfshape{10}{1000}{OT1}
  1818. \setfont\reducedit\itshape{10}{1000}{OT1IT}
  1819. \setfont\reducedsl\slshape{10}{1000}{OT1}
  1820. \setfont\reducedsf\sfshape{10}{1000}{OT1}
  1821. \setfont\reducedsc\scshape{10}{1000}{OT1}
  1822. \setfont\reducedttsl\ttslshape{10}{1000}{OT1TT}
  1823. \font\reducedi=cmmi10
  1824. \font\reducedsy=cmsy10
  1825. \def\reducedecsize{1000}
  1826. \textleading = 13.2pt % line spacing for 11pt CM
  1827. \textfonts % reset the current fonts
  1828. \rm
  1829. } % end of 11pt text font size definitions, \definetextfontsizexi
  1830. % Definitions to make the main text be 10pt Computer Modern, with
  1831. % section, chapter, etc., sizes following suit. This is for the GNU
  1832. % Press printing of the Emacs 22 manual. Maybe other manuals in the
  1833. % future. Used with @smallbook, which sets the leading to 12pt.
  1834. %
  1835. \def\definetextfontsizex{%
  1836. % Text fonts (10pt).
  1837. \def\textnominalsize{10pt}
  1838. \edef\mainmagstep{1000}
  1839. \setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
  1840. \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
  1841. \setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
  1842. \setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
  1843. \setfont\textsl\slshape{10}{\mainmagstep}{OT1}
  1844. \setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
  1845. \setfont\textsc\scshape{10}{\mainmagstep}{OT1}
  1846. \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
  1847. \font\texti=cmmi10 scaled \mainmagstep
  1848. \font\textsy=cmsy10 scaled \mainmagstep
  1849. \def\textecsize{1000}
  1850. % A few fonts for @defun names and args.
  1851. \setfont\defbf\bfshape{10}{\magstephalf}{OT1}
  1852. \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
  1853. \setfont\defsl\slshape{10}{\magstephalf}{OT1TT}
  1854. \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
  1855. \def\df{\let\tentt=\deftt \let\tenbf = \defbf
  1856. \let\tensl=\defsl \let\tenttsl=\defttsl \bf}
  1857. % Fonts for indices, footnotes, small examples (9pt).
  1858. \def\smallnominalsize{9pt}
  1859. \setfont\smallrm\rmshape{9}{1000}{OT1}
  1860. \setfont\smalltt\ttshape{9}{1000}{OT1TT}
  1861. \setfont\smallbf\bfshape{10}{900}{OT1}
  1862. \setfont\smallit\itshape{9}{1000}{OT1IT}
  1863. \setfont\smallsl\slshape{9}{1000}{OT1}
  1864. \setfont\smallsf\sfshape{9}{1000}{OT1}
  1865. \setfont\smallsc\scshape{10}{900}{OT1}
  1866. \setfont\smallttsl\ttslshape{10}{900}{OT1TT}
  1867. \font\smalli=cmmi9
  1868. \font\smallsy=cmsy9
  1869. \def\smallecsize{0900}
  1870. % Fonts for small examples (8pt).
  1871. \def\smallernominalsize{8pt}
  1872. \setfont\smallerrm\rmshape{8}{1000}{OT1}
  1873. \setfont\smallertt\ttshape{8}{1000}{OT1TT}
  1874. \setfont\smallerbf\bfshape{10}{800}{OT1}
  1875. \setfont\smallerit\itshape{8}{1000}{OT1IT}
  1876. \setfont\smallersl\slshape{8}{1000}{OT1}
  1877. \setfont\smallersf\sfshape{8}{1000}{OT1}
  1878. \setfont\smallersc\scshape{10}{800}{OT1}
  1879. \setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
  1880. \font\smalleri=cmmi8
  1881. \font\smallersy=cmsy8
  1882. \def\smallerecsize{0800}
  1883. % Fonts for title page (20.4pt):
  1884. \def\titlenominalsize{20pt}
  1885. \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
  1886. \setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
  1887. \setfont\titlesl\slbshape{10}{\magstep4}{OT1}
  1888. \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
  1889. \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
  1890. \setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
  1891. \let\titlebf=\titlerm
  1892. \setfont\titlesc\scbshape{10}{\magstep4}{OT1}
  1893. \font\titlei=cmmi12 scaled \magstep3
  1894. \font\titlesy=cmsy10 scaled \magstep4
  1895. \def\titleecsize{2074}
  1896. % Chapter fonts (14.4pt).
  1897. \def\chapnominalsize{14pt}
  1898. \setfont\chaprm\rmbshape{12}{\magstep1}{OT1}
  1899. \setfont\chapit\itbshape{10}{\magstep2}{OT1IT}
  1900. \setfont\chapsl\slbshape{10}{\magstep2}{OT1}
  1901. \setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT}
  1902. \setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT}
  1903. \setfont\chapsf\sfbshape{12}{\magstep1}{OT1}
  1904. \let\chapbf\chaprm
  1905. \setfont\chapsc\scbshape{10}{\magstep2}{OT1}
  1906. \font\chapi=cmmi12 scaled \magstep1
  1907. \font\chapsy=cmsy10 scaled \magstep2
  1908. \def\chapecsize{1440}
  1909. % Section fonts (12pt).
  1910. \def\secnominalsize{12pt}
  1911. \setfont\secrm\rmbshape{12}{1000}{OT1}
  1912. \setfont\secit\itbshape{10}{\magstep1}{OT1IT}
  1913. \setfont\secsl\slbshape{10}{\magstep1}{OT1}
  1914. \setfont\sectt\ttbshape{12}{1000}{OT1TT}
  1915. \setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT}
  1916. \setfont\secsf\sfbshape{12}{1000}{OT1}
  1917. \let\secbf\secrm
  1918. \setfont\secsc\scbshape{10}{\magstep1}{OT1}
  1919. \font\seci=cmmi12
  1920. \font\secsy=cmsy10 scaled \magstep1
  1921. \def\sececsize{1200}
  1922. % Subsection fonts (10pt).
  1923. \def\ssecnominalsize{10pt}
  1924. \setfont\ssecrm\rmbshape{10}{1000}{OT1}
  1925. \setfont\ssecit\itbshape{10}{1000}{OT1IT}
  1926. \setfont\ssecsl\slbshape{10}{1000}{OT1}
  1927. \setfont\ssectt\ttbshape{10}{1000}{OT1TT}
  1928. \setfont\ssecttsl\ttslshape{10}{1000}{OT1TT}
  1929. \setfont\ssecsf\sfbshape{10}{1000}{OT1}
  1930. \let\ssecbf\ssecrm
  1931. \setfont\ssecsc\scbshape{10}{1000}{OT1}
  1932. \font\sseci=cmmi10
  1933. \font\ssecsy=cmsy10
  1934. \def\ssececsize{1000}
  1935. % Reduced fonts for @acro in text (9pt).
  1936. \def\reducednominalsize{9pt}
  1937. \setfont\reducedrm\rmshape{9}{1000}{OT1}
  1938. \setfont\reducedtt\ttshape{9}{1000}{OT1TT}
  1939. \setfont\reducedbf\bfshape{10}{900}{OT1}
  1940. \setfont\reducedit\itshape{9}{1000}{OT1IT}
  1941. \setfont\reducedsl\slshape{9}{1000}{OT1}
  1942. \setfont\reducedsf\sfshape{9}{1000}{OT1}
  1943. \setfont\reducedsc\scshape{10}{900}{OT1}
  1944. \setfont\reducedttsl\ttslshape{10}{900}{OT1TT}
  1945. \font\reducedi=cmmi9
  1946. \font\reducedsy=cmsy9
  1947. \def\reducedecsize{0900}
  1948. \divide\parskip by 2 % reduce space between paragraphs
  1949. \textleading = 12pt % line spacing for 10pt CM
  1950. \textfonts % reset the current fonts
  1951. \rm
  1952. } % end of 10pt text font size definitions, \definetextfontsizex
  1953. % We provide the user-level command
  1954. % @fonttextsize 10
  1955. % (or 11) to redefine the text font size. pt is assumed.
  1956. %
  1957. \def\xiword{11}
  1958. \def\xword{10}
  1959. \def\xwordpt{10pt}
  1960. %
  1961. \parseargdef\fonttextsize{%
  1962. \def\textsizearg{#1}%
  1963. %\wlog{doing @fonttextsize \textsizearg}%
  1964. %
  1965. % Set \globaldefs so that documents can use this inside @tex, since
  1966. % makeinfo 4.8 does not support it, but we need it nonetheless.
  1967. %
  1968. \begingroup \globaldefs=1
  1969. \ifx\textsizearg\xword \definetextfontsizex
  1970. \else \ifx\textsizearg\xiword \definetextfontsizexi
  1971. \else
  1972. \errhelp=\EMsimple
  1973. \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
  1974. \fi\fi
  1975. \endgroup
  1976. }
  1977. % In order for the font changes to affect most math symbols and letters,
  1978. % we have to define the \textfont of the standard families. We don't
  1979. % bother to reset \scriptfont and \scriptscriptfont; awaiting user need.
  1980. %
  1981. \def\resetmathfonts{%
  1982. \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy
  1983. \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf
  1984. \textfont\ttfam=\tentt \textfont\sffam=\tensf
  1985. }
  1986. % The font-changing commands redefine the meanings of \tenSTYLE, instead
  1987. % of just \STYLE. We do this because \STYLE needs to also set the
  1988. % current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire
  1989. % \tenSTYLE to set the current font.
  1990. %
  1991. % Each font-changing command also sets the names \lsize (one size lower)
  1992. % and \lllsize (three sizes lower). These relative commands are used
  1993. % in, e.g., the LaTeX logo and acronyms.
  1994. %
  1995. % This all needs generalizing, badly.
  1996. %
  1997. \def\textfonts{%
  1998. \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
  1999. \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
  2000. \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
  2001. \let\tenttsl=\textttsl
  2002. \def\curfontsize{text}%
  2003. \def\lsize{reduced}\def\lllsize{smaller}%
  2004. \resetmathfonts \setleading{\textleading}}
  2005. \def\titlefonts{%
  2006. \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
  2007. \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
  2008. \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
  2009. \let\tenttsl=\titlettsl
  2010. \def\curfontsize{title}%
  2011. \def\lsize{chap}\def\lllsize{subsec}%
  2012. \resetmathfonts \setleading{27pt}}
  2013. \def\titlefont#1{{\titlefonts\rmisbold #1}}
  2014. \def\chapfonts{%
  2015. \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
  2016. \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
  2017. \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
  2018. \let\tenttsl=\chapttsl
  2019. \def\curfontsize{chap}%
  2020. \def\lsize{sec}\def\lllsize{text}%
  2021. \resetmathfonts \setleading{19pt}}
  2022. \def\secfonts{%
  2023. \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
  2024. \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
  2025. \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
  2026. \let\tenttsl=\secttsl
  2027. \def\curfontsize{sec}%
  2028. \def\lsize{subsec}\def\lllsize{reduced}%
  2029. \resetmathfonts \setleading{17pt}}
  2030. \def\subsecfonts{%
  2031. \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
  2032. \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
  2033. \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
  2034. \let\tenttsl=\ssecttsl
  2035. \def\curfontsize{ssec}%
  2036. \def\lsize{text}\def\lllsize{small}%
  2037. \resetmathfonts \setleading{15pt}}
  2038. \let\subsubsecfonts = \subsecfonts
  2039. \def\reducedfonts{%
  2040. \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl
  2041. \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc
  2042. \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy
  2043. \let\tenttsl=\reducedttsl
  2044. \def\curfontsize{reduced}%
  2045. \def\lsize{small}\def\lllsize{smaller}%
  2046. \resetmathfonts \setleading{10.5pt}}
  2047. \def\smallfonts{%
  2048. \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
  2049. \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
  2050. \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
  2051. \let\tenttsl=\smallttsl
  2052. \def\curfontsize{small}%
  2053. \def\lsize{smaller}\def\lllsize{smaller}%
  2054. \resetmathfonts \setleading{10.5pt}}
  2055. \def\smallerfonts{%
  2056. \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
  2057. \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
  2058. \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
  2059. \let\tenttsl=\smallerttsl
  2060. \def\curfontsize{smaller}%
  2061. \def\lsize{smaller}\def\lllsize{smaller}%
  2062. \resetmathfonts \setleading{9.5pt}}
  2063. % Fonts for short table of contents.
  2064. \setfont\shortcontrm\rmshape{12}{1000}{OT1}
  2065. \setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12
  2066. \setfont\shortcontsl\slshape{12}{1000}{OT1}
  2067. \setfont\shortconttt\ttshape{12}{1000}{OT1TT}
  2068. % Define these just so they can be easily changed for other fonts.
  2069. \def\angleleft{$\langle$}
  2070. \def\angleright{$\rangle$}
  2071. % Set the fonts to use with the @small... environments.
  2072. \let\smallexamplefonts = \smallfonts
  2073. % About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample
  2074. % can fit this many characters:
  2075. % 8.5x11=86 smallbook=72 a4=90 a5=69
  2076. % If we use \scriptfonts (8pt), then we can fit this many characters:
  2077. % 8.5x11=90+ smallbook=80 a4=90+ a5=77
  2078. % For me, subjectively, the few extra characters that fit aren't worth
  2079. % the additional smallness of 8pt. So I'm making the default 9pt.
  2080. %
  2081. % By the way, for comparison, here's what fits with @example (10pt):
  2082. % 8.5x11=71 smallbook=60 a4=75 a5=58
  2083. % --karl, 24jan03.
  2084. % Set up the default fonts, so we can use them for creating boxes.
  2085. %
  2086. \definetextfontsizexi
  2087. \message{markup,}
  2088. % Check if we are currently using a typewriter font. Since all the
  2089. % Computer Modern typewriter fonts have zero interword stretch (and
  2090. % shrink), and it is reasonable to expect all typewriter fonts to have
  2091. % this property, we can check that font parameter.
  2092. %
  2093. \def\ifmonospace{\ifdim\fontdimen3\font=0pt }
  2094. % Markup style infrastructure. \defmarkupstylesetup\INITMACRO will
  2095. % define and register \INITMACRO to be called on markup style changes.
  2096. % \INITMACRO can check \currentmarkupstyle for the innermost
  2097. % style and the set of \ifmarkupSTYLE switches for all styles
  2098. % currently in effect.
  2099. \newif\ifmarkupvar
  2100. \newif\ifmarkupsamp
  2101. \newif\ifmarkupkey
  2102. %\newif\ifmarkupfile % @file == @samp.
  2103. %\newif\ifmarkupoption % @option == @samp.
  2104. \newif\ifmarkupcode
  2105. \newif\ifmarkupkbd
  2106. %\newif\ifmarkupenv % @env == @code.
  2107. %\newif\ifmarkupcommand % @command == @code.
  2108. \newif\ifmarkuptex % @tex (and part of @math, for now).
  2109. \newif\ifmarkupexample
  2110. \newif\ifmarkupverb
  2111. \newif\ifmarkupverbatim
  2112. \let\currentmarkupstyle\empty
  2113. \def\setupmarkupstyle#1{%
  2114. \csname markup#1true\endcsname
  2115. \def\currentmarkupstyle{#1}%
  2116. \markupstylesetup
  2117. }
  2118. \let\markupstylesetup\empty
  2119. \def\defmarkupstylesetup#1{%
  2120. \expandafter\def\expandafter\markupstylesetup
  2121. \expandafter{\markupstylesetup #1}%
  2122. \def#1%
  2123. }
  2124. % Markup style setup for left and right quotes.
  2125. \defmarkupstylesetup\markupsetuplq{%
  2126. \expandafter\let\expandafter \temp
  2127. \csname markupsetuplq\currentmarkupstyle\endcsname
  2128. \ifx\temp\relax \markupsetuplqdefault \else \temp \fi
  2129. }
  2130. \defmarkupstylesetup\markupsetuprq{%
  2131. \expandafter\let\expandafter \temp
  2132. \csname markupsetuprq\currentmarkupstyle\endcsname
  2133. \ifx\temp\relax \markupsetuprqdefault \else \temp \fi
  2134. }
  2135. {
  2136. \catcode`\'=\active
  2137. \catcode`\`=\active
  2138. \gdef\markupsetuplqdefault{\let`\lq}
  2139. \gdef\markupsetuprqdefault{\let'\rq}
  2140. \gdef\markupsetcodequoteleft{\let`\codequoteleft}
  2141. \gdef\markupsetcodequoteright{\let'\codequoteright}
  2142. }
  2143. \let\markupsetuplqcode \markupsetcodequoteleft
  2144. \let\markupsetuprqcode \markupsetcodequoteright
  2145. %
  2146. \let\markupsetuplqexample \markupsetcodequoteleft
  2147. \let\markupsetuprqexample \markupsetcodequoteright
  2148. %
  2149. \let\markupsetuplqkbd \markupsetcodequoteleft
  2150. \let\markupsetuprqkbd \markupsetcodequoteright
  2151. %
  2152. \let\markupsetuplqsamp \markupsetcodequoteleft
  2153. \let\markupsetuprqsamp \markupsetcodequoteright
  2154. %
  2155. \let\markupsetuplqverb \markupsetcodequoteleft
  2156. \let\markupsetuprqverb \markupsetcodequoteright
  2157. %
  2158. \let\markupsetuplqverbatim \markupsetcodequoteleft
  2159. \let\markupsetuprqverbatim \markupsetcodequoteright
  2160. % Allow an option to not use regular directed right quote/apostrophe
  2161. % (char 0x27), but instead the undirected quote from cmtt (char 0x0d).
  2162. % The undirected quote is ugly, so don't make it the default, but it
  2163. % works for pasting with more pdf viewers (at least evince), the
  2164. % lilypond developers report. xpdf does work with the regular 0x27.
  2165. %
  2166. \def\codequoteright{%
  2167. \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
  2168. \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
  2169. '%
  2170. \else \char'15 \fi
  2171. \else \char'15 \fi
  2172. }
  2173. %
  2174. % and a similar option for the left quote char vs. a grave accent.
  2175. % Modern fonts display ASCII 0x60 as a grave accent, so some people like
  2176. % the code environments to do likewise.
  2177. %
  2178. \def\codequoteleft{%
  2179. \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
  2180. \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
  2181. % [Knuth] pp. 380,381,391
  2182. % \relax disables Spanish ligatures ?` and !` of \tt font.
  2183. \relax`%
  2184. \else \char'22 \fi
  2185. \else \char'22 \fi
  2186. }
  2187. % Commands to set the quote options.
  2188. %
  2189. \parseargdef\codequoteundirected{%
  2190. \def\temp{#1}%
  2191. \ifx\temp\onword
  2192. \expandafter\let\csname SETtxicodequoteundirected\endcsname
  2193. = t%
  2194. \else\ifx\temp\offword
  2195. \expandafter\let\csname SETtxicodequoteundirected\endcsname
  2196. = \relax
  2197. \else
  2198. \errhelp = \EMsimple
  2199. \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}%
  2200. \fi\fi
  2201. }
  2202. %
  2203. \parseargdef\codequotebacktick{%
  2204. \def\temp{#1}%
  2205. \ifx\temp\onword
  2206. \expandafter\let\csname SETtxicodequotebacktick\endcsname
  2207. = t%
  2208. \else\ifx\temp\offword
  2209. \expandafter\let\csname SETtxicodequotebacktick\endcsname
  2210. = \relax
  2211. \else
  2212. \errhelp = \EMsimple
  2213. \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}%
  2214. \fi\fi
  2215. }
  2216. % [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
  2217. \def\noligaturesquoteleft{\relax\lq}
  2218. % Count depth in font-changes, for error checks
  2219. \newcount\fontdepth \fontdepth=0
  2220. % Font commands.
  2221. % #1 is the font command (\sl or \it), #2 is the text to slant.
  2222. % If we are in a monospaced environment, however, 1) always use \ttsl,
  2223. % and 2) do not add an italic correction.
  2224. \def\dosmartslant#1#2{%
  2225. \ifusingtt
  2226. {{\ttsl #2}\let\next=\relax}%
  2227. {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}%
  2228. \next
  2229. }
  2230. \def\smartslanted{\dosmartslant\sl}
  2231. \def\smartitalic{\dosmartslant\it}
  2232. % Output an italic correction unless \next (presumed to be the following
  2233. % character) is such as not to need one.
  2234. \def\smartitaliccorrection{%
  2235. \ifx\next,%
  2236. \else\ifx\next-%
  2237. \else\ifx\next.%
  2238. \else\ifx\next\.%
  2239. \else\ifx\next\comma%
  2240. \else\ptexslash
  2241. \fi\fi\fi\fi\fi
  2242. \aftersmartic
  2243. }
  2244. % Unconditional use \ttsl, and no ic. @var is set to this for defuns.
  2245. \def\ttslanted#1{{\ttsl #1}}
  2246. % @cite is like \smartslanted except unconditionally use \sl. We never want
  2247. % ttsl for book titles, do we?
  2248. \def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection}
  2249. \def\aftersmartic{}
  2250. \def\var#1{%
  2251. \let\saveaftersmartic = \aftersmartic
  2252. \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}%
  2253. \smartslanted{#1}%
  2254. }
  2255. \let\i=\smartitalic
  2256. \let\slanted=\smartslanted
  2257. \let\dfn=\smartslanted
  2258. \let\emph=\smartitalic
  2259. % Explicit font changes: @r, @sc, undocumented @ii.
  2260. \def\r#1{{\rm #1}} % roman font
  2261. \def\sc#1{{\smallcaps#1}} % smallcaps font
  2262. \def\ii#1{{\it #1}} % italic font
  2263. % @b, explicit bold. Also @strong.
  2264. \def\b#1{{\bf #1}}
  2265. \let\strong=\b
  2266. % @sansserif, explicit sans.
  2267. \def\sansserif#1{{\sf #1}}
  2268. % We can't just use \exhyphenpenalty, because that only has effect at
  2269. % the end of a paragraph. Restore normal hyphenation at the end of the
  2270. % group within which \nohyphenation is presumably called.
  2271. %
  2272. \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
  2273. \def\restorehyphenation{\hyphenchar\font = `- }
  2274. % Set sfcode to normal for the chars that usually have another value.
  2275. % Can't use plain's \frenchspacing because it uses the `\x notation, and
  2276. % sometimes \x has an active definition that messes things up.
  2277. %
  2278. \catcode`@=11
  2279. \def\plainfrenchspacing{%
  2280. \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m
  2281. \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m
  2282. \def\endofsentencespacefactor{1000}% for @. and friends
  2283. }
  2284. \def\plainnonfrenchspacing{%
  2285. \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000
  2286. \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250
  2287. \def\endofsentencespacefactor{3000}% for @. and friends
  2288. }
  2289. \catcode`@=\other
  2290. \def\endofsentencespacefactor{3000}% default
  2291. % @t, explicit typewriter.
  2292. \def\t#1{%
  2293. {\tt \rawbackslash \plainfrenchspacing #1}%
  2294. \null
  2295. }
  2296. % @samp.
  2297. \def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}}
  2298. % @indicateurl is \samp, that is, with quotes.
  2299. \let\indicateurl=\samp
  2300. % @code (and similar) prints in typewriter, but with spaces the same
  2301. % size as normal in the surrounding text, without hyphenation, etc.
  2302. % This is a subroutine for that.
  2303. \def\tclose#1{%
  2304. {%
  2305. % Change normal interword space to be same as for the current font.
  2306. \spaceskip = \fontdimen2\font
  2307. %
  2308. % Switch to typewriter.
  2309. \tt
  2310. %
  2311. % But `\ ' produces the large typewriter interword space.
  2312. \def\ {{\spaceskip = 0pt{} }}%
  2313. %
  2314. % Turn off hyphenation.
  2315. \nohyphenation
  2316. %
  2317. \rawbackslash
  2318. \plainfrenchspacing
  2319. #1%
  2320. }%
  2321. \null % reset spacefactor to 1000
  2322. }
  2323. % We *must* turn on hyphenation at `-' and `_' in @code.
  2324. % (But see \codedashfinish below.)
  2325. % Otherwise, it is too hard to avoid overfull hboxes
  2326. % in the Emacs manual, the Library manual, etc.
  2327. %
  2328. % Unfortunately, TeX uses one parameter (\hyphenchar) to control
  2329. % both hyphenation at - and hyphenation within words.
  2330. % We must therefore turn them both off (\tclose does that)
  2331. % and arrange explicitly to hyphenate at a dash. -- rms.
  2332. {
  2333. \catcode`\-=\active \catcode`\_=\active
  2334. \catcode`\'=\active \catcode`\`=\active
  2335. \global\let'=\rq \global\let`=\lq % default definitions
  2336. %
  2337. \global\def\code{\begingroup
  2338. \setupmarkupstyle{code}%
  2339. % The following should really be moved into \setupmarkupstyle handlers.
  2340. \catcode\dashChar=\active \catcode\underChar=\active
  2341. \ifallowcodebreaks
  2342. \let-\codedash
  2343. \let_\codeunder
  2344. \else
  2345. \let-\normaldash
  2346. \let_\realunder
  2347. \fi
  2348. % Given -foo (with a single dash), we do not want to allow a break
  2349. % after the hyphen.
  2350. \global\let\codedashprev=\codedash
  2351. %
  2352. \codex
  2353. }
  2354. %
  2355. \gdef\codedash{\futurelet\next\codedashfinish}
  2356. \gdef\codedashfinish{%
  2357. \normaldash % always output the dash character itself.
  2358. %
  2359. % Now, output a discretionary to allow a line break, unless
  2360. % (a) the next character is a -, or
  2361. % (b) the preceding character is a -.
  2362. % E.g., given --posix, we do not want to allow a break after either -.
  2363. % Given --foo-bar, we do want to allow a break between the - and the b.
  2364. \ifx\next\codedash \else
  2365. \ifx\codedashprev\codedash
  2366. \else \discretionary{}{}{}\fi
  2367. \fi
  2368. % we need the space after the = for the case when \next itself is a
  2369. % space token; it would get swallowed otherwise. As in @code{- a}.
  2370. \global\let\codedashprev= \next
  2371. }
  2372. }
  2373. \def\normaldash{-}
  2374. %
  2375. \def\codex #1{\tclose{#1}\endgroup}
  2376. \def\codeunder{%
  2377. % this is all so @math{@code{var_name}+1} can work. In math mode, _
  2378. % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
  2379. % will therefore expand the active definition of _, which is us
  2380. % (inside @code that is), therefore an endless loop.
  2381. \ifusingtt{\ifmmode
  2382. \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
  2383. \else\normalunderscore \fi
  2384. \discretionary{}{}{}}%
  2385. {\_}%
  2386. }
  2387. % An additional complication: the above will allow breaks after, e.g.,
  2388. % each of the four underscores in __typeof__. This is bad.
  2389. % @allowcodebreaks provides a document-level way to turn breaking at -
  2390. % and _ on and off.
  2391. %
  2392. \newif\ifallowcodebreaks \allowcodebreakstrue
  2393. \def\keywordtrue{true}
  2394. \def\keywordfalse{false}
  2395. \parseargdef\allowcodebreaks{%
  2396. \def\txiarg{#1}%
  2397. \ifx\txiarg\keywordtrue
  2398. \allowcodebreakstrue
  2399. \else\ifx\txiarg\keywordfalse
  2400. \allowcodebreaksfalse
  2401. \else
  2402. \errhelp = \EMsimple
  2403. \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}%
  2404. \fi\fi
  2405. }
  2406. % For @command, @env, @file, @option quotes seem unnecessary,
  2407. % so use \code rather than \samp.
  2408. \let\command=\code
  2409. \let\env=\code
  2410. \let\file=\code
  2411. \let\option=\code
  2412. % @uref (abbreviation for `urlref') aka @url takes an optional
  2413. % (comma-separated) second argument specifying the text to display and
  2414. % an optional third arg as text to display instead of (rather than in
  2415. % addition to) the url itself. First (mandatory) arg is the url.
  2416. % TeX-only option to allow changing PDF output to show only the second
  2417. % arg (if given), and not the url (which is then just the link target).
  2418. \newif\ifurefurlonlylink
  2419. % The main macro is \urefbreak, which allows breaking at expected
  2420. % places within the url. (There used to be another version, which
  2421. % didn't support automatic breaking.)
  2422. \def\urefbreak{\begingroup \urefcatcodes \dourefbreak}
  2423. \let\uref=\urefbreak
  2424. %
  2425. \def\dourefbreak#1{\urefbreakfinish #1,,,\finish}
  2426. \def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example
  2427. \unsepspaces
  2428. \pdfurl{#1}%
  2429. \setbox0 = \hbox{\ignorespaces #3}%
  2430. \ifdim\wd0 > 0pt
  2431. \unhbox0 % third arg given, show only that
  2432. \else
  2433. \setbox0 = \hbox{\ignorespaces #2}% look for second arg
  2434. \ifdim\wd0 > 0pt
  2435. \ifpdf
  2436. \ifurefurlonlylink
  2437. % PDF plus option to not display url, show just arg
  2438. \unhbox0
  2439. \else
  2440. % PDF, normally display both arg and url for consistency,
  2441. % visibility, if the pdf is eventually used to print, etc.
  2442. \unhbox0\ (\urefcode{#1})%
  2443. \fi
  2444. \else
  2445. \unhbox0\ (\urefcode{#1})% DVI, always show arg and url
  2446. \fi
  2447. \else
  2448. \urefcode{#1}% only url given, so show it
  2449. \fi
  2450. \fi
  2451. \endlink
  2452. \endgroup}
  2453. % Allow line breaks around only a few characters (only).
  2454. \def\urefcatcodes{%
  2455. \catcode\ampChar=\active \catcode\dotChar=\active
  2456. \catcode\hashChar=\active \catcode\questChar=\active
  2457. \catcode\slashChar=\active
  2458. }
  2459. {
  2460. \urefcatcodes
  2461. %
  2462. \global\def\urefcode{\begingroup
  2463. \setupmarkupstyle{code}%
  2464. \urefcatcodes
  2465. \let&\urefcodeamp
  2466. \let.\urefcodedot
  2467. \let#\urefcodehash
  2468. \let?\urefcodequest
  2469. \let/\urefcodeslash
  2470. \codex
  2471. }
  2472. %
  2473. % By default, they are just regular characters.
  2474. \global\def&{\normalamp}
  2475. \global\def.{\normaldot}
  2476. \global\def#{\normalhash}
  2477. \global\def?{\normalquest}
  2478. \global\def/{\normalslash}
  2479. }
  2480. % we put a little stretch before and after the breakable chars, to help
  2481. % line breaking of long url's. The unequal skips make look better in
  2482. % cmtt at least, especially for dots.
  2483. \def\urefprestretchamount{.13em}
  2484. \def\urefpoststretchamount{.1em}
  2485. \def\urefprestretch{\urefprebreak \hskip0pt plus\urefprestretchamount\relax}
  2486. \def\urefpoststretch{\urefpostbreak \hskip0pt plus\urefprestretchamount\relax}
  2487. %
  2488. \def\urefcodeamp{\urefprestretch \&\urefpoststretch}
  2489. \def\urefcodedot{\urefprestretch .\urefpoststretch}
  2490. \def\urefcodehash{\urefprestretch \#\urefpoststretch}
  2491. \def\urefcodequest{\urefprestretch ?\urefpoststretch}
  2492. \def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
  2493. {
  2494. \catcode`\/=\active
  2495. \global\def\urefcodeslashfinish{%
  2496. \urefprestretch \slashChar
  2497. % Allow line break only after the final / in a sequence of
  2498. % slashes, to avoid line break between the slashes in http://.
  2499. \ifx\next/\else \urefpoststretch \fi
  2500. }
  2501. }
  2502. % One more complication: by default we'll break after the special
  2503. % characters, but some people like to break before the special chars, so
  2504. % allow that. Also allow no breaking at all, for manual control.
  2505. %
  2506. \parseargdef\urefbreakstyle{%
  2507. \def\txiarg{#1}%
  2508. \ifx\txiarg\wordnone
  2509. \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
  2510. \else\ifx\txiarg\wordbefore
  2511. \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak}
  2512. \else\ifx\txiarg\wordafter
  2513. \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak}
  2514. \else
  2515. \errhelp = \EMsimple
  2516. \errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
  2517. \fi\fi\fi
  2518. }
  2519. \def\wordafter{after}
  2520. \def\wordbefore{before}
  2521. \def\wordnone{none}
  2522. \urefbreakstyle after
  2523. % @url synonym for @uref, since that's how everyone uses it.
  2524. %
  2525. \let\url=\uref
  2526. % rms does not like angle brackets --karl, 17may97.
  2527. % So now @email is just like @uref, unless we are pdf.
  2528. %
  2529. %\def\email#1{\angleleft{\tt #1}\angleright}
  2530. \ifpdf
  2531. \def\email#1{\doemail#1,,\finish}
  2532. \def\doemail#1,#2,#3\finish{\begingroup
  2533. \unsepspaces
  2534. \pdfurl{mailto:#1}%
  2535. \setbox0 = \hbox{\ignorespaces #2}%
  2536. \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
  2537. \endlink
  2538. \endgroup}
  2539. \else
  2540. \let\email=\uref
  2541. \fi
  2542. % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
  2543. % `example' (@kbd uses ttsl only inside of @example and friends),
  2544. % or `code' (@kbd uses normal tty font always).
  2545. \parseargdef\kbdinputstyle{%
  2546. \def\txiarg{#1}%
  2547. \ifx\txiarg\worddistinct
  2548. \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
  2549. \else\ifx\txiarg\wordexample
  2550. \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
  2551. \else\ifx\txiarg\wordcode
  2552. \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
  2553. \else
  2554. \errhelp = \EMsimple
  2555. \errmessage{Unknown @kbdinputstyle setting `\txiarg'}%
  2556. \fi\fi\fi
  2557. }
  2558. \def\worddistinct{distinct}
  2559. \def\wordexample{example}
  2560. \def\wordcode{code}
  2561. % Default is `distinct'.
  2562. \kbdinputstyle distinct
  2563. % @kbd is like @code, except that if the argument is just one @key command,
  2564. % then @kbd has no effect.
  2565. \def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}}
  2566. \def\xkey{\key}
  2567. \def\kbdsub#1#2#3\par{%
  2568. \def\one{#1}\def\three{#3}\def\threex{??}%
  2569. \ifx\one\xkey\ifx\threex\three \key{#2}%
  2570. \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
  2571. \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
  2572. }
  2573. % definition of @key that produces a lozenge. Doesn't adjust to text size.
  2574. %\setfont\keyrm\rmshape{8}{1000}{OT1}
  2575. %\font\keysy=cmsy9
  2576. %\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
  2577. % \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
  2578. % \vbox{\hrule\kern-0.4pt
  2579. % \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
  2580. % \kern-0.4pt\hrule}%
  2581. % \kern-.06em\raise0.4pt\hbox{\angleright}}}}
  2582. % definition of @key with no lozenge. If the current font is already
  2583. % monospace, don't change it; that way, we respect @kbdinputstyle. But
  2584. % if it isn't monospace, then use \tt.
  2585. %
  2586. \def\key#1{{\setupmarkupstyle{key}%
  2587. \nohyphenation
  2588. \ifmonospace\else\tt\fi
  2589. #1}\null}
  2590. % @clicksequence{File @click{} Open ...}
  2591. \def\clicksequence#1{\begingroup #1\endgroup}
  2592. % @clickstyle @arrow (by default)
  2593. \parseargdef\clickstyle{\def\click{#1}}
  2594. \def\click{\arrow}
  2595. % Typeset a dimension, e.g., `in' or `pt'. The only reason for the
  2596. % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
  2597. %
  2598. \def\dmn#1{\thinspace #1}
  2599. % @acronym for "FBI", "NATO", and the like.
  2600. % We print this one point size smaller, since it's intended for
  2601. % all-uppercase.
  2602. %
  2603. \def\acronym#1{\doacronym #1,,\finish}
  2604. \def\doacronym#1,#2,#3\finish{%
  2605. {\selectfonts\lsize #1}%
  2606. \def\temp{#2}%
  2607. \ifx\temp\empty \else
  2608. \space ({\unsepspaces \ignorespaces \temp \unskip})%
  2609. \fi
  2610. \null % reset \spacefactor=1000
  2611. }
  2612. % @abbr for "Comput. J." and the like.
  2613. % No font change, but don't do end-of-sentence spacing.
  2614. %
  2615. \def\abbr#1{\doabbr #1,,\finish}
  2616. \def\doabbr#1,#2,#3\finish{%
  2617. {\plainfrenchspacing #1}%
  2618. \def\temp{#2}%
  2619. \ifx\temp\empty \else
  2620. \space ({\unsepspaces \ignorespaces \temp \unskip})%
  2621. \fi
  2622. \null % reset \spacefactor=1000
  2623. }
  2624. % @asis just yields its argument. Used with @table, for example.
  2625. %
  2626. \def\asis#1{#1}
  2627. % @math outputs its argument in math mode.
  2628. %
  2629. % One complication: _ usually means subscripts, but it could also mean
  2630. % an actual _ character, as in @math{@var{some_variable} + 1}. So make
  2631. % _ active, and distinguish by seeing if the current family is \slfam,
  2632. % which is what @var uses.
  2633. {
  2634. \catcode`\_ = \active
  2635. \gdef\mathunderscore{%
  2636. \catcode`\_=\active
  2637. \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
  2638. }
  2639. }
  2640. % Another complication: we want \\ (and @\) to output a math (or tt) \.
  2641. % FYI, plain.tex uses \\ as a temporary control sequence (for no
  2642. % particular reason), but this is not advertised and we don't care.
  2643. %
  2644. % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
  2645. \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
  2646. %
  2647. \def\math{%
  2648. \tex
  2649. \mathunderscore
  2650. \let\\ = \mathbackslash
  2651. \mathactive
  2652. % make the texinfo accent commands work in math mode
  2653. \let\"=\ddot
  2654. \let\'=\acute
  2655. \let\==\bar
  2656. \let\^=\hat
  2657. \let\`=\grave
  2658. \let\u=\breve
  2659. \let\v=\check
  2660. \let\~=\tilde
  2661. \let\dotaccent=\dot
  2662. % have to provide another name for sup operator
  2663. \let\mathopsup=\sup
  2664. $\finishmath
  2665. }
  2666. \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
  2667. % Some active characters (such as <) are spaced differently in math.
  2668. % We have to reset their definitions in case the @math was an argument
  2669. % to a command which sets the catcodes (such as @item or @section).
  2670. %
  2671. {
  2672. \catcode`^ = \active
  2673. \catcode`< = \active
  2674. \catcode`> = \active
  2675. \catcode`+ = \active
  2676. \catcode`' = \active
  2677. \gdef\mathactive{%
  2678. \let^ = \ptexhat
  2679. \let< = \ptexless
  2680. \let> = \ptexgtr
  2681. \let+ = \ptexplus
  2682. \let' = \ptexquoteright
  2683. }
  2684. }
  2685. % for @sub and @sup, if in math mode, just do a normal sub/superscript.
  2686. % If in text, use math to place as sub/superscript, but switch
  2687. % into text mode, with smaller fonts. This is a different font than the
  2688. % one used for real math sub/superscripts (8pt vs. 7pt), but let's not
  2689. % fix it (significant additions to font machinery) until someone notices.
  2690. %
  2691. \def\sub{\ifmmode \expandafter\sb \else \expandafter\finishsub\fi}
  2692. \def\finishsub#1{$\sb{\hbox{\selectfonts\lllsize #1}}$}%
  2693. %
  2694. \def\sup{\ifmmode \expandafter\ptexsp \else \expandafter\finishsup\fi}
  2695. \def\finishsup#1{$\ptexsp{\hbox{\selectfonts\lllsize #1}}$}%
  2696. % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
  2697. % Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
  2698. % except specified as a normal braced arg, so no newlines to worry about.
  2699. %
  2700. \def\outfmtnametex{tex}
  2701. %
  2702. \long\def\inlinefmt#1{\doinlinefmt #1,\finish}
  2703. \long\def\doinlinefmt#1,#2,\finish{%
  2704. \def\inlinefmtname{#1}%
  2705. \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
  2706. }
  2707. %
  2708. % @inlinefmtifelse{FMTNAME,THEN-TEXT,ELSE-TEXT} expands THEN-TEXT if
  2709. % FMTNAME is tex, else ELSE-TEXT.
  2710. \long\def\inlinefmtifelse#1{\doinlinefmtifelse #1,,,\finish}
  2711. \long\def\doinlinefmtifelse#1,#2,#3,#4,\finish{%
  2712. \def\inlinefmtname{#1}%
  2713. \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\else \ignorespaces #3\fi
  2714. }
  2715. %
  2716. % For raw, must switch into @tex before parsing the argument, to avoid
  2717. % setting catcodes prematurely. Doing it this way means that, for
  2718. % example, @inlineraw{html, foo{bar} gets a parse error instead of being
  2719. % ignored. But this isn't important because if people want a literal
  2720. % *right* brace they would have to use a command anyway, so they may as
  2721. % well use a command to get a left brace too. We could re-use the
  2722. % delimiter character idea from \verb, but it seems like overkill.
  2723. %
  2724. \long\def\inlineraw{\tex \doinlineraw}
  2725. \long\def\doinlineraw#1{\doinlinerawtwo #1,\finish}
  2726. \def\doinlinerawtwo#1,#2,\finish{%
  2727. \def\inlinerawname{#1}%
  2728. \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi
  2729. \endgroup % close group opened by \tex.
  2730. }
  2731. % @inlineifset{VAR, TEXT} expands TEXT if VAR is @set.
  2732. %
  2733. \long\def\inlineifset#1{\doinlineifset #1,\finish}
  2734. \long\def\doinlineifset#1,#2,\finish{%
  2735. \def\inlinevarname{#1}%
  2736. \expandafter\ifx\csname SET\inlinevarname\endcsname\relax
  2737. \else\ignorespaces#2\fi
  2738. }
  2739. % @inlineifclear{VAR, TEXT} expands TEXT if VAR is not @set.
  2740. %
  2741. \long\def\inlineifclear#1{\doinlineifclear #1,\finish}
  2742. \long\def\doinlineifclear#1,#2,\finish{%
  2743. \def\inlinevarname{#1}%
  2744. \expandafter\ifx\csname SET\inlinevarname\endcsname\relax \ignorespaces#2\fi
  2745. }
  2746. \message{glyphs,}
  2747. % and logos.
  2748. % @@ prints an @, as does @atchar{}.
  2749. \def\@{\char64 }
  2750. \let\atchar=\@
  2751. % @{ @} @lbracechar{} @rbracechar{} all generate brace characters.
  2752. % Unless we're in typewriter, use \ecfont because the CM text fonts do
  2753. % not have braces, and we don't want to switch into math.
  2754. \def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}}
  2755. \def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}}
  2756. \let\{=\mylbrace \let\lbracechar=\{
  2757. \let\}=\myrbrace \let\rbracechar=\}
  2758. \begingroup
  2759. % Definitions to produce \{ and \} commands for indices,
  2760. % and @{ and @} for the aux/toc files.
  2761. \catcode`\{ = \other \catcode`\} = \other
  2762. \catcode`\[ = 1 \catcode`\] = 2
  2763. \catcode`\! = 0 \catcode`\\ = \other
  2764. !gdef!lbracecmd[\{]%
  2765. !gdef!rbracecmd[\}]%
  2766. !gdef!lbraceatcmd[@{]%
  2767. !gdef!rbraceatcmd[@}]%
  2768. !endgroup
  2769. % @comma{} to avoid , parsing problems.
  2770. \let\comma = ,
  2771. % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
  2772. % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
  2773. \let\, = \ptexc
  2774. \let\dotaccent = \ptexdot
  2775. \def\ringaccent#1{{\accent23 #1}}
  2776. \let\tieaccent = \ptext
  2777. \let\ubaraccent = \ptexb
  2778. \let\udotaccent = \d
  2779. % Other special characters: @questiondown @exclamdown @ordf @ordm
  2780. % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
  2781. \def\questiondown{?`}
  2782. \def\exclamdown{!`}
  2783. \def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
  2784. \def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
  2785. % Dotless i and dotless j, used for accents.
  2786. \def\imacro{i}
  2787. \def\jmacro{j}
  2788. \def\dotless#1{%
  2789. \def\temp{#1}%
  2790. \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
  2791. \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
  2792. \else \errmessage{@dotless can be used only with i or j}%
  2793. \fi\fi
  2794. }
  2795. % The \TeX{} logo, as in plain, but resetting the spacing so that a
  2796. % period following counts as ending a sentence. (Idea found in latex.)
  2797. %
  2798. \edef\TeX{\TeX \spacefactor=1000 }
  2799. % @LaTeX{} logo. Not quite the same results as the definition in
  2800. % latex.ltx, since we use a different font for the raised A; it's most
  2801. % convenient for us to use an explicitly smaller font, rather than using
  2802. % the \scriptstyle font (since we don't reset \scriptstyle and
  2803. % \scriptscriptstyle).
  2804. %
  2805. \def\LaTeX{%
  2806. L\kern-.36em
  2807. {\setbox0=\hbox{T}%
  2808. \vbox to \ht0{\hbox{%
  2809. \ifx\textnominalsize\xwordpt
  2810. % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX.
  2811. % Revert to plain's \scriptsize, which is 7pt.
  2812. \count255=\the\fam $\fam\count255 \scriptstyle A$%
  2813. \else
  2814. % For 11pt, we can use our lllsize.
  2815. \selectfonts\lllsize A%
  2816. \fi
  2817. }%
  2818. \vss
  2819. }}%
  2820. \kern-.15em
  2821. \TeX
  2822. }
  2823. % Some math mode symbols. Define \ensuremath to switch into math mode
  2824. % unless we are already there. Expansion tricks may not be needed here,
  2825. % but safer, and can't hurt.
  2826. \def\ensuremath{\ifmmode \expandafter\asis \else\expandafter\ensuredmath \fi}
  2827. \def\ensuredmath#1{$\relax#1$}
  2828. %
  2829. \def\bullet{\ensuremath\ptexbullet}
  2830. \def\geq{\ensuremath\ge}
  2831. \def\leq{\ensuremath\le}
  2832. \def\minus{\ensuremath-}
  2833. % @dots{} outputs an ellipsis using the current font.
  2834. % We do .5em per period so that it has the same spacing in the cm
  2835. % typewriter fonts as three actual period characters; on the other hand,
  2836. % in other typewriter fonts three periods are wider than 1.5em. So do
  2837. % whichever is larger.
  2838. %
  2839. \def\dots{%
  2840. \leavevmode
  2841. \setbox0=\hbox{...}% get width of three periods
  2842. \ifdim\wd0 > 1.5em
  2843. \dimen0 = \wd0
  2844. \else
  2845. \dimen0 = 1.5em
  2846. \fi
  2847. \hbox to \dimen0{%
  2848. \hskip 0pt plus.25fil
  2849. .\hskip 0pt plus1fil
  2850. .\hskip 0pt plus1fil
  2851. .\hskip 0pt plus.5fil
  2852. }%
  2853. }
  2854. % @enddots{} is an end-of-sentence ellipsis.
  2855. %
  2856. \def\enddots{%
  2857. \dots
  2858. \spacefactor=\endofsentencespacefactor
  2859. }
  2860. % @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
  2861. %
  2862. % Since these characters are used in examples, they should be an even number of
  2863. % \tt widths. Each \tt character is 1en, so two makes it 1em.
  2864. %
  2865. \def\point{$\star$}
  2866. \def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}}
  2867. \def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
  2868. \def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}}
  2869. \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
  2870. \def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}}
  2871. % The @error{} command.
  2872. % Adapted from the TeXbook's \boxit.
  2873. %
  2874. \newbox\errorbox
  2875. %
  2876. {\tentt \global\dimen0 = 3em}% Width of the box.
  2877. \dimen2 = .55pt % Thickness of rules
  2878. % The text. (`r' is open on the right, `e' somewhat less so on the left.)
  2879. \setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt}
  2880. %
  2881. \setbox\errorbox=\hbox to \dimen0{\hfil
  2882. \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
  2883. \advance\hsize by -2\dimen2 % Rules.
  2884. \vbox{%
  2885. \hrule height\dimen2
  2886. \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
  2887. \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
  2888. \kern3pt\vrule width\dimen2}% Space to right.
  2889. \hrule height\dimen2}
  2890. \hfil}
  2891. %
  2892. \def\error{\leavevmode\lower.7ex\copy\errorbox}
  2893. % @pounds{} is a sterling sign, which Knuth put in the CM italic font.
  2894. %
  2895. \def\pounds{{\it\$}}
  2896. % @euro{} comes from a separate font, depending on the current style.
  2897. % We use the free feym* fonts from the eurosym package by Henrik
  2898. % Theiling, which support regular, slanted, bold and bold slanted (and
  2899. % "outlined" (blackboard board, sort of) versions, which we don't need).
  2900. % It is available from http://www.ctan.org/tex-archive/fonts/eurosym.
  2901. %
  2902. % Although only regular is the truly official Euro symbol, we ignore
  2903. % that. The Euro is designed to be slightly taller than the regular
  2904. % font height.
  2905. %
  2906. % feymr - regular
  2907. % feymo - slanted
  2908. % feybr - bold
  2909. % feybo - bold slanted
  2910. %
  2911. % There is no good (free) typewriter version, to my knowledge.
  2912. % A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
  2913. % Hmm.
  2914. %
  2915. % Also doesn't work in math. Do we need to do math with euro symbols?
  2916. % Hope not.
  2917. %
  2918. %
  2919. \def\euro{{\eurofont e}}
  2920. \def\eurofont{%
  2921. % We set the font at each command, rather than predefining it in
  2922. % \textfonts and the other font-switching commands, so that
  2923. % installations which never need the symbol don't have to have the
  2924. % font installed.
  2925. %
  2926. % There is only one designed size (nominal 10pt), so we always scale
  2927. % that to the current nominal size.
  2928. %
  2929. % By the way, simply using "at 1em" works for cmr10 and the like, but
  2930. % does not work for cmbx10 and other extended/shrunken fonts.
  2931. %
  2932. \def\eurosize{\csname\curfontsize nominalsize\endcsname}%
  2933. %
  2934. \ifx\curfontstyle\bfstylename
  2935. % bold:
  2936. \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
  2937. \else
  2938. % regular:
  2939. \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
  2940. \fi
  2941. \thiseurofont
  2942. }
  2943. % Glyphs from the EC fonts. We don't use \let for the aliases, because
  2944. % sometimes we redefine the original macro, and the alias should reflect
  2945. % the redefinition.
  2946. %
  2947. % Use LaTeX names for the Icelandic letters.
  2948. \def\DH{{\ecfont \char"D0}} % Eth
  2949. \def\dh{{\ecfont \char"F0}} % eth
  2950. \def\TH{{\ecfont \char"DE}} % Thorn
  2951. \def\th{{\ecfont \char"FE}} % thorn
  2952. %
  2953. \def\guillemetleft{{\ecfont \char"13}}
  2954. \def\guillemotleft{\guillemetleft}
  2955. \def\guillemetright{{\ecfont \char"14}}
  2956. \def\guillemotright{\guillemetright}
  2957. \def\guilsinglleft{{\ecfont \char"0E}}
  2958. \def\guilsinglright{{\ecfont \char"0F}}
  2959. \def\quotedblbase{{\ecfont \char"12}}
  2960. \def\quotesinglbase{{\ecfont \char"0D}}
  2961. %
  2962. % This positioning is not perfect (see the ogonek LaTeX package), but
  2963. % we have the precomposed glyphs for the most common cases. We put the
  2964. % tests to use those glyphs in the single \ogonek macro so we have fewer
  2965. % dummy definitions to worry about for index entries, etc.
  2966. %
  2967. % ogonek is also used with other letters in Lithuanian (IOU), but using
  2968. % the precomposed glyphs for those is not so easy since they aren't in
  2969. % the same EC font.
  2970. \def\ogonek#1{{%
  2971. \def\temp{#1}%
  2972. \ifx\temp\macrocharA\Aogonek
  2973. \else\ifx\temp\macrochara\aogonek
  2974. \else\ifx\temp\macrocharE\Eogonek
  2975. \else\ifx\temp\macrochare\eogonek
  2976. \else
  2977. \ecfont \setbox0=\hbox{#1}%
  2978. \ifdim\ht0=1ex\accent"0C #1%
  2979. \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}%
  2980. \fi
  2981. \fi\fi\fi\fi
  2982. }%
  2983. }
  2984. \def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A}
  2985. \def\aogonek{{\ecfont \char"A1}}\def\macrochara{a}
  2986. \def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E}
  2987. \def\eogonek{{\ecfont \char"A6}}\def\macrochare{e}
  2988. %
  2989. % Use the European Computer Modern fonts (cm-super in outline format)
  2990. % for non-CM glyphs. That is ec* for regular text and tc* for the text
  2991. % companion symbols (LaTeX TS1 encoding). Both are part of the ec
  2992. % package and follow the same conventions.
  2993. %
  2994. \def\ecfont{\etcfont{e}}
  2995. \def\tcfont{\etcfont{t}}
  2996. %
  2997. \def\etcfont#1{%
  2998. % We can't distinguish serif/sans and italic/slanted, but this
  2999. % is used for crude hacks anyway (like adding French and German
  3000. % quotes to documents typeset with CM, where we lose kerning), so
  3001. % hopefully nobody will notice/care.
  3002. \edef\ecsize{\csname\curfontsize ecsize\endcsname}%
  3003. \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
  3004. \ifmonospace
  3005. % typewriter:
  3006. \font\thisecfont = #1ctt\ecsize \space at \nominalsize
  3007. \else
  3008. \ifx\curfontstyle\bfstylename
  3009. % bold:
  3010. \font\thisecfont = #1cb\ifusingit{i}{x}\ecsize \space at \nominalsize
  3011. \else
  3012. % regular:
  3013. \font\thisecfont = #1c\ifusingit{ti}{rm}\ecsize \space at \nominalsize
  3014. \fi
  3015. \fi
  3016. \thisecfont
  3017. }
  3018. % @registeredsymbol - R in a circle. The font for the R should really
  3019. % be smaller yet, but lllsize is the best we can do for now.
  3020. % Adapted from the plain.tex definition of \copyright.
  3021. %
  3022. \def\registeredsymbol{%
  3023. $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}%
  3024. \hfil\crcr\Orb}}%
  3025. }$%
  3026. }
  3027. % @textdegree - the normal degrees sign.
  3028. %
  3029. \def\textdegree{$^\circ$}
  3030. % Laurent Siebenmann reports \Orb undefined with:
  3031. % Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38
  3032. % so we'll define it if necessary.
  3033. %
  3034. \ifx\Orb\thisisundefined
  3035. \def\Orb{\mathhexbox20D}
  3036. \fi
  3037. % Quotes.
  3038. \chardef\quotedblleft="5C
  3039. \chardef\quotedblright=`\"
  3040. \chardef\quoteleft=`\`
  3041. \chardef\quoteright=`\'
  3042. \message{page headings,}
  3043. \newskip\titlepagetopglue \titlepagetopglue = 1.5in
  3044. \newskip\titlepagebottomglue \titlepagebottomglue = 2pc
  3045. % First the title page. Must do @settitle before @titlepage.
  3046. \newif\ifseenauthor
  3047. \newif\iffinishedtitlepage
  3048. % Do an implicit @contents or @shortcontents after @end titlepage if the
  3049. % user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
  3050. %
  3051. \newif\ifsetcontentsaftertitlepage
  3052. \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
  3053. \newif\ifsetshortcontentsaftertitlepage
  3054. \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
  3055. \parseargdef\shorttitlepage{%
  3056. \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
  3057. \endgroup\page\hbox{}\page}
  3058. \envdef\titlepage{%
  3059. % Open one extra group, as we want to close it in the middle of \Etitlepage.
  3060. \begingroup
  3061. \parindent=0pt \textfonts
  3062. % Leave some space at the very top of the page.
  3063. \vglue\titlepagetopglue
  3064. % No rule at page bottom unless we print one at the top with @title.
  3065. \finishedtitlepagetrue
  3066. %
  3067. % Most title ``pages'' are actually two pages long, with space
  3068. % at the top of the second. We don't want the ragged left on the second.
  3069. \let\oldpage = \page
  3070. \def\page{%
  3071. \iffinishedtitlepage\else
  3072. \finishtitlepage
  3073. \fi
  3074. \let\page = \oldpage
  3075. \page
  3076. \null
  3077. }%
  3078. }
  3079. \def\Etitlepage{%
  3080. \iffinishedtitlepage\else
  3081. \finishtitlepage
  3082. \fi
  3083. % It is important to do the page break before ending the group,
  3084. % because the headline and footline are only empty inside the group.
  3085. % If we use the new definition of \page, we always get a blank page
  3086. % after the title page, which we certainly don't want.
  3087. \oldpage
  3088. \endgroup
  3089. %
  3090. % Need this before the \...aftertitlepage checks so that if they are
  3091. % in effect the toc pages will come out with page numbers.
  3092. \HEADINGSon
  3093. %
  3094. % If they want short, they certainly want long too.
  3095. \ifsetshortcontentsaftertitlepage
  3096. \shortcontents
  3097. \contents
  3098. \global\let\shortcontents = \relax
  3099. \global\let\contents = \relax
  3100. \fi
  3101. %
  3102. \ifsetcontentsaftertitlepage
  3103. \contents
  3104. \global\let\contents = \relax
  3105. \global\let\shortcontents = \relax
  3106. \fi
  3107. }
  3108. \def\finishtitlepage{%
  3109. \vskip4pt \hrule height 2pt width \hsize
  3110. \vskip\titlepagebottomglue
  3111. \finishedtitlepagetrue
  3112. }
  3113. % Settings used for typesetting titles: no hyphenation, no indentation,
  3114. % don't worry much about spacing, ragged right. This should be used
  3115. % inside a \vbox, and fonts need to be set appropriately first. Because
  3116. % it is always used for titles, nothing else, we call \rmisbold. \par
  3117. % should be specified before the end of the \vbox, since a vbox is a group.
  3118. %
  3119. \def\raggedtitlesettings{%
  3120. \rmisbold
  3121. \hyphenpenalty=10000
  3122. \parindent=0pt
  3123. \tolerance=5000
  3124. \ptexraggedright
  3125. }
  3126. % Macros to be used within @titlepage:
  3127. \let\subtitlerm=\tenrm
  3128. \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
  3129. \parseargdef\title{%
  3130. \checkenv\titlepage
  3131. \vbox{\titlefonts \raggedtitlesettings #1\par}%
  3132. % print a rule at the page bottom also.
  3133. \finishedtitlepagefalse
  3134. \vskip4pt \hrule height 4pt width \hsize \vskip4pt
  3135. }
  3136. \parseargdef\subtitle{%
  3137. \checkenv\titlepage
  3138. {\subtitlefont \rightline{#1}}%
  3139. }
  3140. % @author should come last, but may come many times.
  3141. % It can also be used inside @quotation.
  3142. %
  3143. \parseargdef\author{%
  3144. \def\temp{\quotation}%
  3145. \ifx\thisenv\temp
  3146. \def\quotationauthor{#1}% printed in \Equotation.
  3147. \else
  3148. \checkenv\titlepage
  3149. \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
  3150. {\secfonts\rmisbold \leftline{#1}}%
  3151. \fi
  3152. }
  3153. % Set up page headings and footings.
  3154. \let\thispage=\folio
  3155. \newtoks\evenheadline % headline on even pages
  3156. \newtoks\oddheadline % headline on odd pages
  3157. \newtoks\evenfootline % footline on even pages
  3158. \newtoks\oddfootline % footline on odd pages
  3159. % Now make \makeheadline and \makefootline in Plain TeX use those variables
  3160. \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
  3161. \else \the\evenheadline \fi}}
  3162. \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
  3163. \else \the\evenfootline \fi}\HEADINGShook}
  3164. \let\HEADINGShook=\relax
  3165. % Commands to set those variables.
  3166. % For example, this is what @headings on does
  3167. % @evenheading @thistitle|@thispage|@thischapter
  3168. % @oddheading @thischapter|@thispage|@thistitle
  3169. % @evenfooting @thisfile||
  3170. % @oddfooting ||@thisfile
  3171. \def\evenheading{\parsearg\evenheadingxxx}
  3172. \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
  3173. \def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
  3174. \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  3175. \def\oddheading{\parsearg\oddheadingxxx}
  3176. \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
  3177. \def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
  3178. \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  3179. \parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
  3180. \def\evenfooting{\parsearg\evenfootingxxx}
  3181. \def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}
  3182. \def\evenfootingyyy #1\|#2\|#3\|#4\finish{%
  3183. \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  3184. \def\oddfooting{\parsearg\oddfootingxxx}
  3185. \def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}
  3186. \def\oddfootingyyy #1\|#2\|#3\|#4\finish{%
  3187. \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
  3188. %
  3189. % Leave some space for the footline. Hopefully ok to assume
  3190. % @evenfooting will not be used by itself.
  3191. \global\advance\pageheight by -12pt
  3192. \global\advance\vsize by -12pt
  3193. }
  3194. \parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
  3195. % @evenheadingmarks top \thischapter <- chapter at the top of a page
  3196. % @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page
  3197. %
  3198. % The same set of arguments for:
  3199. %
  3200. % @oddheadingmarks
  3201. % @evenfootingmarks
  3202. % @oddfootingmarks
  3203. % @everyheadingmarks
  3204. % @everyfootingmarks
  3205. % These define \getoddheadingmarks, \getevenheadingmarks,
  3206. % \getoddfootingmarks, and \getevenfootingmarks, each to one of
  3207. % \gettopheadingmarks, \getbottomheadingmarks.
  3208. %
  3209. \def\evenheadingmarks{\headingmarks{even}{heading}}
  3210. \def\oddheadingmarks{\headingmarks{odd}{heading}}
  3211. \def\evenfootingmarks{\headingmarks{even}{footing}}
  3212. \def\oddfootingmarks{\headingmarks{odd}{footing}}
  3213. \def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1}
  3214. \headingmarks{odd}{heading}{#1} }
  3215. \def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1}
  3216. \headingmarks{odd}{footing}{#1} }
  3217. % #1 = even/odd, #2 = heading/footing, #3 = top/bottom.
  3218. \def\headingmarks#1#2#3 {%
  3219. \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname
  3220. \global\expandafter\let\csname get#1#2marks\endcsname \temp
  3221. }
  3222. \everyheadingmarks bottom
  3223. \everyfootingmarks bottom
  3224. % @headings double turns headings on for double-sided printing.
  3225. % @headings single turns headings on for single-sided printing.
  3226. % @headings off turns them off.
  3227. % @headings on same as @headings double, retained for compatibility.
  3228. % @headings after turns on double-sided headings after this page.
  3229. % @headings doubleafter turns on double-sided headings after this page.
  3230. % @headings singleafter turns on single-sided headings after this page.
  3231. % By default, they are off at the start of a document,
  3232. % and turned `on' after @end titlepage.
  3233. \def\headings #1 {\csname HEADINGS#1\endcsname}
  3234. \def\headingsoff{% non-global headings elimination
  3235. \evenheadline={\hfil}\evenfootline={\hfil}%
  3236. \oddheadline={\hfil}\oddfootline={\hfil}%
  3237. }
  3238. \def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
  3239. \HEADINGSoff % it's the default
  3240. % When we turn headings on, set the page number to 1.
  3241. % For double-sided printing, put current file name in lower left corner,
  3242. % chapter name on inside top of right hand pages, document
  3243. % title on inside top of left hand pages, and page numbers on outside top
  3244. % edge of all pages.
  3245. \def\HEADINGSdouble{%
  3246. \global\pageno=1
  3247. \global\evenfootline={\hfil}
  3248. \global\oddfootline={\hfil}
  3249. \global\evenheadline={\line{\folio\hfil\thistitle}}
  3250. \global\oddheadline={\line{\thischapter\hfil\folio}}
  3251. \global\let\contentsalignmacro = \chapoddpage
  3252. }
  3253. \let\contentsalignmacro = \chappager
  3254. % For single-sided printing, chapter title goes across top left of page,
  3255. % page number on top right.
  3256. \def\HEADINGSsingle{%
  3257. \global\pageno=1
  3258. \global\evenfootline={\hfil}
  3259. \global\oddfootline={\hfil}
  3260. \global\evenheadline={\line{\thischapter\hfil\folio}}
  3261. \global\oddheadline={\line{\thischapter\hfil\folio}}
  3262. \global\let\contentsalignmacro = \chappager
  3263. }
  3264. \def\HEADINGSon{\HEADINGSdouble}
  3265. \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
  3266. \let\HEADINGSdoubleafter=\HEADINGSafter
  3267. \def\HEADINGSdoublex{%
  3268. \global\evenfootline={\hfil}
  3269. \global\oddfootline={\hfil}
  3270. \global\evenheadline={\line{\folio\hfil\thistitle}}
  3271. \global\oddheadline={\line{\thischapter\hfil\folio}}
  3272. \global\let\contentsalignmacro = \chapoddpage
  3273. }
  3274. \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
  3275. \def\HEADINGSsinglex{%
  3276. \global\evenfootline={\hfil}
  3277. \global\oddfootline={\hfil}
  3278. \global\evenheadline={\line{\thischapter\hfil\folio}}
  3279. \global\oddheadline={\line{\thischapter\hfil\folio}}
  3280. \global\let\contentsalignmacro = \chappager
  3281. }
  3282. % Subroutines used in generating headings
  3283. % This produces Day Month Year style of output.
  3284. % Only define if not already defined, in case a txi-??.tex file has set
  3285. % up a different format (e.g., txi-cs.tex does this).
  3286. \ifx\today\thisisundefined
  3287. \def\today{%
  3288. \number\day\space
  3289. \ifcase\month
  3290. \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
  3291. \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
  3292. \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
  3293. \fi
  3294. \space\number\year}
  3295. \fi
  3296. % @settitle line... specifies the title of the document, for headings.
  3297. % It generates no output of its own.
  3298. \def\thistitle{\putwordNoTitle}
  3299. \def\settitle{\parsearg{\gdef\thistitle}}
  3300. \message{tables,}
  3301. % Tables -- @table, @ftable, @vtable, @item(x).
  3302. % default indentation of table text
  3303. \newdimen\tableindent \tableindent=.8in
  3304. % default indentation of @itemize and @enumerate text
  3305. \newdimen\itemindent \itemindent=.3in
  3306. % margin between end of table item and start of table text.
  3307. \newdimen\itemmargin \itemmargin=.1in
  3308. % used internally for \itemindent minus \itemmargin
  3309. \newdimen\itemmax
  3310. % Note @table, @ftable, and @vtable define @item, @itemx, etc., with
  3311. % these defs.
  3312. % They also define \itemindex
  3313. % to index the item name in whatever manner is desired (perhaps none).
  3314. \newif\ifitemxneedsnegativevskip
  3315. \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
  3316. \def\internalBitem{\smallbreak \parsearg\itemzzz}
  3317. \def\internalBitemx{\itemxpar \parsearg\itemzzz}
  3318. \def\itemzzz #1{\begingroup %
  3319. \advance\hsize by -\rightskip
  3320. \advance\hsize by -\tableindent
  3321. \setbox0=\hbox{\itemindicate{#1}}%
  3322. \itemindex{#1}%
  3323. \nobreak % This prevents a break before @itemx.
  3324. %
  3325. % If the item text does not fit in the space we have, put it on a line
  3326. % by itself, and do not allow a page break either before or after that
  3327. % line. We do not start a paragraph here because then if the next
  3328. % command is, e.g., @kindex, the whatsit would get put into the
  3329. % horizontal list on a line by itself, resulting in extra blank space.
  3330. \ifdim \wd0>\itemmax
  3331. %
  3332. % Make this a paragraph so we get the \parskip glue and wrapping,
  3333. % but leave it ragged-right.
  3334. \begingroup
  3335. \advance\leftskip by-\tableindent
  3336. \advance\hsize by\tableindent
  3337. \advance\rightskip by0pt plus1fil\relax
  3338. \leavevmode\unhbox0\par
  3339. \endgroup
  3340. %
  3341. % We're going to be starting a paragraph, but we don't want the
  3342. % \parskip glue -- logically it's part of the @item we just started.
  3343. \nobreak \vskip-\parskip
  3344. %
  3345. % Stop a page break at the \parskip glue coming up. However, if
  3346. % what follows is an environment such as @example, there will be no
  3347. % \parskip glue; then the negative vskip we just inserted would
  3348. % cause the example and the item to crash together. So we use this
  3349. % bizarre value of 10001 as a signal to \aboveenvbreak to insert
  3350. % \parskip glue after all. Section titles are handled this way also.
  3351. %
  3352. \penalty 10001
  3353. \endgroup
  3354. \itemxneedsnegativevskipfalse
  3355. \else
  3356. % The item text fits into the space. Start a paragraph, so that the
  3357. % following text (if any) will end up on the same line.
  3358. \noindent
  3359. % Do this with kerns and \unhbox so that if there is a footnote in
  3360. % the item text, it can migrate to the main vertical list and
  3361. % eventually be printed.
  3362. \nobreak\kern-\tableindent
  3363. \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
  3364. \unhbox0
  3365. \nobreak\kern\dimen0
  3366. \endgroup
  3367. \itemxneedsnegativevskiptrue
  3368. \fi
  3369. }
  3370. \def\item{\errmessage{@item while not in a list environment}}
  3371. \def\itemx{\errmessage{@itemx while not in a list environment}}
  3372. % @table, @ftable, @vtable.
  3373. \envdef\table{%
  3374. \let\itemindex\gobble
  3375. \tablecheck{table}%
  3376. }
  3377. \envdef\ftable{%
  3378. \def\itemindex ##1{\doind {fn}{\code{##1}}}%
  3379. \tablecheck{ftable}%
  3380. }
  3381. \envdef\vtable{%
  3382. \def\itemindex ##1{\doind {vr}{\code{##1}}}%
  3383. \tablecheck{vtable}%
  3384. }
  3385. \def\tablecheck#1{%
  3386. \ifnum \the\catcode`\^^M=\active
  3387. \endgroup
  3388. \errmessage{This command won't work in this context; perhaps the problem is
  3389. that we are \inenvironment\thisenv}%
  3390. \def\next{\doignore{#1}}%
  3391. \else
  3392. \let\next\tablex
  3393. \fi
  3394. \next
  3395. }
  3396. \def\tablex#1{%
  3397. \def\itemindicate{#1}%
  3398. \parsearg\tabley
  3399. }
  3400. \def\tabley#1{%
  3401. {%
  3402. \makevalueexpandable
  3403. \edef\temp{\noexpand\tablez #1\space\space\space}%
  3404. \expandafter
  3405. }\temp \endtablez
  3406. }
  3407. \def\tablez #1 #2 #3 #4\endtablez{%
  3408. \aboveenvbreak
  3409. \ifnum 0#1>0 \advance \leftskip by #1\mil \fi
  3410. \ifnum 0#2>0 \tableindent=#2\mil \fi
  3411. \ifnum 0#3>0 \advance \rightskip by #3\mil \fi
  3412. \itemmax=\tableindent
  3413. \advance \itemmax by -\itemmargin
  3414. \advance \leftskip by \tableindent
  3415. \exdentamount=\tableindent
  3416. \parindent = 0pt
  3417. \parskip = \smallskipamount
  3418. \ifdim \parskip=0pt \parskip=2pt \fi
  3419. \let\item = \internalBitem
  3420. \let\itemx = \internalBitemx
  3421. }
  3422. \def\Etable{\endgraf\afterenvbreak}
  3423. \let\Eftable\Etable
  3424. \let\Evtable\Etable
  3425. \let\Eitemize\Etable
  3426. \let\Eenumerate\Etable
  3427. % This is the counter used by @enumerate, which is really @itemize
  3428. \newcount \itemno
  3429. \envdef\itemize{\parsearg\doitemize}
  3430. \def\doitemize#1{%
  3431. \aboveenvbreak
  3432. \itemmax=\itemindent
  3433. \advance\itemmax by -\itemmargin
  3434. \advance\leftskip by \itemindent
  3435. \exdentamount=\itemindent
  3436. \parindent=0pt
  3437. \parskip=\smallskipamount
  3438. \ifdim\parskip=0pt \parskip=2pt \fi
  3439. %
  3440. % Try typesetting the item mark so that if the document erroneously says
  3441. % something like @itemize @samp (intending @table), there's an error
  3442. % right away at the @itemize. It's not the best error message in the
  3443. % world, but it's better than leaving it to the @item. This means if
  3444. % the user wants an empty mark, they have to say @w{} not just @w.
  3445. \def\itemcontents{#1}%
  3446. \setbox0 = \hbox{\itemcontents}%
  3447. %
  3448. % @itemize with no arg is equivalent to @itemize @bullet.
  3449. \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
  3450. %
  3451. \let\item=\itemizeitem
  3452. }
  3453. % Definition of @item while inside @itemize and @enumerate.
  3454. %
  3455. \def\itemizeitem{%
  3456. \advance\itemno by 1 % for enumerations
  3457. {\let\par=\endgraf \smallbreak}% reasonable place to break
  3458. {%
  3459. % If the document has an @itemize directly after a section title, a
  3460. % \nobreak will be last on the list, and \sectionheading will have
  3461. % done a \vskip-\parskip. In that case, we don't want to zero
  3462. % parskip, or the item text will crash with the heading. On the
  3463. % other hand, when there is normal text preceding the item (as there
  3464. % usually is), we do want to zero parskip, or there would be too much
  3465. % space. In that case, we won't have a \nobreak before. At least
  3466. % that's the theory.
  3467. \ifnum\lastpenalty<10000 \parskip=0in \fi
  3468. \noindent
  3469. \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
  3470. %
  3471. \ifinner\else
  3472. \vadjust{\penalty 1200}% not good to break after first line of item.
  3473. \fi
  3474. % We can be in inner vertical mode in a footnote, although an
  3475. % @itemize looks awful there.
  3476. }%
  3477. \flushcr
  3478. }
  3479. % \splitoff TOKENS\endmark defines \first to be the first token in
  3480. % TOKENS, and \rest to be the remainder.
  3481. %
  3482. \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
  3483. % Allow an optional argument of an uppercase letter, lowercase letter,
  3484. % or number, to specify the first label in the enumerated list. No
  3485. % argument is the same as `1'.
  3486. %
  3487. \envparseargdef\enumerate{\enumeratey #1 \endenumeratey}
  3488. \def\enumeratey #1 #2\endenumeratey{%
  3489. % If we were given no argument, pretend we were given `1'.
  3490. \def\thearg{#1}%
  3491. \ifx\thearg\empty \def\thearg{1}\fi
  3492. %
  3493. % Detect if the argument is a single token. If so, it might be a
  3494. % letter. Otherwise, the only valid thing it can be is a number.
  3495. % (We will always have one token, because of the test we just made.
  3496. % This is a good thing, since \splitoff doesn't work given nothing at
  3497. % all -- the first parameter is undelimited.)
  3498. \expandafter\splitoff\thearg\endmark
  3499. \ifx\rest\empty
  3500. % Only one token in the argument. It could still be anything.
  3501. % A ``lowercase letter'' is one whose \lccode is nonzero.
  3502. % An ``uppercase letter'' is one whose \lccode is both nonzero, and
  3503. % not equal to itself.
  3504. % Otherwise, we assume it's a number.
  3505. %
  3506. % We need the \relax at the end of the \ifnum lines to stop TeX from
  3507. % continuing to look for a <number>.
  3508. %
  3509. \ifnum\lccode\expandafter`\thearg=0\relax
  3510. \numericenumerate % a number (we hope)
  3511. \else
  3512. % It's a letter.
  3513. \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
  3514. \lowercaseenumerate % lowercase letter
  3515. \else
  3516. \uppercaseenumerate % uppercase letter
  3517. \fi
  3518. \fi
  3519. \else
  3520. % Multiple tokens in the argument. We hope it's a number.
  3521. \numericenumerate
  3522. \fi
  3523. }
  3524. % An @enumerate whose labels are integers. The starting integer is
  3525. % given in \thearg.
  3526. %
  3527. \def\numericenumerate{%
  3528. \itemno = \thearg
  3529. \startenumeration{\the\itemno}%
  3530. }
  3531. % The starting (lowercase) letter is in \thearg.
  3532. \def\lowercaseenumerate{%
  3533. \itemno = \expandafter`\thearg
  3534. \startenumeration{%
  3535. % Be sure we're not beyond the end of the alphabet.
  3536. \ifnum\itemno=0
  3537. \errmessage{No more lowercase letters in @enumerate; get a bigger
  3538. alphabet}%
  3539. \fi
  3540. \char\lccode\itemno
  3541. }%
  3542. }
  3543. % The starting (uppercase) letter is in \thearg.
  3544. \def\uppercaseenumerate{%
  3545. \itemno = \expandafter`\thearg
  3546. \startenumeration{%
  3547. % Be sure we're not beyond the end of the alphabet.
  3548. \ifnum\itemno=0
  3549. \errmessage{No more uppercase letters in @enumerate; get a bigger
  3550. alphabet}
  3551. \fi
  3552. \char\uccode\itemno
  3553. }%
  3554. }
  3555. % Call \doitemize, adding a period to the first argument and supplying the
  3556. % common last two arguments. Also subtract one from the initial value in
  3557. % \itemno, since @item increments \itemno.
  3558. %
  3559. \def\startenumeration#1{%
  3560. \advance\itemno by -1
  3561. \doitemize{#1.}\flushcr
  3562. }
  3563. % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
  3564. % to @enumerate.
  3565. %
  3566. \def\alphaenumerate{\enumerate{a}}
  3567. \def\capsenumerate{\enumerate{A}}
  3568. \def\Ealphaenumerate{\Eenumerate}
  3569. \def\Ecapsenumerate{\Eenumerate}
  3570. % @multitable macros
  3571. % Amy Hendrickson, 8/18/94, 3/6/96
  3572. %
  3573. % @multitable ... @end multitable will make as many columns as desired.
  3574. % Contents of each column will wrap at width given in preamble. Width
  3575. % can be specified either with sample text given in a template line,
  3576. % or in percent of \hsize, the current width of text on page.
  3577. % Table can continue over pages but will only break between lines.
  3578. % To make preamble:
  3579. %
  3580. % Either define widths of columns in terms of percent of \hsize:
  3581. % @multitable @columnfractions .25 .3 .45
  3582. % @item ...
  3583. %
  3584. % Numbers following @columnfractions are the percent of the total
  3585. % current hsize to be used for each column. You may use as many
  3586. % columns as desired.
  3587. % Or use a template:
  3588. % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
  3589. % @item ...
  3590. % using the widest term desired in each column.
  3591. % Each new table line starts with @item, each subsequent new column
  3592. % starts with @tab. Empty columns may be produced by supplying @tab's
  3593. % with nothing between them for as many times as empty columns are needed,
  3594. % ie, @tab@tab@tab will produce two empty columns.
  3595. % @item, @tab do not need to be on their own lines, but it will not hurt
  3596. % if they are.
  3597. % Sample multitable:
  3598. % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
  3599. % @item first col stuff @tab second col stuff @tab third col
  3600. % @item
  3601. % first col stuff
  3602. % @tab
  3603. % second col stuff
  3604. % @tab
  3605. % third col
  3606. % @item first col stuff @tab second col stuff
  3607. % @tab Many paragraphs of text may be used in any column.
  3608. %
  3609. % They will wrap at the width determined by the template.
  3610. % @item@tab@tab This will be in third column.
  3611. % @end multitable
  3612. % Default dimensions may be reset by user.
  3613. % @multitableparskip is vertical space between paragraphs in table.
  3614. % @multitableparindent is paragraph indent in table.
  3615. % @multitablecolmargin is horizontal space to be left between columns.
  3616. % @multitablelinespace is space to leave between table items, baseline
  3617. % to baseline.
  3618. % 0pt means it depends on current normal line spacing.
  3619. %
  3620. \newskip\multitableparskip
  3621. \newskip\multitableparindent
  3622. \newdimen\multitablecolspace
  3623. \newskip\multitablelinespace
  3624. \multitableparskip=0pt
  3625. \multitableparindent=6pt
  3626. \multitablecolspace=12pt
  3627. \multitablelinespace=0pt
  3628. % Macros used to set up halign preamble:
  3629. %
  3630. \let\endsetuptable\relax
  3631. \def\xendsetuptable{\endsetuptable}
  3632. \let\columnfractions\relax
  3633. \def\xcolumnfractions{\columnfractions}
  3634. \newif\ifsetpercent
  3635. % #1 is the @columnfraction, usually a decimal number like .5, but might
  3636. % be just 1. We just use it, whatever it is.
  3637. %
  3638. \def\pickupwholefraction#1 {%
  3639. \global\advance\colcount by 1
  3640. \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}%
  3641. \setuptable
  3642. }
  3643. \newcount\colcount
  3644. \def\setuptable#1{%
  3645. \def\firstarg{#1}%
  3646. \ifx\firstarg\xendsetuptable
  3647. \let\go = \relax
  3648. \else
  3649. \ifx\firstarg\xcolumnfractions
  3650. \global\setpercenttrue
  3651. \else
  3652. \ifsetpercent
  3653. \let\go\pickupwholefraction
  3654. \else
  3655. \global\advance\colcount by 1
  3656. \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
  3657. % separator; typically that is always in the input, anyway.
  3658. \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
  3659. \fi
  3660. \fi
  3661. \ifx\go\pickupwholefraction
  3662. % Put the argument back for the \pickupwholefraction call, so
  3663. % we'll always have a period there to be parsed.
  3664. \def\go{\pickupwholefraction#1}%
  3665. \else
  3666. \let\go = \setuptable
  3667. \fi%
  3668. \fi
  3669. \go
  3670. }
  3671. % multitable-only commands.
  3672. %
  3673. % @headitem starts a heading row, which we typeset in bold. Assignments
  3674. % have to be global since we are inside the implicit group of an
  3675. % alignment entry. \everycr below resets \everytab so we don't have to
  3676. % undo it ourselves.
  3677. \def\headitemfont{\b}% for people to use in the template row; not changeable
  3678. \def\headitem{%
  3679. \checkenv\multitable
  3680. \crcr
  3681. \gdef\headitemcrhook{\nobreak}% attempt to avoid page break after headings
  3682. \global\everytab={\bf}% can't use \headitemfont since the parsing differs
  3683. \the\everytab % for the first item
  3684. }%
  3685. %
  3686. % default for tables with no headings.
  3687. \let\headitemcrhook=\relax
  3688. %
  3689. % A \tab used to include \hskip1sp. But then the space in a template
  3690. % line is not enough. That is bad. So let's go back to just `&' until
  3691. % we again encounter the problem the 1sp was intended to solve.
  3692. % --karl, nathan@acm.org, 20apr99.
  3693. \def\tab{\checkenv\multitable &\the\everytab}%
  3694. % @multitable ... @end multitable definitions:
  3695. %
  3696. \newtoks\everytab % insert after every tab.
  3697. %
  3698. \envdef\multitable{%
  3699. \vskip\parskip
  3700. \startsavinginserts
  3701. %
  3702. % @item within a multitable starts a normal row.
  3703. % We use \def instead of \let so that if one of the multitable entries
  3704. % contains an @itemize, we don't choke on the \item (seen as \crcr aka
  3705. % \endtemplate) expanding \doitemize.
  3706. \def\item{\crcr}%
  3707. %
  3708. \tolerance=9500
  3709. \hbadness=9500
  3710. \setmultitablespacing
  3711. \parskip=\multitableparskip
  3712. \parindent=\multitableparindent
  3713. \overfullrule=0pt
  3714. \global\colcount=0
  3715. %
  3716. \everycr = {%
  3717. \noalign{%
  3718. \global\everytab={}% Reset from possible headitem.
  3719. \global\colcount=0 % Reset the column counter.
  3720. %
  3721. % Check for saved footnotes, etc.:
  3722. \checkinserts
  3723. %
  3724. % Perhaps a \nobreak, then reset:
  3725. \headitemcrhook
  3726. \global\let\headitemcrhook=\relax
  3727. }%
  3728. }%
  3729. %
  3730. \parsearg\domultitable
  3731. }
  3732. \def\domultitable#1{%
  3733. % To parse everything between @multitable and @item:
  3734. \setuptable#1 \endsetuptable
  3735. %
  3736. % This preamble sets up a generic column definition, which will
  3737. % be used as many times as user calls for columns.
  3738. % \vtop will set a single line and will also let text wrap and
  3739. % continue for many paragraphs if desired.
  3740. \halign\bgroup &%
  3741. \global\advance\colcount by 1
  3742. \multistrut
  3743. \vtop{%
  3744. % Use the current \colcount to find the correct column width:
  3745. \hsize=\expandafter\csname col\the\colcount\endcsname
  3746. %
  3747. % In order to keep entries from bumping into each other
  3748. % we will add a \leftskip of \multitablecolspace to all columns after
  3749. % the first one.
  3750. %
  3751. % If a template has been used, we will add \multitablecolspace
  3752. % to the width of each template entry.
  3753. %
  3754. % If the user has set preamble in terms of percent of \hsize we will
  3755. % use that dimension as the width of the column, and the \leftskip
  3756. % will keep entries from bumping into each other. Table will start at
  3757. % left margin and final column will justify at right margin.
  3758. %
  3759. % Make sure we don't inherit \rightskip from the outer environment.
  3760. \rightskip=0pt
  3761. \ifnum\colcount=1
  3762. % The first column will be indented with the surrounding text.
  3763. \advance\hsize by\leftskip
  3764. \else
  3765. \ifsetpercent \else
  3766. % If user has not set preamble in terms of percent of \hsize
  3767. % we will advance \hsize by \multitablecolspace.
  3768. \advance\hsize by \multitablecolspace
  3769. \fi
  3770. % In either case we will make \leftskip=\multitablecolspace:
  3771. \leftskip=\multitablecolspace
  3772. \fi
  3773. % Ignoring space at the beginning and end avoids an occasional spurious
  3774. % blank line, when TeX decides to break the line at the space before the
  3775. % box from the multistrut, so the strut ends up on a line by itself.
  3776. % For example:
  3777. % @multitable @columnfractions .11 .89
  3778. % @item @code{#}
  3779. % @tab Legal holiday which is valid in major parts of the whole country.
  3780. % Is automatically provided with highlighting sequences respectively
  3781. % marking characters.
  3782. \noindent\ignorespaces##\unskip\multistrut
  3783. }\cr
  3784. }
  3785. \def\Emultitable{%
  3786. \crcr
  3787. \egroup % end the \halign
  3788. \global\setpercentfalse
  3789. }
  3790. \def\setmultitablespacing{%
  3791. \def\multistrut{\strut}% just use the standard line spacing
  3792. %
  3793. % Compute \multitablelinespace (if not defined by user) for use in
  3794. % \multitableparskip calculation. We used define \multistrut based on
  3795. % this, but (ironically) that caused the spacing to be off.
  3796. % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100.
  3797. \ifdim\multitablelinespace=0pt
  3798. \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
  3799. \global\advance\multitablelinespace by-\ht0
  3800. \fi
  3801. % Test to see if parskip is larger than space between lines of
  3802. % table. If not, do nothing.
  3803. % If so, set to same dimension as multitablelinespace.
  3804. \ifdim\multitableparskip>\multitablelinespace
  3805. \global\multitableparskip=\multitablelinespace
  3806. \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
  3807. % than skip between lines in the table.
  3808. \fi%
  3809. \ifdim\multitableparskip=0pt
  3810. \global\multitableparskip=\multitablelinespace
  3811. \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
  3812. % than skip between lines in the table.
  3813. \fi}
  3814. \message{conditionals,}
  3815. % @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext,
  3816. % @ifnotxml always succeed. They currently do nothing; we don't
  3817. % attempt to check whether the conditionals are properly nested. But we
  3818. % have to remember that they are conditionals, so that @end doesn't
  3819. % attempt to close an environment group.
  3820. %
  3821. \def\makecond#1{%
  3822. \expandafter\let\csname #1\endcsname = \relax
  3823. \expandafter\let\csname iscond.#1\endcsname = 1
  3824. }
  3825. \makecond{iftex}
  3826. \makecond{ifnotdocbook}
  3827. \makecond{ifnothtml}
  3828. \makecond{ifnotinfo}
  3829. \makecond{ifnotplaintext}
  3830. \makecond{ifnotxml}
  3831. % Ignore @ignore, @ifhtml, @ifinfo, and the like.
  3832. %
  3833. \def\direntry{\doignore{direntry}}
  3834. \def\documentdescription{\doignore{documentdescription}}
  3835. \def\docbook{\doignore{docbook}}
  3836. \def\html{\doignore{html}}
  3837. \def\ifdocbook{\doignore{ifdocbook}}
  3838. \def\ifhtml{\doignore{ifhtml}}
  3839. \def\ifinfo{\doignore{ifinfo}}
  3840. \def\ifnottex{\doignore{ifnottex}}
  3841. \def\ifplaintext{\doignore{ifplaintext}}
  3842. \def\ifxml{\doignore{ifxml}}
  3843. \def\ignore{\doignore{ignore}}
  3844. \def\menu{\doignore{menu}}
  3845. \def\xml{\doignore{xml}}
  3846. % Ignore text until a line `@end #1', keeping track of nested conditionals.
  3847. %
  3848. % A count to remember the depth of nesting.
  3849. \newcount\doignorecount
  3850. \def\doignore#1{\begingroup
  3851. % Scan in ``verbatim'' mode:
  3852. \obeylines
  3853. \catcode`\@ = \other
  3854. \catcode`\{ = \other
  3855. \catcode`\} = \other
  3856. %
  3857. % Make sure that spaces turn into tokens that match what \doignoretext wants.
  3858. \spaceisspace
  3859. %
  3860. % Count number of #1's that we've seen.
  3861. \doignorecount = 0
  3862. %
  3863. % Swallow text until we reach the matching `@end #1'.
  3864. \dodoignore{#1}%
  3865. }
  3866. { \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source.
  3867. \obeylines %
  3868. %
  3869. \gdef\dodoignore#1{%
  3870. % #1 contains the command name as a string, e.g., `ifinfo'.
  3871. %
  3872. % Define a command to find the next `@end #1'.
  3873. \long\def\doignoretext##1^^M@end #1{%
  3874. \doignoretextyyy##1^^M@#1\_STOP_}%
  3875. %
  3876. % And this command to find another #1 command, at the beginning of a
  3877. % line. (Otherwise, we would consider a line `@c @ifset', for
  3878. % example, to count as an @ifset for nesting.)
  3879. \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%
  3880. %
  3881. % And now expand that command.
  3882. \doignoretext ^^M%
  3883. }%
  3884. }
  3885. \def\doignoreyyy#1{%
  3886. \def\temp{#1}%
  3887. \ifx\temp\empty % Nothing found.
  3888. \let\next\doignoretextzzz
  3889. \else % Found a nested condition, ...
  3890. \advance\doignorecount by 1
  3891. \let\next\doignoretextyyy % ..., look for another.
  3892. % If we're here, #1 ends with ^^M\ifinfo (for example).
  3893. \fi
  3894. \next #1% the token \_STOP_ is present just after this macro.
  3895. }
  3896. % We have to swallow the remaining "\_STOP_".
  3897. %
  3898. \def\doignoretextzzz#1{%
  3899. \ifnum\doignorecount = 0 % We have just found the outermost @end.
  3900. \let\next\enddoignore
  3901. \else % Still inside a nested condition.
  3902. \advance\doignorecount by -1
  3903. \let\next\doignoretext % Look for the next @end.
  3904. \fi
  3905. \next
  3906. }
  3907. % Finish off ignored text.
  3908. { \obeylines%
  3909. % Ignore anything after the last `@end #1'; this matters in verbatim
  3910. % environments, where otherwise the newline after an ignored conditional
  3911. % would result in a blank line in the output.
  3912. \gdef\enddoignore#1^^M{\endgroup\ignorespaces}%
  3913. }
  3914. % @set VAR sets the variable VAR to an empty value.
  3915. % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
  3916. %
  3917. % Since we want to separate VAR from REST-OF-LINE (which might be
  3918. % empty), we can't just use \parsearg; we have to insert a space of our
  3919. % own to delimit the rest of the line, and then take it out again if we
  3920. % didn't need it.
  3921. % We rely on the fact that \parsearg sets \catcode`\ =10.
  3922. %
  3923. \parseargdef\set{\setyyy#1 \endsetyyy}
  3924. \def\setyyy#1 #2\endsetyyy{%
  3925. {%
  3926. \makevalueexpandable
  3927. \def\temp{#2}%
  3928. \edef\next{\gdef\makecsname{SET#1}}%
  3929. \ifx\temp\empty
  3930. \next{}%
  3931. \else
  3932. \setzzz#2\endsetzzz
  3933. \fi
  3934. }%
  3935. }
  3936. % Remove the trailing space \setxxx inserted.
  3937. \def\setzzz#1 \endsetzzz{\next{#1}}
  3938. % @clear VAR clears (i.e., unsets) the variable VAR.
  3939. %
  3940. \parseargdef\clear{%
  3941. {%
  3942. \makevalueexpandable
  3943. \global\expandafter\let\csname SET#1\endcsname=\relax
  3944. }%
  3945. }
  3946. % @value{foo} gets the text saved in variable foo.
  3947. \def\value{\begingroup\makevalueexpandable\valuexxx}
  3948. \def\valuexxx#1{\expandablevalue{#1}\endgroup}
  3949. {
  3950. \catcode`\-=\active \catcode`\_=\active
  3951. %
  3952. \gdef\makevalueexpandable{%
  3953. \let\value = \expandablevalue
  3954. % We don't want these characters active, ...
  3955. \catcode`\-=\other \catcode`\_=\other
  3956. % ..., but we might end up with active ones in the argument if
  3957. % we're called from @code, as @code{@value{foo-bar_}}, though.
  3958. % So \let them to their normal equivalents.
  3959. \let-\normaldash \let_\normalunderscore
  3960. }
  3961. }
  3962. % We have this subroutine so that we can handle at least some @value's
  3963. % properly in indexes (we call \makevalueexpandable in \indexdummies).
  3964. % The command has to be fully expandable (if the variable is set), since
  3965. % the result winds up in the index file. This means that if the
  3966. % variable's value contains other Texinfo commands, it's almost certain
  3967. % it will fail (although perhaps we could fix that with sufficient work
  3968. % to do a one-level expansion on the result, instead of complete).
  3969. %
  3970. % Unfortunately, this has the consequence that when _ is in the *value*
  3971. % of an @set, it does not print properly in the roman fonts (get the cmr
  3972. % dot accent at position 126 instead). No fix comes to mind, and it's
  3973. % been this way since 2003 or earlier, so just ignore it.
  3974. %
  3975. \def\expandablevalue#1{%
  3976. \expandafter\ifx\csname SET#1\endcsname\relax
  3977. {[No value for ``#1'']}%
  3978. \message{Variable `#1', used in @value, is not set.}%
  3979. \else
  3980. \csname SET#1\endcsname
  3981. \fi
  3982. }
  3983. % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
  3984. % with @set.
  3985. %
  3986. % To get the special treatment we need for `@end ifset,' we call
  3987. % \makecond and then redefine.
  3988. %
  3989. \makecond{ifset}
  3990. \def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}
  3991. \def\doifset#1#2{%
  3992. {%
  3993. \makevalueexpandable
  3994. \let\next=\empty
  3995. \expandafter\ifx\csname SET#2\endcsname\relax
  3996. #1% If not set, redefine \next.
  3997. \fi
  3998. \expandafter
  3999. }\next
  4000. }
  4001. \def\ifsetfail{\doignore{ifset}}
  4002. % @ifclear VAR ... @end executes the `...' iff VAR has never been
  4003. % defined with @set, or has been undefined with @clear.
  4004. %
  4005. % The `\else' inside the `\doifset' parameter is a trick to reuse the
  4006. % above code: if the variable is not set, do nothing, if it is set,
  4007. % then redefine \next to \ifclearfail.
  4008. %
  4009. \makecond{ifclear}
  4010. \def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
  4011. \def\ifclearfail{\doignore{ifclear}}
  4012. % @ifcommandisdefined CMD ... @end executes the `...' if CMD (written
  4013. % without the @) is in fact defined. We can only feasibly check at the
  4014. % TeX level, so something like `mathcode' is going to considered
  4015. % defined even though it is not a Texinfo command.
  4016. %
  4017. \makecond{ifcommanddefined}
  4018. \def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}}
  4019. %
  4020. \def\doifcmddefined#1#2{{%
  4021. \makevalueexpandable
  4022. \let\next=\empty
  4023. \expandafter\ifx\csname #2\endcsname\relax
  4024. #1% If not defined, \let\next as above.
  4025. \fi
  4026. \expandafter
  4027. }\next
  4028. }
  4029. \def\ifcmddefinedfail{\doignore{ifcommanddefined}}
  4030. % @ifcommandnotdefined CMD ... handled similar to @ifclear above.
  4031. \makecond{ifcommandnotdefined}
  4032. \def\ifcommandnotdefined{%
  4033. \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}}
  4034. \def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}}
  4035. % Set the `txicommandconditionals' variable, so documents have a way to
  4036. % test if the @ifcommand...defined conditionals are available.
  4037. \set txicommandconditionals
  4038. % @dircategory CATEGORY -- specify a category of the dir file
  4039. % which this file should belong to. Ignore this in TeX.
  4040. \let\dircategory=\comment
  4041. % @defininfoenclose.
  4042. \let\definfoenclose=\comment
  4043. \message{indexing,}
  4044. % Index generation facilities
  4045. % Define \newwrite to be identical to plain tex's \newwrite
  4046. % except not \outer, so it can be used within macros and \if's.
  4047. \edef\newwrite{\makecsname{ptexnewwrite}}
  4048. % \newindex {foo} defines an index named IX.
  4049. % It automatically defines \IXindex such that
  4050. % \IXindex ...rest of line... puts an entry in the index IX.
  4051. % It also defines \IXindfile to be the number of the output channel for
  4052. % the file that accumulates this index. The file's extension is IX.
  4053. % The name of an index should be no more than 2 characters long
  4054. % for the sake of vms.
  4055. %
  4056. \def\newindex#1{%
  4057. \expandafter\chardef\csname#1indfile\endcsname=0
  4058. \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
  4059. \noexpand\doindex{#1}}
  4060. }
  4061. % @defindex foo == \newindex{foo}
  4062. %
  4063. \def\defindex{\parsearg\newindex}
  4064. % Define @defcodeindex, like @defindex except put all entries in @code.
  4065. %
  4066. \def\defcodeindex{\parsearg\newcodeindex}
  4067. %
  4068. \def\newcodeindex#1{%
  4069. \expandafter\chardef\csname#1indfile\endcsname=0
  4070. \expandafter\xdef\csname#1index\endcsname{%
  4071. \noexpand\docodeindex{#1}}%
  4072. }
  4073. % The default indices:
  4074. \newindex{cp}% concepts,
  4075. \newcodeindex{fn}% functions,
  4076. \newcodeindex{vr}% variables,
  4077. \newcodeindex{tp}% types,
  4078. \newcodeindex{ky}% keys
  4079. \newcodeindex{pg}% and programs.
  4080. % @synindex foo bar makes index foo feed into index bar.
  4081. % Do this instead of @defindex foo if you don't want it as a separate index.
  4082. %
  4083. % @syncodeindex foo bar similar, but put all entries made for index foo
  4084. % inside @code.
  4085. %
  4086. \def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
  4087. \def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
  4088. % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
  4089. % #3 the target index (bar).
  4090. \def\dosynindex#1#2#3{%
  4091. % Only do \closeout if we haven't already done it, else we'll end up
  4092. % closing the target index.
  4093. \expandafter \ifx\csname donesynindex#2\endcsname \relax
  4094. % The \closeout helps reduce unnecessary open files; the limit on the
  4095. % Acorn RISC OS is a mere 16 files.
  4096. \expandafter\closeout\csname#2indfile\endcsname
  4097. \expandafter\let\csname donesynindex#2\endcsname = 1
  4098. \fi
  4099. % redefine \fooindfile:
  4100. \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
  4101. \expandafter\let\csname#2indfile\endcsname=\temp
  4102. % redefine \fooindex:
  4103. \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
  4104. }
  4105. % Define \doindex, the driver for all index macros.
  4106. % Argument #1 is generated by the calling \fooindex macro,
  4107. % and it the two-letter name of the index.
  4108. \def\doindex#1{\edef\indexname{#1}\parsearg\doindexxxx}
  4109. \def\doindexxxx #1{\doind{\indexname}{#1}}
  4110. % like the previous two, but they put @code around the argument.
  4111. \def\docodeindex#1{\edef\indexname{#1}\parsearg\docodeindexxxx}
  4112. \def\docodeindexxxx #1{\doind{\indexname}{\code{#1}}}
  4113. % Used when writing an index entry out to an index file, to prevent
  4114. % expansion of Texinfo commands that can appear in an index entry.
  4115. %
  4116. \def\indexdummies{%
  4117. \escapechar = `\\ % use backslash in output files.
  4118. \def\@{@}% change to @@ when we switch to @ as escape char in index files.
  4119. \def\ {\realbackslash\space }%
  4120. %
  4121. % Need these unexpandable (because we define \tt as a dummy)
  4122. % definitions when @{ or @} appear in index entry text. Also, more
  4123. % complicated, when \tex is in effect and \{ is a \delimiter again.
  4124. % We can't use \lbracecmd and \rbracecmd because texindex assumes
  4125. % braces and backslashes are used only as delimiters. Perhaps we
  4126. % should use @lbracechar and @rbracechar?
  4127. \def\{{{\tt\char123}}%
  4128. \def\}{{\tt\char125}}%
  4129. %
  4130. % Do the redefinitions.
  4131. \commondummies
  4132. }
  4133. % For the aux and toc files, @ is the escape character. So we want to
  4134. % redefine everything using @ as the escape character (instead of
  4135. % \realbackslash, still used for index files). When everything uses @,
  4136. % this will be simpler.
  4137. %
  4138. \def\atdummies{%
  4139. \def\@{@@}%
  4140. \def\ {@ }%
  4141. \let\{ = \lbraceatcmd
  4142. \let\} = \rbraceatcmd
  4143. %
  4144. % Do the redefinitions.
  4145. \commondummies
  4146. \otherbackslash
  4147. }
  4148. % Called from \indexdummies and \atdummies.
  4149. %
  4150. \def\commondummies{%
  4151. % \definedummyword defines \#1 as \string\#1\space, thus effectively
  4152. % preventing its expansion. This is used only for control words,
  4153. % not control letters, because the \space would be incorrect for
  4154. % control characters, but is needed to separate the control word
  4155. % from whatever follows.
  4156. %
  4157. % For control letters, we have \definedummyletter, which omits the
  4158. % space.
  4159. %
  4160. % These can be used both for control words that take an argument and
  4161. % those that do not. If it is followed by {arg} in the input, then
  4162. % that will dutifully get written to the index (or wherever).
  4163. %
  4164. \def\definedummyword ##1{\def##1{\string##1\space}}%
  4165. \def\definedummyletter##1{\def##1{\string##1}}%
  4166. \let\definedummyaccent\definedummyletter
  4167. %
  4168. \commondummiesnofonts
  4169. %
  4170. \definedummyletter\_%
  4171. \definedummyletter\-%
  4172. %
  4173. % Non-English letters.
  4174. \definedummyword\AA
  4175. \definedummyword\AE
  4176. \definedummyword\DH
  4177. \definedummyword\L
  4178. \definedummyword\O
  4179. \definedummyword\OE
  4180. \definedummyword\TH
  4181. \definedummyword\aa
  4182. \definedummyword\ae
  4183. \definedummyword\dh
  4184. \definedummyword\exclamdown
  4185. \definedummyword\l
  4186. \definedummyword\o
  4187. \definedummyword\oe
  4188. \definedummyword\ordf
  4189. \definedummyword\ordm
  4190. \definedummyword\questiondown
  4191. \definedummyword\ss
  4192. \definedummyword\th
  4193. %
  4194. % Although these internal commands shouldn't show up, sometimes they do.
  4195. \definedummyword\bf
  4196. \definedummyword\gtr
  4197. \definedummyword\hat
  4198. \definedummyword\less
  4199. \definedummyword\sf
  4200. \definedummyword\sl
  4201. \definedummyword\tclose
  4202. \definedummyword\tt
  4203. %
  4204. \definedummyword\LaTeX
  4205. \definedummyword\TeX
  4206. %
  4207. % Assorted special characters.
  4208. \definedummyword\arrow
  4209. \definedummyword\bullet
  4210. \definedummyword\comma
  4211. \definedummyword\copyright
  4212. \definedummyword\registeredsymbol
  4213. \definedummyword\dots
  4214. \definedummyword\enddots
  4215. \definedummyword\entrybreak
  4216. \definedummyword\equiv
  4217. \definedummyword\error
  4218. \definedummyword\euro
  4219. \definedummyword\expansion
  4220. \definedummyword\geq
  4221. \definedummyword\guillemetleft
  4222. \definedummyword\guillemetright
  4223. \definedummyword\guilsinglleft
  4224. \definedummyword\guilsinglright
  4225. \definedummyword\lbracechar
  4226. \definedummyword\leq
  4227. \definedummyword\mathopsup
  4228. \definedummyword\minus
  4229. \definedummyword\ogonek
  4230. \definedummyword\pounds
  4231. \definedummyword\point
  4232. \definedummyword\print
  4233. \definedummyword\quotedblbase
  4234. \definedummyword\quotedblleft
  4235. \definedummyword\quotedblright
  4236. \definedummyword\quoteleft
  4237. \definedummyword\quoteright
  4238. \definedummyword\quotesinglbase
  4239. \definedummyword\rbracechar
  4240. \definedummyword\result
  4241. \definedummyword\sub
  4242. \definedummyword\sup
  4243. \definedummyword\textdegree
  4244. %
  4245. % We want to disable all macros so that they are not expanded by \write.
  4246. \macrolist
  4247. %
  4248. \normalturnoffactive
  4249. %
  4250. % Handle some cases of @value -- where it does not contain any
  4251. % (non-fully-expandable) commands.
  4252. \makevalueexpandable
  4253. }
  4254. % \commondummiesnofonts: common to \commondummies and \indexnofonts.
  4255. % Define \definedumyletter, \definedummyaccent and \definedummyword before
  4256. % using.
  4257. %
  4258. \def\commondummiesnofonts{%
  4259. % Control letters and accents.
  4260. \definedummyletter\!%
  4261. \definedummyaccent\"%
  4262. \definedummyaccent\'%
  4263. \definedummyletter\*%
  4264. \definedummyaccent\,%
  4265. \definedummyletter\.%
  4266. \definedummyletter\/%
  4267. \definedummyletter\:%
  4268. \definedummyaccent\=%
  4269. \definedummyletter\?%
  4270. \definedummyaccent\^%
  4271. \definedummyaccent\`%
  4272. \definedummyaccent\~%
  4273. \definedummyword\u
  4274. \definedummyword\v
  4275. \definedummyword\H
  4276. \definedummyword\dotaccent
  4277. \definedummyword\ogonek
  4278. \definedummyword\ringaccent
  4279. \definedummyword\tieaccent
  4280. \definedummyword\ubaraccent
  4281. \definedummyword\udotaccent
  4282. \definedummyword\dotless
  4283. %
  4284. % Texinfo font commands.
  4285. \definedummyword\b
  4286. \definedummyword\i
  4287. \definedummyword\r
  4288. \definedummyword\sansserif
  4289. \definedummyword\sc
  4290. \definedummyword\slanted
  4291. \definedummyword\t
  4292. %
  4293. % Commands that take arguments.
  4294. \definedummyword\abbr
  4295. \definedummyword\acronym
  4296. \definedummyword\anchor
  4297. \definedummyword\cite
  4298. \definedummyword\code
  4299. \definedummyword\command
  4300. \definedummyword\dfn
  4301. \definedummyword\dmn
  4302. \definedummyword\email
  4303. \definedummyword\emph
  4304. \definedummyword\env
  4305. \definedummyword\file
  4306. \definedummyword\image
  4307. \definedummyword\indicateurl
  4308. \definedummyword\inforef
  4309. \definedummyword\kbd
  4310. \definedummyword\key
  4311. \definedummyword\math
  4312. \definedummyword\option
  4313. \definedummyword\pxref
  4314. \definedummyword\ref
  4315. \definedummyword\samp
  4316. \definedummyword\strong
  4317. \definedummyword\tie
  4318. \definedummyword\U
  4319. \definedummyword\uref
  4320. \definedummyword\url
  4321. \definedummyword\var
  4322. \definedummyword\verb
  4323. \definedummyword\w
  4324. \definedummyword\xref
  4325. %
  4326. % Consider:
  4327. % @macro mkind{arg1,arg2}
  4328. % @cindex \arg2\
  4329. % @end macro
  4330. % @mkind{foo, bar}
  4331. % The space after the comma will end up in the temporary definition
  4332. % that we make for arg2 (see \parsemargdef ff.). We want all this to be
  4333. % expanded for the sake of the index, so we end up just seeing "bar".
  4334. \let\xprocessmacroarg\eatspaces
  4335. }
  4336. % For testing: output @{ and @} in index sort strings as \{ and \}.
  4337. \newif\ifusebracesinindexes
  4338. \let\indexlbrace\relax
  4339. \let\indexrbrace\relax
  4340. {\catcode`\@=0
  4341. \catcode`\\=13
  4342. @gdef@backslashdisappear{@def\{}}
  4343. }
  4344. {
  4345. \catcode`\<=13
  4346. \catcode`\-=13
  4347. \catcode`\`=13
  4348. \gdef\indexnonalnumdisappear{%
  4349. \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax\else
  4350. % @set txiindexlquoteignore makes us ignore left quotes in the sort term.
  4351. % (Introduced for FSFS 2nd ed.)
  4352. \let`=\empty
  4353. \fi
  4354. %
  4355. \expandafter\ifx\csname SETtxiindexbackslashignore\endcsname\relax\else
  4356. \backslashdisappear
  4357. \fi
  4358. %
  4359. \expandafter\ifx\csname SETtxiindexhyphenignore\endcsname\relax\else
  4360. \def-{}%
  4361. \fi
  4362. \expandafter\ifx\csname SETtxiindexlessthanignore\endcsname\relax\else
  4363. \def<{}%
  4364. \fi
  4365. \expandafter\ifx\csname SETtxiindexatsignignore\endcsname\relax\else
  4366. \def\@{}%
  4367. \fi
  4368. }
  4369. \gdef\indexnonalnumreappear{%
  4370. \useindexbackslash
  4371. \let-\normaldash
  4372. \let<\normalless
  4373. \def\@{@}%
  4374. }
  4375. }
  4376. % \indexnofonts is used when outputting the strings to sort the index
  4377. % by, and when constructing control sequence names. It eliminates all
  4378. % control sequences and just writes whatever the best ASCII sort string
  4379. % would be for a given command (usually its argument).
  4380. %
  4381. \def\indexnofonts{%
  4382. % Accent commands should become @asis.
  4383. \def\definedummyaccent##1{\let##1\asis}%
  4384. % We can just ignore other control letters.
  4385. \def\definedummyletter##1{\let##1\empty}%
  4386. % All control words become @asis by default; overrides below.
  4387. \let\definedummyword\definedummyaccent
  4388. \commondummiesnofonts
  4389. %
  4390. % Don't no-op \tt, since it isn't a user-level command
  4391. % and is used in the definitions of the active chars like <, >, |, etc.
  4392. % Likewise with the other plain tex font commands.
  4393. %\let\tt=\asis
  4394. %
  4395. \def\ { }%
  4396. \def\@{@}%
  4397. \def\_{\normalunderscore}%
  4398. \def\-{}% @- shouldn't affect sorting
  4399. %
  4400. \def\lbracechar{{\indexlbrace}}%
  4401. \def\rbracechar{{\indexrbrace}}%
  4402. \let\{=\lbracechar
  4403. \let\}=\rbracechar
  4404. %
  4405. %
  4406. % Non-English letters.
  4407. \def\AA{AA}%
  4408. \def\AE{AE}%
  4409. \def\DH{DZZ}%
  4410. \def\L{L}%
  4411. \def\OE{OE}%
  4412. \def\O{O}%
  4413. \def\TH{TH}%
  4414. \def\aa{aa}%
  4415. \def\ae{ae}%
  4416. \def\dh{dzz}%
  4417. \def\exclamdown{!}%
  4418. \def\l{l}%
  4419. \def\oe{oe}%
  4420. \def\ordf{a}%
  4421. \def\ordm{o}%
  4422. \def\o{o}%
  4423. \def\questiondown{?}%
  4424. \def\ss{ss}%
  4425. \def\th{th}%
  4426. %
  4427. \def\LaTeX{LaTeX}%
  4428. \def\TeX{TeX}%
  4429. %
  4430. % Assorted special characters.
  4431. % (The following {} will end up in the sort string, but that's ok.)
  4432. \def\arrow{->}%
  4433. \def\bullet{bullet}%
  4434. \def\comma{,}%
  4435. \def\copyright{copyright}%
  4436. \def\dots{...}%
  4437. \def\enddots{...}%
  4438. \def\equiv{==}%
  4439. \def\error{error}%
  4440. \def\euro{euro}%
  4441. \def\expansion{==>}%
  4442. \def\geq{>=}%
  4443. \def\guillemetleft{<<}%
  4444. \def\guillemetright{>>}%
  4445. \def\guilsinglleft{<}%
  4446. \def\guilsinglright{>}%
  4447. \def\leq{<=}%
  4448. \def\minus{-}%
  4449. \def\point{.}%
  4450. \def\pounds{pounds}%
  4451. \def\print{-|}%
  4452. \def\quotedblbase{"}%
  4453. \def\quotedblleft{"}%
  4454. \def\quotedblright{"}%
  4455. \def\quoteleft{`}%
  4456. \def\quoteright{'}%
  4457. \def\quotesinglbase{,}%
  4458. \def\registeredsymbol{R}%
  4459. \def\result{=>}%
  4460. \def\textdegree{o}%
  4461. %
  4462. % We need to get rid of all macros, leaving only the arguments (if present).
  4463. % Of course this is not nearly correct, but it is the best we can do for now.
  4464. % makeinfo does not expand macros in the argument to @deffn, which ends up
  4465. % writing an index entry, and texindex isn't prepared for an index sort entry
  4466. % that starts with \.
  4467. %
  4468. % Since macro invocations are followed by braces, we can just redefine them
  4469. % to take a single TeX argument. The case of a macro invocation that
  4470. % goes to end-of-line is not handled.
  4471. %
  4472. \macrolist
  4473. }
  4474. \let\SETmarginindex=\relax % put index entries in margin (undocumented)?
  4475. % Most index entries go through here, but \dosubind is the general case.
  4476. % #1 is the index name, #2 is the entry text.
  4477. \def\doind#1#2{\dosubind{#1}{#2}{}}
  4478. % There is also \dosubind {index}{topic}{subtopic}
  4479. % which makes an entry in a two-level index such as the operation index.
  4480. % TODO: Two-level index? Operation index?
  4481. % Workhorse for all indexes.
  4482. % #1 is name of index, #2 is stuff to put there, #3 is subentry --
  4483. % empty if called from \doind, as we usually are (the main exception
  4484. % is with most defuns, which call us directly).
  4485. %
  4486. \def\dosubind#1#2#3{%
  4487. \iflinks
  4488. {%
  4489. \requireopenindexfile{#1}%
  4490. % Store the main index entry text (including the third arg).
  4491. \toks0 = {#2}%
  4492. % If third arg is present, precede it with a space.
  4493. \def\thirdarg{#3}%
  4494. \ifx\thirdarg\empty \else
  4495. \toks0 = \expandafter{\the\toks0 \space #3}%
  4496. \fi
  4497. %
  4498. \edef\writeto{\csname#1indfile\endcsname}%
  4499. %
  4500. \safewhatsit\dosubindwrite
  4501. }%
  4502. \fi
  4503. }
  4504. % Check if an index file has been opened, and if not, open it.
  4505. \def\requireopenindexfile#1{%
  4506. \ifnum\csname #1indfile\endcsname=0
  4507. \expandafter\newwrite \csname#1indfile\endcsname
  4508. \edef\suffix{#1}%
  4509. % A .fls suffix would conflict with the file extension for the output
  4510. % of -recorder, so use .f1s instead.
  4511. \ifx\suffix\indexisfl\def\suffix{f1}\fi
  4512. % Open the file
  4513. \immediate\openout\csname#1indfile\endcsname \jobname.\suffix
  4514. % Using \immediate here prevents an object entering into the current box,
  4515. % which could confound checks such as those in \safewhatsit for preceding
  4516. % skips.
  4517. \fi}
  4518. \def\indexisfl{fl}
  4519. % Output \ as {\indexbackslash}, because \ is an escape character in
  4520. % the index files.
  4521. \let\indexbackslash=\relax
  4522. {\catcode`\@=0 \catcode`\\=\active
  4523. @gdef@useindexbackslash{@def\{{@indexbackslash}}}
  4524. }
  4525. % Definition for writing index entry text.
  4526. \def\sortas#1{\ignorespaces}%
  4527. % Definition for writing index entry sort key. Should occur at the at
  4528. % the beginning of the index entry, like
  4529. % @cindex @sortas{september} \september
  4530. % The \ignorespaces takes care of following space, but there's no way
  4531. % to remove space before it.
  4532. {
  4533. \catcode`\-=13
  4534. \gdef\indexwritesortas{%
  4535. \begingroup
  4536. \indexnonalnumreappear
  4537. \indexwritesortasxxx}
  4538. \gdef\indexwritesortasxxx#1{%
  4539. \xdef\indexsortkey{#1}\endgroup}
  4540. }
  4541. % Write the entry in \toks0 to the index file.
  4542. %
  4543. \def\dosubindwrite{%
  4544. % Put the index entry in the margin if desired.
  4545. \ifx\SETmarginindex\relax\else
  4546. \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}%
  4547. \fi
  4548. %
  4549. % Remember, we are within a group.
  4550. \indexdummies % Must do this here, since \bf, etc expand at this stage
  4551. \useindexbackslash % \indexbackslash isn't defined now so it will be output
  4552. % as is; and it will print as backslash.
  4553. % Get the string to sort by, by processing the index entry with all
  4554. % font commands turned off.
  4555. {\indexnofonts
  4556. \indexnonalnumdisappear
  4557. \xdef\indexsortkey{}%
  4558. \let\sortas=\indexwritesortas
  4559. \edef\temp{\the\toks0}%
  4560. \setbox\dummybox = \hbox{\temp}% Make sure to execute any \sortas
  4561. \ifx\indexsortkey\empty
  4562. \xdef\indexsortkey{\temp}%
  4563. \ifx\indexsortkey\empty\xdef\indexsortkey{ }\fi
  4564. \fi
  4565. }%
  4566. %
  4567. % Set up the complete index entry, with both the sort key and
  4568. % the original text, including any font commands. We write
  4569. % three arguments to \entry to the .?? file (four in the
  4570. % subentry case), texindex reduces to two when writing the .??s
  4571. % sorted result.
  4572. \edef\temp{%
  4573. \write\writeto{%
  4574. \string\entry{\indexsortkey}{\noexpand\folio}{\the\toks0}}%
  4575. }%
  4576. \temp
  4577. }
  4578. \newbox\dummybox % used above
  4579. % Take care of unwanted page breaks/skips around a whatsit:
  4580. %
  4581. % If a skip is the last thing on the list now, preserve it
  4582. % by backing up by \lastskip, doing the \write, then inserting
  4583. % the skip again. Otherwise, the whatsit generated by the
  4584. % \write or \pdfdest will make \lastskip zero. The result is that
  4585. % sequences like this:
  4586. % @end defun
  4587. % @tindex whatever
  4588. % @defun ...
  4589. % will have extra space inserted, because the \medbreak in the
  4590. % start of the @defun won't see the skip inserted by the @end of
  4591. % the previous defun.
  4592. %
  4593. % But don't do any of this if we're not in vertical mode. We
  4594. % don't want to do a \vskip and prematurely end a paragraph.
  4595. %
  4596. % Avoid page breaks due to these extra skips, too.
  4597. %
  4598. % But wait, there is a catch there:
  4599. % We'll have to check whether \lastskip is zero skip. \ifdim is not
  4600. % sufficient for this purpose, as it ignores stretch and shrink parts
  4601. % of the skip. The only way seems to be to check the textual
  4602. % representation of the skip.
  4603. %
  4604. % The following is almost like \def\zeroskipmacro{0.0pt} except that
  4605. % the ``p'' and ``t'' characters have catcode \other, not 11 (letter).
  4606. %
  4607. \edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname}
  4608. %
  4609. \newskip\whatsitskip
  4610. \newcount\whatsitpenalty
  4611. %
  4612. % ..., ready, GO:
  4613. %
  4614. \def\safewhatsit#1{\ifhmode
  4615. #1%
  4616. \else
  4617. % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
  4618. \whatsitskip = \lastskip
  4619. \edef\lastskipmacro{\the\lastskip}%
  4620. \whatsitpenalty = \lastpenalty
  4621. %
  4622. % If \lastskip is nonzero, that means the last item was a
  4623. % skip. And since a skip is discardable, that means this
  4624. % -\whatsitskip glue we're inserting is preceded by a
  4625. % non-discardable item, therefore it is not a potential
  4626. % breakpoint, therefore no \nobreak needed.
  4627. \ifx\lastskipmacro\zeroskipmacro
  4628. \else
  4629. \vskip-\whatsitskip
  4630. \fi
  4631. %
  4632. #1%
  4633. %
  4634. \ifx\lastskipmacro\zeroskipmacro
  4635. % If \lastskip was zero, perhaps the last item was a penalty, and
  4636. % perhaps it was >=10000, e.g., a \nobreak. In that case, we want
  4637. % to re-insert the same penalty (values >10000 are used for various
  4638. % signals); since we just inserted a non-discardable item, any
  4639. % following glue (such as a \parskip) would be a breakpoint. For example:
  4640. % @deffn deffn-whatever
  4641. % @vindex index-whatever
  4642. % Description.
  4643. % would allow a break between the index-whatever whatsit
  4644. % and the "Description." paragraph.
  4645. \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi
  4646. \else
  4647. % On the other hand, if we had a nonzero \lastskip,
  4648. % this make-up glue would be preceded by a non-discardable item
  4649. % (the whatsit from the \write), so we must insert a \nobreak.
  4650. \nobreak\vskip\whatsitskip
  4651. \fi
  4652. \fi}
  4653. % The index entry written in the file actually looks like
  4654. % \entry {sortstring}{page}{topic}
  4655. % or
  4656. % \entry {sortstring}{page}{topic}{subtopic}
  4657. % The texindex program reads in these files and writes files
  4658. % containing these kinds of lines:
  4659. % \initial {c}
  4660. % before the first topic whose initial is c
  4661. % \entry {topic}{pagelist}
  4662. % for a topic that is used without subtopics
  4663. % \primary {topic}
  4664. % for the beginning of a topic that is used with subtopics
  4665. % \secondary {subtopic}{pagelist}
  4666. % for each subtopic.
  4667. % Define the user-accessible indexing commands
  4668. % @findex, @vindex, @kindex, @cindex.
  4669. \def\findex {\fnindex}
  4670. \def\kindex {\kyindex}
  4671. \def\cindex {\cpindex}
  4672. \def\vindex {\vrindex}
  4673. \def\tindex {\tpindex}
  4674. \def\pindex {\pgindex}
  4675. \def\cindexsub {\begingroup\obeylines\cindexsub}
  4676. {\obeylines %
  4677. \gdef\cindexsub "#1" #2^^M{\endgroup %
  4678. \dosubind{cp}{#2}{#1}}}
  4679. % Define the macros used in formatting output of the sorted index material.
  4680. % @printindex causes a particular index (the ??s file) to get printed.
  4681. % It does not print any chapter heading (usually an @unnumbered).
  4682. %
  4683. \parseargdef\printindex{\begingroup
  4684. \dobreak \chapheadingskip{10000}%
  4685. %
  4686. \smallfonts \rm
  4687. \tolerance = 9500
  4688. \plainfrenchspacing
  4689. \everypar = {}% don't want the \kern\-parindent from indentation suppression.
  4690. %
  4691. % See if the index file exists and is nonempty.
  4692. % Change catcode of @ here so that if the index file contains
  4693. % \initial {@}
  4694. % as its first line, TeX doesn't complain about mismatched braces
  4695. % (because it thinks @} is a control sequence).
  4696. \catcode`\@ = 11
  4697. % See comment in \requireopenindexfile.
  4698. \def\indexname{#1}\ifx\indexname\indexisfl\def\indexname{f1}\fi
  4699. \openin 1 \jobname.\indexname s
  4700. \ifeof 1
  4701. % \enddoublecolumns gets confused if there is no text in the index,
  4702. % and it loses the chapter title and the aux file entries for the
  4703. % index. The easiest way to prevent this problem is to make sure
  4704. % there is some text.
  4705. \putwordIndexNonexistent
  4706. \else
  4707. \catcode`\\ = 0
  4708. \escapechar = `\\
  4709. %
  4710. % If the index file exists but is empty, then \openin leaves \ifeof
  4711. % false. We have to make TeX try to read something from the file, so
  4712. % it can discover if there is anything in it.
  4713. \read 1 to \thisline
  4714. \ifeof 1
  4715. \putwordIndexIsEmpty
  4716. \else
  4717. % Index files are almost Texinfo source, but we use \ as the escape
  4718. % character. It would be better to use @, but that's too big a change
  4719. % to make right now.
  4720. \def\indexbackslash{\ttbackslash}%
  4721. \let\indexlbrace\{ % Likewise, set these sequences for braces
  4722. \let\indexrbrace\} % used in the sort key.
  4723. \begindoublecolumns
  4724. \let\entryorphanpenalty=\indexorphanpenalty
  4725. %
  4726. % Read input from the index file line by line.
  4727. \loopdo
  4728. \ifeof1
  4729. \let\firsttoken\relax
  4730. \else
  4731. \read 1 to \nextline
  4732. \edef\act{\gdef\noexpand\firsttoken{\getfirsttoken\nextline}}%
  4733. \act
  4734. \fi
  4735. \thisline
  4736. %
  4737. \ifeof1\else
  4738. \let\thisline\nextline
  4739. \repeat
  4740. %%
  4741. \enddoublecolumns
  4742. \fi
  4743. \fi
  4744. \closein 1
  4745. \endgroup}
  4746. \def\getfirsttoken#1{\expandafter\getfirsttokenx#1\endfirsttoken}
  4747. \long\def\getfirsttokenx#1#2\endfirsttoken{\noexpand#1}
  4748. \def\loopdo#1\repeat{\def\body{#1}\loopdoxxx}
  4749. \def\loopdoxxx{\let\next=\relax\body\let\next=\loopdoxxx\fi\next}
  4750. % These macros are used by the sorted index file itself.
  4751. % Change them to control the appearance of the index.
  4752. {\catcode`\/=13 \catcode`\-=13 \catcode`\^=13 \catcode`\~=13 \catcode`\_=13
  4753. \catcode`\|=13 \catcode`\<=13 \catcode`\>=13 \catcode`\+=13 \catcode`\"=13
  4754. \catcode`\$=3
  4755. \gdef\initialglyphs{%
  4756. % Some changes for non-alphabetic characters. Using the glyphs from the
  4757. % math fonts looks more consistent than the typewriter font used elsewhere
  4758. % for these characters.
  4759. \def\indexbackslash{\math{\backslash}}%
  4760. \let\\=\indexbackslash
  4761. %
  4762. % Can't get bold backslash so don't use bold forward slash
  4763. \catcode`\/=13
  4764. \def/{{\secrmnotbold \normalslash}}%
  4765. \def-{{\normaldash\normaldash}}% en dash `--'
  4766. \def^{{\chapbf \normalcaret}}%
  4767. \def~{{\chapbf \normaltilde}}%
  4768. \def\_{%
  4769. \leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }%
  4770. \def|{$\vert$}%
  4771. \def<{$\less$}%
  4772. \def>{$\gtr$}%
  4773. \def+{$\normalplus$}%
  4774. }}
  4775. \def\initial{%
  4776. \bgroup
  4777. \initialglyphs
  4778. \initialx
  4779. }
  4780. \def\initialx#1{%
  4781. % Remove any glue we may have, we'll be inserting our own.
  4782. \removelastskip
  4783. %
  4784. % We like breaks before the index initials, so insert a bonus.
  4785. % The glue before the bonus allows a little bit of space at the
  4786. % bottom of a column to reduce an increase in inter-line spacing.
  4787. \nobreak
  4788. \vskip 0pt plus 5\baselineskip
  4789. \penalty -300
  4790. \vskip 0pt plus -5\baselineskip
  4791. %
  4792. % Typeset the initial. Making this add up to a whole number of
  4793. % baselineskips increases the chance of the dots lining up from column
  4794. % to column. It still won't often be perfect, because of the stretch
  4795. % we need before each entry, but it's better.
  4796. %
  4797. % No shrink because it confuses \balancecolumns.
  4798. \vskip 1.67\baselineskip plus 1\baselineskip
  4799. \leftline{\secfonts \kern-0.05em \secbf #1}%
  4800. % \secfonts is inside the argument of \leftline so that the change of
  4801. % \baselineskip will not affect any glue inserted before the vbox that
  4802. % \leftline creates.
  4803. % Do our best not to break after the initial.
  4804. \nobreak
  4805. \vskip .33\baselineskip plus .1\baselineskip
  4806. \egroup % \initialglyphs
  4807. }
  4808. \newdimen\entryrightmargin
  4809. \entryrightmargin=0pt
  4810. % \entry typesets a paragraph consisting of the text (#1), dot leaders, and
  4811. % then page number (#2) flushed to the right margin. It is used for index
  4812. % and table of contents entries. The paragraph is indented by \leftskip.
  4813. %
  4814. \def\entry{%
  4815. \begingroup
  4816. %
  4817. % Start a new paragraph if necessary, so our assignments below can't
  4818. % affect previous text.
  4819. \par
  4820. %
  4821. % No extra space above this paragraph.
  4822. \parskip = 0in
  4823. %
  4824. % When reading the text of entry, convert explicit line breaks
  4825. % from @* into spaces. The user might give these in long section
  4826. % titles, for instance.
  4827. \def\*{\unskip\space\ignorespaces}%
  4828. \def\entrybreak{\hfil\break}%
  4829. %
  4830. % A bit of stretch before each entry for the benefit of balancing
  4831. % columns.
  4832. \vskip 0pt plus0.5pt
  4833. %
  4834. % Badness calculation for paragraph affected by -
  4835. % How much \indexdotfill is stretched, or how much \parfillskip is shrunk
  4836. % Number of lines (\linepenalty)
  4837. %
  4838. % Swallow the left brace of the text (first parameter):
  4839. \afterassignment\doentry
  4840. \let\temp =
  4841. }
  4842. \def\entrybreak{\unskip\space\ignorespaces}%
  4843. \def\doentry{%
  4844. % Save the text of the entry
  4845. \global\setbox\boxA=\hbox\bgroup
  4846. \bgroup % Instead of the swallowed brace.
  4847. \noindent
  4848. \aftergroup\finishentry
  4849. % And now comes the text of the entry.
  4850. % Not absorbing as a macro argument reduces the chance of problems
  4851. % with catcodes occurring.
  4852. }
  4853. {\catcode`\@=11
  4854. \gdef\finishentry#1{%
  4855. \egroup % end box A
  4856. \dimen@ = \wd\boxA % Length of text of entry
  4857. \global\setbox\boxA=\hbox\bgroup\unhbox\boxA
  4858. % #1 is the page number.
  4859. %
  4860. % Get the width of the page numbers, and only use
  4861. % leaders if they are present.
  4862. \global\setbox\boxB = \hbox{#1}%
  4863. \ifdim\wd\boxB = 0pt
  4864. \null\nobreak\hfill\ %
  4865. \else
  4866. %
  4867. \null\nobreak\indexdotfill % Have leaders before the page number.
  4868. %
  4869. \ifpdf
  4870. \pdfgettoks#1.%
  4871. \hskip\skip\thinshrinkable\the\toksA
  4872. \else
  4873. \hskip\skip\thinshrinkable #1%
  4874. \fi
  4875. \fi
  4876. \egroup % end \boxA
  4877. \ifdim\wd\boxB = 0pt
  4878. \global\setbox\entryindexbox=\box\boxA
  4879. \else
  4880. \global\setbox\entryindexbox=\vbox\bgroup\noindent
  4881. % We want the text of the entries to be aligned to the left, and the
  4882. % page numbers to be aligned to the right.
  4883. %
  4884. \advance\leftskip by 0pt plus 1fil
  4885. \advance\leftskip by 0pt plus -1fill
  4886. \rightskip = 0pt plus -1fil
  4887. \advance\rightskip by 0pt plus 1fill
  4888. % Cause last line, which could consist of page numbers on their own
  4889. % if the list of page numbers is long, to be aligned to the right.
  4890. \parfillskip=0pt plus -1fill
  4891. %
  4892. \hangindent=1em
  4893. %
  4894. \advance\rightskip by \entryrightmargin
  4895. % Determine how far we can stretch into the margin.
  4896. % This allows, e.g., "Appendix H GNU Free Documentation License" to
  4897. % fit on one line in @letterpaper format.
  4898. \ifdim\entryrightmargin>2.1em
  4899. \dimen@i=2.1em
  4900. \else
  4901. \dimen@i=0em
  4902. \fi
  4903. \advance \parfillskip by 0pt minus 1\dimen@i
  4904. %
  4905. \dimen@ii = \hsize
  4906. \advance\dimen@ii by -1\leftskip
  4907. \advance\dimen@ii by -1\entryrightmargin
  4908. \advance\dimen@ii by 1\dimen@i
  4909. \ifdim\wd\boxA > \dimen@ii % If the entry doesn't fit in one line
  4910. \ifdim\dimen@ > 0.8\dimen@ii % due to long index text
  4911. \dimen@ = 0.7\dimen@ % Try to split the text roughly evenly
  4912. \dimen@ii = \hsize
  4913. \advance \dimen@ii by -1em
  4914. \ifnum\dimen@>\dimen@ii
  4915. % If the entry is too long, use the whole line
  4916. \dimen@ = \dimen@ii
  4917. \fi
  4918. \advance\leftskip by 0pt plus 1fill % ragged right
  4919. \advance \dimen@ by 1\rightskip
  4920. \parshape = 2 0pt \dimen@ 1em \dimen@ii
  4921. % Ideally we'd add a finite glue at the end of the first line only, but
  4922. % TeX doesn't seem to provide a way to do such a thing.
  4923. \fi\fi
  4924. \unhbox\boxA
  4925. %
  4926. % Do not prefer a separate line ending with a hyphen to fewer lines.
  4927. \finalhyphendemerits = 0
  4928. %
  4929. % Word spacing - no stretch
  4930. \spaceskip=\fontdimen2\font minus \fontdimen4\font
  4931. %
  4932. \linepenalty=1000 % Discourage line breaks.
  4933. \hyphenpenalty=5000 % Discourage hyphenation.
  4934. %
  4935. \par % format the paragraph
  4936. \egroup % The \vbox
  4937. \fi
  4938. \endgroup
  4939. % delay text of entry until after penalty
  4940. \bgroup\aftergroup\insertindexentrybox
  4941. \entryorphanpenalty
  4942. }}
  4943. \newskip\thinshrinkable
  4944. \skip\thinshrinkable=.15em minus .15em
  4945. \newbox\entryindexbox
  4946. \def\insertindexentrybox{%
  4947. \lineskip=.7ex plus .5ex % This comes into effect when the \vbox has a large
  4948. % height due to the paragraph in it having several
  4949. % lines.
  4950. \box\entryindexbox}
  4951. % Default is no penalty
  4952. \let\entryorphanpenalty\egroup
  4953. % Used from \printindex. \firsttoken should be the first token
  4954. % after the \entry. If it's not another \entry, we are at the last
  4955. % line of a group of index entries, so insert a penalty to discourage
  4956. % orphaned index entries.
  4957. \long\def\indexorphanpenalty{%
  4958. \def\isentry{\entry}%
  4959. \ifx\firsttoken\isentry
  4960. \else
  4961. \unskip\penalty 9000
  4962. % The \unskip here stops breaking before the glue. It relies on the
  4963. % \vskip above being there, otherwise there is an error
  4964. % "You can't use `\unskip' in vertical mode". There has to be glue
  4965. % in the current vertical list that hasn't been added to the
  4966. % "current page". See Chapter 24 of the TeXbook. This contradicts
  4967. % Section 8.3.7 in "TeX by Topic," though.
  4968. \fi
  4969. \egroup % now comes the box added with \aftergroup
  4970. }
  4971. % Like plain.tex's \dotfill, except uses up at least 1 em.
  4972. % The filll stretch here overpowers both the fil and fill stretch to push
  4973. % the page number to the right.
  4974. \def\indexdotfill{\cleaders
  4975. \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1filll}
  4976. \def\primary #1{\line{#1\hfil}}
  4977. \newskip\secondaryindent \secondaryindent=0.5cm
  4978. \def\secondary#1#2{{%
  4979. \parfillskip=0in
  4980. \parskip=0in
  4981. \hangindent=1in
  4982. \hangafter=1
  4983. \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
  4984. \ifpdf
  4985. \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
  4986. \else
  4987. #2
  4988. \fi
  4989. \par
  4990. }}
  4991. % Define two-column mode, which we use to typeset indexes.
  4992. % Adapted from the TeXbook, page 416, which is to say,
  4993. % the manmac.tex format used to print the TeXbook itself.
  4994. \catcode`\@=11
  4995. \newbox\partialpage
  4996. \newdimen\doublecolumnhsize
  4997. \newdimen\doublecolumntopgap
  4998. \doublecolumntopgap = 0pt
  4999. \newtoks\savedtopmark % Used in \begindoublecolumns
  5000. \newtoks\savedfirstmark
  5001. \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
  5002. % Grab any single-column material above us.
  5003. \output = {%
  5004. %
  5005. % Here is a possibility not foreseen in manmac: if we accumulate a
  5006. % whole lot of material, we might end up calling this \output
  5007. % routine twice in a row (see the doublecol-lose test, which is
  5008. % essentially a couple of indexes with @setchapternewpage off). In
  5009. % that case we just ship out what is in \partialpage with the normal
  5010. % output routine. Generally, \partialpage will be empty when this
  5011. % runs and this will be a no-op. See the indexspread.tex test case.
  5012. \ifvoid\partialpage \else
  5013. \onepageout{\pagecontents\partialpage}%
  5014. \fi
  5015. %
  5016. \global\setbox\partialpage = \vbox{%
  5017. % Unvbox the main output page.
  5018. \unvbox\PAGE
  5019. \kern-\topskip \kern\baselineskip
  5020. }%
  5021. % Save \topmark and \firstmark
  5022. \global\savedtopmark=\expandafter{\topmark}%
  5023. \global\savedfirstmark=\expandafter{\firstmark}%
  5024. }%
  5025. \eject % run that output routine to set \partialpage
  5026. %
  5027. % We recover the two marks that the last output routine saved in order
  5028. % to propagate the information in marks added around a chapter heading,
  5029. % which could be otherwise be lost by the time the final page is output.
  5030. %
  5031. \mark{\the\savedtopmark}% Only mark in page passed to following \output.
  5032. \output = {%
  5033. \setbox0=\box\PAGE % clear box 255
  5034. }abc\eject
  5035. %
  5036. \mark{\the\savedfirstmark}%
  5037. %
  5038. % Use the double-column output routine for subsequent pages.
  5039. \output = {\doublecolumnout}%
  5040. %
  5041. % Change the page size parameters. We could do this once outside this
  5042. % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
  5043. % format, but then we repeat the same computation. Repeating a couple
  5044. % of assignments once per index is clearly meaningless for the
  5045. % execution time, so we may as well do it in one place.
  5046. %
  5047. % First we halve the line length, less a little for the gutter between
  5048. % the columns. We compute the gutter based on the line length, so it
  5049. % changes automatically with the paper format. The magic constant
  5050. % below is chosen so that the gutter has the same value (well, +-<1pt)
  5051. % as it did when we hard-coded it.
  5052. %
  5053. % We put the result in a separate register, \doublecolumhsize, so we
  5054. % can restore it in \pagesofar, after \hsize itself has (potentially)
  5055. % been clobbered.
  5056. %
  5057. \doublecolumnhsize = \hsize
  5058. \advance\doublecolumnhsize by -.04154\hsize
  5059. \divide\doublecolumnhsize by 2
  5060. \hsize = \doublecolumnhsize
  5061. %
  5062. % Double the \vsize as well. (We don't need a separate register here,
  5063. % since nobody clobbers \vsize.)
  5064. \global\doublecolumntopgap = \topskip
  5065. \global\advance\doublecolumntopgap by -1\baselineskip
  5066. \global\advance\vsize by -1\doublecolumntopgap
  5067. \vsize = 2\vsize
  5068. \topskip=0pt
  5069. }
  5070. % The double-column output routine for all double-column pages except
  5071. % the last, which is done by \balancecolumns.
  5072. %
  5073. \def\doublecolumnout{%
  5074. \splittopskip=\topskip \splitmaxdepth=\maxdepth
  5075. % Get the available space for the double columns -- the normal
  5076. % (undoubled) page height minus any material left over from the
  5077. % previous page.
  5078. \dimen@ = \vsize
  5079. \divide\dimen@ by 2
  5080. \advance\dimen@ by -\ht\partialpage
  5081. %
  5082. % box0 will be the left-hand column, box2 the right.
  5083. \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
  5084. \onepageout\pagesofar
  5085. \unvbox255
  5086. \penalty\outputpenalty
  5087. }
  5088. %
  5089. % Re-output the contents of the output page -- any previous material,
  5090. % followed by the two boxes we just split, in box0 and box2.
  5091. \def\pagesofar{%
  5092. \unvbox\partialpage
  5093. %
  5094. \hsize = \doublecolumnhsize
  5095. \wd0=\hsize \wd2=\hsize
  5096. \vbox{%
  5097. \vskip\doublecolumntopgap
  5098. \hbox to\pagewidth{\box0\hfil\box2}}%
  5099. }
  5100. % Finished with with double columns.
  5101. \def\enddoublecolumns{%
  5102. % The following penalty ensures that the page builder is exercised
  5103. % _before_ we change the output routine. This is necessary in the
  5104. % following situation:
  5105. %
  5106. % The last section of the index consists only of a single entry.
  5107. % Before this section, \pagetotal is less than \pagegoal, so no
  5108. % break occurs before the last section starts. However, the last
  5109. % section, consisting of \initial and the single \entry, does not
  5110. % fit on the page and has to be broken off. Without the following
  5111. % penalty the page builder will not be exercised until \eject
  5112. % below, and by that time we'll already have changed the output
  5113. % routine to the \balancecolumns version, so the next-to-last
  5114. % double-column page will be processed with \balancecolumns, which
  5115. % is wrong: The two columns will go to the main vertical list, with
  5116. % the broken-off section in the recent contributions. As soon as
  5117. % the output routine finishes, TeX starts reconsidering the page
  5118. % break. The two columns and the broken-off section both fit on the
  5119. % page, because the two columns now take up only half of the page
  5120. % goal. When TeX sees \eject from below which follows the final
  5121. % section, it invokes the new output routine that we've set after
  5122. % \balancecolumns below; \onepageout will try to fit the two columns
  5123. % and the final section into the vbox of \pageheight (see
  5124. % \pagebody), causing an overfull box.
  5125. %
  5126. % Note that glue won't work here, because glue does not exercise the
  5127. % page builder, unlike penalties (see The TeXbook, pp. 280-281).
  5128. \penalty0
  5129. %
  5130. \output = {%
  5131. % Split the last of the double-column material. Leave it on the
  5132. % current page, no automatic page break.
  5133. \balancecolumns
  5134. %
  5135. % If we end up splitting too much material for the current page,
  5136. % though, there will be another page break right after this \output
  5137. % invocation ends. Having called \balancecolumns once, we do not
  5138. % want to call it again. Therefore, reset \output to its normal
  5139. % definition right away. (We hope \balancecolumns will never be
  5140. % called on to balance too much material, but if it is, this makes
  5141. % the output somewhat more palatable.)
  5142. \global\output = {\onepageout{\pagecontents\PAGE}}%
  5143. }%
  5144. \eject
  5145. \endgroup % started in \begindoublecolumns
  5146. %
  5147. % \pagegoal was set to the doubled \vsize above, since we restarted
  5148. % the current page. We're now back to normal single-column
  5149. % typesetting, so reset \pagegoal to the normal \vsize (after the
  5150. % \endgroup where \vsize got restored).
  5151. \pagegoal = \vsize
  5152. }
  5153. %
  5154. % Only called for the last of the double column material. \doublecolumnout
  5155. % does the others.
  5156. \def\balancecolumns{%
  5157. \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
  5158. \dimen@ = \ht0
  5159. \advance\dimen@ by \topskip
  5160. \advance\dimen@ by-\baselineskip
  5161. \ifdim\dimen@<14\baselineskip
  5162. % Don't split a short final column in two.
  5163. \setbox2=\vbox{}%
  5164. \else
  5165. \divide\dimen@ by 2 % target to split to
  5166. \dimen@ii = \dimen@
  5167. \splittopskip = \topskip
  5168. % Loop until the second column is no higher than the first
  5169. {%
  5170. \vbadness = 10000
  5171. \loop
  5172. \global\setbox3 = \copy0
  5173. \global\setbox1 = \vsplit3 to \dimen@
  5174. % Remove glue from bottom of first column to
  5175. % make sure it is higher than the second.
  5176. \global\setbox1 = \vbox{\unvbox1\unpenalty\unskip}%
  5177. \ifdim\ht3>\ht1
  5178. \global\advance\dimen@ by 1pt
  5179. \repeat
  5180. }%
  5181. \multiply\dimen@ii by 4
  5182. \divide\dimen@ii by 5
  5183. \ifdim\ht3<\dimen@ii
  5184. % Column heights are too different, so don't make their bottoms
  5185. % flush with each other. The glue at the end of the second column
  5186. % allows a second column to stretch, reducing the difference in
  5187. % height between the two.
  5188. \setbox0=\vbox to\dimen@{\unvbox1\vfill}%
  5189. \setbox2=\vbox to\dimen@{\unvbox3\vskip 0pt plus 0.3\ht0}%
  5190. \else
  5191. \setbox0=\vbox to\dimen@{\unvbox1}%
  5192. \setbox2=\vbox to\dimen@{\unvbox3}%
  5193. \fi
  5194. \fi
  5195. %
  5196. \pagesofar
  5197. }
  5198. \catcode`\@ = \other
  5199. \message{sectioning,}
  5200. % Chapters, sections, etc.
  5201. % Let's start with @part.
  5202. \outer\parseargdef\part{\partzzz{#1}}
  5203. \def\partzzz#1{%
  5204. \chapoddpage
  5205. \null
  5206. \vskip.3\vsize % move it down on the page a bit
  5207. \begingroup
  5208. \noindent \titlefonts\rmisbold #1\par % the text
  5209. \let\lastnode=\empty % no node to associate with
  5210. \writetocentry{part}{#1}{}% but put it in the toc
  5211. \headingsoff % no headline or footline on the part page
  5212. % This outputs a mark at the end of the page that clears \thischapter
  5213. % and \thissection, as is done in \startcontents.
  5214. \let\pchapsepmacro\relax
  5215. \chapmacro{}{Yomitfromtoc}{}%
  5216. \chapoddpage
  5217. \endgroup
  5218. }
  5219. % \unnumberedno is an oxymoron. But we count the unnumbered
  5220. % sections so that we can refer to them unambiguously in the pdf
  5221. % outlines by their "section number". We avoid collisions with chapter
  5222. % numbers by starting them at 10000. (If a document ever has 10000
  5223. % chapters, we're in trouble anyway, I'm sure.)
  5224. \newcount\unnumberedno \unnumberedno = 10000
  5225. \newcount\chapno
  5226. \newcount\secno \secno=0
  5227. \newcount\subsecno \subsecno=0
  5228. \newcount\subsubsecno \subsubsecno=0
  5229. % This counter is funny since it counts through charcodes of letters A, B, ...
  5230. \newcount\appendixno \appendixno = `\@
  5231. %
  5232. % \def\appendixletter{\char\the\appendixno}
  5233. % We do the following ugly conditional instead of the above simple
  5234. % construct for the sake of pdftex, which needs the actual
  5235. % letter in the expansion, not just typeset.
  5236. %
  5237. \def\appendixletter{%
  5238. \ifnum\appendixno=`A A%
  5239. \else\ifnum\appendixno=`B B%
  5240. \else\ifnum\appendixno=`C C%
  5241. \else\ifnum\appendixno=`D D%
  5242. \else\ifnum\appendixno=`E E%
  5243. \else\ifnum\appendixno=`F F%
  5244. \else\ifnum\appendixno=`G G%
  5245. \else\ifnum\appendixno=`H H%
  5246. \else\ifnum\appendixno=`I I%
  5247. \else\ifnum\appendixno=`J J%
  5248. \else\ifnum\appendixno=`K K%
  5249. \else\ifnum\appendixno=`L L%
  5250. \else\ifnum\appendixno=`M M%
  5251. \else\ifnum\appendixno=`N N%
  5252. \else\ifnum\appendixno=`O O%
  5253. \else\ifnum\appendixno=`P P%
  5254. \else\ifnum\appendixno=`Q Q%
  5255. \else\ifnum\appendixno=`R R%
  5256. \else\ifnum\appendixno=`S S%
  5257. \else\ifnum\appendixno=`T T%
  5258. \else\ifnum\appendixno=`U U%
  5259. \else\ifnum\appendixno=`V V%
  5260. \else\ifnum\appendixno=`W W%
  5261. \else\ifnum\appendixno=`X X%
  5262. \else\ifnum\appendixno=`Y Y%
  5263. \else\ifnum\appendixno=`Z Z%
  5264. % The \the is necessary, despite appearances, because \appendixletter is
  5265. % expanded while writing the .toc file. \char\appendixno is not
  5266. % expandable, thus it is written literally, thus all appendixes come out
  5267. % with the same letter (or @) in the toc without it.
  5268. \else\char\the\appendixno
  5269. \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
  5270. \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
  5271. % Each @chapter defines these (using marks) as the number+name, number
  5272. % and name of the chapter. Page headings and footings can use
  5273. % these. @section does likewise.
  5274. \def\thischapter{}
  5275. \def\thischapternum{}
  5276. \def\thischaptername{}
  5277. \def\thissection{}
  5278. \def\thissectionnum{}
  5279. \def\thissectionname{}
  5280. \newcount\absseclevel % used to calculate proper heading level
  5281. \newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
  5282. % @raisesections: treat @section as chapter, @subsection as section, etc.
  5283. \def\raisesections{\global\advance\secbase by -1}
  5284. \let\up=\raisesections % original BFox name
  5285. % @lowersections: treat @chapter as section, @section as subsection, etc.
  5286. \def\lowersections{\global\advance\secbase by 1}
  5287. \let\down=\lowersections % original BFox name
  5288. % we only have subsub.
  5289. \chardef\maxseclevel = 3
  5290. %
  5291. % A numbered section within an unnumbered changes to unnumbered too.
  5292. % To achieve this, remember the "biggest" unnum. sec. we are currently in:
  5293. \chardef\unnlevel = \maxseclevel
  5294. %
  5295. % Trace whether the current chapter is an appendix or not:
  5296. % \chapheadtype is "N" or "A", unnumbered chapters are ignored.
  5297. \def\chapheadtype{N}
  5298. % Choose a heading macro
  5299. % #1 is heading type
  5300. % #2 is heading level
  5301. % #3 is text for heading
  5302. \def\genhead#1#2#3{%
  5303. % Compute the abs. sec. level:
  5304. \absseclevel=#2
  5305. \advance\absseclevel by \secbase
  5306. % Make sure \absseclevel doesn't fall outside the range:
  5307. \ifnum \absseclevel < 0
  5308. \absseclevel = 0
  5309. \else
  5310. \ifnum \absseclevel > 3
  5311. \absseclevel = 3
  5312. \fi
  5313. \fi
  5314. % The heading type:
  5315. \def\headtype{#1}%
  5316. \if \headtype U%
  5317. \ifnum \absseclevel < \unnlevel
  5318. \chardef\unnlevel = \absseclevel
  5319. \fi
  5320. \else
  5321. % Check for appendix sections:
  5322. \ifnum \absseclevel = 0
  5323. \edef\chapheadtype{\headtype}%
  5324. \else
  5325. \if \headtype A\if \chapheadtype N%
  5326. \errmessage{@appendix... within a non-appendix chapter}%
  5327. \fi\fi
  5328. \fi
  5329. % Check for numbered within unnumbered:
  5330. \ifnum \absseclevel > \unnlevel
  5331. \def\headtype{U}%
  5332. \else
  5333. \chardef\unnlevel = 3
  5334. \fi
  5335. \fi
  5336. % Now print the heading:
  5337. \if \headtype U%
  5338. \ifcase\absseclevel
  5339. \unnumberedzzz{#3}%
  5340. \or \unnumberedseczzz{#3}%
  5341. \or \unnumberedsubseczzz{#3}%
  5342. \or \unnumberedsubsubseczzz{#3}%
  5343. \fi
  5344. \else
  5345. \if \headtype A%
  5346. \ifcase\absseclevel
  5347. \appendixzzz{#3}%
  5348. \or \appendixsectionzzz{#3}%
  5349. \or \appendixsubseczzz{#3}%
  5350. \or \appendixsubsubseczzz{#3}%
  5351. \fi
  5352. \else
  5353. \ifcase\absseclevel
  5354. \chapterzzz{#3}%
  5355. \or \seczzz{#3}%
  5356. \or \numberedsubseczzz{#3}%
  5357. \or \numberedsubsubseczzz{#3}%
  5358. \fi
  5359. \fi
  5360. \fi
  5361. \suppressfirstparagraphindent
  5362. }
  5363. % an interface:
  5364. \def\numhead{\genhead N}
  5365. \def\apphead{\genhead A}
  5366. \def\unnmhead{\genhead U}
  5367. % @chapter, @appendix, @unnumbered. Increment top-level counter, reset
  5368. % all lower-level sectioning counters to zero.
  5369. %
  5370. % Also set \chaplevelprefix, which we prepend to @float sequence numbers
  5371. % (e.g., figures), q.v. By default (before any chapter), that is empty.
  5372. \let\chaplevelprefix = \empty
  5373. %
  5374. \outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz
  5375. \def\chapterzzz#1{%
  5376. % section resetting is \global in case the chapter is in a group, such
  5377. % as an @include file.
  5378. \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
  5379. \global\advance\chapno by 1
  5380. %
  5381. % Used for \float.
  5382. \gdef\chaplevelprefix{\the\chapno.}%
  5383. \resetallfloatnos
  5384. %
  5385. % \putwordChapter can contain complex things in translations.
  5386. \toks0=\expandafter{\putwordChapter}%
  5387. \message{\the\toks0 \space \the\chapno}%
  5388. %
  5389. % Write the actual heading.
  5390. \chapmacro{#1}{Ynumbered}{\the\chapno}%
  5391. %
  5392. % So @section and the like are numbered underneath this chapter.
  5393. \global\let\section = \numberedsec
  5394. \global\let\subsection = \numberedsubsec
  5395. \global\let\subsubsection = \numberedsubsubsec
  5396. }
  5397. \outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz
  5398. %
  5399. \def\appendixzzz#1{%
  5400. \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
  5401. \global\advance\appendixno by 1
  5402. \gdef\chaplevelprefix{\appendixletter.}%
  5403. \resetallfloatnos
  5404. %
  5405. % \putwordAppendix can contain complex things in translations.
  5406. \toks0=\expandafter{\putwordAppendix}%
  5407. \message{\the\toks0 \space \appendixletter}%
  5408. %
  5409. \chapmacro{#1}{Yappendix}{\appendixletter}%
  5410. %
  5411. \global\let\section = \appendixsec
  5412. \global\let\subsection = \appendixsubsec
  5413. \global\let\subsubsection = \appendixsubsubsec
  5414. }
  5415. % normally unnmhead0 calls unnumberedzzz:
  5416. \outer\parseargdef\unnumbered{\unnmhead0{#1}}
  5417. \def\unnumberedzzz#1{%
  5418. \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
  5419. \global\advance\unnumberedno by 1
  5420. %
  5421. % Since an unnumbered has no number, no prefix for figures.
  5422. \global\let\chaplevelprefix = \empty
  5423. \resetallfloatnos
  5424. %
  5425. % This used to be simply \message{#1}, but TeX fully expands the
  5426. % argument to \message. Therefore, if #1 contained @-commands, TeX
  5427. % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
  5428. % expanded @cite (which turns out to cause errors because \cite is meant
  5429. % to be executed, not expanded).
  5430. %
  5431. % Anyway, we don't want the fully-expanded definition of @cite to appear
  5432. % as a result of the \message, we just want `@cite' itself. We use
  5433. % \the<toks register> to achieve this: TeX expands \the<toks> only once,
  5434. % simply yielding the contents of <toks register>. (We also do this for
  5435. % the toc entries.)
  5436. \toks0 = {#1}%
  5437. \message{(\the\toks0)}%
  5438. %
  5439. \chapmacro{#1}{Ynothing}{\the\unnumberedno}%
  5440. %
  5441. \global\let\section = \unnumberedsec
  5442. \global\let\subsection = \unnumberedsubsec
  5443. \global\let\subsubsection = \unnumberedsubsubsec
  5444. }
  5445. % @centerchap is like @unnumbered, but the heading is centered.
  5446. \outer\parseargdef\centerchap{%
  5447. \let\centerparametersmaybe = \centerparameters
  5448. \unnmhead0{#1}%
  5449. \let\centerparametersmaybe = \relax
  5450. }
  5451. % @top is like @unnumbered.
  5452. \let\top\unnumbered
  5453. % Sections.
  5454. %
  5455. \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
  5456. \def\seczzz#1{%
  5457. \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
  5458. \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
  5459. }
  5460. % normally calls appendixsectionzzz:
  5461. \outer\parseargdef\appendixsection{\apphead1{#1}}
  5462. \def\appendixsectionzzz#1{%
  5463. \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
  5464. \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
  5465. }
  5466. \let\appendixsec\appendixsection
  5467. % normally calls unnumberedseczzz:
  5468. \outer\parseargdef\unnumberedsec{\unnmhead1{#1}}
  5469. \def\unnumberedseczzz#1{%
  5470. \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
  5471. \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
  5472. }
  5473. % Subsections.
  5474. %
  5475. % normally calls numberedsubseczzz:
  5476. \outer\parseargdef\numberedsubsec{\numhead2{#1}}
  5477. \def\numberedsubseczzz#1{%
  5478. \global\subsubsecno=0 \global\advance\subsecno by 1
  5479. \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
  5480. }
  5481. % normally calls appendixsubseczzz:
  5482. \outer\parseargdef\appendixsubsec{\apphead2{#1}}
  5483. \def\appendixsubseczzz#1{%
  5484. \global\subsubsecno=0 \global\advance\subsecno by 1
  5485. \sectionheading{#1}{subsec}{Yappendix}%
  5486. {\appendixletter.\the\secno.\the\subsecno}%
  5487. }
  5488. % normally calls unnumberedsubseczzz:
  5489. \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}}
  5490. \def\unnumberedsubseczzz#1{%
  5491. \global\subsubsecno=0 \global\advance\subsecno by 1
  5492. \sectionheading{#1}{subsec}{Ynothing}%
  5493. {\the\unnumberedno.\the\secno.\the\subsecno}%
  5494. }
  5495. % Subsubsections.
  5496. %
  5497. % normally numberedsubsubseczzz:
  5498. \outer\parseargdef\numberedsubsubsec{\numhead3{#1}}
  5499. \def\numberedsubsubseczzz#1{%
  5500. \global\advance\subsubsecno by 1
  5501. \sectionheading{#1}{subsubsec}{Ynumbered}%
  5502. {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
  5503. }
  5504. % normally appendixsubsubseczzz:
  5505. \outer\parseargdef\appendixsubsubsec{\apphead3{#1}}
  5506. \def\appendixsubsubseczzz#1{%
  5507. \global\advance\subsubsecno by 1
  5508. \sectionheading{#1}{subsubsec}{Yappendix}%
  5509. {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
  5510. }
  5511. % normally unnumberedsubsubseczzz:
  5512. \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}}
  5513. \def\unnumberedsubsubseczzz#1{%
  5514. \global\advance\subsubsecno by 1
  5515. \sectionheading{#1}{subsubsec}{Ynothing}%
  5516. {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}%
  5517. }
  5518. % These macros control what the section commands do, according
  5519. % to what kind of chapter we are in (ordinary, appendix, or unnumbered).
  5520. % Define them by default for a numbered chapter.
  5521. \let\section = \numberedsec
  5522. \let\subsection = \numberedsubsec
  5523. \let\subsubsection = \numberedsubsubsec
  5524. % Define @majorheading, @heading and @subheading
  5525. \def\majorheading{%
  5526. {\advance\chapheadingskip by 10pt \chapbreak }%
  5527. \parsearg\chapheadingzzz
  5528. }
  5529. \def\chapheading{\chapbreak \parsearg\chapheadingzzz}
  5530. \def\chapheadingzzz#1{%
  5531. \vbox{\chapfonts \raggedtitlesettings #1\par}%
  5532. \nobreak\bigskip \nobreak
  5533. \suppressfirstparagraphindent
  5534. }
  5535. % @heading, @subheading, @subsubheading.
  5536. \parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{}
  5537. \suppressfirstparagraphindent}
  5538. \parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{}
  5539. \suppressfirstparagraphindent}
  5540. \parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
  5541. \suppressfirstparagraphindent}
  5542. % These macros generate a chapter, section, etc. heading only
  5543. % (including whitespace, linebreaking, etc. around it),
  5544. % given all the information in convenient, parsed form.
  5545. % Args are the skip and penalty (usually negative)
  5546. \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
  5547. % Parameter controlling skip before chapter headings (if needed)
  5548. \newskip\chapheadingskip
  5549. % Define plain chapter starts, and page on/off switching for it.
  5550. \def\chapbreak{\dobreak \chapheadingskip {-4000}}
  5551. % Start a new page
  5552. \def\chappager{\par\vfill\supereject}
  5553. % \chapoddpage - start on an odd page for a new chapter
  5554. % Because \domark is called before \chapoddpage, the filler page will
  5555. % get the headings for the next chapter, which is wrong. But we don't
  5556. % care -- we just disable all headings on the filler page.
  5557. \def\chapoddpage{%
  5558. \chappager
  5559. \ifodd\pageno \else
  5560. \begingroup
  5561. \headingsoff
  5562. \null
  5563. \chappager
  5564. \endgroup
  5565. \fi
  5566. }
  5567. \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
  5568. \def\CHAPPAGoff{%
  5569. \global\let\contentsalignmacro = \chappager
  5570. \global\let\pchapsepmacro=\chapbreak
  5571. \global\let\pagealignmacro=\chappager}
  5572. \def\CHAPPAGon{%
  5573. \global\let\contentsalignmacro = \chappager
  5574. \global\let\pchapsepmacro=\chappager
  5575. \global\let\pagealignmacro=\chappager
  5576. \global\def\HEADINGSon{\HEADINGSsingle}}
  5577. \def\CHAPPAGodd{%
  5578. \global\let\contentsalignmacro = \chapoddpage
  5579. \global\let\pchapsepmacro=\chapoddpage
  5580. \global\let\pagealignmacro=\chapoddpage
  5581. \global\def\HEADINGSon{\HEADINGSdouble}}
  5582. \CHAPPAGon
  5583. % \chapmacro - Chapter opening.
  5584. %
  5585. % #1 is the text, #2 is the section type (Ynumbered, Ynothing,
  5586. % Yappendix, Yomitfromtoc), #3 the chapter number.
  5587. % Not used for @heading series.
  5588. %
  5589. % To test against our argument.
  5590. \def\Ynothingkeyword{Ynothing}
  5591. \def\Yappendixkeyword{Yappendix}
  5592. \def\Yomitfromtockeyword{Yomitfromtoc}
  5593. %
  5594. \def\chapmacro#1#2#3{%
  5595. \checkenv{}% chapters, etc., should not start inside an environment.
  5596. %
  5597. % Insert the first mark before the heading break (see notes for \domark).
  5598. \let\prevchapterdefs=\lastchapterdefs
  5599. \let\prevsectiondefs=\lastsectiondefs
  5600. \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
  5601. \gdef\thissection{}}%
  5602. %
  5603. \def\temptype{#2}%
  5604. \ifx\temptype\Ynothingkeyword
  5605. \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
  5606. \gdef\thischapter{\thischaptername}}%
  5607. \else\ifx\temptype\Yomitfromtockeyword
  5608. \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
  5609. \gdef\thischapter{}}%
  5610. \else\ifx\temptype\Yappendixkeyword
  5611. \toks0={#1}%
  5612. \xdef\lastchapterdefs{%
  5613. \gdef\noexpand\thischaptername{\the\toks0}%
  5614. \gdef\noexpand\thischapternum{\appendixletter}%
  5615. % \noexpand\putwordAppendix avoids expanding indigestible
  5616. % commands in some of the translations.
  5617. \gdef\noexpand\thischapter{\noexpand\putwordAppendix{}
  5618. \noexpand\thischapternum:
  5619. \noexpand\thischaptername}%
  5620. }%
  5621. \else
  5622. \toks0={#1}%
  5623. \xdef\lastchapterdefs{%
  5624. \gdef\noexpand\thischaptername{\the\toks0}%
  5625. \gdef\noexpand\thischapternum{\the\chapno}%
  5626. % \noexpand\putwordChapter avoids expanding indigestible
  5627. % commands in some of the translations.
  5628. \gdef\noexpand\thischapter{\noexpand\putwordChapter{}
  5629. \noexpand\thischapternum:
  5630. \noexpand\thischaptername}%
  5631. }%
  5632. \fi\fi\fi
  5633. %
  5634. % Output the mark. Pass it through \safewhatsit, to take care of
  5635. % the preceding space.
  5636. \safewhatsit\domark
  5637. %
  5638. % Insert the chapter heading break.
  5639. \pchapsepmacro
  5640. %
  5641. % Now the second mark, after the heading break. No break points
  5642. % between here and the heading.
  5643. \let\prevchapterdefs=\lastchapterdefs
  5644. \let\prevsectiondefs=\lastsectiondefs
  5645. \domark
  5646. %
  5647. {%
  5648. \chapfonts \rmisbold
  5649. \let\footnote=\errfootnoteheading % give better error message
  5650. %
  5651. % Have to define \lastsection before calling \donoderef, because the
  5652. % xref code eventually uses it. On the other hand, it has to be called
  5653. % after \pchapsepmacro, or the headline will change too soon.
  5654. \gdef\lastsection{#1}%
  5655. %
  5656. % Only insert the separating space if we have a chapter/appendix
  5657. % number, and don't print the unnumbered ``number''.
  5658. \ifx\temptype\Ynothingkeyword
  5659. \setbox0 = \hbox{}%
  5660. \def\toctype{unnchap}%
  5661. \else\ifx\temptype\Yomitfromtockeyword
  5662. \setbox0 = \hbox{}% contents like unnumbered, but no toc entry
  5663. \def\toctype{omit}%
  5664. \else\ifx\temptype\Yappendixkeyword
  5665. \setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
  5666. \def\toctype{app}%
  5667. \else
  5668. \setbox0 = \hbox{#3\enspace}%
  5669. \def\toctype{numchap}%
  5670. \fi\fi\fi
  5671. %
  5672. % Write the toc entry for this chapter. Must come before the
  5673. % \donoderef, because we include the current node name in the toc
  5674. % entry, and \donoderef resets it to empty.
  5675. \writetocentry{\toctype}{#1}{#3}%
  5676. %
  5677. % For pdftex, we have to write out the node definition (aka, make
  5678. % the pdfdest) after any page break, but before the actual text has
  5679. % been typeset. If the destination for the pdf outline is after the
  5680. % text, then jumping from the outline may wind up with the text not
  5681. % being visible, for instance under high magnification.
  5682. \donoderef{#2}%
  5683. %
  5684. % Typeset the actual heading.
  5685. \nobreak % Avoid page breaks at the interline glue.
  5686. \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe
  5687. \unhbox0 #1\par}%
  5688. }%
  5689. \nobreak\bigskip % no page break after a chapter title
  5690. \nobreak
  5691. }
  5692. % @centerchap -- centered and unnumbered.
  5693. \let\centerparametersmaybe = \relax
  5694. \def\centerparameters{%
  5695. \advance\rightskip by 3\rightskip
  5696. \leftskip = \rightskip
  5697. \parfillskip = 0pt
  5698. }
  5699. % I don't think this chapter style is supported any more, so I'm not
  5700. % updating it with the new noderef stuff. We'll see. --karl, 11aug03.
  5701. %
  5702. \def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
  5703. %
  5704. \def\unnchfopen #1{%
  5705. \chapoddpage
  5706. \vbox{\chapfonts \raggedtitlesettings #1\par}%
  5707. \nobreak\bigskip\nobreak
  5708. }
  5709. \def\chfopen #1#2{\chapoddpage {\chapfonts
  5710. \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
  5711. \par\penalty 5000 %
  5712. }
  5713. \def\centerchfopen #1{%
  5714. \chapoddpage
  5715. \vbox{\chapfonts \raggedtitlesettings \hfill #1\hfill}%
  5716. \nobreak\bigskip \nobreak
  5717. }
  5718. \def\CHAPFopen{%
  5719. \global\let\chapmacro=\chfopen
  5720. \global\let\centerchapmacro=\centerchfopen}
  5721. % Section titles. These macros combine the section number parts and
  5722. % call the generic \sectionheading to do the printing.
  5723. %
  5724. \newskip\secheadingskip
  5725. \def\secheadingbreak{\dobreak \secheadingskip{-1000}}
  5726. % Subsection titles.
  5727. \newskip\subsecheadingskip
  5728. \def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}}
  5729. % Subsubsection titles.
  5730. \def\subsubsecheadingskip{\subsecheadingskip}
  5731. \def\subsubsecheadingbreak{\subsecheadingbreak}
  5732. % Print any size, any type, section title.
  5733. %
  5734. % #1 is the text of the title,
  5735. % #2 is the section level (sec/subsec/subsubsec),
  5736. % #3 is the section type (Ynumbered, Ynothing, Yappendix, Yomitfromtoc),
  5737. % #4 is the section number.
  5738. %
  5739. \def\seckeyword{sec}
  5740. %
  5741. \def\sectionheading#1#2#3#4{%
  5742. {%
  5743. \def\sectionlevel{#2}%
  5744. \def\temptype{#3}%
  5745. %
  5746. % It is ok for the @heading series commands to appear inside an
  5747. % environment (it's been historically allowed, though the logic is
  5748. % dubious), but not the others.
  5749. \ifx\temptype\Yomitfromtockeyword\else
  5750. \checkenv{}% non-@*heading should not be in an environment.
  5751. \fi
  5752. \let\footnote=\errfootnoteheading
  5753. %
  5754. % Switch to the right set of fonts.
  5755. \csname #2fonts\endcsname \rmisbold
  5756. %
  5757. % Insert first mark before the heading break (see notes for \domark).
  5758. \let\prevsectiondefs=\lastsectiondefs
  5759. \ifx\temptype\Ynothingkeyword
  5760. \ifx\sectionlevel\seckeyword
  5761. \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
  5762. \gdef\thissection{\thissectionname}}%
  5763. \fi
  5764. \else\ifx\temptype\Yomitfromtockeyword
  5765. % Don't redefine \thissection.
  5766. \else\ifx\temptype\Yappendixkeyword
  5767. \ifx\sectionlevel\seckeyword
  5768. \toks0={#1}%
  5769. \xdef\lastsectiondefs{%
  5770. \gdef\noexpand\thissectionname{\the\toks0}%
  5771. \gdef\noexpand\thissectionnum{#4}%
  5772. % \noexpand\putwordSection avoids expanding indigestible
  5773. % commands in some of the translations.
  5774. \gdef\noexpand\thissection{\noexpand\putwordSection{}
  5775. \noexpand\thissectionnum:
  5776. \noexpand\thissectionname}%
  5777. }%
  5778. \fi
  5779. \else
  5780. \ifx\sectionlevel\seckeyword
  5781. \toks0={#1}%
  5782. \xdef\lastsectiondefs{%
  5783. \gdef\noexpand\thissectionname{\the\toks0}%
  5784. \gdef\noexpand\thissectionnum{#4}%
  5785. % \noexpand\putwordSection avoids expanding indigestible
  5786. % commands in some of the translations.
  5787. \gdef\noexpand\thissection{\noexpand\putwordSection{}
  5788. \noexpand\thissectionnum:
  5789. \noexpand\thissectionname}%
  5790. }%
  5791. \fi
  5792. \fi\fi\fi
  5793. %
  5794. % Go into vertical mode. Usually we'll already be there, but we
  5795. % don't want the following whatsit to end up in a preceding paragraph
  5796. % if the document didn't happen to have a blank line.
  5797. \par
  5798. %
  5799. % Output the mark. Pass it through \safewhatsit, to take care of
  5800. % the preceding space.
  5801. \safewhatsit\domark
  5802. %
  5803. % Insert space above the heading.
  5804. \csname #2headingbreak\endcsname
  5805. %
  5806. % Now the second mark, after the heading break. No break points
  5807. % between here and the heading.
  5808. \global\let\prevsectiondefs=\lastsectiondefs
  5809. \domark
  5810. %
  5811. % Only insert the space after the number if we have a section number.
  5812. \ifx\temptype\Ynothingkeyword
  5813. \setbox0 = \hbox{}%
  5814. \def\toctype{unn}%
  5815. \gdef\lastsection{#1}%
  5816. \else\ifx\temptype\Yomitfromtockeyword
  5817. % for @headings -- no section number, don't include in toc,
  5818. % and don't redefine \lastsection.
  5819. \setbox0 = \hbox{}%
  5820. \def\toctype{omit}%
  5821. \let\sectionlevel=\empty
  5822. \else\ifx\temptype\Yappendixkeyword
  5823. \setbox0 = \hbox{#4\enspace}%
  5824. \def\toctype{app}%
  5825. \gdef\lastsection{#1}%
  5826. \else
  5827. \setbox0 = \hbox{#4\enspace}%
  5828. \def\toctype{num}%
  5829. \gdef\lastsection{#1}%
  5830. \fi\fi\fi
  5831. %
  5832. % Write the toc entry (before \donoderef). See comments in \chapmacro.
  5833. \writetocentry{\toctype\sectionlevel}{#1}{#4}%
  5834. %
  5835. % Write the node reference (= pdf destination for pdftex).
  5836. % Again, see comments in \chapmacro.
  5837. \donoderef{#3}%
  5838. %
  5839. % Interline glue will be inserted when the vbox is completed.
  5840. % That glue will be a valid breakpoint for the page, since it'll be
  5841. % preceded by a whatsit (usually from the \donoderef, or from the
  5842. % \writetocentry if there was no node). We don't want to allow that
  5843. % break, since then the whatsits could end up on page n while the
  5844. % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000.
  5845. \nobreak
  5846. %
  5847. % Output the actual section heading.
  5848. \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
  5849. \hangindent=\wd0 % zero if no section number
  5850. \unhbox0 #1}%
  5851. }%
  5852. % Add extra space after the heading -- half of whatever came above it.
  5853. % Don't allow stretch, though.
  5854. \kern .5 \csname #2headingskip\endcsname
  5855. %
  5856. % Do not let the kern be a potential breakpoint, as it would be if it
  5857. % was followed by glue.
  5858. \nobreak
  5859. %
  5860. % We'll almost certainly start a paragraph next, so don't let that
  5861. % glue accumulate. (Not a breakpoint because it's preceded by a
  5862. % discardable item.) However, when a paragraph is not started next
  5863. % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out
  5864. % or the negative glue will cause weirdly wrong output, typically
  5865. % obscuring the section heading with something else.
  5866. \vskip-\parskip
  5867. %
  5868. % This is so the last item on the main vertical list is a known
  5869. % \penalty > 10000, so \startdefun, etc., can recognize the situation
  5870. % and do the needful.
  5871. \penalty 10001
  5872. }
  5873. \message{toc,}
  5874. % Table of contents.
  5875. \newwrite\tocfile
  5876. % Write an entry to the toc file, opening it if necessary.
  5877. % Called from @chapter, etc.
  5878. %
  5879. % Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno}
  5880. % We append the current node name (if any) and page number as additional
  5881. % arguments for the \{chap,sec,...}entry macros which will eventually
  5882. % read this. The node name is used in the pdf outlines as the
  5883. % destination to jump to.
  5884. %
  5885. % We open the .toc file for writing here instead of at @setfilename (or
  5886. % any other fixed time) so that @contents can be anywhere in the document.
  5887. % But if #1 is `omit', then we don't do anything. This is used for the
  5888. % table of contents chapter openings themselves.
  5889. %
  5890. \newif\iftocfileopened
  5891. \def\omitkeyword{omit}%
  5892. %
  5893. \def\writetocentry#1#2#3{%
  5894. \edef\writetoctype{#1}%
  5895. \ifx\writetoctype\omitkeyword \else
  5896. \iftocfileopened\else
  5897. \immediate\openout\tocfile = \jobname.toc
  5898. \global\tocfileopenedtrue
  5899. \fi
  5900. %
  5901. \iflinks
  5902. {\atdummies
  5903. \edef\temp{%
  5904. \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}%
  5905. \temp
  5906. }%
  5907. \fi
  5908. \fi
  5909. %
  5910. % Tell \shipout to create a pdf destination on each page, if we're
  5911. % writing pdf. These are used in the table of contents. We can't
  5912. % just write one on every page because the title pages are numbered
  5913. % 1 and 2 (the page numbers aren't printed), and so are the first
  5914. % two pages of the document. Thus, we'd have two destinations named
  5915. % `1', and two named `2'.
  5916. \ifpdf \global\pdfmakepagedesttrue \fi
  5917. }
  5918. % These characters do not print properly in the Computer Modern roman
  5919. % fonts, so we must take special care. This is more or less redundant
  5920. % with the Texinfo input format setup at the end of this file.
  5921. %
  5922. \def\activecatcodes{%
  5923. \catcode`\"=\active
  5924. \catcode`\$=\active
  5925. \catcode`\<=\active
  5926. \catcode`\>=\active
  5927. \catcode`\\=\active
  5928. \catcode`\^=\active
  5929. \catcode`\_=\active
  5930. \catcode`\|=\active
  5931. \catcode`\~=\active
  5932. }
  5933. % Read the toc file, which is essentially Texinfo input.
  5934. \def\readtocfile{%
  5935. \setupdatafile
  5936. \activecatcodes
  5937. \input \tocreadfilename
  5938. }
  5939. \newskip\contentsrightmargin \contentsrightmargin=1in
  5940. \newcount\savepageno
  5941. \newcount\lastnegativepageno \lastnegativepageno = -1
  5942. % Prepare to read what we've written to \tocfile.
  5943. %
  5944. \def\startcontents#1{%
  5945. % If @setchapternewpage on, and @headings double, the contents should
  5946. % start on an odd page, unlike chapters. Thus, we maintain
  5947. % \contentsalignmacro in parallel with \pagealignmacro.
  5948. % From: Torbjorn Granlund <tege@matematik.su.se>
  5949. \contentsalignmacro
  5950. \immediate\closeout\tocfile
  5951. %
  5952. % Don't need to put `Contents' or `Short Contents' in the headline.
  5953. % It is abundantly clear what they are.
  5954. \chapmacro{#1}{Yomitfromtoc}{}%
  5955. %
  5956. \savepageno = \pageno
  5957. \begingroup % Set up to handle contents files properly.
  5958. \raggedbottom % Worry more about breakpoints than the bottom.
  5959. \entryrightmargin=\contentsrightmargin % Don't use the full line length.
  5960. %
  5961. % Roman numerals for page numbers.
  5962. \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
  5963. }
  5964. % redefined for the two-volume lispref. We always output on
  5965. % \jobname.toc even if this is redefined.
  5966. %
  5967. \def\tocreadfilename{\jobname.toc}
  5968. % Normal (long) toc.
  5969. %
  5970. \def\contents{%
  5971. \startcontents{\putwordTOC}%
  5972. \openin 1 \tocreadfilename\space
  5973. \ifeof 1 \else
  5974. \readtocfile
  5975. \fi
  5976. \vfill \eject
  5977. \contentsalignmacro % in case @setchapternewpage odd is in effect
  5978. \ifeof 1 \else
  5979. \pdfmakeoutlines
  5980. \fi
  5981. \closein 1
  5982. \endgroup
  5983. \lastnegativepageno = \pageno
  5984. \global\pageno = \savepageno
  5985. }
  5986. % And just the chapters.
  5987. \def\summarycontents{%
  5988. \startcontents{\putwordShortTOC}%
  5989. %
  5990. \let\partentry = \shortpartentry
  5991. \let\numchapentry = \shortchapentry
  5992. \let\appentry = \shortchapentry
  5993. \let\unnchapentry = \shortunnchapentry
  5994. % We want a true roman here for the page numbers.
  5995. \secfonts
  5996. \let\rm=\shortcontrm \let\bf=\shortcontbf
  5997. \let\sl=\shortcontsl \let\tt=\shortconttt
  5998. \rm
  5999. \hyphenpenalty = 10000
  6000. \advance\baselineskip by 1pt % Open it up a little.
  6001. \def\numsecentry##1##2##3##4{}
  6002. \let\appsecentry = \numsecentry
  6003. \let\unnsecentry = \numsecentry
  6004. \let\numsubsecentry = \numsecentry
  6005. \let\appsubsecentry = \numsecentry
  6006. \let\unnsubsecentry = \numsecentry
  6007. \let\numsubsubsecentry = \numsecentry
  6008. \let\appsubsubsecentry = \numsecentry
  6009. \let\unnsubsubsecentry = \numsecentry
  6010. \openin 1 \tocreadfilename\space
  6011. \ifeof 1 \else
  6012. \readtocfile
  6013. \fi
  6014. \closein 1
  6015. \vfill \eject
  6016. \contentsalignmacro % in case @setchapternewpage odd is in effect
  6017. \endgroup
  6018. \lastnegativepageno = \pageno
  6019. \global\pageno = \savepageno
  6020. }
  6021. \let\shortcontents = \summarycontents
  6022. % Typeset the label for a chapter or appendix for the short contents.
  6023. % The arg is, e.g., `A' for an appendix, or `3' for a chapter.
  6024. %
  6025. \def\shortchaplabel#1{%
  6026. % This space should be enough, since a single number is .5em, and the
  6027. % widest letter (M) is 1em, at least in the Computer Modern fonts.
  6028. % But use \hss just in case.
  6029. % (This space doesn't include the extra space that gets added after
  6030. % the label; that gets put in by \shortchapentry above.)
  6031. %
  6032. % We'd like to right-justify chapter numbers, but that looks strange
  6033. % with appendix letters. And right-justifying numbers and
  6034. % left-justifying letters looks strange when there is less than 10
  6035. % chapters. Have to read the whole toc once to know how many chapters
  6036. % there are before deciding ...
  6037. \hbox to 1em{#1\hss}%
  6038. }
  6039. % These macros generate individual entries in the table of contents.
  6040. % The first argument is the chapter or section name.
  6041. % The last argument is the page number.
  6042. % The arguments in between are the chapter number, section number, ...
  6043. % Parts, in the main contents. Replace the part number, which doesn't
  6044. % exist, with an empty box. Let's hope all the numbers have the same width.
  6045. % Also ignore the page number, which is conventionally not printed.
  6046. \def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}}
  6047. \def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}}
  6048. %
  6049. % Parts, in the short toc.
  6050. \def\shortpartentry#1#2#3#4{%
  6051. \penalty-300
  6052. \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip
  6053. \shortchapentry{{\bf #1}}{\numeralbox}{}{}%
  6054. }
  6055. % Chapters, in the main contents.
  6056. \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
  6057. % Chapters, in the short toc.
  6058. % See comments in \dochapentry re vbox and related settings.
  6059. \def\shortchapentry#1#2#3#4{%
  6060. \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}%
  6061. }
  6062. % Appendices, in the main contents.
  6063. % Need the word Appendix, and a fixed-size box.
  6064. %
  6065. \def\appendixbox#1{%
  6066. % We use M since it's probably the widest letter.
  6067. \setbox0 = \hbox{\putwordAppendix{} M}%
  6068. \hbox to \wd0{\putwordAppendix{} #1\hss}}
  6069. %
  6070. \def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\hskip.7em#1}{#4}}
  6071. % Unnumbered chapters.
  6072. \def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}
  6073. \def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}}
  6074. % Sections.
  6075. \def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}}
  6076. \let\appsecentry=\numsecentry
  6077. \def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}}
  6078. % Subsections.
  6079. \def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}}
  6080. \let\appsubsecentry=\numsubsecentry
  6081. \def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}
  6082. % And subsubsections.
  6083. \def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}}
  6084. \let\appsubsubsecentry=\numsubsubsecentry
  6085. \def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}}
  6086. % This parameter controls the indentation of the various levels.
  6087. % Same as \defaultparindent.
  6088. \newdimen\tocindent \tocindent = 15pt
  6089. % Now for the actual typesetting. In all these, #1 is the text and #2 is the
  6090. % page number.
  6091. %
  6092. % If the toc has to be broken over pages, we want it to be at chapters
  6093. % if at all possible; hence the \penalty.
  6094. \def\dochapentry#1#2{%
  6095. \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
  6096. \begingroup
  6097. % Move the page numbers slightly to the right
  6098. \advance\entryrightmargin by -0.05em
  6099. \chapentryfonts
  6100. \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  6101. \endgroup
  6102. \nobreak\vskip .25\baselineskip plus.1\baselineskip
  6103. }
  6104. \def\dosecentry#1#2{\begingroup
  6105. \secentryfonts \leftskip=\tocindent
  6106. \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  6107. \endgroup}
  6108. \def\dosubsecentry#1#2{\begingroup
  6109. \subsecentryfonts \leftskip=2\tocindent
  6110. \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  6111. \endgroup}
  6112. \def\dosubsubsecentry#1#2{\begingroup
  6113. \subsubsecentryfonts \leftskip=3\tocindent
  6114. \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  6115. \endgroup}
  6116. % We use the same \entry macro as for the index entries.
  6117. \let\tocentry = \entry
  6118. % Space between chapter (or whatever) number and the title.
  6119. \def\labelspace{\hskip1em \relax}
  6120. \def\dopageno#1{{\rm #1}}
  6121. \def\doshortpageno#1{{\rm #1}}
  6122. \def\chapentryfonts{\secfonts \rm}
  6123. \def\secentryfonts{\textfonts}
  6124. \def\subsecentryfonts{\textfonts}
  6125. \def\subsubsecentryfonts{\textfonts}
  6126. \message{environments,}
  6127. % @foo ... @end foo.
  6128. % @tex ... @end tex escapes into raw TeX temporarily.
  6129. % One exception: @ is still an escape character, so that @end tex works.
  6130. % But \@ or @@ will get a plain @ character.
  6131. \envdef\tex{%
  6132. \setupmarkupstyle{tex}%
  6133. \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
  6134. \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
  6135. \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
  6136. \catcode `\%=14
  6137. \catcode `\+=\other
  6138. \catcode `\"=\other
  6139. \catcode `\|=\other
  6140. \catcode `\<=\other
  6141. \catcode `\>=\other
  6142. \catcode `\`=\other
  6143. \catcode `\'=\other
  6144. \escapechar=`\\
  6145. %
  6146. % ' is active in math mode (mathcode"8000). So reset it, and all our
  6147. % other math active characters (just in case), to plain's definitions.
  6148. \mathactive
  6149. %
  6150. % Inverse of the list at the beginning of the file.
  6151. \let\b=\ptexb
  6152. \let\bullet=\ptexbullet
  6153. \let\c=\ptexc
  6154. \let\,=\ptexcomma
  6155. \let\.=\ptexdot
  6156. \let\dots=\ptexdots
  6157. \let\equiv=\ptexequiv
  6158. \let\!=\ptexexclam
  6159. \let\i=\ptexi
  6160. \let\indent=\ptexindent
  6161. \let\noindent=\ptexnoindent
  6162. \let\{=\ptexlbrace
  6163. \let\+=\tabalign
  6164. \let\}=\ptexrbrace
  6165. \let\/=\ptexslash
  6166. \let\sp=\ptexsp
  6167. \let\*=\ptexstar
  6168. %\let\sup=\ptexsup % do not redefine, we want @sup to work in math mode
  6169. \let\t=\ptext
  6170. \expandafter \let\csname top\endcsname=\ptextop % we've made it outer
  6171. \let\frenchspacing=\plainfrenchspacing
  6172. %
  6173. \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
  6174. \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
  6175. \def\@{@}%
  6176. }
  6177. % There is no need to define \Etex.
  6178. % Define @lisp ... @end lisp.
  6179. % @lisp environment forms a group so it can rebind things,
  6180. % including the definition of @end lisp (which normally is erroneous).
  6181. % Amount to narrow the margins by for @lisp.
  6182. \newskip\lispnarrowing \lispnarrowing=0.4in
  6183. % This is the definition that ^^M gets inside @lisp, @example, and other
  6184. % such environments. \null is better than a space, since it doesn't
  6185. % have any width.
  6186. \def\lisppar{\null\endgraf}
  6187. % This space is always present above and below environments.
  6188. \newskip\envskipamount \envskipamount = 0pt
  6189. % Make spacing and below environment symmetrical. We use \parskip here
  6190. % to help in doing that, since in @example-like environments \parskip
  6191. % is reset to zero; thus the \afterenvbreak inserts no space -- but the
  6192. % start of the next paragraph will insert \parskip.
  6193. %
  6194. \def\aboveenvbreak{{%
  6195. % =10000 instead of <10000 because of a special case in \itemzzz and
  6196. % \sectionheading, q.v.
  6197. \ifnum \lastpenalty=10000 \else
  6198. \advance\envskipamount by \parskip
  6199. \endgraf
  6200. \ifdim\lastskip<\envskipamount
  6201. \removelastskip
  6202. \ifnum\lastpenalty<10000
  6203. % Penalize breaking before the environment, because preceding text
  6204. % often leads into it.
  6205. \penalty100
  6206. \fi
  6207. \vskip\envskipamount
  6208. \fi
  6209. \fi
  6210. }}
  6211. \def\afterenvbreak{{%
  6212. % =10000 instead of <10000 because of a special case in \itemzzz and
  6213. % \sectionheading, q.v.
  6214. \ifnum \lastpenalty=10000 \else
  6215. \advance\envskipamount by \parskip
  6216. \endgraf
  6217. \ifdim\lastskip<\envskipamount
  6218. \removelastskip
  6219. % it's not a good place to break if the last penalty was \nobreak
  6220. % or better ...
  6221. \ifnum\lastpenalty<10000 \penalty-50 \fi
  6222. \vskip\envskipamount
  6223. \fi
  6224. \fi
  6225. }}
  6226. % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will
  6227. % also clear it, so that its embedded environments do the narrowing again.
  6228. \let\nonarrowing=\relax
  6229. % @cartouche ... @end cartouche: draw rectangle w/rounded corners around
  6230. % environment contents.
  6231. \font\circle=lcircle10
  6232. \newdimen\circthick
  6233. \newdimen\cartouter\newdimen\cartinner
  6234. \newskip\normbskip\newskip\normpskip\newskip\normlskip
  6235. \circthick=\fontdimen8\circle
  6236. %
  6237. \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
  6238. \def\ctr{{\hskip 6pt\circle\char'010}}
  6239. \def\cbl{{\circle\char'012\hskip -6pt}}
  6240. \def\cbr{{\hskip 6pt\circle\char'011}}
  6241. \def\carttop{\hbox to \cartouter{\hskip\lskip
  6242. \ctl\leaders\hrule height\circthick\hfil\ctr
  6243. \hskip\rskip}}
  6244. \def\cartbot{\hbox to \cartouter{\hskip\lskip
  6245. \cbl\leaders\hrule height\circthick\hfil\cbr
  6246. \hskip\rskip}}
  6247. %
  6248. \newskip\lskip\newskip\rskip
  6249. \envdef\cartouche{%
  6250. \ifhmode\par\fi % can't be in the midst of a paragraph.
  6251. \startsavinginserts
  6252. \lskip=\leftskip \rskip=\rightskip
  6253. \leftskip=0pt\rightskip=0pt % we want these *outside*.
  6254. \cartinner=\hsize \advance\cartinner by-\lskip
  6255. \advance\cartinner by-\rskip
  6256. \cartouter=\hsize
  6257. \advance\cartouter by 18.4pt % allow for 3pt kerns on either
  6258. % side, and for 6pt waste from
  6259. % each corner char, and rule thickness
  6260. \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
  6261. %
  6262. % If this cartouche directly follows a sectioning command, we need the
  6263. % \parskip glue (backspaced over by default) or the cartouche can
  6264. % collide with the section heading.
  6265. \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi
  6266. %
  6267. \setbox\groupbox=\vbox\bgroup
  6268. \baselineskip=0pt\parskip=0pt\lineskip=0pt
  6269. \carttop
  6270. \hbox\bgroup
  6271. \hskip\lskip
  6272. \vrule\kern3pt
  6273. \vbox\bgroup
  6274. \kern3pt
  6275. \hsize=\cartinner
  6276. \baselineskip=\normbskip
  6277. \lineskip=\normlskip
  6278. \parskip=\normpskip
  6279. \vskip -\parskip
  6280. \comment % For explanation, see the end of def\group.
  6281. }
  6282. \def\Ecartouche{%
  6283. \ifhmode\par\fi
  6284. \kern3pt
  6285. \egroup
  6286. \kern3pt\vrule
  6287. \hskip\rskip
  6288. \egroup
  6289. \cartbot
  6290. \egroup
  6291. \addgroupbox
  6292. \checkinserts
  6293. }
  6294. % This macro is called at the beginning of all the @example variants,
  6295. % inside a group.
  6296. \newdimen\nonfillparindent
  6297. \def\nonfillstart{%
  6298. \aboveenvbreak
  6299. \ifdim\hfuzz < 12pt \hfuzz = 12pt \fi % Don't be fussy
  6300. \sepspaces % Make spaces be word-separators rather than space tokens.
  6301. \let\par = \lisppar % don't ignore blank lines
  6302. \obeylines % each line of input is a line of output
  6303. \parskip = 0pt
  6304. % Turn off paragraph indentation but redefine \indent to emulate
  6305. % the normal \indent.
  6306. \nonfillparindent=\parindent
  6307. \parindent = 0pt
  6308. \let\indent\nonfillindent
  6309. %
  6310. \emergencystretch = 0pt % don't try to avoid overfull boxes
  6311. \ifx\nonarrowing\relax
  6312. \advance \leftskip by \lispnarrowing
  6313. \exdentamount=\lispnarrowing
  6314. \else
  6315. \let\nonarrowing = \relax
  6316. \fi
  6317. \let\exdent=\nofillexdent
  6318. }
  6319. \begingroup
  6320. \obeyspaces
  6321. % We want to swallow spaces (but not other tokens) after the fake
  6322. % @indent in our nonfill-environments, where spaces are normally
  6323. % active and set to @tie, resulting in them not being ignored after
  6324. % @indent.
  6325. \gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}%
  6326. \gdef\nonfillindentcheck{%
  6327. \ifx\temp %
  6328. \expandafter\nonfillindentgobble%
  6329. \else%
  6330. \leavevmode\nonfillindentbox%
  6331. \fi%
  6332. }%
  6333. \endgroup
  6334. \def\nonfillindentgobble#1{\nonfillindent}
  6335. \def\nonfillindentbox{\hbox to \nonfillparindent{\hss}}
  6336. % If you want all examples etc. small: @set dispenvsize small.
  6337. % If you want even small examples the full size: @set dispenvsize nosmall.
  6338. % This affects the following displayed environments:
  6339. % @example, @display, @format, @lisp
  6340. %
  6341. \def\smallword{small}
  6342. \def\nosmallword{nosmall}
  6343. \let\SETdispenvsize\relax
  6344. \def\setnormaldispenv{%
  6345. \ifx\SETdispenvsize\smallword
  6346. % end paragraph for sake of leading, in case document has no blank
  6347. % line. This is redundant with what happens in \aboveenvbreak, but
  6348. % we need to do it before changing the fonts, and it's inconvenient
  6349. % to change the fonts afterward.
  6350. \ifnum \lastpenalty=10000 \else \endgraf \fi
  6351. \smallexamplefonts \rm
  6352. \fi
  6353. }
  6354. \def\setsmalldispenv{%
  6355. \ifx\SETdispenvsize\nosmallword
  6356. \else
  6357. \ifnum \lastpenalty=10000 \else \endgraf \fi
  6358. \smallexamplefonts \rm
  6359. \fi
  6360. }
  6361. % We often define two environments, @foo and @smallfoo.
  6362. % Let's do it in one command. #1 is the env name, #2 the definition.
  6363. \def\makedispenvdef#1#2{%
  6364. \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}%
  6365. \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}%
  6366. \expandafter\let\csname E#1\endcsname \afterenvbreak
  6367. \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
  6368. }
  6369. % Define two environment synonyms (#1 and #2) for an environment.
  6370. \def\maketwodispenvdef#1#2#3{%
  6371. \makedispenvdef{#1}{#3}%
  6372. \makedispenvdef{#2}{#3}%
  6373. }
  6374. %
  6375. % @lisp: indented, narrowed, typewriter font;
  6376. % @example: same as @lisp.
  6377. %
  6378. % @smallexample and @smalllisp: use smaller fonts.
  6379. % Originally contributed by Pavel@xerox.
  6380. %
  6381. \maketwodispenvdef{lisp}{example}{%
  6382. \nonfillstart
  6383. \tt\setupmarkupstyle{example}%
  6384. \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
  6385. \gobble % eat return
  6386. }
  6387. % @display/@smalldisplay: same as @lisp except keep current font.
  6388. %
  6389. \makedispenvdef{display}{%
  6390. \nonfillstart
  6391. \gobble
  6392. }
  6393. % @format/@smallformat: same as @display except don't narrow margins.
  6394. %
  6395. \makedispenvdef{format}{%
  6396. \let\nonarrowing = t%
  6397. \nonfillstart
  6398. \gobble
  6399. }
  6400. % @flushleft: same as @format, but doesn't obey \SETdispenvsize.
  6401. \envdef\flushleft{%
  6402. \let\nonarrowing = t%
  6403. \nonfillstart
  6404. \gobble
  6405. }
  6406. \let\Eflushleft = \afterenvbreak
  6407. % @flushright.
  6408. %
  6409. \envdef\flushright{%
  6410. \let\nonarrowing = t%
  6411. \nonfillstart
  6412. \advance\leftskip by 0pt plus 1fill\relax
  6413. \gobble
  6414. }
  6415. \let\Eflushright = \afterenvbreak
  6416. % @raggedright does more-or-less normal line breaking but no right
  6417. % justification. From plain.tex. Don't stretch around special
  6418. % characters in urls in this environment, since the stretch at the right
  6419. % should be enough.
  6420. \envdef\raggedright{%
  6421. \rightskip0pt plus2.4em \spaceskip.3333em \xspaceskip.5em\relax
  6422. \def\urefprestretchamount{0pt}%
  6423. \def\urefpoststretchamount{0pt}%
  6424. }
  6425. \let\Eraggedright\par
  6426. \envdef\raggedleft{%
  6427. \parindent=0pt \leftskip0pt plus2em
  6428. \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
  6429. \hbadness=10000 % Last line will usually be underfull, so turn off
  6430. % badness reporting.
  6431. }
  6432. \let\Eraggedleft\par
  6433. \envdef\raggedcenter{%
  6434. \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em
  6435. \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
  6436. \hbadness=10000 % Last line will usually be underfull, so turn off
  6437. % badness reporting.
  6438. }
  6439. \let\Eraggedcenter\par
  6440. % @quotation does normal linebreaking (hence we can't use \nonfillstart)
  6441. % and narrows the margins. We keep \parskip nonzero in general, since
  6442. % we're doing normal filling. So, when using \aboveenvbreak and
  6443. % \afterenvbreak, temporarily make \parskip 0.
  6444. %
  6445. \makedispenvdef{quotation}{\quotationstart}
  6446. %
  6447. \def\quotationstart{%
  6448. \indentedblockstart % same as \indentedblock, but increase right margin too.
  6449. \ifx\nonarrowing\relax
  6450. \advance\rightskip by \lispnarrowing
  6451. \fi
  6452. \parsearg\quotationlabel
  6453. }
  6454. % We have retained a nonzero parskip for the environment, since we're
  6455. % doing normal filling.
  6456. %
  6457. \def\Equotation{%
  6458. \par
  6459. \ifx\quotationauthor\thisisundefined\else
  6460. % indent a bit.
  6461. \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
  6462. \fi
  6463. {\parskip=0pt \afterenvbreak}%
  6464. }
  6465. \def\Esmallquotation{\Equotation}
  6466. % If we're given an argument, typeset it in bold with a colon after.
  6467. \def\quotationlabel#1{%
  6468. \def\temp{#1}%
  6469. \ifx\temp\empty \else
  6470. {\bf #1: }%
  6471. \fi
  6472. }
  6473. % @indentedblock is like @quotation, but indents only on the left and
  6474. % has no optional argument.
  6475. %
  6476. \makedispenvdef{indentedblock}{\indentedblockstart}
  6477. %
  6478. \def\indentedblockstart{%
  6479. {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
  6480. \parindent=0pt
  6481. %
  6482. % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
  6483. \ifx\nonarrowing\relax
  6484. \advance\leftskip by \lispnarrowing
  6485. \exdentamount = \lispnarrowing
  6486. \else
  6487. \let\nonarrowing = \relax
  6488. \fi
  6489. }
  6490. % Keep a nonzero parskip for the environment, since we're doing normal filling.
  6491. %
  6492. \def\Eindentedblock{%
  6493. \par
  6494. {\parskip=0pt \afterenvbreak}%
  6495. }
  6496. \def\Esmallindentedblock{\Eindentedblock}
  6497. % LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
  6498. % If we want to allow any <char> as delimiter,
  6499. % we need the curly braces so that makeinfo sees the @verb command, eg:
  6500. % `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
  6501. %
  6502. % [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
  6503. %
  6504. % [Knuth] p.344; only we need to do the other characters Texinfo sets
  6505. % active too. Otherwise, they get lost as the first character on a
  6506. % verbatim line.
  6507. \def\dospecials{%
  6508. \do\ \do\\\do\{\do\}\do\$\do\&%
  6509. \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
  6510. \do\<\do\>\do\|\do\@\do+\do\"%
  6511. % Don't do the quotes -- if we do, @set txicodequoteundirected and
  6512. % @set txicodequotebacktick will not have effect on @verb and
  6513. % @verbatim, and ?` and !` ligatures won't get disabled.
  6514. %\do\`\do\'%
  6515. }
  6516. %
  6517. % [Knuth] p. 380
  6518. \def\uncatcodespecials{%
  6519. \def\do##1{\catcode`##1=\other}\dospecials}
  6520. %
  6521. % Setup for the @verb command.
  6522. %
  6523. % Eight spaces for a tab
  6524. \begingroup
  6525. \catcode`\^^I=\active
  6526. \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
  6527. \endgroup
  6528. %
  6529. \def\setupverb{%
  6530. \tt % easiest (and conventionally used) font for verbatim
  6531. \def\par{\leavevmode\endgraf}%
  6532. \setupmarkupstyle{verb}%
  6533. \tabeightspaces
  6534. % Respect line breaks,
  6535. % print special symbols as themselves, and
  6536. % make each space count
  6537. % must do in this order:
  6538. \obeylines \uncatcodespecials \sepspaces
  6539. }
  6540. % Setup for the @verbatim environment
  6541. %
  6542. % Real tab expansion.
  6543. \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
  6544. %
  6545. % We typeset each line of the verbatim in an \hbox, so we can handle
  6546. % tabs. The \global is in case the verbatim line starts with an accent,
  6547. % or some other command that starts with a begin-group. Otherwise, the
  6548. % entire \verbbox would disappear at the corresponding end-group, before
  6549. % it is typeset. Meanwhile, we can't have nested verbatim commands
  6550. % (can we?), so the \global won't be overwriting itself.
  6551. \newbox\verbbox
  6552. \def\starttabbox{\global\setbox\verbbox=\hbox\bgroup}
  6553. %
  6554. \begingroup
  6555. \catcode`\^^I=\active
  6556. \gdef\tabexpand{%
  6557. \catcode`\^^I=\active
  6558. \def^^I{\leavevmode\egroup
  6559. \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab
  6560. \divide\dimen\verbbox by\tabw
  6561. \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw
  6562. \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw
  6563. \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox
  6564. }%
  6565. }
  6566. \endgroup
  6567. % start the verbatim environment.
  6568. \def\setupverbatim{%
  6569. \let\nonarrowing = t%
  6570. \nonfillstart
  6571. \tt % easiest (and conventionally used) font for verbatim
  6572. % The \leavevmode here is for blank lines. Otherwise, we would
  6573. % never \starttabox and the \egroup would end verbatim mode.
  6574. \def\par{\leavevmode\egroup\box\verbbox\endgraf}%
  6575. \tabexpand
  6576. \setupmarkupstyle{verbatim}%
  6577. % Respect line breaks,
  6578. % print special symbols as themselves, and
  6579. % make each space count.
  6580. % Must do in this order:
  6581. \obeylines \uncatcodespecials \sepspaces
  6582. \everypar{\starttabbox}%
  6583. }
  6584. % Do the @verb magic: verbatim text is quoted by unique
  6585. % delimiter characters. Before first delimiter expect a
  6586. % right brace, after last delimiter expect closing brace:
  6587. %
  6588. % \def\doverb'{'<char>#1<char>'}'{#1}
  6589. %
  6590. % [Knuth] p. 382; only eat outer {}
  6591. \begingroup
  6592. \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other
  6593. \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
  6594. \endgroup
  6595. %
  6596. \def\verb{\begingroup\setupverb\doverb}
  6597. %
  6598. %
  6599. % Do the @verbatim magic: define the macro \doverbatim so that
  6600. % the (first) argument ends when '@end verbatim' is reached, ie:
  6601. %
  6602. % \def\doverbatim#1@end verbatim{#1}
  6603. %
  6604. % For Texinfo it's a lot easier than for LaTeX,
  6605. % because texinfo's \verbatim doesn't stop at '\end{verbatim}':
  6606. % we need not redefine '\', '{' and '}'.
  6607. %
  6608. % Inspired by LaTeX's verbatim command set [latex.ltx]
  6609. %
  6610. \begingroup
  6611. \catcode`\ =\active
  6612. \obeylines %
  6613. % ignore everything up to the first ^^M, that's the newline at the end
  6614. % of the @verbatim input line itself. Otherwise we get an extra blank
  6615. % line in the output.
  6616. \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}%
  6617. % We really want {...\end verbatim} in the body of the macro, but
  6618. % without the active space; thus we have to use \xdef and \gobble.
  6619. \endgroup
  6620. %
  6621. \envdef\verbatim{%
  6622. \setupverbatim\doverbatim
  6623. }
  6624. \let\Everbatim = \afterenvbreak
  6625. % @verbatiminclude FILE - insert text of file in verbatim environment.
  6626. %
  6627. \def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude}
  6628. %
  6629. \def\doverbatiminclude#1{%
  6630. {%
  6631. \makevalueexpandable
  6632. \setupverbatim
  6633. \indexnofonts % Allow `@@' and other weird things in file names.
  6634. \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
  6635. \input #1
  6636. \afterenvbreak
  6637. }%
  6638. }
  6639. % @copying ... @end copying.
  6640. % Save the text away for @insertcopying later.
  6641. %
  6642. % We save the uninterpreted tokens, rather than creating a box.
  6643. % Saving the text in a box would be much easier, but then all the
  6644. % typesetting commands (@smallbook, font changes, etc.) have to be done
  6645. % beforehand -- and a) we want @copying to be done first in the source
  6646. % file; b) letting users define the frontmatter in as flexible order as
  6647. % possible is desirable.
  6648. %
  6649. \def\copying{\checkenv{}\begingroup\scanargctxt\docopying}
  6650. \def\docopying#1@end copying{\endgroup\def\copyingtext{#1}}
  6651. %
  6652. \def\insertcopying{%
  6653. \begingroup
  6654. \parindent = 0pt % paragraph indentation looks wrong on title page
  6655. \scanexp\copyingtext
  6656. \endgroup
  6657. }
  6658. \message{defuns,}
  6659. % @defun etc.
  6660. \newskip\defbodyindent \defbodyindent=.4in
  6661. \newskip\defargsindent \defargsindent=50pt
  6662. \newskip\deflastargmargin \deflastargmargin=18pt
  6663. \newcount\defunpenalty
  6664. % Start the processing of @deffn:
  6665. \def\startdefun{%
  6666. \ifnum\lastpenalty<10000
  6667. \medbreak
  6668. \defunpenalty=10003 % Will keep this @deffn together with the
  6669. % following @def command, see below.
  6670. \else
  6671. % If there are two @def commands in a row, we'll have a \nobreak,
  6672. % which is there to keep the function description together with its
  6673. % header. But if there's nothing but headers, we need to allow a
  6674. % break somewhere. Check specifically for penalty 10002, inserted
  6675. % by \printdefunline, instead of 10000, since the sectioning
  6676. % commands also insert a nobreak penalty, and we don't want to allow
  6677. % a break between a section heading and a defun.
  6678. %
  6679. % As a further refinement, we avoid "club" headers by signalling
  6680. % with penalty of 10003 after the very first @deffn in the
  6681. % sequence (see above), and penalty of 10002 after any following
  6682. % @def command.
  6683. \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi
  6684. %
  6685. % Similarly, after a section heading, do not allow a break.
  6686. % But do insert the glue.
  6687. \medskip % preceded by discardable penalty, so not a breakpoint
  6688. \fi
  6689. %
  6690. \parindent=0in
  6691. \advance\leftskip by \defbodyindent
  6692. \exdentamount=\defbodyindent
  6693. }
  6694. \def\dodefunx#1{%
  6695. % First, check whether we are in the right environment:
  6696. \checkenv#1%
  6697. %
  6698. % As above, allow line break if we have multiple x headers in a row.
  6699. % It's not a great place, though.
  6700. \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi
  6701. %
  6702. % And now, it's time to reuse the body of the original defun:
  6703. \expandafter\gobbledefun#1%
  6704. }
  6705. \def\gobbledefun#1\startdefun{}
  6706. % \printdefunline \deffnheader{text}
  6707. %
  6708. \def\printdefunline#1#2{%
  6709. \begingroup
  6710. % call \deffnheader:
  6711. #1#2 \endheader
  6712. % common ending:
  6713. \interlinepenalty = 10000
  6714. \advance\rightskip by 0pt plus 1fil\relax
  6715. \endgraf
  6716. \nobreak\vskip -\parskip
  6717. \penalty\defunpenalty % signal to \startdefun and \dodefunx
  6718. % Some of the @defun-type tags do not enable magic parentheses,
  6719. % rendering the following check redundant. But we don't optimize.
  6720. \checkparencounts
  6721. \endgroup
  6722. }
  6723. \def\Edefun{\endgraf\medbreak}
  6724. % \makedefun{deffn} creates \deffn, \deffnx and \Edeffn;
  6725. % the only thing remaining is to define \deffnheader.
  6726. %
  6727. \def\makedefun#1{%
  6728. \expandafter\let\csname E#1\endcsname = \Edefun
  6729. \edef\temp{\noexpand\domakedefun
  6730. \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}%
  6731. \temp
  6732. }
  6733. % \domakedefun \deffn \deffnx \deffnheader { (defn. of \deffnheader) }
  6734. %
  6735. % Define \deffn and \deffnx, without parameters.
  6736. % \deffnheader has to be defined explicitly.
  6737. %
  6738. \def\domakedefun#1#2#3{%
  6739. \envdef#1{%
  6740. \startdefun
  6741. \doingtypefnfalse % distinguish typed functions from all else
  6742. \parseargusing\activeparens{\printdefunline#3}%
  6743. }%
  6744. \def#2{\dodefunx#1}%
  6745. \def#3%
  6746. }
  6747. \newif\ifdoingtypefn % doing typed function?
  6748. \newif\ifrettypeownline % typeset return type on its own line?
  6749. % @deftypefnnewline on|off says whether the return type of typed functions
  6750. % are printed on their own line. This affects @deftypefn, @deftypefun,
  6751. % @deftypeop, and @deftypemethod.
  6752. %
  6753. \parseargdef\deftypefnnewline{%
  6754. \def\temp{#1}%
  6755. \ifx\temp\onword
  6756. \expandafter\let\csname SETtxideftypefnnl\endcsname
  6757. = \empty
  6758. \else\ifx\temp\offword
  6759. \expandafter\let\csname SETtxideftypefnnl\endcsname
  6760. = \relax
  6761. \else
  6762. \errhelp = \EMsimple
  6763. \errmessage{Unknown @txideftypefnnl value `\temp',
  6764. must be on|off}%
  6765. \fi\fi
  6766. }
  6767. % Untyped functions:
  6768. % @deffn category name args
  6769. \makedefun{deffn}{\deffngeneral{}}
  6770. % @deffn category class name args
  6771. \makedefun{defop}#1 {\defopon{#1\ \putwordon}}
  6772. % \defopon {category on}class name args
  6773. \def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
  6774. % \deffngeneral {subind}category name args
  6775. %
  6776. \def\deffngeneral#1#2 #3 #4\endheader{%
  6777. % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}.
  6778. \dosubind{fn}{\code{#3}}{#1}%
  6779. \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
  6780. }
  6781. % Typed functions:
  6782. % @deftypefn category type name args
  6783. \makedefun{deftypefn}{\deftypefngeneral{}}
  6784. % @deftypeop category class type name args
  6785. \makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}}
  6786. % \deftypeopon {category on}class type name args
  6787. \def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
  6788. % \deftypefngeneral {subind}category type name args
  6789. %
  6790. \def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
  6791. \dosubind{fn}{\code{#4}}{#1}%
  6792. \doingtypefntrue
  6793. \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
  6794. }
  6795. % Typed variables:
  6796. % @deftypevr category type var args
  6797. \makedefun{deftypevr}{\deftypecvgeneral{}}
  6798. % @deftypecv category class type var args
  6799. \makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}}
  6800. % \deftypecvof {category of}class type var args
  6801. \def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} }
  6802. % \deftypecvgeneral {subind}category type var args
  6803. %
  6804. \def\deftypecvgeneral#1#2 #3 #4 #5\endheader{%
  6805. \dosubind{vr}{\code{#4}}{#1}%
  6806. \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
  6807. }
  6808. % Untyped variables:
  6809. % @defvr category var args
  6810. \makedefun{defvr}#1 {\deftypevrheader{#1} {} }
  6811. % @defcv category class var args
  6812. \makedefun{defcv}#1 {\defcvof{#1\ \putwordof}}
  6813. % \defcvof {category of}class var args
  6814. \def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
  6815. % Types:
  6816. % @deftp category name args
  6817. \makedefun{deftp}#1 #2 #3\endheader{%
  6818. \doind{tp}{\code{#2}}%
  6819. \defname{#1}{}{#2}\defunargs{#3\unskip}%
  6820. }
  6821. % Remaining @defun-like shortcuts:
  6822. \makedefun{defun}{\deffnheader{\putwordDeffunc} }
  6823. \makedefun{defmac}{\deffnheader{\putwordDefmac} }
  6824. \makedefun{defspec}{\deffnheader{\putwordDefspec} }
  6825. \makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} }
  6826. \makedefun{defvar}{\defvrheader{\putwordDefvar} }
  6827. \makedefun{defopt}{\defvrheader{\putwordDefopt} }
  6828. \makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} }
  6829. \makedefun{defmethod}{\defopon\putwordMethodon}
  6830. \makedefun{deftypemethod}{\deftypeopon\putwordMethodon}
  6831. \makedefun{defivar}{\defcvof\putwordInstanceVariableof}
  6832. \makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof}
  6833. % \defname, which formats the name of the @def (not the args).
  6834. % #1 is the category, such as "Function".
  6835. % #2 is the return type, if any.
  6836. % #3 is the function name.
  6837. %
  6838. % We are followed by (but not passed) the arguments, if any.
  6839. %
  6840. \def\defname#1#2#3{%
  6841. \par
  6842. % Get the values of \leftskip and \rightskip as they were outside the @def...
  6843. \advance\leftskip by -\defbodyindent
  6844. %
  6845. % Determine if we are typesetting the return type of a typed function
  6846. % on a line by itself.
  6847. \rettypeownlinefalse
  6848. \ifdoingtypefn % doing a typed function specifically?
  6849. % then check user option for putting return type on its own line:
  6850. \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else
  6851. \rettypeownlinetrue
  6852. \fi
  6853. \fi
  6854. %
  6855. % How we'll format the category name. Putting it in brackets helps
  6856. % distinguish it from the body text that may end up on the next line
  6857. % just below it.
  6858. \def\temp{#1}%
  6859. \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
  6860. %
  6861. % Figure out line sizes for the paragraph shape. We'll always have at
  6862. % least two.
  6863. \tempnum = 2
  6864. %
  6865. % The first line needs space for \box0; but if \rightskip is nonzero,
  6866. % we need only space for the part of \box0 which exceeds it:
  6867. \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip
  6868. %
  6869. % If doing a return type on its own line, we'll have another line.
  6870. \ifrettypeownline
  6871. \advance\tempnum by 1
  6872. \def\maybeshapeline{0in \hsize}%
  6873. \else
  6874. \def\maybeshapeline{}%
  6875. \fi
  6876. %
  6877. % The continuations:
  6878. \dimen2=\hsize \advance\dimen2 by -\defargsindent
  6879. %
  6880. % The final paragraph shape:
  6881. \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2
  6882. %
  6883. % Put the category name at the right margin.
  6884. \noindent
  6885. \hbox to 0pt{%
  6886. \hfil\box0 \kern-\hsize
  6887. % \hsize has to be shortened this way:
  6888. \kern\leftskip
  6889. % Intentionally do not respect \rightskip, since we need the space.
  6890. }%
  6891. %
  6892. % Allow all lines to be underfull without complaint:
  6893. \tolerance=10000 \hbadness=10000
  6894. \exdentamount=\defbodyindent
  6895. {%
  6896. % defun fonts. We use typewriter by default (used to be bold) because:
  6897. % . we're printing identifiers, they should be in tt in principle.
  6898. % . in languages with many accents, such as Czech or French, it's
  6899. % common to leave accents off identifiers. The result looks ok in
  6900. % tt, but exceedingly strange in rm.
  6901. % . we don't want -- and --- to be treated as ligatures.
  6902. % . this still does not fix the ?` and !` ligatures, but so far no
  6903. % one has made identifiers using them :).
  6904. \df \tt
  6905. \def\temp{#2}% text of the return type
  6906. \ifx\temp\empty\else
  6907. \tclose{\temp}% typeset the return type
  6908. \ifrettypeownline
  6909. % put return type on its own line; prohibit line break following:
  6910. \hfil\vadjust{\nobreak}\break
  6911. \else
  6912. \space % type on same line, so just followed by a space
  6913. \fi
  6914. \fi % no return type
  6915. #3% output function name
  6916. }%
  6917. {\rm\enskip}% hskip 0.5 em of \tenrm
  6918. %
  6919. \boldbrax
  6920. % arguments will be output next, if any.
  6921. }
  6922. % Print arguments in slanted roman (not ttsl), inconsistently with using
  6923. % tt for the name. This is because literal text is sometimes needed in
  6924. % the argument list (groff manual), and ttsl and tt are not very
  6925. % distinguishable. Prevent hyphenation at `-' chars.
  6926. %
  6927. \def\defunargs#1{%
  6928. % use sl by default (not ttsl),
  6929. % tt for the names.
  6930. \df \sl \hyphenchar\font=0
  6931. %
  6932. % On the other hand, if an argument has two dashes (for instance), we
  6933. % want a way to get ttsl. We used to recommend @var for that, so
  6934. % leave the code in, but it's strange for @var to lead to typewriter.
  6935. % Nowadays we recommend @code, since the difference between a ttsl hyphen
  6936. % and a tt hyphen is pretty tiny. @code also disables ?` !`.
  6937. \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}%
  6938. #1%
  6939. \sl\hyphenchar\font=45
  6940. }
  6941. % We want ()&[] to print specially on the defun line.
  6942. %
  6943. \def\activeparens{%
  6944. \catcode`\(=\active \catcode`\)=\active
  6945. \catcode`\[=\active \catcode`\]=\active
  6946. \catcode`\&=\active
  6947. }
  6948. % Make control sequences which act like normal parenthesis chars.
  6949. \let\lparen = ( \let\rparen = )
  6950. % Be sure that we always have a definition for `(', etc. For example,
  6951. % if the fn name has parens in it, \boldbrax will not be in effect yet,
  6952. % so TeX would otherwise complain about undefined control sequence.
  6953. {
  6954. \activeparens
  6955. \global\let(=\lparen \global\let)=\rparen
  6956. \global\let[=\lbrack \global\let]=\rbrack
  6957. \global\let& = \&
  6958. \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
  6959. \gdef\magicamp{\let&=\amprm}
  6960. }
  6961. \newcount\parencount
  6962. % If we encounter &foo, then turn on ()-hacking afterwards
  6963. \newif\ifampseen
  6964. \def\amprm#1 {\ampseentrue{\bf\&#1 }}
  6965. \def\parenfont{%
  6966. \ifampseen
  6967. % At the first level, print parens in roman,
  6968. % otherwise use the default font.
  6969. \ifnum \parencount=1 \rm \fi
  6970. \else
  6971. % The \sf parens (in \boldbrax) actually are a little bolder than
  6972. % the contained text. This is especially needed for [ and ] .
  6973. \sf
  6974. \fi
  6975. }
  6976. \def\infirstlevel#1{%
  6977. \ifampseen
  6978. \ifnum\parencount=1
  6979. #1%
  6980. \fi
  6981. \fi
  6982. }
  6983. \def\bfafterword#1 {#1 \bf}
  6984. \def\opnr{%
  6985. \global\advance\parencount by 1
  6986. {\parenfont(}%
  6987. \infirstlevel \bfafterword
  6988. }
  6989. \def\clnr{%
  6990. {\parenfont)}%
  6991. \infirstlevel \sl
  6992. \global\advance\parencount by -1
  6993. }
  6994. \newcount\brackcount
  6995. \def\lbrb{%
  6996. \global\advance\brackcount by 1
  6997. {\bf[}%
  6998. }
  6999. \def\rbrb{%
  7000. {\bf]}%
  7001. \global\advance\brackcount by -1
  7002. }
  7003. \def\checkparencounts{%
  7004. \ifnum\parencount=0 \else \badparencount \fi
  7005. \ifnum\brackcount=0 \else \badbrackcount \fi
  7006. }
  7007. % these should not use \errmessage; the glibc manual, at least, actually
  7008. % has such constructs (when documenting function pointers).
  7009. \def\badparencount{%
  7010. \message{Warning: unbalanced parentheses in @def...}%
  7011. \global\parencount=0
  7012. }
  7013. \def\badbrackcount{%
  7014. \message{Warning: unbalanced square brackets in @def...}%
  7015. \global\brackcount=0
  7016. }
  7017. \message{macros,}
  7018. % @macro.
  7019. % To do this right we need a feature of e-TeX, \scantokens,
  7020. % which we arrange to emulate with a temporary file in ordinary TeX.
  7021. \ifx\eTeXversion\thisisundefined
  7022. \newwrite\macscribble
  7023. \def\scantokens#1{%
  7024. \toks0={#1}%
  7025. \immediate\openout\macscribble=\jobname.tmp
  7026. \immediate\write\macscribble{\the\toks0}%
  7027. \immediate\closeout\macscribble
  7028. \input \jobname.tmp
  7029. }
  7030. \fi
  7031. \let\aftermacroxxx\relax
  7032. \def\aftermacro{\aftermacroxxx}
  7033. % alias because \c means cedilla in @tex or @math
  7034. \let\texinfoc=\c
  7035. % Used at the time of macro expansion.
  7036. % Argument is macro body with arguments substituted
  7037. \def\scanmacro#1{%
  7038. \newlinechar`\^^M
  7039. % Reduce doubled backslashes to one
  7040. \def\xprocessmacroarg{\passargtomacro\eatspaces}%
  7041. %
  7042. % Process the macro body under the current catcode regime.
  7043. \scantokens{#1\texinfoc}\aftermacro%
  7044. %
  7045. % The \c is to remove the \newlinechar added by \scantokens, and
  7046. % can be noticed by \parsearg.
  7047. % The \aftermacro allows a \comment at the end of the macro definition
  7048. % to duplicate itself past the final \newlinechar added by \scantokens:
  7049. % this is used in the definition of \group to comment out a newline. We
  7050. % don't do the same for \c to support Texinfo files with macros that ended
  7051. % with a @c, which should no longer be necessary.
  7052. % We avoid surrounding the call to \scantokens with \bgroup and \egroup
  7053. % to allow macros to open or close groups themselves.
  7054. }
  7055. \def\scanexp#1{%
  7056. \bgroup
  7057. % Undo catcode changes of \startcontents and \printindex
  7058. % When called from @insertcopying or (short)caption, we need active
  7059. % backslash to get it printed correctly.
  7060. % FIXME: This may not be needed.
  7061. %\catcode`\@=0 \catcode`\\=\active \escapechar=`\@
  7062. \edef\temp{\noexpand\scanmacro{#1}}%
  7063. \temp
  7064. \egroup
  7065. }
  7066. \newcount\paramno % Count of parameters
  7067. \newtoks\macname % Macro name
  7068. \newif\ifrecursive % Is it recursive?
  7069. % List of all defined macros in the form
  7070. % \definedummyword\macro1\definedummyword\macro2...
  7071. % Currently is also contains all @aliases; the list can be split
  7072. % if there is a need.
  7073. \def\macrolist{}
  7074. % Add the macro to \macrolist
  7075. \def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname}
  7076. \def\addtomacrolistxxx#1{%
  7077. \toks0 = \expandafter{\macrolist\definedummyword#1}%
  7078. \xdef\macrolist{\the\toks0}%
  7079. }
  7080. % Utility routines.
  7081. % This does \let #1 = #2, with \csnames; that is,
  7082. % \let \csname#1\endcsname = \csname#2\endcsname
  7083. % (except of course we have to play expansion games).
  7084. %
  7085. \def\cslet#1#2{%
  7086. \expandafter\let
  7087. \csname#1\expandafter\endcsname
  7088. \csname#2\endcsname
  7089. }
  7090. % Trim leading and trailing spaces off a string.
  7091. % Concepts from aro-bend problem 15 (see CTAN).
  7092. {\catcode`\@=11
  7093. \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
  7094. \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
  7095. \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
  7096. \def\unbrace#1{#1}
  7097. \unbrace{\gdef\trim@@@ #1 } #2@{#1}
  7098. }
  7099. % Trim a single trailing ^^M off a string.
  7100. {\catcode`\^^M=\other \catcode`\Q=3%
  7101. \gdef\eatcr #1{\eatcra #1Q^^MQ}%
  7102. \gdef\eatcra#1^^MQ{\eatcrb#1Q}%
  7103. \gdef\eatcrb#1Q#2Q{#1}%
  7104. }
  7105. % Macro bodies are absorbed as an argument in a context where
  7106. % all characters are catcode 10, 11 or 12, except \ which is active
  7107. % (as in normal texinfo). It is necessary to change the definition of \
  7108. % to recognize macro arguments; this is the job of \mbodybackslash.
  7109. %
  7110. % Non-ASCII encodings make 8-bit characters active, so un-activate
  7111. % them to avoid their expansion. Must do this non-globally, to
  7112. % confine the change to the current group.
  7113. %
  7114. % It's necessary to have hard CRs when the macro is executed. This is
  7115. % done by making ^^M (\endlinechar) catcode 12 when reading the macro
  7116. % body, and then making it the \newlinechar in \scanmacro.
  7117. %
  7118. \def\scanctxt{% used as subroutine
  7119. \catcode`\"=\other
  7120. \catcode`\+=\other
  7121. \catcode`\<=\other
  7122. \catcode`\>=\other
  7123. \catcode`\^=\other
  7124. \catcode`\_=\other
  7125. \catcode`\|=\other
  7126. \catcode`\~=\other
  7127. \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi
  7128. }
  7129. \def\scanargctxt{% used for copying and captions, not macros.
  7130. \scanctxt
  7131. \catcode`\@=\other
  7132. \catcode`\\=\other
  7133. \catcode`\^^M=\other
  7134. }
  7135. \def\macrobodyctxt{% used for @macro definitions
  7136. \scanctxt
  7137. \catcode`\ =\other
  7138. \catcode`\@=\other
  7139. \catcode`\{=\other
  7140. \catcode`\}=\other
  7141. \catcode`\^^M=\other
  7142. \usembodybackslash
  7143. }
  7144. % Used when scanning braced macro arguments. Note, however, that catcode
  7145. % changes here are ineffectual if the macro invocation was nested inside
  7146. % an argument to another Texinfo command.
  7147. \def\macroargctxt{%
  7148. \scanctxt
  7149. \catcode`\^^M=\other
  7150. \catcode`\\=\active
  7151. }
  7152. \def\macrolineargctxt{% used for whole-line arguments without braces
  7153. \scanctxt
  7154. \catcode`\{=\other
  7155. \catcode`\}=\other
  7156. }
  7157. % \mbodybackslash is the definition of \ in @macro bodies.
  7158. % It maps \foo\ => \csname macarg.foo\endcsname => #N
  7159. % where N is the macro parameter number.
  7160. % We define \csname macarg.\endcsname to be \realbackslash, so
  7161. % \\ in macro replacement text gets you a backslash.
  7162. %
  7163. {\catcode`@=0 @catcode`@\=@active
  7164. @gdef@usembodybackslash{@let\=@mbodybackslash}
  7165. @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
  7166. }
  7167. \expandafter\def\csname macarg.\endcsname{\realbackslash}
  7168. \def\margbackslash#1{\char`\#1 }
  7169. \def\macro{\recursivefalse\parsearg\macroxxx}
  7170. \def\rmacro{\recursivetrue\parsearg\macroxxx}
  7171. \def\macroxxx#1{%
  7172. \getargs{#1}% now \macname is the macname and \argl the arglist
  7173. \ifx\argl\empty % no arguments
  7174. \paramno=0\relax
  7175. \else
  7176. \expandafter\parsemargdef \argl;%
  7177. \if\paramno>256\relax
  7178. \ifx\eTeXversion\thisisundefined
  7179. \errhelp = \EMsimple
  7180. \errmessage{You need eTeX to compile a file with macros with more than 256 arguments}
  7181. \fi
  7182. \fi
  7183. \fi
  7184. \if1\csname ismacro.\the\macname\endcsname
  7185. \message{Warning: redefining \the\macname}%
  7186. \else
  7187. \expandafter\ifx\csname \the\macname\endcsname \relax
  7188. \else \errmessage{Macro name \the\macname\space already defined}\fi
  7189. \global\cslet{macsave.\the\macname}{\the\macname}%
  7190. \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
  7191. \addtomacrolist{\the\macname}%
  7192. \fi
  7193. \begingroup \macrobodyctxt
  7194. \ifrecursive \expandafter\parsermacbody
  7195. \else \expandafter\parsemacbody
  7196. \fi}
  7197. \parseargdef\unmacro{%
  7198. \if1\csname ismacro.#1\endcsname
  7199. \global\cslet{#1}{macsave.#1}%
  7200. \global\expandafter\let \csname ismacro.#1\endcsname=0%
  7201. % Remove the macro name from \macrolist:
  7202. \begingroup
  7203. \expandafter\let\csname#1\endcsname \relax
  7204. \let\definedummyword\unmacrodo
  7205. \xdef\macrolist{\macrolist}%
  7206. \endgroup
  7207. \else
  7208. \errmessage{Macro #1 not defined}%
  7209. \fi
  7210. }
  7211. % Called by \do from \dounmacro on each macro. The idea is to omit any
  7212. % macro definitions that have been changed to \relax.
  7213. %
  7214. \def\unmacrodo#1{%
  7215. \ifx #1\relax
  7216. % remove this
  7217. \else
  7218. \noexpand\definedummyword \noexpand#1%
  7219. \fi
  7220. }
  7221. % \getargs -- Parse the arguments to a @macro line. Set \macname to
  7222. % the name of the macro, and \argl to the braced argument list.
  7223. \def\getargs#1{\getargsxxx#1{}}
  7224. \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
  7225. \def\getmacname#1 #2\relax{\macname={#1}}
  7226. \def\getmacargs#1{\def\argl{#1}}
  7227. % This made use of the feature that if the last token of a
  7228. % <parameter list> is #, then the preceding argument is delimited by
  7229. % an opening brace, and that opening brace is not consumed.
  7230. % Parse the optional {params} list to @macro or @rmacro.
  7231. % Set \paramno to the number of arguments,
  7232. % and \paramlist to a parameter text for the macro (e.g. #1,#2,#3 for a
  7233. % three-param macro.) Define \macarg.BLAH for each BLAH in the params
  7234. % list to some hook where the argument is to be expanded. If there are
  7235. % less than 10 arguments that hook is to be replaced by ##N where N
  7236. % is the position in that list, that is to say the macro arguments are to be
  7237. % defined `a la TeX in the macro body.
  7238. %
  7239. % That gets used by \mbodybackslash (above).
  7240. %
  7241. % If there are 10 or more arguments, a different technique is used: see
  7242. % \parsemmanyargdef.
  7243. %
  7244. \def\parsemargdef#1;{%
  7245. \paramno=0\def\paramlist{}%
  7246. \let\hash\relax
  7247. % \hash is redefined to `#' later to get it into definitions
  7248. \let\processmacroarg\relax
  7249. \parsemargdefxxx#1,;,%
  7250. \ifnum\paramno<10\relax\else
  7251. \paramno0\relax
  7252. \parsemmanyargdef@@#1,;,% 10 or more arguments
  7253. \fi
  7254. }
  7255. \def\parsemargdefxxx#1,{%
  7256. \if#1;\let\next=\relax
  7257. \else \let\next=\parsemargdefxxx
  7258. \advance\paramno by 1
  7259. \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
  7260. {\processmacroarg{\hash\the\paramno}}%
  7261. \edef\paramlist{\paramlist\hash\the\paramno,}%
  7262. \fi\next}
  7263. % \parsemacbody, \parsermacbody
  7264. %
  7265. % Read recursive and nonrecursive macro bodies. (They're different since
  7266. % rec and nonrec macros end differently.)
  7267. %
  7268. % We are in \macrobodyctxt, and the \xdef causes backslashshes in the macro
  7269. % body to be transformed.
  7270. % Set \macrobody to the body of the macro, and call \defmacro.
  7271. %
  7272. {\catcode`\ =\other\long\gdef\parsemacbody#1@end macro{%
  7273. \xdef\macrobody{\eatcr{#1}}\endgroup\defmacro}}%
  7274. {\catcode`\ =\other\long\gdef\parsermacbody#1@end rmacro{%
  7275. \xdef\macrobody{\eatcr{#1}}\endgroup\defmacro}}%
  7276. % Make @ a letter, so that we can make private-to-Texinfo macro names.
  7277. \edef\texiatcatcode{\the\catcode`\@}
  7278. \catcode `@=11\relax
  7279. %%%%%%%%%%%%%% Code for > 10 arguments only %%%%%%%%%%%%%%%%%%
  7280. % If there are 10 or more arguments, a different technique is used, where the
  7281. % hook remains in the body, and when macro is to be expanded the body is
  7282. % processed again to replace the arguments.
  7283. %
  7284. % In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the
  7285. % argument N value and then \edef the body (nothing else will expand because of
  7286. % the catcode regime under which the body was input).
  7287. %
  7288. % If you compile with TeX (not eTeX), and you have macros with 10 or more
  7289. % arguments, no macro can have more than 256 arguments (else error).
  7290. %
  7291. % In case that there are 10 or more arguments we parse again the arguments
  7292. % list to set new definitions for the \macarg.BLAH macros corresponding to
  7293. % each BLAH argument. It was anyhow needed to parse already once this list
  7294. % in order to count the arguments, and as macros with at most 9 arguments
  7295. % are by far more frequent than macro with 10 or more arguments, defining
  7296. % twice the \macarg.BLAH macros does not cost too much processing power.
  7297. \def\parsemmanyargdef@@#1,{%
  7298. \if#1;\let\next=\relax
  7299. \else
  7300. \let\next=\parsemmanyargdef@@
  7301. \edef\tempb{\eatspaces{#1}}%
  7302. \expandafter\def\expandafter\tempa
  7303. \expandafter{\csname macarg.\tempb\endcsname}%
  7304. % Note that we need some extra \noexpand\noexpand, this is because we
  7305. % don't want \the to be expanded in the \parsermacbody as it uses an
  7306. % \xdef .
  7307. \expandafter\edef\tempa
  7308. {\noexpand\noexpand\noexpand\the\toks\the\paramno}%
  7309. \advance\paramno by 1\relax
  7310. \fi\next}
  7311. \let\endargs@\relax
  7312. \let\nil@\relax
  7313. \def\nilm@{\nil@}%
  7314. \long\def\nillm@{\nil@}%
  7315. % This macro is expanded during the Texinfo macro expansion, not during its
  7316. % definition. It gets all the arguments' values and assigns them to macros
  7317. % macarg.ARGNAME
  7318. %
  7319. % #1 is the macro name
  7320. % #2 is the list of argument names
  7321. % #3 is the list of argument values
  7322. \def\getargvals@#1#2#3{%
  7323. \def\macargdeflist@{}%
  7324. \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion.
  7325. \def\paramlist{#2,\nil@}%
  7326. \def\macroname{#1}%
  7327. \begingroup
  7328. \macroargctxt
  7329. \def\argvaluelist{#3,\nil@}%
  7330. \def\@tempa{#3}%
  7331. \ifx\@tempa\empty
  7332. \setemptyargvalues@
  7333. \else
  7334. \getargvals@@
  7335. \fi
  7336. }
  7337. \def\getargvals@@{%
  7338. \ifx\paramlist\nilm@
  7339. % Some sanity check needed here that \argvaluelist is also empty.
  7340. \ifx\argvaluelist\nillm@
  7341. \else
  7342. \errhelp = \EMsimple
  7343. \errmessage{Too many arguments in macro `\macroname'!}%
  7344. \fi
  7345. \let\next\macargexpandinbody@
  7346. \else
  7347. \ifx\argvaluelist\nillm@
  7348. % No more arguments values passed to macro. Set remaining named-arg
  7349. % macros to empty.
  7350. \let\next\setemptyargvalues@
  7351. \else
  7352. % pop current arg name into \@tempb
  7353. \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}%
  7354. \expandafter\@tempa\expandafter{\paramlist}%
  7355. % pop current argument value into \@tempc
  7356. \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}%
  7357. \expandafter\@tempa\expandafter{\argvaluelist}%
  7358. % Here \@tempb is the current arg name and \@tempc is the current arg value.
  7359. % First place the new argument macro definition into \@tempd
  7360. \expandafter\macname\expandafter{\@tempc}%
  7361. \expandafter\let\csname macarg.\@tempb\endcsname\relax
  7362. \expandafter\def\expandafter\@tempe\expandafter{%
  7363. \csname macarg.\@tempb\endcsname}%
  7364. \edef\@tempd{\long\def\@tempe{\the\macname}}%
  7365. \push@\@tempd\macargdeflist@
  7366. \let\next\getargvals@@
  7367. \fi
  7368. \fi
  7369. \next
  7370. }
  7371. \def\push@#1#2{%
  7372. \expandafter\expandafter\expandafter\def
  7373. \expandafter\expandafter\expandafter#2%
  7374. \expandafter\expandafter\expandafter{%
  7375. \expandafter#1#2}%
  7376. }
  7377. % Replace arguments by their values in the macro body, and place the result
  7378. % in macro \@tempa.
  7379. %
  7380. \def\macvalstoargs@{%
  7381. % To do this we use the property that token registers that are \the'ed
  7382. % within an \edef expand only once. So we are going to place all argument
  7383. % values into respective token registers.
  7384. %
  7385. % First we save the token context, and initialize argument numbering.
  7386. \begingroup
  7387. \paramno0\relax
  7388. % Then, for each argument number #N, we place the corresponding argument
  7389. % value into a new token list register \toks#N
  7390. \expandafter\putargsintokens@\saveparamlist@,;,%
  7391. % Then, we expand the body so that argument are replaced by their
  7392. % values. The trick for values not to be expanded themselves is that they
  7393. % are within tokens and that tokens expand only once in an \edef .
  7394. \edef\@tempc{\csname mac.\macroname .body\endcsname}%
  7395. % Now we restore the token stack pointer to free the token list registers
  7396. % which we have used, but we make sure that expanded body is saved after
  7397. % group.
  7398. \expandafter
  7399. \endgroup
  7400. \expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
  7401. }
  7402. % Define the named-macro outside of this group and then close this group.
  7403. %
  7404. \def\macargexpandinbody@{%
  7405. \expandafter
  7406. \endgroup
  7407. \macargdeflist@
  7408. % First the replace in body the macro arguments by their values, the result
  7409. % is in \@tempa .
  7410. \macvalstoargs@
  7411. % Then we point at the \norecurse or \gobble (for recursive) macro value
  7412. % with \@tempb .
  7413. \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname
  7414. % Depending on whether it is recursive or not, we need some tailing
  7415. % \egroup .
  7416. \ifx\@tempb\gobble
  7417. \let\@tempc\relax
  7418. \else
  7419. \let\@tempc\egroup
  7420. \fi
  7421. % And now we do the real job:
  7422. \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}%
  7423. \@tempd
  7424. }
  7425. \def\putargsintokens@#1,{%
  7426. \if#1;\let\next\relax
  7427. \else
  7428. \let\next\putargsintokens@
  7429. % First we allocate the new token list register, and give it a temporary
  7430. % alias \@tempb .
  7431. \toksdef\@tempb\the\paramno
  7432. % Then we place the argument value into that token list register.
  7433. \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname
  7434. \expandafter\@tempb\expandafter{\@tempa}%
  7435. \advance\paramno by 1\relax
  7436. \fi
  7437. \next
  7438. }
  7439. % Trailing missing arguments are set to empty.
  7440. %
  7441. \def\setemptyargvalues@{%
  7442. \ifx\paramlist\nilm@
  7443. \let\next\macargexpandinbody@
  7444. \else
  7445. \expandafter\setemptyargvaluesparser@\paramlist\endargs@
  7446. \let\next\setemptyargvalues@
  7447. \fi
  7448. \next
  7449. }
  7450. \def\setemptyargvaluesparser@#1,#2\endargs@{%
  7451. \expandafter\def\expandafter\@tempa\expandafter{%
  7452. \expandafter\def\csname macarg.#1\endcsname{}}%
  7453. \push@\@tempa\macargdeflist@
  7454. \def\paramlist{#2}%
  7455. }
  7456. % #1 is the element target macro
  7457. % #2 is the list macro
  7458. % #3,#4\endargs@ is the list value
  7459. \def\pop@#1#2#3,#4\endargs@{%
  7460. \def#1{#3}%
  7461. \def#2{#4}%
  7462. }
  7463. \long\def\longpop@#1#2#3,#4\endargs@{%
  7464. \long\def#1{#3}%
  7465. \long\def#2{#4}%
  7466. }
  7467. %%%%%%%%%%%%%% End of code for > 10 arguments %%%%%%%%%%%%%%%%%%
  7468. % Remove following spaces at the expansion stage.
  7469. % This works because spaces are discarded before each argument when TeX is
  7470. % getting the arguments for a macro.
  7471. % This must not be immediately followed by a }.
  7472. \long\def\gobblespaces#1{#1}
  7473. % This defines a Texinfo @macro or @rmacro, called by \parsemacbody.
  7474. % \macrobody has the body of the macro in it, with placeholders for
  7475. % its parameters, looking like "\processmacroarg{\hash 1}".
  7476. % \paramno is the number of parameters
  7477. % \paramlist is a TeX parameter text, e.g. "#1,#2,#3,"
  7478. % There are eight cases: recursive and nonrecursive macros of zero, one,
  7479. % up to nine, and many arguments.
  7480. % \xdef is used so that macro definitions will survive the file
  7481. % they're defined in: @include reads the file inside a group.
  7482. %
  7483. \def\defmacro{%
  7484. \let\hash=##% convert placeholders to macro parameter chars
  7485. \ifnum\paramno=1
  7486. \def\processmacroarg{\gobblespaces}%
  7487. % This removes the pair of braces around the argument. We don't
  7488. % use \eatspaces, because this can cause ends of lines to be lost
  7489. % when the argument to \eatspaces is read, leading to line-based
  7490. % commands like "@itemize" not being read correctly.
  7491. \else
  7492. \def\processmacroarg{\xprocessmacroarg}%
  7493. \let\xprocessmacroarg\relax
  7494. \fi
  7495. \ifrecursive %%%%%%%%%%%%%% Recursive %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  7496. \ifcase\paramno
  7497. % 0
  7498. \expandafter\xdef\csname\the\macname\endcsname{%
  7499. \noexpand\scanmacro{\macrobody}}%
  7500. \or % 1
  7501. \expandafter\xdef\csname\the\macname\endcsname{%
  7502. \bgroup
  7503. \noexpand\braceorline
  7504. \expandafter\noexpand\csname\the\macname @@@\endcsname}%
  7505. \expandafter\xdef\csname\the\macname @@@\endcsname##1{%
  7506. \expandafter\noexpand\csname\the\macname @@@@\endcsname{%
  7507. \noexpand\gobblespaces##1\empty}%
  7508. % The \empty is for \gobblespaces in case #1 is empty
  7509. }%
  7510. \expandafter\xdef\csname\the\macname @@@@\endcsname##1{%
  7511. \egroup\noexpand\scanmacro{\macrobody}}%
  7512. \else
  7513. \ifnum\paramno<10\relax % at most 9
  7514. \expandafter\xdef\csname\the\macname\endcsname{%
  7515. \bgroup\noexpand\macroargctxt
  7516. \noexpand\csname\the\macname @@\endcsname}%
  7517. \expandafter\xdef\csname\the\macname @@\endcsname##1{%
  7518. \expandafter\noexpand\csname\the\macname @@@\endcsname ##1,}%
  7519. \expandafter\expandafter
  7520. \expandafter\xdef
  7521. \expandafter\expandafter
  7522. \csname\the\macname @@@\endcsname
  7523. \paramlist{\egroup\noexpand\scanmacro{\macrobody}}%
  7524. \else % 10 or more
  7525. \expandafter\xdef\csname\the\macname\endcsname{%
  7526. \noexpand\getargvals@{\the\macname}{\argl}%
  7527. }%
  7528. \global\expandafter\let\csname mac.\the\macname .body\endcsname\macrobody
  7529. \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble
  7530. \fi
  7531. \fi
  7532. \else %%%%%%%%%%%%%%%%%%%%%% Non-recursive %%%%%%%%%%%%%%%%%%%%%%%%%%
  7533. \ifcase\paramno
  7534. % 0
  7535. \expandafter\xdef\csname\the\macname\endcsname{%
  7536. \noexpand\scanmacro{\macrobody}}%
  7537. \or % 1
  7538. \expandafter\xdef\csname\the\macname\endcsname{%
  7539. \bgroup
  7540. \noexpand\braceorline
  7541. \expandafter\noexpand\csname\the\macname @@@\endcsname}%
  7542. \expandafter\xdef\csname\the\macname @@@\endcsname##1{%
  7543. \expandafter\noexpand\csname\the\macname @@@@\endcsname{%
  7544. \noexpand\gobblespaces##1\empty}%
  7545. % The \empty is for \gobblespaces in case #1 is empty
  7546. }%
  7547. \expandafter\xdef\csname\the\macname @@@@\endcsname##1{%
  7548. \egroup
  7549. \noexpand\scanmacro{\macrobody}%
  7550. }%
  7551. \else % at most 9
  7552. \ifnum\paramno<10\relax
  7553. \expandafter\xdef\csname\the\macname\endcsname{%
  7554. \bgroup\noexpand\macroargctxt
  7555. \expandafter\noexpand\csname\the\macname @@\endcsname}%
  7556. \expandafter\xdef\csname\the\macname @@\endcsname##1{%
  7557. \expandafter\noexpand\csname\the\macname @@@\endcsname ##1,}%
  7558. \expandafter\expandafter
  7559. \expandafter\xdef
  7560. \expandafter\expandafter
  7561. \csname\the\macname @@@\endcsname
  7562. \paramlist{%
  7563. \egroup
  7564. \noexpand\scanmacro{\macrobody}%
  7565. }%
  7566. \else % 10 or more:
  7567. \expandafter\xdef\csname\the\macname\endcsname{%
  7568. \noexpand\getargvals@{\the\macname}{\argl}%
  7569. }%
  7570. \global\expandafter\let\csname mac.\the\macname .body\endcsname\macrobody
  7571. \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse
  7572. \fi
  7573. \fi
  7574. \fi}
  7575. \catcode `\@\texiatcatcode\relax % end private-to-Texinfo catcodes
  7576. \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
  7577. {\catcode`\@=0 \catcode`\\=13
  7578. @catcode`@_=11
  7579. % Call #1 with a list of tokens #2, with any doubled backslashes in #2
  7580. % compressed to one.
  7581. @gdef@passargtomacro#1#2{%
  7582. @def@the_macro{#1}%
  7583. @def@pending_backslash{}%
  7584. @def@finish{@finish}%
  7585. @def@arg_result{}%
  7586. @let@next_token=@relax
  7587. @add_segment#2\@finish\%
  7588. }
  7589. % Input stream is just after a backslash. If the next token is not a
  7590. % backslash, process the rest of the argument; otherwise, remove the next
  7591. % token.
  7592. @gdef@look_ahead{%
  7593. @futurelet@next_token@look_aheadzzz}
  7594. @gdef@look_aheadzzz{%
  7595. @ifx@next_token\%
  7596. @let@next=@gobble_and_check_finish
  7597. @else
  7598. @let@next=@add_segment
  7599. @fi@next
  7600. }
  7601. % Double backslash found. Add a single backslash here.
  7602. @gdef@gobble_and_check_finish#1{%
  7603. @add_the_backslash
  7604. @def@pending_backslash{}%
  7605. @futurelet@next_token@add_segment
  7606. }
  7607. % append a backslash to \arg_result
  7608. @gdef@add_the_backslash{%
  7609. @expandafter@gdef@expandafter@arg_result@expandafter{@arg_result\}%
  7610. }
  7611. % Input stream is either at the start of the argument, or just after a
  7612. % backslash sequence, either a lone backslash, or a doubled backslash.
  7613. % \next_token contains the first token in the input stream: if it is \finish,
  7614. % finish; otherwise, append to \arg_result the segment of the argument up until
  7615. % the next backslash. \pending_backslash contains a backslash to represent
  7616. % a backslash just before the start of the input stream that has not been
  7617. % added to \arg_result.
  7618. @gdef@add_segment#1\{%
  7619. @ifx@next_token@finish
  7620. @let@next=@call_the_macro%
  7621. @else
  7622. @let@next=@look_ahead
  7623. %
  7624. % append to @arg_result
  7625. % token list registers might be better
  7626. @expandafter@expandafter@expandafter@gdef
  7627. @expandafter@expandafter@expandafter@arg_result
  7628. @expandafter@expandafter@expandafter{%
  7629. @expandafter@arg_result
  7630. @pending_backslash#1}%
  7631. @def@pending_backslash{\}%
  7632. @fi@next}
  7633. @gdef@call_the_macro{@expandafter@the_macro@expandafter{@arg_result}}
  7634. }
  7635. % \braceorline MAC is used for a one-argument macro MAC. It checks
  7636. % whether the next non-whitespace character is a {. It sets the context
  7637. % for reading the argument (slightly different in the two cases). Then,
  7638. % to read the argument, in the whole-line case, it then calls the regular
  7639. % \parsearg MAC; in the lbrace case, it calls \passargtomacro MAC.
  7640. %
  7641. \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
  7642. \def\braceorlinexxx{%
  7643. \ifx\nchar\bgroup
  7644. \macroargctxt
  7645. \expandafter\passargtomacro
  7646. \else
  7647. \macrolineargctxt\expandafter\parsearg
  7648. \fi \macnamexxx}
  7649. % @alias.
  7650. % We need some trickery to remove the optional spaces around the equal
  7651. % sign. Make them active and then expand them all to nothing.
  7652. %
  7653. \def\alias{\parseargusing\obeyspaces\aliasxxx}
  7654. \def\aliasxxx #1{\aliasyyy#1\relax}
  7655. \def\aliasyyy #1=#2\relax{%
  7656. {%
  7657. \expandafter\let\obeyedspace=\empty
  7658. \addtomacrolist{#1}%
  7659. \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%
  7660. }%
  7661. \next
  7662. }
  7663. \message{cross references,}
  7664. \newwrite\auxfile
  7665. \newif\ifhavexrefs % True if xref values are known.
  7666. \newif\ifwarnedxrefs % True if we warned once that they aren't known.
  7667. % @inforef is relatively simple.
  7668. \def\inforef #1{\inforefzzz #1,,,,**}
  7669. \def\inforefzzz #1,#2,#3,#4**{%
  7670. \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
  7671. node \samp{\ignorespaces#1{}}}
  7672. % @node's only job in TeX is to define \lastnode, which is used in
  7673. % cross-references. The @node line might or might not have commas, and
  7674. % might or might not have spaces before the first comma, like:
  7675. % @node foo , bar , ...
  7676. % We don't want such trailing spaces in the node name.
  7677. %
  7678. \parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse}
  7679. %
  7680. % also remove a trailing comma, in case of something like this:
  7681. % @node Help-Cross, , , Cross-refs
  7682. \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
  7683. \def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}}
  7684. \let\nwnode=\node
  7685. \let\lastnode=\empty
  7686. % Write a cross-reference definition for the current node. #1 is the
  7687. % type (Ynumbered, Yappendix, Ynothing).
  7688. %
  7689. \def\donoderef#1{%
  7690. \ifx\lastnode\empty\else
  7691. \setref{\lastnode}{#1}%
  7692. \global\let\lastnode=\empty
  7693. \fi
  7694. }
  7695. % @anchor{NAME} -- define xref target at arbitrary point.
  7696. %
  7697. \newcount\savesfregister
  7698. %
  7699. \def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
  7700. \def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
  7701. \def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
  7702. % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
  7703. % anchor), which consists of three parts:
  7704. % 1) NAME-title - the current sectioning name taken from \lastsection,
  7705. % or the anchor name.
  7706. % 2) NAME-snt - section number and type, passed as the SNT arg, or
  7707. % empty for anchors.
  7708. % 3) NAME-pg - the page number.
  7709. %
  7710. % This is called from \donoderef, \anchor, and \dofloat. In the case of
  7711. % floats, there is an additional part, which is not written here:
  7712. % 4) NAME-lof - the text as it should appear in a @listoffloats.
  7713. %
  7714. \def\setref#1#2{%
  7715. \pdfmkdest{#1}%
  7716. \iflinks
  7717. {%
  7718. \requireauxfile
  7719. \atdummies % preserve commands, but don't expand them
  7720. \edef\writexrdef##1##2{%
  7721. \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
  7722. ##1}{##2}}% these are parameters of \writexrdef
  7723. }%
  7724. \toks0 = \expandafter{\lastsection}%
  7725. \immediate \writexrdef{title}{\the\toks0 }%
  7726. \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
  7727. \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout
  7728. }%
  7729. \fi
  7730. }
  7731. % @xrefautosectiontitle on|off says whether @section(ing) names are used
  7732. % automatically in xrefs, if the third arg is not explicitly specified.
  7733. % This was provided as a "secret" @set xref-automatic-section-title
  7734. % variable, now it's official.
  7735. %
  7736. \parseargdef\xrefautomaticsectiontitle{%
  7737. \def\temp{#1}%
  7738. \ifx\temp\onword
  7739. \expandafter\let\csname SETxref-automatic-section-title\endcsname
  7740. = \empty
  7741. \else\ifx\temp\offword
  7742. \expandafter\let\csname SETxref-automatic-section-title\endcsname
  7743. = \relax
  7744. \else
  7745. \errhelp = \EMsimple
  7746. \errmessage{Unknown @xrefautomaticsectiontitle value `\temp',
  7747. must be on|off}%
  7748. \fi\fi
  7749. }
  7750. %
  7751. % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
  7752. % the node name, #2 the name of the Info cross-reference, #3 the printed
  7753. % node name, #4 the name of the Info file, #5 the name of the printed
  7754. % manual. All but the node name can be omitted.
  7755. %
  7756. \def\pxref{\putwordsee{} \xrefXX}
  7757. \def\xref{\putwordSee{} \xrefXX}
  7758. \def\ref{\xrefXX}
  7759. \def\xrefXX#1{\def\xrefXXarg{#1}\futurelet\tokenafterxref\xrefXXX}
  7760. \def\xrefXXX{\expandafter\xrefX\expandafter[\xrefXXarg,,,,,,,]}
  7761. %
  7762. \newbox\toprefbox
  7763. \newbox\printedrefnamebox
  7764. \newbox\infofilenamebox
  7765. \newbox\printedmanualbox
  7766. %
  7767. \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
  7768. \unsepspaces
  7769. %
  7770. % Get args without leading/trailing spaces.
  7771. \def\printedrefname{\ignorespaces #3}%
  7772. \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}%
  7773. %
  7774. \def\infofilename{\ignorespaces #4}%
  7775. \setbox\infofilenamebox = \hbox{\infofilename\unskip}%
  7776. %
  7777. \def\printedmanual{\ignorespaces #5}%
  7778. \setbox\printedmanualbox = \hbox{\printedmanual\unskip}%
  7779. %
  7780. % If the printed reference name (arg #3) was not explicitly given in
  7781. % the @xref, figure out what we want to use.
  7782. \ifdim \wd\printedrefnamebox = 0pt
  7783. % No printed node name was explicitly given.
  7784. \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax
  7785. % Not auto section-title: use node name inside the square brackets.
  7786. \def\printedrefname{\ignorespaces #1}%
  7787. \else
  7788. % Auto section-title: use chapter/section title inside
  7789. % the square brackets if we have it.
  7790. \ifdim \wd\printedmanualbox > 0pt
  7791. % It is in another manual, so we don't have it; use node name.
  7792. \def\printedrefname{\ignorespaces #1}%
  7793. \else
  7794. \ifhavexrefs
  7795. % We (should) know the real title if we have the xref values.
  7796. \def\printedrefname{\refx{#1-title}{}}%
  7797. \else
  7798. % Otherwise just copy the Info node name.
  7799. \def\printedrefname{\ignorespaces #1}%
  7800. \fi%
  7801. \fi
  7802. \fi
  7803. \fi
  7804. %
  7805. % Make link in pdf output.
  7806. \ifpdf
  7807. {\indexnofonts
  7808. \turnoffactive
  7809. \makevalueexpandable
  7810. % This expands tokens, so do it after making catcode changes, so _
  7811. % etc. don't get their TeX definitions. This ignores all spaces in
  7812. % #4, including (wrongly) those in the middle of the filename.
  7813. \getfilename{#4}%
  7814. %
  7815. % This (wrongly) does not take account of leading or trailing
  7816. % spaces in #1, which should be ignored.
  7817. \edef\pdfxrefdest{#1}%
  7818. \ifx\pdfxrefdest\empty
  7819. \def\pdfxrefdest{Top}% no empty targets
  7820. \else
  7821. \txiescapepdf\pdfxrefdest % escape PDF special chars
  7822. \fi
  7823. %
  7824. \leavevmode
  7825. \startlink attr{/Border [0 0 0]}%
  7826. \ifnum\filenamelength>0
  7827. goto file{\the\filename.pdf} name{\pdfxrefdest}%
  7828. \else
  7829. goto name{\pdfmkpgn{\pdfxrefdest}}%
  7830. \fi
  7831. }%
  7832. \setcolor{\linkcolor}%
  7833. \fi
  7834. %
  7835. % Float references are printed completely differently: "Figure 1.2"
  7836. % instead of "[somenode], p.3". We distinguish them by the
  7837. % LABEL-title being set to a magic string.
  7838. {%
  7839. % Have to otherify everything special to allow the \csname to
  7840. % include an _ in the xref name, etc.
  7841. \indexnofonts
  7842. \turnoffactive
  7843. \expandafter\global\expandafter\let\expandafter\Xthisreftitle
  7844. \csname XR#1-title\endcsname
  7845. }%
  7846. \iffloat\Xthisreftitle
  7847. % If the user specified the print name (third arg) to the ref,
  7848. % print it instead of our usual "Figure 1.2".
  7849. \ifdim\wd\printedrefnamebox = 0pt
  7850. \refx{#1-snt}{}%
  7851. \else
  7852. \printedrefname
  7853. \fi
  7854. %
  7855. % If the user also gave the printed manual name (fifth arg), append
  7856. % "in MANUALNAME".
  7857. \ifdim \wd\printedmanualbox > 0pt
  7858. \space \putwordin{} \cite{\printedmanual}%
  7859. \fi
  7860. \else
  7861. % node/anchor (non-float) references.
  7862. %
  7863. % If we use \unhbox to print the node names, TeX does not insert
  7864. % empty discretionaries after hyphens, which means that it will not
  7865. % find a line break at a hyphen in a node names. Since some manuals
  7866. % are best written with fairly long node names, containing hyphens,
  7867. % this is a loss. Therefore, we give the text of the node name
  7868. % again, so it is as if TeX is seeing it for the first time.
  7869. %
  7870. \ifdim \wd\printedmanualbox > 0pt
  7871. % Cross-manual reference with a printed manual name.
  7872. %
  7873. \crossmanualxref{\cite{\printedmanual\unskip}}%
  7874. %
  7875. \else\ifdim \wd\infofilenamebox > 0pt
  7876. % Cross-manual reference with only an info filename (arg 4), no
  7877. % printed manual name (arg 5). This is essentially the same as
  7878. % the case above; we output the filename, since we have nothing else.
  7879. %
  7880. \crossmanualxref{\code{\infofilename\unskip}}%
  7881. %
  7882. \else
  7883. % Reference within this manual.
  7884. %
  7885. % _ (for example) has to be the character _ for the purposes of the
  7886. % control sequence corresponding to the node, but it has to expand
  7887. % into the usual \leavevmode...\vrule stuff for purposes of
  7888. % printing. So we \turnoffactive for the \refx-snt, back on for the
  7889. % printing, back off for the \refx-pg.
  7890. {\turnoffactive
  7891. % Only output a following space if the -snt ref is nonempty; for
  7892. % @unnumbered and @anchor, it won't be.
  7893. \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
  7894. \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
  7895. }%
  7896. % output the `[mynode]' via the macro below so it can be overridden.
  7897. \xrefprintnodename\printedrefname
  7898. %
  7899. % But we always want a comma and a space:
  7900. ,\space
  7901. %
  7902. % output the `page 3'.
  7903. \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
  7904. \ifx,\tokenafterxref
  7905. \else\ifx.\tokenafterxref
  7906. \else\ifx;\tokenafterxref
  7907. \else\ifx)\tokenafterxref
  7908. \else,% add a , if xref not followed by punctuation
  7909. \fi\fi\fi\fi
  7910. \fi\fi
  7911. \fi
  7912. \endlink
  7913. \endgroup}
  7914. % Output a cross-manual xref to #1. Used just above (twice).
  7915. %
  7916. % Only include the text "Section ``foo'' in" if the foo is neither
  7917. % missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply
  7918. % "see The Foo Manual", the idea being to refer to the whole manual.
  7919. %
  7920. % But, this being TeX, we can't easily compare our node name against the
  7921. % string "Top" while ignoring the possible spaces before and after in
  7922. % the input. By adding the arbitrary 7sp below, we make it much less
  7923. % likely that a real node name would have the same width as "Top" (e.g.,
  7924. % in a monospaced font). Hopefully it will never happen in practice.
  7925. %
  7926. % For the same basic reason, we retypeset the "Top" at every
  7927. % reference, since the current font is indeterminate.
  7928. %
  7929. \def\crossmanualxref#1{%
  7930. \setbox\toprefbox = \hbox{Top\kern7sp}%
  7931. \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
  7932. \ifdim \wd2 > 7sp % nonempty?
  7933. \ifdim \wd2 = \wd\toprefbox \else % same as Top?
  7934. \putwordSection{} ``\printedrefname'' \putwordin{}\space
  7935. \fi
  7936. \fi
  7937. #1%
  7938. }
  7939. % This macro is called from \xrefX for the `[nodename]' part of xref
  7940. % output. It's a separate macro only so it can be changed more easily,
  7941. % since square brackets don't work well in some documents. Particularly
  7942. % one that Bob is working on :).
  7943. %
  7944. \def\xrefprintnodename#1{[#1]}
  7945. % Things referred to by \setref.
  7946. %
  7947. \def\Ynothing{}
  7948. \def\Yomitfromtoc{}
  7949. \def\Ynumbered{%
  7950. \ifnum\secno=0
  7951. \putwordChapter@tie \the\chapno
  7952. \else \ifnum\subsecno=0
  7953. \putwordSection@tie \the\chapno.\the\secno
  7954. \else \ifnum\subsubsecno=0
  7955. \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
  7956. \else
  7957. \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
  7958. \fi\fi\fi
  7959. }
  7960. \def\Yappendix{%
  7961. \ifnum\secno=0
  7962. \putwordAppendix@tie @char\the\appendixno{}%
  7963. \else \ifnum\subsecno=0
  7964. \putwordSection@tie @char\the\appendixno.\the\secno
  7965. \else \ifnum\subsubsecno=0
  7966. \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
  7967. \else
  7968. \putwordSection@tie
  7969. @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
  7970. \fi\fi\fi
  7971. }
  7972. % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
  7973. % If its value is nonempty, SUFFIX is output afterward.
  7974. %
  7975. \def\refx#1#2{%
  7976. \requireauxfile
  7977. {%
  7978. \indexnofonts
  7979. \otherbackslash
  7980. \expandafter\global\expandafter\let\expandafter\thisrefX
  7981. \csname XR#1\endcsname
  7982. }%
  7983. \ifx\thisrefX\relax
  7984. % If not defined, say something at least.
  7985. \angleleft un\-de\-fined\angleright
  7986. \iflinks
  7987. \ifhavexrefs
  7988. {\toks0 = {#1}% avoid expansion of possibly-complex value
  7989. \message{\linenumber Undefined cross reference `\the\toks0'.}}%
  7990. \else
  7991. \ifwarnedxrefs\else
  7992. \global\warnedxrefstrue
  7993. \message{Cross reference values unknown; you must run TeX again.}%
  7994. \fi
  7995. \fi
  7996. \fi
  7997. \else
  7998. % It's defined, so just use it.
  7999. \thisrefX
  8000. \fi
  8001. #2% Output the suffix in any case.
  8002. }
  8003. % This is the macro invoked by entries in the aux file. Usually it's
  8004. % just a \def (we prepend XR to the control sequence name to avoid
  8005. % collisions). But if this is a float type, we have more work to do.
  8006. %
  8007. \def\xrdef#1#2{%
  8008. {% The node name might contain 8-bit characters, which in our current
  8009. % implementation are changed to commands like @'e. Don't let these
  8010. % mess up the control sequence name.
  8011. \indexnofonts
  8012. \turnoffactive
  8013. \xdef\safexrefname{#1}%
  8014. }%
  8015. %
  8016. \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref
  8017. %
  8018. % Was that xref control sequence that we just defined for a float?
  8019. \expandafter\iffloat\csname XR\safexrefname\endcsname
  8020. % it was a float, and we have the (safe) float type in \iffloattype.
  8021. \expandafter\let\expandafter\floatlist
  8022. \csname floatlist\iffloattype\endcsname
  8023. %
  8024. % Is this the first time we've seen this float type?
  8025. \expandafter\ifx\floatlist\relax
  8026. \toks0 = {\do}% yes, so just \do
  8027. \else
  8028. % had it before, so preserve previous elements in list.
  8029. \toks0 = \expandafter{\floatlist\do}%
  8030. \fi
  8031. %
  8032. % Remember this xref in the control sequence \floatlistFLOATTYPE,
  8033. % for later use in \listoffloats.
  8034. \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0
  8035. {\safexrefname}}%
  8036. \fi
  8037. }
  8038. % If working on a large document in chapters, it is convenient to
  8039. % be able to disable indexing, cross-referencing, and contents, for test runs.
  8040. % This is done with @novalidate at the beginning of the file.
  8041. %
  8042. \newif\iflinks \linkstrue % by default we want the aux files.
  8043. \let\novalidate = \linksfalse
  8044. % Used when writing to the aux file, or when using data from it.
  8045. \def\requireauxfile{%
  8046. \iflinks
  8047. \tryauxfile
  8048. % Open the new aux file. TeX will close it automatically at exit.
  8049. \immediate\openout\auxfile=\jobname.aux
  8050. \fi
  8051. \global\let\requireauxfile=\relax % Only do this once.
  8052. }
  8053. % Read the last existing aux file, if any. No error if none exists.
  8054. %
  8055. \def\tryauxfile{%
  8056. \openin 1 \jobname.aux
  8057. \ifeof 1 \else
  8058. \readdatafile{aux}%
  8059. \global\havexrefstrue
  8060. \fi
  8061. \closein 1
  8062. }
  8063. \def\setupdatafile{%
  8064. \catcode`\^^@=\other
  8065. \catcode`\^^A=\other
  8066. \catcode`\^^B=\other
  8067. \catcode`\^^C=\other
  8068. \catcode`\^^D=\other
  8069. \catcode`\^^E=\other
  8070. \catcode`\^^F=\other
  8071. \catcode`\^^G=\other
  8072. \catcode`\^^H=\other
  8073. \catcode`\^^K=\other
  8074. \catcode`\^^L=\other
  8075. \catcode`\^^N=\other
  8076. \catcode`\^^P=\other
  8077. \catcode`\^^Q=\other
  8078. \catcode`\^^R=\other
  8079. \catcode`\^^S=\other
  8080. \catcode`\^^T=\other
  8081. \catcode`\^^U=\other
  8082. \catcode`\^^V=\other
  8083. \catcode`\^^W=\other
  8084. \catcode`\^^X=\other
  8085. \catcode`\^^Z=\other
  8086. \catcode`\^^[=\other
  8087. \catcode`\^^\=\other
  8088. \catcode`\^^]=\other
  8089. \catcode`\^^^=\other
  8090. \catcode`\^^_=\other
  8091. % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
  8092. % in xref tags, i.e., node names. But since ^^e4 notation isn't
  8093. % supported in the main text, it doesn't seem desirable. Furthermore,
  8094. % that is not enough: for node names that actually contain a ^
  8095. % character, we would end up writing a line like this: 'xrdef {'hat
  8096. % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
  8097. % argument, and \hat is not an expandable control sequence. It could
  8098. % all be worked out, but why? Either we support ^^ or we don't.
  8099. %
  8100. % The other change necessary for this was to define \auxhat:
  8101. % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
  8102. % and then to call \auxhat in \setq.
  8103. %
  8104. \catcode`\^=\other
  8105. %
  8106. % Special characters. Should be turned off anyway, but...
  8107. \catcode`\~=\other
  8108. \catcode`\[=\other
  8109. \catcode`\]=\other
  8110. \catcode`\"=\other
  8111. \catcode`\_=\other
  8112. \catcode`\|=\other
  8113. \catcode`\<=\other
  8114. \catcode`\>=\other
  8115. \catcode`\$=\other
  8116. \catcode`\#=\other
  8117. \catcode`\&=\other
  8118. \catcode`\%=\other
  8119. \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
  8120. %
  8121. % This is to support \ in node names and titles, since the \
  8122. % characters end up in a \csname. It's easier than
  8123. % leaving it active and making its active definition an actual \
  8124. % character. What I don't understand is why it works in the *value*
  8125. % of the xrdef. Seems like it should be a catcode12 \, and that
  8126. % should not typeset properly. But it works, so I'm moving on for
  8127. % now. --karl, 15jan04.
  8128. \catcode`\\=\other
  8129. %
  8130. % Make the characters 128-255 be printing characters.
  8131. {\setnonasciicharscatcodenonglobal\other}%
  8132. %
  8133. % @ is our escape character in .aux files, and we need braces.
  8134. \catcode`\{=1
  8135. \catcode`\}=2
  8136. \catcode`\@=0
  8137. }
  8138. \def\readdatafile#1{%
  8139. \begingroup
  8140. \setupdatafile
  8141. \input\jobname.#1
  8142. \endgroup}
  8143. \message{insertions,}
  8144. % including footnotes.
  8145. \newcount \footnoteno
  8146. % The trailing space in the following definition for supereject is
  8147. % vital for proper filling; pages come out unaligned when you do a
  8148. % pagealignmacro call if that space before the closing brace is
  8149. % removed. (Generally, numeric constants should always be followed by a
  8150. % space to prevent strange expansion errors.)
  8151. \def\supereject{\par\penalty -20000\footnoteno =0 }
  8152. % @footnotestyle is meaningful for Info output only.
  8153. \let\footnotestyle=\comment
  8154. {\catcode `\@=11
  8155. %
  8156. % Auto-number footnotes. Otherwise like plain.
  8157. \gdef\footnote{%
  8158. \global\advance\footnoteno by \@ne
  8159. \edef\thisfootno{$^{\the\footnoteno}$}%
  8160. %
  8161. % In case the footnote comes at the end of a sentence, preserve the
  8162. % extra spacing after we do the footnote number.
  8163. \let\@sf\empty
  8164. \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
  8165. %
  8166. % Remove inadvertent blank space before typesetting the footnote number.
  8167. \unskip
  8168. \thisfootno\@sf
  8169. \dofootnote
  8170. }%
  8171. % Don't bother with the trickery in plain.tex to not require the
  8172. % footnote text as a parameter. Our footnotes don't need to be so general.
  8173. %
  8174. % Oh yes, they do; otherwise, @ifset (and anything else that uses
  8175. % \parseargline) fails inside footnotes because the tokens are fixed when
  8176. % the footnote is read. --karl, 16nov96.
  8177. %
  8178. \gdef\dofootnote{%
  8179. \insert\footins\bgroup
  8180. %
  8181. % Nested footnotes are not supported in TeX, that would take a lot
  8182. % more work. (\startsavinginserts does not suffice.)
  8183. \let\footnote=\errfootnotenest
  8184. %
  8185. % We want to typeset this text as a normal paragraph, even if the
  8186. % footnote reference occurs in (for example) a display environment.
  8187. % So reset some parameters.
  8188. \hsize=\pagewidth
  8189. \interlinepenalty\interfootnotelinepenalty
  8190. \splittopskip\ht\strutbox % top baseline for broken footnotes
  8191. \splitmaxdepth\dp\strutbox
  8192. \floatingpenalty\@MM
  8193. \leftskip\z@skip
  8194. \rightskip\z@skip
  8195. \spaceskip\z@skip
  8196. \xspaceskip\z@skip
  8197. \parindent\defaultparindent
  8198. %
  8199. \smallfonts \rm
  8200. %
  8201. % Because we use hanging indentation in footnotes, a @noindent appears
  8202. % to exdent this text, so make it be a no-op. makeinfo does not use
  8203. % hanging indentation so @noindent can still be needed within footnote
  8204. % text after an @example or the like (not that this is good style).
  8205. \let\noindent = \relax
  8206. %
  8207. % Hang the footnote text off the number. Use \everypar in case the
  8208. % footnote extends for more than one paragraph.
  8209. \everypar = {\hang}%
  8210. \textindent{\thisfootno}%
  8211. %
  8212. % Don't crash into the line above the footnote text. Since this
  8213. % expands into a box, it must come within the paragraph, lest it
  8214. % provide a place where TeX can split the footnote.
  8215. \footstrut
  8216. %
  8217. % Invoke rest of plain TeX footnote routine.
  8218. \futurelet\next\fo@t
  8219. }
  8220. }%end \catcode `\@=11
  8221. \def\errfootnotenest{%
  8222. \errhelp=\EMsimple
  8223. \errmessage{Nested footnotes not supported in texinfo.tex,
  8224. even though they work in makeinfo; sorry}
  8225. }
  8226. \def\errfootnoteheading{%
  8227. \errhelp=\EMsimple
  8228. \errmessage{Footnotes in chapters, sections, etc., are not supported}
  8229. }
  8230. % In case a @footnote appears in a vbox, save the footnote text and create
  8231. % the real \insert just after the vbox finished. Otherwise, the insertion
  8232. % would be lost.
  8233. % Similarly, if a @footnote appears inside an alignment, save the footnote
  8234. % text to a box and make the \insert when a row of the table is finished.
  8235. % And the same can be done for other insert classes. --kasal, 16nov03.
  8236. %
  8237. % Replace the \insert primitive by a cheating macro.
  8238. % Deeper inside, just make sure that the saved insertions are not spilled
  8239. % out prematurely.
  8240. %
  8241. \def\startsavinginserts{%
  8242. \ifx \insert\ptexinsert
  8243. \let\insert\saveinsert
  8244. \else
  8245. \let\checkinserts\relax
  8246. \fi
  8247. }
  8248. % This \insert replacement works for both \insert\footins{foo} and
  8249. % \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}.
  8250. %
  8251. \def\saveinsert#1{%
  8252. \edef\next{\noexpand\savetobox \makeSAVEname#1}%
  8253. \afterassignment\next
  8254. % swallow the left brace
  8255. \let\temp =
  8256. }
  8257. \def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}}
  8258. \def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1}
  8259. \def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi}
  8260. \def\placesaveins#1{%
  8261. \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname
  8262. {\box#1}%
  8263. }
  8264. % eat @SAVE -- beware, all of them have catcode \other:
  8265. {
  8266. \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-)
  8267. \gdef\gobblesave @SAVE{}
  8268. }
  8269. % initialization:
  8270. \def\newsaveins #1{%
  8271. \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}%
  8272. \next
  8273. }
  8274. \def\newsaveinsX #1{%
  8275. \csname newbox\endcsname #1%
  8276. \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts
  8277. \checksaveins #1}%
  8278. }
  8279. % initialize:
  8280. \let\checkinserts\empty
  8281. \newsaveins\footins
  8282. \newsaveins\margin
  8283. % @image. We use the macros from epsf.tex to support this.
  8284. % If epsf.tex is not installed and @image is used, we complain.
  8285. %
  8286. % Check for and read epsf.tex up front. If we read it only at @image
  8287. % time, we might be inside a group, and then its definitions would get
  8288. % undone and the next image would fail.
  8289. \openin 1 = epsf.tex
  8290. \ifeof 1 \else
  8291. % Do not bother showing banner with epsf.tex v2.7k (available in
  8292. % doc/epsf.tex and on ctan).
  8293. \def\epsfannounce{\toks0 = }%
  8294. \input epsf.tex
  8295. \fi
  8296. \closein 1
  8297. %
  8298. % We will only complain once about lack of epsf.tex.
  8299. \newif\ifwarnednoepsf
  8300. \newhelp\noepsfhelp{epsf.tex must be installed for images to
  8301. work. It is also included in the Texinfo distribution, or you can get
  8302. it from ftp://tug.org/tex/epsf.tex.}
  8303. %
  8304. \def\image#1{%
  8305. \ifx\epsfbox\thisisundefined
  8306. \ifwarnednoepsf \else
  8307. \errhelp = \noepsfhelp
  8308. \errmessage{epsf.tex not found, images will be ignored}%
  8309. \global\warnednoepsftrue
  8310. \fi
  8311. \else
  8312. \imagexxx #1,,,,,\finish
  8313. \fi
  8314. }
  8315. %
  8316. % Arguments to @image:
  8317. % #1 is (mandatory) image filename; we tack on .eps extension.
  8318. % #2 is (optional) width, #3 is (optional) height.
  8319. % #4 is (ignored optional) html alt text.
  8320. % #5 is (ignored optional) extension.
  8321. % #6 is just the usual extra ignored arg for parsing stuff.
  8322. \newif\ifimagevmode
  8323. \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
  8324. \catcode`\^^M = 5 % in case we're inside an example
  8325. \normalturnoffactive % allow _ et al. in names
  8326. \def\xprocessmacroarg{\eatspaces}% in case we are being used via a macro
  8327. % If the image is by itself, center it.
  8328. \ifvmode
  8329. \imagevmodetrue
  8330. \else \ifx\centersub\centerV
  8331. % for @center @image, we need a vbox so we can have our vertical space
  8332. \imagevmodetrue
  8333. \vbox\bgroup % vbox has better behavior than vtop herev
  8334. \fi\fi
  8335. %
  8336. \ifimagevmode
  8337. \nobreak\medskip
  8338. % Usually we'll have text after the image which will insert
  8339. % \parskip glue, so insert it here too to equalize the space
  8340. % above and below.
  8341. \nobreak\vskip\parskip
  8342. \nobreak
  8343. \fi
  8344. %
  8345. % Leave vertical mode so that indentation from an enclosing
  8346. % environment such as @quotation is respected.
  8347. % However, if we're at the top level, we don't want the
  8348. % normal paragraph indentation.
  8349. % On the other hand, if we are in the case of @center @image, we don't
  8350. % want to start a paragraph, which will create a hsize-width box and
  8351. % eradicate the centering.
  8352. \ifx\centersub\centerV\else \noindent \fi
  8353. %
  8354. % Output the image.
  8355. \ifpdf
  8356. \dopdfimage{#1}{#2}{#3}%
  8357. \else
  8358. % \epsfbox itself resets \epsf?size at each figure.
  8359. \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
  8360. \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
  8361. \epsfbox{#1.eps}%
  8362. \fi
  8363. %
  8364. \ifimagevmode
  8365. \medskip % space after a standalone image
  8366. \fi
  8367. \ifx\centersub\centerV \egroup \fi
  8368. \endgroup}
  8369. % @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables,
  8370. % etc. We don't actually implement floating yet, we always include the
  8371. % float "here". But it seemed the best name for the future.
  8372. %
  8373. \envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish}
  8374. % There may be a space before second and/or third parameter; delete it.
  8375. \def\eatcommaspace#1, {#1,}
  8376. % #1 is the optional FLOATTYPE, the text label for this float, typically
  8377. % "Figure", "Table", "Example", etc. Can't contain commas. If omitted,
  8378. % this float will not be numbered and cannot be referred to.
  8379. %
  8380. % #2 is the optional xref label. Also must be present for the float to
  8381. % be referable.
  8382. %
  8383. % #3 is the optional positioning argument; for now, it is ignored. It
  8384. % will somehow specify the positions allowed to float to (here, top, bottom).
  8385. %
  8386. % We keep a separate counter for each FLOATTYPE, which we reset at each
  8387. % chapter-level command.
  8388. \let\resetallfloatnos=\empty
  8389. %
  8390. \def\dofloat#1,#2,#3,#4\finish{%
  8391. \let\thiscaption=\empty
  8392. \let\thisshortcaption=\empty
  8393. %
  8394. % don't lose footnotes inside @float.
  8395. %
  8396. % BEWARE: when the floats start float, we have to issue warning whenever an
  8397. % insert appears inside a float which could possibly float. --kasal, 26may04
  8398. %
  8399. \startsavinginserts
  8400. %
  8401. % We can't be used inside a paragraph.
  8402. \par
  8403. %
  8404. \vtop\bgroup
  8405. \def\floattype{#1}%
  8406. \def\floatlabel{#2}%
  8407. \def\floatloc{#3}% we do nothing with this yet.
  8408. %
  8409. \ifx\floattype\empty
  8410. \let\safefloattype=\empty
  8411. \else
  8412. {%
  8413. % the floattype might have accents or other special characters,
  8414. % but we need to use it in a control sequence name.
  8415. \indexnofonts
  8416. \turnoffactive
  8417. \xdef\safefloattype{\floattype}%
  8418. }%
  8419. \fi
  8420. %
  8421. % If label is given but no type, we handle that as the empty type.
  8422. \ifx\floatlabel\empty \else
  8423. % We want each FLOATTYPE to be numbered separately (Figure 1,
  8424. % Table 1, Figure 2, ...). (And if no label, no number.)
  8425. %
  8426. \expandafter\getfloatno\csname\safefloattype floatno\endcsname
  8427. \global\advance\floatno by 1
  8428. %
  8429. {%
  8430. % This magic value for \lastsection is output by \setref as the
  8431. % XREFLABEL-title value. \xrefX uses it to distinguish float
  8432. % labels (which have a completely different output format) from
  8433. % node and anchor labels. And \xrdef uses it to construct the
  8434. % lists of floats.
  8435. %
  8436. \edef\lastsection{\floatmagic=\safefloattype}%
  8437. \setref{\floatlabel}{Yfloat}%
  8438. }%
  8439. \fi
  8440. %
  8441. % start with \parskip glue, I guess.
  8442. \vskip\parskip
  8443. %
  8444. % Don't suppress indentation if a float happens to start a section.
  8445. \restorefirstparagraphindent
  8446. }
  8447. % we have these possibilities:
  8448. % @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap
  8449. % @float Foo,lbl & no caption: Foo 1.1
  8450. % @float Foo & @caption{Cap}: Foo: Cap
  8451. % @float Foo & no caption: Foo
  8452. % @float ,lbl & Caption{Cap}: 1.1: Cap
  8453. % @float ,lbl & no caption: 1.1
  8454. % @float & @caption{Cap}: Cap
  8455. % @float & no caption:
  8456. %
  8457. \def\Efloat{%
  8458. \let\floatident = \empty
  8459. %
  8460. % In all cases, if we have a float type, it comes first.
  8461. \ifx\floattype\empty \else \def\floatident{\floattype}\fi
  8462. %
  8463. % If we have an xref label, the number comes next.
  8464. \ifx\floatlabel\empty \else
  8465. \ifx\floattype\empty \else % if also had float type, need tie first.
  8466. \appendtomacro\floatident{\tie}%
  8467. \fi
  8468. % the number.
  8469. \appendtomacro\floatident{\chaplevelprefix\the\floatno}%
  8470. \fi
  8471. %
  8472. % Start the printed caption with what we've constructed in
  8473. % \floatident, but keep it separate; we need \floatident again.
  8474. \let\captionline = \floatident
  8475. %
  8476. \ifx\thiscaption\empty \else
  8477. \ifx\floatident\empty \else
  8478. \appendtomacro\captionline{: }% had ident, so need a colon between
  8479. \fi
  8480. %
  8481. % caption text.
  8482. \appendtomacro\captionline{\scanexp\thiscaption}%
  8483. \fi
  8484. %
  8485. % If we have anything to print, print it, with space before.
  8486. % Eventually this needs to become an \insert.
  8487. \ifx\captionline\empty \else
  8488. \vskip.5\parskip
  8489. \captionline
  8490. %
  8491. % Space below caption.
  8492. \vskip\parskip
  8493. \fi
  8494. %
  8495. % If have an xref label, write the list of floats info. Do this
  8496. % after the caption, to avoid chance of it being a breakpoint.
  8497. \ifx\floatlabel\empty \else
  8498. % Write the text that goes in the lof to the aux file as
  8499. % \floatlabel-lof. Besides \floatident, we include the short
  8500. % caption if specified, else the full caption if specified, else nothing.
  8501. {%
  8502. \requireauxfile
  8503. \atdummies
  8504. %
  8505. % since we read the caption text in the macro world, where ^^M
  8506. % is turned into a normal character, we have to scan it back, so
  8507. % we don't write the literal three characters "^^M" into the aux file.
  8508. \scanexp{%
  8509. \xdef\noexpand\gtemp{%
  8510. \ifx\thisshortcaption\empty
  8511. \thiscaption
  8512. \else
  8513. \thisshortcaption
  8514. \fi
  8515. }%
  8516. }%
  8517. \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident
  8518. \ifx\gtemp\empty \else : \gtemp \fi}}%
  8519. }%
  8520. \fi
  8521. \egroup % end of \vtop
  8522. %
  8523. % place the captured inserts
  8524. %
  8525. % BEWARE: when the floats start floating, we have to issue warning
  8526. % whenever an insert appears inside a float which could possibly
  8527. % float. --kasal, 26may04
  8528. %
  8529. \checkinserts
  8530. }
  8531. % Append the tokens #2 to the definition of macro #1, not expanding either.
  8532. %
  8533. \def\appendtomacro#1#2{%
  8534. \expandafter\def\expandafter#1\expandafter{#1#2}%
  8535. }
  8536. % @caption, @shortcaption
  8537. %
  8538. \def\caption{\docaption\thiscaption}
  8539. \def\shortcaption{\docaption\thisshortcaption}
  8540. \def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption}
  8541. \def\defcaption#1#2{\egroup \def#1{#2}}
  8542. % The parameter is the control sequence identifying the counter we are
  8543. % going to use. Create it if it doesn't exist and assign it to \floatno.
  8544. \def\getfloatno#1{%
  8545. \ifx#1\relax
  8546. % Haven't seen this figure type before.
  8547. \csname newcount\endcsname #1%
  8548. %
  8549. % Remember to reset this floatno at the next chap.
  8550. \expandafter\gdef\expandafter\resetallfloatnos
  8551. \expandafter{\resetallfloatnos #1=0 }%
  8552. \fi
  8553. \let\floatno#1%
  8554. }
  8555. % \setref calls this to get the XREFLABEL-snt value. We want an @xref
  8556. % to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we
  8557. % first read the @float command.
  8558. %
  8559. \def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}%
  8560. % Magic string used for the XREFLABEL-title value, so \xrefX can
  8561. % distinguish floats from other xref types.
  8562. \def\floatmagic{!!float!!}
  8563. % #1 is the control sequence we are passed; we expand into a conditional
  8564. % which is true if #1 represents a float ref. That is, the magic
  8565. % \lastsection value which we \setref above.
  8566. %
  8567. \def\iffloat#1{\expandafter\doiffloat#1==\finish}
  8568. %
  8569. % #1 is (maybe) the \floatmagic string. If so, #2 will be the
  8570. % (safe) float type for this float. We set \iffloattype to #2.
  8571. %
  8572. \def\doiffloat#1=#2=#3\finish{%
  8573. \def\temp{#1}%
  8574. \def\iffloattype{#2}%
  8575. \ifx\temp\floatmagic
  8576. }
  8577. % @listoffloats FLOATTYPE - print a list of floats like a table of contents.
  8578. %
  8579. \parseargdef\listoffloats{%
  8580. \def\floattype{#1}% floattype
  8581. {%
  8582. % the floattype might have accents or other special characters,
  8583. % but we need to use it in a control sequence name.
  8584. \indexnofonts
  8585. \turnoffactive
  8586. \xdef\safefloattype{\floattype}%
  8587. }%
  8588. %
  8589. % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE.
  8590. \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax
  8591. \ifhavexrefs
  8592. % if the user said @listoffloats foo but never @float foo.
  8593. \message{\linenumber No `\safefloattype' floats to list.}%
  8594. \fi
  8595. \else
  8596. \begingroup
  8597. \leftskip=\tocindent % indent these entries like a toc
  8598. \let\do=\listoffloatsdo
  8599. \csname floatlist\safefloattype\endcsname
  8600. \endgroup
  8601. \fi
  8602. }
  8603. % This is called on each entry in a list of floats. We're passed the
  8604. % xref label, in the form LABEL-title, which is how we save it in the
  8605. % aux file. We strip off the -title and look up \XRLABEL-lof, which
  8606. % has the text we're supposed to typeset here.
  8607. %
  8608. % Figures without xref labels will not be included in the list (since
  8609. % they won't appear in the aux file).
  8610. %
  8611. \def\listoffloatsdo#1{\listoffloatsdoentry#1\finish}
  8612. \def\listoffloatsdoentry#1-title\finish{{%
  8613. % Can't fully expand XR#1-lof because it can contain anything. Just
  8614. % pass the control sequence. On the other hand, XR#1-pg is just the
  8615. % page number, and we want to fully expand that so we can get a link
  8616. % in pdf output.
  8617. \toksA = \expandafter{\csname XR#1-lof\endcsname}%
  8618. %
  8619. % use the same \entry macro we use to generate the TOC and index.
  8620. \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}%
  8621. \writeentry
  8622. }}
  8623. \message{localization,}
  8624. % For single-language documents, @documentlanguage is usually given very
  8625. % early, just after @documentencoding. Single argument is the language
  8626. % (de) or locale (de_DE) abbreviation.
  8627. %
  8628. {
  8629. \catcode`\_ = \active
  8630. \globaldefs=1
  8631. \parseargdef\documentlanguage{%
  8632. \tex % read txi-??.tex file in plain TeX.
  8633. % Read the file by the name they passed if it exists.
  8634. \let_ = \normalunderscore % normal _ character for filename test
  8635. \openin 1 txi-#1.tex
  8636. \ifeof 1
  8637. \documentlanguagetrywithoutunderscore #1_\finish
  8638. \else
  8639. \globaldefs = 1 % everything in the txi-LL files needs to persist
  8640. \input txi-#1.tex
  8641. \fi
  8642. \closein 1
  8643. \endgroup % end raw TeX
  8644. }
  8645. %
  8646. % If they passed de_DE, and txi-de_DE.tex doesn't exist,
  8647. % try txi-de.tex.
  8648. %
  8649. \gdef\documentlanguagetrywithoutunderscore#1_#2\finish{%
  8650. \openin 1 txi-#1.tex
  8651. \ifeof 1
  8652. \errhelp = \nolanghelp
  8653. \errmessage{Cannot read language file txi-#1.tex}%
  8654. \else
  8655. \globaldefs = 1 % everything in the txi-LL files needs to persist
  8656. \input txi-#1.tex
  8657. \fi
  8658. \closein 1
  8659. }
  8660. }% end of special _ catcode
  8661. %
  8662. \newhelp\nolanghelp{The given language definition file cannot be found or
  8663. is empty. Maybe you need to install it? Putting it in the current
  8664. directory should work if nowhere else does.}
  8665. % This macro is called from txi-??.tex files; the first argument is the
  8666. % \language name to set (without the "\lang@" prefix), the second and
  8667. % third args are \{left,right}hyphenmin.
  8668. %
  8669. % The language names to pass are determined when the format is built.
  8670. % See the etex.log file created at that time, e.g.,
  8671. % /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log.
  8672. %
  8673. % With TeX Live 2008, etex now includes hyphenation patterns for all
  8674. % available languages. This means we can support hyphenation in
  8675. % Texinfo, at least to some extent. (This still doesn't solve the
  8676. % accented characters problem.)
  8677. %
  8678. \catcode`@=11
  8679. \def\txisetlanguage#1#2#3{%
  8680. % do not set the language if the name is undefined in the current TeX.
  8681. \expandafter\ifx\csname lang@#1\endcsname \relax
  8682. \message{no patterns for #1}%
  8683. \else
  8684. \global\language = \csname lang@#1\endcsname
  8685. \fi
  8686. % but there is no harm in adjusting the hyphenmin values regardless.
  8687. \global\lefthyphenmin = #2\relax
  8688. \global\righthyphenmin = #3\relax
  8689. }
  8690. % Helpers for encodings.
  8691. % Set the catcode of characters 128 through 255 to the specified number.
  8692. %
  8693. \def\setnonasciicharscatcode#1{%
  8694. \count255=128
  8695. \loop\ifnum\count255<256
  8696. \global\catcode\count255=#1\relax
  8697. \advance\count255 by 1
  8698. \repeat
  8699. }
  8700. \def\setnonasciicharscatcodenonglobal#1{%
  8701. \count255=128
  8702. \loop\ifnum\count255<256
  8703. \catcode\count255=#1\relax
  8704. \advance\count255 by 1
  8705. \repeat
  8706. }
  8707. % @documentencoding sets the definition of non-ASCII characters
  8708. % according to the specified encoding.
  8709. %
  8710. \def\documentencoding{\parseargusing\filenamecatcodes\documentencodingzzz}
  8711. \def\documentencodingzzz#1{%
  8712. % Encoding being declared for the document.
  8713. \def\declaredencoding{\csname #1.enc\endcsname}%
  8714. %
  8715. % Supported encodings: names converted to tokens in order to be able
  8716. % to compare them with \ifx.
  8717. \def\ascii{\csname US-ASCII.enc\endcsname}%
  8718. \def\latnine{\csname ISO-8859-15.enc\endcsname}%
  8719. \def\latone{\csname ISO-8859-1.enc\endcsname}%
  8720. \def\lattwo{\csname ISO-8859-2.enc\endcsname}%
  8721. \def\utfeight{\csname UTF-8.enc\endcsname}%
  8722. %
  8723. \ifx \declaredencoding \ascii
  8724. \asciichardefs
  8725. %
  8726. \else \ifx \declaredencoding \lattwo
  8727. \setnonasciicharscatcode\active
  8728. \lattwochardefs
  8729. %
  8730. \else \ifx \declaredencoding \latone
  8731. \setnonasciicharscatcode\active
  8732. \latonechardefs
  8733. %
  8734. \else \ifx \declaredencoding \latnine
  8735. \setnonasciicharscatcode\active
  8736. \latninechardefs
  8737. %
  8738. \else \ifx \declaredencoding \utfeight
  8739. \setnonasciicharscatcode\active
  8740. % since we already invoked \utfeightchardefs at the top level
  8741. % (below), do not re-invoke it, then our check for duplicated
  8742. % definitions triggers. Making non-ascii chars active is enough.
  8743. %
  8744. \else
  8745. \message{Ignoring unknown document encoding: #1.}%
  8746. %
  8747. \fi % utfeight
  8748. \fi % latnine
  8749. \fi % latone
  8750. \fi % lattwo
  8751. \fi % ascii
  8752. }
  8753. % emacs-page
  8754. % A message to be logged when using a character that isn't available
  8755. % the default font encoding (OT1).
  8756. %
  8757. \def\missingcharmsg#1{\message{Character missing, sorry: #1.}}
  8758. % Take account of \c (plain) vs. \, (Texinfo) difference.
  8759. \def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
  8760. % First, make active non-ASCII characters in order for them to be
  8761. % correctly categorized when TeX reads the replacement text of
  8762. % macros containing the character definitions.
  8763. \setnonasciicharscatcode\active
  8764. %
  8765. % Latin1 (ISO-8859-1) character definitions.
  8766. \def\latonechardefs{%
  8767. \gdef^^a0{\tie}
  8768. \gdef^^a1{\exclamdown}
  8769. \gdef^^a2{{\tcfont \char162}} % cent
  8770. \gdef^^a3{\pounds}
  8771. \gdef^^a4{{\tcfont \char164}} % currency
  8772. \gdef^^a5{{\tcfont \char165}} % yen
  8773. \gdef^^a6{{\tcfont \char166}} % broken bar
  8774. \gdef^^a7{\S}
  8775. \gdef^^a8{\"{}}
  8776. \gdef^^a9{\copyright}
  8777. \gdef^^aa{\ordf}
  8778. \gdef^^ab{\guillemetleft}
  8779. \gdef^^ac{\ensuremath\lnot}
  8780. \gdef^^ad{\-}
  8781. \gdef^^ae{\registeredsymbol}
  8782. \gdef^^af{\={}}
  8783. %
  8784. \gdef^^b0{\textdegree}
  8785. \gdef^^b1{$\pm$}
  8786. \gdef^^b2{$^2$}
  8787. \gdef^^b3{$^3$}
  8788. \gdef^^b4{\'{}}
  8789. \gdef^^b5{$\mu$}
  8790. \gdef^^b6{\P}
  8791. \gdef^^b7{\ensuremath\cdot}
  8792. \gdef^^b8{\cedilla\ }
  8793. \gdef^^b9{$^1$}
  8794. \gdef^^ba{\ordm}
  8795. \gdef^^bb{\guillemetright}
  8796. \gdef^^bc{$1\over4$}
  8797. \gdef^^bd{$1\over2$}
  8798. \gdef^^be{$3\over4$}
  8799. \gdef^^bf{\questiondown}
  8800. %
  8801. \gdef^^c0{\`A}
  8802. \gdef^^c1{\'A}
  8803. \gdef^^c2{\^A}
  8804. \gdef^^c3{\~A}
  8805. \gdef^^c4{\"A}
  8806. \gdef^^c5{\ringaccent A}
  8807. \gdef^^c6{\AE}
  8808. \gdef^^c7{\cedilla C}
  8809. \gdef^^c8{\`E}
  8810. \gdef^^c9{\'E}
  8811. \gdef^^ca{\^E}
  8812. \gdef^^cb{\"E}
  8813. \gdef^^cc{\`I}
  8814. \gdef^^cd{\'I}
  8815. \gdef^^ce{\^I}
  8816. \gdef^^cf{\"I}
  8817. %
  8818. \gdef^^d0{\DH}
  8819. \gdef^^d1{\~N}
  8820. \gdef^^d2{\`O}
  8821. \gdef^^d3{\'O}
  8822. \gdef^^d4{\^O}
  8823. \gdef^^d5{\~O}
  8824. \gdef^^d6{\"O}
  8825. \gdef^^d7{$\times$}
  8826. \gdef^^d8{\O}
  8827. \gdef^^d9{\`U}
  8828. \gdef^^da{\'U}
  8829. \gdef^^db{\^U}
  8830. \gdef^^dc{\"U}
  8831. \gdef^^dd{\'Y}
  8832. \gdef^^de{\TH}
  8833. \gdef^^df{\ss}
  8834. %
  8835. \gdef^^e0{\`a}
  8836. \gdef^^e1{\'a}
  8837. \gdef^^e2{\^a}
  8838. \gdef^^e3{\~a}
  8839. \gdef^^e4{\"a}
  8840. \gdef^^e5{\ringaccent a}
  8841. \gdef^^e6{\ae}
  8842. \gdef^^e7{\cedilla c}
  8843. \gdef^^e8{\`e}
  8844. \gdef^^e9{\'e}
  8845. \gdef^^ea{\^e}
  8846. \gdef^^eb{\"e}
  8847. \gdef^^ec{\`{\dotless i}}
  8848. \gdef^^ed{\'{\dotless i}}
  8849. \gdef^^ee{\^{\dotless i}}
  8850. \gdef^^ef{\"{\dotless i}}
  8851. %
  8852. \gdef^^f0{\dh}
  8853. \gdef^^f1{\~n}
  8854. \gdef^^f2{\`o}
  8855. \gdef^^f3{\'o}
  8856. \gdef^^f4{\^o}
  8857. \gdef^^f5{\~o}
  8858. \gdef^^f6{\"o}
  8859. \gdef^^f7{$\div$}
  8860. \gdef^^f8{\o}
  8861. \gdef^^f9{\`u}
  8862. \gdef^^fa{\'u}
  8863. \gdef^^fb{\^u}
  8864. \gdef^^fc{\"u}
  8865. \gdef^^fd{\'y}
  8866. \gdef^^fe{\th}
  8867. \gdef^^ff{\"y}
  8868. }
  8869. % Latin9 (ISO-8859-15) encoding character definitions.
  8870. \def\latninechardefs{%
  8871. % Encoding is almost identical to Latin1.
  8872. \latonechardefs
  8873. %
  8874. \gdef^^a4{\euro}
  8875. \gdef^^a6{\v S}
  8876. \gdef^^a8{\v s}
  8877. \gdef^^b4{\v Z}
  8878. \gdef^^b8{\v z}
  8879. \gdef^^bc{\OE}
  8880. \gdef^^bd{\oe}
  8881. \gdef^^be{\"Y}
  8882. }
  8883. % Latin2 (ISO-8859-2) character definitions.
  8884. \def\lattwochardefs{%
  8885. \gdef^^a0{\tie}
  8886. \gdef^^a1{\ogonek{A}}
  8887. \gdef^^a2{\u{}}
  8888. \gdef^^a3{\L}
  8889. \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
  8890. \gdef^^a5{\v L}
  8891. \gdef^^a6{\'S}
  8892. \gdef^^a7{\S}
  8893. \gdef^^a8{\"{}}
  8894. \gdef^^a9{\v S}
  8895. \gdef^^aa{\cedilla S}
  8896. \gdef^^ab{\v T}
  8897. \gdef^^ac{\'Z}
  8898. \gdef^^ad{\-}
  8899. \gdef^^ae{\v Z}
  8900. \gdef^^af{\dotaccent Z}
  8901. %
  8902. \gdef^^b0{\textdegree}
  8903. \gdef^^b1{\ogonek{a}}
  8904. \gdef^^b2{\ogonek{ }}
  8905. \gdef^^b3{\l}
  8906. \gdef^^b4{\'{}}
  8907. \gdef^^b5{\v l}
  8908. \gdef^^b6{\'s}
  8909. \gdef^^b7{\v{}}
  8910. \gdef^^b8{\cedilla\ }
  8911. \gdef^^b9{\v s}
  8912. \gdef^^ba{\cedilla s}
  8913. \gdef^^bb{\v t}
  8914. \gdef^^bc{\'z}
  8915. \gdef^^bd{\H{}}
  8916. \gdef^^be{\v z}
  8917. \gdef^^bf{\dotaccent z}
  8918. %
  8919. \gdef^^c0{\'R}
  8920. \gdef^^c1{\'A}
  8921. \gdef^^c2{\^A}
  8922. \gdef^^c3{\u A}
  8923. \gdef^^c4{\"A}
  8924. \gdef^^c5{\'L}
  8925. \gdef^^c6{\'C}
  8926. \gdef^^c7{\cedilla C}
  8927. \gdef^^c8{\v C}
  8928. \gdef^^c9{\'E}
  8929. \gdef^^ca{\ogonek{E}}
  8930. \gdef^^cb{\"E}
  8931. \gdef^^cc{\v E}
  8932. \gdef^^cd{\'I}
  8933. \gdef^^ce{\^I}
  8934. \gdef^^cf{\v D}
  8935. %
  8936. \gdef^^d0{\DH}
  8937. \gdef^^d1{\'N}
  8938. \gdef^^d2{\v N}
  8939. \gdef^^d3{\'O}
  8940. \gdef^^d4{\^O}
  8941. \gdef^^d5{\H O}
  8942. \gdef^^d6{\"O}
  8943. \gdef^^d7{$\times$}
  8944. \gdef^^d8{\v R}
  8945. \gdef^^d9{\ringaccent U}
  8946. \gdef^^da{\'U}
  8947. \gdef^^db{\H U}
  8948. \gdef^^dc{\"U}
  8949. \gdef^^dd{\'Y}
  8950. \gdef^^de{\cedilla T}
  8951. \gdef^^df{\ss}
  8952. %
  8953. \gdef^^e0{\'r}
  8954. \gdef^^e1{\'a}
  8955. \gdef^^e2{\^a}
  8956. \gdef^^e3{\u a}
  8957. \gdef^^e4{\"a}
  8958. \gdef^^e5{\'l}
  8959. \gdef^^e6{\'c}
  8960. \gdef^^e7{\cedilla c}
  8961. \gdef^^e8{\v c}
  8962. \gdef^^e9{\'e}
  8963. \gdef^^ea{\ogonek{e}}
  8964. \gdef^^eb{\"e}
  8965. \gdef^^ec{\v e}
  8966. \gdef^^ed{\'{\dotless{i}}}
  8967. \gdef^^ee{\^{\dotless{i}}}
  8968. \gdef^^ef{\v d}
  8969. %
  8970. \gdef^^f0{\dh}
  8971. \gdef^^f1{\'n}
  8972. \gdef^^f2{\v n}
  8973. \gdef^^f3{\'o}
  8974. \gdef^^f4{\^o}
  8975. \gdef^^f5{\H o}
  8976. \gdef^^f6{\"o}
  8977. \gdef^^f7{$\div$}
  8978. \gdef^^f8{\v r}
  8979. \gdef^^f9{\ringaccent u}
  8980. \gdef^^fa{\'u}
  8981. \gdef^^fb{\H u}
  8982. \gdef^^fc{\"u}
  8983. \gdef^^fd{\'y}
  8984. \gdef^^fe{\cedilla t}
  8985. \gdef^^ff{\dotaccent{}}
  8986. }
  8987. % UTF-8 character definitions.
  8988. %
  8989. % This code to support UTF-8 is based on LaTeX's utf8.def, with some
  8990. % changes for Texinfo conventions. It is included here under the GPL by
  8991. % permission from Frank Mittelbach and the LaTeX team.
  8992. %
  8993. \newcount\countUTFx
  8994. \newcount\countUTFy
  8995. \newcount\countUTFz
  8996. \gdef\UTFviiiTwoOctets#1#2{\expandafter
  8997. \UTFviiiDefined\csname u8:#1\string #2\endcsname}
  8998. %
  8999. \gdef\UTFviiiThreeOctets#1#2#3{\expandafter
  9000. \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname}
  9001. %
  9002. \gdef\UTFviiiFourOctets#1#2#3#4{\expandafter
  9003. \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname}
  9004. \gdef\UTFviiiDefined#1{%
  9005. \ifx #1\relax
  9006. \message{\linenumber Unicode char \string #1 not defined for Texinfo}%
  9007. \else
  9008. \expandafter #1%
  9009. \fi
  9010. }
  9011. \begingroup
  9012. \catcode`\~13
  9013. \catcode`\"12
  9014. \def\UTFviiiLoop{%
  9015. \global\catcode\countUTFx\active
  9016. \uccode`\~\countUTFx
  9017. \uppercase\expandafter{\UTFviiiTmp}%
  9018. \advance\countUTFx by 1
  9019. \ifnum\countUTFx < \countUTFy
  9020. \expandafter\UTFviiiLoop
  9021. \fi}
  9022. \countUTFx = "C2
  9023. \countUTFy = "E0
  9024. \def\UTFviiiTmp{%
  9025. \xdef~{\noexpand\UTFviiiTwoOctets\string~}}
  9026. \UTFviiiLoop
  9027. \countUTFx = "E0
  9028. \countUTFy = "F0
  9029. \def\UTFviiiTmp{%
  9030. \xdef~{\noexpand\UTFviiiThreeOctets\string~}}
  9031. \UTFviiiLoop
  9032. \countUTFx = "F0
  9033. \countUTFy = "F4
  9034. \def\UTFviiiTmp{%
  9035. \xdef~{\noexpand\UTFviiiFourOctets\string~}}
  9036. \UTFviiiLoop
  9037. \endgroup
  9038. \def\globallet{\global\let} % save some \expandafter's below
  9039. % @U{xxxx} to produce U+xxxx, if we support it.
  9040. \def\U#1{%
  9041. \expandafter\ifx\csname uni:#1\endcsname \relax
  9042. \errhelp = \EMsimple
  9043. \errmessage{Unicode character U+#1 not supported, sorry}%
  9044. \else
  9045. \csname uni:#1\endcsname
  9046. \fi
  9047. }
  9048. \begingroup
  9049. \catcode`\"=12
  9050. \catcode`\<=12
  9051. \catcode`\.=12
  9052. \catcode`\,=12
  9053. \catcode`\;=12
  9054. \catcode`\!=12
  9055. \catcode`\~=13
  9056. \gdef\DeclareUnicodeCharacter#1#2{%
  9057. \countUTFz = "#1\relax
  9058. %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%
  9059. \begingroup
  9060. \parseXMLCharref
  9061. \def\UTFviiiTwoOctets##1##2{%
  9062. \csname u8:##1\string ##2\endcsname}%
  9063. \def\UTFviiiThreeOctets##1##2##3{%
  9064. \csname u8:##1\string ##2\string ##3\endcsname}%
  9065. \def\UTFviiiFourOctets##1##2##3##4{%
  9066. \csname u8:##1\string ##2\string ##3\string ##4\endcsname}%
  9067. \expandafter\expandafter\expandafter\expandafter
  9068. \expandafter\expandafter\expandafter
  9069. \gdef\UTFviiiTmp{#2}%
  9070. %
  9071. \expandafter\ifx\csname uni:#1\endcsname \relax \else
  9072. \message{Internal error, already defined: #1}%
  9073. \fi
  9074. %
  9075. % define an additional control sequence for this code point.
  9076. \expandafter\globallet\csname uni:#1\endcsname \UTFviiiTmp
  9077. \endgroup}
  9078. \gdef\parseXMLCharref{%
  9079. \ifnum\countUTFz < "A0\relax
  9080. \errhelp = \EMsimple
  9081. \errmessage{Cannot define Unicode char value < 00A0}%
  9082. \else\ifnum\countUTFz < "800\relax
  9083. \parseUTFviiiA,%
  9084. \parseUTFviiiB C\UTFviiiTwoOctets.,%
  9085. \else\ifnum\countUTFz < "10000\relax
  9086. \parseUTFviiiA;%
  9087. \parseUTFviiiA,%
  9088. \parseUTFviiiB E\UTFviiiThreeOctets.{,;}%
  9089. \else
  9090. \parseUTFviiiA;%
  9091. \parseUTFviiiA,%
  9092. \parseUTFviiiA!%
  9093. \parseUTFviiiB F\UTFviiiFourOctets.{!,;}%
  9094. \fi\fi\fi
  9095. }
  9096. \gdef\parseUTFviiiA#1{%
  9097. \countUTFx = \countUTFz
  9098. \divide\countUTFz by 64
  9099. \countUTFy = \countUTFz
  9100. \multiply\countUTFz by 64
  9101. \advance\countUTFx by -\countUTFz
  9102. \advance\countUTFx by 128
  9103. \uccode `#1\countUTFx
  9104. \countUTFz = \countUTFy}
  9105. \gdef\parseUTFviiiB#1#2#3#4{%
  9106. \advance\countUTFz by "#10\relax
  9107. \uccode `#3\countUTFz
  9108. \uppercase{\gdef\UTFviiiTmp{#2#3#4}}}
  9109. \endgroup
  9110. % https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_M
  9111. % U+0000..U+007F = https://en.wikipedia.org/wiki/Basic_Latin_(Unicode_block)
  9112. % U+0080..U+00FF = https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)
  9113. % U+0100..U+017F = https://en.wikipedia.org/wiki/Latin_Extended-A
  9114. % U+0180..U+024F = https://en.wikipedia.org/wiki/Latin_Extended-B
  9115. %
  9116. % Many of our renditions are less than wonderful, and all the missing
  9117. % characters are available somewhere. Loading the necessary fonts
  9118. % awaits user request. We can't truly support Unicode without
  9119. % reimplementing everything that's been done in LaTeX for many years,
  9120. % plus probably using luatex or xetex, and who knows what else.
  9121. % We won't be doing that here in this simple file. But we can try to at
  9122. % least make most of the characters not bomb out.
  9123. %
  9124. \def\utfeightchardefs{%
  9125. \DeclareUnicodeCharacter{00A0}{\tie}
  9126. \DeclareUnicodeCharacter{00A1}{\exclamdown}
  9127. \DeclareUnicodeCharacter{00A2}{{\tcfont \char162}}% 0242=cent
  9128. \DeclareUnicodeCharacter{00A3}{\pounds}
  9129. \DeclareUnicodeCharacter{00A4}{{\tcfont \char164}}% 0244=currency
  9130. \DeclareUnicodeCharacter{00A5}{{\tcfont \char165}}% 0245=yen
  9131. \DeclareUnicodeCharacter{00A6}{{\tcfont \char166}}% 0246=brokenbar
  9132. \DeclareUnicodeCharacter{00A7}{\S}
  9133. \DeclareUnicodeCharacter{00A8}{\"{ }}
  9134. \DeclareUnicodeCharacter{00A9}{\copyright}
  9135. \DeclareUnicodeCharacter{00AA}{\ordf}
  9136. \DeclareUnicodeCharacter{00AB}{\guillemetleft}
  9137. \DeclareUnicodeCharacter{00AC}{\ensuremath\lnot}
  9138. \DeclareUnicodeCharacter{00AD}{\-}
  9139. \DeclareUnicodeCharacter{00AE}{\registeredsymbol}
  9140. \DeclareUnicodeCharacter{00AF}{\={ }}
  9141. \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}
  9142. \DeclareUnicodeCharacter{00B1}{\ensuremath\pm}
  9143. \DeclareUnicodeCharacter{00B2}{$^2$}
  9144. \DeclareUnicodeCharacter{00B3}{$^3$}
  9145. \DeclareUnicodeCharacter{00B4}{\'{ }}
  9146. \DeclareUnicodeCharacter{00B5}{$\mu$}
  9147. \DeclareUnicodeCharacter{00B6}{\P}
  9148. \DeclareUnicodeCharacter{00B7}{\ensuremath\cdot}
  9149. \DeclareUnicodeCharacter{00B8}{\cedilla{ }}
  9150. \DeclareUnicodeCharacter{00B9}{$^1$}
  9151. \DeclareUnicodeCharacter{00BA}{\ordm}
  9152. \DeclareUnicodeCharacter{00BB}{\guillemetright}
  9153. \DeclareUnicodeCharacter{00BC}{$1\over4$}
  9154. \DeclareUnicodeCharacter{00BD}{$1\over2$}
  9155. \DeclareUnicodeCharacter{00BE}{$3\over4$}
  9156. \DeclareUnicodeCharacter{00BF}{\questiondown}
  9157. \DeclareUnicodeCharacter{00C0}{\`A}
  9158. \DeclareUnicodeCharacter{00C1}{\'A}
  9159. \DeclareUnicodeCharacter{00C2}{\^A}
  9160. \DeclareUnicodeCharacter{00C3}{\~A}
  9161. \DeclareUnicodeCharacter{00C4}{\"A}
  9162. \DeclareUnicodeCharacter{00C5}{\AA}
  9163. \DeclareUnicodeCharacter{00C6}{\AE}
  9164. \DeclareUnicodeCharacter{00C7}{\cedilla{C}}
  9165. \DeclareUnicodeCharacter{00C8}{\`E}
  9166. \DeclareUnicodeCharacter{00C9}{\'E}
  9167. \DeclareUnicodeCharacter{00CA}{\^E}
  9168. \DeclareUnicodeCharacter{00CB}{\"E}
  9169. \DeclareUnicodeCharacter{00CC}{\`I}
  9170. \DeclareUnicodeCharacter{00CD}{\'I}
  9171. \DeclareUnicodeCharacter{00CE}{\^I}
  9172. \DeclareUnicodeCharacter{00CF}{\"I}
  9173. \DeclareUnicodeCharacter{00D0}{\DH}
  9174. \DeclareUnicodeCharacter{00D1}{\~N}
  9175. \DeclareUnicodeCharacter{00D2}{\`O}
  9176. \DeclareUnicodeCharacter{00D3}{\'O}
  9177. \DeclareUnicodeCharacter{00D4}{\^O}
  9178. \DeclareUnicodeCharacter{00D5}{\~O}
  9179. \DeclareUnicodeCharacter{00D6}{\"O}
  9180. \DeclareUnicodeCharacter{00D7}{\ensuremath\times}
  9181. \DeclareUnicodeCharacter{00D8}{\O}
  9182. \DeclareUnicodeCharacter{00D9}{\`U}
  9183. \DeclareUnicodeCharacter{00DA}{\'U}
  9184. \DeclareUnicodeCharacter{00DB}{\^U}
  9185. \DeclareUnicodeCharacter{00DC}{\"U}
  9186. \DeclareUnicodeCharacter{00DD}{\'Y}
  9187. \DeclareUnicodeCharacter{00DE}{\TH}
  9188. \DeclareUnicodeCharacter{00DF}{\ss}
  9189. \DeclareUnicodeCharacter{00E0}{\`a}
  9190. \DeclareUnicodeCharacter{00E1}{\'a}
  9191. \DeclareUnicodeCharacter{00E2}{\^a}
  9192. \DeclareUnicodeCharacter{00E3}{\~a}
  9193. \DeclareUnicodeCharacter{00E4}{\"a}
  9194. \DeclareUnicodeCharacter{00E5}{\aa}
  9195. \DeclareUnicodeCharacter{00E6}{\ae}
  9196. \DeclareUnicodeCharacter{00E7}{\cedilla{c}}
  9197. \DeclareUnicodeCharacter{00E8}{\`e}
  9198. \DeclareUnicodeCharacter{00E9}{\'e}
  9199. \DeclareUnicodeCharacter{00EA}{\^e}
  9200. \DeclareUnicodeCharacter{00EB}{\"e}
  9201. \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}
  9202. \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}
  9203. \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}
  9204. \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}
  9205. \DeclareUnicodeCharacter{00F0}{\dh}
  9206. \DeclareUnicodeCharacter{00F1}{\~n}
  9207. \DeclareUnicodeCharacter{00F2}{\`o}
  9208. \DeclareUnicodeCharacter{00F3}{\'o}
  9209. \DeclareUnicodeCharacter{00F4}{\^o}
  9210. \DeclareUnicodeCharacter{00F5}{\~o}
  9211. \DeclareUnicodeCharacter{00F6}{\"o}
  9212. \DeclareUnicodeCharacter{00F7}{\ensuremath\div}
  9213. \DeclareUnicodeCharacter{00F8}{\o}
  9214. \DeclareUnicodeCharacter{00F9}{\`u}
  9215. \DeclareUnicodeCharacter{00FA}{\'u}
  9216. \DeclareUnicodeCharacter{00FB}{\^u}
  9217. \DeclareUnicodeCharacter{00FC}{\"u}
  9218. \DeclareUnicodeCharacter{00FD}{\'y}
  9219. \DeclareUnicodeCharacter{00FE}{\th}
  9220. \DeclareUnicodeCharacter{00FF}{\"y}
  9221. \DeclareUnicodeCharacter{0100}{\=A}
  9222. \DeclareUnicodeCharacter{0101}{\=a}
  9223. \DeclareUnicodeCharacter{0102}{\u{A}}
  9224. \DeclareUnicodeCharacter{0103}{\u{a}}
  9225. \DeclareUnicodeCharacter{0104}{\ogonek{A}}
  9226. \DeclareUnicodeCharacter{0105}{\ogonek{a}}
  9227. \DeclareUnicodeCharacter{0106}{\'C}
  9228. \DeclareUnicodeCharacter{0107}{\'c}
  9229. \DeclareUnicodeCharacter{0108}{\^C}
  9230. \DeclareUnicodeCharacter{0109}{\^c}
  9231. \DeclareUnicodeCharacter{010A}{\dotaccent{C}}
  9232. \DeclareUnicodeCharacter{010B}{\dotaccent{c}}
  9233. \DeclareUnicodeCharacter{010C}{\v{C}}
  9234. \DeclareUnicodeCharacter{010D}{\v{c}}
  9235. \DeclareUnicodeCharacter{010E}{\v{D}}
  9236. \DeclareUnicodeCharacter{010F}{d'}
  9237. \DeclareUnicodeCharacter{0110}{\DH}
  9238. \DeclareUnicodeCharacter{0111}{\dh}
  9239. \DeclareUnicodeCharacter{0112}{\=E}
  9240. \DeclareUnicodeCharacter{0113}{\=e}
  9241. \DeclareUnicodeCharacter{0114}{\u{E}}
  9242. \DeclareUnicodeCharacter{0115}{\u{e}}
  9243. \DeclareUnicodeCharacter{0116}{\dotaccent{E}}
  9244. \DeclareUnicodeCharacter{0117}{\dotaccent{e}}
  9245. \DeclareUnicodeCharacter{0118}{\ogonek{E}}
  9246. \DeclareUnicodeCharacter{0119}{\ogonek{e}}
  9247. \DeclareUnicodeCharacter{011A}{\v{E}}
  9248. \DeclareUnicodeCharacter{011B}{\v{e}}
  9249. \DeclareUnicodeCharacter{011C}{\^G}
  9250. \DeclareUnicodeCharacter{011D}{\^g}
  9251. \DeclareUnicodeCharacter{011E}{\u{G}}
  9252. \DeclareUnicodeCharacter{011F}{\u{g}}
  9253. \DeclareUnicodeCharacter{0120}{\dotaccent{G}}
  9254. \DeclareUnicodeCharacter{0121}{\dotaccent{g}}
  9255. \DeclareUnicodeCharacter{0122}{\cedilla{G}}
  9256. \DeclareUnicodeCharacter{0123}{\cedilla{g}}
  9257. \DeclareUnicodeCharacter{0124}{\^H}
  9258. \DeclareUnicodeCharacter{0125}{\^h}
  9259. \DeclareUnicodeCharacter{0126}{\missingcharmsg{H WITH STROKE}}
  9260. \DeclareUnicodeCharacter{0127}{\missingcharmsg{h WITH STROKE}}
  9261. \DeclareUnicodeCharacter{0128}{\~I}
  9262. \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}
  9263. \DeclareUnicodeCharacter{012A}{\=I}
  9264. \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}
  9265. \DeclareUnicodeCharacter{012C}{\u{I}}
  9266. \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}
  9267. \DeclareUnicodeCharacter{012E}{\ogonek{I}}
  9268. \DeclareUnicodeCharacter{012F}{\ogonek{i}}
  9269. \DeclareUnicodeCharacter{0130}{\dotaccent{I}}
  9270. \DeclareUnicodeCharacter{0131}{\dotless{i}}
  9271. \DeclareUnicodeCharacter{0132}{IJ}
  9272. \DeclareUnicodeCharacter{0133}{ij}
  9273. \DeclareUnicodeCharacter{0134}{\^J}
  9274. \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}
  9275. \DeclareUnicodeCharacter{0136}{\cedilla{K}}
  9276. \DeclareUnicodeCharacter{0137}{\cedilla{k}}
  9277. \DeclareUnicodeCharacter{0138}{\ensuremath\kappa}
  9278. \DeclareUnicodeCharacter{0139}{\'L}
  9279. \DeclareUnicodeCharacter{013A}{\'l}
  9280. \DeclareUnicodeCharacter{013B}{\cedilla{L}}
  9281. \DeclareUnicodeCharacter{013C}{\cedilla{l}}
  9282. \DeclareUnicodeCharacter{013D}{L'}% should kern
  9283. \DeclareUnicodeCharacter{013E}{l'}% should kern
  9284. \DeclareUnicodeCharacter{013F}{L\U{00B7}}
  9285. \DeclareUnicodeCharacter{0140}{l\U{00B7}}
  9286. \DeclareUnicodeCharacter{0141}{\L}
  9287. \DeclareUnicodeCharacter{0142}{\l}
  9288. \DeclareUnicodeCharacter{0143}{\'N}
  9289. \DeclareUnicodeCharacter{0144}{\'n}
  9290. \DeclareUnicodeCharacter{0145}{\cedilla{N}}
  9291. \DeclareUnicodeCharacter{0146}{\cedilla{n}}
  9292. \DeclareUnicodeCharacter{0147}{\v{N}}
  9293. \DeclareUnicodeCharacter{0148}{\v{n}}
  9294. \DeclareUnicodeCharacter{0149}{'n}
  9295. \DeclareUnicodeCharacter{014A}{\missingcharmsg{ENG}}
  9296. \DeclareUnicodeCharacter{014B}{\missingcharmsg{eng}}
  9297. \DeclareUnicodeCharacter{014C}{\=O}
  9298. \DeclareUnicodeCharacter{014D}{\=o}
  9299. \DeclareUnicodeCharacter{014E}{\u{O}}
  9300. \DeclareUnicodeCharacter{014F}{\u{o}}
  9301. \DeclareUnicodeCharacter{0150}{\H{O}}
  9302. \DeclareUnicodeCharacter{0151}{\H{o}}
  9303. \DeclareUnicodeCharacter{0152}{\OE}
  9304. \DeclareUnicodeCharacter{0153}{\oe}
  9305. \DeclareUnicodeCharacter{0154}{\'R}
  9306. \DeclareUnicodeCharacter{0155}{\'r}
  9307. \DeclareUnicodeCharacter{0156}{\cedilla{R}}
  9308. \DeclareUnicodeCharacter{0157}{\cedilla{r}}
  9309. \DeclareUnicodeCharacter{0158}{\v{R}}
  9310. \DeclareUnicodeCharacter{0159}{\v{r}}
  9311. \DeclareUnicodeCharacter{015A}{\'S}
  9312. \DeclareUnicodeCharacter{015B}{\'s}
  9313. \DeclareUnicodeCharacter{015C}{\^S}
  9314. \DeclareUnicodeCharacter{015D}{\^s}
  9315. \DeclareUnicodeCharacter{015E}{\cedilla{S}}
  9316. \DeclareUnicodeCharacter{015F}{\cedilla{s}}
  9317. \DeclareUnicodeCharacter{0160}{\v{S}}
  9318. \DeclareUnicodeCharacter{0161}{\v{s}}
  9319. \DeclareUnicodeCharacter{0162}{\cedilla{T}}
  9320. \DeclareUnicodeCharacter{0163}{\cedilla{t}}
  9321. \DeclareUnicodeCharacter{0164}{\v{T}}
  9322. \DeclareUnicodeCharacter{0165}{\v{t}}
  9323. \DeclareUnicodeCharacter{0166}{\missingcharmsg{H WITH STROKE}}
  9324. \DeclareUnicodeCharacter{0167}{\missingcharmsg{h WITH STROKE}}
  9325. \DeclareUnicodeCharacter{0168}{\~U}
  9326. \DeclareUnicodeCharacter{0169}{\~u}
  9327. \DeclareUnicodeCharacter{016A}{\=U}
  9328. \DeclareUnicodeCharacter{016B}{\=u}
  9329. \DeclareUnicodeCharacter{016C}{\u{U}}
  9330. \DeclareUnicodeCharacter{016D}{\u{u}}
  9331. \DeclareUnicodeCharacter{016E}{\ringaccent{U}}
  9332. \DeclareUnicodeCharacter{016F}{\ringaccent{u}}
  9333. \DeclareUnicodeCharacter{0170}{\H{U}}
  9334. \DeclareUnicodeCharacter{0171}{\H{u}}
  9335. \DeclareUnicodeCharacter{0172}{\ogonek{U}}
  9336. \DeclareUnicodeCharacter{0173}{\ogonek{u}}
  9337. \DeclareUnicodeCharacter{0174}{\^W}
  9338. \DeclareUnicodeCharacter{0175}{\^w}
  9339. \DeclareUnicodeCharacter{0176}{\^Y}
  9340. \DeclareUnicodeCharacter{0177}{\^y}
  9341. \DeclareUnicodeCharacter{0178}{\"Y}
  9342. \DeclareUnicodeCharacter{0179}{\'Z}
  9343. \DeclareUnicodeCharacter{017A}{\'z}
  9344. \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}
  9345. \DeclareUnicodeCharacter{017C}{\dotaccent{z}}
  9346. \DeclareUnicodeCharacter{017D}{\v{Z}}
  9347. \DeclareUnicodeCharacter{017E}{\v{z}}
  9348. \DeclareUnicodeCharacter{017F}{\missingcharmsg{LONG S}}
  9349. \DeclareUnicodeCharacter{01C4}{D\v{Z}}
  9350. \DeclareUnicodeCharacter{01C5}{D\v{z}}
  9351. \DeclareUnicodeCharacter{01C6}{d\v{z}}
  9352. \DeclareUnicodeCharacter{01C7}{LJ}
  9353. \DeclareUnicodeCharacter{01C8}{Lj}
  9354. \DeclareUnicodeCharacter{01C9}{lj}
  9355. \DeclareUnicodeCharacter{01CA}{NJ}
  9356. \DeclareUnicodeCharacter{01CB}{Nj}
  9357. \DeclareUnicodeCharacter{01CC}{nj}
  9358. \DeclareUnicodeCharacter{01CD}{\v{A}}
  9359. \DeclareUnicodeCharacter{01CE}{\v{a}}
  9360. \DeclareUnicodeCharacter{01CF}{\v{I}}
  9361. \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}
  9362. \DeclareUnicodeCharacter{01D1}{\v{O}}
  9363. \DeclareUnicodeCharacter{01D2}{\v{o}}
  9364. \DeclareUnicodeCharacter{01D3}{\v{U}}
  9365. \DeclareUnicodeCharacter{01D4}{\v{u}}
  9366. \DeclareUnicodeCharacter{01E2}{\={\AE}}
  9367. \DeclareUnicodeCharacter{01E3}{\={\ae}}
  9368. \DeclareUnicodeCharacter{01E6}{\v{G}}
  9369. \DeclareUnicodeCharacter{01E7}{\v{g}}
  9370. \DeclareUnicodeCharacter{01E8}{\v{K}}
  9371. \DeclareUnicodeCharacter{01E9}{\v{k}}
  9372. \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}
  9373. \DeclareUnicodeCharacter{01F1}{DZ}
  9374. \DeclareUnicodeCharacter{01F2}{Dz}
  9375. \DeclareUnicodeCharacter{01F3}{dz}
  9376. \DeclareUnicodeCharacter{01F4}{\'G}
  9377. \DeclareUnicodeCharacter{01F5}{\'g}
  9378. \DeclareUnicodeCharacter{01F8}{\`N}
  9379. \DeclareUnicodeCharacter{01F9}{\`n}
  9380. \DeclareUnicodeCharacter{01FC}{\'{\AE}}
  9381. \DeclareUnicodeCharacter{01FD}{\'{\ae}}
  9382. \DeclareUnicodeCharacter{01FE}{\'{\O}}
  9383. \DeclareUnicodeCharacter{01FF}{\'{\o}}
  9384. \DeclareUnicodeCharacter{021E}{\v{H}}
  9385. \DeclareUnicodeCharacter{021F}{\v{h}}
  9386. \DeclareUnicodeCharacter{0226}{\dotaccent{A}}
  9387. \DeclareUnicodeCharacter{0227}{\dotaccent{a}}
  9388. \DeclareUnicodeCharacter{0228}{\cedilla{E}}
  9389. \DeclareUnicodeCharacter{0229}{\cedilla{e}}
  9390. \DeclareUnicodeCharacter{022E}{\dotaccent{O}}
  9391. \DeclareUnicodeCharacter{022F}{\dotaccent{o}}
  9392. \DeclareUnicodeCharacter{0232}{\=Y}
  9393. \DeclareUnicodeCharacter{0233}{\=y}
  9394. \DeclareUnicodeCharacter{0237}{\dotless{j}}
  9395. \DeclareUnicodeCharacter{02DB}{\ogonek{ }}
  9396. % Greek letters upper case
  9397. \DeclareUnicodeCharacter{0391}{{\it A}}
  9398. \DeclareUnicodeCharacter{0392}{{\it B}}
  9399. \DeclareUnicodeCharacter{0393}{\ensuremath{\mit\Gamma}}
  9400. \DeclareUnicodeCharacter{0394}{\ensuremath{\mit\Delta}}
  9401. \DeclareUnicodeCharacter{0395}{{\it E}}
  9402. \DeclareUnicodeCharacter{0396}{{\it Z}}
  9403. \DeclareUnicodeCharacter{0397}{{\it H}}
  9404. \DeclareUnicodeCharacter{0398}{\ensuremath{\mit\Theta}}
  9405. \DeclareUnicodeCharacter{0399}{{\it I}}
  9406. \DeclareUnicodeCharacter{039A}{{\it K}}
  9407. \DeclareUnicodeCharacter{039B}{\ensuremath{\mit\Lambda}}
  9408. \DeclareUnicodeCharacter{039C}{{\it M}}
  9409. \DeclareUnicodeCharacter{039D}{{\it N}}
  9410. \DeclareUnicodeCharacter{039E}{\ensuremath{\mit\Xi}}
  9411. \DeclareUnicodeCharacter{039F}{{\it O}}
  9412. \DeclareUnicodeCharacter{03A0}{\ensuremath{\mit\Pi}}
  9413. \DeclareUnicodeCharacter{03A1}{{\it P}}
  9414. %\DeclareUnicodeCharacter{03A2}{} % none - corresponds to final sigma
  9415. \DeclareUnicodeCharacter{03A3}{\ensuremath{\mit\Sigma}}
  9416. \DeclareUnicodeCharacter{03A4}{{\it T}}
  9417. \DeclareUnicodeCharacter{03A5}{\ensuremath{\mit\Upsilon}}
  9418. \DeclareUnicodeCharacter{03A6}{\ensuremath{\mit\Phi}}
  9419. \DeclareUnicodeCharacter{03A7}{{\it X}}
  9420. \DeclareUnicodeCharacter{03A8}{\ensuremath{\mit\Psi}}
  9421. \DeclareUnicodeCharacter{03A9}{\ensuremath{\mit\Omega}}
  9422. % Vowels with accents
  9423. \DeclareUnicodeCharacter{0390}{\ensuremath{\ddot{\acute\iota}}}
  9424. \DeclareUnicodeCharacter{03AC}{\ensuremath{\acute\alpha}}
  9425. \DeclareUnicodeCharacter{03AD}{\ensuremath{\acute\epsilon}}
  9426. \DeclareUnicodeCharacter{03AE}{\ensuremath{\acute\eta}}
  9427. \DeclareUnicodeCharacter{03AF}{\ensuremath{\acute\iota}}
  9428. \DeclareUnicodeCharacter{03B0}{\ensuremath{\acute{\ddot\upsilon}}}
  9429. % Standalone accent
  9430. \DeclareUnicodeCharacter{0384}{\ensuremath{\acute{\ }}}
  9431. % Greek letters lower case
  9432. \DeclareUnicodeCharacter{03B1}{\ensuremath\alpha}
  9433. \DeclareUnicodeCharacter{03B2}{\ensuremath\beta}
  9434. \DeclareUnicodeCharacter{03B3}{\ensuremath\gamma}
  9435. \DeclareUnicodeCharacter{03B4}{\ensuremath\delta}
  9436. \DeclareUnicodeCharacter{03B5}{\ensuremath\epsilon}
  9437. \DeclareUnicodeCharacter{03B6}{\ensuremath\zeta}
  9438. \DeclareUnicodeCharacter{03B7}{\ensuremath\eta}
  9439. \DeclareUnicodeCharacter{03B8}{\ensuremath\theta}
  9440. \DeclareUnicodeCharacter{03B9}{\ensuremath\iota}
  9441. \DeclareUnicodeCharacter{03BA}{\ensuremath\kappa}
  9442. \DeclareUnicodeCharacter{03BB}{\ensuremath\lambda}
  9443. \DeclareUnicodeCharacter{03BC}{\ensuremath\mu}
  9444. \DeclareUnicodeCharacter{03BD}{\ensuremath\nu}
  9445. \DeclareUnicodeCharacter{03BE}{\ensuremath\xi}
  9446. \DeclareUnicodeCharacter{03BF}{{\it o}} % omicron
  9447. \DeclareUnicodeCharacter{03C0}{\ensuremath\pi}
  9448. \DeclareUnicodeCharacter{03C1}{\ensuremath\rho}
  9449. \DeclareUnicodeCharacter{03C2}{\ensuremath\varsigma}
  9450. \DeclareUnicodeCharacter{03C3}{\ensuremath\sigma}
  9451. \DeclareUnicodeCharacter{03C4}{\ensuremath\tau}
  9452. \DeclareUnicodeCharacter{03C5}{\ensuremath\upsilon}
  9453. \DeclareUnicodeCharacter{03C6}{\ensuremath\phi}
  9454. \DeclareUnicodeCharacter{03C7}{\ensuremath\chi}
  9455. \DeclareUnicodeCharacter{03C8}{\ensuremath\psi}
  9456. \DeclareUnicodeCharacter{03C9}{\ensuremath\omega}
  9457. % More Greek vowels with accents
  9458. \DeclareUnicodeCharacter{03CA}{\ensuremath{\ddot\iota}}
  9459. \DeclareUnicodeCharacter{03CB}{\ensuremath{\ddot\upsilon}}
  9460. \DeclareUnicodeCharacter{03CC}{\ensuremath{\acute o}}
  9461. \DeclareUnicodeCharacter{03CD}{\ensuremath{\acute\upsilon}}
  9462. \DeclareUnicodeCharacter{03CE}{\ensuremath{\acute\omega}}
  9463. % Variant Greek letters
  9464. \DeclareUnicodeCharacter{03D1}{\ensuremath\vartheta}
  9465. \DeclareUnicodeCharacter{03D6}{\ensuremath\varpi}
  9466. \DeclareUnicodeCharacter{03F1}{\ensuremath\varrho}
  9467. \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}
  9468. \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}
  9469. \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}
  9470. \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}
  9471. \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}
  9472. \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}
  9473. \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}
  9474. \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}
  9475. \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}
  9476. \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}
  9477. \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}
  9478. \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}
  9479. \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}
  9480. \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}
  9481. \DeclareUnicodeCharacter{1E20}{\=G}
  9482. \DeclareUnicodeCharacter{1E21}{\=g}
  9483. \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}
  9484. \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}
  9485. \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}
  9486. \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}
  9487. \DeclareUnicodeCharacter{1E26}{\"H}
  9488. \DeclareUnicodeCharacter{1E27}{\"h}
  9489. \DeclareUnicodeCharacter{1E30}{\'K}
  9490. \DeclareUnicodeCharacter{1E31}{\'k}
  9491. \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}
  9492. \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}
  9493. \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}
  9494. \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}
  9495. \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}
  9496. \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}
  9497. \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}
  9498. \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}
  9499. \DeclareUnicodeCharacter{1E3E}{\'M}
  9500. \DeclareUnicodeCharacter{1E3F}{\'m}
  9501. \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}
  9502. \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}
  9503. \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}
  9504. \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}
  9505. \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}
  9506. \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}
  9507. \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}
  9508. \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}
  9509. \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}
  9510. \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}
  9511. \DeclareUnicodeCharacter{1E54}{\'P}
  9512. \DeclareUnicodeCharacter{1E55}{\'p}
  9513. \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}
  9514. \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}
  9515. \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}
  9516. \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}
  9517. \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}
  9518. \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}
  9519. \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}
  9520. \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}
  9521. \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}
  9522. \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}
  9523. \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}
  9524. \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}
  9525. \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}
  9526. \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}
  9527. \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}
  9528. \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}
  9529. \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}
  9530. \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}
  9531. \DeclareUnicodeCharacter{1E7C}{\~V}
  9532. \DeclareUnicodeCharacter{1E7D}{\~v}
  9533. \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}
  9534. \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}
  9535. \DeclareUnicodeCharacter{1E80}{\`W}
  9536. \DeclareUnicodeCharacter{1E81}{\`w}
  9537. \DeclareUnicodeCharacter{1E82}{\'W}
  9538. \DeclareUnicodeCharacter{1E83}{\'w}
  9539. \DeclareUnicodeCharacter{1E84}{\"W}
  9540. \DeclareUnicodeCharacter{1E85}{\"w}
  9541. \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}
  9542. \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}
  9543. \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}
  9544. \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}
  9545. \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}
  9546. \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}
  9547. \DeclareUnicodeCharacter{1E8C}{\"X}
  9548. \DeclareUnicodeCharacter{1E8D}{\"x}
  9549. \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}
  9550. \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}
  9551. \DeclareUnicodeCharacter{1E90}{\^Z}
  9552. \DeclareUnicodeCharacter{1E91}{\^z}
  9553. \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}
  9554. \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}
  9555. \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}
  9556. \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}
  9557. \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}
  9558. \DeclareUnicodeCharacter{1E97}{\"t}
  9559. \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}
  9560. \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}
  9561. \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}
  9562. \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}
  9563. \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}
  9564. \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}
  9565. \DeclareUnicodeCharacter{1EBC}{\~E}
  9566. \DeclareUnicodeCharacter{1EBD}{\~e}
  9567. \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}
  9568. \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}
  9569. \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}
  9570. \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}
  9571. \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}
  9572. \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}
  9573. \DeclareUnicodeCharacter{1EF2}{\`Y}
  9574. \DeclareUnicodeCharacter{1EF3}{\`y}
  9575. \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}
  9576. \DeclareUnicodeCharacter{1EF8}{\~Y}
  9577. \DeclareUnicodeCharacter{1EF9}{\~y}
  9578. % Punctuation
  9579. \DeclareUnicodeCharacter{2013}{--}
  9580. \DeclareUnicodeCharacter{2014}{---}
  9581. \DeclareUnicodeCharacter{2018}{\quoteleft}
  9582. \DeclareUnicodeCharacter{2019}{\quoteright}
  9583. \DeclareUnicodeCharacter{201A}{\quotesinglbase}
  9584. \DeclareUnicodeCharacter{201C}{\quotedblleft}
  9585. \DeclareUnicodeCharacter{201D}{\quotedblright}
  9586. \DeclareUnicodeCharacter{201E}{\quotedblbase}
  9587. \DeclareUnicodeCharacter{2020}{\ensuremath\dagger}
  9588. \DeclareUnicodeCharacter{2021}{\ensuremath\ddagger}
  9589. \DeclareUnicodeCharacter{2022}{\bullet}
  9590. \DeclareUnicodeCharacter{202F}{\thinspace}
  9591. \DeclareUnicodeCharacter{2026}{\dots}
  9592. \DeclareUnicodeCharacter{2039}{\guilsinglleft}
  9593. \DeclareUnicodeCharacter{203A}{\guilsinglright}
  9594. \DeclareUnicodeCharacter{20AC}{\euro}
  9595. \DeclareUnicodeCharacter{2192}{\expansion}
  9596. \DeclareUnicodeCharacter{21D2}{\result}
  9597. % Mathematical symbols
  9598. \DeclareUnicodeCharacter{2200}{\ensuremath\forall}
  9599. \DeclareUnicodeCharacter{2203}{\ensuremath\exists}
  9600. \DeclareUnicodeCharacter{2208}{\ensuremath\in}
  9601. \DeclareUnicodeCharacter{2212}{\minus}
  9602. \DeclareUnicodeCharacter{2217}{\ast}
  9603. \DeclareUnicodeCharacter{221E}{\ensuremath\infty}
  9604. \DeclareUnicodeCharacter{2225}{\ensuremath\parallel}
  9605. \DeclareUnicodeCharacter{2227}{\ensuremath\wedge}
  9606. \DeclareUnicodeCharacter{2229}{\ensuremath\cap}
  9607. \DeclareUnicodeCharacter{2261}{\equiv}
  9608. \DeclareUnicodeCharacter{2264}{\ensuremath\leq}
  9609. \DeclareUnicodeCharacter{2265}{\ensuremath\geq}
  9610. \DeclareUnicodeCharacter{2282}{\ensuremath\subset}
  9611. \DeclareUnicodeCharacter{2287}{\ensuremath\supseteq}
  9612. \DeclareUnicodeCharacter{2016}{\ensuremath\Vert}
  9613. \DeclareUnicodeCharacter{2032}{\ensuremath\prime}
  9614. \DeclareUnicodeCharacter{210F}{\ensuremath\hbar}
  9615. \DeclareUnicodeCharacter{2111}{\ensuremath\Im}
  9616. \DeclareUnicodeCharacter{2113}{\ensuremath\ell}
  9617. \DeclareUnicodeCharacter{2118}{\ensuremath\wp}
  9618. \DeclareUnicodeCharacter{211C}{\ensuremath\Re}
  9619. \DeclareUnicodeCharacter{2127}{\ensuremath\mho}
  9620. \DeclareUnicodeCharacter{2135}{\ensuremath\aleph}
  9621. \DeclareUnicodeCharacter{2190}{\ensuremath\leftarrow}
  9622. \DeclareUnicodeCharacter{2191}{\ensuremath\uparrow}
  9623. \DeclareUnicodeCharacter{2193}{\ensuremath\downarrow}
  9624. \DeclareUnicodeCharacter{2194}{\ensuremath\leftrightarrow}
  9625. \DeclareUnicodeCharacter{2195}{\ensuremath\updownarrow}
  9626. \DeclareUnicodeCharacter{2196}{\ensuremath\nwarrow}
  9627. \DeclareUnicodeCharacter{2197}{\ensuremath\nearrow}
  9628. \DeclareUnicodeCharacter{2198}{\ensuremath\searrow}
  9629. \DeclareUnicodeCharacter{2199}{\ensuremath\swarrow}
  9630. \DeclareUnicodeCharacter{21A6}{\ensuremath\mapsto}
  9631. \DeclareUnicodeCharacter{21A9}{\ensuremath\hookleftarrow}
  9632. \DeclareUnicodeCharacter{21AA}{\ensuremath\hookrightarrow}
  9633. \DeclareUnicodeCharacter{21BC}{\ensuremath\leftharpoonup}
  9634. \DeclareUnicodeCharacter{21BD}{\ensuremath\leftharpoondown}
  9635. \DeclareUnicodeCharacter{21BE}{\ensuremath\upharpoonright}
  9636. \DeclareUnicodeCharacter{21C0}{\ensuremath\rightharpoonup}
  9637. \DeclareUnicodeCharacter{21C1}{\ensuremath\rightharpoondown}
  9638. \DeclareUnicodeCharacter{21CC}{\ensuremath\rightleftharpoons}
  9639. \DeclareUnicodeCharacter{21D0}{\ensuremath\Leftarrow}
  9640. \DeclareUnicodeCharacter{21D1}{\ensuremath\Uparrow}
  9641. \DeclareUnicodeCharacter{21D3}{\ensuremath\Downarrow}
  9642. \DeclareUnicodeCharacter{21D4}{\ensuremath\Leftrightarrow}
  9643. \DeclareUnicodeCharacter{21D5}{\ensuremath\Updownarrow}
  9644. \DeclareUnicodeCharacter{21DD}{\ensuremath\leadsto}
  9645. \DeclareUnicodeCharacter{2201}{\ensuremath\complement}
  9646. \DeclareUnicodeCharacter{2202}{\ensuremath\partial}
  9647. \DeclareUnicodeCharacter{2205}{\ensuremath\emptyset}
  9648. \DeclareUnicodeCharacter{2207}{\ensuremath\nabla}
  9649. \DeclareUnicodeCharacter{2209}{\ensuremath\notin}
  9650. \DeclareUnicodeCharacter{220B}{\ensuremath\owns}
  9651. \DeclareUnicodeCharacter{220F}{\ensuremath\prod}
  9652. \DeclareUnicodeCharacter{2210}{\ensuremath\coprod}
  9653. \DeclareUnicodeCharacter{2211}{\ensuremath\sum}
  9654. \DeclareUnicodeCharacter{2213}{\ensuremath\mp}
  9655. \DeclareUnicodeCharacter{2218}{\ensuremath\circ}
  9656. \DeclareUnicodeCharacter{221A}{\ensuremath\surd}
  9657. \DeclareUnicodeCharacter{221D}{\ensuremath\propto}
  9658. \DeclareUnicodeCharacter{2220}{\ensuremath\angle}
  9659. \DeclareUnicodeCharacter{2223}{\ensuremath\mid}
  9660. \DeclareUnicodeCharacter{2228}{\ensuremath\vee}
  9661. \DeclareUnicodeCharacter{222A}{\ensuremath\cup}
  9662. \DeclareUnicodeCharacter{222B}{\ensuremath\smallint}
  9663. \DeclareUnicodeCharacter{222E}{\ensuremath\oint}
  9664. \DeclareUnicodeCharacter{223C}{\ensuremath\sim}
  9665. \DeclareUnicodeCharacter{2240}{\ensuremath\wr}
  9666. \DeclareUnicodeCharacter{2243}{\ensuremath\simeq}
  9667. \DeclareUnicodeCharacter{2245}{\ensuremath\cong}
  9668. \DeclareUnicodeCharacter{2248}{\ensuremath\approx}
  9669. \DeclareUnicodeCharacter{224D}{\ensuremath\asymp}
  9670. \DeclareUnicodeCharacter{2250}{\ensuremath\doteq}
  9671. \DeclareUnicodeCharacter{2260}{\ensuremath\neq}
  9672. \DeclareUnicodeCharacter{226A}{\ensuremath\ll}
  9673. \DeclareUnicodeCharacter{226B}{\ensuremath\gg}
  9674. \DeclareUnicodeCharacter{227A}{\ensuremath\prec}
  9675. \DeclareUnicodeCharacter{227B}{\ensuremath\succ}
  9676. \DeclareUnicodeCharacter{2283}{\ensuremath\supset}
  9677. \DeclareUnicodeCharacter{2286}{\ensuremath\subseteq}
  9678. \DeclareUnicodeCharacter{228E}{\ensuremath\uplus}
  9679. \DeclareUnicodeCharacter{228F}{\ensuremath\sqsubset}
  9680. \DeclareUnicodeCharacter{2290}{\ensuremath\sqsupset}
  9681. \DeclareUnicodeCharacter{2291}{\ensuremath\sqsubseteq}
  9682. \DeclareUnicodeCharacter{2292}{\ensuremath\sqsupseteq}
  9683. \DeclareUnicodeCharacter{2293}{\ensuremath\sqcap}
  9684. \DeclareUnicodeCharacter{2294}{\ensuremath\sqcup}
  9685. \DeclareUnicodeCharacter{2295}{\ensuremath\oplus}
  9686. \DeclareUnicodeCharacter{2296}{\ensuremath\ominus}
  9687. \DeclareUnicodeCharacter{2297}{\ensuremath\otimes}
  9688. \DeclareUnicodeCharacter{2298}{\ensuremath\oslash}
  9689. \DeclareUnicodeCharacter{2299}{\ensuremath\odot}
  9690. \DeclareUnicodeCharacter{22A2}{\ensuremath\vdash}
  9691. \DeclareUnicodeCharacter{22A3}{\ensuremath\dashv}
  9692. \DeclareUnicodeCharacter{22A4}{\ensuremath\ptextop}
  9693. \DeclareUnicodeCharacter{22A5}{\ensuremath\bot}
  9694. \DeclareUnicodeCharacter{22A8}{\ensuremath\models}
  9695. \DeclareUnicodeCharacter{22B4}{\ensuremath\unlhd}
  9696. \DeclareUnicodeCharacter{22B5}{\ensuremath\unrhd}
  9697. \DeclareUnicodeCharacter{22C0}{\ensuremath\bigwedge}
  9698. \DeclareUnicodeCharacter{22C1}{\ensuremath\bigvee}
  9699. \DeclareUnicodeCharacter{22C2}{\ensuremath\bigcap}
  9700. \DeclareUnicodeCharacter{22C3}{\ensuremath\bigcup}
  9701. \DeclareUnicodeCharacter{22C4}{\ensuremath\diamond}
  9702. \DeclareUnicodeCharacter{22C5}{\ensuremath\cdot}
  9703. \DeclareUnicodeCharacter{22C6}{\ensuremath\star}
  9704. \DeclareUnicodeCharacter{22C8}{\ensuremath\bowtie}
  9705. \DeclareUnicodeCharacter{2308}{\ensuremath\lceil}
  9706. \DeclareUnicodeCharacter{2309}{\ensuremath\rceil}
  9707. \DeclareUnicodeCharacter{230A}{\ensuremath\lfloor}
  9708. \DeclareUnicodeCharacter{230B}{\ensuremath\rfloor}
  9709. \DeclareUnicodeCharacter{2322}{\ensuremath\frown}
  9710. \DeclareUnicodeCharacter{2323}{\ensuremath\smile}
  9711. \DeclareUnicodeCharacter{25A1}{\ensuremath\Box}
  9712. \DeclareUnicodeCharacter{25B3}{\ensuremath\triangle}
  9713. \DeclareUnicodeCharacter{25B7}{\ensuremath\triangleright}
  9714. \DeclareUnicodeCharacter{25BD}{\ensuremath\bigtriangledown}
  9715. \DeclareUnicodeCharacter{25C1}{\ensuremath\triangleleft}
  9716. \DeclareUnicodeCharacter{25C7}{\ensuremath\Diamond}
  9717. \DeclareUnicodeCharacter{2660}{\ensuremath\spadesuit}
  9718. \DeclareUnicodeCharacter{2661}{\ensuremath\heartsuit}
  9719. \DeclareUnicodeCharacter{2662}{\ensuremath\diamondsuit}
  9720. \DeclareUnicodeCharacter{2663}{\ensuremath\clubsuit}
  9721. \DeclareUnicodeCharacter{266D}{\ensuremath\flat}
  9722. \DeclareUnicodeCharacter{266E}{\ensuremath\natural}
  9723. \DeclareUnicodeCharacter{266F}{\ensuremath\sharp}
  9724. \DeclareUnicodeCharacter{26AA}{\ensuremath\bigcirc}
  9725. \DeclareUnicodeCharacter{27B9}{\ensuremath\rangle}
  9726. \DeclareUnicodeCharacter{27C2}{\ensuremath\perp}
  9727. \DeclareUnicodeCharacter{27E8}{\ensuremath\langle}
  9728. \DeclareUnicodeCharacter{27F5}{\ensuremath\longleftarrow}
  9729. \DeclareUnicodeCharacter{27F6}{\ensuremath\longrightarrow}
  9730. \DeclareUnicodeCharacter{27F7}{\ensuremath\longleftrightarrow}
  9731. \DeclareUnicodeCharacter{27FC}{\ensuremath\longmapsto}
  9732. \DeclareUnicodeCharacter{29F5}{\ensuremath\setminus}
  9733. \DeclareUnicodeCharacter{2A00}{\ensuremath\bigodot}
  9734. \DeclareUnicodeCharacter{2A01}{\ensuremath\bigoplus}
  9735. \DeclareUnicodeCharacter{2A02}{\ensuremath\bigotimes}
  9736. \DeclareUnicodeCharacter{2A04}{\ensuremath\biguplus}
  9737. \DeclareUnicodeCharacter{2A06}{\ensuremath\bigsqcup}
  9738. \DeclareUnicodeCharacter{2A1D}{\ensuremath\Join}
  9739. \DeclareUnicodeCharacter{2A3F}{\ensuremath\amalg}
  9740. \DeclareUnicodeCharacter{2AAF}{\ensuremath\preceq}
  9741. \DeclareUnicodeCharacter{2AB0}{\ensuremath\succeq}
  9742. \global\mathchardef\checkmark="1370 % actually the square root sign
  9743. \DeclareUnicodeCharacter{2713}{\ensuremath\checkmark}
  9744. }% end of \utfeightchardefs
  9745. % US-ASCII character definitions.
  9746. \def\asciichardefs{% nothing need be done
  9747. \relax
  9748. }
  9749. % Latin1 (ISO-8859-1) character definitions.
  9750. \def\nonasciistringdefs{%
  9751. \setnonasciicharscatcode\active
  9752. \def\defstringchar##1{\def##1{\string##1}}%
  9753. %
  9754. \defstringchar^^80\defstringchar^^81\defstringchar^^82\defstringchar^^83%
  9755. \defstringchar^^84\defstringchar^^85\defstringchar^^86\defstringchar^^87%
  9756. \defstringchar^^88\defstringchar^^89\defstringchar^^8a\defstringchar^^8b%
  9757. \defstringchar^^8c\defstringchar^^8d\defstringchar^^8e\defstringchar^^8f%
  9758. %
  9759. \defstringchar^^90\defstringchar^^91\defstringchar^^92\defstringchar^^93%
  9760. \defstringchar^^94\defstringchar^^95\defstringchar^^96\defstringchar^^97%
  9761. \defstringchar^^98\defstringchar^^99\defstringchar^^9a\defstringchar^^9b%
  9762. \defstringchar^^9c\defstringchar^^9d\defstringchar^^9e\defstringchar^^9f%
  9763. %
  9764. \defstringchar^^a0\defstringchar^^a1\defstringchar^^a2\defstringchar^^a3%
  9765. \defstringchar^^a4\defstringchar^^a5\defstringchar^^a6\defstringchar^^a7%
  9766. \defstringchar^^a8\defstringchar^^a9\defstringchar^^aa\defstringchar^^ab%
  9767. \defstringchar^^ac\defstringchar^^ad\defstringchar^^ae\defstringchar^^af%
  9768. %
  9769. \defstringchar^^b0\defstringchar^^b1\defstringchar^^b2\defstringchar^^b3%
  9770. \defstringchar^^b4\defstringchar^^b5\defstringchar^^b6\defstringchar^^b7%
  9771. \defstringchar^^b8\defstringchar^^b9\defstringchar^^ba\defstringchar^^bb%
  9772. \defstringchar^^bc\defstringchar^^bd\defstringchar^^be\defstringchar^^bf%
  9773. %
  9774. \defstringchar^^c0\defstringchar^^c1\defstringchar^^c2\defstringchar^^c3%
  9775. \defstringchar^^c4\defstringchar^^c5\defstringchar^^c6\defstringchar^^c7%
  9776. \defstringchar^^c8\defstringchar^^c9\defstringchar^^ca\defstringchar^^cb%
  9777. \defstringchar^^cc\defstringchar^^cd\defstringchar^^ce\defstringchar^^cf%
  9778. %
  9779. \defstringchar^^d0\defstringchar^^d1\defstringchar^^d2\defstringchar^^d3%
  9780. \defstringchar^^d4\defstringchar^^d5\defstringchar^^d6\defstringchar^^d7%
  9781. \defstringchar^^d8\defstringchar^^d9\defstringchar^^da\defstringchar^^db%
  9782. \defstringchar^^dc\defstringchar^^dd\defstringchar^^de\defstringchar^^df%
  9783. %
  9784. \defstringchar^^e0\defstringchar^^e1\defstringchar^^e2\defstringchar^^e3%
  9785. \defstringchar^^e4\defstringchar^^e5\defstringchar^^e6\defstringchar^^e7%
  9786. \defstringchar^^e8\defstringchar^^e9\defstringchar^^ea\defstringchar^^eb%
  9787. \defstringchar^^ec\defstringchar^^ed\defstringchar^^ee\defstringchar^^ef%
  9788. %
  9789. \defstringchar^^f0\defstringchar^^f1\defstringchar^^f2\defstringchar^^f3%
  9790. \defstringchar^^f4\defstringchar^^f5\defstringchar^^f6\defstringchar^^f7%
  9791. \defstringchar^^f8\defstringchar^^f9\defstringchar^^fa\defstringchar^^fb%
  9792. \defstringchar^^fc\defstringchar^^fd\defstringchar^^fe\defstringchar^^ff%
  9793. }
  9794. % define all the unicode characters we know about, for the sake of @U.
  9795. \utfeightchardefs
  9796. % Make non-ASCII characters printable again for compatibility with
  9797. % existing Texinfo documents that may use them, even without declaring a
  9798. % document encoding.
  9799. %
  9800. \setnonasciicharscatcode \other
  9801. \message{formatting,}
  9802. \newdimen\defaultparindent \defaultparindent = 15pt
  9803. \chapheadingskip = 15pt plus 4pt minus 2pt
  9804. \secheadingskip = 12pt plus 3pt minus 2pt
  9805. \subsecheadingskip = 9pt plus 2pt minus 2pt
  9806. % Prevent underfull vbox error messages.
  9807. \vbadness = 10000
  9808. % Don't be very finicky about underfull hboxes, either.
  9809. \hbadness = 6666
  9810. % Following George Bush, get rid of widows and orphans.
  9811. \widowpenalty=10000
  9812. \clubpenalty=10000
  9813. % Use TeX 3.0's \emergencystretch to help line breaking, but if we're
  9814. % using an old version of TeX, don't do anything. We want the amount of
  9815. % stretch added to depend on the line length, hence the dependence on
  9816. % \hsize. We call this whenever the paper size is set.
  9817. %
  9818. \def\setemergencystretch{%
  9819. \ifx\emergencystretch\thisisundefined
  9820. % Allow us to assign to \emergencystretch anyway.
  9821. \def\emergencystretch{\dimen0}%
  9822. \else
  9823. \emergencystretch = .15\hsize
  9824. \fi
  9825. }
  9826. % Parameters in order: 1) textheight; 2) textwidth;
  9827. % 3) voffset; 4) hoffset; 5) binding offset; 6) topskip;
  9828. % 7) physical page height; 8) physical page width.
  9829. %
  9830. % We also call \setleading{\textleading}, so the caller should define
  9831. % \textleading. The caller should also set \parskip.
  9832. %
  9833. \def\internalpagesizes#1#2#3#4#5#6#7#8{%
  9834. \voffset = #3\relax
  9835. \topskip = #6\relax
  9836. \splittopskip = \topskip
  9837. %
  9838. \vsize = #1\relax
  9839. \advance\vsize by \topskip
  9840. \outervsize = \vsize
  9841. \advance\outervsize by 2\topandbottommargin
  9842. \pageheight = \vsize
  9843. %
  9844. \hsize = #2\relax
  9845. \outerhsize = \hsize
  9846. \advance\outerhsize by 0.5in
  9847. \pagewidth = \hsize
  9848. %
  9849. \normaloffset = #4\relax
  9850. \bindingoffset = #5\relax
  9851. %
  9852. \ifpdf
  9853. \pdfpageheight #7\relax
  9854. \pdfpagewidth #8\relax
  9855. % if we don't reset these, they will remain at "1 true in" of
  9856. % whatever layout pdftex was dumped with.
  9857. \pdfhorigin = 1 true in
  9858. \pdfvorigin = 1 true in
  9859. \fi
  9860. %
  9861. \setleading{\textleading}
  9862. %
  9863. \parindent = \defaultparindent
  9864. \setemergencystretch
  9865. }
  9866. % @letterpaper (the default).
  9867. \def\letterpaper{{\globaldefs = 1
  9868. \parskip = 3pt plus 2pt minus 1pt
  9869. \textleading = 13.2pt
  9870. %
  9871. % If page is nothing but text, make it come out even.
  9872. \internalpagesizes{607.2pt}{6in}% that's 46 lines
  9873. {\voffset}{.25in}%
  9874. {\bindingoffset}{36pt}%
  9875. {11in}{8.5in}%
  9876. }}
  9877. % Use @smallbook to reset parameters for 7x9.25 trim size.
  9878. \def\smallbook{{\globaldefs = 1
  9879. \parskip = 2pt plus 1pt
  9880. \textleading = 12pt
  9881. %
  9882. \internalpagesizes{7.5in}{5in}%
  9883. {-.2in}{0in}%
  9884. {\bindingoffset}{16pt}%
  9885. {9.25in}{7in}%
  9886. %
  9887. \lispnarrowing = 0.3in
  9888. \tolerance = 700
  9889. \hfuzz = 1pt
  9890. \contentsrightmargin = 0pt
  9891. \defbodyindent = .5cm
  9892. }}
  9893. % Use @smallerbook to reset parameters for 6x9 trim size.
  9894. % (Just testing, parameters still in flux.)
  9895. \def\smallerbook{{\globaldefs = 1
  9896. \parskip = 1.5pt plus 1pt
  9897. \textleading = 12pt
  9898. %
  9899. \internalpagesizes{7.4in}{4.8in}%
  9900. {-.2in}{-.4in}%
  9901. {0pt}{14pt}%
  9902. {9in}{6in}%
  9903. %
  9904. \lispnarrowing = 0.25in
  9905. \tolerance = 700
  9906. \hfuzz = 1pt
  9907. \contentsrightmargin = 0pt
  9908. \defbodyindent = .4cm
  9909. }}
  9910. % Use @afourpaper to print on European A4 paper.
  9911. \def\afourpaper{{\globaldefs = 1
  9912. \parskip = 3pt plus 2pt minus 1pt
  9913. \textleading = 13.2pt
  9914. %
  9915. % Double-side printing via postscript on Laserjet 4050
  9916. % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
  9917. % To change the settings for a different printer or situation, adjust
  9918. % \normaloffset until the front-side and back-side texts align. Then
  9919. % do the same for \bindingoffset. You can set these for testing in
  9920. % your texinfo source file like this:
  9921. % @tex
  9922. % \global\normaloffset = -6mm
  9923. % \global\bindingoffset = 10mm
  9924. % @end tex
  9925. \internalpagesizes{673.2pt}{160mm}% that's 51 lines
  9926. {\voffset}{\hoffset}%
  9927. {\bindingoffset}{44pt}%
  9928. {297mm}{210mm}%
  9929. %
  9930. \tolerance = 700
  9931. \hfuzz = 1pt
  9932. \contentsrightmargin = 0pt
  9933. \defbodyindent = 5mm
  9934. }}
  9935. % Use @afivepaper to print on European A5 paper.
  9936. % From romildo@urano.iceb.ufop.br, 2 July 2000.
  9937. % He also recommends making @example and @lisp be small.
  9938. \def\afivepaper{{\globaldefs = 1
  9939. \parskip = 2pt plus 1pt minus 0.1pt
  9940. \textleading = 12.5pt
  9941. %
  9942. \internalpagesizes{160mm}{120mm}%
  9943. {\voffset}{\hoffset}%
  9944. {\bindingoffset}{8pt}%
  9945. {210mm}{148mm}%
  9946. %
  9947. \lispnarrowing = 0.2in
  9948. \tolerance = 800
  9949. \hfuzz = 1.2pt
  9950. \contentsrightmargin = 0pt
  9951. \defbodyindent = 2mm
  9952. \tableindent = 12mm
  9953. }}
  9954. % A specific text layout, 24x15cm overall, intended for A4 paper.
  9955. \def\afourlatex{{\globaldefs = 1
  9956. \afourpaper
  9957. \internalpagesizes{237mm}{150mm}%
  9958. {\voffset}{4.6mm}%
  9959. {\bindingoffset}{7mm}%
  9960. {297mm}{210mm}%
  9961. %
  9962. % Must explicitly reset to 0 because we call \afourpaper.
  9963. \globaldefs = 0
  9964. }}
  9965. % Use @afourwide to print on A4 paper in landscape format.
  9966. \def\afourwide{{\globaldefs = 1
  9967. \afourpaper
  9968. \internalpagesizes{241mm}{165mm}%
  9969. {\voffset}{-2.95mm}%
  9970. {\bindingoffset}{7mm}%
  9971. {297mm}{210mm}%
  9972. \globaldefs = 0
  9973. }}
  9974. % @pagesizes TEXTHEIGHT[,TEXTWIDTH]
  9975. % Perhaps we should allow setting the margins, \topskip, \parskip,
  9976. % and/or leading, also. Or perhaps we should compute them somehow.
  9977. %
  9978. \parseargdef\pagesizes{\pagesizesyyy #1,,\finish}
  9979. \def\pagesizesyyy#1,#2,#3\finish{{%
  9980. \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
  9981. \globaldefs = 1
  9982. %
  9983. \parskip = 3pt plus 2pt minus 1pt
  9984. \setleading{\textleading}%
  9985. %
  9986. \dimen0 = #1\relax
  9987. \advance\dimen0 by \voffset
  9988. %
  9989. \dimen2 = \hsize
  9990. \advance\dimen2 by \normaloffset
  9991. %
  9992. \internalpagesizes{#1}{\hsize}%
  9993. {\voffset}{\normaloffset}%
  9994. {\bindingoffset}{44pt}%
  9995. {\dimen0}{\dimen2}%
  9996. }}
  9997. % Set default to letter.
  9998. %
  9999. \letterpaper
  10000. \message{and turning on texinfo input format.}
  10001. \def^^L{\par} % remove \outer, so ^L can appear in an @comment
  10002. % DEL is a comment character, in case @c does not suffice.
  10003. \catcode`\^^? = 14
  10004. % Define macros to output various characters with catcode for normal text.
  10005. \catcode`\"=\other \def\normaldoublequote{"}
  10006. \catcode`\$=\other \def\normaldollar{$}%$ font-lock fix
  10007. \catcode`\+=\other \def\normalplus{+}
  10008. \catcode`\<=\other \def\normalless{<}
  10009. \catcode`\>=\other \def\normalgreater{>}
  10010. \catcode`\^=\other \def\normalcaret{^}
  10011. \catcode`\_=\other \def\normalunderscore{_}
  10012. \catcode`\|=\other \def\normalverticalbar{|}
  10013. \catcode`\~=\other \def\normaltilde{~}
  10014. % This macro is used to make a character print one way in \tt
  10015. % (where it can probably be output as-is), and another way in other fonts,
  10016. % where something hairier probably needs to be done.
  10017. %
  10018. % #1 is what to print if we are indeed using \tt; #2 is what to print
  10019. % otherwise. Since all the Computer Modern typewriter fonts have zero
  10020. % interword stretch (and shrink), and it is reasonable to expect all
  10021. % typewriter fonts to have this, we can check that font parameter.
  10022. %
  10023. \def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
  10024. % Same as above, but check for italic font. Actually this also catches
  10025. % non-italic slanted fonts since it is impossible to distinguish them from
  10026. % italic fonts. But since this is only used by $ and it uses \sl anyway
  10027. % this is not a problem.
  10028. \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
  10029. % Turn off all special characters except @
  10030. % (and those which the user can use as if they were ordinary).
  10031. % Most of these we simply print from the \tt font, but for some, we can
  10032. % use math or other variants that look better in normal text.
  10033. \catcode`\"=\active
  10034. \def\activedoublequote{{\tt\char34}}
  10035. \let"=\activedoublequote
  10036. \catcode`\~=\active \def\activetilde{{\tt\char126}} \let~ = \activetilde
  10037. \chardef\hatchar=`\^
  10038. \catcode`\^=\active \def\activehat{{\tt \hatchar}} \let^ = \activehat
  10039. \catcode`\_=\active
  10040. \def_{\ifusingtt\normalunderscore\_}
  10041. \let\realunder=_
  10042. % Subroutine for the previous macro.
  10043. \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
  10044. \catcode`\|=\active
  10045. \def|{{\tt\char124}}
  10046. \chardef \less=`\<
  10047. \catcode`\<=\active \def\activeless{{\tt \less}}\let< = \activeless
  10048. \chardef \gtr=`\>
  10049. \catcode`\>=\active \def\activegtr{{\tt \gtr}}\let> = \activegtr
  10050. \catcode`\+=\active \def+{{\tt \char 43}}
  10051. \catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
  10052. \catcode`\-=\active \let-=\normaldash
  10053. % used for headline/footline in the output routine, in case the page
  10054. % breaks in the middle of an @tex block.
  10055. \def\texinfochars{%
  10056. \let< = \activeless
  10057. \let> = \activegtr
  10058. \let~ = \activetilde
  10059. \let^ = \activehat
  10060. \markupsetuplqdefault \markupsetuprqdefault
  10061. \let\b = \strong
  10062. \let\i = \smartitalic
  10063. % in principle, all other definitions in \tex have to be undone too.
  10064. }
  10065. % Used sometimes to turn off (effectively) the active characters even after
  10066. % parsing them.
  10067. \def\turnoffactive{%
  10068. \normalturnoffactive
  10069. \otherbackslash
  10070. }
  10071. \catcode`\@=0
  10072. % \backslashcurfont outputs one backslash character in current font,
  10073. % as in \char`\\.
  10074. \global\chardef\backslashcurfont=`\\
  10075. \global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work
  10076. % \realbackslash is an actual character `\' with catcode other, and
  10077. % \doublebackslash is two of them (for the pdf outlines).
  10078. {\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}}
  10079. % In Texinfo, backslash is an active character; it prints the backslash
  10080. % in fixed width font.
  10081. \catcode`\\=\active % @ for escape char from now on.
  10082. % Print a typewriter backslash. For math mode, we can't simply use
  10083. % \backslashcurfont: the story here is that in math mode, the \char
  10084. % of \backslashcurfont ends up printing the roman \ from the math symbol
  10085. % font (because \char in math mode uses the \mathcode, and plain.tex
  10086. % sets \mathcode`\\="026E). Hence we use an explicit \mathchar,
  10087. % which is the decimal equivalent of "715c (class 7, e.g., use \fam;
  10088. % ignored family value; char position "5C). We can't use " for the
  10089. % usual hex value because it has already been made active.
  10090. @def@ttbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}}
  10091. @let@backslashchar = @ttbackslash % @backslashchar{} is for user documents.
  10092. % \rawbackslash defines an active \ to do \backslashcurfont.
  10093. % \otherbackslash defines an active \ to be a literal `\' character with
  10094. % catcode other. We switch back and forth between these.
  10095. @gdef@rawbackslash{@let\=@backslashcurfont}
  10096. @gdef@otherbackslash{@let\=@realbackslash}
  10097. % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
  10098. % the literal character `\'.
  10099. %
  10100. {@catcode`- = @active
  10101. @gdef@normalturnoffactive{%
  10102. @nonasciistringdefs
  10103. @let-=@normaldash
  10104. @let"=@normaldoublequote
  10105. @let$=@normaldollar %$ font-lock fix
  10106. @let+=@normalplus
  10107. @let<=@normalless
  10108. @let>=@normalgreater
  10109. @let^=@normalcaret
  10110. @let_=@normalunderscore
  10111. @let|=@normalverticalbar
  10112. @let~=@normaltilde
  10113. @let\=@ttbackslash
  10114. @markupsetuplqdefault
  10115. @markupsetuprqdefault
  10116. @unsepspaces
  10117. }
  10118. }
  10119. % If a .fmt file is being used, characters that might appear in a file
  10120. % name cannot be active until we have parsed the command line.
  10121. % So turn them off again, and have @fixbackslash turn them back on.
  10122. @catcode`+=@other @catcode`@_=@other
  10123. % \enablebackslashhack - allow file to begin `\input texinfo'
  10124. %
  10125. % If a .fmt file is being used, we don't want the `\input texinfo' to show up.
  10126. % That is what \eatinput is for; after that, the `\' should revert to printing
  10127. % a backslash.
  10128. % If the file did not have a `\input texinfo', then it is turned off after
  10129. % the first line; otherwise the first `\' in the file would cause an error.
  10130. % This is used on the very last line of this file, texinfo.tex.
  10131. % We also use @c to call @fixbackslash, in case ends of lines are hidden.
  10132. {
  10133. @catcode`@^=7
  10134. @catcode`@^^M=13@gdef@enablebackslashhack{%
  10135. @global@let\ = @eatinput%
  10136. @catcode`@^^M=13%
  10137. @def@c{@fixbackslash@c}%
  10138. @def ^^M{@let^^M@secondlinenl}%
  10139. @gdef @secondlinenl{@let^^M@thirdlinenl}%
  10140. @gdef @thirdlinenl{@fixbackslash}%
  10141. }}
  10142. {@catcode`@^=7 @catcode`@^^M=13%
  10143. @gdef@eatinput input texinfo#1^^M{@fixbackslash}}
  10144. @gdef@fixbackslash{%
  10145. @ifx\@eatinput @let\ = @ttbackslash @fi
  10146. @catcode13=5 % regular end of line
  10147. @let@c=@texinfoc
  10148. % Also turn back on active characters that might appear in the input
  10149. % file name, in case not using a pre-dumped format.
  10150. @catcode`+=@active
  10151. @catcode`@_=@active
  10152. %
  10153. % If texinfo.cnf is present on the system, read it.
  10154. % Useful for site-wide @afourpaper, etc. This macro, @fixbackslash, gets
  10155. % called at the beginning of every Texinfo file. Not opening texinfo.cnf
  10156. % directly in this file, texinfo.tex, makes it possible to make a format
  10157. % file for Texinfo.
  10158. %
  10159. @openin 1 texinfo.cnf
  10160. @ifeof 1 @else @input texinfo.cnf @fi
  10161. @closein 1
  10162. }
  10163. % Say @foo, not \foo, in error messages.
  10164. @escapechar = `@@
  10165. % These (along with & and #) are made active for url-breaking, so need
  10166. % active definitions as the normal characters.
  10167. @def@normaldot{.}
  10168. @def@normalquest{?}
  10169. @def@normalslash{/}
  10170. % These look ok in all fonts, so just make them not special.
  10171. % @hashchar{} gets its own user-level command, because of #line.
  10172. @catcode`@& = @other @def@normalamp{&}
  10173. @catcode`@# = @other @def@normalhash{#}
  10174. @catcode`@% = @other @def@normalpercent{%}
  10175. @let @hashchar = @normalhash
  10176. @c Finally, make ` and ' active, so that txicodequoteundirected and
  10177. @c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we
  10178. @c don't make ` and ' active, @code will not get them as active chars.
  10179. @c Do this last of all since we use ` in the previous @catcode assignments.
  10180. @catcode`@'=@active
  10181. @catcode`@`=@active
  10182. @markupsetuplqdefault
  10183. @markupsetuprqdefault
  10184. @c Local variables:
  10185. @c eval: (add-hook 'write-file-hooks 'time-stamp)
  10186. @c page-delimiter: "^\\\\message\\|emacs-page"
  10187. @c time-stamp-start: "def\\\\texinfoversion{"
  10188. @c time-stamp-format: "%:y-%02m-%02d.%02H"
  10189. @c time-stamp-end: "}"
  10190. @c End:
  10191. @c vim:sw=2:
  10192. @ignore
  10193. arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115
  10194. @end ignore
  10195. @enablebackslashhack