texinfo.tex 279 KB

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