texinfo.tex 277 KB

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