texinfo.tex 370 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731
  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{2021-02-20.11}
  7. %
  8. % Copyright 1985, 1986, 1988, 1990-2021 Free Software Foundation, Inc.
  9. %
  10. % This texinfo.tex file is free software: you can redistribute it and/or
  11. % modify it under the terms of the GNU General Public License as
  12. % published by the Free Software Foundation, either version 3 of the
  13. % License, or (at your option) any later version.
  14. %
  15. % This texinfo.tex file is distributed in the hope that it will be
  16. % useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  17. % of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. % General Public License for more details.
  19. %
  20. % You should have received a copy of the GNU General Public License
  21. % along with this program. If not, see <https://www.gnu.org/licenses/>.
  22. %
  23. % As a special exception, when this file is read by TeX when processing
  24. % a Texinfo source document, you may use the result without
  25. % restriction. This Exception is an additional permission under section 7
  26. % of the GNU General Public License, version 3 ("GPLv3").
  27. %
  28. % Please try the latest version of texinfo.tex before submitting bug
  29. % reports; you can get the latest version from:
  30. % https://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or
  31. % https://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or
  32. % https://www.gnu.org/software/texinfo/ (the Texinfo home page)
  33. % The texinfo.tex in any given distribution could well be out
  34. % of date, so if that's what you're using, please check.
  35. %
  36. % Send bug reports to bug-texinfo@gnu.org. Please include a
  37. % complete document in each bug report with which we can reproduce the
  38. % problem. Patches are, of course, greatly appreciated.
  39. %
  40. % To process a Texinfo manual with TeX, it's most reliable to use the
  41. % texi2dvi shell script that comes with the distribution. For a simple
  42. % manual foo.texi, however, you can get away with this:
  43. % tex foo.texi
  44. % texindex foo.??
  45. % tex foo.texi
  46. % tex foo.texi
  47. % dvips foo.dvi -o # or whatever; this makes foo.ps.
  48. % The extra TeX runs get the cross-reference information correct.
  49. % Sometimes one run after texindex suffices, and sometimes you need more
  50. % than two; texi2dvi does it as many times as necessary.
  51. %
  52. % It is possible to adapt texinfo.tex for other languages, to some
  53. % extent. You can get the existing language-specific files from the
  54. % full Texinfo distribution.
  55. %
  56. % The GNU Texinfo home page is https://www.gnu.org/software/texinfo.
  57. \message{Loading texinfo [version \texinfoversion]:}
  58. % If in a .fmt file, print the version number
  59. % and turn on active characters that we couldn't do earlier because
  60. % they might have appeared in the input file name.
  61. \everyjob{\message{[Texinfo version \texinfoversion]}%
  62. \catcode`+=\active \catcode`\_=\active}
  63. % LaTeX's \typeout. This ensures that the messages it is used for
  64. % are identical in format to the corresponding ones from latex/pdflatex.
  65. \def\typeout{\immediate\write17}%
  66. \chardef\other=12
  67. % We never want plain's \outer definition of \+ in Texinfo.
  68. % For @tex, we can use \tabalign.
  69. \let\+ = \relax
  70. % Save some plain tex macros whose names we will redefine.
  71. \let\ptexb=\b
  72. \let\ptexbullet=\bullet
  73. \let\ptexc=\c
  74. \let\ptexcomma=\,
  75. \let\ptexdot=\.
  76. \let\ptexdots=\dots
  77. \let\ptexend=\end
  78. \let\ptexequiv=\equiv
  79. \let\ptexexclam=\!
  80. \let\ptexfootnote=\footnote
  81. \let\ptexgtr=>
  82. \let\ptexhat=^
  83. \let\ptexi=\i
  84. \let\ptexindent=\indent
  85. \let\ptexinsert=\insert
  86. \let\ptexlbrace=\{
  87. \let\ptexless=<
  88. \let\ptexnewwrite\newwrite
  89. \let\ptexnoindent=\noindent
  90. \let\ptexplus=+
  91. \let\ptexraggedright=\raggedright
  92. \let\ptexrbrace=\}
  93. \let\ptexslash=\/
  94. \let\ptexsp=\sp
  95. \let\ptexstar=\*
  96. \let\ptexsup=\sup
  97. \let\ptext=\t
  98. \let\ptextop=\top
  99. {\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode
  100. % If this character appears in an error message or help string, it
  101. % starts a new line in the output.
  102. \newlinechar = `^^J
  103. % Use TeX 3.0's \inputlineno to get the line number, for better error
  104. % messages, but if we're using an old version of TeX, don't do anything.
  105. %
  106. \ifx\inputlineno\thisisundefined
  107. \let\linenumber = \empty % Pre-3.0.
  108. \else
  109. \def\linenumber{l.\the\inputlineno:\space}
  110. \fi
  111. % Set up fixed words for English if not already set.
  112. \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
  113. \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
  114. \ifx\putworderror\undefined \gdef\putworderror{error}\fi
  115. \ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
  116. \ifx\putwordin\undefined \gdef\putwordin{in}\fi
  117. \ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
  118. \ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
  119. \ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
  120. \ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
  121. \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
  122. \ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi
  123. \ifx\putwordof\undefined \gdef\putwordof{of}\fi
  124. \ifx\putwordon\undefined \gdef\putwordon{on}\fi
  125. \ifx\putwordpage\undefined \gdef\putwordpage{page}\fi
  126. \ifx\putwordsection\undefined \gdef\putwordsection{section}\fi
  127. \ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi
  128. \ifx\putwordsee\undefined \gdef\putwordsee{see}\fi
  129. \ifx\putwordSee\undefined \gdef\putwordSee{See}\fi
  130. \ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi
  131. \ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi
  132. %
  133. \ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
  134. \ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
  135. \ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
  136. \ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
  137. \ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
  138. \ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
  139. \ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
  140. \ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
  141. \ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
  142. \ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
  143. \ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
  144. \ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
  145. %
  146. \ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi
  147. \ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi
  148. \ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi
  149. \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
  150. \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
  151. % Give the space character the catcode for a space.
  152. \def\spaceisspace{\catcode`\ =10\relax}
  153. % Likewise for ^^M, the end of line character.
  154. \def\endlineisspace{\catcode13=10\relax}
  155. \chardef\dashChar = `\-
  156. \chardef\slashChar = `\/
  157. \chardef\underChar = `\_
  158. % Ignore a token.
  159. %
  160. \def\gobble#1{}
  161. % The following is used inside several \edef's.
  162. \def\makecsname#1{\expandafter\noexpand\csname#1\endcsname}
  163. % Hyphenation fixes.
  164. \hyphenation{
  165. Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script
  166. ap-pen-dix bit-map bit-maps
  167. data-base data-bases eshell fall-ing half-way long-est man-u-script
  168. man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm
  169. par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces
  170. spell-ing spell-ings
  171. stand-alone strong-est time-stamp time-stamps which-ever white-space
  172. wide-spread wrap-around
  173. }
  174. % Sometimes it is convenient to have everything in the transcript file
  175. % and nothing on the terminal. We don't just call \tracingall here,
  176. % since that produces some useless output on the terminal. We also make
  177. % some effort to order the tracing commands to reduce output in the log
  178. % file; cf. trace.sty in LaTeX.
  179. %
  180. \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
  181. \def\loggingall{%
  182. \tracingstats2
  183. \tracingpages1
  184. \tracinglostchars2 % 2 gives us more in etex
  185. \tracingparagraphs1
  186. \tracingoutput1
  187. \tracingmacros2
  188. \tracingrestores1
  189. \showboxbreadth\maxdimen \showboxdepth\maxdimen
  190. \ifx\eTeXversion\thisisundefined\else % etex gives us more logging
  191. \tracingscantokens1
  192. \tracingifs1
  193. \tracinggroups1
  194. \tracingnesting2
  195. \tracingassigns1
  196. \fi
  197. \tracingcommands3 % 3 gives us more in etex
  198. \errorcontextlines16
  199. }%
  200. % @errormsg{MSG}. Do the index-like expansions on MSG, but if things
  201. % aren't perfect, it's not the end of the world, being an error message,
  202. % after all.
  203. %
  204. \def\errormsg{\begingroup \indexnofonts \doerrormsg}
  205. \def\doerrormsg#1{\errmessage{#1}}
  206. % add check for \lastpenalty to plain's definitions. If the last thing
  207. % we did was a \nobreak, we don't want to insert more space.
  208. %
  209. \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
  210. \removelastskip\penalty-50\smallskip\fi\fi}
  211. \def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
  212. \removelastskip\penalty-100\medskip\fi\fi}
  213. \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
  214. \removelastskip\penalty-200\bigskip\fi\fi}
  215. % Output routine
  216. %
  217. % For a final copy, take out the rectangles
  218. % that mark overfull boxes (in case you have decided
  219. % that the text looks ok even though it passes the margin).
  220. %
  221. \def\finalout{\overfullrule=0pt }
  222. \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
  223. \newdimen\topandbottommargin \topandbottommargin=.75in
  224. % Output a mark which sets \thischapter, \thissection and \thiscolor.
  225. % We dump everything together because we only have one kind of mark.
  226. % This works because we only use \botmark / \topmark, not \firstmark.
  227. %
  228. % A mark contains a subexpression of the \ifcase ... \fi construct.
  229. % \get*marks macros below extract the needed part using \ifcase.
  230. %
  231. % Another complication is to let the user choose whether \thischapter
  232. % (\thissection) refers to the chapter (section) in effect at the top
  233. % of a page, or that at the bottom of a page.
  234. % \domark is called twice inside \chapmacro, to add one
  235. % mark before the section break, and one after.
  236. % In the second call \prevchapterdefs is the same as \currentchapterdefs,
  237. % and \prevsectiondefs is the same as \currentsectiondefs.
  238. % Then if the page is not broken at the mark, some of the previous
  239. % section appears on the page, and we can get the name of this section
  240. % from \firstmark for @everyheadingmarks top.
  241. % @everyheadingmarks bottom uses \botmark.
  242. %
  243. % See page 260 of The TeXbook.
  244. \def\domark{%
  245. \toks0=\expandafter{\currentchapterdefs}%
  246. \toks2=\expandafter{\currentsectiondefs}%
  247. \toks4=\expandafter{\prevchapterdefs}%
  248. \toks6=\expandafter{\prevsectiondefs}%
  249. \toks8=\expandafter{\currentcolordefs}%
  250. \mark{%
  251. \the\toks0 \the\toks2 % 0: marks for @everyheadingmarks top
  252. \noexpand\or \the\toks4 \the\toks6 % 1: for @everyheadingmarks bottom
  253. \noexpand\else \the\toks8 % 2: color marks
  254. }%
  255. }
  256. % \gettopheadingmarks, \getbottomheadingmarks,
  257. % \getcolormarks - extract needed part of mark.
  258. %
  259. % \topmark doesn't work for the very first chapter (after the title
  260. % page or the contents), so we use \firstmark there -- this gets us
  261. % the mark with the chapter defs, unless the user sneaks in, e.g.,
  262. % @setcolor (or @url, or @link, etc.) between @contents and the very
  263. % first @chapter.
  264. \def\gettopheadingmarks{%
  265. \ifcase0\the\savedtopmark\fi
  266. \ifx\thischapter\empty \ifcase0\firstmark\fi \fi
  267. }
  268. \def\getbottomheadingmarks{\ifcase1\botmark\fi}
  269. \def\getcolormarks{\ifcase2\the\savedtopmark\fi}
  270. % Avoid "undefined control sequence" errors.
  271. \def\currentchapterdefs{}
  272. \def\currentsectiondefs{}
  273. \def\currentsection{}
  274. \def\prevchapterdefs{}
  275. \def\prevsectiondefs{}
  276. \def\currentcolordefs{}
  277. % Margin to add to right of even pages, to left of odd pages.
  278. \newdimen\bindingoffset
  279. \newdimen\normaloffset
  280. \newdimen\txipagewidth \newdimen\txipageheight
  281. % Main output routine.
  282. %
  283. \chardef\PAGE = 255
  284. \newtoks\defaultoutput
  285. \defaultoutput = {\savetopmark\onepageout{\pagecontents\PAGE}}
  286. \output=\expandafter{\the\defaultoutput}
  287. \newbox\headlinebox
  288. \newbox\footlinebox
  289. % When outputting the double column layout for indices, an output routine
  290. % is run several times, which hides the original value of \topmark. This
  291. % can lead to a page heading being output and duplicating the chapter heading
  292. % of the index. Hence, save the contents of \topmark at the beginning of
  293. % the output routine. The saved contents are valid until we actually
  294. % \shipout a page.
  295. %
  296. % (We used to run a short output routine to actually set \topmark and
  297. % \firstmark to the right values, but if this was called with an empty page
  298. % containing whatsits for writing index entries, the whatsits would be thrown
  299. % away and the index auxiliary file would remain empty.)
  300. %
  301. \newtoks\savedtopmark
  302. \newif\iftopmarksaved
  303. \topmarksavedtrue
  304. \def\savetopmark{%
  305. \iftopmarksaved\else
  306. \global\savedtopmark=\expandafter{\topmark}%
  307. \global\topmarksavedtrue
  308. \fi
  309. }
  310. % \onepageout takes a vbox as an argument.
  311. % \shipout a vbox for a single page, adding an optional header, footer
  312. % and footnote. This also causes index entries for this page to be written
  313. % to the auxiliary files.
  314. %
  315. \def\onepageout#1{%
  316. \hoffset=\normaloffset
  317. %
  318. \ifodd\pageno \advance\hoffset by \bindingoffset
  319. \else \advance\hoffset by -\bindingoffset\fi
  320. %
  321. \checkchapterpage
  322. %
  323. % Retrieve the information for the headings from the marks in the page,
  324. % and call Plain TeX's \makeheadline and \makefootline, which use the
  325. % values in \headline and \footline.
  326. %
  327. % Common context changes for both heading and footing.
  328. % Do this outside of the \shipout so @code etc. will be expanded in
  329. % the headline as they should be, not taken literally (outputting ''code).
  330. \def\commonheadfootline{\let\hsize=\txipagewidth \texinfochars}
  331. %
  332. \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
  333. \global\setbox\headlinebox = \vbox{\commonheadfootline \makeheadline}%
  334. \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
  335. \global\setbox\footlinebox = \vbox{\commonheadfootline \makefootline}%
  336. %
  337. {%
  338. % Set context for writing to auxiliary files like index files.
  339. % Have to do this stuff outside the \shipout because we want it to
  340. % take effect in \write's, yet the group defined by the \vbox ends
  341. % before the \shipout runs.
  342. %
  343. \atdummies % don't expand commands in the output.
  344. \turnoffactive
  345. \shipout\vbox{%
  346. % Do this early so pdf references go to the beginning of the page.
  347. \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
  348. %
  349. \unvbox\headlinebox
  350. \pagebody{#1}%
  351. \ifdim\ht\footlinebox > 0pt
  352. % Only leave this space if the footline is nonempty.
  353. % (We lessened \vsize for it in \oddfootingyyy.)
  354. % The \baselineskip=24pt in plain's \makefootline has no effect.
  355. \vskip 24pt
  356. \unvbox\footlinebox
  357. \fi
  358. %
  359. }%
  360. }%
  361. \global\topmarksavedfalse
  362. \advancepageno
  363. \ifnum\outputpenalty>-20000 \else\dosupereject\fi
  364. }
  365. \newinsert\margin \dimen\margin=\maxdimen
  366. % Main part of page, including any footnotes
  367. \def\pagebody#1{\vbox to\txipageheight{\boxmaxdepth=\maxdepth #1}}
  368. {\catcode`\@ =11
  369. \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
  370. % marginal hacks, juha@viisa.uucp (Juha Takala)
  371. \ifvoid\margin\else % marginal info is present
  372. \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
  373. \dimen@=\dp#1\relax \unvbox#1\relax
  374. \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
  375. \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
  376. }
  377. % Check if we are on the first page of a chapter. Used for printing headings.
  378. \newif\ifchapterpage
  379. \def\checkchapterpage{%
  380. % Get the chapter that was current at the end of the last page
  381. \ifcase1\the\savedtopmark\fi
  382. \let\prevchaptername\thischaptername
  383. %
  384. \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
  385. \let\curchaptername\thischaptername
  386. %
  387. \ifx\curchaptername\prevchaptername
  388. \chapterpagefalse
  389. \else
  390. \chapterpagetrue
  391. \fi
  392. }
  393. % Argument parsing
  394. % Parse an argument, then pass it to #1. The argument is the rest of
  395. % the input line (except we remove a trailing comment). #1 should be a
  396. % macro which expects an ordinary undelimited TeX argument.
  397. % For example, \def\foo{\parsearg\fooxxx}.
  398. %
  399. \def\parsearg{\parseargusing{}}
  400. \def\parseargusing#1#2{%
  401. \def\argtorun{#2}%
  402. \begingroup
  403. \obeylines
  404. \spaceisspace
  405. #1%
  406. \parseargline\empty% Insert the \empty token, see \finishparsearg below.
  407. }
  408. {\obeylines %
  409. \gdef\parseargline#1^^M{%
  410. \endgroup % End of the group started in \parsearg.
  411. \argremovecomment #1\comment\ArgTerm%
  412. }%
  413. }
  414. % First remove any @comment, then any @c comment. Pass the result on to
  415. % \argcheckspaces.
  416. \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
  417. \def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
  418. % Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space.
  419. %
  420. % \argremovec might leave us with trailing space, e.g.,
  421. % @end itemize @c foo
  422. % This space token undergoes the same procedure and is eventually removed
  423. % by \finishparsearg.
  424. %
  425. \def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M}
  426. \def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M}
  427. \def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
  428. \def\temp{#3}%
  429. \ifx\temp\empty
  430. % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp:
  431. \let\temp\finishparsearg
  432. \else
  433. \let\temp\argcheckspaces
  434. \fi
  435. % Put the space token in:
  436. \temp#1 #3\ArgTerm
  437. }
  438. % If a _delimited_ argument is enclosed in braces, they get stripped; so
  439. % to get _exactly_ the rest of the line, we had to prevent such situation.
  440. % We prepended an \empty token at the very beginning and we expand it now,
  441. % just before passing the control to \argtorun.
  442. % (Similarly, we have to think about #3 of \argcheckspacesY above: it is
  443. % either the null string, or it ends with \^^M---thus there is no danger
  444. % that a pair of braces would be stripped.
  445. %
  446. % But first, we have to remove the trailing space token.
  447. %
  448. \def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}}
  449. % \parseargdef - define a command taking an argument on the line
  450. %
  451. % \parseargdef\foo{...}
  452. % is roughly equivalent to
  453. % \def\foo{\parsearg\Xfoo}
  454. % \def\Xfoo#1{...}
  455. \def\parseargdef#1{%
  456. \expandafter \doparseargdef \csname\string#1\endcsname #1%
  457. }
  458. \def\doparseargdef#1#2{%
  459. \def#2{\parsearg#1}%
  460. \def#1##1%
  461. }
  462. % Several utility definitions with active space:
  463. {
  464. \obeyspaces
  465. \gdef\obeyedspace{ }
  466. % Make each space character in the input produce a normal interword
  467. % space in the output. Don't allow a line break at this space, as this
  468. % is used only in environments like @example, where each line of input
  469. % should produce a line of output anyway.
  470. %
  471. \gdef\sepspaces{\obeyspaces\let =\tie}
  472. % If an index command is used in an @example environment, any spaces
  473. % therein should become regular spaces in the raw index file, not the
  474. % expansion of \tie (\leavevmode \penalty \@M \ ).
  475. \gdef\unsepspaces{\let =\space}
  476. }
  477. \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
  478. % Define the framework for environments in texinfo.tex. It's used like this:
  479. %
  480. % \envdef\foo{...}
  481. % \def\Efoo{...}
  482. %
  483. % It's the responsibility of \envdef to insert \begingroup before the
  484. % actual body; @end closes the group after calling \Efoo. \envdef also
  485. % defines \thisenv, so the current environment is known; @end checks
  486. % whether the environment name matches. The \checkenv macro can also be
  487. % used to check whether the current environment is the one expected.
  488. %
  489. % Non-false conditionals (@iftex, @ifset) don't fit into this, so they
  490. % are not treated as environments; they don't open a group. (The
  491. % implementation of @end takes care not to call \endgroup in this
  492. % special case.)
  493. % At run-time, environments start with this:
  494. \def\startenvironment#1{\begingroup\def\thisenv{#1}}
  495. % initialize
  496. \let\thisenv\empty
  497. % ... but they get defined via ``\envdef\foo{...}'':
  498. \long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
  499. \def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
  500. % Check whether we're in the right environment:
  501. \def\checkenv#1{%
  502. \def\temp{#1}%
  503. \ifx\thisenv\temp
  504. \else
  505. \badenverr
  506. \fi
  507. }
  508. % Environment mismatch, #1 expected:
  509. \def\badenverr{%
  510. \errhelp = \EMsimple
  511. \errmessage{This command can appear only \inenvironment\temp,
  512. not \inenvironment\thisenv}%
  513. }
  514. \def\inenvironment#1{%
  515. \ifx#1\empty
  516. outside of any environment%
  517. \else
  518. in environment \expandafter\string#1%
  519. \fi
  520. }
  521. % @end foo calls \checkenv and executes the definition of \Efoo.
  522. \parseargdef\end{
  523. \if 1\csname iscond.#1\endcsname
  524. \else
  525. % The general wording of \badenverr may not be ideal.
  526. \expandafter\checkenv\csname#1\endcsname
  527. \csname E#1\endcsname
  528. \endgroup
  529. \fi
  530. }
  531. \newhelp\EMsimple{Press RETURN to continue.}
  532. % Be sure we're in horizontal mode when doing a tie, since we make space
  533. % equivalent to this in @example-like environments. Otherwise, a space
  534. % at the beginning of a line will start with \penalty -- and
  535. % since \penalty is valid in vertical mode, we'd end up putting the
  536. % penalty on the vertical list instead of in the new paragraph.
  537. {\catcode`@ = 11
  538. % Avoid using \@M directly, because that causes trouble
  539. % if the definition is written into an index file.
  540. \global\let\tiepenalty = \@M
  541. \gdef\tie{\leavevmode\penalty\tiepenalty\ }
  542. }
  543. % @: forces normal size whitespace following.
  544. \def\:{\spacefactor=1000 }
  545. % @* forces a line break.
  546. \def\*{\unskip\hfil\break\hbox{}\ignorespaces}
  547. % @/ allows a line break.
  548. \let\/=\allowbreak
  549. % @. is an end-of-sentence period.
  550. \def\.{.\spacefactor=\endofsentencespacefactor\space}
  551. % @! is an end-of-sentence bang.
  552. \def\!{!\spacefactor=\endofsentencespacefactor\space}
  553. % @? is an end-of-sentence query.
  554. \def\?{?\spacefactor=\endofsentencespacefactor\space}
  555. % @frenchspacing on|off says whether to put extra space after punctuation.
  556. %
  557. \def\onword{on}
  558. \def\offword{off}
  559. %
  560. \parseargdef\frenchspacing{%
  561. \def\temp{#1}%
  562. \ifx\temp\onword \plainfrenchspacing
  563. \else\ifx\temp\offword \plainnonfrenchspacing
  564. \else
  565. \errhelp = \EMsimple
  566. \errmessage{Unknown @frenchspacing option `\temp', must be on|off}%
  567. \fi\fi
  568. }
  569. % @w prevents a word break. Without the \leavevmode, @w at the
  570. % beginning of a paragraph, when TeX is still in vertical mode, would
  571. % produce a whole line of output instead of starting the paragraph.
  572. \def\w#1{\leavevmode\hbox{#1}}
  573. % @group ... @end group forces ... to be all on one page, by enclosing
  574. % it in a TeX vbox. We use \vtop instead of \vbox to construct the box
  575. % to keep its height that of a normal line. According to the rules for
  576. % \topskip (p.114 of the TeXbook), the glue inserted is
  577. % max (\topskip - \ht (first item), 0). If that height is large,
  578. % therefore, no glue is inserted, and the space between the headline and
  579. % the text is small, which looks bad.
  580. %
  581. % Another complication is that the group might be very large. This can
  582. % cause the glue on the previous page to be unduly stretched, because it
  583. % does not have much material. In this case, it's better to add an
  584. % explicit \vfill so that the extra space is at the bottom. The
  585. % threshold for doing this is if the group is more than \vfilllimit
  586. % percent of a page (\vfilllimit can be changed inside of @tex).
  587. %
  588. \newbox\groupbox
  589. \def\vfilllimit{0.7}
  590. %
  591. \envdef\group{%
  592. \ifnum\catcode`\^^M=\active \else
  593. \errhelp = \groupinvalidhelp
  594. \errmessage{@group invalid in context where filling is enabled}%
  595. \fi
  596. \startsavinginserts
  597. %
  598. \setbox\groupbox = \vtop\bgroup
  599. % Do @comment since we are called inside an environment such as
  600. % @example, where each end-of-line in the input causes an
  601. % end-of-line in the output. We don't want the end-of-line after
  602. % the `@group' to put extra space in the output. Since @group
  603. % should appear on a line by itself (according to the Texinfo
  604. % manual), we don't worry about eating any user text.
  605. \comment
  606. }
  607. %
  608. % The \vtop produces a box with normal height and large depth; thus, TeX puts
  609. % \baselineskip glue before it, and (when the next line of text is done)
  610. % \lineskip glue after it. Thus, space below is not quite equal to space
  611. % above. But it's pretty close.
  612. \def\Egroup{%
  613. % To get correct interline space between the last line of the group
  614. % and the first line afterwards, we have to propagate \prevdepth.
  615. \endgraf % Not \par, as it may have been set to \lisppar.
  616. \global\dimen1 = \prevdepth
  617. \egroup % End the \vtop.
  618. \addgroupbox
  619. \prevdepth = \dimen1
  620. \checkinserts
  621. }
  622. \def\addgroupbox{
  623. % \dimen0 is the vertical size of the group's box.
  624. \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox
  625. % \dimen2 is how much space is left on the page (more or less).
  626. \dimen2 = \txipageheight \advance\dimen2 by -\pagetotal
  627. % if the group doesn't fit on the current page, and it's a big big
  628. % group, force a page break.
  629. \ifdim \dimen0 > \dimen2
  630. \ifdim \pagetotal < \vfilllimit\txipageheight
  631. \page
  632. \fi
  633. \fi
  634. \box\groupbox
  635. }
  636. %
  637. % TeX puts in an \escapechar (i.e., `@') at the beginning of the help
  638. % message, so this ends up printing `@group can only ...'.
  639. %
  640. \newhelp\groupinvalidhelp{%
  641. group can only be used in environments such as @example,^^J%
  642. where each line of input produces a line of output.}
  643. % @need space-in-mils
  644. % forces a page break if there is not space-in-mils remaining.
  645. \newdimen\mil \mil=0.001in
  646. \parseargdef\need{%
  647. % Ensure vertical mode, so we don't make a big box in the middle of a
  648. % paragraph.
  649. \par
  650. %
  651. % If the @need value is less than one line space, it's useless.
  652. \dimen0 = #1\mil
  653. \dimen2 = \ht\strutbox
  654. \advance\dimen2 by \dp\strutbox
  655. \ifdim\dimen0 > \dimen2
  656. %
  657. % Do a \strut just to make the height of this box be normal, so the
  658. % normal leading is inserted relative to the preceding line.
  659. % And a page break here is fine.
  660. \vtop to #1\mil{\strut\vfil}%
  661. %
  662. % TeX does not even consider page breaks if a penalty added to the
  663. % main vertical list is 10000 or more. But in order to see if the
  664. % empty box we just added fits on the page, we must make it consider
  665. % page breaks. On the other hand, we don't want to actually break the
  666. % page after the empty box. So we use a penalty of 9999.
  667. %
  668. % There is an extremely small chance that TeX will actually break the
  669. % page at this \penalty, if there are no other feasible breakpoints in
  670. % sight. (If the user is using lots of big @group commands, which
  671. % almost-but-not-quite fill up a page, TeX will have a hard time doing
  672. % good page breaking, for example.) However, I could not construct an
  673. % example where a page broke at this \penalty; if it happens in a real
  674. % document, then we can reconsider our strategy.
  675. \penalty9999
  676. %
  677. % Back up by the size of the box, whether we did a page break or not.
  678. \kern -#1\mil
  679. %
  680. % Do not allow a page break right after this kern.
  681. \nobreak
  682. \fi
  683. }
  684. % @br forces paragraph break (and is undocumented).
  685. \let\br = \par
  686. % @page forces the start of a new page.
  687. %
  688. \def\page{\par\vfill\supereject}
  689. % @exdent text....
  690. % outputs text on separate line in roman font, starting at standard page margin
  691. % This records the amount of indent in the innermost environment.
  692. % That's how much \exdent should take out.
  693. \newskip\exdentamount
  694. % This defn is used inside fill environments such as @defun.
  695. \parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
  696. % This defn is used inside nofill environments such as @example.
  697. \parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount
  698. \leftline{\hskip\leftskip{\rm#1}}}}
  699. % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
  700. % paragraph. For more general purposes, use the \margin insertion
  701. % class. WHICH is `l' or `r'. Not documented, written for gawk manual.
  702. %
  703. \newskip\inmarginspacing \inmarginspacing=1cm
  704. \def\strutdepth{\dp\strutbox}
  705. %
  706. \def\doinmargin#1#2{\strut\vadjust{%
  707. \nobreak
  708. \kern-\strutdepth
  709. \vtop to \strutdepth{%
  710. \baselineskip=\strutdepth
  711. \vss
  712. % if you have multiple lines of stuff to put here, you'll need to
  713. % make the vbox yourself of the appropriate size.
  714. \ifx#1l%
  715. \llap{\ignorespaces #2\hskip\inmarginspacing}%
  716. \else
  717. \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
  718. \fi
  719. \null
  720. }%
  721. }}
  722. \def\inleftmargin{\doinmargin l}
  723. \def\inrightmargin{\doinmargin r}
  724. %
  725. % @inmargin{TEXT [, RIGHT-TEXT]}
  726. % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
  727. % else use TEXT for both).
  728. %
  729. \def\inmargin#1{\parseinmargin #1,,\finish}
  730. \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
  731. \setbox0 = \hbox{\ignorespaces #2}%
  732. \ifdim\wd0 > 0pt
  733. \def\lefttext{#1}% have both texts
  734. \def\righttext{#2}%
  735. \else
  736. \def\lefttext{#1}% have only one text
  737. \def\righttext{#1}%
  738. \fi
  739. %
  740. \ifodd\pageno
  741. \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
  742. \else
  743. \def\temp{\inleftmargin\lefttext}%
  744. \fi
  745. \temp
  746. }
  747. % @include FILE -- \input text of FILE.
  748. %
  749. \def\include{\parseargusing\filenamecatcodes\includezzz}
  750. \def\includezzz#1{%
  751. \pushthisfilestack
  752. \def\thisfile{#1}%
  753. {%
  754. \makevalueexpandable % we want to expand any @value in FILE.
  755. \turnoffactive % and allow special characters in the expansion
  756. \indexnofonts % Allow `@@' and other weird things in file names.
  757. \wlog{texinfo.tex: doing @include of #1^^J}%
  758. \edef\temp{\noexpand\input #1 }%
  759. %
  760. % This trickery is to read FILE outside of a group, in case it makes
  761. % definitions, etc.
  762. \expandafter
  763. }\temp
  764. \popthisfilestack
  765. }
  766. \def\filenamecatcodes{%
  767. \catcode`\\=\other
  768. \catcode`~=\other
  769. \catcode`^=\other
  770. \catcode`_=\other
  771. \catcode`|=\other
  772. \catcode`<=\other
  773. \catcode`>=\other
  774. \catcode`+=\other
  775. \catcode`-=\other
  776. \catcode`\`=\other
  777. \catcode`\'=\other
  778. }
  779. \def\pushthisfilestack{%
  780. \expandafter\pushthisfilestackX\popthisfilestack\StackTerm
  781. }
  782. \def\pushthisfilestackX{%
  783. \expandafter\pushthisfilestackY\thisfile\StackTerm
  784. }
  785. \def\pushthisfilestackY #1\StackTerm #2\StackTerm {%
  786. \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}%
  787. }
  788. \def\popthisfilestack{\errthisfilestackempty}
  789. \def\errthisfilestackempty{\errmessage{Internal error:
  790. the stack of filenames is empty.}}
  791. %
  792. \def\thisfile{}
  793. % @center line
  794. % outputs that line, centered.
  795. %
  796. \parseargdef\center{%
  797. \ifhmode
  798. \let\centersub\centerH
  799. \else
  800. \let\centersub\centerV
  801. \fi
  802. \centersub{\hfil \ignorespaces#1\unskip \hfil}%
  803. \let\centersub\relax % don't let the definition persist, just in case
  804. }
  805. \def\centerH#1{{%
  806. \hfil\break
  807. \advance\hsize by -\leftskip
  808. \advance\hsize by -\rightskip
  809. \line{#1}%
  810. \break
  811. }}
  812. %
  813. \newcount\centerpenalty
  814. \def\centerV#1{%
  815. % The idea here is the same as in \startdefun, \cartouche, etc.: if
  816. % @center is the first thing after a section heading, we need to wipe
  817. % out the negative parskip inserted by \sectionheading, but still
  818. % prevent a page break here.
  819. \centerpenalty = \lastpenalty
  820. \ifnum\centerpenalty>10000 \vskip\parskip \fi
  821. \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi
  822. \line{\kern\leftskip #1\kern\rightskip}%
  823. }
  824. % @sp n outputs n lines of vertical space
  825. %
  826. \parseargdef\sp{\vskip #1\baselineskip}
  827. % @comment ...line which is ignored...
  828. % @c is the same as @comment
  829. % @ignore ... @end ignore is another way to write a comment
  830. \def\c{\begingroup \catcode`\^^M=\active%
  831. \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
  832. \cxxx}
  833. {\catcode`\^^M=\active \gdef\cxxx#1^^M{\endgroup}}
  834. %
  835. \let\comment\c
  836. % @paragraphindent NCHARS
  837. % We'll use ems for NCHARS, close enough.
  838. % NCHARS can also be the word `asis' or `none'.
  839. % We cannot feasibly implement @paragraphindent asis, though.
  840. %
  841. \def\asisword{asis} % no translation, these are keywords
  842. \def\noneword{none}
  843. %
  844. \parseargdef\paragraphindent{%
  845. \def\temp{#1}%
  846. \ifx\temp\asisword
  847. \else
  848. \ifx\temp\noneword
  849. \defaultparindent = 0pt
  850. \else
  851. \defaultparindent = #1em
  852. \fi
  853. \fi
  854. \parindent = \defaultparindent
  855. }
  856. % @exampleindent NCHARS
  857. % We'll use ems for NCHARS like @paragraphindent.
  858. % It seems @exampleindent asis isn't necessary, but
  859. % I preserve it to make it similar to @paragraphindent.
  860. \parseargdef\exampleindent{%
  861. \def\temp{#1}%
  862. \ifx\temp\asisword
  863. \else
  864. \ifx\temp\noneword
  865. \lispnarrowing = 0pt
  866. \else
  867. \lispnarrowing = #1em
  868. \fi
  869. \fi
  870. }
  871. % @firstparagraphindent WORD
  872. % If WORD is `none', then suppress indentation of the first paragraph
  873. % after a section heading. If WORD is `insert', then do indent at such
  874. % paragraphs.
  875. %
  876. % The paragraph indentation is suppressed or not by calling
  877. % \suppressfirstparagraphindent, which the sectioning commands do.
  878. % We switch the definition of this back and forth according to WORD.
  879. % By default, we suppress indentation.
  880. %
  881. \def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
  882. \def\insertword{insert}
  883. %
  884. \parseargdef\firstparagraphindent{%
  885. \def\temp{#1}%
  886. \ifx\temp\noneword
  887. \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
  888. \else\ifx\temp\insertword
  889. \let\suppressfirstparagraphindent = \relax
  890. \else
  891. \errhelp = \EMsimple
  892. \errmessage{Unknown @firstparagraphindent option `\temp'}%
  893. \fi\fi
  894. }
  895. % Here is how we actually suppress indentation. Redefine \everypar to
  896. % \kern backwards by \parindent, and then reset itself to empty.
  897. %
  898. % We also make \indent itself not actually do anything until the next
  899. % paragraph.
  900. %
  901. \gdef\dosuppressfirstparagraphindent{%
  902. \gdef\indent {\restorefirstparagraphindent \indent}%
  903. \gdef\noindent{\restorefirstparagraphindent \noindent}%
  904. \global\everypar = {\kern -\parindent \restorefirstparagraphindent}%
  905. }
  906. %
  907. \gdef\restorefirstparagraphindent{%
  908. \global\let\indent = \ptexindent
  909. \global\let\noindent = \ptexnoindent
  910. \global\everypar = {}%
  911. }
  912. % @refill is a no-op.
  913. \let\refill=\relax
  914. % @setfilename INFO-FILENAME - ignored
  915. \let\setfilename=\comment
  916. % @bye.
  917. \outer\def\bye{\chappager\pagelabels\tracingstats=1\ptexend}
  918. \message{pdf,}
  919. % adobe `portable' document format
  920. \newcount\tempnum
  921. \newcount\lnkcount
  922. \newtoks\filename
  923. \newcount\filenamelength
  924. \newcount\pgn
  925. \newtoks\toksA
  926. \newtoks\toksB
  927. \newtoks\toksC
  928. \newtoks\toksD
  929. \newbox\boxA
  930. \newbox\boxB
  931. \newcount\countA
  932. \newif\ifpdf
  933. \newif\ifpdfmakepagedest
  934. %
  935. % For LuaTeX
  936. %
  937. \newif\iftxiuseunicodedestname
  938. \txiuseunicodedestnamefalse % For pdfTeX etc.
  939. \ifx\luatexversion\thisisundefined
  940. \else
  941. % Use Unicode destination names
  942. \txiuseunicodedestnametrue
  943. % Escape PDF strings with converting UTF-16 from UTF-8
  944. \begingroup
  945. \catcode`\%=12
  946. \directlua{
  947. function UTF16oct(str)
  948. tex.sprint(string.char(0x5c) .. '376' .. string.char(0x5c) .. '377')
  949. for c in string.utfvalues(str) do
  950. if c < 0x10000 then
  951. tex.sprint(
  952. string.format(string.char(0x5c) .. string.char(0x25) .. '03o' ..
  953. string.char(0x5c) .. string.char(0x25) .. '03o',
  954. math.floor(c / 256), math.floor(c % 256)))
  955. else
  956. c = c - 0x10000
  957. local c_hi = c / 1024 + 0xd800
  958. local c_lo = c % 1024 + 0xdc00
  959. tex.sprint(
  960. string.format(string.char(0x5c) .. string.char(0x25) .. '03o' ..
  961. string.char(0x5c) .. string.char(0x25) .. '03o' ..
  962. string.char(0x5c) .. string.char(0x25) .. '03o' ..
  963. string.char(0x5c) .. string.char(0x25) .. '03o',
  964. math.floor(c_hi / 256), math.floor(c_hi % 256),
  965. math.floor(c_lo / 256), math.floor(c_lo % 256)))
  966. end
  967. end
  968. end
  969. }
  970. \endgroup
  971. \def\pdfescapestrutfsixteen#1{\directlua{UTF16oct('\luaescapestring{#1}')}}
  972. % Escape PDF strings without converting
  973. \begingroup
  974. \directlua{
  975. function PDFescstr(str)
  976. for c in string.bytes(str) do
  977. if c <= 0x20 or c >= 0x80 or c == 0x28 or c == 0x29 or c == 0x5c then
  978. tex.sprint(-2,
  979. string.format(string.char(0x5c) .. string.char(0x25) .. '03o',
  980. c))
  981. else
  982. tex.sprint(-2, string.char(c))
  983. end
  984. end
  985. end
  986. }
  987. % The -2 in the arguments here gives all the input to TeX catcode 12
  988. % (other) or 10 (space), preventing undefined control sequence errors. See
  989. % https://lists.gnu.org/archive/html/bug-texinfo/2019-08/msg00031.html
  990. %
  991. \endgroup
  992. \def\pdfescapestring#1{\directlua{PDFescstr('\luaescapestring{#1}')}}
  993. \ifnum\luatexversion>84
  994. % For LuaTeX >= 0.85
  995. \def\pdfdest{\pdfextension dest}
  996. \let\pdfoutput\outputmode
  997. \def\pdfliteral{\pdfextension literal}
  998. \def\pdfcatalog{\pdfextension catalog}
  999. \def\pdftexversion{\numexpr\pdffeedback version\relax}
  1000. \let\pdfximage\saveimageresource
  1001. \let\pdfrefximage\useimageresource
  1002. \let\pdflastximage\lastsavedimageresourceindex
  1003. \def\pdfendlink{\pdfextension endlink\relax}
  1004. \def\pdfoutline{\pdfextension outline}
  1005. \def\pdfstartlink{\pdfextension startlink}
  1006. \def\pdffontattr{\pdfextension fontattr}
  1007. \def\pdfobj{\pdfextension obj}
  1008. \def\pdflastobj{\numexpr\pdffeedback lastobj\relax}
  1009. \let\pdfpagewidth\pagewidth
  1010. \let\pdfpageheight\pageheight
  1011. \edef\pdfhorigin{\pdfvariable horigin}
  1012. \edef\pdfvorigin{\pdfvariable vorigin}
  1013. \fi
  1014. \fi
  1015. % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
  1016. % can be set). So we test for \relax and 0 as well as being undefined.
  1017. \ifx\pdfoutput\thisisundefined
  1018. \else
  1019. \ifx\pdfoutput\relax
  1020. \else
  1021. \ifcase\pdfoutput
  1022. \else
  1023. \pdftrue
  1024. \fi
  1025. \fi
  1026. \fi
  1027. \newif\ifpdforxetex
  1028. \pdforxetexfalse
  1029. \ifpdf
  1030. \pdforxetextrue
  1031. \fi
  1032. \ifx\XeTeXrevision\thisisundefined\else
  1033. \pdforxetextrue
  1034. \fi
  1035. % Output page labels information.
  1036. % See PDF reference v.1.7 p.594, section 8.3.1.
  1037. \ifpdf
  1038. \def\pagelabels{%
  1039. \def\title{0 << /P (T-) /S /D >>}%
  1040. \edef\roman{\the\romancount << /S /r >>}%
  1041. \edef\arabic{\the\arabiccount << /S /D >>}%
  1042. %
  1043. % Page label ranges must be increasing. Remove any duplicates.
  1044. % (There is a slight chance of this being wrong if e.g. there is
  1045. % a @contents but no @titlepage, etc.)
  1046. %
  1047. \ifnum\romancount=0 \def\roman{}\fi
  1048. \ifnum\arabiccount=0 \def\title{}%
  1049. \else
  1050. \ifnum\romancount=\arabiccount \def\roman{}\fi
  1051. \fi
  1052. %
  1053. \ifnum\romancount<\arabiccount
  1054. \pdfcatalog{/PageLabels << /Nums [\title \roman \arabic ] >> }\relax
  1055. \else
  1056. \pdfcatalog{/PageLabels << /Nums [\title \arabic \roman ] >> }\relax
  1057. \fi
  1058. }
  1059. \else
  1060. \let\pagelabels\relax
  1061. \fi
  1062. \newcount\pagecount \pagecount=0
  1063. \newcount\romancount \romancount=0
  1064. \newcount\arabiccount \arabiccount=0
  1065. \ifpdf
  1066. \let\ptxadvancepageno\advancepageno
  1067. \def\advancepageno{%
  1068. \ptxadvancepageno\global\advance\pagecount by 1
  1069. }
  1070. \fi
  1071. % PDF uses PostScript string constants for the names of xref targets,
  1072. % for display in the outlines, and in other places. Thus, we have to
  1073. % double any backslashes. Otherwise, a name like "\node" will be
  1074. % interpreted as a newline (\n), followed by o, d, e. Not good.
  1075. %
  1076. % See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and
  1077. % related messages. The final outcome is that it is up to the TeX user
  1078. % to double the backslashes and otherwise make the string valid, so
  1079. % that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to
  1080. % do this reliably, so we use it.
  1081. % #1 is a control sequence in which to do the replacements,
  1082. % which we \xdef.
  1083. \def\txiescapepdf#1{%
  1084. \ifx\pdfescapestring\thisisundefined
  1085. % No primitive available; should we give a warning or log?
  1086. % Many times it won't matter.
  1087. \xdef#1{#1}%
  1088. \else
  1089. % The expandable \pdfescapestring primitive escapes parentheses,
  1090. % backslashes, and other special chars.
  1091. \xdef#1{\pdfescapestring{#1}}%
  1092. \fi
  1093. }
  1094. \def\txiescapepdfutfsixteen#1{%
  1095. \ifx\pdfescapestrutfsixteen\thisisundefined
  1096. % No UTF-16 converting macro available.
  1097. \txiescapepdf{#1}%
  1098. \else
  1099. \xdef#1{\pdfescapestrutfsixteen{#1}}%
  1100. \fi
  1101. }
  1102. \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
  1103. with PDF output, and none of those formats could be found. (.eps cannot
  1104. be supported due to the design of the PDF format; use regular TeX (DVI
  1105. output) for that.)}
  1106. \ifpdf
  1107. %
  1108. % Color manipulation macros using ideas from pdfcolor.tex,
  1109. % except using rgb instead of cmyk; the latter is said to render as a
  1110. % very dark gray on-screen and a very dark halftone in print, instead
  1111. % of actual black. The dark red here is dark enough to print on paper as
  1112. % nearly black, but still distinguishable for online viewing. We use
  1113. % black by default, though.
  1114. \def\rgbDarkRed{0.50 0.09 0.12}
  1115. \def\rgbBlack{0 0 0}
  1116. %
  1117. % rg sets the color for filling (usual text, etc.);
  1118. % RG sets the color for stroking (thin rules, e.g., normal _'s).
  1119. \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}}
  1120. %
  1121. % Set color, and create a mark which defines \thiscolor accordingly,
  1122. % so that \makeheadline knows which color to restore.
  1123. \def\setcolor#1{%
  1124. \xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}%
  1125. \domark
  1126. \pdfsetcolor{#1}%
  1127. }
  1128. %
  1129. \def\maincolor{\rgbBlack}
  1130. \pdfsetcolor{\maincolor}
  1131. \edef\thiscolor{\maincolor}
  1132. \def\currentcolordefs{}
  1133. %
  1134. \def\makefootline{%
  1135. \baselineskip24pt
  1136. \line{\pdfsetcolor{\maincolor}\the\footline}%
  1137. }
  1138. %
  1139. \def\makeheadline{%
  1140. \vbox to 0pt{%
  1141. \vskip-22.5pt
  1142. \line{%
  1143. \vbox to8.5pt{}%
  1144. % Extract \thiscolor definition from the marks.
  1145. \getcolormarks
  1146. % Typeset the headline with \maincolor, then restore the color.
  1147. \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
  1148. }%
  1149. \vss
  1150. }%
  1151. \nointerlineskip
  1152. }
  1153. %
  1154. %
  1155. \pdfcatalog{/PageMode /UseOutlines}
  1156. %
  1157. % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
  1158. \def\dopdfimage#1#2#3{%
  1159. \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
  1160. \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
  1161. %
  1162. % pdftex (and the PDF format) support .pdf, .png, .jpg (among
  1163. % others). Let's try in that order, PDF first since if
  1164. % someone has a scalable image, presumably better to use that than a
  1165. % bitmap.
  1166. \let\pdfimgext=\empty
  1167. \begingroup
  1168. \openin 1 #1.pdf \ifeof 1
  1169. \openin 1 #1.PDF \ifeof 1
  1170. \openin 1 #1.png \ifeof 1
  1171. \openin 1 #1.jpg \ifeof 1
  1172. \openin 1 #1.jpeg \ifeof 1
  1173. \openin 1 #1.JPG \ifeof 1
  1174. \errhelp = \nopdfimagehelp
  1175. \errmessage{Could not find image file #1 for pdf}%
  1176. \else \gdef\pdfimgext{JPG}%
  1177. \fi
  1178. \else \gdef\pdfimgext{jpeg}%
  1179. \fi
  1180. \else \gdef\pdfimgext{jpg}%
  1181. \fi
  1182. \else \gdef\pdfimgext{png}%
  1183. \fi
  1184. \else \gdef\pdfimgext{PDF}%
  1185. \fi
  1186. \else \gdef\pdfimgext{pdf}%
  1187. \fi
  1188. \closein 1
  1189. \endgroup
  1190. %
  1191. % without \immediate, ancient pdftex seg faults when the same image is
  1192. % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.)
  1193. \ifnum\pdftexversion < 14
  1194. \immediate\pdfimage
  1195. \else
  1196. \immediate\pdfximage
  1197. \fi
  1198. \ifdim \wd0 >0pt width \pdfimagewidth \fi
  1199. \ifdim \wd2 >0pt height \pdfimageheight \fi
  1200. \ifnum\pdftexversion<13
  1201. #1.\pdfimgext
  1202. \else
  1203. {#1.\pdfimgext}%
  1204. \fi
  1205. \ifnum\pdftexversion < 14 \else
  1206. \pdfrefximage \pdflastximage
  1207. \fi}
  1208. %
  1209. \def\setpdfdestname#1{{%
  1210. % We have to set dummies so commands such as @code, and characters
  1211. % such as \, aren't expanded when present in a section title.
  1212. \indexnofonts
  1213. \makevalueexpandable
  1214. \turnoffactive
  1215. \iftxiuseunicodedestname
  1216. \ifx \declaredencoding \latone
  1217. % Pass through Latin-1 characters.
  1218. % LuaTeX with byte wise I/O converts Latin-1 characters to Unicode.
  1219. \else
  1220. \ifx \declaredencoding \utfeight
  1221. % Pass through Unicode characters.
  1222. \else
  1223. % Use ASCII approximations in destination names.
  1224. \passthroughcharsfalse
  1225. \fi
  1226. \fi
  1227. \else
  1228. % Use ASCII approximations in destination names.
  1229. \passthroughcharsfalse
  1230. \fi
  1231. \def\pdfdestname{#1}%
  1232. \txiescapepdf\pdfdestname
  1233. }}
  1234. %
  1235. \def\setpdfoutlinetext#1{{%
  1236. \indexnofonts
  1237. \makevalueexpandable
  1238. \turnoffactive
  1239. \ifx \declaredencoding \latone
  1240. % The PDF format can use an extended form of Latin-1 in bookmark
  1241. % strings. See Appendix D of the PDF Reference, Sixth Edition, for
  1242. % the "PDFDocEncoding".
  1243. \passthroughcharstrue
  1244. % Pass through Latin-1 characters.
  1245. % LuaTeX: Convert to Unicode
  1246. % pdfTeX: Use Latin-1 as PDFDocEncoding
  1247. \def\pdfoutlinetext{#1}%
  1248. \else
  1249. \ifx \declaredencoding \utfeight
  1250. \ifx\luatexversion\thisisundefined
  1251. % For pdfTeX with UTF-8.
  1252. % TODO: the PDF format can use UTF-16 in bookmark strings,
  1253. % but the code for this isn't done yet.
  1254. % Use ASCII approximations.
  1255. \passthroughcharsfalse
  1256. \def\pdfoutlinetext{#1}%
  1257. \else
  1258. % For LuaTeX with UTF-8.
  1259. % Pass through Unicode characters for title texts.
  1260. \passthroughcharstrue
  1261. \def\pdfoutlinetext{#1}%
  1262. \fi
  1263. \else
  1264. % For non-Latin-1 or non-UTF-8 encodings.
  1265. % Use ASCII approximations.
  1266. \passthroughcharsfalse
  1267. \def\pdfoutlinetext{#1}%
  1268. \fi
  1269. \fi
  1270. % LuaTeX: Convert to UTF-16
  1271. % pdfTeX: Use Latin-1 as PDFDocEncoding
  1272. \txiescapepdfutfsixteen\pdfoutlinetext
  1273. }}
  1274. %
  1275. \def\pdfmkdest#1{%
  1276. \setpdfdestname{#1}%
  1277. \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
  1278. }
  1279. %
  1280. % used to mark target names; must be expandable.
  1281. \def\pdfmkpgn#1{#1}
  1282. %
  1283. % by default, use black for everything.
  1284. \def\urlcolor{\rgbBlack}
  1285. \def\linkcolor{\rgbBlack}
  1286. \def\endlink{\setcolor{\maincolor}\pdfendlink}
  1287. %
  1288. % Adding outlines to PDF; macros for calculating structure of outlines
  1289. % come from Petr Olsak
  1290. \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
  1291. \else \csname#1\endcsname \fi}
  1292. \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
  1293. \advance\tempnum by 1
  1294. \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
  1295. %
  1296. % #1 is the section text, which is what will be displayed in the
  1297. % outline by the pdf viewer. #2 is the pdf expression for the number
  1298. % of subentries (or empty, for subsubsections). #3 is the node text,
  1299. % which might be empty if this toc entry had no corresponding node.
  1300. % #4 is the page number
  1301. %
  1302. \def\dopdfoutline#1#2#3#4{%
  1303. % Generate a link to the node text if that exists; else, use the
  1304. % page number. We could generate a destination for the section
  1305. % text in the case where a section has no node, but it doesn't
  1306. % seem worth the trouble, since most documents are normally structured.
  1307. \setpdfoutlinetext{#1}
  1308. \setpdfdestname{#3}
  1309. \ifx\pdfdestname\empty
  1310. \def\pdfdestname{#4}%
  1311. \fi
  1312. %
  1313. \pdfoutline goto name{\pdfmkpgn{\pdfdestname}}#2{\pdfoutlinetext}%
  1314. }
  1315. %
  1316. \def\pdfmakeoutlines{%
  1317. \begingroup
  1318. % Read toc silently, to get counts of subentries for \pdfoutline.
  1319. \def\partentry##1##2##3##4{}% ignore parts in the outlines
  1320. \def\numchapentry##1##2##3##4{%
  1321. \def\thischapnum{##2}%
  1322. \def\thissecnum{0}%
  1323. \def\thissubsecnum{0}%
  1324. }%
  1325. \def\numsecentry##1##2##3##4{%
  1326. \advancenumber{chap\thischapnum}%
  1327. \def\thissecnum{##2}%
  1328. \def\thissubsecnum{0}%
  1329. }%
  1330. \def\numsubsecentry##1##2##3##4{%
  1331. \advancenumber{sec\thissecnum}%
  1332. \def\thissubsecnum{##2}%
  1333. }%
  1334. \def\numsubsubsecentry##1##2##3##4{%
  1335. \advancenumber{subsec\thissubsecnum}%
  1336. }%
  1337. \def\thischapnum{0}%
  1338. \def\thissecnum{0}%
  1339. \def\thissubsecnum{0}%
  1340. %
  1341. % use \def rather than \let here because we redefine \chapentry et
  1342. % al. a second time, below.
  1343. \def\appentry{\numchapentry}%
  1344. \def\appsecentry{\numsecentry}%
  1345. \def\appsubsecentry{\numsubsecentry}%
  1346. \def\appsubsubsecentry{\numsubsubsecentry}%
  1347. \def\unnchapentry{\numchapentry}%
  1348. \def\unnsecentry{\numsecentry}%
  1349. \def\unnsubsecentry{\numsubsecentry}%
  1350. \def\unnsubsubsecentry{\numsubsubsecentry}%
  1351. \readdatafile{toc}%
  1352. %
  1353. % Read toc second time, this time actually producing the outlines.
  1354. % The `-' means take the \expnumber as the absolute number of
  1355. % subentries, which we calculated on our first read of the .toc above.
  1356. %
  1357. % We use the node names as the destinations.
  1358. %
  1359. % Currently we prefix the section name with the section number
  1360. % for chapter and appendix headings only in order to avoid too much
  1361. % horizontal space being required in the PDF viewer.
  1362. \def\numchapentry##1##2##3##4{%
  1363. \dopdfoutline{##2 ##1}{count-\expnumber{chap##2}}{##3}{##4}}%
  1364. \def\unnchapentry##1##2##3##4{%
  1365. \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
  1366. \def\numsecentry##1##2##3##4{%
  1367. \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
  1368. \def\numsubsecentry##1##2##3##4{%
  1369. \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%
  1370. \def\numsubsubsecentry##1##2##3##4{% count is always zero
  1371. \dopdfoutline{##1}{}{##3}{##4}}%
  1372. %
  1373. % PDF outlines are displayed using system fonts, instead of
  1374. % document fonts. Therefore we cannot use special characters,
  1375. % since the encoding is unknown. For example, the eogonek from
  1376. % Latin 2 (0xea) gets translated to a | character. Info from
  1377. % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
  1378. %
  1379. % TODO this right, we have to translate 8-bit characters to
  1380. % their "best" equivalent, based on the @documentencoding. Too
  1381. % much work for too little return. Just use the ASCII equivalents
  1382. % we use for the index sort strings.
  1383. %
  1384. \indexnofonts
  1385. \setupdatafile
  1386. % We can have normal brace characters in the PDF outlines, unlike
  1387. % Texinfo index files. So set that up.
  1388. \def\{{\lbracecharliteral}%
  1389. \def\}{\rbracecharliteral}%
  1390. \catcode`\\=\active \otherbackslash
  1391. \input \tocreadfilename
  1392. \endgroup
  1393. }
  1394. {\catcode`[=1 \catcode`]=2
  1395. \catcode`{=\other \catcode`}=\other
  1396. \gdef\lbracecharliteral[{]%
  1397. \gdef\rbracecharliteral[}]%
  1398. ]
  1399. %
  1400. \def\skipspaces#1{\def\PP{#1}\def\D{|}%
  1401. \ifx\PP\D\let\nextsp\relax
  1402. \else\let\nextsp\skipspaces
  1403. \addtokens{\filename}{\PP}%
  1404. \advance\filenamelength by 1
  1405. \fi
  1406. \nextsp}
  1407. \def\getfilename#1{%
  1408. \filenamelength=0
  1409. % If we don't expand the argument now, \skipspaces will get
  1410. % snagged on things like "@value{foo}".
  1411. \edef\temp{#1}%
  1412. \expandafter\skipspaces\temp|\relax
  1413. }
  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. % do we want to go so far as to use \indexnofonts instead of just
  1432. % special-casing \var here?
  1433. \def\var##1{##1}%
  1434. %
  1435. \leavevmode\setcolor{\urlcolor}%
  1436. \startlink attr{/Border [0 0 0]}%
  1437. user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
  1438. \endgroup}
  1439. % \pdfgettoks - Surround page numbers in #1 with @pdflink. #1 may
  1440. % be a simple number, or a list of numbers in the case of an index
  1441. % entry.
  1442. \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
  1443. \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
  1444. \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
  1445. \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
  1446. \def\maketoks{%
  1447. \expandafter\poptoks\the\toksA|ENDTOKS|\relax
  1448. \ifx\first0\adn0
  1449. \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
  1450. \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
  1451. \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
  1452. \else
  1453. \ifnum0=\countA\else\makelink\fi
  1454. \ifx\first.\let\next=\done\else
  1455. \let\next=\maketoks
  1456. \addtokens{\toksB}{\the\toksD}
  1457. \ifx\first,\addtokens{\toksB}{\space}\fi
  1458. \fi
  1459. \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
  1460. \next}
  1461. \def\makelink{\addtokens{\toksB}%
  1462. {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
  1463. \def\pdflink#1{%
  1464. \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
  1465. \setcolor{\linkcolor}#1\endlink}
  1466. \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
  1467. \else
  1468. % non-pdf mode
  1469. \let\pdfmkdest = \gobble
  1470. \let\pdfurl = \gobble
  1471. \let\endlink = \relax
  1472. \let\setcolor = \gobble
  1473. \let\pdfsetcolor = \gobble
  1474. \let\pdfmakeoutlines = \relax
  1475. \fi % \ifx\pdfoutput
  1476. %
  1477. % For XeTeX
  1478. %
  1479. \ifx\XeTeXrevision\thisisundefined
  1480. \else
  1481. %
  1482. % XeTeX version check
  1483. %
  1484. \ifnum\strcmp{\the\XeTeXversion\XeTeXrevision}{0.99996}>-1
  1485. % TeX Live 2016 contains XeTeX 0.99996 and xdvipdfmx 20160307.
  1486. % It can use the `dvipdfmx:config' special (from TeX Live SVN r40941).
  1487. % For avoiding PDF destination name replacement, we use this special
  1488. % instead of xdvipdfmx's command line option `-C 0x0010'.
  1489. \special{dvipdfmx:config C 0x0010}
  1490. % XeTeX 0.99995+ comes with xdvipdfmx 20160307+.
  1491. % It can handle Unicode destination names for PDF.
  1492. \txiuseunicodedestnametrue
  1493. \else
  1494. % XeTeX < 0.99996 (TeX Live < 2016) cannot use the
  1495. % `dvipdfmx:config' special.
  1496. % So for avoiding PDF destination name replacement,
  1497. % xdvipdfmx's command line option `-C 0x0010' is necessary.
  1498. %
  1499. % XeTeX < 0.99995 can not handle Unicode destination names for PDF
  1500. % because xdvipdfmx 20150315 has a UTF-16 conversion issue.
  1501. % It is fixed by xdvipdfmx 20160106 (TeX Live SVN r39753).
  1502. \txiuseunicodedestnamefalse
  1503. \fi
  1504. %
  1505. % Color support
  1506. %
  1507. \def\rgbDarkRed{0.50 0.09 0.12}
  1508. \def\rgbBlack{0 0 0}
  1509. %
  1510. \def\pdfsetcolor#1{\special{pdf:scolor [#1]}}
  1511. %
  1512. % Set color, and create a mark which defines \thiscolor accordingly,
  1513. % so that \makeheadline knows which color to restore.
  1514. \def\setcolor#1{%
  1515. \xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}%
  1516. \domark
  1517. \pdfsetcolor{#1}%
  1518. }
  1519. %
  1520. \def\maincolor{\rgbBlack}
  1521. \pdfsetcolor{\maincolor}
  1522. \edef\thiscolor{\maincolor}
  1523. \def\currentcolordefs{}
  1524. %
  1525. \def\makefootline{%
  1526. \baselineskip24pt
  1527. \line{\pdfsetcolor{\maincolor}\the\footline}%
  1528. }
  1529. %
  1530. \def\makeheadline{%
  1531. \vbox to 0pt{%
  1532. \vskip-22.5pt
  1533. \line{%
  1534. \vbox to8.5pt{}%
  1535. % Extract \thiscolor definition from the marks.
  1536. \getcolormarks
  1537. % Typeset the headline with \maincolor, then restore the color.
  1538. \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
  1539. }%
  1540. \vss
  1541. }%
  1542. \nointerlineskip
  1543. }
  1544. %
  1545. % PDF outline support
  1546. %
  1547. % Emulate pdfTeX primitive
  1548. \def\pdfdest name#1 xyz{%
  1549. \special{pdf:dest (#1) [@thispage /XYZ @xpos @ypos null]}%
  1550. }
  1551. %
  1552. \def\setpdfdestname#1{{%
  1553. % We have to set dummies so commands such as @code, and characters
  1554. % such as \, aren't expanded when present in a section title.
  1555. \indexnofonts
  1556. \makevalueexpandable
  1557. \turnoffactive
  1558. \iftxiuseunicodedestname
  1559. % Pass through Unicode characters.
  1560. \else
  1561. % Use ASCII approximations in destination names.
  1562. \passthroughcharsfalse
  1563. \fi
  1564. \def\pdfdestname{#1}%
  1565. \txiescapepdf\pdfdestname
  1566. }}
  1567. %
  1568. \def\setpdfoutlinetext#1{{%
  1569. \turnoffactive
  1570. % Always use Unicode characters in title texts.
  1571. \def\pdfoutlinetext{#1}%
  1572. % For XeTeX, xdvipdfmx converts to UTF-16.
  1573. % So we do not convert.
  1574. \txiescapepdf\pdfoutlinetext
  1575. }}
  1576. %
  1577. \def\pdfmkdest#1{%
  1578. \setpdfdestname{#1}%
  1579. \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
  1580. }
  1581. %
  1582. % by default, use black for everything.
  1583. \def\urlcolor{\rgbBlack}
  1584. \def\linkcolor{\rgbBlack}
  1585. \def\endlink{\setcolor{\maincolor}\pdfendlink}
  1586. %
  1587. \def\dopdfoutline#1#2#3#4{%
  1588. \setpdfoutlinetext{#1}
  1589. \setpdfdestname{#3}
  1590. \ifx\pdfdestname\empty
  1591. \def\pdfdestname{#4}%
  1592. \fi
  1593. %
  1594. \special{pdf:out [-] #2 << /Title (\pdfoutlinetext) /A
  1595. << /S /GoTo /D (\pdfdestname) >> >> }%
  1596. }
  1597. %
  1598. \def\pdfmakeoutlines{%
  1599. \begingroup
  1600. %
  1601. % For XeTeX, counts of subentries are not necessary.
  1602. % Therefore, we read toc only once.
  1603. %
  1604. % We use node names as destinations.
  1605. %
  1606. % Currently we prefix the section name with the section number
  1607. % for chapter and appendix headings only in order to avoid too much
  1608. % horizontal space being required in the PDF viewer.
  1609. \def\partentry##1##2##3##4{}% ignore parts in the outlines
  1610. \def\numchapentry##1##2##3##4{%
  1611. \dopdfoutline{##2 ##1}{1}{##3}{##4}}%
  1612. \def\numsecentry##1##2##3##4{%
  1613. \dopdfoutline{##1}{2}{##3}{##4}}%
  1614. \def\numsubsecentry##1##2##3##4{%
  1615. \dopdfoutline{##1}{3}{##3}{##4}}%
  1616. \def\numsubsubsecentry##1##2##3##4{%
  1617. \dopdfoutline{##1}{4}{##3}{##4}}%
  1618. %
  1619. \let\appentry\numchapentry%
  1620. \let\appsecentry\numsecentry%
  1621. \let\appsubsecentry\numsubsecentry%
  1622. \let\appsubsubsecentry\numsubsubsecentry%
  1623. \def\unnchapentry##1##2##3##4{%
  1624. \dopdfoutline{##1}{1}{##3}{##4}}%
  1625. \let\unnsecentry\numsecentry%
  1626. \let\unnsubsecentry\numsubsecentry%
  1627. \let\unnsubsubsecentry\numsubsubsecentry%
  1628. %
  1629. % For XeTeX, xdvipdfmx converts strings to UTF-16.
  1630. % Therefore, the encoding and the language may not be considered.
  1631. %
  1632. \indexnofonts
  1633. \setupdatafile
  1634. % We can have normal brace characters in the PDF outlines, unlike
  1635. % Texinfo index files. So set that up.
  1636. \def\{{\lbracecharliteral}%
  1637. \def\}{\rbracecharliteral}%
  1638. \catcode`\\=\active \otherbackslash
  1639. \input \tocreadfilename
  1640. \endgroup
  1641. }
  1642. {\catcode`[=1 \catcode`]=2
  1643. \catcode`{=\other \catcode`}=\other
  1644. \gdef\lbracecharliteral[{]%
  1645. \gdef\rbracecharliteral[}]%
  1646. ]
  1647. \special{pdf:docview << /PageMode /UseOutlines >> }
  1648. % ``\special{pdf:tounicode ...}'' is not necessary
  1649. % because xdvipdfmx converts strings from UTF-8 to UTF-16 without it.
  1650. % However, due to a UTF-16 conversion issue of xdvipdfmx 20150315,
  1651. % ``\special{pdf:dest ...}'' cannot handle non-ASCII strings.
  1652. % It is fixed by xdvipdfmx 20160106 (TeX Live SVN r39753).
  1653. %
  1654. \def\skipspaces#1{\def\PP{#1}\def\D{|}%
  1655. \ifx\PP\D\let\nextsp\relax
  1656. \else\let\nextsp\skipspaces
  1657. \addtokens{\filename}{\PP}%
  1658. \advance\filenamelength by 1
  1659. \fi
  1660. \nextsp}
  1661. \def\getfilename#1{%
  1662. \filenamelength=0
  1663. % If we don't expand the argument now, \skipspaces will get
  1664. % snagged on things like "@value{foo}".
  1665. \edef\temp{#1}%
  1666. \expandafter\skipspaces\temp|\relax
  1667. }
  1668. % make a live url in pdf output.
  1669. \def\pdfurl#1{%
  1670. \begingroup
  1671. % it seems we really need yet another set of dummies; have not
  1672. % tried to figure out what each command should do in the context
  1673. % of @url. for now, just make @/ a no-op, that's the only one
  1674. % people have actually reported a problem with.
  1675. %
  1676. \normalturnoffactive
  1677. \def\@{@}%
  1678. \let\/=\empty
  1679. \makevalueexpandable
  1680. % do we want to go so far as to use \indexnofonts instead of just
  1681. % special-casing \var here?
  1682. \def\var##1{##1}%
  1683. %
  1684. \leavevmode\setcolor{\urlcolor}%
  1685. \special{pdf:bann << /Border [0 0 0]
  1686. /Subtype /Link /A << /S /URI /URI (#1) >> >>}%
  1687. \endgroup}
  1688. \def\endlink{\setcolor{\maincolor}\special{pdf:eann}}
  1689. \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
  1690. \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
  1691. \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
  1692. \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
  1693. \def\maketoks{%
  1694. \expandafter\poptoks\the\toksA|ENDTOKS|\relax
  1695. \ifx\first0\adn0
  1696. \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
  1697. \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
  1698. \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
  1699. \else
  1700. \ifnum0=\countA\else\makelink\fi
  1701. \ifx\first.\let\next=\done\else
  1702. \let\next=\maketoks
  1703. \addtokens{\toksB}{\the\toksD}
  1704. \ifx\first,\addtokens{\toksB}{\space}\fi
  1705. \fi
  1706. \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
  1707. \next}
  1708. \def\makelink{\addtokens{\toksB}%
  1709. {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
  1710. \def\pdflink#1{%
  1711. \special{pdf:bann << /Border [0 0 0]
  1712. /Type /Annot /Subtype /Link /A << /S /GoTo /D (#1) >> >>}%
  1713. \setcolor{\linkcolor}#1\endlink}
  1714. \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
  1715. %
  1716. %
  1717. % @image support
  1718. %
  1719. % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
  1720. \def\doxeteximage#1#2#3{%
  1721. \def\xeteximagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
  1722. \def\xeteximageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
  1723. %
  1724. % XeTeX (and the PDF format) supports .pdf, .png, .jpg (among
  1725. % others). Let's try in that order, PDF first since if
  1726. % someone has a scalable image, presumably better to use that than a
  1727. % bitmap.
  1728. \let\xeteximgext=\empty
  1729. \begingroup
  1730. \openin 1 #1.pdf \ifeof 1
  1731. \openin 1 #1.PDF \ifeof 1
  1732. \openin 1 #1.png \ifeof 1
  1733. \openin 1 #1.jpg \ifeof 1
  1734. \openin 1 #1.jpeg \ifeof 1
  1735. \openin 1 #1.JPG \ifeof 1
  1736. \errmessage{Could not find image file #1 for XeTeX}%
  1737. \else \gdef\xeteximgext{JPG}%
  1738. \fi
  1739. \else \gdef\xeteximgext{jpeg}%
  1740. \fi
  1741. \else \gdef\xeteximgext{jpg}%
  1742. \fi
  1743. \else \gdef\xeteximgext{png}%
  1744. \fi
  1745. \else \gdef\xeteximgext{PDF}%
  1746. \fi
  1747. \else \gdef\xeteximgext{pdf}%
  1748. \fi
  1749. \closein 1
  1750. \endgroup
  1751. %
  1752. \def\xetexpdfext{pdf}%
  1753. \ifx\xeteximgext\xetexpdfext
  1754. \XeTeXpdffile "#1".\xeteximgext ""
  1755. \else
  1756. \def\xetexpdfext{PDF}%
  1757. \ifx\xeteximgext\xetexpdfext
  1758. \XeTeXpdffile "#1".\xeteximgext ""
  1759. \else
  1760. \XeTeXpicfile "#1".\xeteximgext ""
  1761. \fi
  1762. \fi
  1763. \ifdim \wd0 >0pt width \xeteximagewidth \fi
  1764. \ifdim \wd2 >0pt height \xeteximageheight \fi \relax
  1765. }
  1766. \fi
  1767. %
  1768. \message{fonts,}
  1769. % Set the baselineskip to #1, and the lineskip and strut size
  1770. % correspondingly. There is no deep meaning behind these magic numbers
  1771. % used as factors; they just match (closely enough) what Knuth defined.
  1772. %
  1773. \def\lineskipfactor{.08333}
  1774. \def\strutheightpercent{.70833}
  1775. \def\strutdepthpercent {.29167}
  1776. %
  1777. % can get a sort of poor man's double spacing by redefining this.
  1778. \def\baselinefactor{1}
  1779. %
  1780. \newdimen\textleading
  1781. \def\setleading#1{%
  1782. \dimen0 = #1\relax
  1783. \normalbaselineskip = \baselinefactor\dimen0
  1784. \normallineskip = \lineskipfactor\normalbaselineskip
  1785. \normalbaselines
  1786. \setbox\strutbox =\hbox{%
  1787. \vrule width0pt height\strutheightpercent\baselineskip
  1788. depth \strutdepthpercent \baselineskip
  1789. }%
  1790. }
  1791. % PDF CMaps. See also LaTeX's t1.cmap.
  1792. %
  1793. % do nothing with this by default.
  1794. \expandafter\let\csname cmapOT1\endcsname\gobble
  1795. \expandafter\let\csname cmapOT1IT\endcsname\gobble
  1796. \expandafter\let\csname cmapOT1TT\endcsname\gobble
  1797. % if we are producing pdf, and we have \pdffontattr, then define cmaps.
  1798. % (\pdffontattr was introduced many years ago, but people still run
  1799. % older pdftex's; it's easy to conditionalize, so we do.)
  1800. \ifpdf \ifx\pdffontattr\thisisundefined \else
  1801. \begingroup
  1802. \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
  1803. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
  1804. %%DocumentNeededResources: ProcSet (CIDInit)
  1805. %%IncludeResource: ProcSet (CIDInit)
  1806. %%BeginResource: CMap (TeX-OT1-0)
  1807. %%Title: (TeX-OT1-0 TeX OT1 0)
  1808. %%Version: 1.000
  1809. %%EndComments
  1810. /CIDInit /ProcSet findresource begin
  1811. 12 dict begin
  1812. begincmap
  1813. /CIDSystemInfo
  1814. << /Registry (TeX)
  1815. /Ordering (OT1)
  1816. /Supplement 0
  1817. >> def
  1818. /CMapName /TeX-OT1-0 def
  1819. /CMapType 2 def
  1820. 1 begincodespacerange
  1821. <00> <7F>
  1822. endcodespacerange
  1823. 8 beginbfrange
  1824. <00> <01> <0393>
  1825. <09> <0A> <03A8>
  1826. <23> <26> <0023>
  1827. <28> <3B> <0028>
  1828. <3F> <5B> <003F>
  1829. <5D> <5E> <005D>
  1830. <61> <7A> <0061>
  1831. <7B> <7C> <2013>
  1832. endbfrange
  1833. 40 beginbfchar
  1834. <02> <0398>
  1835. <03> <039B>
  1836. <04> <039E>
  1837. <05> <03A0>
  1838. <06> <03A3>
  1839. <07> <03D2>
  1840. <08> <03A6>
  1841. <0B> <00660066>
  1842. <0C> <00660069>
  1843. <0D> <0066006C>
  1844. <0E> <006600660069>
  1845. <0F> <00660066006C>
  1846. <10> <0131>
  1847. <11> <0237>
  1848. <12> <0060>
  1849. <13> <00B4>
  1850. <14> <02C7>
  1851. <15> <02D8>
  1852. <16> <00AF>
  1853. <17> <02DA>
  1854. <18> <00B8>
  1855. <19> <00DF>
  1856. <1A> <00E6>
  1857. <1B> <0153>
  1858. <1C> <00F8>
  1859. <1D> <00C6>
  1860. <1E> <0152>
  1861. <1F> <00D8>
  1862. <21> <0021>
  1863. <22> <201D>
  1864. <27> <2019>
  1865. <3C> <00A1>
  1866. <3D> <003D>
  1867. <3E> <00BF>
  1868. <5C> <201C>
  1869. <5F> <02D9>
  1870. <60> <2018>
  1871. <7D> <02DD>
  1872. <7E> <007E>
  1873. <7F> <00A8>
  1874. endbfchar
  1875. endcmap
  1876. CMapName currentdict /CMap defineresource pop
  1877. end
  1878. end
  1879. %%EndResource
  1880. %%EOF
  1881. }\endgroup
  1882. \expandafter\edef\csname cmapOT1\endcsname#1{%
  1883. \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
  1884. }%
  1885. %
  1886. % \cmapOT1IT
  1887. \begingroup
  1888. \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
  1889. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
  1890. %%DocumentNeededResources: ProcSet (CIDInit)
  1891. %%IncludeResource: ProcSet (CIDInit)
  1892. %%BeginResource: CMap (TeX-OT1IT-0)
  1893. %%Title: (TeX-OT1IT-0 TeX OT1IT 0)
  1894. %%Version: 1.000
  1895. %%EndComments
  1896. /CIDInit /ProcSet findresource begin
  1897. 12 dict begin
  1898. begincmap
  1899. /CIDSystemInfo
  1900. << /Registry (TeX)
  1901. /Ordering (OT1IT)
  1902. /Supplement 0
  1903. >> def
  1904. /CMapName /TeX-OT1IT-0 def
  1905. /CMapType 2 def
  1906. 1 begincodespacerange
  1907. <00> <7F>
  1908. endcodespacerange
  1909. 8 beginbfrange
  1910. <00> <01> <0393>
  1911. <09> <0A> <03A8>
  1912. <25> <26> <0025>
  1913. <28> <3B> <0028>
  1914. <3F> <5B> <003F>
  1915. <5D> <5E> <005D>
  1916. <61> <7A> <0061>
  1917. <7B> <7C> <2013>
  1918. endbfrange
  1919. 42 beginbfchar
  1920. <02> <0398>
  1921. <03> <039B>
  1922. <04> <039E>
  1923. <05> <03A0>
  1924. <06> <03A3>
  1925. <07> <03D2>
  1926. <08> <03A6>
  1927. <0B> <00660066>
  1928. <0C> <00660069>
  1929. <0D> <0066006C>
  1930. <0E> <006600660069>
  1931. <0F> <00660066006C>
  1932. <10> <0131>
  1933. <11> <0237>
  1934. <12> <0060>
  1935. <13> <00B4>
  1936. <14> <02C7>
  1937. <15> <02D8>
  1938. <16> <00AF>
  1939. <17> <02DA>
  1940. <18> <00B8>
  1941. <19> <00DF>
  1942. <1A> <00E6>
  1943. <1B> <0153>
  1944. <1C> <00F8>
  1945. <1D> <00C6>
  1946. <1E> <0152>
  1947. <1F> <00D8>
  1948. <21> <0021>
  1949. <22> <201D>
  1950. <23> <0023>
  1951. <24> <00A3>
  1952. <27> <2019>
  1953. <3C> <00A1>
  1954. <3D> <003D>
  1955. <3E> <00BF>
  1956. <5C> <201C>
  1957. <5F> <02D9>
  1958. <60> <2018>
  1959. <7D> <02DD>
  1960. <7E> <007E>
  1961. <7F> <00A8>
  1962. endbfchar
  1963. endcmap
  1964. CMapName currentdict /CMap defineresource pop
  1965. end
  1966. end
  1967. %%EndResource
  1968. %%EOF
  1969. }\endgroup
  1970. \expandafter\edef\csname cmapOT1IT\endcsname#1{%
  1971. \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
  1972. }%
  1973. %
  1974. % \cmapOT1TT
  1975. \begingroup
  1976. \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
  1977. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
  1978. %%DocumentNeededResources: ProcSet (CIDInit)
  1979. %%IncludeResource: ProcSet (CIDInit)
  1980. %%BeginResource: CMap (TeX-OT1TT-0)
  1981. %%Title: (TeX-OT1TT-0 TeX OT1TT 0)
  1982. %%Version: 1.000
  1983. %%EndComments
  1984. /CIDInit /ProcSet findresource begin
  1985. 12 dict begin
  1986. begincmap
  1987. /CIDSystemInfo
  1988. << /Registry (TeX)
  1989. /Ordering (OT1TT)
  1990. /Supplement 0
  1991. >> def
  1992. /CMapName /TeX-OT1TT-0 def
  1993. /CMapType 2 def
  1994. 1 begincodespacerange
  1995. <00> <7F>
  1996. endcodespacerange
  1997. 5 beginbfrange
  1998. <00> <01> <0393>
  1999. <09> <0A> <03A8>
  2000. <21> <26> <0021>
  2001. <28> <5F> <0028>
  2002. <61> <7E> <0061>
  2003. endbfrange
  2004. 32 beginbfchar
  2005. <02> <0398>
  2006. <03> <039B>
  2007. <04> <039E>
  2008. <05> <03A0>
  2009. <06> <03A3>
  2010. <07> <03D2>
  2011. <08> <03A6>
  2012. <0B> <2191>
  2013. <0C> <2193>
  2014. <0D> <0027>
  2015. <0E> <00A1>
  2016. <0F> <00BF>
  2017. <10> <0131>
  2018. <11> <0237>
  2019. <12> <0060>
  2020. <13> <00B4>
  2021. <14> <02C7>
  2022. <15> <02D8>
  2023. <16> <00AF>
  2024. <17> <02DA>
  2025. <18> <00B8>
  2026. <19> <00DF>
  2027. <1A> <00E6>
  2028. <1B> <0153>
  2029. <1C> <00F8>
  2030. <1D> <00C6>
  2031. <1E> <0152>
  2032. <1F> <00D8>
  2033. <20> <2423>
  2034. <27> <2019>
  2035. <60> <2018>
  2036. <7F> <00A8>
  2037. endbfchar
  2038. endcmap
  2039. CMapName currentdict /CMap defineresource pop
  2040. end
  2041. end
  2042. %%EndResource
  2043. %%EOF
  2044. }\endgroup
  2045. \expandafter\edef\csname cmapOT1TT\endcsname#1{%
  2046. \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
  2047. }%
  2048. \fi\fi
  2049. % Set the font macro #1 to the font named \fontprefix#2.
  2050. % #3 is the font's design size, #4 is a scale factor, #5 is the CMap
  2051. % encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit).
  2052. % Example:
  2053. % #1 = \textrm
  2054. % #2 = \rmshape
  2055. % #3 = 10
  2056. % #4 = \mainmagstep
  2057. % #5 = OT1
  2058. %
  2059. \def\setfont#1#2#3#4#5{%
  2060. \font#1=\fontprefix#2#3 scaled #4
  2061. \csname cmap#5\endcsname#1%
  2062. }
  2063. % This is what gets called when #5 of \setfont is empty.
  2064. \let\cmap\gobble
  2065. %
  2066. % (end of cmaps)
  2067. % Use cm as the default font prefix.
  2068. % To specify the font prefix, you must define \fontprefix
  2069. % before you read in texinfo.tex.
  2070. \ifx\fontprefix\thisisundefined
  2071. \def\fontprefix{cm}
  2072. \fi
  2073. % Support font families that don't use the same naming scheme as CM.
  2074. \def\rmshape{r}
  2075. \def\rmbshape{bx} % where the normal face is bold
  2076. \def\bfshape{b}
  2077. \def\bxshape{bx}
  2078. \def\ttshape{tt}
  2079. \def\ttbshape{tt}
  2080. \def\ttslshape{sltt}
  2081. \def\itshape{ti}
  2082. \def\itbshape{bxti}
  2083. \def\slshape{sl}
  2084. \def\slbshape{bxsl}
  2085. \def\sfshape{ss}
  2086. \def\sfbshape{ss}
  2087. \def\scshape{csc}
  2088. \def\scbshape{csc}
  2089. % Definitions for a main text size of 11pt. (The default in Texinfo.)
  2090. %
  2091. \def\definetextfontsizexi{%
  2092. % Text fonts (11.2pt, magstep1).
  2093. \def\textnominalsize{11pt}
  2094. \edef\mainmagstep{\magstephalf}
  2095. \setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
  2096. \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
  2097. \setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
  2098. \setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
  2099. \setfont\textsl\slshape{10}{\mainmagstep}{OT1}
  2100. \setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
  2101. \setfont\textsc\scshape{10}{\mainmagstep}{OT1}
  2102. \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
  2103. \font\texti=cmmi10 scaled \mainmagstep
  2104. \font\textsy=cmsy10 scaled \mainmagstep
  2105. \def\textecsize{1095}
  2106. % A few fonts for @defun names and args.
  2107. \setfont\defbf\bfshape{10}{\magstep1}{OT1}
  2108. \setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
  2109. \setfont\defsl\slshape{10}{\magstep1}{OT1}
  2110. \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
  2111. \def\df{\let\ttfont=\deftt \let\bffont = \defbf
  2112. \let\ttslfont=\defttsl \let\slfont=\defsl \bf}
  2113. % Fonts for indices, footnotes, small examples (9pt).
  2114. \def\smallnominalsize{9pt}
  2115. \setfont\smallrm\rmshape{9}{1000}{OT1}
  2116. \setfont\smalltt\ttshape{9}{1000}{OT1TT}
  2117. \setfont\smallbf\bfshape{10}{900}{OT1}
  2118. \setfont\smallit\itshape{9}{1000}{OT1IT}
  2119. \setfont\smallsl\slshape{9}{1000}{OT1}
  2120. \setfont\smallsf\sfshape{9}{1000}{OT1}
  2121. \setfont\smallsc\scshape{10}{900}{OT1}
  2122. \setfont\smallttsl\ttslshape{10}{900}{OT1TT}
  2123. \font\smalli=cmmi9
  2124. \font\smallsy=cmsy9
  2125. \def\smallecsize{0900}
  2126. % Fonts for small examples (8pt).
  2127. \def\smallernominalsize{8pt}
  2128. \setfont\smallerrm\rmshape{8}{1000}{OT1}
  2129. \setfont\smallertt\ttshape{8}{1000}{OT1TT}
  2130. \setfont\smallerbf\bfshape{10}{800}{OT1}
  2131. \setfont\smallerit\itshape{8}{1000}{OT1IT}
  2132. \setfont\smallersl\slshape{8}{1000}{OT1}
  2133. \setfont\smallersf\sfshape{8}{1000}{OT1}
  2134. \setfont\smallersc\scshape{10}{800}{OT1}
  2135. \setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
  2136. \font\smalleri=cmmi8
  2137. \font\smallersy=cmsy8
  2138. \def\smallerecsize{0800}
  2139. % Fonts for math mode superscripts (7pt).
  2140. \def\sevennominalsize{7pt}
  2141. \setfont\sevenrm\rmshape{7}{1000}{OT1}
  2142. \setfont\seventt\ttshape{10}{700}{OT1TT}
  2143. \setfont\sevenbf\bfshape{10}{700}{OT1}
  2144. \setfont\sevenit\itshape{7}{1000}{OT1IT}
  2145. \setfont\sevensl\slshape{10}{700}{OT1}
  2146. \setfont\sevensf\sfshape{10}{700}{OT1}
  2147. \setfont\sevensc\scshape{10}{700}{OT1}
  2148. \setfont\seventtsl\ttslshape{10}{700}{OT1TT}
  2149. \font\seveni=cmmi7
  2150. \font\sevensy=cmsy7
  2151. \def\sevenecsize{0700}
  2152. % Fonts for title page (20.4pt):
  2153. \def\titlenominalsize{20pt}
  2154. \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
  2155. \setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
  2156. \setfont\titlesl\slbshape{10}{\magstep4}{OT1}
  2157. \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
  2158. \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
  2159. \setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
  2160. \let\titlebf=\titlerm
  2161. \setfont\titlesc\scbshape{10}{\magstep4}{OT1}
  2162. \font\titlei=cmmi12 scaled \magstep3
  2163. \font\titlesy=cmsy10 scaled \magstep4
  2164. \def\titleecsize{2074}
  2165. % Chapter (and unnumbered) fonts (17.28pt).
  2166. \def\chapnominalsize{17pt}
  2167. \setfont\chaprm\rmbshape{12}{\magstep2}{OT1}
  2168. \setfont\chapit\itbshape{10}{\magstep3}{OT1IT}
  2169. \setfont\chapsl\slbshape{10}{\magstep3}{OT1}
  2170. \setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT}
  2171. \setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT}
  2172. \setfont\chapsf\sfbshape{17}{1000}{OT1}
  2173. \let\chapbf=\chaprm
  2174. \setfont\chapsc\scbshape{10}{\magstep3}{OT1}
  2175. \font\chapi=cmmi12 scaled \magstep2
  2176. \font\chapsy=cmsy10 scaled \magstep3
  2177. \def\chapecsize{1728}
  2178. % Section fonts (14.4pt).
  2179. \def\secnominalsize{14pt}
  2180. \setfont\secrm\rmbshape{12}{\magstep1}{OT1}
  2181. \setfont\secrmnotbold\rmshape{12}{\magstep1}{OT1}
  2182. \setfont\secit\itbshape{10}{\magstep2}{OT1IT}
  2183. \setfont\secsl\slbshape{10}{\magstep2}{OT1}
  2184. \setfont\sectt\ttbshape{12}{\magstep1}{OT1TT}
  2185. \setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT}
  2186. \setfont\secsf\sfbshape{12}{\magstep1}{OT1}
  2187. \let\secbf\secrm
  2188. \setfont\secsc\scbshape{10}{\magstep2}{OT1}
  2189. \font\seci=cmmi12 scaled \magstep1
  2190. \font\secsy=cmsy10 scaled \magstep2
  2191. \def\sececsize{1440}
  2192. % Subsection fonts (13.15pt).
  2193. \def\ssecnominalsize{13pt}
  2194. \setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1}
  2195. \setfont\ssecit\itbshape{10}{1315}{OT1IT}
  2196. \setfont\ssecsl\slbshape{10}{1315}{OT1}
  2197. \setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT}
  2198. \setfont\ssecttsl\ttslshape{10}{1315}{OT1TT}
  2199. \setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1}
  2200. \let\ssecbf\ssecrm
  2201. \setfont\ssecsc\scbshape{10}{1315}{OT1}
  2202. \font\sseci=cmmi12 scaled \magstephalf
  2203. \font\ssecsy=cmsy10 scaled 1315
  2204. \def\ssececsize{1200}
  2205. % Reduced fonts for @acronym in text (10pt).
  2206. \def\reducednominalsize{10pt}
  2207. \setfont\reducedrm\rmshape{10}{1000}{OT1}
  2208. \setfont\reducedtt\ttshape{10}{1000}{OT1TT}
  2209. \setfont\reducedbf\bfshape{10}{1000}{OT1}
  2210. \setfont\reducedit\itshape{10}{1000}{OT1IT}
  2211. \setfont\reducedsl\slshape{10}{1000}{OT1}
  2212. \setfont\reducedsf\sfshape{10}{1000}{OT1}
  2213. \setfont\reducedsc\scshape{10}{1000}{OT1}
  2214. \setfont\reducedttsl\ttslshape{10}{1000}{OT1TT}
  2215. \font\reducedi=cmmi10
  2216. \font\reducedsy=cmsy10
  2217. \def\reducedecsize{1000}
  2218. \textleading = 13.2pt % line spacing for 11pt CM
  2219. \textfonts % reset the current fonts
  2220. \rm
  2221. } % end of 11pt text font size definitions, \definetextfontsizexi
  2222. % Definitions to make the main text be 10pt Computer Modern, with
  2223. % section, chapter, etc., sizes following suit. This is for the GNU
  2224. % Press printing of the Emacs 22 manual. Maybe other manuals in the
  2225. % future. Used with @smallbook, which sets the leading to 12pt.
  2226. %
  2227. \def\definetextfontsizex{%
  2228. % Text fonts (10pt).
  2229. \def\textnominalsize{10pt}
  2230. \edef\mainmagstep{1000}
  2231. \setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
  2232. \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
  2233. \setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
  2234. \setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
  2235. \setfont\textsl\slshape{10}{\mainmagstep}{OT1}
  2236. \setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
  2237. \setfont\textsc\scshape{10}{\mainmagstep}{OT1}
  2238. \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
  2239. \font\texti=cmmi10 scaled \mainmagstep
  2240. \font\textsy=cmsy10 scaled \mainmagstep
  2241. \def\textecsize{1000}
  2242. % A few fonts for @defun names and args.
  2243. \setfont\defbf\bfshape{10}{\magstephalf}{OT1}
  2244. \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
  2245. \setfont\defsl\slshape{10}{\magstephalf}{OT1}
  2246. \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
  2247. \def\df{\let\ttfont=\deftt \let\bffont = \defbf
  2248. \let\slfont=\defsl \let\ttslfont=\defttsl \bf}
  2249. % Fonts for indices, footnotes, small examples (9pt).
  2250. \def\smallnominalsize{9pt}
  2251. \setfont\smallrm\rmshape{9}{1000}{OT1}
  2252. \setfont\smalltt\ttshape{9}{1000}{OT1TT}
  2253. \setfont\smallbf\bfshape{10}{900}{OT1}
  2254. \setfont\smallit\itshape{9}{1000}{OT1IT}
  2255. \setfont\smallsl\slshape{9}{1000}{OT1}
  2256. \setfont\smallsf\sfshape{9}{1000}{OT1}
  2257. \setfont\smallsc\scshape{10}{900}{OT1}
  2258. \setfont\smallttsl\ttslshape{10}{900}{OT1TT}
  2259. \font\smalli=cmmi9
  2260. \font\smallsy=cmsy9
  2261. \def\smallecsize{0900}
  2262. % Fonts for small examples (8pt).
  2263. \def\smallernominalsize{8pt}
  2264. \setfont\smallerrm\rmshape{8}{1000}{OT1}
  2265. \setfont\smallertt\ttshape{8}{1000}{OT1TT}
  2266. \setfont\smallerbf\bfshape{10}{800}{OT1}
  2267. \setfont\smallerit\itshape{8}{1000}{OT1IT}
  2268. \setfont\smallersl\slshape{8}{1000}{OT1}
  2269. \setfont\smallersf\sfshape{8}{1000}{OT1}
  2270. \setfont\smallersc\scshape{10}{800}{OT1}
  2271. \setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
  2272. \font\smalleri=cmmi8
  2273. \font\smallersy=cmsy8
  2274. \def\smallerecsize{0800}
  2275. % Fonts for math mode superscripts (7pt).
  2276. \def\sevennominalsize{7pt}
  2277. \setfont\sevenrm\rmshape{7}{1000}{OT1}
  2278. \setfont\seventt\ttshape{10}{700}{OT1TT}
  2279. \setfont\sevenbf\bfshape{10}{700}{OT1}
  2280. \setfont\sevenit\itshape{7}{1000}{OT1IT}
  2281. \setfont\sevensl\slshape{10}{700}{OT1}
  2282. \setfont\sevensf\sfshape{10}{700}{OT1}
  2283. \setfont\sevensc\scshape{10}{700}{OT1}
  2284. \setfont\seventtsl\ttslshape{10}{700}{OT1TT}
  2285. \font\seveni=cmmi7
  2286. \font\sevensy=cmsy7
  2287. \def\sevenecsize{0700}
  2288. % Fonts for title page (20.4pt):
  2289. \def\titlenominalsize{20pt}
  2290. \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
  2291. \setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
  2292. \setfont\titlesl\slbshape{10}{\magstep4}{OT1}
  2293. \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
  2294. \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
  2295. \setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
  2296. \let\titlebf=\titlerm
  2297. \setfont\titlesc\scbshape{10}{\magstep4}{OT1}
  2298. \font\titlei=cmmi12 scaled \magstep3
  2299. \font\titlesy=cmsy10 scaled \magstep4
  2300. \def\titleecsize{2074}
  2301. % Chapter fonts (14.4pt).
  2302. \def\chapnominalsize{14pt}
  2303. \setfont\chaprm\rmbshape{12}{\magstep1}{OT1}
  2304. \setfont\chapit\itbshape{10}{\magstep2}{OT1IT}
  2305. \setfont\chapsl\slbshape{10}{\magstep2}{OT1}
  2306. \setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT}
  2307. \setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT}
  2308. \setfont\chapsf\sfbshape{12}{\magstep1}{OT1}
  2309. \let\chapbf\chaprm
  2310. \setfont\chapsc\scbshape{10}{\magstep2}{OT1}
  2311. \font\chapi=cmmi12 scaled \magstep1
  2312. \font\chapsy=cmsy10 scaled \magstep2
  2313. \def\chapecsize{1440}
  2314. % Section fonts (12pt).
  2315. \def\secnominalsize{12pt}
  2316. \setfont\secrm\rmbshape{12}{1000}{OT1}
  2317. \setfont\secit\itbshape{10}{\magstep1}{OT1IT}
  2318. \setfont\secsl\slbshape{10}{\magstep1}{OT1}
  2319. \setfont\sectt\ttbshape{12}{1000}{OT1TT}
  2320. \setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT}
  2321. \setfont\secsf\sfbshape{12}{1000}{OT1}
  2322. \let\secbf\secrm
  2323. \setfont\secsc\scbshape{10}{\magstep1}{OT1}
  2324. \font\seci=cmmi12
  2325. \font\secsy=cmsy10 scaled \magstep1
  2326. \def\sececsize{1200}
  2327. % Subsection fonts (10pt).
  2328. \def\ssecnominalsize{10pt}
  2329. \setfont\ssecrm\rmbshape{10}{1000}{OT1}
  2330. \setfont\ssecit\itbshape{10}{1000}{OT1IT}
  2331. \setfont\ssecsl\slbshape{10}{1000}{OT1}
  2332. \setfont\ssectt\ttbshape{10}{1000}{OT1TT}
  2333. \setfont\ssecttsl\ttslshape{10}{1000}{OT1TT}
  2334. \setfont\ssecsf\sfbshape{10}{1000}{OT1}
  2335. \let\ssecbf\ssecrm
  2336. \setfont\ssecsc\scbshape{10}{1000}{OT1}
  2337. \font\sseci=cmmi10
  2338. \font\ssecsy=cmsy10
  2339. \def\ssececsize{1000}
  2340. % Reduced fonts for @acronym in text (9pt).
  2341. \def\reducednominalsize{9pt}
  2342. \setfont\reducedrm\rmshape{9}{1000}{OT1}
  2343. \setfont\reducedtt\ttshape{9}{1000}{OT1TT}
  2344. \setfont\reducedbf\bfshape{10}{900}{OT1}
  2345. \setfont\reducedit\itshape{9}{1000}{OT1IT}
  2346. \setfont\reducedsl\slshape{9}{1000}{OT1}
  2347. \setfont\reducedsf\sfshape{9}{1000}{OT1}
  2348. \setfont\reducedsc\scshape{10}{900}{OT1}
  2349. \setfont\reducedttsl\ttslshape{10}{900}{OT1TT}
  2350. \font\reducedi=cmmi9
  2351. \font\reducedsy=cmsy9
  2352. \def\reducedecsize{0900}
  2353. \divide\parskip by 2 % reduce space between paragraphs
  2354. \textleading = 12pt % line spacing for 10pt CM
  2355. \textfonts % reset the current fonts
  2356. \rm
  2357. } % end of 10pt text font size definitions, \definetextfontsizex
  2358. % Fonts for short table of contents.
  2359. \setfont\shortcontrm\rmshape{12}{1000}{OT1}
  2360. \setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12
  2361. \setfont\shortcontsl\slshape{12}{1000}{OT1}
  2362. \setfont\shortconttt\ttshape{12}{1000}{OT1TT}
  2363. % We provide the user-level command
  2364. % @fonttextsize 10
  2365. % (or 11) to redefine the text font size. pt is assumed.
  2366. %
  2367. \def\xiword{11}
  2368. \def\xword{10}
  2369. \def\xwordpt{10pt}
  2370. %
  2371. \parseargdef\fonttextsize{%
  2372. \def\textsizearg{#1}%
  2373. %\wlog{doing @fonttextsize \textsizearg}%
  2374. %
  2375. % Set \globaldefs so that documents can use this inside @tex, since
  2376. % makeinfo 4.8 does not support it, but we need it nonetheless.
  2377. %
  2378. \begingroup \globaldefs=1
  2379. \ifx\textsizearg\xword \definetextfontsizex
  2380. \else \ifx\textsizearg\xiword \definetextfontsizexi
  2381. \else
  2382. \errhelp=\EMsimple
  2383. \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
  2384. \fi\fi
  2385. \endgroup
  2386. }
  2387. %
  2388. % Change the current font style to #1, remembering it in \curfontstyle.
  2389. % For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
  2390. % italics, not bold italics.
  2391. %
  2392. \def\setfontstyle#1{%
  2393. \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
  2394. \csname #1font\endcsname % change the current font
  2395. }
  2396. \def\rm{\fam=0 \setfontstyle{rm}}
  2397. \def\it{\fam=\itfam \setfontstyle{it}}
  2398. \def\sl{\fam=\slfam \setfontstyle{sl}}
  2399. \def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
  2400. \def\tt{\fam=\ttfam \setfontstyle{tt}}\def\ttstylename{tt}
  2401. % Texinfo sort of supports the sans serif font style, which plain TeX does not.
  2402. % So we set up a \sf.
  2403. \newfam\sffam
  2404. \def\sf{\fam=\sffam \setfontstyle{sf}}
  2405. % We don't need math for this font style.
  2406. \def\ttsl{\setfontstyle{ttsl}}
  2407. % In order for the font changes to affect most math symbols and letters,
  2408. % we have to define the \textfont of the standard families.
  2409. % We don't bother to reset \scriptscriptfont; awaiting user need.
  2410. %
  2411. \def\resetmathfonts{%
  2412. \textfont0=\rmfont \textfont1=\ifont \textfont2=\syfont
  2413. \textfont\itfam=\itfont \textfont\slfam=\slfont \textfont\bffam=\bffont
  2414. \textfont\ttfam=\ttfont \textfont\sffam=\sffont
  2415. %
  2416. % Fonts for superscript. Note that the 7pt fonts are used regardless
  2417. % of the current font size.
  2418. \scriptfont0=\sevenrm \scriptfont1=\seveni \scriptfont2=\sevensy
  2419. \scriptfont\itfam=\sevenit \scriptfont\slfam=\sevensl
  2420. \scriptfont\bffam=\sevenbf \scriptfont\ttfam=\seventt
  2421. \scriptfont\sffam=\sevensf
  2422. }
  2423. %
  2424. % The font-changing commands (all called \...fonts) redefine the meanings
  2425. % of \STYLEfont, instead of just \STYLE. We do this because \STYLE needs
  2426. % to also set the current \fam for math mode. Our \STYLE (e.g., \rm)
  2427. % commands hardwire \STYLEfont to set the current font.
  2428. %
  2429. % The fonts used for \ifont are for "math italics" (\itfont is for italics
  2430. % in regular text). \syfont is also used in math mode only.
  2431. %
  2432. % Each font-changing command also sets the names \lsize (one size lower)
  2433. % and \lllsize (three sizes lower). These relative commands are used
  2434. % in, e.g., the LaTeX logo and acronyms.
  2435. %
  2436. % This all needs generalizing, badly.
  2437. %
  2438. \def\assignfonts#1{%
  2439. \expandafter\let\expandafter\rmfont\csname #1rm\endcsname
  2440. \expandafter\let\expandafter\itfont\csname #1it\endcsname
  2441. \expandafter\let\expandafter\slfont\csname #1sl\endcsname
  2442. \expandafter\let\expandafter\bffont\csname #1bf\endcsname
  2443. \expandafter\let\expandafter\ttfont\csname #1tt\endcsname
  2444. \expandafter\let\expandafter\smallcaps\csname #1sc\endcsname
  2445. \expandafter\let\expandafter\sffont \csname #1sf\endcsname
  2446. \expandafter\let\expandafter\ifont \csname #1i\endcsname
  2447. \expandafter\let\expandafter\syfont \csname #1sy\endcsname
  2448. \expandafter\let\expandafter\ttslfont\csname #1ttsl\endcsname
  2449. }
  2450. \newif\ifrmisbold
  2451. % Select smaller font size with the current style. Used to change font size
  2452. % in, e.g., the LaTeX logo and acronyms. If we are using bold fonts for
  2453. % normal roman text, also use bold fonts for roman text in the smaller size.
  2454. \def\switchtolllsize{%
  2455. \expandafter\assignfonts\expandafter{\lllsize}%
  2456. \ifrmisbold
  2457. \let\rmfont\bffont
  2458. \fi
  2459. \csname\curfontstyle\endcsname
  2460. }%
  2461. \def\switchtolsize{%
  2462. \expandafter\assignfonts\expandafter{\lsize}%
  2463. \ifrmisbold
  2464. \let\rmfont\bffont
  2465. \fi
  2466. \csname\curfontstyle\endcsname
  2467. }%
  2468. \def\definefontsetatsize#1#2#3#4#5{%
  2469. \expandafter\def\csname #1fonts\endcsname{%
  2470. \def\curfontsize{#1}%
  2471. \def\lsize{#2}\def\lllsize{#3}%
  2472. \csname rmisbold#5\endcsname
  2473. \assignfonts{#1}%
  2474. \resetmathfonts
  2475. \setleading{#4}%
  2476. }}
  2477. \definefontsetatsize{text} {reduced}{smaller}{\textleading}{false}
  2478. \definefontsetatsize{title} {chap} {subsec} {27pt} {true}
  2479. \definefontsetatsize{chap} {sec} {text} {19pt} {true}
  2480. \definefontsetatsize{sec} {subsec} {reduced}{17pt} {true}
  2481. \definefontsetatsize{ssec} {text} {small} {15pt} {true}
  2482. \definefontsetatsize{reduced}{small} {smaller}{10.5pt}{false}
  2483. \definefontsetatsize{small} {smaller}{smaller}{10.5pt}{false}
  2484. \definefontsetatsize{smaller}{smaller}{smaller}{9.5pt} {false}
  2485. \def\titlefont#1{{\titlefonts\rm #1}}
  2486. \let\subsecfonts = \ssecfonts
  2487. \let\subsubsecfonts = \ssecfonts
  2488. % Define these just so they can be easily changed for other fonts.
  2489. \def\angleleft{$\langle$}
  2490. \def\angleright{$\rangle$}
  2491. % Set the fonts to use with the @small... environments.
  2492. \let\smallexamplefonts = \smallfonts
  2493. % About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample
  2494. % can fit this many characters:
  2495. % 8.5x11=86 smallbook=72 a4=90 a5=69
  2496. % If we use \scriptfonts (8pt), then we can fit this many characters:
  2497. % 8.5x11=90+ smallbook=80 a4=90+ a5=77
  2498. % For me, subjectively, the few extra characters that fit aren't worth
  2499. % the additional smallness of 8pt. So I'm making the default 9pt.
  2500. %
  2501. % By the way, for comparison, here's what fits with @example (10pt):
  2502. % 8.5x11=71 smallbook=60 a4=75 a5=58
  2503. % --karl, 24jan03.
  2504. % Set up the default fonts, so we can use them for creating boxes.
  2505. %
  2506. \definetextfontsizexi
  2507. % Check if we are currently using a typewriter font. Since all the
  2508. % Computer Modern typewriter fonts have zero interword stretch (and
  2509. % shrink), and it is reasonable to expect all typewriter fonts to have
  2510. % this property, we can check that font parameter.
  2511. %
  2512. \def\ifmonospace{\ifdim\fontdimen3\font=0pt }
  2513. {
  2514. \catcode`\'=\active
  2515. \catcode`\`=\active
  2516. \gdef\setcodequotes{\let`\codequoteleft \let'\codequoteright}
  2517. \gdef\setregularquotes{\let`\lq \let'\rq}
  2518. }
  2519. % Allow an option to not use regular directed right quote/apostrophe
  2520. % (char 0x27), but instead the undirected quote from cmtt (char 0x0d).
  2521. % The undirected quote is ugly, so don't make it the default, but it
  2522. % works for pasting with more pdf viewers (at least evince), the
  2523. % lilypond developers report. xpdf does work with the regular 0x27.
  2524. %
  2525. \def\codequoteright{%
  2526. \ifmonospace
  2527. \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
  2528. \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
  2529. '%
  2530. \else \char'15 \fi
  2531. \else \char'15 \fi
  2532. \else
  2533. '%
  2534. \fi
  2535. }
  2536. %
  2537. % and a similar option for the left quote char vs. a grave accent.
  2538. % Modern fonts display ASCII 0x60 as a grave accent, so some people like
  2539. % the code environments to do likewise.
  2540. %
  2541. \def\codequoteleft{%
  2542. \ifmonospace
  2543. \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
  2544. \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
  2545. % [Knuth] pp. 380,381,391
  2546. % \relax disables Spanish ligatures ?` and !` of \tt font.
  2547. \relax`%
  2548. \else \char'22 \fi
  2549. \else \char'22 \fi
  2550. \else
  2551. \relax`%
  2552. \fi
  2553. }
  2554. % Commands to set the quote options.
  2555. %
  2556. \parseargdef\codequoteundirected{%
  2557. \def\temp{#1}%
  2558. \ifx\temp\onword
  2559. \expandafter\let\csname SETtxicodequoteundirected\endcsname
  2560. = t%
  2561. \else\ifx\temp\offword
  2562. \expandafter\let\csname SETtxicodequoteundirected\endcsname
  2563. = \relax
  2564. \else
  2565. \errhelp = \EMsimple
  2566. \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}%
  2567. \fi\fi
  2568. }
  2569. %
  2570. \parseargdef\codequotebacktick{%
  2571. \def\temp{#1}%
  2572. \ifx\temp\onword
  2573. \expandafter\let\csname SETtxicodequotebacktick\endcsname
  2574. = t%
  2575. \else\ifx\temp\offword
  2576. \expandafter\let\csname SETtxicodequotebacktick\endcsname
  2577. = \relax
  2578. \else
  2579. \errhelp = \EMsimple
  2580. \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}%
  2581. \fi\fi
  2582. }
  2583. % [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
  2584. \def\noligaturesquoteleft{\relax\lq}
  2585. % Count depth in font-changes, for error checks
  2586. \newcount\fontdepth \fontdepth=0
  2587. % Font commands.
  2588. % #1 is the font command (\sl or \it), #2 is the text to slant.
  2589. % If we are in a monospaced environment, however, 1) always use \ttsl,
  2590. % and 2) do not add an italic correction.
  2591. \def\dosmartslant#1#2{%
  2592. \ifusingtt
  2593. {{\ttsl #2}\let\next=\relax}%
  2594. {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}%
  2595. \next
  2596. }
  2597. \def\smartslanted{\dosmartslant\sl}
  2598. \def\smartitalic{\dosmartslant\it}
  2599. % Output an italic correction unless \next (presumed to be the following
  2600. % character) is such as not to need one.
  2601. \def\smartitaliccorrection{%
  2602. \ifx\next,%
  2603. \else\ifx\next-%
  2604. \else\ifx\next.%
  2605. \else\ifx\next\.%
  2606. \else\ifx\next\comma%
  2607. \else\ptexslash
  2608. \fi\fi\fi\fi\fi
  2609. \aftersmartic
  2610. }
  2611. % Unconditional use \ttsl, and no ic. @var is set to this for defuns.
  2612. \def\ttslanted#1{{\ttsl #1}}
  2613. % @cite is like \smartslanted except unconditionally use \sl. We never want
  2614. % ttsl for book titles, do we?
  2615. \def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection}
  2616. \def\aftersmartic{}
  2617. \def\var#1{%
  2618. \let\saveaftersmartic = \aftersmartic
  2619. \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}%
  2620. \smartslanted{#1}%
  2621. }
  2622. \let\i=\smartitalic
  2623. \let\slanted=\smartslanted
  2624. \let\dfn=\smartslanted
  2625. \let\emph=\smartitalic
  2626. % Explicit font changes: @r, @sc, undocumented @ii.
  2627. \def\r#1{{\rm #1}} % roman font
  2628. \def\sc#1{{\smallcaps#1}} % smallcaps font
  2629. \def\ii#1{{\it #1}} % italic font
  2630. % @b, explicit bold. Also @strong.
  2631. \def\b#1{{\bf #1}}
  2632. \let\strong=\b
  2633. % @sansserif, explicit sans.
  2634. \def\sansserif#1{{\sf #1}}
  2635. % We can't just use \exhyphenpenalty, because that only has effect at
  2636. % the end of a paragraph. Restore normal hyphenation at the end of the
  2637. % group within which \nohyphenation is presumably called.
  2638. %
  2639. \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
  2640. \def\restorehyphenation{\hyphenchar\font = `- }
  2641. % Set sfcode to normal for the chars that usually have another value.
  2642. % Can't use plain's \frenchspacing because it uses the `\x notation, and
  2643. % sometimes \x has an active definition that messes things up.
  2644. %
  2645. \catcode`@=11
  2646. \def\plainfrenchspacing{%
  2647. \sfcode`\.=\@m \sfcode`\?=\@m \sfcode`\!=\@m
  2648. \sfcode`\:=\@m \sfcode`\;=\@m \sfcode`\,=\@m
  2649. \def\endofsentencespacefactor{1000}% for @. and friends
  2650. }
  2651. \def\plainnonfrenchspacing{%
  2652. \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000
  2653. \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250
  2654. \def\endofsentencespacefactor{3000}% for @. and friends
  2655. }
  2656. \catcode`@=\other
  2657. \def\endofsentencespacefactor{3000}% default
  2658. % @t, explicit typewriter.
  2659. \def\t#1{%
  2660. {\tt \plainfrenchspacing #1}%
  2661. \null
  2662. }
  2663. % @samp.
  2664. \def\samp#1{{\setcodequotes\lq\tclose{#1}\rq\null}}
  2665. % @indicateurl is \samp, that is, with quotes.
  2666. \let\indicateurl=\samp
  2667. % @code (and similar) prints in typewriter, but with spaces the same
  2668. % size as normal in the surrounding text, without hyphenation, etc.
  2669. % This is a subroutine for that.
  2670. \def\tclose#1{%
  2671. {%
  2672. % Change normal interword space to be same as for the current font.
  2673. \spaceskip = \fontdimen2\font
  2674. %
  2675. % Switch to typewriter.
  2676. \tt
  2677. %
  2678. % But `\ ' produces the large typewriter interword space.
  2679. \def\ {{\spaceskip = 0pt{} }}%
  2680. %
  2681. % Turn off hyphenation.
  2682. \nohyphenation
  2683. %
  2684. \plainfrenchspacing
  2685. #1%
  2686. }%
  2687. \null % reset spacefactor to 1000
  2688. }
  2689. % We *must* turn on hyphenation at `-' and `_' in @code.
  2690. % (But see \codedashfinish below.)
  2691. % Otherwise, it is too hard to avoid overfull hboxes
  2692. % in the Emacs manual, the Library manual, etc.
  2693. %
  2694. % Unfortunately, TeX uses one parameter (\hyphenchar) to control
  2695. % both hyphenation at - and hyphenation within words.
  2696. % We must therefore turn them both off (\tclose does that)
  2697. % and arrange explicitly to hyphenate at a dash. -- rms.
  2698. {
  2699. \catcode`\-=\active \catcode`\_=\active
  2700. \catcode`\'=\active \catcode`\`=\active
  2701. \global\let'=\rq \global\let`=\lq % default definitions
  2702. %
  2703. \global\def\code{\begingroup
  2704. \setcodequotes
  2705. \catcode\dashChar=\active \catcode\underChar=\active
  2706. \ifallowcodebreaks
  2707. \let-\codedash
  2708. \let_\codeunder
  2709. \else
  2710. \let-\normaldash
  2711. \let_\realunder
  2712. \fi
  2713. % Given -foo (with a single dash), we do not want to allow a break
  2714. % after the hyphen.
  2715. \global\let\codedashprev=\codedash
  2716. %
  2717. \codex
  2718. }
  2719. %
  2720. \gdef\codedash{\futurelet\next\codedashfinish}
  2721. \gdef\codedashfinish{%
  2722. \normaldash % always output the dash character itself.
  2723. %
  2724. % Now, output a discretionary to allow a line break, unless
  2725. % (a) the next character is a -, or
  2726. % (b) the preceding character is a -.
  2727. % E.g., given --posix, we do not want to allow a break after either -.
  2728. % Given --foo-bar, we do want to allow a break between the - and the b.
  2729. \ifx\next\codedash \else
  2730. \ifx\codedashprev\codedash
  2731. \else \discretionary{}{}{}\fi
  2732. \fi
  2733. % we need the space after the = for the case when \next itself is a
  2734. % space token; it would get swallowed otherwise. As in @code{- a}.
  2735. \global\let\codedashprev= \next
  2736. }
  2737. }
  2738. \def\normaldash{-}
  2739. %
  2740. \def\codex #1{\tclose{#1}\endgroup}
  2741. \def\codeunder{%
  2742. % this is all so @math{@code{var_name}+1} can work. In math mode, _
  2743. % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
  2744. % will therefore expand the active definition of _, which is us
  2745. % (inside @code that is), therefore an endless loop.
  2746. \ifusingtt{\ifmmode
  2747. \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
  2748. \else\normalunderscore \fi
  2749. \discretionary{}{}{}}%
  2750. {\_}%
  2751. }
  2752. % An additional complication: the above will allow breaks after, e.g.,
  2753. % each of the four underscores in __typeof__. This is bad.
  2754. % @allowcodebreaks provides a document-level way to turn breaking at -
  2755. % and _ on and off.
  2756. %
  2757. \newif\ifallowcodebreaks \allowcodebreakstrue
  2758. \def\keywordtrue{true}
  2759. \def\keywordfalse{false}
  2760. \parseargdef\allowcodebreaks{%
  2761. \def\txiarg{#1}%
  2762. \ifx\txiarg\keywordtrue
  2763. \allowcodebreakstrue
  2764. \else\ifx\txiarg\keywordfalse
  2765. \allowcodebreaksfalse
  2766. \else
  2767. \errhelp = \EMsimple
  2768. \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}%
  2769. \fi\fi
  2770. }
  2771. % For @command, @env, @file, @option quotes seem unnecessary,
  2772. % so use \code rather than \samp.
  2773. \let\command=\code
  2774. \let\env=\code
  2775. \let\file=\code
  2776. \let\option=\code
  2777. % @uref (abbreviation for `urlref') aka @url takes an optional
  2778. % (comma-separated) second argument specifying the text to display and
  2779. % an optional third arg as text to display instead of (rather than in
  2780. % addition to) the url itself. First (mandatory) arg is the url.
  2781. % TeX-only option to allow changing PDF output to show only the second
  2782. % arg (if given), and not the url (which is then just the link target).
  2783. \newif\ifurefurlonlylink
  2784. % The default \pretolerance setting stops the penalty inserted in
  2785. % \urefallowbreak being a discouragement to line breaking. Set it to
  2786. % a negative value for this paragraph only. Hopefully this does not
  2787. % conflict with redefinitions of \par done elsewhere.
  2788. \def\nopretolerance{%
  2789. \pretolerance=-1
  2790. \def\par{\endgraf\pretolerance=100 \let\par\endgraf}%
  2791. }
  2792. % The main macro is \urefbreak, which allows breaking at expected
  2793. % places within the url.
  2794. \def\urefbreak{\nopretolerance \begingroup \urefcatcodes \dourefbreak}
  2795. \let\uref=\urefbreak
  2796. %
  2797. \def\dourefbreak#1{\urefbreakfinish #1,,,\finish}
  2798. \def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example
  2799. \unsepspaces
  2800. \pdfurl{#1}%
  2801. \setbox0 = \hbox{\ignorespaces #3}%
  2802. \ifdim\wd0 > 0pt
  2803. \unhbox0 % third arg given, show only that
  2804. \else
  2805. \setbox0 = \hbox{\ignorespaces #2}% look for second arg
  2806. \ifdim\wd0 > 0pt
  2807. \ifpdf
  2808. % For pdfTeX and LuaTeX
  2809. \ifurefurlonlylink
  2810. % PDF plus option to not display url, show just arg
  2811. \unhbox0
  2812. \else
  2813. % PDF, normally display both arg and url for consistency,
  2814. % visibility, if the pdf is eventually used to print, etc.
  2815. \unhbox0\ (\urefcode{#1})%
  2816. \fi
  2817. \else
  2818. \ifx\XeTeXrevision\thisisundefined
  2819. \unhbox0\ (\urefcode{#1})% DVI, always show arg and url
  2820. \else
  2821. % For XeTeX
  2822. \ifurefurlonlylink
  2823. % PDF plus option to not display url, show just arg
  2824. \unhbox0
  2825. \else
  2826. % PDF, normally display both arg and url for consistency,
  2827. % visibility, if the pdf is eventually used to print, etc.
  2828. \unhbox0\ (\urefcode{#1})%
  2829. \fi
  2830. \fi
  2831. \fi
  2832. \else
  2833. \urefcode{#1}% only url given, so show it
  2834. \fi
  2835. \fi
  2836. \endlink
  2837. \endgroup}
  2838. % Allow line breaks around only a few characters (only).
  2839. \def\urefcatcodes{%
  2840. \catcode`\&=\active \catcode`\.=\active
  2841. \catcode`\#=\active \catcode`\?=\active
  2842. \catcode`\/=\active
  2843. }
  2844. {
  2845. \urefcatcodes
  2846. %
  2847. \global\def\urefcode{\begingroup
  2848. \setcodequotes
  2849. \urefcatcodes
  2850. \let&\urefcodeamp
  2851. \let.\urefcodedot
  2852. \let#\urefcodehash
  2853. \let?\urefcodequest
  2854. \let/\urefcodeslash
  2855. \codex
  2856. }
  2857. %
  2858. % By default, they are just regular characters.
  2859. \global\def&{\normalamp}
  2860. \global\def.{\normaldot}
  2861. \global\def#{\normalhash}
  2862. \global\def?{\normalquest}
  2863. \global\def/{\normalslash}
  2864. }
  2865. \def\urefcodeamp{\urefprebreak \&\urefpostbreak}
  2866. \def\urefcodedot{\urefprebreak .\urefpostbreak}
  2867. \def\urefcodehash{\urefprebreak \#\urefpostbreak}
  2868. \def\urefcodequest{\urefprebreak ?\urefpostbreak}
  2869. \def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
  2870. {
  2871. \catcode`\/=\active
  2872. \global\def\urefcodeslashfinish{%
  2873. \urefprebreak \slashChar
  2874. % Allow line break only after the final / in a sequence of
  2875. % slashes, to avoid line break between the slashes in http://.
  2876. \ifx\next/\else \urefpostbreak \fi
  2877. }
  2878. }
  2879. % By default we'll break after the special characters, but some people like to
  2880. % break before the special chars, so allow that. Also allow no breaking at
  2881. % all, for manual control.
  2882. %
  2883. \parseargdef\urefbreakstyle{%
  2884. \def\txiarg{#1}%
  2885. \ifx\txiarg\wordnone
  2886. \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
  2887. \else\ifx\txiarg\wordbefore
  2888. \def\urefprebreak{\urefallowbreak}\def\urefpostbreak{\nobreak}
  2889. \else\ifx\txiarg\wordafter
  2890. \def\urefprebreak{\nobreak}\def\urefpostbreak{\urefallowbreak}
  2891. \else
  2892. \errhelp = \EMsimple
  2893. \errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
  2894. \fi\fi\fi
  2895. }
  2896. \def\wordafter{after}
  2897. \def\wordbefore{before}
  2898. \def\wordnone{none}
  2899. % Allow a ragged right output to aid breaking long URL's. There can
  2900. % be a break at the \allowbreak with no extra glue (if the existing stretch in
  2901. % the line is sufficient), a break at the \penalty with extra glue added
  2902. % at the end of the line, or no break at all here.
  2903. % Changing the value of the penalty and/or the amount of stretch affects how
  2904. % preferable one choice is over the other.
  2905. \def\urefallowbreak{%
  2906. \penalty0\relax
  2907. \hskip 0pt plus 2 em\relax
  2908. \penalty1000\relax
  2909. \hskip 0pt plus -2 em\relax
  2910. }
  2911. \urefbreakstyle after
  2912. % @url synonym for @uref, since that's how everyone uses it.
  2913. %
  2914. \let\url=\uref
  2915. % rms does not like angle brackets --karl, 17may97.
  2916. % So now @email is just like @uref, unless we are pdf.
  2917. %
  2918. %\def\email#1{\angleleft{\tt #1}\angleright}
  2919. \ifpdforxetex
  2920. \def\email#1{\doemail#1,,\finish}
  2921. \def\doemail#1,#2,#3\finish{\begingroup
  2922. \unsepspaces
  2923. \pdfurl{mailto:#1}%
  2924. \setbox0 = \hbox{\ignorespaces #2}%
  2925. \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
  2926. \endlink
  2927. \endgroup}
  2928. \else
  2929. \let\email=\uref
  2930. \fi
  2931. % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
  2932. % `example' (@kbd uses ttsl only inside of @example and friends),
  2933. % or `code' (@kbd uses normal tty font always).
  2934. \parseargdef\kbdinputstyle{%
  2935. \def\txiarg{#1}%
  2936. \ifx\txiarg\worddistinct
  2937. \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
  2938. \else\ifx\txiarg\wordexample
  2939. \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
  2940. \else\ifx\txiarg\wordcode
  2941. \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
  2942. \else
  2943. \errhelp = \EMsimple
  2944. \errmessage{Unknown @kbdinputstyle setting `\txiarg'}%
  2945. \fi\fi\fi
  2946. }
  2947. \def\worddistinct{distinct}
  2948. \def\wordexample{example}
  2949. \def\wordcode{code}
  2950. % Default is `distinct'.
  2951. \kbdinputstyle distinct
  2952. % @kbd is like @code, except that if the argument is just one @key command,
  2953. % then @kbd has no effect.
  2954. \def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}}
  2955. \def\xkey{\key}
  2956. \def\kbdsub#1#2#3\par{%
  2957. \def\one{#1}\def\three{#3}\def\threex{??}%
  2958. \ifx\one\xkey\ifx\threex\three \key{#2}%
  2959. \else{\tclose{\kbdfont\setcodequotes\look}}\fi
  2960. \else{\tclose{\kbdfont\setcodequotes\look}}\fi
  2961. }
  2962. % definition of @key that produces a lozenge. Doesn't adjust to text size.
  2963. %\setfont\keyrm\rmshape{8}{1000}{OT1}
  2964. %\font\keysy=cmsy9
  2965. %\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
  2966. % \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
  2967. % \vbox{\hrule\kern-0.4pt
  2968. % \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
  2969. % \kern-0.4pt\hrule}%
  2970. % \kern-.06em\raise0.4pt\hbox{\angleright}}}}
  2971. % definition of @key with no lozenge. If the current font is already
  2972. % monospace, don't change it; that way, we respect @kbdinputstyle. But
  2973. % if it isn't monospace, then use \tt.
  2974. %
  2975. \def\key#1{{\setregularquotes
  2976. \nohyphenation
  2977. \ifmonospace\else\tt\fi
  2978. #1}\null}
  2979. % @clicksequence{File @click{} Open ...}
  2980. \def\clicksequence#1{\begingroup #1\endgroup}
  2981. % @clickstyle @arrow (by default)
  2982. \parseargdef\clickstyle{\def\click{#1}}
  2983. \def\click{\arrow}
  2984. % Typeset a dimension, e.g., `in' or `pt'. The only reason for the
  2985. % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
  2986. %
  2987. \def\dmn#1{\thinspace #1}
  2988. % @acronym for "FBI", "NATO", and the like.
  2989. % We print this one point size smaller, since it's intended for
  2990. % all-uppercase.
  2991. %
  2992. \def\acronym#1{\doacronym #1,,\finish}
  2993. \def\doacronym#1,#2,#3\finish{%
  2994. {\switchtolsize #1}%
  2995. \def\temp{#2}%
  2996. \ifx\temp\empty \else
  2997. \space ({\unsepspaces \ignorespaces \temp \unskip})%
  2998. \fi
  2999. \null % reset \spacefactor=1000
  3000. }
  3001. % @abbr for "Comput. J." and the like.
  3002. % No font change, but don't do end-of-sentence spacing.
  3003. %
  3004. \def\abbr#1{\doabbr #1,,\finish}
  3005. \def\doabbr#1,#2,#3\finish{%
  3006. {\plainfrenchspacing #1}%
  3007. \def\temp{#2}%
  3008. \ifx\temp\empty \else
  3009. \space ({\unsepspaces \ignorespaces \temp \unskip})%
  3010. \fi
  3011. \null % reset \spacefactor=1000
  3012. }
  3013. % @asis just yields its argument. Used with @table, for example.
  3014. %
  3015. \def\asis#1{#1}
  3016. % @math outputs its argument in math mode.
  3017. %
  3018. % One complication: _ usually means subscripts, but it could also mean
  3019. % an actual _ character, as in @math{@var{some_variable} + 1}. So make
  3020. % _ active, and distinguish by seeing if the current family is \slfam,
  3021. % which is what @var uses.
  3022. {
  3023. \catcode`\_ = \active
  3024. \gdef\mathunderscore{%
  3025. \catcode`\_=\active
  3026. \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
  3027. }
  3028. }
  3029. % Another complication: we want \\ (and @\) to output a math (or tt) \.
  3030. % FYI, plain.tex uses \\ as a temporary control sequence (for no
  3031. % particular reason), but this is not advertised and we don't care.
  3032. %
  3033. % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
  3034. \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
  3035. %
  3036. \def\math{%
  3037. \ifmmode\else % only go into math if not in math mode already
  3038. \tex
  3039. \mathunderscore
  3040. \let\\ = \mathbackslash
  3041. \mathactive
  3042. % make the texinfo accent commands work in math mode
  3043. \let\"=\ddot
  3044. \let\'=\acute
  3045. \let\==\bar
  3046. \let\^=\hat
  3047. \let\`=\grave
  3048. \let\u=\breve
  3049. \let\v=\check
  3050. \let\~=\tilde
  3051. \let\dotaccent=\dot
  3052. % have to provide another name for sup operator
  3053. \let\mathopsup=\sup
  3054. $\expandafter\finishmath\fi
  3055. }
  3056. \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
  3057. % Some active characters (such as <) are spaced differently in math.
  3058. % We have to reset their definitions in case the @math was an argument
  3059. % to a command which sets the catcodes (such as @item or @section).
  3060. %
  3061. {
  3062. \catcode`^ = \active
  3063. \catcode`< = \active
  3064. \catcode`> = \active
  3065. \catcode`+ = \active
  3066. \catcode`' = \active
  3067. \gdef\mathactive{%
  3068. \let^ = \ptexhat
  3069. \let< = \ptexless
  3070. \let> = \ptexgtr
  3071. \let+ = \ptexplus
  3072. \let' = \ptexquoteright
  3073. }
  3074. }
  3075. % for @sub and @sup, if in math mode, just do a normal sub/superscript.
  3076. % If in text, use math to place as sub/superscript, but switch
  3077. % into text mode, with smaller fonts. This is a different font than the
  3078. % one used for real math sub/superscripts (8pt vs. 7pt), but let's not
  3079. % fix it (significant additions to font machinery) until someone notices.
  3080. %
  3081. \def\sub{\ifmmode \expandafter\sb \else \expandafter\finishsub\fi}
  3082. \def\finishsub#1{$\sb{\hbox{\switchtolllsize #1}}$}%
  3083. %
  3084. \def\sup{\ifmmode \expandafter\ptexsp \else \expandafter\finishsup\fi}
  3085. \def\finishsup#1{$\ptexsp{\hbox{\switchtolllsize #1}}$}%
  3086. % provide this command from LaTeX as it is very common
  3087. \def\frac#1#2{{{#1}\over{#2}}}
  3088. % @displaymath.
  3089. % \globaldefs is needed to recognize the end lines in \tex and
  3090. % \end tex. Set \thisenv as @end displaymath is seen before @end tex.
  3091. {\obeylines
  3092. \globaldefs=1
  3093. \envdef\displaymath{%
  3094. \tex%
  3095. \def\thisenv{\displaymath}%
  3096. \begingroup\let\end\displaymathend%
  3097. $$%
  3098. }
  3099. \def\displaymathend{$$\endgroup\end}%
  3100. \def\Edisplaymath{%
  3101. \def\thisenv{\tex}%
  3102. \end tex
  3103. }}
  3104. % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
  3105. % Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
  3106. % except specified as a normal braced arg, so no newlines to worry about.
  3107. %
  3108. \def\outfmtnametex{tex}
  3109. %
  3110. \long\def\inlinefmt#1{\doinlinefmt #1,\finish}
  3111. \long\def\doinlinefmt#1,#2,\finish{%
  3112. \def\inlinefmtname{#1}%
  3113. \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
  3114. }
  3115. %
  3116. % @inlinefmtifelse{FMTNAME,THEN-TEXT,ELSE-TEXT} expands THEN-TEXT if
  3117. % FMTNAME is tex, else ELSE-TEXT.
  3118. \long\def\inlinefmtifelse#1{\doinlinefmtifelse #1,,,\finish}
  3119. \long\def\doinlinefmtifelse#1,#2,#3,#4,\finish{%
  3120. \def\inlinefmtname{#1}%
  3121. \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\else \ignorespaces #3\fi
  3122. }
  3123. %
  3124. % For raw, must switch into @tex before parsing the argument, to avoid
  3125. % setting catcodes prematurely. Doing it this way means that, for
  3126. % example, @inlineraw{html, foo{bar} gets a parse error instead of being
  3127. % ignored. But this isn't important because if people want a literal
  3128. % *right* brace they would have to use a command anyway, so they may as
  3129. % well use a command to get a left brace too. We could re-use the
  3130. % delimiter character idea from \verb, but it seems like overkill.
  3131. %
  3132. \long\def\inlineraw{\tex \doinlineraw}
  3133. \long\def\doinlineraw#1{\doinlinerawtwo #1,\finish}
  3134. \def\doinlinerawtwo#1,#2,\finish{%
  3135. \def\inlinerawname{#1}%
  3136. \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi
  3137. \endgroup % close group opened by \tex.
  3138. }
  3139. % @inlineifset{VAR, TEXT} expands TEXT if VAR is @set.
  3140. %
  3141. \long\def\inlineifset#1{\doinlineifset #1,\finish}
  3142. \long\def\doinlineifset#1,#2,\finish{%
  3143. \def\inlinevarname{#1}%
  3144. \expandafter\ifx\csname SET\inlinevarname\endcsname\relax
  3145. \else\ignorespaces#2\fi
  3146. }
  3147. % @inlineifclear{VAR, TEXT} expands TEXT if VAR is not @set.
  3148. %
  3149. \long\def\inlineifclear#1{\doinlineifclear #1,\finish}
  3150. \long\def\doinlineifclear#1,#2,\finish{%
  3151. \def\inlinevarname{#1}%
  3152. \expandafter\ifx\csname SET\inlinevarname\endcsname\relax \ignorespaces#2\fi
  3153. }
  3154. \message{glyphs,}
  3155. % and logos.
  3156. % @@ prints an @, as does @atchar{}.
  3157. \def\@{\char64 }
  3158. \let\atchar=\@
  3159. % @{ @} @lbracechar{} @rbracechar{} all generate brace characters.
  3160. \def\lbracechar{{\ifmonospace\char123\else\ensuremath\lbrace\fi}}
  3161. \def\rbracechar{{\ifmonospace\char125\else\ensuremath\rbrace\fi}}
  3162. \let\{=\lbracechar
  3163. \let\}=\rbracechar
  3164. % @comma{} to avoid , parsing problems.
  3165. \let\comma = ,
  3166. % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
  3167. % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
  3168. \let\, = \ptexc
  3169. \let\dotaccent = \ptexdot
  3170. \def\ringaccent#1{{\accent23 #1}}
  3171. \let\tieaccent = \ptext
  3172. \let\ubaraccent = \ptexb
  3173. \let\udotaccent = \d
  3174. % Other special characters: @questiondown @exclamdown @ordf @ordm
  3175. % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
  3176. \def\questiondown{?`}
  3177. \def\exclamdown{!`}
  3178. \def\ordf{\leavevmode\raise1ex\hbox{\switchtolllsize \underbar{a}}}
  3179. \def\ordm{\leavevmode\raise1ex\hbox{\switchtolllsize \underbar{o}}}
  3180. % Dotless i and dotless j, used for accents.
  3181. \def\imacro{i}
  3182. \def\jmacro{j}
  3183. \def\dotless#1{%
  3184. \def\temp{#1}%
  3185. \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
  3186. \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
  3187. \else \errmessage{@dotless can be used only with i or j}%
  3188. \fi\fi
  3189. }
  3190. % The \TeX{} logo, as in plain, but resetting the spacing so that a
  3191. % period following counts as ending a sentence. (Idea found in latex.)
  3192. %
  3193. \edef\TeX{\TeX \spacefactor=1000 }
  3194. % @LaTeX{} logo. Not quite the same results as the definition in
  3195. % latex.ltx, since we use a different font for the raised A; it's most
  3196. % convenient for us to use an explicitly smaller font, rather than using
  3197. % the \scriptstyle font (since we don't reset \scriptstyle and
  3198. % \scriptscriptstyle).
  3199. %
  3200. \def\LaTeX{%
  3201. L\kern-.36em
  3202. {\setbox0=\hbox{T}%
  3203. \vbox to \ht0{\hbox{%
  3204. \ifx\textnominalsize\xwordpt
  3205. % for 10pt running text, lllsize (8pt) is too small for the A in LaTeX.
  3206. % Revert to plain's \scriptsize, which is 7pt.
  3207. \count255=\the\fam $\fam\count255 \scriptstyle A$%
  3208. \else
  3209. % For 11pt, we can use our lllsize.
  3210. \switchtolllsize A%
  3211. \fi
  3212. }%
  3213. \vss
  3214. }}%
  3215. \kern-.15em
  3216. \TeX
  3217. }
  3218. % Some math mode symbols. Define \ensuremath to switch into math mode
  3219. % unless we are already there. Expansion tricks may not be needed here,
  3220. % but safer, and can't hurt.
  3221. \def\ensuremath{\ifmmode \expandafter\asis \else\expandafter\ensuredmath \fi}
  3222. \def\ensuredmath#1{$\relax#1$}
  3223. %
  3224. \def\bullet{\ensuremath\ptexbullet}
  3225. \def\geq{\ensuremath\ge}
  3226. \def\leq{\ensuremath\le}
  3227. \def\minus{\ensuremath-}
  3228. % @dots{} outputs an ellipsis using the current font.
  3229. % We do .5em per period so that it has the same spacing in the cm
  3230. % typewriter fonts as three actual period characters; on the other hand,
  3231. % in other typewriter fonts three periods are wider than 1.5em. So do
  3232. % whichever is larger.
  3233. %
  3234. \def\dots{%
  3235. \leavevmode
  3236. \setbox0=\hbox{...}% get width of three periods
  3237. \ifdim\wd0 > 1.5em
  3238. \dimen0 = \wd0
  3239. \else
  3240. \dimen0 = 1.5em
  3241. \fi
  3242. \hbox to \dimen0{%
  3243. \hskip 0pt plus.25fil
  3244. .\hskip 0pt plus1fil
  3245. .\hskip 0pt plus1fil
  3246. .\hskip 0pt plus.5fil
  3247. }%
  3248. }
  3249. % @enddots{} is an end-of-sentence ellipsis.
  3250. %
  3251. \def\enddots{%
  3252. \dots
  3253. \spacefactor=\endofsentencespacefactor
  3254. }
  3255. % @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
  3256. %
  3257. % Since these characters are used in examples, they should be an even number of
  3258. % \tt widths. Each \tt character is 1en, so two makes it 1em.
  3259. %
  3260. \def\point{$\star$}
  3261. \def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}}
  3262. \def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
  3263. \def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}}
  3264. \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
  3265. \def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}}
  3266. % The @error{} command.
  3267. % Adapted from the TeXbook's \boxit.
  3268. %
  3269. \newbox\errorbox
  3270. %
  3271. {\ttfont \global\dimen0 = 3em}% Width of the box.
  3272. \dimen2 = .55pt % Thickness of rules
  3273. % The text. (`r' is open on the right, `e' somewhat less so on the left.)
  3274. \setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt}
  3275. %
  3276. \setbox\errorbox=\hbox to \dimen0{\hfil
  3277. \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
  3278. \advance\hsize by -2\dimen2 % Rules.
  3279. \vbox{%
  3280. \hrule height\dimen2
  3281. \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
  3282. \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
  3283. \kern3pt\vrule width\dimen2}% Space to right.
  3284. \hrule height\dimen2}
  3285. \hfil}
  3286. %
  3287. \def\error{\leavevmode\lower.7ex\copy\errorbox}
  3288. % @pounds{} is a sterling sign, which Knuth put in the CM italic font.
  3289. %
  3290. \def\pounds{\ifmonospace{\ecfont\char"BF}\else{\it\$}\fi}
  3291. % @euro{} comes from a separate font, depending on the current style.
  3292. % We use the free feym* fonts from the eurosym package by Henrik
  3293. % Theiling, which support regular, slanted, bold and bold slanted (and
  3294. % "outlined" (blackboard board, sort of) versions, which we don't need).
  3295. % It is available from http://www.ctan.org/tex-archive/fonts/eurosym.
  3296. %
  3297. % Although only regular is the truly official Euro symbol, we ignore
  3298. % that. The Euro is designed to be slightly taller than the regular
  3299. % font height.
  3300. %
  3301. % feymr - regular
  3302. % feymo - slanted
  3303. % feybr - bold
  3304. % feybo - bold slanted
  3305. %
  3306. % There is no good (free) typewriter version, to my knowledge.
  3307. % A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
  3308. % Hmm.
  3309. %
  3310. % Also doesn't work in math. Do we need to do math with euro symbols?
  3311. % Hope not.
  3312. %
  3313. %
  3314. \def\euro{{\eurofont e}}
  3315. \def\eurofont{%
  3316. % We set the font at each command, rather than predefining it in
  3317. % \textfonts and the other font-switching commands, so that
  3318. % installations which never need the symbol don't have to have the
  3319. % font installed.
  3320. %
  3321. % There is only one designed size (nominal 10pt), so we always scale
  3322. % that to the current nominal size.
  3323. %
  3324. % By the way, simply using "at 1em" works for cmr10 and the like, but
  3325. % does not work for cmbx10 and other extended/shrunken fonts.
  3326. %
  3327. \def\eurosize{\csname\curfontsize nominalsize\endcsname}%
  3328. %
  3329. \ifx\curfontstyle\bfstylename
  3330. % bold:
  3331. \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
  3332. \else
  3333. % regular:
  3334. \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
  3335. \fi
  3336. \thiseurofont
  3337. }
  3338. % Glyphs from the EC fonts. We don't use \let for the aliases, because
  3339. % sometimes we redefine the original macro, and the alias should reflect
  3340. % the redefinition.
  3341. %
  3342. % Use LaTeX names for the Icelandic letters.
  3343. \def\DH{{\ecfont \char"D0}} % Eth
  3344. \def\dh{{\ecfont \char"F0}} % eth
  3345. \def\TH{{\ecfont \char"DE}} % Thorn
  3346. \def\th{{\ecfont \char"FE}} % thorn
  3347. %
  3348. \def\guillemetleft{{\ecfont \char"13}}
  3349. \def\guillemotleft{\guillemetleft}
  3350. \def\guillemetright{{\ecfont \char"14}}
  3351. \def\guillemotright{\guillemetright}
  3352. \def\guilsinglleft{{\ecfont \char"0E}}
  3353. \def\guilsinglright{{\ecfont \char"0F}}
  3354. \def\quotedblbase{{\ecfont \char"12}}
  3355. \def\quotesinglbase{{\ecfont \char"0D}}
  3356. %
  3357. % This positioning is not perfect (see the ogonek LaTeX package), but
  3358. % we have the precomposed glyphs for the most common cases. We put the
  3359. % tests to use those glyphs in the single \ogonek macro so we have fewer
  3360. % dummy definitions to worry about for index entries, etc.
  3361. %
  3362. % ogonek is also used with other letters in Lithuanian (IOU), but using
  3363. % the precomposed glyphs for those is not so easy since they aren't in
  3364. % the same EC font.
  3365. \def\ogonek#1{{%
  3366. \def\temp{#1}%
  3367. \ifx\temp\macrocharA\Aogonek
  3368. \else\ifx\temp\macrochara\aogonek
  3369. \else\ifx\temp\macrocharE\Eogonek
  3370. \else\ifx\temp\macrochare\eogonek
  3371. \else
  3372. \ecfont \setbox0=\hbox{#1}%
  3373. \ifdim\ht0=1ex\accent"0C #1%
  3374. \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}%
  3375. \fi
  3376. \fi\fi\fi\fi
  3377. }%
  3378. }
  3379. \def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A}
  3380. \def\aogonek{{\ecfont \char"A1}}\def\macrochara{a}
  3381. \def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E}
  3382. \def\eogonek{{\ecfont \char"A6}}\def\macrochare{e}
  3383. %
  3384. % Use the European Computer Modern fonts (cm-super in outline format)
  3385. % for non-CM glyphs. That is ec* for regular text and tc* for the text
  3386. % companion symbols (LaTeX TS1 encoding). Both are part of the ec
  3387. % package and follow the same conventions.
  3388. %
  3389. \def\ecfont{\etcfont{e}}
  3390. \def\tcfont{\etcfont{t}}
  3391. %
  3392. \def\etcfont#1{%
  3393. % We can't distinguish serif/sans and italic/slanted, but this
  3394. % is used for crude hacks anyway (like adding French and German
  3395. % quotes to documents typeset with CM, where we lose kerning), so
  3396. % hopefully nobody will notice/care.
  3397. \edef\ecsize{\csname\curfontsize ecsize\endcsname}%
  3398. \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
  3399. \ifmonospace
  3400. % typewriter:
  3401. \font\thisecfont = #1ctt\ecsize \space at \nominalsize
  3402. \else
  3403. \ifx\curfontstyle\bfstylename
  3404. % bold:
  3405. \font\thisecfont = #1cb\ifusingit{i}{x}\ecsize \space at \nominalsize
  3406. \else
  3407. % regular:
  3408. \font\thisecfont = #1c\ifusingit{ti}{rm}\ecsize \space at \nominalsize
  3409. \fi
  3410. \fi
  3411. \thisecfont
  3412. }
  3413. % @registeredsymbol - R in a circle. The font for the R should really
  3414. % be smaller yet, but lllsize is the best we can do for now.
  3415. % Adapted from the plain.tex definition of \copyright.
  3416. %
  3417. \def\registeredsymbol{%
  3418. $^{{\ooalign{\hfil\raise.07ex\hbox{\switchtolllsize R}%
  3419. \hfil\crcr\Orb}}%
  3420. }$%
  3421. }
  3422. % @textdegree - the normal degrees sign.
  3423. %
  3424. \def\textdegree{$^\circ$}
  3425. % Laurent Siebenmann reports \Orb undefined with:
  3426. % Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38
  3427. % so we'll define it if necessary.
  3428. %
  3429. \ifx\Orb\thisisundefined
  3430. \def\Orb{\mathhexbox20D}
  3431. \fi
  3432. % Quotes.
  3433. \chardef\quoteleft=`\`
  3434. \chardef\quoteright=`\'
  3435. % only change font for tt for correct kerning and to avoid using
  3436. % \ecfont unless necessary.
  3437. \def\quotedblleft{%
  3438. \ifmonospace{\ecfont\char"10}\else{\char"5C}\fi
  3439. }
  3440. \def\quotedblright{%
  3441. \ifmonospace{\ecfont\char"11}\else{\char`\"}\fi
  3442. }
  3443. \message{page headings,}
  3444. \newskip\titlepagetopglue \titlepagetopglue = 1.5in
  3445. \newskip\titlepagebottomglue \titlepagebottomglue = 2pc
  3446. % First the title page. Must do @settitle before @titlepage.
  3447. \newif\ifseenauthor
  3448. \newif\iffinishedtitlepage
  3449. % @setcontentsaftertitlepage used to do an implicit @contents or
  3450. % @shortcontents after @end titlepage, but it is now obsolete.
  3451. \def\setcontentsaftertitlepage{%
  3452. \errmessage{@setcontentsaftertitlepage has been removed as a Texinfo
  3453. command; move your @contents command if you want the contents
  3454. after the title page.}}%
  3455. \def\setshortcontentsaftertitlepage{%
  3456. \errmessage{@setshortcontentsaftertitlepage has been removed as a Texinfo
  3457. command; move your @shortcontents and @contents commands if you
  3458. want the contents after the title page.}}%
  3459. \parseargdef\shorttitlepage{%
  3460. \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
  3461. \endgroup\page\hbox{}\page}
  3462. \envdef\titlepage{%
  3463. % Open one extra group, as we want to close it in the middle of \Etitlepage.
  3464. \begingroup
  3465. \parindent=0pt \textfonts
  3466. % Leave some space at the very top of the page.
  3467. \vglue\titlepagetopglue
  3468. % No rule at page bottom unless we print one at the top with @title.
  3469. \finishedtitlepagetrue
  3470. %
  3471. % Most title ``pages'' are actually two pages long, with space
  3472. % at the top of the second. We don't want the ragged left on the second.
  3473. \let\oldpage = \page
  3474. \def\page{%
  3475. \iffinishedtitlepage\else
  3476. \finishtitlepage
  3477. \fi
  3478. \let\page = \oldpage
  3479. \page
  3480. \null
  3481. }%
  3482. }
  3483. \def\Etitlepage{%
  3484. \iffinishedtitlepage\else
  3485. \finishtitlepage
  3486. \fi
  3487. % It is important to do the page break before ending the group,
  3488. % because the headline and footline are only empty inside the group.
  3489. % If we use the new definition of \page, we always get a blank page
  3490. % after the title page, which we certainly don't want.
  3491. \oldpage
  3492. \endgroup
  3493. %
  3494. % Need this before the \...aftertitlepage checks so that if they are
  3495. % in effect the toc pages will come out with page numbers.
  3496. \HEADINGSon
  3497. }
  3498. \def\finishtitlepage{%
  3499. \vskip4pt \hrule height 2pt width \hsize
  3500. \vskip\titlepagebottomglue
  3501. \finishedtitlepagetrue
  3502. }
  3503. % Settings used for typesetting titles: no hyphenation, no indentation,
  3504. % don't worry much about spacing, ragged right. This should be used
  3505. % inside a \vbox, and fonts need to be set appropriately first. \par should
  3506. % be specified before the end of the \vbox, since a vbox is a group.
  3507. %
  3508. \def\raggedtitlesettings{%
  3509. \rm
  3510. \hyphenpenalty=10000
  3511. \parindent=0pt
  3512. \tolerance=5000
  3513. \ptexraggedright
  3514. }
  3515. % Macros to be used within @titlepage:
  3516. \let\subtitlerm=\rmfont
  3517. \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
  3518. \parseargdef\title{%
  3519. \checkenv\titlepage
  3520. \vbox{\titlefonts \raggedtitlesettings #1\par}%
  3521. % print a rule at the page bottom also.
  3522. \finishedtitlepagefalse
  3523. \vskip4pt \hrule height 4pt width \hsize \vskip4pt
  3524. }
  3525. \parseargdef\subtitle{%
  3526. \checkenv\titlepage
  3527. {\subtitlefont \rightline{#1}}%
  3528. }
  3529. % @author should come last, but may come many times.
  3530. % It can also be used inside @quotation.
  3531. %
  3532. \parseargdef\author{%
  3533. \def\temp{\quotation}%
  3534. \ifx\thisenv\temp
  3535. \def\quotationauthor{#1}% printed in \Equotation.
  3536. \else
  3537. \checkenv\titlepage
  3538. \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
  3539. {\secfonts\rm \leftline{#1}}%
  3540. \fi
  3541. }
  3542. % Set up page headings and footings.
  3543. \let\thispage=\folio
  3544. \newtoks\evenheadline % headline on even pages
  3545. \newtoks\oddheadline % headline on odd pages
  3546. \newtoks\evenchapheadline% headline on even pages with a new chapter
  3547. \newtoks\oddchapheadline % headline on odd pages with a new chapter
  3548. \newtoks\evenfootline % footline on even pages
  3549. \newtoks\oddfootline % footline on odd pages
  3550. % Now make \makeheadline and \makefootline in Plain TeX use those variables
  3551. \headline={{\textfonts\rm
  3552. \ifchapterpage
  3553. \ifodd\pageno\the\oddchapheadline\else\the\evenchapheadline\fi
  3554. \else
  3555. \ifodd\pageno\the\oddheadline\else\the\evenheadline\fi
  3556. \fi}}
  3557. \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
  3558. \else \the\evenfootline \fi}\HEADINGShook}
  3559. \let\HEADINGShook=\relax
  3560. % Commands to set those variables.
  3561. % For example, this is what @headings on does
  3562. % @evenheading @thistitle|@thispage|@thischapter
  3563. % @oddheading @thischapter|@thispage|@thistitle
  3564. % @evenfooting @thisfile||
  3565. % @oddfooting ||@thisfile
  3566. \def\evenheading{\parsearg\evenheadingxxx}
  3567. \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
  3568. \def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
  3569. \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
  3570. \global\evenchapheadline=\evenheadline}
  3571. \def\oddheading{\parsearg\oddheadingxxx}
  3572. \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
  3573. \def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
  3574. \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}%
  3575. \global\oddchapheadline=\oddheadline}
  3576. \parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
  3577. \def\evenfooting{\parsearg\evenfootingxxx}
  3578. \def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}
  3579. \def\evenfootingyyy #1\|#2\|#3\|#4\finish{%
  3580. \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  3581. \def\oddfooting{\parsearg\oddfootingxxx}
  3582. \def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}
  3583. \def\oddfootingyyy #1\|#2\|#3\|#4\finish{%
  3584. \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
  3585. %
  3586. % Leave some space for the footline. Hopefully ok to assume
  3587. % @evenfooting will not be used by itself.
  3588. \global\advance\txipageheight by -12pt
  3589. \global\advance\vsize by -12pt
  3590. }
  3591. \parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
  3592. % @evenheadingmarks top \thischapter <- chapter at the top of a page
  3593. % @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page
  3594. %
  3595. % The same set of arguments for:
  3596. %
  3597. % @oddheadingmarks
  3598. % @evenfootingmarks
  3599. % @oddfootingmarks
  3600. % @everyheadingmarks
  3601. % @everyfootingmarks
  3602. % These define \getoddheadingmarks, \getevenheadingmarks,
  3603. % \getoddfootingmarks, and \getevenfootingmarks, each to one of
  3604. % \gettopheadingmarks, \getbottomheadingmarks.
  3605. %
  3606. \def\evenheadingmarks{\headingmarks{even}{heading}}
  3607. \def\oddheadingmarks{\headingmarks{odd}{heading}}
  3608. \def\evenfootingmarks{\headingmarks{even}{footing}}
  3609. \def\oddfootingmarks{\headingmarks{odd}{footing}}
  3610. \parseargdef\everyheadingmarks{\headingmarks{even}{heading}{#1}
  3611. \headingmarks{odd}{heading}{#1} }
  3612. \parseargdef\everyfootingmarks{\headingmarks{even}{footing}{#1}
  3613. \headingmarks{odd}{footing}{#1} }
  3614. % #1 = even/odd, #2 = heading/footing, #3 = top/bottom.
  3615. \def\headingmarks#1#2#3 {%
  3616. \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname
  3617. \global\expandafter\let\csname get#1#2marks\endcsname \temp
  3618. }
  3619. \everyheadingmarks bottom
  3620. \everyfootingmarks bottom
  3621. % @headings double turns headings on for double-sided printing.
  3622. % @headings single turns headings on for single-sided printing.
  3623. % @headings off turns them off.
  3624. % @headings on same as @headings double, retained for compatibility.
  3625. % @headings after turns on double-sided headings after this page.
  3626. % @headings doubleafter turns on double-sided headings after this page.
  3627. % @headings singleafter turns on single-sided headings after this page.
  3628. % By default, they are off at the start of a document,
  3629. % and turned `on' after @end titlepage.
  3630. \parseargdef\headings{\csname HEADINGS#1\endcsname}
  3631. \def\headingsoff{% non-global headings elimination
  3632. \evenheadline={\hfil}\evenfootline={\hfil}\evenchapheadline={\hfil}%
  3633. \oddheadline={\hfil}\oddfootline={\hfil}\oddchapheadline={\hfil}%
  3634. }
  3635. \def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
  3636. \HEADINGSoff % it's the default
  3637. % When we turn headings on, set the page number to 1.
  3638. \def\pageone{
  3639. \global\pageno=1
  3640. \global\arabiccount = \pagecount
  3641. }
  3642. % For double-sided printing, put current file name in lower left corner,
  3643. % chapter name on inside top of right hand pages, document
  3644. % title on inside top of left hand pages, and page numbers on outside top
  3645. % edge of all pages.
  3646. \def\HEADINGSdouble{%
  3647. \pageone
  3648. \HEADINGSdoublex
  3649. }
  3650. \let\contentsalignmacro = \chappager
  3651. % For single-sided printing, chapter title goes across top left of page,
  3652. % page number on top right.
  3653. \def\HEADINGSsingle{%
  3654. \pageone
  3655. \HEADINGSsinglex
  3656. }
  3657. \def\HEADINGSon{\HEADINGSdouble}
  3658. \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
  3659. \let\HEADINGSdoubleafter=\HEADINGSafter
  3660. \def\HEADINGSdoublex{%
  3661. \global\evenfootline={\hfil}
  3662. \global\oddfootline={\hfil}
  3663. \global\evenheadline={\line{\folio\hfil\thistitle}}
  3664. \global\oddheadline={\line{\thischapter\hfil\folio}}
  3665. \global\evenchapheadline={\line{\folio\hfil}}
  3666. \global\oddchapheadline={\line{\hfil\folio}}
  3667. \global\let\contentsalignmacro = \chapoddpage
  3668. }
  3669. \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
  3670. \def\HEADINGSsinglex{%
  3671. \global\evenfootline={\hfil}
  3672. \global\oddfootline={\hfil}
  3673. \global\evenheadline={\line{\thischapter\hfil\folio}}
  3674. \global\oddheadline={\line{\thischapter\hfil\folio}}
  3675. \global\evenchapheadline={\line{\hfil\folio}}
  3676. \global\oddchapheadline={\line{\hfil\folio}}
  3677. \global\let\contentsalignmacro = \chappager
  3678. }
  3679. % for @setchapternewpage off
  3680. \def\HEADINGSsinglechapoff{%
  3681. \pageone
  3682. \global\evenfootline={\hfil}
  3683. \global\oddfootline={\hfil}
  3684. \global\evenheadline={\line{\thischapter\hfil\folio}}
  3685. \global\oddheadline={\line{\thischapter\hfil\folio}}
  3686. \global\evenchapheadline=\evenheadline
  3687. \global\oddchapheadline=\oddheadline
  3688. \global\let\contentsalignmacro = \chappager
  3689. }
  3690. % Subroutines used in generating headings
  3691. % This produces Day Month Year style of output.
  3692. % Only define if not already defined, in case a txi-??.tex file has set
  3693. % up a different format (e.g., txi-cs.tex does this).
  3694. \ifx\today\thisisundefined
  3695. \def\today{%
  3696. \number\day\space
  3697. \ifcase\month
  3698. \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
  3699. \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
  3700. \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
  3701. \fi
  3702. \space\number\year}
  3703. \fi
  3704. % @settitle line... specifies the title of the document, for headings.
  3705. % It generates no output of its own.
  3706. \def\thistitle{\putwordNoTitle}
  3707. \def\settitle{\parsearg{\gdef\thistitle}}
  3708. \message{tables,}
  3709. % Tables -- @table, @ftable, @vtable, @item(x).
  3710. % default indentation of table text
  3711. \newdimen\tableindent \tableindent=.8in
  3712. % default indentation of @itemize and @enumerate text
  3713. \newdimen\itemindent \itemindent=.3in
  3714. % margin between end of table item and start of table text.
  3715. \newdimen\itemmargin \itemmargin=.1in
  3716. % used internally for \itemindent minus \itemmargin
  3717. \newdimen\itemmax
  3718. % Note @table, @ftable, and @vtable define @item, @itemx, etc., with
  3719. % these defs.
  3720. % They also define \itemindex
  3721. % to index the item name in whatever manner is desired (perhaps none).
  3722. \newif\ifitemxneedsnegativevskip
  3723. \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
  3724. \def\internalBitem{\smallbreak \parsearg\itemzzz}
  3725. \def\internalBitemx{\itemxpar \parsearg\itemzzz}
  3726. \def\itemzzz #1{\begingroup %
  3727. \advance\hsize by -\rightskip
  3728. \advance\hsize by -\tableindent
  3729. \setbox0=\hbox{\itemindicate{#1}}%
  3730. \itemindex{#1}%
  3731. \nobreak % This prevents a break before @itemx.
  3732. %
  3733. % If the item text does not fit in the space we have, put it on a line
  3734. % by itself, and do not allow a page break either before or after that
  3735. % line. We do not start a paragraph here because then if the next
  3736. % command is, e.g., @kindex, the whatsit would get put into the
  3737. % horizontal list on a line by itself, resulting in extra blank space.
  3738. \ifdim \wd0>\itemmax
  3739. %
  3740. % Make this a paragraph so we get the \parskip glue and wrapping,
  3741. % but leave it ragged-right.
  3742. \begingroup
  3743. \advance\leftskip by-\tableindent
  3744. \advance\hsize by\tableindent
  3745. \advance\rightskip by0pt plus1fil\relax
  3746. \leavevmode\unhbox0\par
  3747. \endgroup
  3748. %
  3749. % We're going to be starting a paragraph, but we don't want the
  3750. % \parskip glue -- logically it's part of the @item we just started.
  3751. \nobreak \vskip-\parskip
  3752. %
  3753. % Stop a page break at the \parskip glue coming up. However, if
  3754. % what follows is an environment such as @example, there will be no
  3755. % \parskip glue; then the negative vskip we just inserted would
  3756. % cause the example and the item to crash together. So we use this
  3757. % bizarre value of 10001 as a signal to \aboveenvbreak to insert
  3758. % \parskip glue after all. Section titles are handled this way also.
  3759. %
  3760. \penalty 10001
  3761. \endgroup
  3762. \itemxneedsnegativevskipfalse
  3763. \else
  3764. % The item text fits into the space. Start a paragraph, so that the
  3765. % following text (if any) will end up on the same line.
  3766. \noindent
  3767. % Do this with kerns and \unhbox so that if there is a footnote in
  3768. % the item text, it can migrate to the main vertical list and
  3769. % eventually be printed.
  3770. \nobreak\kern-\tableindent
  3771. \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
  3772. \unhbox0
  3773. \nobreak\kern\dimen0
  3774. \endgroup
  3775. \itemxneedsnegativevskiptrue
  3776. \fi
  3777. }
  3778. \def\item{\errmessage{@item while not in a list environment}}
  3779. \def\itemx{\errmessage{@itemx while not in a list environment}}
  3780. % @table, @ftable, @vtable.
  3781. \envdef\table{%
  3782. \let\itemindex\gobble
  3783. \tablecheck{table}%
  3784. }
  3785. \envdef\ftable{%
  3786. \def\itemindex ##1{\doind {fn}{\code{##1}}}%
  3787. \tablecheck{ftable}%
  3788. }
  3789. \envdef\vtable{%
  3790. \def\itemindex ##1{\doind {vr}{\code{##1}}}%
  3791. \tablecheck{vtable}%
  3792. }
  3793. \def\tablecheck#1{%
  3794. \ifnum \the\catcode`\^^M=\active
  3795. \endgroup
  3796. \errmessage{This command won't work in this context; perhaps the problem is
  3797. that we are \inenvironment\thisenv}%
  3798. \def\next{\doignore{#1}}%
  3799. \else
  3800. \let\next\tablex
  3801. \fi
  3802. \next
  3803. }
  3804. \def\tablex#1{%
  3805. \def\itemindicate{#1}%
  3806. \parsearg\tabley
  3807. }
  3808. \def\tabley#1{%
  3809. {%
  3810. \makevalueexpandable
  3811. \edef\temp{\noexpand\tablez #1\space\space\space}%
  3812. \expandafter
  3813. }\temp \endtablez
  3814. }
  3815. \def\tablez #1 #2 #3 #4\endtablez{%
  3816. \aboveenvbreak
  3817. \ifnum 0#1>0 \advance \leftskip by #1\mil \fi
  3818. \ifnum 0#2>0 \tableindent=#2\mil \fi
  3819. \ifnum 0#3>0 \advance \rightskip by #3\mil \fi
  3820. \itemmax=\tableindent
  3821. \advance \itemmax by -\itemmargin
  3822. \advance \leftskip by \tableindent
  3823. \exdentamount=\tableindent
  3824. \parindent = 0pt
  3825. \parskip = \smallskipamount
  3826. \ifdim \parskip=0pt \parskip=2pt \fi
  3827. \let\item = \internalBitem
  3828. \let\itemx = \internalBitemx
  3829. }
  3830. \def\Etable{\endgraf\afterenvbreak}
  3831. \let\Eftable\Etable
  3832. \let\Evtable\Etable
  3833. \let\Eitemize\Etable
  3834. \let\Eenumerate\Etable
  3835. % This is the counter used by @enumerate, which is really @itemize
  3836. \newcount \itemno
  3837. \envdef\itemize{\parsearg\doitemize}
  3838. \def\doitemize#1{%
  3839. \aboveenvbreak
  3840. \itemmax=\itemindent
  3841. \advance\itemmax by -\itemmargin
  3842. \advance\leftskip by \itemindent
  3843. \exdentamount=\itemindent
  3844. \parindent=0pt
  3845. \parskip=\smallskipamount
  3846. \ifdim\parskip=0pt \parskip=2pt \fi
  3847. %
  3848. % Try typesetting the item mark so that if the document erroneously says
  3849. % something like @itemize @samp (intending @table), there's an error
  3850. % right away at the @itemize. It's not the best error message in the
  3851. % world, but it's better than leaving it to the @item. This means if
  3852. % the user wants an empty mark, they have to say @w{} not just @w.
  3853. \def\itemcontents{#1}%
  3854. \setbox0 = \hbox{\itemcontents}%
  3855. %
  3856. % @itemize with no arg is equivalent to @itemize @bullet.
  3857. \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
  3858. %
  3859. \let\item=\itemizeitem
  3860. }
  3861. % Definition of @item while inside @itemize and @enumerate.
  3862. %
  3863. \def\itemizeitem{%
  3864. \advance\itemno by 1 % for enumerations
  3865. {\let\par=\endgraf \smallbreak}% reasonable place to break
  3866. {%
  3867. % If the document has an @itemize directly after a section title, a
  3868. % \nobreak will be last on the list, and \sectionheading will have
  3869. % done a \vskip-\parskip. In that case, we don't want to zero
  3870. % parskip, or the item text will crash with the heading. On the
  3871. % other hand, when there is normal text preceding the item (as there
  3872. % usually is), we do want to zero parskip, or there would be too much
  3873. % space. In that case, we won't have a \nobreak before. At least
  3874. % that's the theory.
  3875. \ifnum\lastpenalty<10000 \parskip=0in \fi
  3876. \noindent
  3877. \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
  3878. %
  3879. \ifinner\else
  3880. \vadjust{\penalty 1200}% not good to break after first line of item.
  3881. \fi
  3882. % We can be in inner vertical mode in a footnote, although an
  3883. % @itemize looks awful there.
  3884. }%
  3885. \flushcr
  3886. }
  3887. % \splitoff TOKENS\endmark defines \first to be the first token in
  3888. % TOKENS, and \rest to be the remainder.
  3889. %
  3890. \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
  3891. % Allow an optional argument of an uppercase letter, lowercase letter,
  3892. % or number, to specify the first label in the enumerated list. No
  3893. % argument is the same as `1'.
  3894. %
  3895. \envparseargdef\enumerate{\enumeratey #1 \endenumeratey}
  3896. \def\enumeratey #1 #2\endenumeratey{%
  3897. % If we were given no argument, pretend we were given `1'.
  3898. \def\thearg{#1}%
  3899. \ifx\thearg\empty \def\thearg{1}\fi
  3900. %
  3901. % Detect if the argument is a single token. If so, it might be a
  3902. % letter. Otherwise, the only valid thing it can be is a number.
  3903. % (We will always have one token, because of the test we just made.
  3904. % This is a good thing, since \splitoff doesn't work given nothing at
  3905. % all -- the first parameter is undelimited.)
  3906. \expandafter\splitoff\thearg\endmark
  3907. \ifx\rest\empty
  3908. % Only one token in the argument. It could still be anything.
  3909. % A ``lowercase letter'' is one whose \lccode is nonzero.
  3910. % An ``uppercase letter'' is one whose \lccode is both nonzero, and
  3911. % not equal to itself.
  3912. % Otherwise, we assume it's a number.
  3913. %
  3914. % We need the \relax at the end of the \ifnum lines to stop TeX from
  3915. % continuing to look for a <number>.
  3916. %
  3917. \ifnum\lccode\expandafter`\thearg=0\relax
  3918. \numericenumerate % a number (we hope)
  3919. \else
  3920. % It's a letter.
  3921. \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
  3922. \lowercaseenumerate % lowercase letter
  3923. \else
  3924. \uppercaseenumerate % uppercase letter
  3925. \fi
  3926. \fi
  3927. \else
  3928. % Multiple tokens in the argument. We hope it's a number.
  3929. \numericenumerate
  3930. \fi
  3931. }
  3932. % An @enumerate whose labels are integers. The starting integer is
  3933. % given in \thearg.
  3934. %
  3935. \def\numericenumerate{%
  3936. \itemno = \thearg
  3937. \startenumeration{\the\itemno}%
  3938. }
  3939. % The starting (lowercase) letter is in \thearg.
  3940. \def\lowercaseenumerate{%
  3941. \itemno = \expandafter`\thearg
  3942. \startenumeration{%
  3943. % Be sure we're not beyond the end of the alphabet.
  3944. \ifnum\itemno=0
  3945. \errmessage{No more lowercase letters in @enumerate; get a bigger
  3946. alphabet}%
  3947. \fi
  3948. \char\lccode\itemno
  3949. }%
  3950. }
  3951. % The starting (uppercase) letter is in \thearg.
  3952. \def\uppercaseenumerate{%
  3953. \itemno = \expandafter`\thearg
  3954. \startenumeration{%
  3955. % Be sure we're not beyond the end of the alphabet.
  3956. \ifnum\itemno=0
  3957. \errmessage{No more uppercase letters in @enumerate; get a bigger
  3958. alphabet}
  3959. \fi
  3960. \char\uccode\itemno
  3961. }%
  3962. }
  3963. % Call \doitemize, adding a period to the first argument and supplying the
  3964. % common last two arguments. Also subtract one from the initial value in
  3965. % \itemno, since @item increments \itemno.
  3966. %
  3967. \def\startenumeration#1{%
  3968. \advance\itemno by -1
  3969. \doitemize{#1.}\flushcr
  3970. }
  3971. % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
  3972. % to @enumerate.
  3973. %
  3974. \def\alphaenumerate{\enumerate{a}}
  3975. \def\capsenumerate{\enumerate{A}}
  3976. \def\Ealphaenumerate{\Eenumerate}
  3977. \def\Ecapsenumerate{\Eenumerate}
  3978. % @multitable macros
  3979. % Amy Hendrickson, 8/18/94, 3/6/96
  3980. %
  3981. % @multitable ... @end multitable will make as many columns as desired.
  3982. % Contents of each column will wrap at width given in preamble. Width
  3983. % can be specified either with sample text given in a template line,
  3984. % or in percent of \hsize, the current width of text on page.
  3985. % Table can continue over pages but will only break between lines.
  3986. % To make preamble:
  3987. %
  3988. % Either define widths of columns in terms of percent of \hsize:
  3989. % @multitable @columnfractions .25 .3 .45
  3990. % @item ...
  3991. %
  3992. % Numbers following @columnfractions are the percent of the total
  3993. % current hsize to be used for each column. You may use as many
  3994. % columns as desired.
  3995. % Or use a template:
  3996. % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
  3997. % @item ...
  3998. % using the widest term desired in each column.
  3999. % Each new table line starts with @item, each subsequent new column
  4000. % starts with @tab. Empty columns may be produced by supplying @tab's
  4001. % with nothing between them for as many times as empty columns are needed,
  4002. % ie, @tab@tab@tab will produce two empty columns.
  4003. % @item, @tab do not need to be on their own lines, but it will not hurt
  4004. % if they are.
  4005. % Sample multitable:
  4006. % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
  4007. % @item first col stuff @tab second col stuff @tab third col
  4008. % @item
  4009. % first col stuff
  4010. % @tab
  4011. % second col stuff
  4012. % @tab
  4013. % third col
  4014. % @item first col stuff @tab second col stuff
  4015. % @tab Many paragraphs of text may be used in any column.
  4016. %
  4017. % They will wrap at the width determined by the template.
  4018. % @item@tab@tab This will be in third column.
  4019. % @end multitable
  4020. % Default dimensions may be reset by user.
  4021. % @multitableparskip is vertical space between paragraphs in table.
  4022. % @multitableparindent is paragraph indent in table.
  4023. % @multitablecolmargin is horizontal space to be left between columns.
  4024. % @multitablelinespace is space to leave between table items, baseline
  4025. % to baseline.
  4026. % 0pt means it depends on current normal line spacing.
  4027. %
  4028. \newskip\multitableparskip
  4029. \newskip\multitableparindent
  4030. \newdimen\multitablecolspace
  4031. \newskip\multitablelinespace
  4032. \multitableparskip=0pt
  4033. \multitableparindent=6pt
  4034. \multitablecolspace=12pt
  4035. \multitablelinespace=0pt
  4036. % Macros used to set up halign preamble:
  4037. %
  4038. \let\endsetuptable\relax
  4039. \def\xendsetuptable{\endsetuptable}
  4040. \let\columnfractions\relax
  4041. \def\xcolumnfractions{\columnfractions}
  4042. \newif\ifsetpercent
  4043. % #1 is the @columnfraction, usually a decimal number like .5, but might
  4044. % be just 1. We just use it, whatever it is.
  4045. %
  4046. \def\pickupwholefraction#1 {%
  4047. \global\advance\colcount by 1
  4048. \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}%
  4049. \setuptable
  4050. }
  4051. \newcount\colcount
  4052. \def\setuptable#1{%
  4053. \def\firstarg{#1}%
  4054. \ifx\firstarg\xendsetuptable
  4055. \let\go = \relax
  4056. \else
  4057. \ifx\firstarg\xcolumnfractions
  4058. \global\setpercenttrue
  4059. \else
  4060. \ifsetpercent
  4061. \let\go\pickupwholefraction
  4062. \else
  4063. \global\advance\colcount by 1
  4064. \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
  4065. % separator; typically that is always in the input, anyway.
  4066. \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
  4067. \fi
  4068. \fi
  4069. \ifx\go\pickupwholefraction
  4070. % Put the argument back for the \pickupwholefraction call, so
  4071. % we'll always have a period there to be parsed.
  4072. \def\go{\pickupwholefraction#1}%
  4073. \else
  4074. \let\go = \setuptable
  4075. \fi%
  4076. \fi
  4077. \go
  4078. }
  4079. % multitable-only commands.
  4080. %
  4081. % @headitem starts a heading row, which we typeset in bold. Assignments
  4082. % have to be global since we are inside the implicit group of an
  4083. % alignment entry. \everycr below resets \everytab so we don't have to
  4084. % undo it ourselves.
  4085. \def\headitemfont{\b}% for people to use in the template row; not changeable
  4086. \def\headitem{%
  4087. \checkenv\multitable
  4088. \crcr
  4089. \gdef\headitemcrhook{\nobreak}% attempt to avoid page break after headings
  4090. \global\everytab={\bf}% can't use \headitemfont since the parsing differs
  4091. \the\everytab % for the first item
  4092. }%
  4093. %
  4094. % default for tables with no headings.
  4095. \let\headitemcrhook=\relax
  4096. %
  4097. % A \tab used to include \hskip1sp. But then the space in a template
  4098. % line is not enough. That is bad. So let's go back to just `&' until
  4099. % we again encounter the problem the 1sp was intended to solve.
  4100. % --karl, nathan@acm.org, 20apr99.
  4101. \def\tab{\checkenv\multitable &\the\everytab}%
  4102. % @multitable ... @end multitable definitions:
  4103. %
  4104. \newtoks\everytab % insert after every tab.
  4105. %
  4106. \envdef\multitable{%
  4107. \vskip\parskip
  4108. \startsavinginserts
  4109. %
  4110. % @item within a multitable starts a normal row.
  4111. % We use \def instead of \let so that if one of the multitable entries
  4112. % contains an @itemize, we don't choke on the \item (seen as \crcr aka
  4113. % \endtemplate) expanding \doitemize.
  4114. \def\item{\crcr}%
  4115. %
  4116. \tolerance=9500
  4117. \hbadness=9500
  4118. \setmultitablespacing
  4119. \parskip=\multitableparskip
  4120. \parindent=\multitableparindent
  4121. \overfullrule=0pt
  4122. \global\colcount=0
  4123. %
  4124. \everycr = {%
  4125. \noalign{%
  4126. \global\everytab={}% Reset from possible headitem.
  4127. \global\colcount=0 % Reset the column counter.
  4128. %
  4129. % Check for saved footnotes, etc.:
  4130. \checkinserts
  4131. %
  4132. % Perhaps a \nobreak, then reset:
  4133. \headitemcrhook
  4134. \global\let\headitemcrhook=\relax
  4135. }%
  4136. }%
  4137. %
  4138. \parsearg\domultitable
  4139. }
  4140. \def\domultitable#1{%
  4141. % To parse everything between @multitable and @item:
  4142. \setuptable#1 \endsetuptable
  4143. %
  4144. % This preamble sets up a generic column definition, which will
  4145. % be used as many times as user calls for columns.
  4146. % \vtop will set a single line and will also let text wrap and
  4147. % continue for many paragraphs if desired.
  4148. \halign\bgroup &%
  4149. \global\advance\colcount by 1
  4150. \multistrut
  4151. \vtop{%
  4152. % Use the current \colcount to find the correct column width:
  4153. \hsize=\expandafter\csname col\the\colcount\endcsname
  4154. %
  4155. % In order to keep entries from bumping into each other
  4156. % we will add a \leftskip of \multitablecolspace to all columns after
  4157. % the first one.
  4158. %
  4159. % If a template has been used, we will add \multitablecolspace
  4160. % to the width of each template entry.
  4161. %
  4162. % If the user has set preamble in terms of percent of \hsize we will
  4163. % use that dimension as the width of the column, and the \leftskip
  4164. % will keep entries from bumping into each other. Table will start at
  4165. % left margin and final column will justify at right margin.
  4166. %
  4167. % Make sure we don't inherit \rightskip from the outer environment.
  4168. \rightskip=0pt
  4169. \ifnum\colcount=1
  4170. % The first column will be indented with the surrounding text.
  4171. \advance\hsize by\leftskip
  4172. \else
  4173. \ifsetpercent \else
  4174. % If user has not set preamble in terms of percent of \hsize
  4175. % we will advance \hsize by \multitablecolspace.
  4176. \advance\hsize by \multitablecolspace
  4177. \fi
  4178. % In either case we will make \leftskip=\multitablecolspace:
  4179. \leftskip=\multitablecolspace
  4180. \fi
  4181. % Ignoring space at the beginning and end avoids an occasional spurious
  4182. % blank line, when TeX decides to break the line at the space before the
  4183. % box from the multistrut, so the strut ends up on a line by itself.
  4184. % For example:
  4185. % @multitable @columnfractions .11 .89
  4186. % @item @code{#}
  4187. % @tab Legal holiday which is valid in major parts of the whole country.
  4188. % Is automatically provided with highlighting sequences respectively
  4189. % marking characters.
  4190. \noindent\ignorespaces##\unskip\multistrut
  4191. }\cr
  4192. }
  4193. \def\Emultitable{%
  4194. \crcr
  4195. \egroup % end the \halign
  4196. \global\setpercentfalse
  4197. }
  4198. \def\setmultitablespacing{%
  4199. \def\multistrut{\strut}% just use the standard line spacing
  4200. %
  4201. % Compute \multitablelinespace (if not defined by user) for use in
  4202. % \multitableparskip calculation. We used define \multistrut based on
  4203. % this, but (ironically) that caused the spacing to be off.
  4204. % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100.
  4205. \ifdim\multitablelinespace=0pt
  4206. \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
  4207. \global\advance\multitablelinespace by-\ht0
  4208. \fi
  4209. % Test to see if parskip is larger than space between lines of
  4210. % table. If not, do nothing.
  4211. % If so, set to same dimension as multitablelinespace.
  4212. \ifdim\multitableparskip>\multitablelinespace
  4213. \global\multitableparskip=\multitablelinespace
  4214. \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
  4215. % than skip between lines in the table.
  4216. \fi%
  4217. \ifdim\multitableparskip=0pt
  4218. \global\multitableparskip=\multitablelinespace
  4219. \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
  4220. % than skip between lines in the table.
  4221. \fi}
  4222. \message{conditionals,}
  4223. % @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext,
  4224. % @ifnotxml always succeed. They currently do nothing; we don't
  4225. % attempt to check whether the conditionals are properly nested. But we
  4226. % have to remember that they are conditionals, so that @end doesn't
  4227. % attempt to close an environment group.
  4228. %
  4229. \def\makecond#1{%
  4230. \expandafter\let\csname #1\endcsname = \relax
  4231. \expandafter\let\csname iscond.#1\endcsname = 1
  4232. }
  4233. \makecond{iftex}
  4234. \makecond{ifnotdocbook}
  4235. \makecond{ifnothtml}
  4236. \makecond{ifnotinfo}
  4237. \makecond{ifnotplaintext}
  4238. \makecond{ifnotxml}
  4239. % Ignore @ignore, @ifhtml, @ifinfo, and the like.
  4240. %
  4241. \def\direntry{\doignore{direntry}}
  4242. \def\documentdescription{\doignore{documentdescription}}
  4243. \def\docbook{\doignore{docbook}}
  4244. \def\html{\doignore{html}}
  4245. \def\ifdocbook{\doignore{ifdocbook}}
  4246. \def\ifhtml{\doignore{ifhtml}}
  4247. \def\ifinfo{\doignore{ifinfo}}
  4248. \def\ifnottex{\doignore{ifnottex}}
  4249. \def\ifplaintext{\doignore{ifplaintext}}
  4250. \def\ifxml{\doignore{ifxml}}
  4251. \def\ignore{\doignore{ignore}}
  4252. \def\menu{\doignore{menu}}
  4253. \def\xml{\doignore{xml}}
  4254. % Ignore text until a line `@end #1', keeping track of nested conditionals.
  4255. %
  4256. % A count to remember the depth of nesting.
  4257. \newcount\doignorecount
  4258. \def\doignore#1{\begingroup
  4259. % Scan in ``verbatim'' mode:
  4260. \obeylines
  4261. \catcode`\@ = \other
  4262. \catcode`\{ = \other
  4263. \catcode`\} = \other
  4264. %
  4265. % Make sure that spaces turn into tokens that match what \doignoretext wants.
  4266. \spaceisspace
  4267. %
  4268. % Count number of #1's that we've seen.
  4269. \doignorecount = 0
  4270. %
  4271. % Swallow text until we reach the matching `@end #1'.
  4272. \dodoignore{#1}%
  4273. }
  4274. { \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source.
  4275. \obeylines %
  4276. %
  4277. \gdef\dodoignore#1{%
  4278. % #1 contains the command name as a string, e.g., `ifinfo'.
  4279. %
  4280. % Define a command to find the next `@end #1'.
  4281. \long\def\doignoretext##1^^M@end #1{%
  4282. \doignoretextyyy##1^^M@#1\_STOP_}%
  4283. %
  4284. % And this command to find another #1 command, at the beginning of a
  4285. % line. (Otherwise, we would consider a line `@c @ifset', for
  4286. % example, to count as an @ifset for nesting.)
  4287. \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%
  4288. %
  4289. % And now expand that command.
  4290. \doignoretext ^^M%
  4291. }%
  4292. }
  4293. \def\doignoreyyy#1{%
  4294. \def\temp{#1}%
  4295. \ifx\temp\empty % Nothing found.
  4296. \let\next\doignoretextzzz
  4297. \else % Found a nested condition, ...
  4298. \advance\doignorecount by 1
  4299. \let\next\doignoretextyyy % ..., look for another.
  4300. % If we're here, #1 ends with ^^M\ifinfo (for example).
  4301. \fi
  4302. \next #1% the token \_STOP_ is present just after this macro.
  4303. }
  4304. % We have to swallow the remaining "\_STOP_".
  4305. %
  4306. \def\doignoretextzzz#1{%
  4307. \ifnum\doignorecount = 0 % We have just found the outermost @end.
  4308. \let\next\enddoignore
  4309. \else % Still inside a nested condition.
  4310. \advance\doignorecount by -1
  4311. \let\next\doignoretext % Look for the next @end.
  4312. \fi
  4313. \next
  4314. }
  4315. % Finish off ignored text.
  4316. { \obeylines%
  4317. % Ignore anything after the last `@end #1'; this matters in verbatim
  4318. % environments, where otherwise the newline after an ignored conditional
  4319. % would result in a blank line in the output.
  4320. \gdef\enddoignore#1^^M{\endgroup\ignorespaces}%
  4321. }
  4322. % @set VAR sets the variable VAR to an empty value.
  4323. % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
  4324. %
  4325. % Since we want to separate VAR from REST-OF-LINE (which might be
  4326. % empty), we can't just use \parsearg; we have to insert a space of our
  4327. % own to delimit the rest of the line, and then take it out again if we
  4328. % didn't need it.
  4329. % We rely on the fact that \parsearg sets \catcode`\ =10.
  4330. %
  4331. \parseargdef\set{\setyyy#1 \endsetyyy}
  4332. \def\setyyy#1 #2\endsetyyy{%
  4333. {%
  4334. \makevalueexpandable
  4335. \def\temp{#2}%
  4336. \edef\next{\gdef\makecsname{SET#1}}%
  4337. \ifx\temp\empty
  4338. \next{}%
  4339. \else
  4340. \setzzz#2\endsetzzz
  4341. \fi
  4342. }%
  4343. }
  4344. % Remove the trailing space \setxxx inserted.
  4345. \def\setzzz#1 \endsetzzz{\next{#1}}
  4346. % @clear VAR clears (i.e., unsets) the variable VAR.
  4347. %
  4348. \parseargdef\clear{%
  4349. {%
  4350. \makevalueexpandable
  4351. \global\expandafter\let\csname SET#1\endcsname=\relax
  4352. }%
  4353. }
  4354. % @value{foo} gets the text saved in variable foo.
  4355. \def\value{\begingroup\makevalueexpandable\valuexxx}
  4356. \def\valuexxx#1{\expandablevalue{#1}\endgroup}
  4357. {
  4358. \catcode`\-=\active \catcode`\_=\active
  4359. %
  4360. \gdef\makevalueexpandable{%
  4361. \let\value = \expandablevalue
  4362. % We don't want these characters active, ...
  4363. \catcode`\-=\other \catcode`\_=\other
  4364. % ..., but we might end up with active ones in the argument if
  4365. % we're called from @code, as @code{@value{foo-bar_}}, though.
  4366. % So \let them to their normal equivalents.
  4367. \let-\normaldash \let_\normalunderscore
  4368. }
  4369. }
  4370. \def\expandablevalue#1{%
  4371. \expandafter\ifx\csname SET#1\endcsname\relax
  4372. {[No value for ``#1'']}%
  4373. \message{Variable `#1', used in @value, is not set.}%
  4374. \else
  4375. \csname SET#1\endcsname
  4376. \fi
  4377. }
  4378. % Like \expandablevalue, but completely expandable (the \message in the
  4379. % definition above operates at the execution level of TeX). Used when
  4380. % writing to auxiliary files, due to the expansion that \write does.
  4381. % If flag is undefined, pass through an unexpanded @value command: maybe it
  4382. % will be set by the time it is read back in.
  4383. %
  4384. % NB flag names containing - or _ may not work here.
  4385. \def\dummyvalue#1{%
  4386. \expandafter\ifx\csname SET#1\endcsname\relax
  4387. \string\value{#1}%
  4388. \else
  4389. \csname SET#1\endcsname
  4390. \fi
  4391. }
  4392. % Used for @value's in index entries to form the sort key: expand the @value
  4393. % if possible, otherwise sort late.
  4394. \def\indexnofontsvalue#1{%
  4395. \expandafter\ifx\csname SET#1\endcsname\relax
  4396. ZZZZZZZ%
  4397. \else
  4398. \csname SET#1\endcsname
  4399. \fi
  4400. }
  4401. % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
  4402. % with @set.
  4403. %
  4404. % To get the special treatment we need for `@end ifset,' we call
  4405. % \makecond and then redefine.
  4406. %
  4407. \makecond{ifset}
  4408. \def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}
  4409. \def\doifset#1#2{%
  4410. {%
  4411. \makevalueexpandable
  4412. \let\next=\empty
  4413. \expandafter\ifx\csname SET#2\endcsname\relax
  4414. #1% If not set, redefine \next.
  4415. \fi
  4416. \expandafter
  4417. }\next
  4418. }
  4419. \def\ifsetfail{\doignore{ifset}}
  4420. % @ifclear VAR ... @end executes the `...' iff VAR has never been
  4421. % defined with @set, or has been undefined with @clear.
  4422. %
  4423. % The `\else' inside the `\doifset' parameter is a trick to reuse the
  4424. % above code: if the variable is not set, do nothing, if it is set,
  4425. % then redefine \next to \ifclearfail.
  4426. %
  4427. \makecond{ifclear}
  4428. \def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
  4429. \def\ifclearfail{\doignore{ifclear}}
  4430. % @ifcommandisdefined CMD ... @end executes the `...' if CMD (written
  4431. % without the @) is in fact defined. We can only feasibly check at the
  4432. % TeX level, so something like `mathcode' is going to considered
  4433. % defined even though it is not a Texinfo command.
  4434. %
  4435. \makecond{ifcommanddefined}
  4436. \def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}}
  4437. %
  4438. \def\doifcmddefined#1#2{{%
  4439. \makevalueexpandable
  4440. \let\next=\empty
  4441. \expandafter\ifx\csname #2\endcsname\relax
  4442. #1% If not defined, \let\next as above.
  4443. \fi
  4444. \expandafter
  4445. }\next
  4446. }
  4447. \def\ifcmddefinedfail{\doignore{ifcommanddefined}}
  4448. % @ifcommandnotdefined CMD ... handled similar to @ifclear above.
  4449. \makecond{ifcommandnotdefined}
  4450. \def\ifcommandnotdefined{%
  4451. \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}}
  4452. \def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}}
  4453. % Set the `txicommandconditionals' variable, so documents have a way to
  4454. % test if the @ifcommand...defined conditionals are available.
  4455. \set txicommandconditionals
  4456. % @dircategory CATEGORY -- specify a category of the dir file
  4457. % which this file should belong to. Ignore this in TeX.
  4458. \let\dircategory=\comment
  4459. % @defininfoenclose.
  4460. \let\definfoenclose=\comment
  4461. \message{indexing,}
  4462. % Index generation facilities
  4463. % Define \newwrite to be identical to plain tex's \newwrite
  4464. % except not \outer, so it can be used within macros and \if's.
  4465. \edef\newwrite{\makecsname{ptexnewwrite}}
  4466. % \newindex {foo} defines an index named IX.
  4467. % It automatically defines \IXindex such that
  4468. % \IXindex ...rest of line... puts an entry in the index IX.
  4469. % It also defines \IXindfile to be the number of the output channel for
  4470. % the file that accumulates this index. The file's extension is IX.
  4471. % The name of an index should be no more than 2 characters long
  4472. % for the sake of vms.
  4473. %
  4474. \def\newindex#1{%
  4475. \expandafter\chardef\csname#1indfile\endcsname=0
  4476. \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
  4477. \noexpand\doindex{#1}}
  4478. }
  4479. % @defindex foo == \newindex{foo}
  4480. %
  4481. \def\defindex{\parsearg\newindex}
  4482. % Define @defcodeindex, like @defindex except put all entries in @code.
  4483. %
  4484. \def\defcodeindex{\parsearg\newcodeindex}
  4485. %
  4486. \def\newcodeindex#1{%
  4487. \expandafter\chardef\csname#1indfile\endcsname=0
  4488. \expandafter\xdef\csname#1index\endcsname{%
  4489. \noexpand\docodeindex{#1}}%
  4490. }
  4491. % The default indices:
  4492. \newindex{cp}% concepts,
  4493. \newcodeindex{fn}% functions,
  4494. \newcodeindex{vr}% variables,
  4495. \newcodeindex{tp}% types,
  4496. \newcodeindex{ky}% keys
  4497. \newcodeindex{pg}% and programs.
  4498. % @synindex foo bar makes index foo feed into index bar.
  4499. % Do this instead of @defindex foo if you don't want it as a separate index.
  4500. %
  4501. % @syncodeindex foo bar similar, but put all entries made for index foo
  4502. % inside @code.
  4503. %
  4504. \def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
  4505. \def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
  4506. % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
  4507. % #3 the target index (bar).
  4508. \def\dosynindex#1#2#3{%
  4509. \requireopenindexfile{#3}%
  4510. % redefine \fooindfile:
  4511. \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
  4512. \expandafter\let\csname#2indfile\endcsname=\temp
  4513. % redefine \fooindex:
  4514. \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
  4515. }
  4516. % Define \doindex, the driver for all index macros.
  4517. % Argument #1 is generated by the calling \fooindex macro,
  4518. % and it is the two-letter name of the index.
  4519. \def\doindex#1{\edef\indexname{#1}\parsearg\doindexxxx}
  4520. \def\doindexxxx #1{\doind{\indexname}{#1}}
  4521. % like the previous two, but they put @code around the argument.
  4522. \def\docodeindex#1{\edef\indexname{#1}\parsearg\docodeindexxxx}
  4523. \def\docodeindexxxx #1{\docind{\indexname}{#1}}
  4524. % Used for the aux, toc and index files to prevent expansion of Texinfo
  4525. % commands.
  4526. %
  4527. \def\atdummies{%
  4528. \definedummyletter\@%
  4529. \definedummyletter\ %
  4530. \definedummyletter\{%
  4531. \definedummyletter\}%
  4532. \definedummyletter\&%
  4533. %
  4534. % Do the redefinitions.
  4535. \definedummies
  4536. \otherbackslash
  4537. }
  4538. % \definedummyword defines \#1 as \string\#1\space, thus effectively
  4539. % preventing its expansion. This is used only for control words,
  4540. % not control letters, because the \space would be incorrect for
  4541. % control characters, but is needed to separate the control word
  4542. % from whatever follows.
  4543. %
  4544. % These can be used both for control words that take an argument and
  4545. % those that do not. If it is followed by {arg} in the input, then
  4546. % that will dutifully get written to the index (or wherever).
  4547. %
  4548. % For control letters, we have \definedummyletter, which omits the
  4549. % space.
  4550. %
  4551. \def\definedummyword #1{\def#1{\string#1\space}}%
  4552. \def\definedummyletter#1{\def#1{\string#1}}%
  4553. \let\definedummyaccent\definedummyletter
  4554. % Called from \atdummies to prevent the expansion of commands.
  4555. %
  4556. \def\definedummies{%
  4557. %
  4558. \let\commondummyword\definedummyword
  4559. \let\commondummyletter\definedummyletter
  4560. \let\commondummyaccent\definedummyaccent
  4561. \commondummiesnofonts
  4562. %
  4563. \definedummyletter\_%
  4564. \definedummyletter\-%
  4565. %
  4566. % Non-English letters.
  4567. \definedummyword\AA
  4568. \definedummyword\AE
  4569. \definedummyword\DH
  4570. \definedummyword\L
  4571. \definedummyword\O
  4572. \definedummyword\OE
  4573. \definedummyword\TH
  4574. \definedummyword\aa
  4575. \definedummyword\ae
  4576. \definedummyword\dh
  4577. \definedummyword\exclamdown
  4578. \definedummyword\l
  4579. \definedummyword\o
  4580. \definedummyword\oe
  4581. \definedummyword\ordf
  4582. \definedummyword\ordm
  4583. \definedummyword\questiondown
  4584. \definedummyword\ss
  4585. \definedummyword\th
  4586. %
  4587. % Although these internal commands shouldn't show up, sometimes they do.
  4588. \definedummyword\bf
  4589. \definedummyword\gtr
  4590. \definedummyword\hat
  4591. \definedummyword\less
  4592. \definedummyword\sf
  4593. \definedummyword\sl
  4594. \definedummyword\tclose
  4595. \definedummyword\tt
  4596. %
  4597. \definedummyword\LaTeX
  4598. \definedummyword\TeX
  4599. %
  4600. % Assorted special characters.
  4601. \definedummyword\ampchar
  4602. \definedummyword\atchar
  4603. \definedummyword\arrow
  4604. \definedummyword\backslashchar
  4605. \definedummyword\bullet
  4606. \definedummyword\comma
  4607. \definedummyword\copyright
  4608. \definedummyword\registeredsymbol
  4609. \definedummyword\dots
  4610. \definedummyword\enddots
  4611. \definedummyword\entrybreak
  4612. \definedummyword\equiv
  4613. \definedummyword\error
  4614. \definedummyword\euro
  4615. \definedummyword\expansion
  4616. \definedummyword\geq
  4617. \definedummyword\guillemetleft
  4618. \definedummyword\guillemetright
  4619. \definedummyword\guilsinglleft
  4620. \definedummyword\guilsinglright
  4621. \definedummyword\lbracechar
  4622. \definedummyword\leq
  4623. \definedummyword\mathopsup
  4624. \definedummyword\minus
  4625. \definedummyword\ogonek
  4626. \definedummyword\pounds
  4627. \definedummyword\point
  4628. \definedummyword\print
  4629. \definedummyword\quotedblbase
  4630. \definedummyword\quotedblleft
  4631. \definedummyword\quotedblright
  4632. \definedummyword\quoteleft
  4633. \definedummyword\quoteright
  4634. \definedummyword\quotesinglbase
  4635. \definedummyword\rbracechar
  4636. \definedummyword\result
  4637. \definedummyword\sub
  4638. \definedummyword\sup
  4639. \definedummyword\textdegree
  4640. %
  4641. \definedummyword\subentry
  4642. %
  4643. % We want to disable all macros so that they are not expanded by \write.
  4644. \macrolist
  4645. \let\value\dummyvalue
  4646. %
  4647. \normalturnoffactive
  4648. }
  4649. % \commondummiesnofonts: common to \definedummies and \indexnofonts.
  4650. % Define \commondummyletter, \commondummyaccent and \commondummyword before
  4651. % using. Used for accents, font commands, and various control letters.
  4652. %
  4653. \def\commondummiesnofonts{%
  4654. % Control letters and accents.
  4655. \commondummyletter\!%
  4656. \commondummyaccent\"%
  4657. \commondummyaccent\'%
  4658. \commondummyletter\*%
  4659. \commondummyaccent\,%
  4660. \commondummyletter\.%
  4661. \commondummyletter\/%
  4662. \commondummyletter\:%
  4663. \commondummyaccent\=%
  4664. \commondummyletter\?%
  4665. \commondummyaccent\^%
  4666. \commondummyaccent\`%
  4667. \commondummyaccent\~%
  4668. \commondummyword\u
  4669. \commondummyword\v
  4670. \commondummyword\H
  4671. \commondummyword\dotaccent
  4672. \commondummyword\ogonek
  4673. \commondummyword\ringaccent
  4674. \commondummyword\tieaccent
  4675. \commondummyword\ubaraccent
  4676. \commondummyword\udotaccent
  4677. \commondummyword\dotless
  4678. %
  4679. % Texinfo font commands.
  4680. \commondummyword\b
  4681. \commondummyword\i
  4682. \commondummyword\r
  4683. \commondummyword\sansserif
  4684. \commondummyword\sc
  4685. \commondummyword\slanted
  4686. \commondummyword\t
  4687. %
  4688. % Commands that take arguments.
  4689. \commondummyword\abbr
  4690. \commondummyword\acronym
  4691. \commondummyword\anchor
  4692. \commondummyword\cite
  4693. \commondummyword\code
  4694. \commondummyword\command
  4695. \commondummyword\dfn
  4696. \commondummyword\dmn
  4697. \commondummyword\email
  4698. \commondummyword\emph
  4699. \commondummyword\env
  4700. \commondummyword\file
  4701. \commondummyword\image
  4702. \commondummyword\indicateurl
  4703. \commondummyword\inforef
  4704. \commondummyword\kbd
  4705. \commondummyword\key
  4706. \commondummyword\math
  4707. \commondummyword\option
  4708. \commondummyword\pxref
  4709. \commondummyword\ref
  4710. \commondummyword\samp
  4711. \commondummyword\strong
  4712. \commondummyword\tie
  4713. \commondummyword\U
  4714. \commondummyword\uref
  4715. \commondummyword\url
  4716. \commondummyword\var
  4717. \commondummyword\verb
  4718. \commondummyword\w
  4719. \commondummyword\xref
  4720. }
  4721. \let\indexlbrace\relax
  4722. \let\indexrbrace\relax
  4723. \let\indexatchar\relax
  4724. \let\indexbackslash\relax
  4725. {\catcode`\@=0
  4726. \catcode`\\=13
  4727. @gdef@backslashdisappear{@def\{}}
  4728. }
  4729. {
  4730. \catcode`\<=13
  4731. \catcode`\-=13
  4732. \catcode`\`=13
  4733. \gdef\indexnonalnumdisappear{%
  4734. \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax\else
  4735. % @set txiindexlquoteignore makes us ignore left quotes in the sort term.
  4736. % (Introduced for FSFS 2nd ed.)
  4737. \let`=\empty
  4738. \fi
  4739. %
  4740. \expandafter\ifx\csname SETtxiindexbackslashignore\endcsname\relax\else
  4741. \backslashdisappear
  4742. \fi
  4743. %
  4744. \expandafter\ifx\csname SETtxiindexhyphenignore\endcsname\relax\else
  4745. \def-{}%
  4746. \fi
  4747. \expandafter\ifx\csname SETtxiindexlessthanignore\endcsname\relax\else
  4748. \def<{}%
  4749. \fi
  4750. \expandafter\ifx\csname SETtxiindexatsignignore\endcsname\relax\else
  4751. \def\@{}%
  4752. \fi
  4753. }
  4754. \gdef\indexnonalnumreappear{%
  4755. \let-\normaldash
  4756. \let<\normalless
  4757. }
  4758. }
  4759. % \indexnofonts is used when outputting the strings to sort the index
  4760. % by, and when constructing control sequence names. It eliminates all
  4761. % control sequences and just writes whatever the best ASCII sort string
  4762. % would be for a given command (usually its argument).
  4763. %
  4764. \def\indexnofonts{%
  4765. % Accent commands should become @asis.
  4766. \def\commondummyaccent##1{\let##1\asis}%
  4767. % We can just ignore other control letters.
  4768. \def\commondummyletter##1{\let##1\empty}%
  4769. % All control words become @asis by default; overrides below.
  4770. \let\commondummyword\commondummyaccent
  4771. \commondummiesnofonts
  4772. %
  4773. % Don't no-op \tt, since it isn't a user-level command
  4774. % and is used in the definitions of the active chars like <, >, |, etc.
  4775. % Likewise with the other plain tex font commands.
  4776. %\let\tt=\asis
  4777. %
  4778. \def\ { }%
  4779. \def\@{@}%
  4780. \def\_{\normalunderscore}%
  4781. \def\-{}% @- shouldn't affect sorting
  4782. %
  4783. \uccode`\1=`\{ \uppercase{\def\{{1}}%
  4784. \uccode`\1=`\} \uppercase{\def\}{1}}%
  4785. \let\lbracechar\{%
  4786. \let\rbracechar\}%
  4787. %
  4788. %
  4789. \let\do\indexnofontsdef
  4790. %
  4791. % Non-English letters.
  4792. \do\AA{AA}%
  4793. \do\AE{AE}%
  4794. \do\DH{DZZ}%
  4795. \do\L{L}%
  4796. \do\OE{OE}%
  4797. \do\O{O}%
  4798. \do\TH{TH}%
  4799. \do\aa{aa}%
  4800. \do\ae{ae}%
  4801. \do\dh{dzz}%
  4802. \do\exclamdown{!}%
  4803. \do\l{l}%
  4804. \do\oe{oe}%
  4805. \do\ordf{a}%
  4806. \do\ordm{o}%
  4807. \do\o{o}%
  4808. \do\questiondown{?}%
  4809. \do\ss{ss}%
  4810. \do\th{th}%
  4811. %
  4812. \do\LaTeX{LaTeX}%
  4813. \do\TeX{TeX}%
  4814. %
  4815. % Assorted special characters.
  4816. \do\atchar{@}%
  4817. \do\arrow{->}%
  4818. \do\bullet{bullet}%
  4819. \do\comma{,}%
  4820. \do\copyright{copyright}%
  4821. \do\dots{...}%
  4822. \do\enddots{...}%
  4823. \do\equiv{==}%
  4824. \do\error{error}%
  4825. \do\euro{euro}%
  4826. \do\expansion{==>}%
  4827. \do\geq{>=}%
  4828. \do\guillemetleft{<<}%
  4829. \do\guillemetright{>>}%
  4830. \do\guilsinglleft{<}%
  4831. \do\guilsinglright{>}%
  4832. \do\leq{<=}%
  4833. \do\lbracechar{\{}%
  4834. \do\minus{-}%
  4835. \do\point{.}%
  4836. \do\pounds{pounds}%
  4837. \do\print{-|}%
  4838. \do\quotedblbase{"}%
  4839. \do\quotedblleft{"}%
  4840. \do\quotedblright{"}%
  4841. \do\quoteleft{`}%
  4842. \do\quoteright{'}%
  4843. \do\quotesinglbase{,}%
  4844. \do\rbracechar{\}}%
  4845. \do\registeredsymbol{R}%
  4846. \do\result{=>}%
  4847. \do\textdegree{o}%
  4848. %
  4849. % We need to get rid of all macros, leaving only the arguments (if present).
  4850. % Of course this is not nearly correct, but it is the best we can do for now.
  4851. % makeinfo does not expand macros in the argument to @deffn, which ends up
  4852. % writing an index entry, and texindex isn't prepared for an index sort entry
  4853. % that starts with \.
  4854. %
  4855. % Since macro invocations are followed by braces, we can just redefine them
  4856. % to take a single TeX argument. The case of a macro invocation that
  4857. % goes to end-of-line is not handled.
  4858. %
  4859. \macrolist
  4860. \let\value\indexnofontsvalue
  4861. }
  4862. % Give the control sequence a definition that removes the {} that follows
  4863. % its use, e.g. @AA{} -> AA
  4864. \def\indexnofontsdef#1#2{\def#1##1{#2}}%
  4865. % #1 is the index name, #2 is the entry text.
  4866. \def\doind#1#2{%
  4867. \iflinks
  4868. {%
  4869. %
  4870. \requireopenindexfile{#1}%
  4871. \edef\writeto{\csname#1indfile\endcsname}%
  4872. %
  4873. \def\indextext{#2}%
  4874. \safewhatsit\doindwrite
  4875. }%
  4876. \fi
  4877. }
  4878. % Same as \doind, but for code indices
  4879. \def\docind#1#2{%
  4880. \iflinks
  4881. {%
  4882. %
  4883. \requireopenindexfile{#1}%
  4884. \edef\writeto{\csname#1indfile\endcsname}%
  4885. %
  4886. \def\indextext{#2}%
  4887. \safewhatsit\docindwrite
  4888. }%
  4889. \fi
  4890. }
  4891. % Check if an index file has been opened, and if not, open it.
  4892. \def\requireopenindexfile#1{%
  4893. \ifnum\csname #1indfile\endcsname=0
  4894. \expandafter\newwrite \csname#1indfile\endcsname
  4895. \edef\suffix{#1}%
  4896. % A .fls suffix would conflict with the file extension for the output
  4897. % of -recorder, so use .f1s instead.
  4898. \ifx\suffix\indexisfl\def\suffix{f1}\fi
  4899. % Open the file
  4900. \immediate\openout\csname#1indfile\endcsname \jobname.\suffix
  4901. % Using \immediate above here prevents an object entering into the current
  4902. % box, which could confound checks such as those in \safewhatsit for
  4903. % preceding skips.
  4904. \typeout{Writing index file \jobname.\suffix}%
  4905. \fi}
  4906. \def\indexisfl{fl}
  4907. % Definition for writing index entry sort key.
  4908. {
  4909. \catcode`\-=13
  4910. \gdef\indexwritesortas{%
  4911. \begingroup
  4912. \indexnonalnumreappear
  4913. \indexwritesortasxxx}
  4914. \gdef\indexwritesortasxxx#1{%
  4915. \xdef\indexsortkey{#1}\endgroup}
  4916. }
  4917. \def\indexwriteseealso#1{
  4918. \gdef\pagenumbertext{\string\seealso{#1}}%
  4919. }
  4920. \def\indexwriteseeentry#1{
  4921. \gdef\pagenumbertext{\string\seeentry{#1}}%
  4922. }
  4923. % The default definitions
  4924. \def\sortas#1{}%
  4925. \def\seealso#1{\i{\putwordSeeAlso}\ #1}% for sorted index file only
  4926. \def\putwordSeeAlso{See also}
  4927. \def\seeentry#1{\i{\putwordSee}\ #1}% for sorted index file only
  4928. % Given index entry text like "aaa @subentry bbb @sortas{ZZZ}":
  4929. % * Set \bracedtext to "{aaa}{bbb}"
  4930. % * Set \fullindexsortkey to "aaa @subentry ZZZ"
  4931. % * If @seealso occurs, set \pagenumbertext
  4932. %
  4933. \def\splitindexentry#1{%
  4934. \gdef\fullindexsortkey{}%
  4935. \xdef\bracedtext{}%
  4936. \def\sep{}%
  4937. \def\seealso##1{}%
  4938. \def\seeentry##1{}%
  4939. \expandafter\doindexsegment#1\subentry\finish\subentry
  4940. }
  4941. % append the results from the next segment
  4942. \def\doindexsegment#1\subentry{%
  4943. \def\segment{#1}%
  4944. \ifx\segment\isfinish
  4945. \else
  4946. %
  4947. % Fully expand the segment, throwing away any @sortas directives, and
  4948. % trim spaces.
  4949. \edef\trimmed{\segment}%
  4950. \edef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}%
  4951. \ifincodeindex
  4952. \edef\trimmed{\noexpand\code{\trimmed}}%
  4953. \fi
  4954. %
  4955. \xdef\bracedtext{\bracedtext{\trimmed}}%
  4956. %
  4957. % Get the string to sort by. Process the segment with all
  4958. % font commands turned off.
  4959. \bgroup
  4960. \let\sortas\indexwritesortas
  4961. \let\seealso\indexwriteseealso
  4962. \let\seeentry\indexwriteseeentry
  4963. \indexnofonts
  4964. % The braces around the commands are recognized by texindex.
  4965. \def\lbracechar{{\string\indexlbrace}}%
  4966. \def\rbracechar{{\string\indexrbrace}}%
  4967. \let\{=\lbracechar
  4968. \let\}=\rbracechar
  4969. \def\@{{\string\indexatchar}}%
  4970. \def\atchar##1{\@}%
  4971. \def\backslashchar{{\string\indexbackslash}}%
  4972. \uccode`\~=`\\ \uppercase{\let~\backslashchar}%
  4973. %
  4974. \let\indexsortkey\empty
  4975. \global\let\pagenumbertext\empty
  4976. % Execute the segment and throw away the typeset output. This executes
  4977. % any @sortas or @seealso commands in this segment.
  4978. \setbox\dummybox = \hbox{\segment}%
  4979. \ifx\indexsortkey\empty{%
  4980. \indexnonalnumdisappear
  4981. \xdef\trimmed{\segment}%
  4982. \xdef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}%
  4983. \xdef\indexsortkey{\trimmed}%
  4984. \ifx\indexsortkey\empty\xdef\indexsortkey{ }\fi
  4985. }\fi
  4986. %
  4987. % Append to \fullindexsortkey.
  4988. \edef\tmp{\gdef\noexpand\fullindexsortkey{%
  4989. \fullindexsortkey\sep\indexsortkey}}%
  4990. \tmp
  4991. \egroup
  4992. \def\sep{\subentry}%
  4993. %
  4994. \expandafter\doindexsegment
  4995. \fi
  4996. }
  4997. \def\isfinish{\finish}%
  4998. \newbox\dummybox % used above
  4999. \let\subentry\relax
  5000. % Use \ instead of @ in index files. To support old texi2dvi and texindex.
  5001. % This works without changing the escape character used in the toc or aux
  5002. % files because the index entries are fully expanded here, and \string uses
  5003. % the current value of \escapechar.
  5004. \def\escapeisbackslash{\escapechar=`\\}
  5005. % Use \ in index files by default. texi2dvi didn't support @ as the escape
  5006. % character (as it checked for "\entry" in the files, and not "@entry"). When
  5007. % the new version of texi2dvi has had a chance to become more prevalent, then
  5008. % the escape character can change back to @ again. This should be an easy
  5009. % change to make now because both @ and \ are only used as escape characters in
  5010. % index files, never standing for themselves.
  5011. %
  5012. \set txiindexescapeisbackslash
  5013. % Write the entry in \indextext to the index file.
  5014. %
  5015. \newif\ifincodeindex
  5016. \def\doindwrite{\incodeindexfalse\doindwritex}
  5017. \def\docindwrite{\incodeindextrue\doindwritex}
  5018. \def\doindwritex{%
  5019. \maybemarginindex
  5020. %
  5021. \atdummies
  5022. %
  5023. \expandafter\ifx\csname SETtxiindexescapeisbackslash\endcsname\relax\else
  5024. \escapeisbackslash
  5025. \fi
  5026. %
  5027. % For texindex which always views { and } as separators.
  5028. \def\{{\lbracechar{}}%
  5029. \def\}{\rbracechar{}}%
  5030. \uccode`\~=`\\ \uppercase{\def~{\backslashchar{}}}%
  5031. %
  5032. % Split the entry into primary entry and any subentries, and get the index
  5033. % sort key.
  5034. \splitindexentry\indextext
  5035. %
  5036. % Set up the complete index entry, with both the sort key and
  5037. % the original text, including any font commands. We write
  5038. % three arguments to \entry to the .?? file (four in the
  5039. % subentry case), texindex reduces to two when writing the .??s
  5040. % sorted result.
  5041. %
  5042. \edef\temp{%
  5043. \write\writeto{%
  5044. \string\entry{\fullindexsortkey}%
  5045. {\ifx\pagenumbertext\empty\noexpand\folio\else\pagenumbertext\fi}%
  5046. \bracedtext}%
  5047. }%
  5048. \temp
  5049. }
  5050. % Put the index entry in the margin if desired (undocumented).
  5051. \def\maybemarginindex{%
  5052. \ifx\SETmarginindex\relax\else
  5053. \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \relax\indextext}}%
  5054. \fi
  5055. }
  5056. \let\SETmarginindex=\relax
  5057. % Take care of unwanted page breaks/skips around a whatsit:
  5058. %
  5059. % If a skip is the last thing on the list now, preserve it
  5060. % by backing up by \lastskip, doing the \write, then inserting
  5061. % the skip again. Otherwise, the whatsit generated by the
  5062. % \write or \pdfdest will make \lastskip zero. The result is that
  5063. % sequences like this:
  5064. % @end defun
  5065. % @tindex whatever
  5066. % @defun ...
  5067. % will have extra space inserted, because the \medbreak in the
  5068. % start of the @defun won't see the skip inserted by the @end of
  5069. % the previous defun.
  5070. %
  5071. % But don't do any of this if we're not in vertical mode. We
  5072. % don't want to do a \vskip and prematurely end a paragraph.
  5073. %
  5074. % Avoid page breaks due to these extra skips, too.
  5075. %
  5076. % But wait, there is a catch there:
  5077. % We'll have to check whether \lastskip is zero skip. \ifdim is not
  5078. % sufficient for this purpose, as it ignores stretch and shrink parts
  5079. % of the skip. The only way seems to be to check the textual
  5080. % representation of the skip.
  5081. %
  5082. % The following is almost like \def\zeroskipmacro{0.0pt} except that
  5083. % the ``p'' and ``t'' characters have catcode \other, not 11 (letter).
  5084. %
  5085. \edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname}
  5086. %
  5087. \newskip\whatsitskip
  5088. \newcount\whatsitpenalty
  5089. %
  5090. % ..., ready, GO:
  5091. %
  5092. \def\safewhatsit#1{\ifhmode
  5093. #1%
  5094. \else
  5095. % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
  5096. \whatsitskip = \lastskip
  5097. \edef\lastskipmacro{\the\lastskip}%
  5098. \whatsitpenalty = \lastpenalty
  5099. %
  5100. % If \lastskip is nonzero, that means the last item was a
  5101. % skip. And since a skip is discardable, that means this
  5102. % -\whatsitskip glue we're inserting is preceded by a
  5103. % non-discardable item, therefore it is not a potential
  5104. % breakpoint, therefore no \nobreak needed.
  5105. \ifx\lastskipmacro\zeroskipmacro
  5106. \else
  5107. \vskip-\whatsitskip
  5108. \fi
  5109. %
  5110. #1%
  5111. %
  5112. \ifx\lastskipmacro\zeroskipmacro
  5113. % If \lastskip was zero, perhaps the last item was a penalty, and
  5114. % perhaps it was >=10000, e.g., a \nobreak. In that case, we want
  5115. % to re-insert the same penalty (values >10000 are used for various
  5116. % signals); since we just inserted a non-discardable item, any
  5117. % following glue (such as a \parskip) would be a breakpoint. For example:
  5118. % @deffn deffn-whatever
  5119. % @vindex index-whatever
  5120. % Description.
  5121. % would allow a break between the index-whatever whatsit
  5122. % and the "Description." paragraph.
  5123. \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi
  5124. \else
  5125. % On the other hand, if we had a nonzero \lastskip,
  5126. % this make-up glue would be preceded by a non-discardable item
  5127. % (the whatsit from the \write), so we must insert a \nobreak.
  5128. \nobreak\vskip\whatsitskip
  5129. \fi
  5130. \fi}
  5131. % The index entry written in the file actually looks like
  5132. % \entry {sortstring}{page}{topic}
  5133. % or
  5134. % \entry {sortstring}{page}{topic}{subtopic}
  5135. % The texindex program reads in these files and writes files
  5136. % containing these kinds of lines:
  5137. % \initial {c}
  5138. % before the first topic whose initial is c
  5139. % \entry {topic}{pagelist}
  5140. % for a topic that is used without subtopics
  5141. % \primary {topic}
  5142. % \entry {topic}{}
  5143. % for the beginning of a topic that is used with subtopics
  5144. % \secondary {subtopic}{pagelist}
  5145. % for each subtopic.
  5146. % \secondary {subtopic}{}
  5147. % for a subtopic with sub-subtopics
  5148. % \tertiary {subtopic}{subsubtopic}{pagelist}
  5149. % for each sub-subtopic.
  5150. % Define the user-accessible indexing commands
  5151. % @findex, @vindex, @kindex, @cindex.
  5152. \def\findex {\fnindex}
  5153. \def\kindex {\kyindex}
  5154. \def\cindex {\cpindex}
  5155. \def\vindex {\vrindex}
  5156. \def\tindex {\tpindex}
  5157. \def\pindex {\pgindex}
  5158. % Define the macros used in formatting output of the sorted index material.
  5159. % @printindex causes a particular index (the ??s file) to get printed.
  5160. % It does not print any chapter heading (usually an @unnumbered).
  5161. %
  5162. \parseargdef\printindex{\begingroup
  5163. \dobreak \chapheadingskip{10000}%
  5164. %
  5165. \smallfonts \rm
  5166. \tolerance = 9500
  5167. \plainfrenchspacing
  5168. \everypar = {}% don't want the \kern\-parindent from indentation suppression.
  5169. %
  5170. % See comment in \requireopenindexfile.
  5171. \def\indexname{#1}\ifx\indexname\indexisfl\def\indexname{f1}\fi
  5172. %
  5173. % See if the index file exists and is nonempty.
  5174. \openin 1 \jobname.\indexname s
  5175. \ifeof 1
  5176. % \enddoublecolumns gets confused if there is no text in the index,
  5177. % and it loses the chapter title and the aux file entries for the
  5178. % index. The easiest way to prevent this problem is to make sure
  5179. % there is some text.
  5180. \putwordIndexNonexistent
  5181. \typeout{No file \jobname.\indexname s.}%
  5182. \else
  5183. % If the index file exists but is empty, then \openin leaves \ifeof
  5184. % false. We have to make TeX try to read something from the file, so
  5185. % it can discover if there is anything in it.
  5186. \read 1 to \thisline
  5187. \ifeof 1
  5188. \putwordIndexIsEmpty
  5189. \else
  5190. \expandafter\printindexzz\thisline\relax\relax\finish%
  5191. \fi
  5192. \fi
  5193. \closein 1
  5194. \endgroup}
  5195. % If the index file starts with a backslash, forgo reading the index
  5196. % file altogether. If somebody upgrades texinfo.tex they may still have
  5197. % old index files using \ as the escape character. Reading this would
  5198. % at best lead to typesetting garbage, at worst a TeX syntax error.
  5199. \def\printindexzz#1#2\finish{%
  5200. \expandafter\ifx\csname SETtxiindexescapeisbackslash\endcsname\relax
  5201. \uccode`\~=`\\ \uppercase{\if\noexpand~}\noexpand#1
  5202. \expandafter\ifx\csname SETtxiskipindexfileswithbackslash\endcsname\relax
  5203. \errmessage{%
  5204. ERROR: A sorted index file in an obsolete format was skipped.
  5205. To fix this problem, please upgrade your version of 'texi2dvi'
  5206. or 'texi2pdf' to that at <https://ftp.gnu.org/gnu/texinfo>.
  5207. If you are using an old version of 'texindex' (part of the Texinfo
  5208. distribution), you may also need to upgrade to a newer version (at least 6.0).
  5209. You may be able to typeset the index if you run
  5210. 'texindex \jobname.\indexname' yourself.
  5211. You could also try setting the 'txiindexescapeisbackslash' flag by
  5212. running a command like
  5213. 'texi2dvi -t "@set txiindexescapeisbackslash" \jobname.texi'. If you do
  5214. this, Texinfo will try to use index files in the old format.
  5215. If you continue to have problems, deleting the index files and starting again
  5216. might help (with 'rm \jobname.?? \jobname.??s')%
  5217. }%
  5218. \else
  5219. (Skipped sorted index file in obsolete format)
  5220. \fi
  5221. \else
  5222. \begindoublecolumns
  5223. \input \jobname.\indexname s
  5224. \enddoublecolumns
  5225. \fi
  5226. \else
  5227. \begindoublecolumns
  5228. \catcode`\\=0\relax
  5229. %
  5230. % Make @ an escape character to give macros a chance to work. This
  5231. % should work because we (hopefully) don't otherwise use @ in index files.
  5232. %\catcode`\@=12\relax
  5233. \catcode`\@=0\relax
  5234. \input \jobname.\indexname s
  5235. \enddoublecolumns
  5236. \fi
  5237. }
  5238. % These macros are used by the sorted index file itself.
  5239. % Change them to control the appearance of the index.
  5240. {\catcode`\/=13 \catcode`\-=13 \catcode`\^=13 \catcode`\~=13 \catcode`\_=13
  5241. \catcode`\|=13 \catcode`\<=13 \catcode`\>=13 \catcode`\+=13 \catcode`\"=13
  5242. \catcode`\$=3
  5243. \gdef\initialglyphs{%
  5244. % special control sequences used in the index sort key
  5245. \let\indexlbrace\{%
  5246. \let\indexrbrace\}%
  5247. \let\indexatchar\@%
  5248. \def\indexbackslash{\math{\backslash}}%
  5249. %
  5250. % Some changes for non-alphabetic characters. Using the glyphs from the
  5251. % math fonts looks more consistent than the typewriter font used elsewhere
  5252. % for these characters.
  5253. \uccode`\~=`\\ \uppercase{\def~{\math{\backslash}}}
  5254. %
  5255. % In case @\ is used for backslash
  5256. \uppercase{\let\\=~}
  5257. % Can't get bold backslash so don't use bold forward slash
  5258. \catcode`\/=13
  5259. \def/{{\secrmnotbold \normalslash}}%
  5260. \def-{{\normaldash\normaldash}}% en dash `--'
  5261. \def^{{\chapbf \normalcaret}}%
  5262. \def~{{\chapbf \normaltilde}}%
  5263. \def\_{%
  5264. \leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }%
  5265. \def|{$\vert$}%
  5266. \def<{$\less$}%
  5267. \def>{$\gtr$}%
  5268. \def+{$\normalplus$}%
  5269. }}
  5270. \def\initial{%
  5271. \bgroup
  5272. \initialglyphs
  5273. \initialx
  5274. }
  5275. \def\initialx#1{%
  5276. % Remove any glue we may have, we'll be inserting our own.
  5277. \removelastskip
  5278. %
  5279. % We like breaks before the index initials, so insert a bonus.
  5280. % The glue before the bonus allows a little bit of space at the
  5281. % bottom of a column to reduce an increase in inter-line spacing.
  5282. \nobreak
  5283. \vskip 0pt plus 5\baselineskip
  5284. \penalty -300
  5285. \vskip 0pt plus -5\baselineskip
  5286. %
  5287. % Typeset the initial. Making this add up to a whole number of
  5288. % baselineskips increases the chance of the dots lining up from column
  5289. % to column. It still won't often be perfect, because of the stretch
  5290. % we need before each entry, but it's better.
  5291. %
  5292. % No shrink because it confuses \balancecolumns.
  5293. \vskip 1.67\baselineskip plus 1\baselineskip
  5294. \leftline{\secfonts \kern-0.05em \secbf #1}%
  5295. % \secfonts is inside the argument of \leftline so that the change of
  5296. % \baselineskip will not affect any glue inserted before the vbox that
  5297. % \leftline creates.
  5298. % Do our best not to break after the initial.
  5299. \nobreak
  5300. \vskip .33\baselineskip plus .1\baselineskip
  5301. \egroup % \initialglyphs
  5302. }
  5303. \newdimen\entryrightmargin
  5304. \entryrightmargin=0pt
  5305. % \entry typesets a paragraph consisting of the text (#1), dot leaders, and
  5306. % then page number (#2) flushed to the right margin. It is used for index
  5307. % and table of contents entries. The paragraph is indented by \leftskip.
  5308. %
  5309. \def\entry{%
  5310. \begingroup
  5311. %
  5312. % Start a new paragraph if necessary, so our assignments below can't
  5313. % affect previous text.
  5314. \par
  5315. %
  5316. % No extra space above this paragraph.
  5317. \parskip = 0in
  5318. %
  5319. % When reading the text of entry, convert explicit line breaks
  5320. % from @* into spaces. The user might give these in long section
  5321. % titles, for instance.
  5322. \def\*{\unskip\space\ignorespaces}%
  5323. \def\entrybreak{\hfil\break}% An undocumented command
  5324. %
  5325. % Swallow the left brace of the text (first parameter):
  5326. \afterassignment\doentry
  5327. \let\temp =
  5328. }
  5329. \def\entrybreak{\unskip\space\ignorespaces}%
  5330. \def\doentry{%
  5331. % Save the text of the entry
  5332. \global\setbox\boxA=\hbox\bgroup
  5333. \bgroup % Instead of the swallowed brace.
  5334. \noindent
  5335. \aftergroup\finishentry
  5336. % And now comes the text of the entry.
  5337. % Not absorbing as a macro argument reduces the chance of problems
  5338. % with catcodes occurring.
  5339. }
  5340. {\catcode`\@=11
  5341. \gdef\finishentry#1{%
  5342. \egroup % end box A
  5343. \dimen@ = \wd\boxA % Length of text of entry
  5344. \global\setbox\boxA=\hbox\bgroup
  5345. \unhbox\boxA
  5346. % #1 is the page number.
  5347. %
  5348. % Get the width of the page numbers, and only use
  5349. % leaders if they are present.
  5350. \global\setbox\boxB = \hbox{#1}%
  5351. \ifdim\wd\boxB = 0pt
  5352. \null\nobreak\hfill\ %
  5353. \else
  5354. %
  5355. \null\nobreak\indexdotfill % Have leaders before the page number.
  5356. %
  5357. \ifpdforxetex
  5358. \pdfgettoks#1.%
  5359. \hskip\skip\thinshrinkable\the\toksA
  5360. \else
  5361. \hskip\skip\thinshrinkable #1%
  5362. \fi
  5363. \fi
  5364. \egroup % end \boxA
  5365. \ifdim\wd\boxB = 0pt
  5366. \noindent\unhbox\boxA\par
  5367. \nobreak
  5368. \else\bgroup
  5369. % We want the text of the entries to be aligned to the left, and the
  5370. % page numbers to be aligned to the right.
  5371. %
  5372. \parindent = 0pt
  5373. \advance\leftskip by 0pt plus 1fil
  5374. \advance\leftskip by 0pt plus -1fill
  5375. \rightskip = 0pt plus -1fil
  5376. \advance\rightskip by 0pt plus 1fill
  5377. % Cause last line, which could consist of page numbers on their own
  5378. % if the list of page numbers is long, to be aligned to the right.
  5379. \parfillskip=0pt plus -1fill
  5380. %
  5381. \advance\rightskip by \entryrightmargin
  5382. % Determine how far we can stretch into the margin.
  5383. % This allows, e.g., "Appendix H GNU Free Documentation License" to
  5384. % fit on one line in @letterpaper format.
  5385. \ifdim\entryrightmargin>2.1em
  5386. \dimen@i=2.1em
  5387. \else
  5388. \dimen@i=0em
  5389. \fi
  5390. \advance \parfillskip by 0pt minus 1\dimen@i
  5391. %
  5392. \dimen@ii = \hsize
  5393. \advance\dimen@ii by -1\leftskip
  5394. \advance\dimen@ii by -1\entryrightmargin
  5395. \advance\dimen@ii by 1\dimen@i
  5396. \ifdim\wd\boxA > \dimen@ii % If the entry doesn't fit in one line
  5397. \ifdim\dimen@ > 0.8\dimen@ii % due to long index text
  5398. % Try to split the text roughly evenly. \dimen@ will be the length of
  5399. % the first line.
  5400. \dimen@ = 0.7\dimen@
  5401. \dimen@ii = \hsize
  5402. \ifnum\dimen@>\dimen@ii
  5403. % If the entry is too long (for example, if it needs more than
  5404. % two lines), use all the space in the first line.
  5405. \dimen@ = \dimen@ii
  5406. \fi
  5407. \advance\leftskip by 0pt plus 1fill % ragged right
  5408. \advance \dimen@ by 1\rightskip
  5409. \parshape = 2 0pt \dimen@ 0em \dimen@ii
  5410. % Ideally we'd add a finite glue at the end of the first line only,
  5411. % instead of using \parshape with explicit line lengths, but TeX
  5412. % doesn't seem to provide a way to do such a thing.
  5413. %
  5414. % Indent all lines but the first one.
  5415. \advance\leftskip by 1em
  5416. \advance\parindent by -1em
  5417. \fi\fi
  5418. \indent % start paragraph
  5419. \unhbox\boxA
  5420. %
  5421. % Do not prefer a separate line ending with a hyphen to fewer lines.
  5422. \finalhyphendemerits = 0
  5423. %
  5424. % Word spacing - no stretch
  5425. \spaceskip=\fontdimen2\font minus \fontdimen4\font
  5426. %
  5427. \linepenalty=1000 % Discourage line breaks.
  5428. \hyphenpenalty=5000 % Discourage hyphenation.
  5429. %
  5430. \par % format the paragraph
  5431. \egroup % The \vbox
  5432. \fi
  5433. \endgroup
  5434. }}
  5435. \newskip\thinshrinkable
  5436. \skip\thinshrinkable=.15em minus .15em
  5437. % Like plain.tex's \dotfill, except uses up at least 1 em.
  5438. % The filll stretch here overpowers both the fil and fill stretch to push
  5439. % the page number to the right.
  5440. \def\indexdotfill{\cleaders
  5441. \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1filll}
  5442. \def\primary #1{\line{#1\hfil}}
  5443. \def\secondary{\indententry{0.5cm}}
  5444. \def\tertiary{\indententry{1cm}}
  5445. \def\indententry#1#2#3{%
  5446. \bgroup
  5447. \leftskip=#1
  5448. \entry{#2}{#3}%
  5449. \egroup
  5450. }
  5451. % Define two-column mode, which we use to typeset indexes.
  5452. % Adapted from the TeXbook, page 416, which is to say,
  5453. % the manmac.tex format used to print the TeXbook itself.
  5454. \catcode`\@=11 % private names
  5455. \newbox\partialpage
  5456. \newdimen\doublecolumnhsize
  5457. \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
  5458. % If not much space left on page, start a new page.
  5459. \ifdim\pagetotal>0.8\vsize\vfill\eject\fi
  5460. %
  5461. % Grab any single-column material above us.
  5462. \output = {%
  5463. \savetopmark
  5464. %
  5465. \global\setbox\partialpage = \vbox{%
  5466. % Unvbox the main output page.
  5467. \unvbox\PAGE
  5468. \kern-\topskip \kern\baselineskip
  5469. }%
  5470. }%
  5471. \eject % run that output routine to set \partialpage
  5472. %
  5473. % Use the double-column output routine for subsequent pages.
  5474. \output = {\doublecolumnout}%
  5475. %
  5476. % Change the page size parameters. We could do this once outside this
  5477. % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
  5478. % format, but then we repeat the same computation. Repeating a couple
  5479. % of assignments once per index is clearly meaningless for the
  5480. % execution time, so we may as well do it in one place.
  5481. %
  5482. % First we halve the line length, less a little for the gutter between
  5483. % the columns. We compute the gutter based on the line length, so it
  5484. % changes automatically with the paper format. The magic constant
  5485. % below is chosen so that the gutter has the same value (well, +-<1pt)
  5486. % as it did when we hard-coded it.
  5487. %
  5488. % We put the result in a separate register, \doublecolumhsize, so we
  5489. % can restore it in \pagesofar, after \hsize itself has (potentially)
  5490. % been clobbered.
  5491. %
  5492. \doublecolumnhsize = \hsize
  5493. \advance\doublecolumnhsize by -.04154\hsize
  5494. \divide\doublecolumnhsize by 2
  5495. \hsize = \doublecolumnhsize
  5496. %
  5497. % Get the available space for the double columns -- the normal
  5498. % (undoubled) page height minus any material left over from the
  5499. % previous page.
  5500. \advance\vsize by -\ht\partialpage
  5501. \vsize = 2\vsize
  5502. %
  5503. % For the benefit of balancing columns
  5504. \advance\baselineskip by 0pt plus 0.5pt
  5505. }
  5506. % The double-column output routine for all double-column pages except
  5507. % the last, which is done by \balancecolumns.
  5508. %
  5509. \def\doublecolumnout{%
  5510. %
  5511. \savetopmark
  5512. \splittopskip=\topskip \splitmaxdepth=\maxdepth
  5513. \dimen@ = \vsize
  5514. \divide\dimen@ by 2
  5515. %
  5516. % box0 will be the left-hand column, box2 the right.
  5517. \setbox0=\vsplit\PAGE to\dimen@ \setbox2=\vsplit\PAGE to\dimen@
  5518. \global\advance\vsize by 2\ht\partialpage
  5519. \onepageout\pagesofar % empty except for the first time we are called
  5520. \unvbox\PAGE
  5521. \penalty\outputpenalty
  5522. }
  5523. %
  5524. % Re-output the contents of the output page -- any previous material,
  5525. % followed by the two boxes we just split, in box0 and box2.
  5526. \def\pagesofar{%
  5527. \unvbox\partialpage
  5528. %
  5529. \hsize = \doublecolumnhsize
  5530. \wd0=\hsize \wd2=\hsize
  5531. \hbox to\txipagewidth{\box0\hfil\box2}%
  5532. }
  5533. % Finished with double columns.
  5534. \def\enddoublecolumns{%
  5535. % The following penalty ensures that the page builder is exercised
  5536. % _before_ we change the output routine. This is necessary in the
  5537. % following situation:
  5538. %
  5539. % The last section of the index consists only of a single entry.
  5540. % Before this section, \pagetotal is less than \pagegoal, so no
  5541. % break occurs before the last section starts. However, the last
  5542. % section, consisting of \initial and the single \entry, does not
  5543. % fit on the page and has to be broken off. Without the following
  5544. % penalty the page builder will not be exercised until \eject
  5545. % below, and by that time we'll already have changed the output
  5546. % routine to the \balancecolumns version, so the next-to-last
  5547. % double-column page will be processed with \balancecolumns, which
  5548. % is wrong: The two columns will go to the main vertical list, with
  5549. % the broken-off section in the recent contributions. As soon as
  5550. % the output routine finishes, TeX starts reconsidering the page
  5551. % break. The two columns and the broken-off section both fit on the
  5552. % page, because the two columns now take up only half of the page
  5553. % goal. When TeX sees \eject from below which follows the final
  5554. % section, it invokes the new output routine that we've set after
  5555. % \balancecolumns below; \onepageout will try to fit the two columns
  5556. % and the final section into the vbox of \txipageheight (see
  5557. % \pagebody), causing an overfull box.
  5558. %
  5559. % Note that glue won't work here, because glue does not exercise the
  5560. % page builder, unlike penalties (see The TeXbook, pp. 280-281).
  5561. \penalty0
  5562. %
  5563. \output = {%
  5564. % Split the last of the double-column material.
  5565. \savetopmark
  5566. \balancecolumns
  5567. }%
  5568. \eject % call the \output just set
  5569. \ifdim\pagetotal=0pt
  5570. % Having called \balancecolumns once, we do not
  5571. % want to call it again. Therefore, reset \output to its normal
  5572. % definition right away.
  5573. \global\output=\expandafter{\the\defaultoutput}
  5574. %
  5575. \endgroup % started in \begindoublecolumns
  5576. % Leave the double-column material on the current page, no automatic
  5577. % page break.
  5578. \box\balancedcolumns
  5579. %
  5580. % \pagegoal was set to the doubled \vsize above, since we restarted
  5581. % the current page. We're now back to normal single-column
  5582. % typesetting, so reset \pagegoal to the normal \vsize.
  5583. \global\vsize = \txipageheight %
  5584. \pagegoal = \txipageheight %
  5585. \else
  5586. % We had some left-over material. This might happen when \doublecolumnout
  5587. % is called in \balancecolumns. Try again.
  5588. \expandafter\enddoublecolumns
  5589. \fi
  5590. }
  5591. \newbox\balancedcolumns
  5592. \setbox\balancedcolumns=\vbox{shouldnt see this}%
  5593. %
  5594. % Only called for the last of the double column material. \doublecolumnout
  5595. % does the others.
  5596. \def\balancecolumns{%
  5597. \setbox0 = \vbox{\unvbox\PAGE}% like \box255 but more efficient, see p.120.
  5598. \dimen@ = \ht0
  5599. \ifdim\dimen@<7\baselineskip
  5600. % Don't split a short final column in two.
  5601. \setbox2=\vbox{}%
  5602. \global\setbox\balancedcolumns=\vbox{\pagesofar}%
  5603. \else
  5604. % double the leading vertical space
  5605. \advance\dimen@ by \topskip
  5606. \advance\dimen@ by-\baselineskip
  5607. \divide\dimen@ by 2 % target to split to
  5608. \dimen@ii = \dimen@
  5609. \splittopskip = \topskip
  5610. % Loop until left column is at least as high as the right column.
  5611. {%
  5612. \vbadness = 10000
  5613. \loop
  5614. \global\setbox3 = \copy0
  5615. \global\setbox1 = \vsplit3 to \dimen@
  5616. \ifdim\ht1<\ht3
  5617. \global\advance\dimen@ by 1pt
  5618. \repeat
  5619. }%
  5620. % Now the left column is in box 1, and the right column in box 3.
  5621. %
  5622. % Check whether the left column has come out higher than the page itself.
  5623. % (Note that we have doubled \vsize for the double columns, so
  5624. % the actual height of the page is 0.5\vsize).
  5625. \ifdim2\ht1>\vsize
  5626. % It appears that we have been called upon to balance too much material.
  5627. % Output some of it with \doublecolumnout, leaving the rest on the page.
  5628. \setbox\PAGE=\box0
  5629. \doublecolumnout
  5630. \else
  5631. % Compare the heights of the two columns.
  5632. \ifdim4\ht1>5\ht3
  5633. % Column heights are too different, so don't make their bottoms
  5634. % flush with each other.
  5635. \setbox2=\vbox to \ht1 {\unvbox3\vfill}%
  5636. \setbox0=\vbox to \ht1 {\unvbox1\vfill}%
  5637. \else
  5638. % Make column bottoms flush with each other.
  5639. \setbox2=\vbox to\ht1{\unvbox3\unskip}%
  5640. \setbox0=\vbox to\ht1{\unvbox1\unskip}%
  5641. \fi
  5642. \global\setbox\balancedcolumns=\vbox{\pagesofar}%
  5643. \fi
  5644. \fi
  5645. %
  5646. }
  5647. \catcode`\@ = \other
  5648. \message{sectioning,}
  5649. % Chapters, sections, etc.
  5650. % Let's start with @part.
  5651. \outer\parseargdef\part{\partzzz{#1}}
  5652. \def\partzzz#1{%
  5653. \chapoddpage
  5654. \null
  5655. \vskip.3\vsize % move it down on the page a bit
  5656. \begingroup
  5657. \noindent \titlefonts\rm #1\par % the text
  5658. \let\lastnode=\empty % no node to associate with
  5659. \writetocentry{part}{#1}{}% but put it in the toc
  5660. \headingsoff % no headline or footline on the part page
  5661. % This outputs a mark at the end of the page that clears \thischapter
  5662. % and \thissection, as is done in \startcontents.
  5663. \let\pchapsepmacro\relax
  5664. \chapmacro{}{Yomitfromtoc}{}%
  5665. \chapoddpage
  5666. \endgroup
  5667. }
  5668. % \unnumberedno is an oxymoron. But we count the unnumbered
  5669. % sections so that we can refer to them unambiguously in the pdf
  5670. % outlines by their "section number". We avoid collisions with chapter
  5671. % numbers by starting them at 10000. (If a document ever has 10000
  5672. % chapters, we're in trouble anyway, I'm sure.)
  5673. \newcount\unnumberedno \unnumberedno = 10000
  5674. \newcount\chapno
  5675. \newcount\secno \secno=0
  5676. \newcount\subsecno \subsecno=0
  5677. \newcount\subsubsecno \subsubsecno=0
  5678. % This counter is funny since it counts through charcodes of letters A, B, ...
  5679. \newcount\appendixno \appendixno = `\@
  5680. %
  5681. % \def\appendixletter{\char\the\appendixno}
  5682. % We do the following ugly conditional instead of the above simple
  5683. % construct for the sake of pdftex, which needs the actual
  5684. % letter in the expansion, not just typeset.
  5685. %
  5686. \def\appendixletter{%
  5687. \ifnum\appendixno=`A A%
  5688. \else\ifnum\appendixno=`B B%
  5689. \else\ifnum\appendixno=`C C%
  5690. \else\ifnum\appendixno=`D D%
  5691. \else\ifnum\appendixno=`E E%
  5692. \else\ifnum\appendixno=`F F%
  5693. \else\ifnum\appendixno=`G G%
  5694. \else\ifnum\appendixno=`H H%
  5695. \else\ifnum\appendixno=`I I%
  5696. \else\ifnum\appendixno=`J J%
  5697. \else\ifnum\appendixno=`K K%
  5698. \else\ifnum\appendixno=`L L%
  5699. \else\ifnum\appendixno=`M M%
  5700. \else\ifnum\appendixno=`N N%
  5701. \else\ifnum\appendixno=`O O%
  5702. \else\ifnum\appendixno=`P P%
  5703. \else\ifnum\appendixno=`Q Q%
  5704. \else\ifnum\appendixno=`R R%
  5705. \else\ifnum\appendixno=`S S%
  5706. \else\ifnum\appendixno=`T T%
  5707. \else\ifnum\appendixno=`U U%
  5708. \else\ifnum\appendixno=`V V%
  5709. \else\ifnum\appendixno=`W W%
  5710. \else\ifnum\appendixno=`X X%
  5711. \else\ifnum\appendixno=`Y Y%
  5712. \else\ifnum\appendixno=`Z Z%
  5713. % The \the is necessary, despite appearances, because \appendixletter is
  5714. % expanded while writing the .toc file. \char\appendixno is not
  5715. % expandable, thus it is written literally, thus all appendixes come out
  5716. % with the same letter (or @) in the toc without it.
  5717. \else\char\the\appendixno
  5718. \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
  5719. \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
  5720. % Each @chapter defines these (using marks) as the number+name, number
  5721. % and name of the chapter. Page headings and footings can use
  5722. % these. @section does likewise.
  5723. \def\thischapter{}
  5724. \def\thischapternum{}
  5725. \def\thischaptername{}
  5726. \def\thissection{}
  5727. \def\thissectionnum{}
  5728. \def\thissectionname{}
  5729. \newcount\absseclevel % used to calculate proper heading level
  5730. \newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
  5731. % @raisesections: treat @section as chapter, @subsection as section, etc.
  5732. \def\raisesections{\global\advance\secbase by -1}
  5733. % @lowersections: treat @chapter as section, @section as subsection, etc.
  5734. \def\lowersections{\global\advance\secbase by 1}
  5735. % we only have subsub.
  5736. \chardef\maxseclevel = 3
  5737. %
  5738. % A numbered section within an unnumbered changes to unnumbered too.
  5739. % To achieve this, remember the "biggest" unnum. sec. we are currently in:
  5740. \chardef\unnlevel = \maxseclevel
  5741. %
  5742. % Trace whether the current chapter is an appendix or not:
  5743. % \chapheadtype is "N" or "A", unnumbered chapters are ignored.
  5744. \def\chapheadtype{N}
  5745. % Choose a heading macro
  5746. % #1 is heading type
  5747. % #2 is heading level
  5748. % #3 is text for heading
  5749. \def\genhead#1#2#3{%
  5750. % Compute the abs. sec. level:
  5751. \absseclevel=#2
  5752. \advance\absseclevel by \secbase
  5753. % Make sure \absseclevel doesn't fall outside the range:
  5754. \ifnum \absseclevel < 0
  5755. \absseclevel = 0
  5756. \else
  5757. \ifnum \absseclevel > 3
  5758. \absseclevel = 3
  5759. \fi
  5760. \fi
  5761. % The heading type:
  5762. \def\headtype{#1}%
  5763. \if \headtype U%
  5764. \ifnum \absseclevel < \unnlevel
  5765. \chardef\unnlevel = \absseclevel
  5766. \fi
  5767. \else
  5768. % Check for appendix sections:
  5769. \ifnum \absseclevel = 0
  5770. \edef\chapheadtype{\headtype}%
  5771. \else
  5772. \if \headtype A\if \chapheadtype N%
  5773. \errmessage{@appendix... within a non-appendix chapter}%
  5774. \fi\fi
  5775. \fi
  5776. % Check for numbered within unnumbered:
  5777. \ifnum \absseclevel > \unnlevel
  5778. \def\headtype{U}%
  5779. \else
  5780. \chardef\unnlevel = 3
  5781. \fi
  5782. \fi
  5783. % Now print the heading:
  5784. \if \headtype U%
  5785. \ifcase\absseclevel
  5786. \unnumberedzzz{#3}%
  5787. \or \unnumberedseczzz{#3}%
  5788. \or \unnumberedsubseczzz{#3}%
  5789. \or \unnumberedsubsubseczzz{#3}%
  5790. \fi
  5791. \else
  5792. \if \headtype A%
  5793. \ifcase\absseclevel
  5794. \appendixzzz{#3}%
  5795. \or \appendixsectionzzz{#3}%
  5796. \or \appendixsubseczzz{#3}%
  5797. \or \appendixsubsubseczzz{#3}%
  5798. \fi
  5799. \else
  5800. \ifcase\absseclevel
  5801. \chapterzzz{#3}%
  5802. \or \seczzz{#3}%
  5803. \or \numberedsubseczzz{#3}%
  5804. \or \numberedsubsubseczzz{#3}%
  5805. \fi
  5806. \fi
  5807. \fi
  5808. \suppressfirstparagraphindent
  5809. }
  5810. % an interface:
  5811. \def\numhead{\genhead N}
  5812. \def\apphead{\genhead A}
  5813. \def\unnmhead{\genhead U}
  5814. % @chapter, @appendix, @unnumbered. Increment top-level counter, reset
  5815. % all lower-level sectioning counters to zero.
  5816. %
  5817. % Also set \chaplevelprefix, which we prepend to @float sequence numbers
  5818. % (e.g., figures), q.v. By default (before any chapter), that is empty.
  5819. \let\chaplevelprefix = \empty
  5820. %
  5821. \outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz
  5822. \def\chapterzzz#1{%
  5823. % section resetting is \global in case the chapter is in a group, such
  5824. % as an @include file.
  5825. \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
  5826. \global\advance\chapno by 1
  5827. %
  5828. % Used for \float.
  5829. \gdef\chaplevelprefix{\the\chapno.}%
  5830. \resetallfloatnos
  5831. %
  5832. % \putwordChapter can contain complex things in translations.
  5833. \toks0=\expandafter{\putwordChapter}%
  5834. \message{\the\toks0 \space \the\chapno}%
  5835. %
  5836. % Write the actual heading.
  5837. \chapmacro{#1}{Ynumbered}{\the\chapno}%
  5838. %
  5839. % So @section and the like are numbered underneath this chapter.
  5840. \global\let\section = \numberedsec
  5841. \global\let\subsection = \numberedsubsec
  5842. \global\let\subsubsection = \numberedsubsubsec
  5843. }
  5844. \outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz
  5845. %
  5846. \def\appendixzzz#1{%
  5847. \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
  5848. \global\advance\appendixno by 1
  5849. \gdef\chaplevelprefix{\appendixletter.}%
  5850. \resetallfloatnos
  5851. %
  5852. % \putwordAppendix can contain complex things in translations.
  5853. \toks0=\expandafter{\putwordAppendix}%
  5854. \message{\the\toks0 \space \appendixletter}%
  5855. %
  5856. \chapmacro{#1}{Yappendix}{\appendixletter}%
  5857. %
  5858. \global\let\section = \appendixsec
  5859. \global\let\subsection = \appendixsubsec
  5860. \global\let\subsubsection = \appendixsubsubsec
  5861. }
  5862. % normally unnmhead0 calls unnumberedzzz:
  5863. \outer\parseargdef\unnumbered{\unnmhead0{#1}}
  5864. \def\unnumberedzzz#1{%
  5865. \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
  5866. \global\advance\unnumberedno by 1
  5867. %
  5868. % Since an unnumbered has no number, no prefix for figures.
  5869. \global\let\chaplevelprefix = \empty
  5870. \resetallfloatnos
  5871. %
  5872. % This used to be simply \message{#1}, but TeX fully expands the
  5873. % argument to \message. Therefore, if #1 contained @-commands, TeX
  5874. % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
  5875. % expanded @cite (which turns out to cause errors because \cite is meant
  5876. % to be executed, not expanded).
  5877. %
  5878. % Anyway, we don't want the fully-expanded definition of @cite to appear
  5879. % as a result of the \message, we just want `@cite' itself. We use
  5880. % \the<toks register> to achieve this: TeX expands \the<toks> only once,
  5881. % simply yielding the contents of <toks register>. (We also do this for
  5882. % the toc entries.)
  5883. \toks0 = {#1}%
  5884. \message{(\the\toks0)}%
  5885. %
  5886. \chapmacro{#1}{Ynothing}{\the\unnumberedno}%
  5887. %
  5888. \global\let\section = \unnumberedsec
  5889. \global\let\subsection = \unnumberedsubsec
  5890. \global\let\subsubsection = \unnumberedsubsubsec
  5891. }
  5892. % @centerchap is like @unnumbered, but the heading is centered.
  5893. \outer\parseargdef\centerchap{%
  5894. \let\centerparametersmaybe = \centerparameters
  5895. \unnmhead0{#1}%
  5896. \let\centerparametersmaybe = \relax
  5897. }
  5898. % @top is like @unnumbered.
  5899. \let\top\unnumbered
  5900. % Sections.
  5901. %
  5902. \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
  5903. \def\seczzz#1{%
  5904. \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
  5905. \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
  5906. }
  5907. % normally calls appendixsectionzzz:
  5908. \outer\parseargdef\appendixsection{\apphead1{#1}}
  5909. \def\appendixsectionzzz#1{%
  5910. \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
  5911. \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
  5912. }
  5913. \let\appendixsec\appendixsection
  5914. % normally calls unnumberedseczzz:
  5915. \outer\parseargdef\unnumberedsec{\unnmhead1{#1}}
  5916. \def\unnumberedseczzz#1{%
  5917. \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
  5918. \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
  5919. }
  5920. % Subsections.
  5921. %
  5922. % normally calls numberedsubseczzz:
  5923. \outer\parseargdef\numberedsubsec{\numhead2{#1}}
  5924. \def\numberedsubseczzz#1{%
  5925. \global\subsubsecno=0 \global\advance\subsecno by 1
  5926. \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
  5927. }
  5928. % normally calls appendixsubseczzz:
  5929. \outer\parseargdef\appendixsubsec{\apphead2{#1}}
  5930. \def\appendixsubseczzz#1{%
  5931. \global\subsubsecno=0 \global\advance\subsecno by 1
  5932. \sectionheading{#1}{subsec}{Yappendix}%
  5933. {\appendixletter.\the\secno.\the\subsecno}%
  5934. }
  5935. % normally calls unnumberedsubseczzz:
  5936. \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}}
  5937. \def\unnumberedsubseczzz#1{%
  5938. \global\subsubsecno=0 \global\advance\subsecno by 1
  5939. \sectionheading{#1}{subsec}{Ynothing}%
  5940. {\the\unnumberedno.\the\secno.\the\subsecno}%
  5941. }
  5942. % Subsubsections.
  5943. %
  5944. % normally numberedsubsubseczzz:
  5945. \outer\parseargdef\numberedsubsubsec{\numhead3{#1}}
  5946. \def\numberedsubsubseczzz#1{%
  5947. \global\advance\subsubsecno by 1
  5948. \sectionheading{#1}{subsubsec}{Ynumbered}%
  5949. {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
  5950. }
  5951. % normally appendixsubsubseczzz:
  5952. \outer\parseargdef\appendixsubsubsec{\apphead3{#1}}
  5953. \def\appendixsubsubseczzz#1{%
  5954. \global\advance\subsubsecno by 1
  5955. \sectionheading{#1}{subsubsec}{Yappendix}%
  5956. {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
  5957. }
  5958. % normally unnumberedsubsubseczzz:
  5959. \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}}
  5960. \def\unnumberedsubsubseczzz#1{%
  5961. \global\advance\subsubsecno by 1
  5962. \sectionheading{#1}{subsubsec}{Ynothing}%
  5963. {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}%
  5964. }
  5965. % These macros control what the section commands do, according
  5966. % to what kind of chapter we are in (ordinary, appendix, or unnumbered).
  5967. % Define them by default for a numbered chapter.
  5968. \let\section = \numberedsec
  5969. \let\subsection = \numberedsubsec
  5970. \let\subsubsection = \numberedsubsubsec
  5971. % Define @majorheading, @heading and @subheading
  5972. \def\majorheading{%
  5973. {\advance\chapheadingskip by 10pt \chapbreak }%
  5974. \parsearg\chapheadingzzz
  5975. }
  5976. \def\chapheading{\chapbreak \parsearg\chapheadingzzz}
  5977. \def\chapheadingzzz#1{%
  5978. \vbox{\chapfonts \raggedtitlesettings #1\par}%
  5979. \nobreak\bigskip \nobreak
  5980. \suppressfirstparagraphindent
  5981. }
  5982. % @heading, @subheading, @subsubheading.
  5983. \parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{}
  5984. \suppressfirstparagraphindent}
  5985. \parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{}
  5986. \suppressfirstparagraphindent}
  5987. \parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
  5988. \suppressfirstparagraphindent}
  5989. % These macros generate a chapter, section, etc. heading only
  5990. % (including whitespace, linebreaking, etc. around it),
  5991. % given all the information in convenient, parsed form.
  5992. % Args are the skip and penalty (usually negative)
  5993. \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
  5994. % Parameter controlling skip before chapter headings (if needed)
  5995. \newskip\chapheadingskip
  5996. % Define plain chapter starts, and page on/off switching for it.
  5997. \def\chapbreak{\dobreak \chapheadingskip {-4000}}
  5998. % Start a new page
  5999. \def\chappager{\par\vfill\supereject}
  6000. % \chapoddpage - start on an odd page for a new chapter
  6001. % Because \domark is called before \chapoddpage, the filler page will
  6002. % get the headings for the next chapter, which is wrong. But we don't
  6003. % care -- we just disable all headings on the filler page.
  6004. \def\chapoddpage{%
  6005. \chappager
  6006. \ifodd\pageno \else
  6007. \begingroup
  6008. \headingsoff
  6009. \null
  6010. \chappager
  6011. \endgroup
  6012. \fi
  6013. }
  6014. \parseargdef\setchapternewpage{\csname CHAPPAG#1\endcsname}
  6015. \def\CHAPPAGoff{%
  6016. \global\let\contentsalignmacro = \chappager
  6017. \global\let\pchapsepmacro=\chapbreak
  6018. \global\def\HEADINGSon{\HEADINGSsinglechapoff}}
  6019. \def\CHAPPAGon{%
  6020. \global\let\contentsalignmacro = \chappager
  6021. \global\let\pchapsepmacro=\chappager
  6022. \global\def\HEADINGSon{\HEADINGSsingle}}
  6023. \def\CHAPPAGodd{%
  6024. \global\let\contentsalignmacro = \chapoddpage
  6025. \global\let\pchapsepmacro=\chapoddpage
  6026. \global\def\HEADINGSon{\HEADINGSdouble}}
  6027. \CHAPPAGon
  6028. % \chapmacro - Chapter opening.
  6029. %
  6030. % #1 is the text, #2 is the section type (Ynumbered, Ynothing,
  6031. % Yappendix, Yomitfromtoc), #3 the chapter number.
  6032. % Not used for @heading series.
  6033. %
  6034. % To test against our argument.
  6035. \def\Ynothingkeyword{Ynothing}
  6036. \def\Yappendixkeyword{Yappendix}
  6037. \def\Yomitfromtockeyword{Yomitfromtoc}
  6038. %
  6039. \def\chapmacro#1#2#3{%
  6040. \expandafter\ifx\thisenv\titlepage\else
  6041. \checkenv{}% chapters, etc., should not start inside an environment.
  6042. \fi
  6043. % Insert the first mark before the heading break (see notes for \domark).
  6044. \let\prevchapterdefs=\currentchapterdefs
  6045. \let\prevsectiondefs=\currentsectiondefs
  6046. \gdef\currentsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
  6047. \gdef\thissection{}}%
  6048. %
  6049. \def\temptype{#2}%
  6050. \ifx\temptype\Ynothingkeyword
  6051. \gdef\currentchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
  6052. \gdef\thischapter{\thischaptername}}%
  6053. \else\ifx\temptype\Yomitfromtockeyword
  6054. \gdef\currentchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
  6055. \gdef\thischapter{}}%
  6056. \else\ifx\temptype\Yappendixkeyword
  6057. \toks0={#1}%
  6058. \xdef\currentchapterdefs{%
  6059. \gdef\noexpand\thischaptername{\the\toks0}%
  6060. \gdef\noexpand\thischapternum{\appendixletter}%
  6061. % \noexpand\putwordAppendix avoids expanding indigestible
  6062. % commands in some of the translations.
  6063. \gdef\noexpand\thischapter{\noexpand\putwordAppendix{}
  6064. \noexpand\thischapternum:
  6065. \noexpand\thischaptername}%
  6066. }%
  6067. \else
  6068. \toks0={#1}%
  6069. \xdef\currentchapterdefs{%
  6070. \gdef\noexpand\thischaptername{\the\toks0}%
  6071. \gdef\noexpand\thischapternum{\the\chapno}%
  6072. % \noexpand\putwordChapter avoids expanding indigestible
  6073. % commands in some of the translations.
  6074. \gdef\noexpand\thischapter{\noexpand\putwordChapter{}
  6075. \noexpand\thischapternum:
  6076. \noexpand\thischaptername}%
  6077. }%
  6078. \fi\fi\fi
  6079. %
  6080. % Output the mark. Pass it through \safewhatsit, to take care of
  6081. % the preceding space.
  6082. \safewhatsit\domark
  6083. %
  6084. % Insert the chapter heading break.
  6085. \pchapsepmacro
  6086. %
  6087. % Now the second mark, after the heading break. No break points
  6088. % between here and the heading.
  6089. \let\prevchapterdefs=\currentchapterdefs
  6090. \let\prevsectiondefs=\currentsectiondefs
  6091. \domark
  6092. %
  6093. {%
  6094. \chapfonts \rm
  6095. \let\footnote=\errfootnoteheading % give better error message
  6096. %
  6097. % Have to define \currentsection before calling \donoderef, because the
  6098. % xref code eventually uses it. On the other hand, it has to be called
  6099. % after \pchapsepmacro, or the headline will change too soon.
  6100. \gdef\currentsection{#1}%
  6101. %
  6102. % Only insert the separating space if we have a chapter/appendix
  6103. % number, and don't print the unnumbered ``number''.
  6104. \ifx\temptype\Ynothingkeyword
  6105. \setbox0 = \hbox{}%
  6106. \def\toctype{unnchap}%
  6107. \else\ifx\temptype\Yomitfromtockeyword
  6108. \setbox0 = \hbox{}% contents like unnumbered, but no toc entry
  6109. \def\toctype{omit}%
  6110. \else\ifx\temptype\Yappendixkeyword
  6111. \setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
  6112. \def\toctype{app}%
  6113. \else
  6114. \setbox0 = \hbox{#3\enspace}%
  6115. \def\toctype{numchap}%
  6116. \fi\fi\fi
  6117. %
  6118. % Write the toc entry for this chapter. Must come before the
  6119. % \donoderef, because we include the current node name in the toc
  6120. % entry, and \donoderef resets it to empty.
  6121. \writetocentry{\toctype}{#1}{#3}%
  6122. %
  6123. % For pdftex, we have to write out the node definition (aka, make
  6124. % the pdfdest) after any page break, but before the actual text has
  6125. % been typeset. If the destination for the pdf outline is after the
  6126. % text, then jumping from the outline may wind up with the text not
  6127. % being visible, for instance under high magnification.
  6128. \donoderef{#2}%
  6129. %
  6130. % Typeset the actual heading.
  6131. \nobreak % Avoid page breaks at the interline glue.
  6132. \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe
  6133. \unhbox0 #1\par}%
  6134. }%
  6135. \nobreak\bigskip % no page break after a chapter title
  6136. \nobreak
  6137. }
  6138. % @centerchap -- centered and unnumbered.
  6139. \let\centerparametersmaybe = \relax
  6140. \def\centerparameters{%
  6141. \advance\rightskip by 3\rightskip
  6142. \leftskip = \rightskip
  6143. \parfillskip = 0pt
  6144. }
  6145. % Section titles. These macros combine the section number parts and
  6146. % call the generic \sectionheading to do the printing.
  6147. %
  6148. \newskip\secheadingskip
  6149. \def\secheadingbreak{\dobreak \secheadingskip{-1000}}
  6150. % Subsection titles.
  6151. \newskip\subsecheadingskip
  6152. \def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}}
  6153. % Subsubsection titles.
  6154. \def\subsubsecheadingskip{\subsecheadingskip}
  6155. \def\subsubsecheadingbreak{\subsecheadingbreak}
  6156. % Print any size, any type, section title.
  6157. %
  6158. % #1 is the text of the title,
  6159. % #2 is the section level (sec/subsec/subsubsec),
  6160. % #3 is the section type (Ynumbered, Ynothing, Yappendix, Yomitfromtoc),
  6161. % #4 is the section number.
  6162. %
  6163. \def\seckeyword{sec}
  6164. %
  6165. \def\sectionheading#1#2#3#4{%
  6166. {%
  6167. \def\sectionlevel{#2}%
  6168. \def\temptype{#3}%
  6169. %
  6170. % It is ok for the @heading series commands to appear inside an
  6171. % environment (it's been historically allowed, though the logic is
  6172. % dubious), but not the others.
  6173. \ifx\temptype\Yomitfromtockeyword\else
  6174. \checkenv{}% non-@*heading should not be in an environment.
  6175. \fi
  6176. \let\footnote=\errfootnoteheading
  6177. %
  6178. % Switch to the right set of fonts.
  6179. \csname #2fonts\endcsname \rm
  6180. %
  6181. % Insert first mark before the heading break (see notes for \domark).
  6182. \let\prevsectiondefs=\currentsectiondefs
  6183. \ifx\temptype\Ynothingkeyword
  6184. \ifx\sectionlevel\seckeyword
  6185. \gdef\currentsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
  6186. \gdef\thissection{\thissectionname}}%
  6187. \fi
  6188. \else\ifx\temptype\Yomitfromtockeyword
  6189. % Don't redefine \thissection.
  6190. \else\ifx\temptype\Yappendixkeyword
  6191. \ifx\sectionlevel\seckeyword
  6192. \toks0={#1}%
  6193. \xdef\currentsectiondefs{%
  6194. \gdef\noexpand\thissectionname{\the\toks0}%
  6195. \gdef\noexpand\thissectionnum{#4}%
  6196. % \noexpand\putwordSection avoids expanding indigestible
  6197. % commands in some of the translations.
  6198. \gdef\noexpand\thissection{\noexpand\putwordSection{}
  6199. \noexpand\thissectionnum:
  6200. \noexpand\thissectionname}%
  6201. }%
  6202. \fi
  6203. \else
  6204. \ifx\sectionlevel\seckeyword
  6205. \toks0={#1}%
  6206. \xdef\currentsectiondefs{%
  6207. \gdef\noexpand\thissectionname{\the\toks0}%
  6208. \gdef\noexpand\thissectionnum{#4}%
  6209. % \noexpand\putwordSection avoids expanding indigestible
  6210. % commands in some of the translations.
  6211. \gdef\noexpand\thissection{\noexpand\putwordSection{}
  6212. \noexpand\thissectionnum:
  6213. \noexpand\thissectionname}%
  6214. }%
  6215. \fi
  6216. \fi\fi\fi
  6217. %
  6218. % Go into vertical mode. Usually we'll already be there, but we
  6219. % don't want the following whatsit to end up in a preceding paragraph
  6220. % if the document didn't happen to have a blank line.
  6221. \par
  6222. %
  6223. % Output the mark. Pass it through \safewhatsit, to take care of
  6224. % the preceding space.
  6225. \safewhatsit\domark
  6226. %
  6227. % Insert space above the heading.
  6228. \csname #2headingbreak\endcsname
  6229. %
  6230. % Now the second mark, after the heading break. No break points
  6231. % between here and the heading.
  6232. \global\let\prevsectiondefs=\currentsectiondefs
  6233. \domark
  6234. %
  6235. % Only insert the space after the number if we have a section number.
  6236. \ifx\temptype\Ynothingkeyword
  6237. \setbox0 = \hbox{}%
  6238. \def\toctype{unn}%
  6239. \gdef\currentsection{#1}%
  6240. \else\ifx\temptype\Yomitfromtockeyword
  6241. % for @headings -- no section number, don't include in toc,
  6242. % and don't redefine \currentsection.
  6243. \setbox0 = \hbox{}%
  6244. \def\toctype{omit}%
  6245. \let\sectionlevel=\empty
  6246. \else\ifx\temptype\Yappendixkeyword
  6247. \setbox0 = \hbox{#4\enspace}%
  6248. \def\toctype{app}%
  6249. \gdef\currentsection{#1}%
  6250. \else
  6251. \setbox0 = \hbox{#4\enspace}%
  6252. \def\toctype{num}%
  6253. \gdef\currentsection{#1}%
  6254. \fi\fi\fi
  6255. %
  6256. % Write the toc entry (before \donoderef). See comments in \chapmacro.
  6257. \writetocentry{\toctype\sectionlevel}{#1}{#4}%
  6258. %
  6259. % Write the node reference (= pdf destination for pdftex).
  6260. % Again, see comments in \chapmacro.
  6261. \donoderef{#3}%
  6262. %
  6263. % Interline glue will be inserted when the vbox is completed.
  6264. % That glue will be a valid breakpoint for the page, since it'll be
  6265. % preceded by a whatsit (usually from the \donoderef, or from the
  6266. % \writetocentry if there was no node). We don't want to allow that
  6267. % break, since then the whatsits could end up on page n while the
  6268. % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000.
  6269. \nobreak
  6270. %
  6271. % Output the actual section heading.
  6272. \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
  6273. \hangindent=\wd0 % zero if no section number
  6274. \unhbox0 #1}%
  6275. }%
  6276. % Add extra space after the heading -- half of whatever came above it.
  6277. % Don't allow stretch, though.
  6278. \kern .5 \csname #2headingskip\endcsname
  6279. %
  6280. % Do not let the kern be a potential breakpoint, as it would be if it
  6281. % was followed by glue.
  6282. \nobreak
  6283. %
  6284. % We'll almost certainly start a paragraph next, so don't let that
  6285. % glue accumulate. (Not a breakpoint because it's preceded by a
  6286. % discardable item.) However, when a paragraph is not started next
  6287. % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out
  6288. % or the negative glue will cause weirdly wrong output, typically
  6289. % obscuring the section heading with something else.
  6290. \vskip-\parskip
  6291. %
  6292. % This is so the last item on the main vertical list is a known
  6293. % \penalty > 10000, so \startdefun, etc., can recognize the situation
  6294. % and do the needful.
  6295. \penalty 10001
  6296. }
  6297. \message{toc,}
  6298. % Table of contents.
  6299. \newwrite\tocfile
  6300. % Write an entry to the toc file, opening it if necessary.
  6301. % Called from @chapter, etc.
  6302. %
  6303. % Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno}
  6304. % We append the current node name (if any) and page number as additional
  6305. % arguments for the \{chap,sec,...}entry macros which will eventually
  6306. % read this. The node name is used in the pdf outlines as the
  6307. % destination to jump to.
  6308. %
  6309. % We open the .toc file for writing here instead of at @setfilename (or
  6310. % any other fixed time) so that @contents can be anywhere in the document.
  6311. % But if #1 is `omit', then we don't do anything. This is used for the
  6312. % table of contents chapter openings themselves.
  6313. %
  6314. \newif\iftocfileopened
  6315. \def\omitkeyword{omit}%
  6316. %
  6317. \def\writetocentry#1#2#3{%
  6318. \edef\writetoctype{#1}%
  6319. \ifx\writetoctype\omitkeyword \else
  6320. \iftocfileopened\else
  6321. \immediate\openout\tocfile = \jobname.toc
  6322. \global\tocfileopenedtrue
  6323. \fi
  6324. %
  6325. \iflinks
  6326. {\atdummies
  6327. \edef\temp{%
  6328. \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}%
  6329. \temp
  6330. }%
  6331. \fi
  6332. \fi
  6333. %
  6334. % Tell \shipout to create a pdf destination on each page, if we're
  6335. % writing pdf. These are used in the table of contents. We can't
  6336. % just write one on every page because the title pages are numbered
  6337. % 1 and 2 (the page numbers aren't printed), and so are the first
  6338. % two pages of the document. Thus, we'd have two destinations named
  6339. % `1', and two named `2'.
  6340. \ifpdforxetex
  6341. \global\pdfmakepagedesttrue
  6342. \fi
  6343. }
  6344. % These characters do not print properly in the Computer Modern roman
  6345. % fonts, so we must take special care. This is more or less redundant
  6346. % with the Texinfo input format setup at the end of this file.
  6347. %
  6348. \def\activecatcodes{%
  6349. \catcode`\"=\active
  6350. \catcode`\$=\active
  6351. \catcode`\<=\active
  6352. \catcode`\>=\active
  6353. \catcode`\\=\active
  6354. \catcode`\^=\active
  6355. \catcode`\_=\active
  6356. \catcode`\|=\active
  6357. \catcode`\~=\active
  6358. }
  6359. % Read the toc file, which is essentially Texinfo input.
  6360. \def\readtocfile{%
  6361. \setupdatafile
  6362. \activecatcodes
  6363. \input \tocreadfilename
  6364. }
  6365. \newskip\contentsrightmargin \contentsrightmargin=1in
  6366. \newcount\savepageno
  6367. \newcount\lastnegativepageno \lastnegativepageno = -1
  6368. % Prepare to read what we've written to \tocfile.
  6369. %
  6370. \def\startcontents#1{%
  6371. % If @setchapternewpage on, and @headings double, the contents should
  6372. % start on an odd page, unlike chapters.
  6373. \contentsalignmacro
  6374. \immediate\closeout\tocfile
  6375. %
  6376. % Don't need to put `Contents' or `Short Contents' in the headline.
  6377. % It is abundantly clear what they are.
  6378. \chapmacro{#1}{Yomitfromtoc}{}%
  6379. %
  6380. \savepageno = \pageno
  6381. \begingroup % Set up to handle contents files properly.
  6382. \raggedbottom % Worry more about breakpoints than the bottom.
  6383. \entryrightmargin=\contentsrightmargin % Don't use the full line length.
  6384. %
  6385. % Roman numerals for page numbers.
  6386. \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
  6387. \def\thistitle{}% no title in double-sided headings
  6388. % Record where the Roman numerals started.
  6389. \ifnum\romancount=0 \global\romancount=\pagecount \fi
  6390. }
  6391. % redefined for the two-volume lispref. We always output on
  6392. % \jobname.toc even if this is redefined.
  6393. %
  6394. \def\tocreadfilename{\jobname.toc}
  6395. % Normal (long) toc.
  6396. %
  6397. \def\contents{%
  6398. \startcontents{\putwordTOC}%
  6399. \openin 1 \tocreadfilename\space
  6400. \ifeof 1 \else
  6401. \readtocfile
  6402. \fi
  6403. \vfill \eject
  6404. \contentsalignmacro % in case @setchapternewpage odd is in effect
  6405. \ifeof 1 \else
  6406. \pdfmakeoutlines
  6407. \fi
  6408. \closein 1
  6409. \endgroup
  6410. \contentsendroman
  6411. }
  6412. % And just the chapters.
  6413. \def\summarycontents{%
  6414. \startcontents{\putwordShortTOC}%
  6415. %
  6416. \let\partentry = \shortpartentry
  6417. \let\numchapentry = \shortchapentry
  6418. \let\appentry = \shortchapentry
  6419. \let\unnchapentry = \shortunnchapentry
  6420. % We want a true roman here for the page numbers.
  6421. \secfonts
  6422. \let\rm=\shortcontrm \let\bf=\shortcontbf
  6423. \let\sl=\shortcontsl \let\tt=\shortconttt
  6424. \rm
  6425. \hyphenpenalty = 10000
  6426. \advance\baselineskip by 1pt % Open it up a little.
  6427. \def\numsecentry##1##2##3##4{}
  6428. \let\appsecentry = \numsecentry
  6429. \let\unnsecentry = \numsecentry
  6430. \let\numsubsecentry = \numsecentry
  6431. \let\appsubsecentry = \numsecentry
  6432. \let\unnsubsecentry = \numsecentry
  6433. \let\numsubsubsecentry = \numsecentry
  6434. \let\appsubsubsecentry = \numsecentry
  6435. \let\unnsubsubsecentry = \numsecentry
  6436. \openin 1 \tocreadfilename\space
  6437. \ifeof 1 \else
  6438. \readtocfile
  6439. \fi
  6440. \closein 1
  6441. \vfill \eject
  6442. \contentsalignmacro % in case @setchapternewpage odd is in effect
  6443. \endgroup
  6444. \contentsendroman
  6445. }
  6446. \let\shortcontents = \summarycontents
  6447. % Get ready to use Arabic numerals again
  6448. \def\contentsendroman{%
  6449. \lastnegativepageno = \pageno
  6450. \global\pageno = \savepageno
  6451. %
  6452. % If \romancount > \arabiccount, the contents are at the end of the
  6453. % document. Otherwise, advance where the Arabic numerals start for
  6454. % the page numbers.
  6455. \ifnum\romancount>\arabiccount\else\global\arabiccount=\pagecount\fi
  6456. }
  6457. % Typeset the label for a chapter or appendix for the short contents.
  6458. % The arg is, e.g., `A' for an appendix, or `3' for a chapter.
  6459. %
  6460. \def\shortchaplabel#1{%
  6461. % This space should be enough, since a single number is .5em, and the
  6462. % widest letter (M) is 1em, at least in the Computer Modern fonts.
  6463. % But use \hss just in case.
  6464. % (This space doesn't include the extra space that gets added after
  6465. % the label; that gets put in by \shortchapentry above.)
  6466. %
  6467. % We'd like to right-justify chapter numbers, but that looks strange
  6468. % with appendix letters. And right-justifying numbers and
  6469. % left-justifying letters looks strange when there is less than 10
  6470. % chapters. Have to read the whole toc once to know how many chapters
  6471. % there are before deciding ...
  6472. \hbox to 1em{#1\hss}%
  6473. }
  6474. % These macros generate individual entries in the table of contents.
  6475. % The first argument is the chapter or section name.
  6476. % The last argument is the page number.
  6477. % The arguments in between are the chapter number, section number, ...
  6478. % Parts, in the main contents. Replace the part number, which doesn't
  6479. % exist, with an empty box. Let's hope all the numbers have the same width.
  6480. % Also ignore the page number, which is conventionally not printed.
  6481. \def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}}
  6482. \def\partentry#1#2#3#4{%
  6483. % Add stretch and a bonus for breaking the page before the part heading.
  6484. % This reduces the chance of the page being broken immediately after the
  6485. % part heading, before a following chapter heading.
  6486. \vskip 0pt plus 5\baselineskip
  6487. \penalty-300
  6488. \vskip 0pt plus -5\baselineskip
  6489. \dochapentry{\numeralbox\labelspace#1}{}%
  6490. }
  6491. %
  6492. % Parts, in the short toc.
  6493. \def\shortpartentry#1#2#3#4{%
  6494. \penalty-300
  6495. \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip
  6496. \shortchapentry{{\bf #1}}{\numeralbox}{}{}%
  6497. }
  6498. % Chapters, in the main contents.
  6499. \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
  6500. % Chapters, in the short toc.
  6501. % See comments in \dochapentry re vbox and related settings.
  6502. \def\shortchapentry#1#2#3#4{%
  6503. \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}%
  6504. }
  6505. % Appendices, in the main contents.
  6506. % Need the word Appendix, and a fixed-size box.
  6507. %
  6508. \def\appendixbox#1{%
  6509. % We use M since it's probably the widest letter.
  6510. \setbox0 = \hbox{\putwordAppendix{} M}%
  6511. \hbox to \wd0{\putwordAppendix{} #1\hss}}
  6512. %
  6513. \def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\hskip.7em#1}{#4}}
  6514. % Unnumbered chapters.
  6515. \def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}
  6516. \def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}}
  6517. % Sections.
  6518. \def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}}
  6519. \let\appsecentry=\numsecentry
  6520. \def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}}
  6521. % Subsections.
  6522. \def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}}
  6523. \let\appsubsecentry=\numsubsecentry
  6524. \def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}
  6525. % And subsubsections.
  6526. \def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}}
  6527. \let\appsubsubsecentry=\numsubsubsecentry
  6528. \def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}}
  6529. % This parameter controls the indentation of the various levels.
  6530. % Same as \defaultparindent.
  6531. \newdimen\tocindent \tocindent = 15pt
  6532. % Now for the actual typesetting. In all these, #1 is the text and #2 is the
  6533. % page number.
  6534. %
  6535. % If the toc has to be broken over pages, we want it to be at chapters
  6536. % if at all possible; hence the \penalty.
  6537. \def\dochapentry#1#2{%
  6538. \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
  6539. \begingroup
  6540. % Move the page numbers slightly to the right
  6541. \advance\entryrightmargin by -0.05em
  6542. \chapentryfonts
  6543. \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  6544. \endgroup
  6545. \nobreak\vskip .25\baselineskip plus.1\baselineskip
  6546. }
  6547. \def\dosecentry#1#2{\begingroup
  6548. \secentryfonts \leftskip=\tocindent
  6549. \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  6550. \endgroup}
  6551. \def\dosubsecentry#1#2{\begingroup
  6552. \subsecentryfonts \leftskip=2\tocindent
  6553. \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  6554. \endgroup}
  6555. \def\dosubsubsecentry#1#2{\begingroup
  6556. \subsubsecentryfonts \leftskip=3\tocindent
  6557. \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  6558. \endgroup}
  6559. % We use the same \entry macro as for the index entries.
  6560. \let\tocentry = \entry
  6561. % Space between chapter (or whatever) number and the title.
  6562. \def\labelspace{\hskip1em \relax}
  6563. \def\dopageno#1{{\rm #1}}
  6564. \def\doshortpageno#1{{\rm #1}}
  6565. \def\chapentryfonts{\secfonts \rm}
  6566. \def\secentryfonts{\textfonts}
  6567. \def\subsecentryfonts{\textfonts}
  6568. \def\subsubsecentryfonts{\textfonts}
  6569. \message{environments,}
  6570. % @foo ... @end foo.
  6571. % @tex ... @end tex escapes into raw TeX temporarily.
  6572. % One exception: @ is still an escape character, so that @end tex works.
  6573. % But \@ or @@ will get a plain @ character.
  6574. \envdef\tex{%
  6575. \setregularquotes
  6576. \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
  6577. \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
  6578. \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
  6579. \catcode `\%=14
  6580. \catcode `\+=\other
  6581. \catcode `\"=\other
  6582. \catcode `\|=\other
  6583. \catcode `\<=\other
  6584. \catcode `\>=\other
  6585. \catcode `\`=\other
  6586. \catcode `\'=\other
  6587. %
  6588. % ' is active in math mode (mathcode"8000). So reset it, and all our
  6589. % other math active characters (just in case), to plain's definitions.
  6590. \mathactive
  6591. %
  6592. % Inverse of the list at the beginning of the file.
  6593. \let\b=\ptexb
  6594. \let\bullet=\ptexbullet
  6595. \let\c=\ptexc
  6596. \let\,=\ptexcomma
  6597. \let\.=\ptexdot
  6598. \let\dots=\ptexdots
  6599. \let\equiv=\ptexequiv
  6600. \let\!=\ptexexclam
  6601. \let\i=\ptexi
  6602. \let\indent=\ptexindent
  6603. \let\noindent=\ptexnoindent
  6604. \let\{=\ptexlbrace
  6605. \let\+=\tabalign
  6606. \let\}=\ptexrbrace
  6607. \let\/=\ptexslash
  6608. \let\sp=\ptexsp
  6609. \let\*=\ptexstar
  6610. %\let\sup=\ptexsup % do not redefine, we want @sup to work in math mode
  6611. \let\t=\ptext
  6612. \expandafter \let\csname top\endcsname=\ptextop % we've made it outer
  6613. \let\frenchspacing=\plainfrenchspacing
  6614. %
  6615. \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
  6616. \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
  6617. \def\@{@}%
  6618. }
  6619. % There is no need to define \Etex.
  6620. % Define @lisp ... @end lisp.
  6621. % @lisp environment forms a group so it can rebind things,
  6622. % including the definition of @end lisp (which normally is erroneous).
  6623. % Amount to narrow the margins by for @lisp.
  6624. \newskip\lispnarrowing \lispnarrowing=0.4in
  6625. % This is the definition that ^^M gets inside @lisp, @example, and other
  6626. % such environments. \null is better than a space, since it doesn't
  6627. % have any width.
  6628. \def\lisppar{\null\endgraf}
  6629. % This space is always present above and below environments.
  6630. \newskip\envskipamount \envskipamount = 0pt
  6631. % Make spacing and below environment symmetrical. We use \parskip here
  6632. % to help in doing that, since in @example-like environments \parskip
  6633. % is reset to zero; thus the \afterenvbreak inserts no space -- but the
  6634. % start of the next paragraph will insert \parskip.
  6635. %
  6636. \def\aboveenvbreak{{%
  6637. % =10000 instead of <10000 because of a special case in \itemzzz and
  6638. % \sectionheading, q.v.
  6639. \ifnum \lastpenalty=10000 \else
  6640. \advance\envskipamount by \parskip
  6641. \endgraf
  6642. \ifdim\lastskip<\envskipamount
  6643. \removelastskip
  6644. \ifnum\lastpenalty<10000
  6645. % Penalize breaking before the environment, because preceding text
  6646. % often leads into it.
  6647. \penalty100
  6648. \fi
  6649. \vskip\envskipamount
  6650. \fi
  6651. \fi
  6652. }}
  6653. \def\afterenvbreak{{%
  6654. % =10000 instead of <10000 because of a special case in \itemzzz and
  6655. % \sectionheading, q.v.
  6656. \ifnum \lastpenalty=10000 \else
  6657. \advance\envskipamount by \parskip
  6658. \endgraf
  6659. \ifdim\lastskip<\envskipamount
  6660. \removelastskip
  6661. % it's not a good place to break if the last penalty was \nobreak
  6662. % or better ...
  6663. \ifnum\lastpenalty<10000 \penalty-50 \fi
  6664. \vskip\envskipamount
  6665. \fi
  6666. \fi
  6667. }}
  6668. % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will
  6669. % also clear it, so that its embedded environments do the narrowing again.
  6670. \let\nonarrowing=\relax
  6671. % @cartouche ... @end cartouche: draw rectangle w/rounded corners around
  6672. % environment contents.
  6673. %
  6674. \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
  6675. \def\ctr{{\hskip 6pt\circle\char'010}}
  6676. \def\cbl{{\circle\char'012\hskip -6pt}}
  6677. \def\cbr{{\hskip 6pt\circle\char'011}}
  6678. \def\carttop{\hbox to \cartouter{\hskip\lskip
  6679. \ctl\leaders\hrule height\circthick\hfil\ctr
  6680. \hskip\rskip}}
  6681. \def\cartbot{\hbox to \cartouter{\hskip\lskip
  6682. \cbl\leaders\hrule height\circthick\hfil\cbr
  6683. \hskip\rskip}}
  6684. %
  6685. \newskip\lskip\newskip\rskip
  6686. % only require the font if @cartouche is actually used
  6687. \def\cartouchefontdefs{%
  6688. \font\circle=lcircle10\relax
  6689. \circthick=\fontdimen8\circle
  6690. }
  6691. \newdimen\circthick
  6692. \newdimen\cartouter\newdimen\cartinner
  6693. \newskip\normbskip\newskip\normpskip\newskip\normlskip
  6694. \envdef\cartouche{%
  6695. \cartouchefontdefs
  6696. \ifhmode\par\fi % can't be in the midst of a paragraph.
  6697. \startsavinginserts
  6698. \lskip=\leftskip \rskip=\rightskip
  6699. \leftskip=0pt\rightskip=0pt % we want these *outside*.
  6700. \cartinner=\hsize \advance\cartinner by-\lskip
  6701. \advance\cartinner by-\rskip
  6702. \cartouter=\hsize
  6703. \advance\cartouter by 18.4pt % allow for 3pt kerns on either
  6704. % side, and for 6pt waste from
  6705. % each corner char, and rule thickness
  6706. \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
  6707. %
  6708. % If this cartouche directly follows a sectioning command, we need the
  6709. % \parskip glue (backspaced over by default) or the cartouche can
  6710. % collide with the section heading.
  6711. \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi
  6712. %
  6713. \setbox\groupbox=\vbox\bgroup
  6714. \baselineskip=0pt\parskip=0pt\lineskip=0pt
  6715. \carttop
  6716. \hbox\bgroup
  6717. \hskip\lskip
  6718. \vrule\kern3pt
  6719. \vbox\bgroup
  6720. \kern3pt
  6721. \hsize=\cartinner
  6722. \baselineskip=\normbskip
  6723. \lineskip=\normlskip
  6724. \parskip=\normpskip
  6725. \vskip -\parskip
  6726. \comment % For explanation, see the end of def\group.
  6727. }
  6728. \def\Ecartouche{%
  6729. \ifhmode\par\fi
  6730. \kern3pt
  6731. \egroup
  6732. \kern3pt\vrule
  6733. \hskip\rskip
  6734. \egroup
  6735. \cartbot
  6736. \egroup
  6737. \addgroupbox
  6738. \checkinserts
  6739. }
  6740. % This macro is called at the beginning of all the @example variants,
  6741. % inside a group.
  6742. \newdimen\nonfillparindent
  6743. \def\nonfillstart{%
  6744. \aboveenvbreak
  6745. \ifdim\hfuzz < 12pt \hfuzz = 12pt \fi % Don't be fussy
  6746. \sepspaces % Make spaces be word-separators rather than space tokens.
  6747. \let\par = \lisppar % don't ignore blank lines
  6748. \obeylines % each line of input is a line of output
  6749. \parskip = 0pt
  6750. % Turn off paragraph indentation but redefine \indent to emulate
  6751. % the normal \indent.
  6752. \nonfillparindent=\parindent
  6753. \parindent = 0pt
  6754. \let\indent\nonfillindent
  6755. %
  6756. \emergencystretch = 0pt % don't try to avoid overfull boxes
  6757. \ifx\nonarrowing\relax
  6758. \advance \leftskip by \lispnarrowing
  6759. \exdentamount=\lispnarrowing
  6760. \else
  6761. \let\nonarrowing = \relax
  6762. \fi
  6763. \let\exdent=\nofillexdent
  6764. }
  6765. \begingroup
  6766. \obeyspaces
  6767. % We want to swallow spaces (but not other tokens) after the fake
  6768. % @indent in our nonfill-environments, where spaces are normally
  6769. % active and set to @tie, resulting in them not being ignored after
  6770. % @indent.
  6771. \gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}%
  6772. \gdef\nonfillindentcheck{%
  6773. \ifx\temp %
  6774. \expandafter\nonfillindentgobble%
  6775. \else%
  6776. \leavevmode\nonfillindentbox%
  6777. \fi%
  6778. }%
  6779. \endgroup
  6780. \def\nonfillindentgobble#1{\nonfillindent}
  6781. \def\nonfillindentbox{\hbox to \nonfillparindent{\hss}}
  6782. % If you want all examples etc. small: @set dispenvsize small.
  6783. % If you want even small examples the full size: @set dispenvsize nosmall.
  6784. % This affects the following displayed environments:
  6785. % @example, @display, @format, @lisp, @verbatim
  6786. %
  6787. \def\smallword{small}
  6788. \def\nosmallword{nosmall}
  6789. \let\SETdispenvsize\relax
  6790. \def\setnormaldispenv{%
  6791. \ifx\SETdispenvsize\smallword
  6792. % end paragraph for sake of leading, in case document has no blank
  6793. % line. This is redundant with what happens in \aboveenvbreak, but
  6794. % we need to do it before changing the fonts, and it's inconvenient
  6795. % to change the fonts afterward.
  6796. \ifnum \lastpenalty=10000 \else \endgraf \fi
  6797. \smallexamplefonts \rm
  6798. \fi
  6799. }
  6800. \def\setsmalldispenv{%
  6801. \ifx\SETdispenvsize\nosmallword
  6802. \else
  6803. \ifnum \lastpenalty=10000 \else \endgraf \fi
  6804. \smallexamplefonts \rm
  6805. \fi
  6806. }
  6807. % We often define two environments, @foo and @smallfoo.
  6808. % Let's do it in one command. #1 is the env name, #2 the definition.
  6809. \def\makedispenvdef#1#2{%
  6810. \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}%
  6811. \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}%
  6812. \expandafter\let\csname E#1\endcsname \afterenvbreak
  6813. \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
  6814. }
  6815. % Define two environment synonyms (#1 and #2) for an environment.
  6816. \def\maketwodispenvdef#1#2#3{%
  6817. \makedispenvdef{#1}{#3}%
  6818. \makedispenvdef{#2}{#3}%
  6819. }
  6820. %
  6821. % @lisp: indented, narrowed, typewriter font;
  6822. % @example: same as @lisp.
  6823. %
  6824. % @smallexample and @smalllisp: use smaller fonts.
  6825. % Originally contributed by Pavel@xerox.
  6826. %
  6827. \maketwodispenvdef{lisp}{example}{%
  6828. \nonfillstart
  6829. \tt\setcodequotes
  6830. \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
  6831. \parsearg\gobble
  6832. }
  6833. % @display/@smalldisplay: same as @lisp except keep current font.
  6834. %
  6835. \makedispenvdef{display}{%
  6836. \nonfillstart
  6837. \gobble
  6838. }
  6839. % @format/@smallformat: same as @display except don't narrow margins.
  6840. %
  6841. \makedispenvdef{format}{%
  6842. \let\nonarrowing = t%
  6843. \nonfillstart
  6844. \gobble
  6845. }
  6846. % @flushleft: same as @format, but doesn't obey \SETdispenvsize.
  6847. \envdef\flushleft{%
  6848. \let\nonarrowing = t%
  6849. \nonfillstart
  6850. \gobble
  6851. }
  6852. \let\Eflushleft = \afterenvbreak
  6853. % @flushright.
  6854. %
  6855. \envdef\flushright{%
  6856. \let\nonarrowing = t%
  6857. \nonfillstart
  6858. \advance\leftskip by 0pt plus 1fill\relax
  6859. \gobble
  6860. }
  6861. \let\Eflushright = \afterenvbreak
  6862. % @raggedright does more-or-less normal line breaking but no right
  6863. % justification. From plain.tex.
  6864. \envdef\raggedright{%
  6865. \rightskip0pt plus2.4em \spaceskip.3333em \xspaceskip.5em\relax
  6866. }
  6867. \let\Eraggedright\par
  6868. \envdef\raggedleft{%
  6869. \parindent=0pt \leftskip0pt plus2em
  6870. \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
  6871. \hbadness=10000 % Last line will usually be underfull, so turn off
  6872. % badness reporting.
  6873. }
  6874. \let\Eraggedleft\par
  6875. \envdef\raggedcenter{%
  6876. \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em
  6877. \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
  6878. \hbadness=10000 % Last line will usually be underfull, so turn off
  6879. % badness reporting.
  6880. }
  6881. \let\Eraggedcenter\par
  6882. % @quotation does normal linebreaking (hence we can't use \nonfillstart)
  6883. % and narrows the margins. We keep \parskip nonzero in general, since
  6884. % we're doing normal filling. So, when using \aboveenvbreak and
  6885. % \afterenvbreak, temporarily make \parskip 0.
  6886. %
  6887. \makedispenvdef{quotation}{\quotationstart}
  6888. %
  6889. \def\quotationstart{%
  6890. \indentedblockstart % same as \indentedblock, but increase right margin too.
  6891. \ifx\nonarrowing\relax
  6892. \advance\rightskip by \lispnarrowing
  6893. \fi
  6894. \parsearg\quotationlabel
  6895. }
  6896. % We have retained a nonzero parskip for the environment, since we're
  6897. % doing normal filling.
  6898. %
  6899. \def\Equotation{%
  6900. \par
  6901. \ifx\quotationauthor\thisisundefined\else
  6902. % indent a bit.
  6903. \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
  6904. \fi
  6905. {\parskip=0pt \afterenvbreak}%
  6906. }
  6907. \def\Esmallquotation{\Equotation}
  6908. % If we're given an argument, typeset it in bold with a colon after.
  6909. \def\quotationlabel#1{%
  6910. \def\temp{#1}%
  6911. \ifx\temp\empty \else
  6912. {\bf #1: }%
  6913. \fi
  6914. }
  6915. % @indentedblock is like @quotation, but indents only on the left and
  6916. % has no optional argument.
  6917. %
  6918. \makedispenvdef{indentedblock}{\indentedblockstart}
  6919. %
  6920. \def\indentedblockstart{%
  6921. {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
  6922. \parindent=0pt
  6923. %
  6924. % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
  6925. \ifx\nonarrowing\relax
  6926. \advance\leftskip by \lispnarrowing
  6927. \exdentamount = \lispnarrowing
  6928. \else
  6929. \let\nonarrowing = \relax
  6930. \fi
  6931. }
  6932. % Keep a nonzero parskip for the environment, since we're doing normal filling.
  6933. %
  6934. \def\Eindentedblock{%
  6935. \par
  6936. {\parskip=0pt \afterenvbreak}%
  6937. }
  6938. \def\Esmallindentedblock{\Eindentedblock}
  6939. % LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
  6940. % If we want to allow any <char> as delimiter,
  6941. % we need the curly braces so that makeinfo sees the @verb command, eg:
  6942. % `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
  6943. %
  6944. % [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
  6945. %
  6946. % [Knuth] p.344; only we need to do the other characters Texinfo sets
  6947. % active too. Otherwise, they get lost as the first character on a
  6948. % verbatim line.
  6949. \def\dospecials{%
  6950. \do\ \do\\\do\{\do\}\do\$\do\&%
  6951. \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
  6952. \do\<\do\>\do\|\do\@\do+\do\"%
  6953. % Don't do the quotes -- if we do, @set txicodequoteundirected and
  6954. % @set txicodequotebacktick will not have effect on @verb and
  6955. % @verbatim, and ?` and !` ligatures won't get disabled.
  6956. %\do\`\do\'%
  6957. }
  6958. %
  6959. % [Knuth] p. 380
  6960. \def\uncatcodespecials{%
  6961. \def\do##1{\catcode`##1=\other}\dospecials}
  6962. %
  6963. % Setup for the @verb command.
  6964. %
  6965. % Eight spaces for a tab
  6966. \begingroup
  6967. \catcode`\^^I=\active
  6968. \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
  6969. \endgroup
  6970. %
  6971. \def\setupverb{%
  6972. \tt % easiest (and conventionally used) font for verbatim
  6973. \def\par{\leavevmode\endgraf}%
  6974. \setcodequotes
  6975. \tabeightspaces
  6976. % Respect line breaks,
  6977. % print special symbols as themselves, and
  6978. % make each space count
  6979. % must do in this order:
  6980. \obeylines \uncatcodespecials \sepspaces
  6981. }
  6982. % Setup for the @verbatim environment
  6983. %
  6984. % Real tab expansion.
  6985. \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
  6986. %
  6987. % We typeset each line of the verbatim in an \hbox, so we can handle
  6988. % tabs.
  6989. \newbox\verbbox
  6990. \def\starttabbox{\setbox\verbbox=\hbox\bgroup}
  6991. %
  6992. \begingroup
  6993. \catcode`\^^I=\active
  6994. \gdef\tabexpand{%
  6995. \catcode`\^^I=\active
  6996. \def^^I{\leavevmode\egroup
  6997. \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab
  6998. \divide\dimen\verbbox by\tabw
  6999. \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw
  7000. \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw
  7001. \wd\verbbox=\dimen\verbbox
  7002. \leavevmode\box\verbbox \starttabbox
  7003. }%
  7004. }
  7005. \endgroup
  7006. % start the verbatim environment.
  7007. \def\setupverbatim{%
  7008. \let\nonarrowing = t%
  7009. \nonfillstart
  7010. \tt % easiest (and conventionally used) font for verbatim
  7011. \def\par{\egroup\leavevmode\box\verbbox\endgraf\starttabbox}%
  7012. \tabexpand
  7013. \setcodequotes
  7014. % Respect line breaks,
  7015. % print special symbols as themselves, and
  7016. % make each space count.
  7017. % Must do in this order:
  7018. \obeylines \uncatcodespecials \sepspaces
  7019. }
  7020. % Do the @verb magic: verbatim text is quoted by unique
  7021. % delimiter characters. Before first delimiter expect a
  7022. % right brace, after last delimiter expect closing brace:
  7023. %
  7024. % \def\doverb'{'<char>#1<char>'}'{#1}
  7025. %
  7026. % [Knuth] p. 382; only eat outer {}
  7027. \begingroup
  7028. \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other
  7029. \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
  7030. \endgroup
  7031. %
  7032. \def\verb{\begingroup\setupverb\doverb}
  7033. %
  7034. %
  7035. % Do the @verbatim magic: define the macro \doverbatim so that
  7036. % the (first) argument ends when '@end verbatim' is reached, ie:
  7037. %
  7038. % \def\doverbatim#1@end verbatim{#1}
  7039. %
  7040. % For Texinfo it's a lot easier than for LaTeX,
  7041. % because texinfo's \verbatim doesn't stop at '\end{verbatim}':
  7042. % we need not redefine '\', '{' and '}'.
  7043. %
  7044. % Inspired by LaTeX's verbatim command set [latex.ltx]
  7045. %
  7046. \begingroup
  7047. \catcode`\ =\active
  7048. \obeylines %
  7049. % ignore everything up to the first ^^M, that's the newline at the end
  7050. % of the @verbatim input line itself. Otherwise we get an extra blank
  7051. % line in the output.
  7052. \xdef\doverbatim#1^^M#2@end verbatim{%
  7053. \starttabbox#2\egroup\noexpand\end\gobble verbatim}%
  7054. % We really want {...\end verbatim} in the body of the macro, but
  7055. % without the active space; thus we have to use \xdef and \gobble.
  7056. % The \egroup ends the \verbbox started at the end of the last line in
  7057. % the block.
  7058. \endgroup
  7059. %
  7060. \envdef\verbatim{%
  7061. \setnormaldispenv\setupverbatim\doverbatim
  7062. }
  7063. \let\Everbatim = \afterenvbreak
  7064. % @verbatiminclude FILE - insert text of file in verbatim environment.
  7065. %
  7066. \def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude}
  7067. %
  7068. \def\doverbatiminclude#1{%
  7069. {%
  7070. \makevalueexpandable
  7071. \setupverbatim
  7072. {%
  7073. \indexnofonts % Allow `@@' and other weird things in file names.
  7074. \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
  7075. \edef\tmp{\noexpand\input #1 }
  7076. \expandafter
  7077. }\expandafter\starttabbox\tmp\egroup
  7078. \afterenvbreak
  7079. }%
  7080. }
  7081. % @copying ... @end copying.
  7082. % Save the text away for @insertcopying later.
  7083. %
  7084. % We save the uninterpreted tokens, rather than creating a box.
  7085. % Saving the text in a box would be much easier, but then all the
  7086. % typesetting commands (@smallbook, font changes, etc.) have to be done
  7087. % beforehand -- and a) we want @copying to be done first in the source
  7088. % file; b) letting users define the frontmatter in as flexible order as
  7089. % possible is desirable.
  7090. %
  7091. \def\copying{\checkenv{}\begingroup\scanargctxt\docopying}
  7092. \def\docopying#1@end copying{\endgroup\def\copyingtext{#1}}
  7093. %
  7094. \def\insertcopying{%
  7095. \begingroup
  7096. \parindent = 0pt % paragraph indentation looks wrong on title page
  7097. \scanexp\copyingtext
  7098. \endgroup
  7099. }
  7100. \message{defuns,}
  7101. % @defun etc.
  7102. \newskip\defbodyindent \defbodyindent=.4in
  7103. \newskip\defargsindent \defargsindent=50pt
  7104. \newskip\deflastargmargin \deflastargmargin=18pt
  7105. \newcount\defunpenalty
  7106. % Start the processing of @deffn:
  7107. \def\startdefun{%
  7108. \ifnum\lastpenalty<10000
  7109. \medbreak
  7110. \defunpenalty=10003 % Will keep this @deffn together with the
  7111. % following @def command, see below.
  7112. \else
  7113. % If there are two @def commands in a row, we'll have a \nobreak,
  7114. % which is there to keep the function description together with its
  7115. % header. But if there's nothing but headers, we need to allow a
  7116. % break somewhere. Check specifically for penalty 10002, inserted
  7117. % by \printdefunline, instead of 10000, since the sectioning
  7118. % commands also insert a nobreak penalty, and we don't want to allow
  7119. % a break between a section heading and a defun.
  7120. %
  7121. % As a further refinement, we avoid "club" headers by signalling
  7122. % with penalty of 10003 after the very first @deffn in the
  7123. % sequence (see above), and penalty of 10002 after any following
  7124. % @def command.
  7125. \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi
  7126. %
  7127. % Similarly, after a section heading, do not allow a break.
  7128. % But do insert the glue.
  7129. \medskip % preceded by discardable penalty, so not a breakpoint
  7130. \fi
  7131. %
  7132. \parindent=0in
  7133. \advance\leftskip by \defbodyindent
  7134. \exdentamount=\defbodyindent
  7135. }
  7136. \def\dodefunx#1{%
  7137. % First, check whether we are in the right environment:
  7138. \checkenv#1%
  7139. %
  7140. % As above, allow line break if we have multiple x headers in a row.
  7141. % It's not a great place, though.
  7142. \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi
  7143. %
  7144. % And now, it's time to reuse the body of the original defun:
  7145. \expandafter\gobbledefun#1%
  7146. }
  7147. \def\gobbledefun#1\startdefun{}
  7148. % \printdefunline \deffnheader{text}
  7149. %
  7150. \def\printdefunline#1#2{%
  7151. \begingroup
  7152. % call \deffnheader:
  7153. #1#2 \endheader
  7154. % common ending:
  7155. \interlinepenalty = 10000
  7156. \advance\rightskip by 0pt plus 1fil\relax
  7157. \endgraf
  7158. \nobreak\vskip -\parskip
  7159. \penalty\defunpenalty % signal to \startdefun and \dodefunx
  7160. % Some of the @defun-type tags do not enable magic parentheses,
  7161. % rendering the following check redundant. But we don't optimize.
  7162. \checkparencounts
  7163. \endgroup
  7164. }
  7165. \def\Edefun{\endgraf\medbreak}
  7166. % \makedefun{deffn} creates \deffn, \deffnx and \Edeffn;
  7167. % the only thing remaining is to define \deffnheader.
  7168. %
  7169. \def\makedefun#1{%
  7170. \expandafter\let\csname E#1\endcsname = \Edefun
  7171. \edef\temp{\noexpand\domakedefun
  7172. \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}%
  7173. \temp
  7174. }
  7175. % \domakedefun \deffn \deffnx \deffnheader { (defn. of \deffnheader) }
  7176. %
  7177. % Define \deffn and \deffnx, without parameters.
  7178. % \deffnheader has to be defined explicitly.
  7179. %
  7180. \def\domakedefun#1#2#3{%
  7181. \envdef#1{%
  7182. \startdefun
  7183. \doingtypefnfalse % distinguish typed functions from all else
  7184. \parseargusing\activeparens{\printdefunline#3}%
  7185. }%
  7186. \def#2{\dodefunx#1}%
  7187. \def#3%
  7188. }
  7189. \newif\ifdoingtypefn % doing typed function?
  7190. \newif\ifrettypeownline % typeset return type on its own line?
  7191. % @deftypefnnewline on|off says whether the return type of typed functions
  7192. % are printed on their own line. This affects @deftypefn, @deftypefun,
  7193. % @deftypeop, and @deftypemethod.
  7194. %
  7195. \parseargdef\deftypefnnewline{%
  7196. \def\temp{#1}%
  7197. \ifx\temp\onword
  7198. \expandafter\let\csname SETtxideftypefnnl\endcsname
  7199. = \empty
  7200. \else\ifx\temp\offword
  7201. \expandafter\let\csname SETtxideftypefnnl\endcsname
  7202. = \relax
  7203. \else
  7204. \errhelp = \EMsimple
  7205. \errmessage{Unknown @txideftypefnnl value `\temp',
  7206. must be on|off}%
  7207. \fi\fi
  7208. }
  7209. % \dosubind {index}{topic}{subtopic}
  7210. %
  7211. % If SUBTOPIC is present, precede it with a space, and call \doind.
  7212. % (At some time during the 20th century, this made a two-level entry in an
  7213. % index such as the operation index. Nobody seemed to notice the change in
  7214. % behaviour though.)
  7215. \def\dosubind#1#2#3{%
  7216. \def\thirdarg{#3}%
  7217. \ifx\thirdarg\empty
  7218. \doind{#1}{#2}%
  7219. \else
  7220. \doind{#1}{#2\space#3}%
  7221. \fi
  7222. }
  7223. % Untyped functions:
  7224. % @deffn category name args
  7225. \makedefun{deffn}{\deffngeneral{}}
  7226. % @deffn category class name args
  7227. \makedefun{defop}#1 {\defopon{#1\ \putwordon}}
  7228. % \defopon {category on}class name args
  7229. \def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
  7230. % \deffngeneral {subind}category name args
  7231. %
  7232. \def\deffngeneral#1#2 #3 #4\endheader{%
  7233. \dosubind{fn}{\code{#3}}{#1}%
  7234. \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
  7235. }
  7236. % Typed functions:
  7237. % @deftypefn category type name args
  7238. \makedefun{deftypefn}{\deftypefngeneral{}}
  7239. % @deftypeop category class type name args
  7240. \makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}}
  7241. % \deftypeopon {category on}class type name args
  7242. \def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
  7243. % \deftypefngeneral {subind}category type name args
  7244. %
  7245. \def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
  7246. \dosubind{fn}{\code{#4}}{#1}%
  7247. \doingtypefntrue
  7248. \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
  7249. }
  7250. % Typed variables:
  7251. % @deftypevr category type var args
  7252. \makedefun{deftypevr}{\deftypecvgeneral{}}
  7253. % @deftypecv category class type var args
  7254. \makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}}
  7255. % \deftypecvof {category of}class type var args
  7256. \def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} }
  7257. % \deftypecvgeneral {subind}category type var args
  7258. %
  7259. \def\deftypecvgeneral#1#2 #3 #4 #5\endheader{%
  7260. \dosubind{vr}{\code{#4}}{#1}%
  7261. \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
  7262. }
  7263. % Untyped variables:
  7264. % @defvr category var args
  7265. \makedefun{defvr}#1 {\deftypevrheader{#1} {} }
  7266. % @defcv category class var args
  7267. \makedefun{defcv}#1 {\defcvof{#1\ \putwordof}}
  7268. % \defcvof {category of}class var args
  7269. \def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
  7270. % Types:
  7271. % @deftp category name args
  7272. \makedefun{deftp}#1 #2 #3\endheader{%
  7273. \doind{tp}{\code{#2}}%
  7274. \defname{#1}{}{#2}\defunargs{#3\unskip}%
  7275. }
  7276. % Remaining @defun-like shortcuts:
  7277. \makedefun{defun}{\deffnheader{\putwordDeffunc} }
  7278. \makedefun{defmac}{\deffnheader{\putwordDefmac} }
  7279. \makedefun{defspec}{\deffnheader{\putwordDefspec} }
  7280. \makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} }
  7281. \makedefun{defvar}{\defvrheader{\putwordDefvar} }
  7282. \makedefun{defopt}{\defvrheader{\putwordDefopt} }
  7283. \makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} }
  7284. \makedefun{defmethod}{\defopon\putwordMethodon}
  7285. \makedefun{deftypemethod}{\deftypeopon\putwordMethodon}
  7286. \makedefun{defivar}{\defcvof\putwordInstanceVariableof}
  7287. \makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof}
  7288. % \defname, which formats the name of the @def (not the args).
  7289. % #1 is the category, such as "Function".
  7290. % #2 is the return type, if any.
  7291. % #3 is the function name.
  7292. %
  7293. % We are followed by (but not passed) the arguments, if any.
  7294. %
  7295. \def\defname#1#2#3{%
  7296. \par
  7297. % Get the values of \leftskip and \rightskip as they were outside the @def...
  7298. \advance\leftskip by -\defbodyindent
  7299. %
  7300. % Determine if we are typesetting the return type of a typed function
  7301. % on a line by itself.
  7302. \rettypeownlinefalse
  7303. \ifdoingtypefn % doing a typed function specifically?
  7304. % then check user option for putting return type on its own line:
  7305. \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else
  7306. \rettypeownlinetrue
  7307. \fi
  7308. \fi
  7309. %
  7310. % How we'll format the category name. Putting it in brackets helps
  7311. % distinguish it from the body text that may end up on the next line
  7312. % just below it.
  7313. \def\temp{#1}%
  7314. \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
  7315. %
  7316. % Figure out line sizes for the paragraph shape. We'll always have at
  7317. % least two.
  7318. \tempnum = 2
  7319. %
  7320. % The first line needs space for \box0; but if \rightskip is nonzero,
  7321. % we need only space for the part of \box0 which exceeds it:
  7322. \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip
  7323. %
  7324. % If doing a return type on its own line, we'll have another line.
  7325. \ifrettypeownline
  7326. \advance\tempnum by 1
  7327. \def\maybeshapeline{0in \hsize}%
  7328. \else
  7329. \def\maybeshapeline{}%
  7330. \fi
  7331. %
  7332. % The continuations:
  7333. \dimen2=\hsize \advance\dimen2 by -\defargsindent
  7334. %
  7335. % The final paragraph shape:
  7336. \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2
  7337. %
  7338. % Put the category name at the right margin.
  7339. \noindent
  7340. \hbox to 0pt{%
  7341. \hfil\box0 \kern-\hsize
  7342. % \hsize has to be shortened this way:
  7343. \kern\leftskip
  7344. % Intentionally do not respect \rightskip, since we need the space.
  7345. }%
  7346. %
  7347. % Allow all lines to be underfull without complaint:
  7348. \tolerance=10000 \hbadness=10000
  7349. \exdentamount=\defbodyindent
  7350. {%
  7351. % defun fonts. We use typewriter by default (used to be bold) because:
  7352. % . we're printing identifiers, they should be in tt in principle.
  7353. % . in languages with many accents, such as Czech or French, it's
  7354. % common to leave accents off identifiers. The result looks ok in
  7355. % tt, but exceedingly strange in rm.
  7356. % . we don't want -- and --- to be treated as ligatures.
  7357. % . this still does not fix the ?` and !` ligatures, but so far no
  7358. % one has made identifiers using them :).
  7359. \df \tt
  7360. \def\temp{#2}% text of the return type
  7361. \ifx\temp\empty\else
  7362. \tclose{\temp}% typeset the return type
  7363. \ifrettypeownline
  7364. % put return type on its own line; prohibit line break following:
  7365. \hfil\vadjust{\nobreak}\break
  7366. \else
  7367. \space % type on same line, so just followed by a space
  7368. \fi
  7369. \fi % no return type
  7370. #3% output function name
  7371. }%
  7372. {\rm\enskip}% hskip 0.5 em of \rmfont
  7373. %
  7374. \boldbrax
  7375. % arguments will be output next, if any.
  7376. }
  7377. % Print arguments in slanted roman (not ttsl), inconsistently with using
  7378. % tt for the name. This is because literal text is sometimes needed in
  7379. % the argument list (groff manual), and ttsl and tt are not very
  7380. % distinguishable. Prevent hyphenation at `-' chars.
  7381. %
  7382. \def\defunargs#1{%
  7383. % use sl by default (not ttsl),
  7384. % tt for the names.
  7385. \df \sl \hyphenchar\font=0
  7386. %
  7387. % On the other hand, if an argument has two dashes (for instance), we
  7388. % want a way to get ttsl. We used to recommend @var for that, so
  7389. % leave the code in, but it's strange for @var to lead to typewriter.
  7390. % Nowadays we recommend @code, since the difference between a ttsl hyphen
  7391. % and a tt hyphen is pretty tiny. @code also disables ?` !`.
  7392. \def\var##1{{\setregularquotes\ttslanted{##1}}}%
  7393. #1%
  7394. \sl\hyphenchar\font=45
  7395. }
  7396. % We want ()&[] to print specially on the defun line.
  7397. %
  7398. \def\activeparens{%
  7399. \catcode`\(=\active \catcode`\)=\active
  7400. \catcode`\[=\active \catcode`\]=\active
  7401. \catcode`\&=\active
  7402. }
  7403. % Make control sequences which act like normal parenthesis chars.
  7404. \let\lparen = ( \let\rparen = )
  7405. % Be sure that we always have a definition for `(', etc. For example,
  7406. % if the fn name has parens in it, \boldbrax will not be in effect yet,
  7407. % so TeX would otherwise complain about undefined control sequence.
  7408. {
  7409. \activeparens
  7410. \global\let(=\lparen \global\let)=\rparen
  7411. \global\let[=\lbrack \global\let]=\rbrack
  7412. \global\let& = \&
  7413. \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
  7414. \gdef\magicamp{\let&=\amprm}
  7415. }
  7416. \let\ampchar\&
  7417. \newcount\parencount
  7418. % If we encounter &foo, then turn on ()-hacking afterwards
  7419. \newif\ifampseen
  7420. \def\amprm#1 {\ampseentrue{\bf\&#1 }}
  7421. \def\parenfont{%
  7422. \ifampseen
  7423. % At the first level, print parens in roman,
  7424. % otherwise use the default font.
  7425. \ifnum \parencount=1 \rm \fi
  7426. \else
  7427. % The \sf parens (in \boldbrax) actually are a little bolder than
  7428. % the contained text. This is especially needed for [ and ] .
  7429. \sf
  7430. \fi
  7431. }
  7432. \def\infirstlevel#1{%
  7433. \ifampseen
  7434. \ifnum\parencount=1
  7435. #1%
  7436. \fi
  7437. \fi
  7438. }
  7439. \def\bfafterword#1 {#1 \bf}
  7440. \def\opnr{%
  7441. \global\advance\parencount by 1
  7442. {\parenfont(}%
  7443. \infirstlevel \bfafterword
  7444. }
  7445. \def\clnr{%
  7446. {\parenfont)}%
  7447. \infirstlevel \sl
  7448. \global\advance\parencount by -1
  7449. }
  7450. \newcount\brackcount
  7451. \def\lbrb{%
  7452. \global\advance\brackcount by 1
  7453. {\bf[}%
  7454. }
  7455. \def\rbrb{%
  7456. {\bf]}%
  7457. \global\advance\brackcount by -1
  7458. }
  7459. \def\checkparencounts{%
  7460. \ifnum\parencount=0 \else \badparencount \fi
  7461. \ifnum\brackcount=0 \else \badbrackcount \fi
  7462. }
  7463. % these should not use \errmessage; the glibc manual, at least, actually
  7464. % has such constructs (when documenting function pointers).
  7465. \def\badparencount{%
  7466. \message{Warning: unbalanced parentheses in @def...}%
  7467. \global\parencount=0
  7468. }
  7469. \def\badbrackcount{%
  7470. \message{Warning: unbalanced square brackets in @def...}%
  7471. \global\brackcount=0
  7472. }
  7473. \message{macros,}
  7474. % @macro.
  7475. % To do this right we need a feature of e-TeX, \scantokens,
  7476. % which we arrange to emulate with a temporary file in ordinary TeX.
  7477. \ifx\eTeXversion\thisisundefined
  7478. \newwrite\macscribble
  7479. \def\scantokens#1{%
  7480. \toks0={#1}%
  7481. \immediate\openout\macscribble=\jobname.tmp
  7482. \immediate\write\macscribble{\the\toks0}%
  7483. \immediate\closeout\macscribble
  7484. \input \jobname.tmp
  7485. }
  7486. \fi
  7487. \let\E=\expandafter
  7488. % Used at the time of macro expansion.
  7489. % Argument is macro body with arguments substituted
  7490. \def\scanmacro#1{%
  7491. \newlinechar`\^^M
  7492. % expand the expansion of \eatleadingcr twice to maybe remove a leading
  7493. % newline (and \else and \fi tokens), then call \eatspaces on the result.
  7494. \def\xeatspaces##1{%
  7495. \E\E\E\E\E\E\E\eatspaces\E\E\E\E\E\E\E{\eatleadingcr##1%
  7496. }}%
  7497. \def\xempty##1{}%
  7498. %
  7499. % Process the macro body under the current catcode regime.
  7500. \scantokens{#1@comment}%
  7501. %
  7502. % The \comment is to remove the \newlinechar added by \scantokens, and
  7503. % can be noticed by \parsearg. Note \c isn't used because this means cedilla
  7504. % in math mode.
  7505. }
  7506. % Used for copying and captions
  7507. \def\scanexp#1{%
  7508. \expandafter\scanmacro\expandafter{#1}%
  7509. }
  7510. \newcount\paramno % Count of parameters
  7511. \newtoks\macname % Macro name
  7512. \newif\ifrecursive % Is it recursive?
  7513. % List of all defined macros in the form
  7514. % \commondummyword\macro1\commondummyword\macro2...
  7515. % Currently is also contains all @aliases; the list can be split
  7516. % if there is a need.
  7517. \def\macrolist{}
  7518. % Add the macro to \macrolist
  7519. \def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname}
  7520. \def\addtomacrolistxxx#1{%
  7521. \toks0 = \expandafter{\macrolist\commondummyword#1}%
  7522. \xdef\macrolist{\the\toks0}%
  7523. }
  7524. % Utility routines.
  7525. % This does \let #1 = #2, with \csnames; that is,
  7526. % \let \csname#1\endcsname = \csname#2\endcsname
  7527. % (except of course we have to play expansion games).
  7528. %
  7529. \def\cslet#1#2{%
  7530. \expandafter\let
  7531. \csname#1\expandafter\endcsname
  7532. \csname#2\endcsname
  7533. }
  7534. % Trim leading and trailing spaces off a string.
  7535. % Concepts from aro-bend problem 15 (see CTAN).
  7536. {\catcode`\@=11
  7537. \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
  7538. \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
  7539. \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
  7540. \def\unbrace#1{#1}
  7541. \unbrace{\gdef\trim@@@ #1 } #2@{#1}
  7542. }
  7543. {\catcode`\^^M=\other%
  7544. \gdef\eatleadingcr#1{\if\noexpand#1\noexpand^^M\else\E#1\fi}}%
  7545. % Warning: this won't work for a delimited argument
  7546. % or for an empty argument
  7547. % Trim a single trailing ^^M off a string.
  7548. {\catcode`\^^M=\other \catcode`\Q=3%
  7549. \gdef\eatcr #1{\eatcra #1Q^^MQ}%
  7550. \gdef\eatcra#1^^MQ{\eatcrb#1Q}%
  7551. \gdef\eatcrb#1Q#2Q{#1}%
  7552. }
  7553. % Macro bodies are absorbed as an argument in a context where
  7554. % all characters are catcode 10, 11 or 12, except \ which is active
  7555. % (as in normal texinfo). It is necessary to change the definition of \
  7556. % to recognize macro arguments; this is the job of \mbodybackslash.
  7557. %
  7558. % Non-ASCII encodings make 8-bit characters active, so un-activate
  7559. % them to avoid their expansion. Must do this non-globally, to
  7560. % confine the change to the current group.
  7561. %
  7562. % It's necessary to have hard CRs when the macro is executed. This is
  7563. % done by making ^^M (\endlinechar) catcode 12 when reading the macro
  7564. % body, and then making it the \newlinechar in \scanmacro.
  7565. %
  7566. \def\scanctxt{% used as subroutine
  7567. \catcode`\"=\other
  7568. \catcode`\+=\other
  7569. \catcode`\<=\other
  7570. \catcode`\>=\other
  7571. \catcode`\^=\other
  7572. \catcode`\_=\other
  7573. \catcode`\|=\other
  7574. \catcode`\~=\other
  7575. \passthroughcharstrue
  7576. }
  7577. \def\scanargctxt{% used for copying and captions, not macros.
  7578. \scanctxt
  7579. \catcode`\@=\other
  7580. \catcode`\\=\other
  7581. \catcode`\^^M=\other
  7582. }
  7583. \def\macrobodyctxt{% used for @macro definitions
  7584. \scanctxt
  7585. \catcode`\ =\other
  7586. \catcode`\@=\other
  7587. \catcode`\{=\other
  7588. \catcode`\}=\other
  7589. \catcode`\^^M=\other
  7590. \usembodybackslash
  7591. }
  7592. % Used when scanning braced macro arguments. Note, however, that catcode
  7593. % changes here are ineffectual if the macro invocation was nested inside
  7594. % an argument to another Texinfo command.
  7595. \def\macroargctxt{%
  7596. \scanctxt
  7597. \catcode`\ =\active
  7598. \catcode`\@=\other
  7599. \catcode`\^^M=\other
  7600. \catcode`\\=\active
  7601. }
  7602. \def\macrolineargctxt{% used for whole-line arguments without braces
  7603. \scanctxt
  7604. \catcode`\@=\other
  7605. \catcode`\{=\other
  7606. \catcode`\}=\other
  7607. }
  7608. % \mbodybackslash is the definition of \ in @macro bodies.
  7609. % It maps \foo\ => \csname macarg.foo\endcsname => #N
  7610. % where N is the macro parameter number.
  7611. % We define \csname macarg.\endcsname to be \realbackslash, so
  7612. % \\ in macro replacement text gets you a backslash.
  7613. %
  7614. {\catcode`@=0 @catcode`@\=@active
  7615. @gdef@usembodybackslash{@let\=@mbodybackslash}
  7616. @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
  7617. }
  7618. \expandafter\def\csname macarg.\endcsname{\realbackslash}
  7619. \def\margbackslash#1{\char`\#1 }
  7620. \def\macro{\recursivefalse\parsearg\macroxxx}
  7621. \def\rmacro{\recursivetrue\parsearg\macroxxx}
  7622. \def\macroxxx#1{%
  7623. \getargs{#1}% now \macname is the macname and \argl the arglist
  7624. \ifx\argl\empty % no arguments
  7625. \paramno=0\relax
  7626. \else
  7627. \expandafter\parsemargdef \argl;%
  7628. \if\paramno>256\relax
  7629. \ifx\eTeXversion\thisisundefined
  7630. \errhelp = \EMsimple
  7631. \errmessage{You need eTeX to compile a file with macros with more than 256 arguments}
  7632. \fi
  7633. \fi
  7634. \fi
  7635. \if1\csname ismacro.\the\macname\endcsname
  7636. \message{Warning: redefining \the\macname}%
  7637. \else
  7638. \expandafter\ifx\csname \the\macname\endcsname \relax
  7639. \else \errmessage{Macro name \the\macname\space already defined}\fi
  7640. \global\cslet{macsave.\the\macname}{\the\macname}%
  7641. \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
  7642. \addtomacrolist{\the\macname}%
  7643. \fi
  7644. \begingroup \macrobodyctxt
  7645. \ifrecursive \expandafter\parsermacbody
  7646. \else \expandafter\parsemacbody
  7647. \fi}
  7648. \parseargdef\unmacro{%
  7649. \if1\csname ismacro.#1\endcsname
  7650. \global\cslet{#1}{macsave.#1}%
  7651. \global\expandafter\let \csname ismacro.#1\endcsname=0%
  7652. % Remove the macro name from \macrolist:
  7653. \begingroup
  7654. \expandafter\let\csname#1\endcsname \relax
  7655. \let\commondummyword\unmacrodo
  7656. \xdef\macrolist{\macrolist}%
  7657. \endgroup
  7658. \else
  7659. \errmessage{Macro #1 not defined}%
  7660. \fi
  7661. }
  7662. % Called by \do from \dounmacro on each macro. The idea is to omit any
  7663. % macro definitions that have been changed to \relax.
  7664. %
  7665. \def\unmacrodo#1{%
  7666. \ifx #1\relax
  7667. % remove this
  7668. \else
  7669. \noexpand\commondummyword \noexpand#1%
  7670. \fi
  7671. }
  7672. % \getargs -- Parse the arguments to a @macro line. Set \macname to
  7673. % the name of the macro, and \argl to the braced argument list.
  7674. \def\getargs#1{\getargsxxx#1{}}
  7675. \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
  7676. \def\getmacname#1 #2\relax{\macname={#1}}
  7677. \def\getmacargs#1{\def\argl{#1}}
  7678. % This made use of the feature that if the last token of a
  7679. % <parameter list> is #, then the preceding argument is delimited by
  7680. % an opening brace, and that opening brace is not consumed.
  7681. % Parse the optional {params} list to @macro or @rmacro.
  7682. % Set \paramno to the number of arguments,
  7683. % and \paramlist to a parameter text for the macro (e.g. #1,#2,#3 for a
  7684. % three-param macro.) Define \macarg.BLAH for each BLAH in the params
  7685. % list to some hook where the argument is to be expanded. If there are
  7686. % less than 10 arguments that hook is to be replaced by ##N where N
  7687. % is the position in that list, that is to say the macro arguments are to be
  7688. % defined `a la TeX in the macro body.
  7689. %
  7690. % That gets used by \mbodybackslash (above).
  7691. %
  7692. % If there are 10 or more arguments, a different technique is used: see
  7693. % \parsemmanyargdef.
  7694. %
  7695. \def\parsemargdef#1;{%
  7696. \paramno=0\def\paramlist{}%
  7697. \let\hash\relax
  7698. % \hash is redefined to `#' later to get it into definitions
  7699. \let\xeatspaces\relax
  7700. \let\xempty\relax
  7701. \parsemargdefxxx#1,;,%
  7702. \ifnum\paramno<10\relax\else
  7703. \paramno0\relax
  7704. \parsemmanyargdef@@#1,;,% 10 or more arguments
  7705. \fi
  7706. }
  7707. \def\parsemargdefxxx#1,{%
  7708. \if#1;\let\next=\relax
  7709. \else \let\next=\parsemargdefxxx
  7710. \advance\paramno by 1
  7711. \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
  7712. {\xeatspaces{\hash\the\paramno\noexpand\xempty{}}}%
  7713. \edef\paramlist{\paramlist\hash\the\paramno,}%
  7714. \fi\next}
  7715. % the \xempty{} is to give \eatleadingcr an argument in the case of an
  7716. % empty macro argument.
  7717. % \parsemacbody, \parsermacbody
  7718. %
  7719. % Read recursive and nonrecursive macro bodies. (They're different since
  7720. % rec and nonrec macros end differently.)
  7721. %
  7722. % We are in \macrobodyctxt, and the \xdef causes backslashshes in the macro
  7723. % body to be transformed.
  7724. % Set \macrobody to the body of the macro, and call \defmacro.
  7725. %
  7726. {\catcode`\ =\other\long\gdef\parsemacbody#1@end macro{%
  7727. \xdef\macrobody{\eatcr{#1}}\endgroup\defmacro}}%
  7728. {\catcode`\ =\other\long\gdef\parsermacbody#1@end rmacro{%
  7729. \xdef\macrobody{\eatcr{#1}}\endgroup\defmacro}}%
  7730. % Make @ a letter, so that we can make private-to-Texinfo macro names.
  7731. \edef\texiatcatcode{\the\catcode`\@}
  7732. \catcode `@=11\relax
  7733. %%%%%%%%%%%%%% Code for > 10 arguments only %%%%%%%%%%%%%%%%%%
  7734. % If there are 10 or more arguments, a different technique is used, where the
  7735. % hook remains in the body, and when macro is to be expanded the body is
  7736. % processed again to replace the arguments.
  7737. %
  7738. % In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the
  7739. % argument N value and then \edef the body (nothing else will expand because of
  7740. % the catcode regime under which the body was input).
  7741. %
  7742. % If you compile with TeX (not eTeX), and you have macros with 10 or more
  7743. % arguments, no macro can have more than 256 arguments (else error).
  7744. %
  7745. % In case that there are 10 or more arguments we parse again the arguments
  7746. % list to set new definitions for the \macarg.BLAH macros corresponding to
  7747. % each BLAH argument. It was anyhow needed to parse already once this list
  7748. % in order to count the arguments, and as macros with at most 9 arguments
  7749. % are by far more frequent than macro with 10 or more arguments, defining
  7750. % twice the \macarg.BLAH macros does not cost too much processing power.
  7751. \def\parsemmanyargdef@@#1,{%
  7752. \if#1;\let\next=\relax
  7753. \else
  7754. \let\next=\parsemmanyargdef@@
  7755. \edef\tempb{\eatspaces{#1}}%
  7756. \expandafter\def\expandafter\tempa
  7757. \expandafter{\csname macarg.\tempb\endcsname}%
  7758. % Note that we need some extra \noexpand\noexpand, this is because we
  7759. % don't want \the to be expanded in the \parsermacbody as it uses an
  7760. % \xdef .
  7761. \expandafter\edef\tempa
  7762. {\noexpand\noexpand\noexpand\the\toks\the\paramno}%
  7763. \advance\paramno by 1\relax
  7764. \fi\next}
  7765. \let\endargs@\relax
  7766. \let\nil@\relax
  7767. \def\nilm@{\nil@}%
  7768. \long\def\nillm@{\nil@}%
  7769. % This macro is expanded during the Texinfo macro expansion, not during its
  7770. % definition. It gets all the arguments' values and assigns them to macros
  7771. % macarg.ARGNAME
  7772. %
  7773. % #1 is the macro name
  7774. % #2 is the list of argument names
  7775. % #3 is the list of argument values
  7776. \def\getargvals@#1#2#3{%
  7777. \def\macargdeflist@{}%
  7778. \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion.
  7779. \def\paramlist{#2,\nil@}%
  7780. \def\macroname{#1}%
  7781. \begingroup
  7782. \macroargctxt
  7783. \def\argvaluelist{#3,\nil@}%
  7784. \def\@tempa{#3}%
  7785. \ifx\@tempa\empty
  7786. \setemptyargvalues@
  7787. \else
  7788. \getargvals@@
  7789. \fi
  7790. }
  7791. \def\getargvals@@{%
  7792. \ifx\paramlist\nilm@
  7793. % Some sanity check needed here that \argvaluelist is also empty.
  7794. \ifx\argvaluelist\nillm@
  7795. \else
  7796. \errhelp = \EMsimple
  7797. \errmessage{Too many arguments in macro `\macroname'!}%
  7798. \fi
  7799. \let\next\macargexpandinbody@
  7800. \else
  7801. \ifx\argvaluelist\nillm@
  7802. % No more arguments values passed to macro. Set remaining named-arg
  7803. % macros to empty.
  7804. \let\next\setemptyargvalues@
  7805. \else
  7806. % pop current arg name into \@tempb
  7807. \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}%
  7808. \expandafter\@tempa\expandafter{\paramlist}%
  7809. % pop current argument value into \@tempc
  7810. \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}%
  7811. \expandafter\@tempa\expandafter{\argvaluelist}%
  7812. % Here \@tempb is the current arg name and \@tempc is the current arg value.
  7813. % First place the new argument macro definition into \@tempd
  7814. \expandafter\macname\expandafter{\@tempc}%
  7815. \expandafter\let\csname macarg.\@tempb\endcsname\relax
  7816. \expandafter\def\expandafter\@tempe\expandafter{%
  7817. \csname macarg.\@tempb\endcsname}%
  7818. \edef\@tempd{\long\def\@tempe{\the\macname}}%
  7819. \push@\@tempd\macargdeflist@
  7820. \let\next\getargvals@@
  7821. \fi
  7822. \fi
  7823. \next
  7824. }
  7825. \def\push@#1#2{%
  7826. \expandafter\expandafter\expandafter\def
  7827. \expandafter\expandafter\expandafter#2%
  7828. \expandafter\expandafter\expandafter{%
  7829. \expandafter#1#2}%
  7830. }
  7831. % Replace arguments by their values in the macro body, and place the result
  7832. % in macro \@tempa.
  7833. %
  7834. \def\macvalstoargs@{%
  7835. % To do this we use the property that token registers that are \the'ed
  7836. % within an \edef expand only once. So we are going to place all argument
  7837. % values into respective token registers.
  7838. %
  7839. % First we save the token context, and initialize argument numbering.
  7840. \begingroup
  7841. \paramno0\relax
  7842. % Then, for each argument number #N, we place the corresponding argument
  7843. % value into a new token list register \toks#N
  7844. \expandafter\putargsintokens@\saveparamlist@,;,%
  7845. % Then, we expand the body so that argument are replaced by their
  7846. % values. The trick for values not to be expanded themselves is that they
  7847. % are within tokens and that tokens expand only once in an \edef .
  7848. \edef\@tempc{\csname mac.\macroname .body\endcsname}%
  7849. % Now we restore the token stack pointer to free the token list registers
  7850. % which we have used, but we make sure that expanded body is saved after
  7851. % group.
  7852. \expandafter
  7853. \endgroup
  7854. \expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
  7855. }
  7856. % Define the named-macro outside of this group and then close this group.
  7857. %
  7858. \def\macargexpandinbody@{%
  7859. \expandafter
  7860. \endgroup
  7861. \macargdeflist@
  7862. % First the replace in body the macro arguments by their values, the result
  7863. % is in \@tempa .
  7864. \macvalstoargs@
  7865. % Then we point at the \norecurse or \gobble (for recursive) macro value
  7866. % with \@tempb .
  7867. \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname
  7868. % Depending on whether it is recursive or not, we need some tailing
  7869. % \egroup .
  7870. \ifx\@tempb\gobble
  7871. \let\@tempc\relax
  7872. \else
  7873. \let\@tempc\egroup
  7874. \fi
  7875. % And now we do the real job:
  7876. \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}%
  7877. \@tempd
  7878. }
  7879. \def\putargsintokens@#1,{%
  7880. \if#1;\let\next\relax
  7881. \else
  7882. \let\next\putargsintokens@
  7883. % First we allocate the new token list register, and give it a temporary
  7884. % alias \@tempb .
  7885. \toksdef\@tempb\the\paramno
  7886. % Then we place the argument value into that token list register.
  7887. \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname
  7888. \expandafter\@tempb\expandafter{\@tempa}%
  7889. \advance\paramno by 1\relax
  7890. \fi
  7891. \next
  7892. }
  7893. % Trailing missing arguments are set to empty.
  7894. %
  7895. \def\setemptyargvalues@{%
  7896. \ifx\paramlist\nilm@
  7897. \let\next\macargexpandinbody@
  7898. \else
  7899. \expandafter\setemptyargvaluesparser@\paramlist\endargs@
  7900. \let\next\setemptyargvalues@
  7901. \fi
  7902. \next
  7903. }
  7904. \def\setemptyargvaluesparser@#1,#2\endargs@{%
  7905. \expandafter\def\expandafter\@tempa\expandafter{%
  7906. \expandafter\def\csname macarg.#1\endcsname{}}%
  7907. \push@\@tempa\macargdeflist@
  7908. \def\paramlist{#2}%
  7909. }
  7910. % #1 is the element target macro
  7911. % #2 is the list macro
  7912. % #3,#4\endargs@ is the list value
  7913. \def\pop@#1#2#3,#4\endargs@{%
  7914. \def#1{#3}%
  7915. \def#2{#4}%
  7916. }
  7917. \long\def\longpop@#1#2#3,#4\endargs@{%
  7918. \long\def#1{#3}%
  7919. \long\def#2{#4}%
  7920. }
  7921. %%%%%%%%%%%%%% End of code for > 10 arguments %%%%%%%%%%%%%%%%%%
  7922. % This defines a Texinfo @macro or @rmacro, called by \parsemacbody.
  7923. % \macrobody has the body of the macro in it, with placeholders for
  7924. % its parameters, looking like "\xeatspaces{\hash 1}".
  7925. % \paramno is the number of parameters
  7926. % \paramlist is a TeX parameter text, e.g. "#1,#2,#3,"
  7927. % There are four cases: macros of zero, one, up to nine, and many arguments.
  7928. % \xdef is used so that macro definitions will survive the file
  7929. % they're defined in: @include reads the file inside a group.
  7930. %
  7931. \def\defmacro{%
  7932. \let\hash=##% convert placeholders to macro parameter chars
  7933. \ifnum\paramno=1
  7934. \def\xeatspaces##1{##1}%
  7935. % This removes the pair of braces around the argument. We don't
  7936. % use \eatspaces, because this can cause ends of lines to be lost
  7937. % when the argument to \eatspaces is read, leading to line-based
  7938. % commands like "@itemize" not being read correctly.
  7939. \else
  7940. \let\xeatspaces\relax % suppress expansion
  7941. \fi
  7942. \ifcase\paramno
  7943. % 0
  7944. \expandafter\xdef\csname\the\macname\endcsname{%
  7945. \bgroup
  7946. \noexpand\spaceisspace
  7947. \noexpand\endlineisspace
  7948. \noexpand\expandafter % skip any whitespace after the macro name.
  7949. \expandafter\noexpand\csname\the\macname @@@\endcsname}%
  7950. \expandafter\xdef\csname\the\macname @@@\endcsname{%
  7951. \egroup
  7952. \noexpand\scanmacro{\macrobody}}%
  7953. \or % 1
  7954. \expandafter\xdef\csname\the\macname\endcsname{%
  7955. \bgroup
  7956. \noexpand\braceorline
  7957. \expandafter\noexpand\csname\the\macname @@@\endcsname}%
  7958. \expandafter\xdef\csname\the\macname @@@\endcsname##1{%
  7959. \egroup
  7960. \noexpand\scanmacro{\macrobody}%
  7961. }%
  7962. \else % at most 9
  7963. \ifnum\paramno<10\relax
  7964. % @MACNAME sets the context for reading the macro argument
  7965. % @MACNAME@@ gets the argument, processes backslashes and appends a
  7966. % comma.
  7967. % @MACNAME@@@ removes braces surrounding the argument list.
  7968. % @MACNAME@@@@ scans the macro body with arguments substituted.
  7969. \expandafter\xdef\csname\the\macname\endcsname{%
  7970. \bgroup
  7971. \noexpand\expandafter % This \expandafter skip any spaces after the
  7972. \noexpand\macroargctxt % macro before we change the catcode of space.
  7973. \noexpand\expandafter
  7974. \expandafter\noexpand\csname\the\macname @@\endcsname}%
  7975. \expandafter\xdef\csname\the\macname @@\endcsname##1{%
  7976. \noexpand\passargtomacro
  7977. \expandafter\noexpand\csname\the\macname @@@\endcsname{##1,}}%
  7978. \expandafter\xdef\csname\the\macname @@@\endcsname##1{%
  7979. \expandafter\noexpand\csname\the\macname @@@@\endcsname ##1}%
  7980. \expandafter\expandafter
  7981. \expandafter\xdef
  7982. \expandafter\expandafter
  7983. \csname\the\macname @@@@\endcsname\paramlist{%
  7984. \egroup\noexpand\scanmacro{\macrobody}}%
  7985. \else % 10 or more:
  7986. \expandafter\xdef\csname\the\macname\endcsname{%
  7987. \noexpand\getargvals@{\the\macname}{\argl}%
  7988. }%
  7989. \global\expandafter\let\csname mac.\the\macname .body\endcsname\macrobody
  7990. \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble
  7991. \fi
  7992. \fi}
  7993. \catcode `\@\texiatcatcode\relax % end private-to-Texinfo catcodes
  7994. \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
  7995. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  7996. %
  7997. {\catcode`\@=0 \catcode`\\=13 % We need to manipulate \ so use @ as escape
  7998. @catcode`@_=11 % private names
  7999. @catcode`@!=11 % used as argument separator
  8000. % \passargtomacro#1#2 -
  8001. % Call #1 with a list of tokens #2, with any doubled backslashes in #2
  8002. % compressed to one.
  8003. %
  8004. % This implementation works by expansion, and not execution (so we cannot use
  8005. % \def or similar). This reduces the risk of this failing in contexts where
  8006. % complete expansion is done with no execution (for example, in writing out to
  8007. % an auxiliary file for an index entry).
  8008. %
  8009. % State is kept in the input stream: the argument passed to
  8010. % @look_ahead, @gobble_and_check_finish and @add_segment is
  8011. %
  8012. % THE_MACRO ARG_RESULT ! {PENDING_BS} NEXT_TOKEN (... rest of input)
  8013. %
  8014. % where:
  8015. % THE_MACRO - name of the macro we want to call
  8016. % ARG_RESULT - argument list we build to pass to that macro
  8017. % PENDING_BS - either a backslash or nothing
  8018. % NEXT_TOKEN - used to look ahead in the input stream to see what's coming next
  8019. @gdef@passargtomacro#1#2{%
  8020. @add_segment #1!{}@relax#2\@_finish\%
  8021. }
  8022. @gdef@_finish{@_finishx} @global@let@_finishx@relax
  8023. % #1 - THE_MACRO ARG_RESULT
  8024. % #2 - PENDING_BS
  8025. % #3 - NEXT_TOKEN
  8026. % #4 used to look ahead
  8027. %
  8028. % If the next token is not a backslash, process the rest of the argument;
  8029. % otherwise, remove the next token.
  8030. @gdef@look_ahead#1!#2#3#4{%
  8031. @ifx#4\%
  8032. @expandafter@gobble_and_check_finish
  8033. @else
  8034. @expandafter@add_segment
  8035. @fi#1!{#2}#4#4%
  8036. }
  8037. % #1 - THE_MACRO ARG_RESULT
  8038. % #2 - PENDING_BS
  8039. % #3 - NEXT_TOKEN
  8040. % #4 should be a backslash, which is gobbled.
  8041. % #5 looks ahead
  8042. %
  8043. % Double backslash found. Add a single backslash, and look ahead.
  8044. @gdef@gobble_and_check_finish#1!#2#3#4#5{%
  8045. @add_segment#1\!{}#5#5%
  8046. }
  8047. @gdef@is_fi{@fi}
  8048. % #1 - THE_MACRO ARG_RESULT
  8049. % #2 - PENDING_BS
  8050. % #3 - NEXT_TOKEN
  8051. % #4 is input stream until next backslash
  8052. %
  8053. % Input stream is either at the start of the argument, or just after a
  8054. % backslash sequence, either a lone backslash, or a doubled backslash.
  8055. % NEXT_TOKEN contains the first token in the input stream: if it is \finish,
  8056. % finish; otherwise, append to ARG_RESULT the segment of the argument up until
  8057. % the next backslash. PENDING_BACKSLASH contains a backslash to represent
  8058. % a backslash just before the start of the input stream that has not been
  8059. % added to ARG_RESULT.
  8060. @gdef@add_segment#1!#2#3#4\{%
  8061. @ifx#3@_finish
  8062. @call_the_macro#1!%
  8063. @else
  8064. % append the pending backslash to the result, followed by the next segment
  8065. @expandafter@is_fi@look_ahead#1#2#4!{\}@fi
  8066. % this @fi is discarded by @look_ahead.
  8067. % we can't get rid of it with \expandafter because we don't know how
  8068. % long #4 is.
  8069. }
  8070. % #1 - THE_MACRO
  8071. % #2 - ARG_RESULT
  8072. % #3 discards the res of the conditional in @add_segment, and @is_fi ends the
  8073. % conditional.
  8074. @gdef@call_the_macro#1#2!#3@fi{@is_fi #1{#2}}
  8075. }
  8076. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  8077. % \braceorline MAC is used for a one-argument macro MAC. It checks
  8078. % whether the next non-whitespace character is a {. It sets the context
  8079. % for reading the argument (slightly different in the two cases). Then,
  8080. % to read the argument, in the whole-line case, it then calls the regular
  8081. % \parsearg MAC; in the lbrace case, it calls \passargtomacro MAC.
  8082. %
  8083. \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
  8084. \def\braceorlinexxx{%
  8085. \ifx\nchar\bgroup
  8086. \macroargctxt
  8087. \expandafter\passargtomacro
  8088. \else
  8089. \macrolineargctxt\expandafter\parsearg
  8090. \fi \macnamexxx}
  8091. % @alias.
  8092. % We need some trickery to remove the optional spaces around the equal
  8093. % sign. Make them active and then expand them all to nothing.
  8094. %
  8095. \def\alias{\parseargusing\obeyspaces\aliasxxx}
  8096. \def\aliasxxx #1{\aliasyyy#1\relax}
  8097. \def\aliasyyy #1=#2\relax{%
  8098. {%
  8099. \expandafter\let\obeyedspace=\empty
  8100. \addtomacrolist{#1}%
  8101. \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%
  8102. }%
  8103. \next
  8104. }
  8105. \message{cross references,}
  8106. \newwrite\auxfile
  8107. \newif\ifhavexrefs % True if xref values are known.
  8108. \newif\ifwarnedxrefs % True if we warned once that they aren't known.
  8109. % @inforef is relatively simple.
  8110. \def\inforef #1{\inforefzzz #1,,,,**}
  8111. \def\inforefzzz #1,#2,#3,#4**{%
  8112. \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
  8113. node \samp{\ignorespaces#1{}}}
  8114. % @node's only job in TeX is to define \lastnode, which is used in
  8115. % cross-references. The @node line might or might not have commas, and
  8116. % might or might not have spaces before the first comma, like:
  8117. % @node foo , bar , ...
  8118. % We don't want such trailing spaces in the node name.
  8119. %
  8120. \parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse}
  8121. %
  8122. % also remove a trailing comma, in case of something like this:
  8123. % @node Help-Cross, , , Cross-refs
  8124. \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
  8125. \def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}\omittopnode}
  8126. % Used so that the @top node doesn't have to be wrapped in an @ifnottex
  8127. % conditional.
  8128. % \doignore goes to more effort to skip nested conditionals but we don't need
  8129. % that here.
  8130. \def\omittopnode{%
  8131. \ifx\lastnode\wordTop
  8132. \expandafter\ignorenode\fi
  8133. }
  8134. \def\wordTop{Top}
  8135. % Until the next @node or @bye command, divert output to a box that is not
  8136. % output.
  8137. \def\ignorenode{\setbox\dummybox\vbox\bgroup\def\node{\egroup\node}%
  8138. \ignorenodebye
  8139. }
  8140. {\let\bye\relax
  8141. \gdef\ignorenodebye{\let\bye\ignorenodebyedef}
  8142. \gdef\ignorenodebyedef{\egroup(`Top' node ignored)\bye}}
  8143. % The redefinition of \bye here is because it is declared \outer
  8144. \let\lastnode=\empty
  8145. % Write a cross-reference definition for the current node. #1 is the
  8146. % type (Ynumbered, Yappendix, Ynothing).
  8147. %
  8148. \def\donoderef#1{%
  8149. \ifx\lastnode\empty\else
  8150. \setref{\lastnode}{#1}%
  8151. \global\let\lastnode=\empty
  8152. \fi
  8153. }
  8154. % @anchor{NAME} -- define xref target at arbitrary point.
  8155. %
  8156. \newcount\savesfregister
  8157. %
  8158. \def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
  8159. \def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
  8160. \def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
  8161. % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
  8162. % anchor), which consists of three parts:
  8163. % 1) NAME-title - the current sectioning name taken from \currentsection,
  8164. % or the anchor name.
  8165. % 2) NAME-snt - section number and type, passed as the SNT arg, or
  8166. % empty for anchors.
  8167. % 3) NAME-pg - the page number.
  8168. %
  8169. % This is called from \donoderef, \anchor, and \dofloat. In the case of
  8170. % floats, there is an additional part, which is not written here:
  8171. % 4) NAME-lof - the text as it should appear in a @listoffloats.
  8172. %
  8173. \def\setref#1#2{%
  8174. \pdfmkdest{#1}%
  8175. \iflinks
  8176. {%
  8177. \requireauxfile
  8178. \atdummies % preserve commands, but don't expand them
  8179. % match definition in \xrdef, \refx, \xrefX.
  8180. \def\value##1{##1}%
  8181. \edef\writexrdef##1##2{%
  8182. \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
  8183. ##1}{##2}}% these are parameters of \writexrdef
  8184. }%
  8185. \toks0 = \expandafter{\currentsection}%
  8186. \immediate \writexrdef{title}{\the\toks0 }%
  8187. \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
  8188. \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout
  8189. }%
  8190. \fi
  8191. }
  8192. % @xrefautosectiontitle on|off says whether @section(ing) names are used
  8193. % automatically in xrefs, if the third arg is not explicitly specified.
  8194. % This was provided as a "secret" @set xref-automatic-section-title
  8195. % variable, now it's official.
  8196. %
  8197. \parseargdef\xrefautomaticsectiontitle{%
  8198. \def\temp{#1}%
  8199. \ifx\temp\onword
  8200. \expandafter\let\csname SETxref-automatic-section-title\endcsname
  8201. = \empty
  8202. \else\ifx\temp\offword
  8203. \expandafter\let\csname SETxref-automatic-section-title\endcsname
  8204. = \relax
  8205. \else
  8206. \errhelp = \EMsimple
  8207. \errmessage{Unknown @xrefautomaticsectiontitle value `\temp',
  8208. must be on|off}%
  8209. \fi\fi
  8210. }
  8211. %
  8212. % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
  8213. % the node name, #2 the name of the Info cross-reference, #3 the printed
  8214. % node name, #4 the name of the Info file, #5 the name of the printed
  8215. % manual. All but the node name can be omitted.
  8216. %
  8217. \def\pxref{\putwordsee{} \xrefXX}
  8218. \def\xref{\putwordSee{} \xrefXX}
  8219. \def\ref{\xrefXX}
  8220. \def\xrefXX#1{\def\xrefXXarg{#1}\futurelet\tokenafterxref\xrefXXX}
  8221. \def\xrefXXX{\expandafter\xrefX\expandafter[\xrefXXarg,,,,,,,]}
  8222. %
  8223. \newbox\toprefbox
  8224. \newbox\printedrefnamebox
  8225. \newbox\infofilenamebox
  8226. \newbox\printedmanualbox
  8227. %
  8228. \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
  8229. \unsepspaces
  8230. %
  8231. % Get args without leading/trailing spaces.
  8232. \def\printedrefname{\ignorespaces #3}%
  8233. \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}%
  8234. %
  8235. \def\infofilename{\ignorespaces #4}%
  8236. \setbox\infofilenamebox = \hbox{\infofilename\unskip}%
  8237. %
  8238. \def\printedmanual{\ignorespaces #5}%
  8239. \setbox\printedmanualbox = \hbox{\printedmanual\unskip}%
  8240. %
  8241. % If the printed reference name (arg #3) was not explicitly given in
  8242. % the @xref, figure out what we want to use.
  8243. \ifdim \wd\printedrefnamebox = 0pt
  8244. % No printed node name was explicitly given.
  8245. \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax
  8246. % Not auto section-title: use node name inside the square brackets.
  8247. \def\printedrefname{\ignorespaces #1}%
  8248. \else
  8249. % Auto section-title: use chapter/section title inside
  8250. % the square brackets if we have it.
  8251. \ifdim \wd\printedmanualbox > 0pt
  8252. % It is in another manual, so we don't have it; use node name.
  8253. \def\printedrefname{\ignorespaces #1}%
  8254. \else
  8255. \ifhavexrefs
  8256. % We (should) know the real title if we have the xref values.
  8257. \def\printedrefname{\refx{#1-title}}%
  8258. \else
  8259. % Otherwise just copy the Info node name.
  8260. \def\printedrefname{\ignorespaces #1}%
  8261. \fi%
  8262. \fi
  8263. \fi
  8264. \fi
  8265. %
  8266. % Make link in pdf output.
  8267. \ifpdf
  8268. % For pdfTeX and LuaTeX
  8269. {\indexnofonts
  8270. \makevalueexpandable
  8271. \turnoffactive
  8272. % This expands tokens, so do it after making catcode changes, so _
  8273. % etc. don't get their TeX definitions. This ignores all spaces in
  8274. % #4, including (wrongly) those in the middle of the filename.
  8275. \getfilename{#4}%
  8276. %
  8277. % This (wrongly) does not take account of leading or trailing
  8278. % spaces in #1, which should be ignored.
  8279. \setpdfdestname{#1}%
  8280. %
  8281. \ifx\pdfdestname\empty
  8282. \def\pdfdestname{Top}% no empty targets
  8283. \fi
  8284. %
  8285. \leavevmode
  8286. \startlink attr{/Border [0 0 0]}%
  8287. \ifnum\filenamelength>0
  8288. goto file{\the\filename.pdf} name{\pdfdestname}%
  8289. \else
  8290. goto name{\pdfmkpgn{\pdfdestname}}%
  8291. \fi
  8292. }%
  8293. \setcolor{\linkcolor}%
  8294. \else
  8295. \ifx\XeTeXrevision\thisisundefined
  8296. \else
  8297. % For XeTeX
  8298. {\indexnofonts
  8299. \makevalueexpandable
  8300. \turnoffactive
  8301. % This expands tokens, so do it after making catcode changes, so _
  8302. % etc. don't get their TeX definitions. This ignores all spaces in
  8303. % #4, including (wrongly) those in the middle of the filename.
  8304. \getfilename{#4}%
  8305. %
  8306. % This (wrongly) does not take account of leading or trailing
  8307. % spaces in #1, which should be ignored.
  8308. \setpdfdestname{#1}%
  8309. %
  8310. \ifx\pdfdestname\empty
  8311. \def\pdfdestname{Top}% no empty targets
  8312. \fi
  8313. %
  8314. \leavevmode
  8315. \ifnum\filenamelength>0
  8316. % With default settings,
  8317. % XeTeX (xdvipdfmx) replaces link destination names with integers.
  8318. % In this case, the replaced destination names of
  8319. % remote PDFs are no longer known. In order to avoid a replacement,
  8320. % you can use xdvipdfmx's command line option `-C 0x0010'.
  8321. % If you use XeTeX 0.99996+ (TeX Live 2016+),
  8322. % this command line option is no longer necessary
  8323. % because we can use the `dvipdfmx:config' special.
  8324. \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A
  8325. << /S /GoToR /F (\the\filename.pdf) /D (\pdfdestname) >> >>}%
  8326. \else
  8327. \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A
  8328. << /S /GoTo /D (\pdfdestname) >> >>}%
  8329. \fi
  8330. }%
  8331. \setcolor{\linkcolor}%
  8332. \fi
  8333. \fi
  8334. {%
  8335. % Have to otherify everything special to allow the \csname to
  8336. % include an _ in the xref name, etc.
  8337. \indexnofonts
  8338. \turnoffactive
  8339. \def\value##1{##1}%
  8340. \expandafter\global\expandafter\let\expandafter\Xthisreftitle
  8341. \csname XR#1-title\endcsname
  8342. }%
  8343. %
  8344. % Float references are printed completely differently: "Figure 1.2"
  8345. % instead of "[somenode], p.3". \iffloat distinguishes them by
  8346. % \Xthisreftitle being set to a magic string.
  8347. \iffloat\Xthisreftitle
  8348. % If the user specified the print name (third arg) to the ref,
  8349. % print it instead of our usual "Figure 1.2".
  8350. \ifdim\wd\printedrefnamebox = 0pt
  8351. \refx{#1-snt}%
  8352. \else
  8353. \printedrefname
  8354. \fi
  8355. %
  8356. % If the user also gave the printed manual name (fifth arg), append
  8357. % "in MANUALNAME".
  8358. \ifdim \wd\printedmanualbox > 0pt
  8359. \space \putwordin{} \cite{\printedmanual}%
  8360. \fi
  8361. \else
  8362. % node/anchor (non-float) references.
  8363. %
  8364. % If we use \unhbox to print the node names, TeX does not insert
  8365. % empty discretionaries after hyphens, which means that it will not
  8366. % find a line break at a hyphen in a node names. Since some manuals
  8367. % are best written with fairly long node names, containing hyphens,
  8368. % this is a loss. Therefore, we give the text of the node name
  8369. % again, so it is as if TeX is seeing it for the first time.
  8370. %
  8371. \ifdim \wd\printedmanualbox > 0pt
  8372. % Cross-manual reference with a printed manual name.
  8373. %
  8374. \crossmanualxref{\cite{\printedmanual\unskip}}%
  8375. %
  8376. \else\ifdim \wd\infofilenamebox > 0pt
  8377. % Cross-manual reference with only an info filename (arg 4), no
  8378. % printed manual name (arg 5). This is essentially the same as
  8379. % the case above; we output the filename, since we have nothing else.
  8380. %
  8381. \crossmanualxref{\code{\infofilename\unskip}}%
  8382. %
  8383. \else
  8384. % Reference within this manual.
  8385. %
  8386. % Only output a following space if the -snt ref is nonempty, as the ref
  8387. % will be empty for @unnumbered and @anchor.
  8388. \setbox2 = \hbox{\ignorespaces \refx{#1-snt}}%
  8389. \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
  8390. %
  8391. % output the `[mynode]' via the macro below so it can be overridden.
  8392. \xrefprintnodename\printedrefname
  8393. %
  8394. \expandafter\ifx\csname SETtxiomitxrefpg\endcsname\relax
  8395. % But we always want a comma and a space:
  8396. ,\space
  8397. %
  8398. % output the `page 3'.
  8399. \turnoffactive \putwordpage\tie\refx{#1-pg}%
  8400. % Add a , if xref followed by a space
  8401. \if\space\noexpand\tokenafterxref ,%
  8402. \else\ifx\ \tokenafterxref ,% @TAB
  8403. \else\ifx\*\tokenafterxref ,% @*
  8404. \else\ifx\ \tokenafterxref ,% @SPACE
  8405. \else\ifx\
  8406. \tokenafterxref ,% @NL
  8407. \else\ifx\tie\tokenafterxref ,% @tie
  8408. \fi\fi\fi\fi\fi\fi
  8409. \fi
  8410. \fi\fi
  8411. \fi
  8412. \endlink
  8413. \endgroup}
  8414. % Output a cross-manual xref to #1. Used just above (twice).
  8415. %
  8416. % Only include the text "Section ``foo'' in" if the foo is neither
  8417. % missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply
  8418. % "see The Foo Manual", the idea being to refer to the whole manual.
  8419. %
  8420. % But, this being TeX, we can't easily compare our node name against the
  8421. % string "Top" while ignoring the possible spaces before and after in
  8422. % the input. By adding the arbitrary 7sp below, we make it much less
  8423. % likely that a real node name would have the same width as "Top" (e.g.,
  8424. % in a monospaced font). Hopefully it will never happen in practice.
  8425. %
  8426. % For the same basic reason, we retypeset the "Top" at every
  8427. % reference, since the current font is indeterminate.
  8428. %
  8429. \def\crossmanualxref#1{%
  8430. \setbox\toprefbox = \hbox{Top\kern7sp}%
  8431. \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
  8432. \ifdim \wd2 > 7sp % nonempty?
  8433. \ifdim \wd2 = \wd\toprefbox \else % same as Top?
  8434. \putwordSection{} ``\printedrefname'' \putwordin{}\space
  8435. \fi
  8436. \fi
  8437. #1%
  8438. }
  8439. % This macro is called from \xrefX for the `[nodename]' part of xref
  8440. % output. It's a separate macro only so it can be changed more easily,
  8441. % since square brackets don't work well in some documents. Particularly
  8442. % one that Bob is working on :).
  8443. %
  8444. \def\xrefprintnodename#1{[#1]}
  8445. % Things referred to by \setref.
  8446. %
  8447. \def\Ynothing{}
  8448. \def\Yomitfromtoc{}
  8449. \def\Ynumbered{%
  8450. \ifnum\secno=0
  8451. \putwordChapter@tie \the\chapno
  8452. \else \ifnum\subsecno=0
  8453. \putwordSection@tie \the\chapno.\the\secno
  8454. \else \ifnum\subsubsecno=0
  8455. \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
  8456. \else
  8457. \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
  8458. \fi\fi\fi
  8459. }
  8460. \def\Yappendix{%
  8461. \ifnum\secno=0
  8462. \putwordAppendix@tie @char\the\appendixno{}%
  8463. \else \ifnum\subsecno=0
  8464. \putwordSection@tie @char\the\appendixno.\the\secno
  8465. \else \ifnum\subsubsecno=0
  8466. \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
  8467. \else
  8468. \putwordSection@tie
  8469. @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
  8470. \fi\fi\fi
  8471. }
  8472. % \refx{NAME} - reference a cross-reference string named NAME.
  8473. \def\refx#1{%
  8474. \requireauxfile
  8475. {%
  8476. \indexnofonts
  8477. \turnoffactive
  8478. \def\value##1{##1}%
  8479. \expandafter\global\expandafter\let\expandafter\thisrefX
  8480. \csname XR#1\endcsname
  8481. }%
  8482. \ifx\thisrefX\relax
  8483. % If not defined, say something at least.
  8484. \angleleft un\-de\-fined\angleright
  8485. \iflinks
  8486. \ifhavexrefs
  8487. {\toks0 = {#1}% avoid expansion of possibly-complex value
  8488. \message{\linenumber Undefined cross reference `\the\toks0'.}}%
  8489. \else
  8490. \ifwarnedxrefs\else
  8491. \global\warnedxrefstrue
  8492. \message{Cross reference values unknown; you must run TeX again.}%
  8493. \fi
  8494. \fi
  8495. \fi
  8496. \else
  8497. % It's defined, so just use it.
  8498. \thisrefX
  8499. \fi
  8500. }
  8501. % This is the macro invoked by entries in the aux file. Define a control
  8502. % sequence for a cross-reference target (we prepend XR to the control sequence
  8503. % name to avoid collisions). The value is the page number. If this is a float
  8504. % type, we have more work to do.
  8505. %
  8506. \def\xrdef#1#2{%
  8507. {% Expand the node or anchor name to remove control sequences.
  8508. % \turnoffactive stops 8-bit characters being changed to commands
  8509. % like @'e. \refx does the same to retrieve the value in the definition.
  8510. \indexnofonts
  8511. \turnoffactive
  8512. \def\value##1{##1}%
  8513. \xdef\safexrefname{#1}%
  8514. }%
  8515. %
  8516. \bgroup
  8517. \expandafter\gdef\csname XR\safexrefname\endcsname{#2}%
  8518. \egroup
  8519. % We put the \gdef inside a group to avoid the definitions building up on
  8520. % TeX's save stack, which can cause it to run out of space for aux files with
  8521. % thousands of lines. \gdef doesn't use the save stack, but \csname does
  8522. % when it defines an unknown control sequence as \relax.
  8523. %
  8524. % Was that xref control sequence that we just defined for a float?
  8525. \expandafter\iffloat\csname XR\safexrefname\endcsname
  8526. % it was a float, and we have the (safe) float type in \iffloattype.
  8527. \expandafter\let\expandafter\floatlist
  8528. \csname floatlist\iffloattype\endcsname
  8529. %
  8530. % Is this the first time we've seen this float type?
  8531. \expandafter\ifx\floatlist\relax
  8532. \toks0 = {\do}% yes, so just \do
  8533. \else
  8534. % had it before, so preserve previous elements in list.
  8535. \toks0 = \expandafter{\floatlist\do}%
  8536. \fi
  8537. %
  8538. % Remember this xref in the control sequence \floatlistFLOATTYPE,
  8539. % for later use in \listoffloats.
  8540. \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0
  8541. {\safexrefname}}%
  8542. \fi
  8543. }
  8544. % If working on a large document in chapters, it is convenient to
  8545. % be able to disable indexing, cross-referencing, and contents, for test runs.
  8546. % This is done with @novalidate at the beginning of the file.
  8547. %
  8548. \newif\iflinks \linkstrue % by default we want the aux files.
  8549. \let\novalidate = \linksfalse
  8550. % Used when writing to the aux file, or when using data from it.
  8551. \def\requireauxfile{%
  8552. \iflinks
  8553. \tryauxfile
  8554. % Open the new aux file. TeX will close it automatically at exit.
  8555. \immediate\openout\auxfile=\jobname.aux
  8556. \fi
  8557. \global\let\requireauxfile=\relax % Only do this once.
  8558. }
  8559. % Read the last existing aux file, if any. No error if none exists.
  8560. %
  8561. \def\tryauxfile{%
  8562. \openin 1 \jobname.aux
  8563. \ifeof 1 \else
  8564. \readdatafile{aux}%
  8565. \global\havexrefstrue
  8566. \fi
  8567. \closein 1
  8568. }
  8569. \def\setupdatafile{%
  8570. \catcode`\^^@=\other
  8571. \catcode`\^^A=\other
  8572. \catcode`\^^B=\other
  8573. \catcode`\^^C=\other
  8574. \catcode`\^^D=\other
  8575. \catcode`\^^E=\other
  8576. \catcode`\^^F=\other
  8577. \catcode`\^^G=\other
  8578. \catcode`\^^H=\other
  8579. \catcode`\^^K=\other
  8580. \catcode`\^^L=\other
  8581. \catcode`\^^N=\other
  8582. \catcode`\^^P=\other
  8583. \catcode`\^^Q=\other
  8584. \catcode`\^^R=\other
  8585. \catcode`\^^S=\other
  8586. \catcode`\^^T=\other
  8587. \catcode`\^^U=\other
  8588. \catcode`\^^V=\other
  8589. \catcode`\^^W=\other
  8590. \catcode`\^^X=\other
  8591. \catcode`\^^Z=\other
  8592. \catcode`\^^[=\other
  8593. \catcode`\^^\=\other
  8594. \catcode`\^^]=\other
  8595. \catcode`\^^^=\other
  8596. \catcode`\^^_=\other
  8597. \catcode`\^=\other
  8598. %
  8599. % Special characters. Should be turned off anyway, but...
  8600. \catcode`\~=\other
  8601. \catcode`\[=\other
  8602. \catcode`\]=\other
  8603. \catcode`\"=\other
  8604. \catcode`\_=\active
  8605. \catcode`\|=\active
  8606. \catcode`\<=\active
  8607. \catcode`\>=\active
  8608. \catcode`\$=\other
  8609. \catcode`\#=\other
  8610. \catcode`\&=\other
  8611. \catcode`\%=\other
  8612. \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
  8613. %
  8614. \catcode`\\=\active
  8615. %
  8616. % @ is our escape character in .aux files, and we need braces.
  8617. \catcode`\{=1
  8618. \catcode`\}=2
  8619. \catcode`\@=0
  8620. }
  8621. \def\readdatafile#1{%
  8622. \begingroup
  8623. \setupdatafile
  8624. \input\jobname.#1
  8625. \endgroup}
  8626. \message{insertions,}
  8627. % including footnotes.
  8628. \newcount \footnoteno
  8629. % The trailing space in the following definition for supereject is
  8630. % vital for proper filling; pages come out unaligned when you do a
  8631. % pagealignmacro call if that space before the closing brace is
  8632. % removed. (Generally, numeric constants should always be followed by a
  8633. % space to prevent strange expansion errors.)
  8634. \def\supereject{\par\penalty -20000\footnoteno =0 }
  8635. % @footnotestyle is meaningful for Info output only.
  8636. \let\footnotestyle=\comment
  8637. {\catcode `\@=11
  8638. %
  8639. % Auto-number footnotes. Otherwise like plain.
  8640. \gdef\footnote{%
  8641. \global\advance\footnoteno by \@ne
  8642. \edef\thisfootno{$^{\the\footnoteno}$}%
  8643. %
  8644. % In case the footnote comes at the end of a sentence, preserve the
  8645. % extra spacing after we do the footnote number.
  8646. \let\@sf\empty
  8647. \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
  8648. %
  8649. % Remove inadvertent blank space before typesetting the footnote number.
  8650. \unskip
  8651. \thisfootno\@sf
  8652. \dofootnote
  8653. }%
  8654. % Don't bother with the trickery in plain.tex to not require the
  8655. % footnote text as a parameter. Our footnotes don't need to be so general.
  8656. %
  8657. % Oh yes, they do; otherwise, @ifset (and anything else that uses
  8658. % \parseargline) fails inside footnotes because the tokens are fixed when
  8659. % the footnote is read. --karl, 16nov96.
  8660. %
  8661. \gdef\dofootnote{%
  8662. \insert\footins\bgroup
  8663. %
  8664. % Nested footnotes are not supported in TeX, that would take a lot
  8665. % more work. (\startsavinginserts does not suffice.)
  8666. \let\footnote=\errfootnotenest
  8667. %
  8668. % We want to typeset this text as a normal paragraph, even if the
  8669. % footnote reference occurs in (for example) a display environment.
  8670. % So reset some parameters.
  8671. \hsize=\txipagewidth
  8672. \interlinepenalty\interfootnotelinepenalty
  8673. \splittopskip\ht\strutbox % top baseline for broken footnotes
  8674. \splitmaxdepth\dp\strutbox
  8675. \floatingpenalty\@MM
  8676. \leftskip\z@skip
  8677. \rightskip\z@skip
  8678. \spaceskip\z@skip
  8679. \xspaceskip\z@skip
  8680. \parindent\defaultparindent
  8681. %
  8682. \smallfonts \rm
  8683. %
  8684. % Because we use hanging indentation in footnotes, a @noindent appears
  8685. % to exdent this text, so make it be a no-op. makeinfo does not use
  8686. % hanging indentation so @noindent can still be needed within footnote
  8687. % text after an @example or the like (not that this is good style).
  8688. \let\noindent = \relax
  8689. %
  8690. % Hang the footnote text off the number. Use \everypar in case the
  8691. % footnote extends for more than one paragraph.
  8692. \everypar = {\hang}%
  8693. \textindent{\thisfootno}%
  8694. %
  8695. % Don't crash into the line above the footnote text. Since this
  8696. % expands into a box, it must come within the paragraph, lest it
  8697. % provide a place where TeX can split the footnote.
  8698. \footstrut
  8699. %
  8700. % Invoke rest of plain TeX footnote routine.
  8701. \futurelet\next\fo@t
  8702. }
  8703. }%end \catcode `\@=11
  8704. \def\errfootnotenest{%
  8705. \errhelp=\EMsimple
  8706. \errmessage{Nested footnotes not supported in texinfo.tex,
  8707. even though they work in makeinfo; sorry}
  8708. }
  8709. \def\errfootnoteheading{%
  8710. \errhelp=\EMsimple
  8711. \errmessage{Footnotes in chapters, sections, etc., are not supported}
  8712. }
  8713. % In case a @footnote appears in a vbox, save the footnote text and create
  8714. % the real \insert just after the vbox finished. Otherwise, the insertion
  8715. % would be lost.
  8716. % Similarly, if a @footnote appears inside an alignment, save the footnote
  8717. % text to a box and make the \insert when a row of the table is finished.
  8718. % And the same can be done for other insert classes. --kasal, 16nov03.
  8719. %
  8720. % Replace the \insert primitive by a cheating macro.
  8721. % Deeper inside, just make sure that the saved insertions are not spilled
  8722. % out prematurely.
  8723. %
  8724. \def\startsavinginserts{%
  8725. \ifx \insert\ptexinsert
  8726. \let\insert\saveinsert
  8727. \else
  8728. \let\checkinserts\relax
  8729. \fi
  8730. }
  8731. % This \insert replacement works for both \insert\footins{foo} and
  8732. % \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}.
  8733. %
  8734. \def\saveinsert#1{%
  8735. \edef\next{\noexpand\savetobox \makeSAVEname#1}%
  8736. \afterassignment\next
  8737. % swallow the left brace
  8738. \let\temp =
  8739. }
  8740. \def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}}
  8741. \def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1}
  8742. \def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi}
  8743. \def\placesaveins#1{%
  8744. \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname
  8745. {\box#1}%
  8746. }
  8747. % eat @SAVE -- beware, all of them have catcode \other:
  8748. {
  8749. \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-)
  8750. \gdef\gobblesave @SAVE{}
  8751. }
  8752. % initialization:
  8753. \def\newsaveins #1{%
  8754. \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}%
  8755. \next
  8756. }
  8757. \def\newsaveinsX #1{%
  8758. \csname newbox\endcsname #1%
  8759. \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts
  8760. \checksaveins #1}%
  8761. }
  8762. % initialize:
  8763. \let\checkinserts\empty
  8764. \newsaveins\footins
  8765. \newsaveins\margin
  8766. % @image. We use the macros from epsf.tex to support this.
  8767. % If epsf.tex is not installed and @image is used, we complain.
  8768. %
  8769. % Check for and read epsf.tex up front. If we read it only at @image
  8770. % time, we might be inside a group, and then its definitions would get
  8771. % undone and the next image would fail.
  8772. \openin 1 = epsf.tex
  8773. \ifeof 1 \else
  8774. % Do not bother showing banner with epsf.tex v2.7k (available in
  8775. % doc/epsf.tex and on ctan).
  8776. \def\epsfannounce{\toks0 = }%
  8777. \input epsf.tex
  8778. \fi
  8779. \closein 1
  8780. %
  8781. % We will only complain once about lack of epsf.tex.
  8782. \newif\ifwarnednoepsf
  8783. \newhelp\noepsfhelp{epsf.tex must be installed for images to
  8784. work. It is also included in the Texinfo distribution, or you can get
  8785. it from https://ctan.org/texarchive/macros/texinfo/texinfo/doc/epsf.tex.}
  8786. %
  8787. \def\image#1{%
  8788. \ifx\epsfbox\thisisundefined
  8789. \ifwarnednoepsf \else
  8790. \errhelp = \noepsfhelp
  8791. \errmessage{epsf.tex not found, images will be ignored}%
  8792. \global\warnednoepsftrue
  8793. \fi
  8794. \else
  8795. \imagexxx #1,,,,,\finish
  8796. \fi
  8797. }
  8798. %
  8799. % Arguments to @image:
  8800. % #1 is (mandatory) image filename; we tack on .eps extension.
  8801. % #2 is (optional) width, #3 is (optional) height.
  8802. % #4 is (ignored optional) html alt text.
  8803. % #5 is (ignored optional) extension.
  8804. % #6 is just the usual extra ignored arg for parsing stuff.
  8805. \newif\ifimagevmode
  8806. \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
  8807. \catcode`\^^M = 5 % in case we're inside an example
  8808. \normalturnoffactive % allow _ et al. in names
  8809. \makevalueexpandable
  8810. % If the image is by itself, center it.
  8811. \ifvmode
  8812. \imagevmodetrue
  8813. \else \ifx\centersub\centerV
  8814. % for @center @image, we need a vbox so we can have our vertical space
  8815. \imagevmodetrue
  8816. \vbox\bgroup % vbox has better behavior than vtop herev
  8817. \fi\fi
  8818. %
  8819. \ifimagevmode
  8820. \nobreak\medskip
  8821. % Usually we'll have text after the image which will insert
  8822. % \parskip glue, so insert it here too to equalize the space
  8823. % above and below.
  8824. \nobreak\vskip\parskip
  8825. \nobreak
  8826. \fi
  8827. %
  8828. % Leave vertical mode so that indentation from an enclosing
  8829. % environment such as @quotation is respected.
  8830. % However, if we're at the top level, we don't want the
  8831. % normal paragraph indentation.
  8832. % On the other hand, if we are in the case of @center @image, we don't
  8833. % want to start a paragraph, which will create a hsize-width box and
  8834. % eradicate the centering.
  8835. \ifx\centersub\centerV\else \noindent \fi
  8836. %
  8837. % Output the image.
  8838. \ifpdf
  8839. % For pdfTeX and LuaTeX <= 0.80
  8840. \dopdfimage{#1}{#2}{#3}%
  8841. \else
  8842. \ifx\XeTeXrevision\thisisundefined
  8843. % For epsf.tex
  8844. % \epsfbox itself resets \epsf?size at each figure.
  8845. \setbox0 = \hbox{\ignorespaces #2}%
  8846. \ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
  8847. \setbox0 = \hbox{\ignorespaces #3}%
  8848. \ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
  8849. \epsfbox{#1.eps}%
  8850. \else
  8851. % For XeTeX
  8852. \doxeteximage{#1}{#2}{#3}%
  8853. \fi
  8854. \fi
  8855. %
  8856. \ifimagevmode
  8857. \medskip % space after a standalone image
  8858. \fi
  8859. \ifx\centersub\centerV \egroup \fi
  8860. \endgroup}
  8861. % @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables,
  8862. % etc. We don't actually implement floating yet, we always include the
  8863. % float "here". But it seemed the best name for the future.
  8864. %
  8865. \envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish}
  8866. % There may be a space before second and/or third parameter; delete it.
  8867. \def\eatcommaspace#1, {#1,}
  8868. % #1 is the optional FLOATTYPE, the text label for this float, typically
  8869. % "Figure", "Table", "Example", etc. Can't contain commas. If omitted,
  8870. % this float will not be numbered and cannot be referred to.
  8871. %
  8872. % #2 is the optional xref label. Also must be present for the float to
  8873. % be referable.
  8874. %
  8875. % #3 is the optional positioning argument; for now, it is ignored. It
  8876. % will somehow specify the positions allowed to float to (here, top, bottom).
  8877. %
  8878. % We keep a separate counter for each FLOATTYPE, which we reset at each
  8879. % chapter-level command.
  8880. \let\resetallfloatnos=\empty
  8881. %
  8882. \def\dofloat#1,#2,#3,#4\finish{%
  8883. \let\thiscaption=\empty
  8884. \let\thisshortcaption=\empty
  8885. %
  8886. % don't lose footnotes inside @float.
  8887. %
  8888. % BEWARE: when the floats start float, we have to issue warning whenever an
  8889. % insert appears inside a float which could possibly float. --kasal, 26may04
  8890. %
  8891. \startsavinginserts
  8892. %
  8893. % We can't be used inside a paragraph.
  8894. \par
  8895. %
  8896. \vtop\bgroup
  8897. \def\floattype{#1}%
  8898. \def\floatlabel{#2}%
  8899. \def\floatloc{#3}% we do nothing with this yet.
  8900. %
  8901. \ifx\floattype\empty
  8902. \let\safefloattype=\empty
  8903. \else
  8904. {%
  8905. % the floattype might have accents or other special characters,
  8906. % but we need to use it in a control sequence name.
  8907. \indexnofonts
  8908. \turnoffactive
  8909. \xdef\safefloattype{\floattype}%
  8910. }%
  8911. \fi
  8912. %
  8913. % If label is given but no type, we handle that as the empty type.
  8914. \ifx\floatlabel\empty \else
  8915. % We want each FLOATTYPE to be numbered separately (Figure 1,
  8916. % Table 1, Figure 2, ...). (And if no label, no number.)
  8917. %
  8918. \expandafter\getfloatno\csname\safefloattype floatno\endcsname
  8919. \global\advance\floatno by 1
  8920. %
  8921. {%
  8922. % This magic value for \currentsection is output by \setref as the
  8923. % XREFLABEL-title value. \xrefX uses it to distinguish float
  8924. % labels (which have a completely different output format) from
  8925. % node and anchor labels. And \xrdef uses it to construct the
  8926. % lists of floats.
  8927. %
  8928. \edef\currentsection{\floatmagic=\safefloattype}%
  8929. \setref{\floatlabel}{Yfloat}%
  8930. }%
  8931. \fi
  8932. %
  8933. % start with \parskip glue, I guess.
  8934. \vskip\parskip
  8935. %
  8936. % Don't suppress indentation if a float happens to start a section.
  8937. \restorefirstparagraphindent
  8938. }
  8939. % we have these possibilities:
  8940. % @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap
  8941. % @float Foo,lbl & no caption: Foo 1.1
  8942. % @float Foo & @caption{Cap}: Foo: Cap
  8943. % @float Foo & no caption: Foo
  8944. % @float ,lbl & Caption{Cap}: 1.1: Cap
  8945. % @float ,lbl & no caption: 1.1
  8946. % @float & @caption{Cap}: Cap
  8947. % @float & no caption:
  8948. %
  8949. \def\Efloat{%
  8950. \let\floatident = \empty
  8951. %
  8952. % In all cases, if we have a float type, it comes first.
  8953. \ifx\floattype\empty \else \def\floatident{\floattype}\fi
  8954. %
  8955. % If we have an xref label, the number comes next.
  8956. \ifx\floatlabel\empty \else
  8957. \ifx\floattype\empty \else % if also had float type, need tie first.
  8958. \appendtomacro\floatident{\tie}%
  8959. \fi
  8960. % the number.
  8961. \appendtomacro\floatident{\chaplevelprefix\the\floatno}%
  8962. \fi
  8963. %
  8964. % Start the printed caption with what we've constructed in
  8965. % \floatident, but keep it separate; we need \floatident again.
  8966. \let\captionline = \floatident
  8967. %
  8968. \ifx\thiscaption\empty \else
  8969. \ifx\floatident\empty \else
  8970. \appendtomacro\captionline{: }% had ident, so need a colon between
  8971. \fi
  8972. %
  8973. % caption text.
  8974. \appendtomacro\captionline{\scanexp\thiscaption}%
  8975. \fi
  8976. %
  8977. % If we have anything to print, print it, with space before.
  8978. % Eventually this needs to become an \insert.
  8979. \ifx\captionline\empty \else
  8980. \vskip.5\parskip
  8981. \captionline
  8982. %
  8983. % Space below caption.
  8984. \vskip\parskip
  8985. \fi
  8986. %
  8987. % If have an xref label, write the list of floats info. Do this
  8988. % after the caption, to avoid chance of it being a breakpoint.
  8989. \ifx\floatlabel\empty \else
  8990. % Write the text that goes in the lof to the aux file as
  8991. % \floatlabel-lof. Besides \floatident, we include the short
  8992. % caption if specified, else the full caption if specified, else nothing.
  8993. {%
  8994. \requireauxfile
  8995. \atdummies
  8996. %
  8997. \ifx\thisshortcaption\empty
  8998. \def\gtemp{\thiscaption}%
  8999. \else
  9000. \def\gtemp{\thisshortcaption}%
  9001. \fi
  9002. \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident
  9003. \ifx\gtemp\empty \else : \gtemp \fi}}%
  9004. }%
  9005. \fi
  9006. \egroup % end of \vtop
  9007. %
  9008. \checkinserts
  9009. }
  9010. % Append the tokens #2 to the definition of macro #1, not expanding either.
  9011. %
  9012. \def\appendtomacro#1#2{%
  9013. \expandafter\def\expandafter#1\expandafter{#1#2}%
  9014. }
  9015. % @caption, @shortcaption
  9016. %
  9017. \def\caption{\docaption\thiscaption}
  9018. \def\shortcaption{\docaption\thisshortcaption}
  9019. \def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption}
  9020. \def\defcaption#1#2{\egroup \def#1{#2}}
  9021. % The parameter is the control sequence identifying the counter we are
  9022. % going to use. Create it if it doesn't exist and assign it to \floatno.
  9023. \def\getfloatno#1{%
  9024. \ifx#1\relax
  9025. % Haven't seen this figure type before.
  9026. \csname newcount\endcsname #1%
  9027. %
  9028. % Remember to reset this floatno at the next chap.
  9029. \expandafter\gdef\expandafter\resetallfloatnos
  9030. \expandafter{\resetallfloatnos #1=0 }%
  9031. \fi
  9032. \let\floatno#1%
  9033. }
  9034. % \setref calls this to get the XREFLABEL-snt value. We want an @xref
  9035. % to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we
  9036. % first read the @float command.
  9037. %
  9038. \def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}%
  9039. % Magic string used for the XREFLABEL-title value, so \xrefX can
  9040. % distinguish floats from other xref types.
  9041. \def\floatmagic{!!float!!}
  9042. % #1 is the control sequence we are passed; we expand into a conditional
  9043. % which is true if #1 represents a float ref. That is, the magic
  9044. % \currentsection value which we \setref above.
  9045. %
  9046. \def\iffloat#1{\expandafter\doiffloat#1==\finish}
  9047. %
  9048. % #1 is (maybe) the \floatmagic string. If so, #2 will be the
  9049. % (safe) float type for this float. We set \iffloattype to #2.
  9050. %
  9051. \def\doiffloat#1=#2=#3\finish{%
  9052. \def\temp{#1}%
  9053. \def\iffloattype{#2}%
  9054. \ifx\temp\floatmagic
  9055. }
  9056. % @listoffloats FLOATTYPE - print a list of floats like a table of contents.
  9057. %
  9058. \parseargdef\listoffloats{%
  9059. \def\floattype{#1}% floattype
  9060. {%
  9061. % the floattype might have accents or other special characters,
  9062. % but we need to use it in a control sequence name.
  9063. \indexnofonts
  9064. \turnoffactive
  9065. \xdef\safefloattype{\floattype}%
  9066. }%
  9067. %
  9068. % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE.
  9069. \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax
  9070. \ifhavexrefs
  9071. % if the user said @listoffloats foo but never @float foo.
  9072. \message{\linenumber No `\safefloattype' floats to list.}%
  9073. \fi
  9074. \else
  9075. \begingroup
  9076. \leftskip=\tocindent % indent these entries like a toc
  9077. \let\do=\listoffloatsdo
  9078. \csname floatlist\safefloattype\endcsname
  9079. \endgroup
  9080. \fi
  9081. }
  9082. % This is called on each entry in a list of floats. We're passed the
  9083. % xref label, in the form LABEL-title, which is how we save it in the
  9084. % aux file. We strip off the -title and look up \XRLABEL-lof, which
  9085. % has the text we're supposed to typeset here.
  9086. %
  9087. % Figures without xref labels will not be included in the list (since
  9088. % they won't appear in the aux file).
  9089. %
  9090. \def\listoffloatsdo#1{\listoffloatsdoentry#1\finish}
  9091. \def\listoffloatsdoentry#1-title\finish{{%
  9092. % Can't fully expand XR#1-lof because it can contain anything. Just
  9093. % pass the control sequence. On the other hand, XR#1-pg is just the
  9094. % page number, and we want to fully expand that so we can get a link
  9095. % in pdf output.
  9096. \toksA = \expandafter{\csname XR#1-lof\endcsname}%
  9097. %
  9098. % use the same \entry macro we use to generate the TOC and index.
  9099. \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}%
  9100. \writeentry
  9101. }}
  9102. \message{localization,}
  9103. % For single-language documents, @documentlanguage is usually given very
  9104. % early, just after @documentencoding. Single argument is the language
  9105. % (de) or locale (de_DE) abbreviation.
  9106. %
  9107. {
  9108. \catcode`\_ = \active
  9109. \globaldefs=1
  9110. \parseargdef\documentlanguage{%
  9111. \tex % read txi-??.tex file in plain TeX.
  9112. % Read the file by the name they passed if it exists.
  9113. \let_ = \normalunderscore % normal _ character for filename test
  9114. \openin 1 txi-#1.tex
  9115. \ifeof 1
  9116. \documentlanguagetrywithoutunderscore #1_\finish
  9117. \else
  9118. \globaldefs = 1 % everything in the txi-LL files needs to persist
  9119. \input txi-#1.tex
  9120. \fi
  9121. \closein 1
  9122. \endgroup % end raw TeX
  9123. }
  9124. %
  9125. % If they passed de_DE, and txi-de_DE.tex doesn't exist,
  9126. % try txi-de.tex.
  9127. %
  9128. \gdef\documentlanguagetrywithoutunderscore#1_#2\finish{%
  9129. \openin 1 txi-#1.tex
  9130. \ifeof 1
  9131. \errhelp = \nolanghelp
  9132. \errmessage{Cannot read language file txi-#1.tex}%
  9133. \else
  9134. \globaldefs = 1 % everything in the txi-LL files needs to persist
  9135. \input txi-#1.tex
  9136. \fi
  9137. \closein 1
  9138. }
  9139. }% end of special _ catcode
  9140. %
  9141. \newhelp\nolanghelp{The given language definition file cannot be found or
  9142. is empty. Maybe you need to install it? Putting it in the current
  9143. directory should work if nowhere else does.}
  9144. % This macro is called from txi-??.tex files; the first argument is the
  9145. % \language name to set (without the "\lang@" prefix), the second and
  9146. % third args are \{left,right}hyphenmin.
  9147. %
  9148. % The language names to pass are determined when the format is built.
  9149. % See the etex.log file created at that time, e.g.,
  9150. % /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log.
  9151. %
  9152. % With TeX Live 2008, etex now includes hyphenation patterns for all
  9153. % available languages. This means we can support hyphenation in
  9154. % Texinfo, at least to some extent. (This still doesn't solve the
  9155. % accented characters problem.)
  9156. %
  9157. \catcode`@=11
  9158. \def\txisetlanguage#1#2#3{%
  9159. % do not set the language if the name is undefined in the current TeX.
  9160. \expandafter\ifx\csname lang@#1\endcsname \relax
  9161. \message{no patterns for #1}%
  9162. \else
  9163. \global\language = \csname lang@#1\endcsname
  9164. \fi
  9165. % but there is no harm in adjusting the hyphenmin values regardless.
  9166. \global\lefthyphenmin = #2\relax
  9167. \global\righthyphenmin = #3\relax
  9168. }
  9169. % XeTeX and LuaTeX can handle Unicode natively.
  9170. % Their default I/O uses UTF-8 sequences instead of a byte-wise operation.
  9171. % Other TeX engines' I/O (pdfTeX, etc.) is byte-wise.
  9172. %
  9173. \newif\iftxinativeunicodecapable
  9174. \newif\iftxiusebytewiseio
  9175. \ifx\XeTeXrevision\thisisundefined
  9176. \ifx\luatexversion\thisisundefined
  9177. \txinativeunicodecapablefalse
  9178. \txiusebytewiseiotrue
  9179. \else
  9180. \txinativeunicodecapabletrue
  9181. \txiusebytewiseiofalse
  9182. \fi
  9183. \else
  9184. \txinativeunicodecapabletrue
  9185. \txiusebytewiseiofalse
  9186. \fi
  9187. % Set I/O by bytes instead of UTF-8 sequence for XeTeX and LuaTex
  9188. % for non-UTF-8 (byte-wise) encodings.
  9189. %
  9190. \def\setbytewiseio{%
  9191. \ifx\XeTeXrevision\thisisundefined
  9192. \else
  9193. \XeTeXdefaultencoding "bytes" % For subsequent files to be read
  9194. \XeTeXinputencoding "bytes" % For document root file
  9195. % Unfortunately, there seems to be no corresponding XeTeX command for
  9196. % output encoding. This is a problem for auxiliary index and TOC files.
  9197. % The only solution would be perhaps to write out @U{...} sequences in
  9198. % place of non-ASCII characters.
  9199. \fi
  9200. \ifx\luatexversion\thisisundefined
  9201. \else
  9202. \directlua{
  9203. local utf8_char, byte, gsub = unicode.utf8.char, string.byte, string.gsub
  9204. local function convert_char (char)
  9205. return utf8_char(byte(char))
  9206. end
  9207. local function convert_line (line)
  9208. return gsub(line, ".", convert_char)
  9209. end
  9210. callback.register("process_input_buffer", convert_line)
  9211. local function convert_line_out (line)
  9212. local line_out = ""
  9213. for c in string.utfvalues(line) do
  9214. line_out = line_out .. string.char(c)
  9215. end
  9216. return line_out
  9217. end
  9218. callback.register("process_output_buffer", convert_line_out)
  9219. }
  9220. \fi
  9221. \txiusebytewiseiotrue
  9222. }
  9223. % Helpers for encodings.
  9224. % Set the catcode of characters 128 through 255 to the specified number.
  9225. %
  9226. \def\setnonasciicharscatcode#1{%
  9227. \count255=128
  9228. \loop\ifnum\count255<256
  9229. \global\catcode\count255=#1\relax
  9230. \advance\count255 by 1
  9231. \repeat
  9232. }
  9233. \def\setnonasciicharscatcodenonglobal#1{%
  9234. \count255=128
  9235. \loop\ifnum\count255<256
  9236. \catcode\count255=#1\relax
  9237. \advance\count255 by 1
  9238. \repeat
  9239. }
  9240. % @documentencoding sets the definition of non-ASCII characters
  9241. % according to the specified encoding.
  9242. %
  9243. \def\documentencoding{\parseargusing\filenamecatcodes\documentencodingzzz}
  9244. \def\documentencodingzzz#1{%
  9245. %
  9246. % Encoding being declared for the document.
  9247. \def\declaredencoding{\csname #1.enc\endcsname}%
  9248. %
  9249. % Supported encodings: names converted to tokens in order to be able
  9250. % to compare them with \ifx.
  9251. \def\ascii{\csname US-ASCII.enc\endcsname}%
  9252. \def\latnine{\csname ISO-8859-15.enc\endcsname}%
  9253. \def\latone{\csname ISO-8859-1.enc\endcsname}%
  9254. \def\lattwo{\csname ISO-8859-2.enc\endcsname}%
  9255. \def\utfeight{\csname UTF-8.enc\endcsname}%
  9256. %
  9257. \ifx \declaredencoding \ascii
  9258. \asciichardefs
  9259. %
  9260. \else \ifx \declaredencoding \lattwo
  9261. \iftxinativeunicodecapable
  9262. \setbytewiseio
  9263. \fi
  9264. \setnonasciicharscatcode\active
  9265. \lattwochardefs
  9266. %
  9267. \else \ifx \declaredencoding \latone
  9268. \iftxinativeunicodecapable
  9269. \setbytewiseio
  9270. \fi
  9271. \setnonasciicharscatcode\active
  9272. \latonechardefs
  9273. %
  9274. \else \ifx \declaredencoding \latnine
  9275. \iftxinativeunicodecapable
  9276. \setbytewiseio
  9277. \fi
  9278. \setnonasciicharscatcode\active
  9279. \latninechardefs
  9280. %
  9281. \else \ifx \declaredencoding \utfeight
  9282. \iftxinativeunicodecapable
  9283. % For native Unicode handling (XeTeX and LuaTeX)
  9284. \nativeunicodechardefs
  9285. \else
  9286. % For treating UTF-8 as byte sequences (TeX, eTeX and pdfTeX)
  9287. \setnonasciicharscatcode\active
  9288. % since we already invoked \utfeightchardefs at the top level
  9289. % (below), do not re-invoke it, otherwise our check for duplicated
  9290. % definitions gets triggered. Making non-ascii chars active is
  9291. % sufficient.
  9292. \fi
  9293. %
  9294. \else
  9295. \message{Ignoring unknown document encoding: #1.}%
  9296. %
  9297. \fi % utfeight
  9298. \fi % latnine
  9299. \fi % latone
  9300. \fi % lattwo
  9301. \fi % ascii
  9302. %
  9303. \ifx\XeTeXrevision\thisisundefined
  9304. \else
  9305. \ifx \declaredencoding \utfeight
  9306. \else
  9307. \ifx \declaredencoding \ascii
  9308. \else
  9309. \message{Warning: XeTeX with non-UTF-8 encodings cannot handle %
  9310. non-ASCII characters in auxiliary files.}%
  9311. \fi
  9312. \fi
  9313. \fi
  9314. }
  9315. % emacs-page
  9316. % A message to be logged when using a character that isn't available
  9317. % the default font encoding (OT1).
  9318. %
  9319. \def\missingcharmsg#1{\message{Character missing, sorry: #1.}}
  9320. % Take account of \c (plain) vs. \, (Texinfo) difference.
  9321. \def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
  9322. % First, make active non-ASCII characters in order for them to be
  9323. % correctly categorized when TeX reads the replacement text of
  9324. % macros containing the character definitions.
  9325. \setnonasciicharscatcode\active
  9326. %
  9327. \def\gdefchar#1#2{%
  9328. \gdef#1{%
  9329. \ifpassthroughchars
  9330. \string#1%
  9331. \else
  9332. #2%
  9333. \fi
  9334. }}
  9335. % Latin1 (ISO-8859-1) character definitions.
  9336. \def\latonechardefs{%
  9337. \gdefchar^^a0{\tie}
  9338. \gdefchar^^a1{\exclamdown}
  9339. \gdefchar^^a2{{\tcfont \char162}} % cent
  9340. \gdefchar^^a3{\pounds{}}
  9341. \gdefchar^^a4{{\tcfont \char164}} % currency
  9342. \gdefchar^^a5{{\tcfont \char165}} % yen
  9343. \gdefchar^^a6{{\tcfont \char166}} % broken bar
  9344. \gdefchar^^a7{\S}
  9345. \gdefchar^^a8{\"{}}
  9346. \gdefchar^^a9{\copyright{}}
  9347. \gdefchar^^aa{\ordf}
  9348. \gdefchar^^ab{\guillemetleft{}}
  9349. \gdefchar^^ac{\ensuremath\lnot}
  9350. \gdefchar^^ad{\-}
  9351. \gdefchar^^ae{\registeredsymbol{}}
  9352. \gdefchar^^af{\={}}
  9353. %
  9354. \gdefchar^^b0{\textdegree}
  9355. \gdefchar^^b1{$\pm$}
  9356. \gdefchar^^b2{$^2$}
  9357. \gdefchar^^b3{$^3$}
  9358. \gdefchar^^b4{\'{}}
  9359. \gdefchar^^b5{$\mu$}
  9360. \gdefchar^^b6{\P}
  9361. \gdefchar^^b7{\ensuremath\cdot}
  9362. \gdefchar^^b8{\cedilla\ }
  9363. \gdefchar^^b9{$^1$}
  9364. \gdefchar^^ba{\ordm}
  9365. \gdefchar^^bb{\guillemetright{}}
  9366. \gdefchar^^bc{$1\over4$}
  9367. \gdefchar^^bd{$1\over2$}
  9368. \gdefchar^^be{$3\over4$}
  9369. \gdefchar^^bf{\questiondown}
  9370. %
  9371. \gdefchar^^c0{\`A}
  9372. \gdefchar^^c1{\'A}
  9373. \gdefchar^^c2{\^A}
  9374. \gdefchar^^c3{\~A}
  9375. \gdefchar^^c4{\"A}
  9376. \gdefchar^^c5{\ringaccent A}
  9377. \gdefchar^^c6{\AE}
  9378. \gdefchar^^c7{\cedilla C}
  9379. \gdefchar^^c8{\`E}
  9380. \gdefchar^^c9{\'E}
  9381. \gdefchar^^ca{\^E}
  9382. \gdefchar^^cb{\"E}
  9383. \gdefchar^^cc{\`I}
  9384. \gdefchar^^cd{\'I}
  9385. \gdefchar^^ce{\^I}
  9386. \gdefchar^^cf{\"I}
  9387. %
  9388. \gdefchar^^d0{\DH}
  9389. \gdefchar^^d1{\~N}
  9390. \gdefchar^^d2{\`O}
  9391. \gdefchar^^d3{\'O}
  9392. \gdefchar^^d4{\^O}
  9393. \gdefchar^^d5{\~O}
  9394. \gdefchar^^d6{\"O}
  9395. \gdefchar^^d7{$\times$}
  9396. \gdefchar^^d8{\O}
  9397. \gdefchar^^d9{\`U}
  9398. \gdefchar^^da{\'U}
  9399. \gdefchar^^db{\^U}
  9400. \gdefchar^^dc{\"U}
  9401. \gdefchar^^dd{\'Y}
  9402. \gdefchar^^de{\TH}
  9403. \gdefchar^^df{\ss}
  9404. %
  9405. \gdefchar^^e0{\`a}
  9406. \gdefchar^^e1{\'a}
  9407. \gdefchar^^e2{\^a}
  9408. \gdefchar^^e3{\~a}
  9409. \gdefchar^^e4{\"a}
  9410. \gdefchar^^e5{\ringaccent a}
  9411. \gdefchar^^e6{\ae}
  9412. \gdefchar^^e7{\cedilla c}
  9413. \gdefchar^^e8{\`e}
  9414. \gdefchar^^e9{\'e}
  9415. \gdefchar^^ea{\^e}
  9416. \gdefchar^^eb{\"e}
  9417. \gdefchar^^ec{\`{\dotless i}}
  9418. \gdefchar^^ed{\'{\dotless i}}
  9419. \gdefchar^^ee{\^{\dotless i}}
  9420. \gdefchar^^ef{\"{\dotless i}}
  9421. %
  9422. \gdefchar^^f0{\dh}
  9423. \gdefchar^^f1{\~n}
  9424. \gdefchar^^f2{\`o}
  9425. \gdefchar^^f3{\'o}
  9426. \gdefchar^^f4{\^o}
  9427. \gdefchar^^f5{\~o}
  9428. \gdefchar^^f6{\"o}
  9429. \gdefchar^^f7{$\div$}
  9430. \gdefchar^^f8{\o}
  9431. \gdefchar^^f9{\`u}
  9432. \gdefchar^^fa{\'u}
  9433. \gdefchar^^fb{\^u}
  9434. \gdefchar^^fc{\"u}
  9435. \gdefchar^^fd{\'y}
  9436. \gdefchar^^fe{\th}
  9437. \gdefchar^^ff{\"y}
  9438. }
  9439. % Latin9 (ISO-8859-15) encoding character definitions.
  9440. \def\latninechardefs{%
  9441. % Encoding is almost identical to Latin1.
  9442. \latonechardefs
  9443. %
  9444. \gdefchar^^a4{\euro{}}
  9445. \gdefchar^^a6{\v S}
  9446. \gdefchar^^a8{\v s}
  9447. \gdefchar^^b4{\v Z}
  9448. \gdefchar^^b8{\v z}
  9449. \gdefchar^^bc{\OE}
  9450. \gdefchar^^bd{\oe}
  9451. \gdefchar^^be{\"Y}
  9452. }
  9453. % Latin2 (ISO-8859-2) character definitions.
  9454. \def\lattwochardefs{%
  9455. \gdefchar^^a0{\tie}
  9456. \gdefchar^^a1{\ogonek{A}}
  9457. \gdefchar^^a2{\u{}}
  9458. \gdefchar^^a3{\L}
  9459. \gdefchar^^a4{\missingcharmsg{CURRENCY SIGN}}
  9460. \gdefchar^^a5{\v L}
  9461. \gdefchar^^a6{\'S}
  9462. \gdefchar^^a7{\S}
  9463. \gdefchar^^a8{\"{}}
  9464. \gdefchar^^a9{\v S}
  9465. \gdefchar^^aa{\cedilla S}
  9466. \gdefchar^^ab{\v T}
  9467. \gdefchar^^ac{\'Z}
  9468. \gdefchar^^ad{\-}
  9469. \gdefchar^^ae{\v Z}
  9470. \gdefchar^^af{\dotaccent Z}
  9471. %
  9472. \gdefchar^^b0{\textdegree{}}
  9473. \gdefchar^^b1{\ogonek{a}}
  9474. \gdefchar^^b2{\ogonek{ }}
  9475. \gdefchar^^b3{\l}
  9476. \gdefchar^^b4{\'{}}
  9477. \gdefchar^^b5{\v l}
  9478. \gdefchar^^b6{\'s}
  9479. \gdefchar^^b7{\v{}}
  9480. \gdefchar^^b8{\cedilla\ }
  9481. \gdefchar^^b9{\v s}
  9482. \gdefchar^^ba{\cedilla s}
  9483. \gdefchar^^bb{\v t}
  9484. \gdefchar^^bc{\'z}
  9485. \gdefchar^^bd{\H{}}
  9486. \gdefchar^^be{\v z}
  9487. \gdefchar^^bf{\dotaccent z}
  9488. %
  9489. \gdefchar^^c0{\'R}
  9490. \gdefchar^^c1{\'A}
  9491. \gdefchar^^c2{\^A}
  9492. \gdefchar^^c3{\u A}
  9493. \gdefchar^^c4{\"A}
  9494. \gdefchar^^c5{\'L}
  9495. \gdefchar^^c6{\'C}
  9496. \gdefchar^^c7{\cedilla C}
  9497. \gdefchar^^c8{\v C}
  9498. \gdefchar^^c9{\'E}
  9499. \gdefchar^^ca{\ogonek{E}}
  9500. \gdefchar^^cb{\"E}
  9501. \gdefchar^^cc{\v E}
  9502. \gdefchar^^cd{\'I}
  9503. \gdefchar^^ce{\^I}
  9504. \gdefchar^^cf{\v D}
  9505. %
  9506. \gdefchar^^d0{\DH}
  9507. \gdefchar^^d1{\'N}
  9508. \gdefchar^^d2{\v N}
  9509. \gdefchar^^d3{\'O}
  9510. \gdefchar^^d4{\^O}
  9511. \gdefchar^^d5{\H O}
  9512. \gdefchar^^d6{\"O}
  9513. \gdefchar^^d7{$\times$}
  9514. \gdefchar^^d8{\v R}
  9515. \gdefchar^^d9{\ringaccent U}
  9516. \gdefchar^^da{\'U}
  9517. \gdefchar^^db{\H U}
  9518. \gdefchar^^dc{\"U}
  9519. \gdefchar^^dd{\'Y}
  9520. \gdefchar^^de{\cedilla T}
  9521. \gdefchar^^df{\ss}
  9522. %
  9523. \gdefchar^^e0{\'r}
  9524. \gdefchar^^e1{\'a}
  9525. \gdefchar^^e2{\^a}
  9526. \gdefchar^^e3{\u a}
  9527. \gdefchar^^e4{\"a}
  9528. \gdefchar^^e5{\'l}
  9529. \gdefchar^^e6{\'c}
  9530. \gdefchar^^e7{\cedilla c}
  9531. \gdefchar^^e8{\v c}
  9532. \gdefchar^^e9{\'e}
  9533. \gdefchar^^ea{\ogonek{e}}
  9534. \gdefchar^^eb{\"e}
  9535. \gdefchar^^ec{\v e}
  9536. \gdefchar^^ed{\'{\dotless{i}}}
  9537. \gdefchar^^ee{\^{\dotless{i}}}
  9538. \gdefchar^^ef{\v d}
  9539. %
  9540. \gdefchar^^f0{\dh}
  9541. \gdefchar^^f1{\'n}
  9542. \gdefchar^^f2{\v n}
  9543. \gdefchar^^f3{\'o}
  9544. \gdefchar^^f4{\^o}
  9545. \gdefchar^^f5{\H o}
  9546. \gdefchar^^f6{\"o}
  9547. \gdefchar^^f7{$\div$}
  9548. \gdefchar^^f8{\v r}
  9549. \gdefchar^^f9{\ringaccent u}
  9550. \gdefchar^^fa{\'u}
  9551. \gdefchar^^fb{\H u}
  9552. \gdefchar^^fc{\"u}
  9553. \gdefchar^^fd{\'y}
  9554. \gdefchar^^fe{\cedilla t}
  9555. \gdefchar^^ff{\dotaccent{}}
  9556. }
  9557. % UTF-8 character definitions.
  9558. %
  9559. % This code to support UTF-8 is based on LaTeX's utf8.def, with some
  9560. % changes for Texinfo conventions. It is included here under the GPL by
  9561. % permission from Frank Mittelbach and the LaTeX team.
  9562. %
  9563. \newcount\countUTFx
  9564. \newcount\countUTFy
  9565. \newcount\countUTFz
  9566. \gdef\UTFviiiTwoOctets#1#2{\expandafter
  9567. \UTFviiiDefined\csname u8:#1\string #2\endcsname}
  9568. %
  9569. \gdef\UTFviiiThreeOctets#1#2#3{\expandafter
  9570. \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname}
  9571. %
  9572. \gdef\UTFviiiFourOctets#1#2#3#4{\expandafter
  9573. \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname}
  9574. \gdef\UTFviiiDefined#1{%
  9575. \ifx #1\relax
  9576. \message{\linenumber Unicode char \string #1 not defined for Texinfo}%
  9577. \else
  9578. \expandafter #1%
  9579. \fi
  9580. }
  9581. % Give non-ASCII bytes the active definitions for processing UTF-8 sequences
  9582. \begingroup
  9583. \catcode`\~13
  9584. \catcode`\$12
  9585. \catcode`\"12
  9586. % Loop from \countUTFx to \countUTFy, performing \UTFviiiTmp
  9587. % substituting ~ and $ with a character token of that value.
  9588. \def\UTFviiiLoop{%
  9589. \global\catcode\countUTFx\active
  9590. \uccode`\~\countUTFx
  9591. \uccode`\$\countUTFx
  9592. \uppercase\expandafter{\UTFviiiTmp}%
  9593. \advance\countUTFx by 1
  9594. \ifnum\countUTFx < \countUTFy
  9595. \expandafter\UTFviiiLoop
  9596. \fi}
  9597. % For bytes other than the first in a UTF-8 sequence. Not expected to
  9598. % be expanded except when writing to auxiliary files.
  9599. \countUTFx = "80
  9600. \countUTFy = "C2
  9601. \def\UTFviiiTmp{%
  9602. \gdef~{%
  9603. \ifpassthroughchars $\fi}}%
  9604. \UTFviiiLoop
  9605. \countUTFx = "C2
  9606. \countUTFy = "E0
  9607. \def\UTFviiiTmp{%
  9608. \gdef~{%
  9609. \ifpassthroughchars $%
  9610. \else\expandafter\UTFviiiTwoOctets\expandafter$\fi}}%
  9611. \UTFviiiLoop
  9612. \countUTFx = "E0
  9613. \countUTFy = "F0
  9614. \def\UTFviiiTmp{%
  9615. \gdef~{%
  9616. \ifpassthroughchars $%
  9617. \else\expandafter\UTFviiiThreeOctets\expandafter$\fi}}%
  9618. \UTFviiiLoop
  9619. \countUTFx = "F0
  9620. \countUTFy = "F4
  9621. \def\UTFviiiTmp{%
  9622. \gdef~{%
  9623. \ifpassthroughchars $%
  9624. \else\expandafter\UTFviiiFourOctets\expandafter$\fi
  9625. }}%
  9626. \UTFviiiLoop
  9627. \endgroup
  9628. \def\globallet{\global\let} % save some \expandafter's below
  9629. % @U{xxxx} to produce U+xxxx, if we support it.
  9630. \def\U#1{%
  9631. \expandafter\ifx\csname uni:#1\endcsname \relax
  9632. \iftxinativeunicodecapable
  9633. % All Unicode characters can be used if native Unicode handling is
  9634. % active. However, if the font does not have the glyph,
  9635. % letters are missing.
  9636. \begingroup
  9637. \uccode`\.="#1\relax
  9638. \uppercase{.}
  9639. \endgroup
  9640. \else
  9641. \errhelp = \EMsimple
  9642. \errmessage{Unicode character U+#1 not supported, sorry}%
  9643. \fi
  9644. \else
  9645. \csname uni:#1\endcsname
  9646. \fi
  9647. }
  9648. % These macros are used here to construct the name of a control
  9649. % sequence to be defined.
  9650. \def\UTFviiiTwoOctetsName#1#2{%
  9651. \csname u8:#1\string #2\endcsname}%
  9652. \def\UTFviiiThreeOctetsName#1#2#3{%
  9653. \csname u8:#1\string #2\string #3\endcsname}%
  9654. \def\UTFviiiFourOctetsName#1#2#3#4{%
  9655. \csname u8:#1\string #2\string #3\string #4\endcsname}%
  9656. % For UTF-8 byte sequences (TeX, e-TeX and pdfTeX),
  9657. % provide a definition macro to replace a Unicode character;
  9658. % this gets used by the @U command
  9659. %
  9660. \begingroup
  9661. \catcode`\"=12
  9662. \catcode`\<=12
  9663. \catcode`\.=12
  9664. \catcode`\,=12
  9665. \catcode`\;=12
  9666. \catcode`\!=12
  9667. \catcode`\~=13
  9668. \gdef\DeclareUnicodeCharacterUTFviii#1#2{%
  9669. \countUTFz = "#1\relax
  9670. \begingroup
  9671. \parseXMLCharref
  9672. % Give \u8:... its definition. The sequence of seven \expandafter's
  9673. % expands after the \gdef three times, e.g.
  9674. %
  9675. % 1. \UTFviiTwoOctetsName B1 B2
  9676. % 2. \csname u8:B1 \string B2 \endcsname
  9677. % 3. \u8: B1 B2 (a single control sequence token)
  9678. %
  9679. \expandafter\expandafter
  9680. \expandafter\expandafter
  9681. \expandafter\expandafter
  9682. \expandafter\gdef \UTFviiiTmp{#2}%
  9683. %
  9684. \expandafter\ifx\csname uni:#1\endcsname \relax \else
  9685. \message{Internal error, already defined: #1}%
  9686. \fi
  9687. %
  9688. % define an additional control sequence for this code point.
  9689. \expandafter\globallet\csname uni:#1\endcsname \UTFviiiTmp
  9690. \endgroup}
  9691. %
  9692. % Given the value in \countUTFz as a Unicode code point, set \UTFviiiTmp
  9693. % to the corresponding UTF-8 sequence.
  9694. \gdef\parseXMLCharref{%
  9695. \ifnum\countUTFz < "A0\relax
  9696. \errhelp = \EMsimple
  9697. \errmessage{Cannot define Unicode char value < 00A0}%
  9698. \else\ifnum\countUTFz < "800\relax
  9699. \parseUTFviiiA,%
  9700. \parseUTFviiiB C\UTFviiiTwoOctetsName.,%
  9701. \else\ifnum\countUTFz < "10000\relax
  9702. \parseUTFviiiA;%
  9703. \parseUTFviiiA,%
  9704. \parseUTFviiiB E\UTFviiiThreeOctetsName.{,;}%
  9705. \else
  9706. \parseUTFviiiA;%
  9707. \parseUTFviiiA,%
  9708. \parseUTFviiiA!%
  9709. \parseUTFviiiB F\UTFviiiFourOctetsName.{!,;}%
  9710. \fi\fi\fi
  9711. }
  9712. % Extract a byte from the end of the UTF-8 representation of \countUTFx.
  9713. % It must be a non-initial byte in the sequence.
  9714. % Change \uccode of #1 for it to be used in \parseUTFviiiB as one
  9715. % of the bytes.
  9716. \gdef\parseUTFviiiA#1{%
  9717. \countUTFx = \countUTFz
  9718. \divide\countUTFz by 64
  9719. \countUTFy = \countUTFz % Save to be the future value of \countUTFz.
  9720. \multiply\countUTFz by 64
  9721. % \countUTFz is now \countUTFx with the last 5 bits cleared. Subtract
  9722. % in order to get the last five bits.
  9723. \advance\countUTFx by -\countUTFz
  9724. % Convert this to the byte in the UTF-8 sequence.
  9725. \advance\countUTFx by 128
  9726. \uccode `#1\countUTFx
  9727. \countUTFz = \countUTFy}
  9728. % Used to put a UTF-8 byte sequence into \UTFviiiTmp
  9729. % #1 is the increment for \countUTFz to yield a the first byte of the UTF-8
  9730. % sequence.
  9731. % #2 is one of the \UTFviii*OctetsName macros.
  9732. % #3 is always a full stop (.)
  9733. % #4 is a template for the other bytes in the sequence. The values for these
  9734. % bytes is substituted in here with \uppercase using the \uccode's.
  9735. \gdef\parseUTFviiiB#1#2#3#4{%
  9736. \advance\countUTFz by "#10\relax
  9737. \uccode `#3\countUTFz
  9738. \uppercase{\gdef\UTFviiiTmp{#2#3#4}}}
  9739. \endgroup
  9740. % For native Unicode handling (XeTeX and LuaTeX),
  9741. % provide a definition macro that sets a catcode to `other' non-globally
  9742. %
  9743. \def\DeclareUnicodeCharacterNativeOther#1#2{%
  9744. \catcode"#1=\other
  9745. }
  9746. % https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_M
  9747. % U+0000..U+007F = https://en.wikipedia.org/wiki/Basic_Latin_(Unicode_block)
  9748. % U+0080..U+00FF = https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)
  9749. % U+0100..U+017F = https://en.wikipedia.org/wiki/Latin_Extended-A
  9750. % U+0180..U+024F = https://en.wikipedia.org/wiki/Latin_Extended-B
  9751. %
  9752. % Many of our renditions are less than wonderful, and all the missing
  9753. % characters are available somewhere. Loading the necessary fonts
  9754. % awaits user request. We can't truly support Unicode without
  9755. % reimplementing everything that's been done in LaTeX for many years,
  9756. % plus probably using luatex or xetex, and who knows what else.
  9757. % We won't be doing that here in this simple file. But we can try to at
  9758. % least make most of the characters not bomb out.
  9759. %
  9760. \def\unicodechardefs{%
  9761. \DeclareUnicodeCharacter{00A0}{\tie}%
  9762. \DeclareUnicodeCharacter{00A1}{\exclamdown}%
  9763. \DeclareUnicodeCharacter{00A2}{{\tcfont \char162}}% 0242=cent
  9764. \DeclareUnicodeCharacter{00A3}{\pounds{}}%
  9765. \DeclareUnicodeCharacter{00A4}{{\tcfont \char164}}% 0244=currency
  9766. \DeclareUnicodeCharacter{00A5}{{\tcfont \char165}}% 0245=yen
  9767. \DeclareUnicodeCharacter{00A6}{{\tcfont \char166}}% 0246=brokenbar
  9768. \DeclareUnicodeCharacter{00A7}{\S}%
  9769. \DeclareUnicodeCharacter{00A8}{\"{ }}%
  9770. \DeclareUnicodeCharacter{00A9}{\copyright{}}%
  9771. \DeclareUnicodeCharacter{00AA}{\ordf}%
  9772. \DeclareUnicodeCharacter{00AB}{\guillemetleft{}}%
  9773. \DeclareUnicodeCharacter{00AC}{\ensuremath\lnot}%
  9774. \DeclareUnicodeCharacter{00AD}{\-}%
  9775. \DeclareUnicodeCharacter{00AE}{\registeredsymbol{}}%
  9776. \DeclareUnicodeCharacter{00AF}{\={ }}%
  9777. %
  9778. \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}%
  9779. \DeclareUnicodeCharacter{00B1}{\ensuremath\pm}%
  9780. \DeclareUnicodeCharacter{00B2}{$^2$}%
  9781. \DeclareUnicodeCharacter{00B3}{$^3$}%
  9782. \DeclareUnicodeCharacter{00B4}{\'{ }}%
  9783. \DeclareUnicodeCharacter{00B5}{$\mu$}%
  9784. \DeclareUnicodeCharacter{00B6}{\P}%
  9785. \DeclareUnicodeCharacter{00B7}{\ensuremath\cdot}%
  9786. \DeclareUnicodeCharacter{00B8}{\cedilla{ }}%
  9787. \DeclareUnicodeCharacter{00B9}{$^1$}%
  9788. \DeclareUnicodeCharacter{00BA}{\ordm}%
  9789. \DeclareUnicodeCharacter{00BB}{\guillemetright{}}%
  9790. \DeclareUnicodeCharacter{00BC}{$1\over4$}%
  9791. \DeclareUnicodeCharacter{00BD}{$1\over2$}%
  9792. \DeclareUnicodeCharacter{00BE}{$3\over4$}%
  9793. \DeclareUnicodeCharacter{00BF}{\questiondown}%
  9794. %
  9795. \DeclareUnicodeCharacter{00C0}{\`A}%
  9796. \DeclareUnicodeCharacter{00C1}{\'A}%
  9797. \DeclareUnicodeCharacter{00C2}{\^A}%
  9798. \DeclareUnicodeCharacter{00C3}{\~A}%
  9799. \DeclareUnicodeCharacter{00C4}{\"A}%
  9800. \DeclareUnicodeCharacter{00C5}{\AA}%
  9801. \DeclareUnicodeCharacter{00C6}{\AE}%
  9802. \DeclareUnicodeCharacter{00C7}{\cedilla{C}}%
  9803. \DeclareUnicodeCharacter{00C8}{\`E}%
  9804. \DeclareUnicodeCharacter{00C9}{\'E}%
  9805. \DeclareUnicodeCharacter{00CA}{\^E}%
  9806. \DeclareUnicodeCharacter{00CB}{\"E}%
  9807. \DeclareUnicodeCharacter{00CC}{\`I}%
  9808. \DeclareUnicodeCharacter{00CD}{\'I}%
  9809. \DeclareUnicodeCharacter{00CE}{\^I}%
  9810. \DeclareUnicodeCharacter{00CF}{\"I}%
  9811. %
  9812. \DeclareUnicodeCharacter{00D0}{\DH}%
  9813. \DeclareUnicodeCharacter{00D1}{\~N}%
  9814. \DeclareUnicodeCharacter{00D2}{\`O}%
  9815. \DeclareUnicodeCharacter{00D3}{\'O}%
  9816. \DeclareUnicodeCharacter{00D4}{\^O}%
  9817. \DeclareUnicodeCharacter{00D5}{\~O}%
  9818. \DeclareUnicodeCharacter{00D6}{\"O}%
  9819. \DeclareUnicodeCharacter{00D7}{\ensuremath\times}%
  9820. \DeclareUnicodeCharacter{00D8}{\O}%
  9821. \DeclareUnicodeCharacter{00D9}{\`U}%
  9822. \DeclareUnicodeCharacter{00DA}{\'U}%
  9823. \DeclareUnicodeCharacter{00DB}{\^U}%
  9824. \DeclareUnicodeCharacter{00DC}{\"U}%
  9825. \DeclareUnicodeCharacter{00DD}{\'Y}%
  9826. \DeclareUnicodeCharacter{00DE}{\TH}%
  9827. \DeclareUnicodeCharacter{00DF}{\ss}%
  9828. %
  9829. \DeclareUnicodeCharacter{00E0}{\`a}%
  9830. \DeclareUnicodeCharacter{00E1}{\'a}%
  9831. \DeclareUnicodeCharacter{00E2}{\^a}%
  9832. \DeclareUnicodeCharacter{00E3}{\~a}%
  9833. \DeclareUnicodeCharacter{00E4}{\"a}%
  9834. \DeclareUnicodeCharacter{00E5}{\aa}%
  9835. \DeclareUnicodeCharacter{00E6}{\ae}%
  9836. \DeclareUnicodeCharacter{00E7}{\cedilla{c}}%
  9837. \DeclareUnicodeCharacter{00E8}{\`e}%
  9838. \DeclareUnicodeCharacter{00E9}{\'e}%
  9839. \DeclareUnicodeCharacter{00EA}{\^e}%
  9840. \DeclareUnicodeCharacter{00EB}{\"e}%
  9841. \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}%
  9842. \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}%
  9843. \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}%
  9844. \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}%
  9845. %
  9846. \DeclareUnicodeCharacter{00F0}{\dh}%
  9847. \DeclareUnicodeCharacter{00F1}{\~n}%
  9848. \DeclareUnicodeCharacter{00F2}{\`o}%
  9849. \DeclareUnicodeCharacter{00F3}{\'o}%
  9850. \DeclareUnicodeCharacter{00F4}{\^o}%
  9851. \DeclareUnicodeCharacter{00F5}{\~o}%
  9852. \DeclareUnicodeCharacter{00F6}{\"o}%
  9853. \DeclareUnicodeCharacter{00F7}{\ensuremath\div}%
  9854. \DeclareUnicodeCharacter{00F8}{\o}%
  9855. \DeclareUnicodeCharacter{00F9}{\`u}%
  9856. \DeclareUnicodeCharacter{00FA}{\'u}%
  9857. \DeclareUnicodeCharacter{00FB}{\^u}%
  9858. \DeclareUnicodeCharacter{00FC}{\"u}%
  9859. \DeclareUnicodeCharacter{00FD}{\'y}%
  9860. \DeclareUnicodeCharacter{00FE}{\th}%
  9861. \DeclareUnicodeCharacter{00FF}{\"y}%
  9862. %
  9863. \DeclareUnicodeCharacter{0100}{\=A}%
  9864. \DeclareUnicodeCharacter{0101}{\=a}%
  9865. \DeclareUnicodeCharacter{0102}{\u{A}}%
  9866. \DeclareUnicodeCharacter{0103}{\u{a}}%
  9867. \DeclareUnicodeCharacter{0104}{\ogonek{A}}%
  9868. \DeclareUnicodeCharacter{0105}{\ogonek{a}}%
  9869. \DeclareUnicodeCharacter{0106}{\'C}%
  9870. \DeclareUnicodeCharacter{0107}{\'c}%
  9871. \DeclareUnicodeCharacter{0108}{\^C}%
  9872. \DeclareUnicodeCharacter{0109}{\^c}%
  9873. \DeclareUnicodeCharacter{010A}{\dotaccent{C}}%
  9874. \DeclareUnicodeCharacter{010B}{\dotaccent{c}}%
  9875. \DeclareUnicodeCharacter{010C}{\v{C}}%
  9876. \DeclareUnicodeCharacter{010D}{\v{c}}%
  9877. \DeclareUnicodeCharacter{010E}{\v{D}}%
  9878. \DeclareUnicodeCharacter{010F}{d'}%
  9879. %
  9880. \DeclareUnicodeCharacter{0110}{\DH}%
  9881. \DeclareUnicodeCharacter{0111}{\dh}%
  9882. \DeclareUnicodeCharacter{0112}{\=E}%
  9883. \DeclareUnicodeCharacter{0113}{\=e}%
  9884. \DeclareUnicodeCharacter{0114}{\u{E}}%
  9885. \DeclareUnicodeCharacter{0115}{\u{e}}%
  9886. \DeclareUnicodeCharacter{0116}{\dotaccent{E}}%
  9887. \DeclareUnicodeCharacter{0117}{\dotaccent{e}}%
  9888. \DeclareUnicodeCharacter{0118}{\ogonek{E}}%
  9889. \DeclareUnicodeCharacter{0119}{\ogonek{e}}%
  9890. \DeclareUnicodeCharacter{011A}{\v{E}}%
  9891. \DeclareUnicodeCharacter{011B}{\v{e}}%
  9892. \DeclareUnicodeCharacter{011C}{\^G}%
  9893. \DeclareUnicodeCharacter{011D}{\^g}%
  9894. \DeclareUnicodeCharacter{011E}{\u{G}}%
  9895. \DeclareUnicodeCharacter{011F}{\u{g}}%
  9896. %
  9897. \DeclareUnicodeCharacter{0120}{\dotaccent{G}}%
  9898. \DeclareUnicodeCharacter{0121}{\dotaccent{g}}%
  9899. \DeclareUnicodeCharacter{0122}{\cedilla{G}}%
  9900. \DeclareUnicodeCharacter{0123}{\cedilla{g}}%
  9901. \DeclareUnicodeCharacter{0124}{\^H}%
  9902. \DeclareUnicodeCharacter{0125}{\^h}%
  9903. \DeclareUnicodeCharacter{0126}{\missingcharmsg{H WITH STROKE}}%
  9904. \DeclareUnicodeCharacter{0127}{\missingcharmsg{h WITH STROKE}}%
  9905. \DeclareUnicodeCharacter{0128}{\~I}%
  9906. \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}%
  9907. \DeclareUnicodeCharacter{012A}{\=I}%
  9908. \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}%
  9909. \DeclareUnicodeCharacter{012C}{\u{I}}%
  9910. \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}%
  9911. \DeclareUnicodeCharacter{012E}{\ogonek{I}}%
  9912. \DeclareUnicodeCharacter{012F}{\ogonek{i}}%
  9913. %
  9914. \DeclareUnicodeCharacter{0130}{\dotaccent{I}}%
  9915. \DeclareUnicodeCharacter{0131}{\dotless{i}}%
  9916. \DeclareUnicodeCharacter{0132}{IJ}%
  9917. \DeclareUnicodeCharacter{0133}{ij}%
  9918. \DeclareUnicodeCharacter{0134}{\^J}%
  9919. \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}%
  9920. \DeclareUnicodeCharacter{0136}{\cedilla{K}}%
  9921. \DeclareUnicodeCharacter{0137}{\cedilla{k}}%
  9922. \DeclareUnicodeCharacter{0138}{\ensuremath\kappa}%
  9923. \DeclareUnicodeCharacter{0139}{\'L}%
  9924. \DeclareUnicodeCharacter{013A}{\'l}%
  9925. \DeclareUnicodeCharacter{013B}{\cedilla{L}}%
  9926. \DeclareUnicodeCharacter{013C}{\cedilla{l}}%
  9927. \DeclareUnicodeCharacter{013D}{L'}% should kern
  9928. \DeclareUnicodeCharacter{013E}{l'}% should kern
  9929. \DeclareUnicodeCharacter{013F}{L\U{00B7}}%
  9930. %
  9931. \DeclareUnicodeCharacter{0140}{l\U{00B7}}%
  9932. \DeclareUnicodeCharacter{0141}{\L}%
  9933. \DeclareUnicodeCharacter{0142}{\l}%
  9934. \DeclareUnicodeCharacter{0143}{\'N}%
  9935. \DeclareUnicodeCharacter{0144}{\'n}%
  9936. \DeclareUnicodeCharacter{0145}{\cedilla{N}}%
  9937. \DeclareUnicodeCharacter{0146}{\cedilla{n}}%
  9938. \DeclareUnicodeCharacter{0147}{\v{N}}%
  9939. \DeclareUnicodeCharacter{0148}{\v{n}}%
  9940. \DeclareUnicodeCharacter{0149}{'n}%
  9941. \DeclareUnicodeCharacter{014A}{\missingcharmsg{ENG}}%
  9942. \DeclareUnicodeCharacter{014B}{\missingcharmsg{eng}}%
  9943. \DeclareUnicodeCharacter{014C}{\=O}%
  9944. \DeclareUnicodeCharacter{014D}{\=o}%
  9945. \DeclareUnicodeCharacter{014E}{\u{O}}%
  9946. \DeclareUnicodeCharacter{014F}{\u{o}}%
  9947. %
  9948. \DeclareUnicodeCharacter{0150}{\H{O}}%
  9949. \DeclareUnicodeCharacter{0151}{\H{o}}%
  9950. \DeclareUnicodeCharacter{0152}{\OE}%
  9951. \DeclareUnicodeCharacter{0153}{\oe}%
  9952. \DeclareUnicodeCharacter{0154}{\'R}%
  9953. \DeclareUnicodeCharacter{0155}{\'r}%
  9954. \DeclareUnicodeCharacter{0156}{\cedilla{R}}%
  9955. \DeclareUnicodeCharacter{0157}{\cedilla{r}}%
  9956. \DeclareUnicodeCharacter{0158}{\v{R}}%
  9957. \DeclareUnicodeCharacter{0159}{\v{r}}%
  9958. \DeclareUnicodeCharacter{015A}{\'S}%
  9959. \DeclareUnicodeCharacter{015B}{\'s}%
  9960. \DeclareUnicodeCharacter{015C}{\^S}%
  9961. \DeclareUnicodeCharacter{015D}{\^s}%
  9962. \DeclareUnicodeCharacter{015E}{\cedilla{S}}%
  9963. \DeclareUnicodeCharacter{015F}{\cedilla{s}}%
  9964. %
  9965. \DeclareUnicodeCharacter{0160}{\v{S}}%
  9966. \DeclareUnicodeCharacter{0161}{\v{s}}%
  9967. \DeclareUnicodeCharacter{0162}{\cedilla{T}}%
  9968. \DeclareUnicodeCharacter{0163}{\cedilla{t}}%
  9969. \DeclareUnicodeCharacter{0164}{\v{T}}%
  9970. \DeclareUnicodeCharacter{0165}{\v{t}}%
  9971. \DeclareUnicodeCharacter{0166}{\missingcharmsg{H WITH STROKE}}%
  9972. \DeclareUnicodeCharacter{0167}{\missingcharmsg{h WITH STROKE}}%
  9973. \DeclareUnicodeCharacter{0168}{\~U}%
  9974. \DeclareUnicodeCharacter{0169}{\~u}%
  9975. \DeclareUnicodeCharacter{016A}{\=U}%
  9976. \DeclareUnicodeCharacter{016B}{\=u}%
  9977. \DeclareUnicodeCharacter{016C}{\u{U}}%
  9978. \DeclareUnicodeCharacter{016D}{\u{u}}%
  9979. \DeclareUnicodeCharacter{016E}{\ringaccent{U}}%
  9980. \DeclareUnicodeCharacter{016F}{\ringaccent{u}}%
  9981. %
  9982. \DeclareUnicodeCharacter{0170}{\H{U}}%
  9983. \DeclareUnicodeCharacter{0171}{\H{u}}%
  9984. \DeclareUnicodeCharacter{0172}{\ogonek{U}}%
  9985. \DeclareUnicodeCharacter{0173}{\ogonek{u}}%
  9986. \DeclareUnicodeCharacter{0174}{\^W}%
  9987. \DeclareUnicodeCharacter{0175}{\^w}%
  9988. \DeclareUnicodeCharacter{0176}{\^Y}%
  9989. \DeclareUnicodeCharacter{0177}{\^y}%
  9990. \DeclareUnicodeCharacter{0178}{\"Y}%
  9991. \DeclareUnicodeCharacter{0179}{\'Z}%
  9992. \DeclareUnicodeCharacter{017A}{\'z}%
  9993. \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}%
  9994. \DeclareUnicodeCharacter{017C}{\dotaccent{z}}%
  9995. \DeclareUnicodeCharacter{017D}{\v{Z}}%
  9996. \DeclareUnicodeCharacter{017E}{\v{z}}%
  9997. \DeclareUnicodeCharacter{017F}{\missingcharmsg{LONG S}}%
  9998. %
  9999. \DeclareUnicodeCharacter{01C4}{D\v{Z}}%
  10000. \DeclareUnicodeCharacter{01C5}{D\v{z}}%
  10001. \DeclareUnicodeCharacter{01C6}{d\v{z}}%
  10002. \DeclareUnicodeCharacter{01C7}{LJ}%
  10003. \DeclareUnicodeCharacter{01C8}{Lj}%
  10004. \DeclareUnicodeCharacter{01C9}{lj}%
  10005. \DeclareUnicodeCharacter{01CA}{NJ}%
  10006. \DeclareUnicodeCharacter{01CB}{Nj}%
  10007. \DeclareUnicodeCharacter{01CC}{nj}%
  10008. \DeclareUnicodeCharacter{01CD}{\v{A}}%
  10009. \DeclareUnicodeCharacter{01CE}{\v{a}}%
  10010. \DeclareUnicodeCharacter{01CF}{\v{I}}%
  10011. %
  10012. \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}%
  10013. \DeclareUnicodeCharacter{01D1}{\v{O}}%
  10014. \DeclareUnicodeCharacter{01D2}{\v{o}}%
  10015. \DeclareUnicodeCharacter{01D3}{\v{U}}%
  10016. \DeclareUnicodeCharacter{01D4}{\v{u}}%
  10017. %
  10018. \DeclareUnicodeCharacter{01E2}{\={\AE}}%
  10019. \DeclareUnicodeCharacter{01E3}{\={\ae}}%
  10020. \DeclareUnicodeCharacter{01E6}{\v{G}}%
  10021. \DeclareUnicodeCharacter{01E7}{\v{g}}%
  10022. \DeclareUnicodeCharacter{01E8}{\v{K}}%
  10023. \DeclareUnicodeCharacter{01E9}{\v{k}}%
  10024. %
  10025. \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}%
  10026. \DeclareUnicodeCharacter{01F1}{DZ}%
  10027. \DeclareUnicodeCharacter{01F2}{Dz}%
  10028. \DeclareUnicodeCharacter{01F3}{dz}%
  10029. \DeclareUnicodeCharacter{01F4}{\'G}%
  10030. \DeclareUnicodeCharacter{01F5}{\'g}%
  10031. \DeclareUnicodeCharacter{01F8}{\`N}%
  10032. \DeclareUnicodeCharacter{01F9}{\`n}%
  10033. \DeclareUnicodeCharacter{01FC}{\'{\AE}}%
  10034. \DeclareUnicodeCharacter{01FD}{\'{\ae}}%
  10035. \DeclareUnicodeCharacter{01FE}{\'{\O}}%
  10036. \DeclareUnicodeCharacter{01FF}{\'{\o}}%
  10037. %
  10038. \DeclareUnicodeCharacter{021E}{\v{H}}%
  10039. \DeclareUnicodeCharacter{021F}{\v{h}}%
  10040. %
  10041. \DeclareUnicodeCharacter{0226}{\dotaccent{A}}%
  10042. \DeclareUnicodeCharacter{0227}{\dotaccent{a}}%
  10043. \DeclareUnicodeCharacter{0228}{\cedilla{E}}%
  10044. \DeclareUnicodeCharacter{0229}{\cedilla{e}}%
  10045. \DeclareUnicodeCharacter{022E}{\dotaccent{O}}%
  10046. \DeclareUnicodeCharacter{022F}{\dotaccent{o}}%
  10047. %
  10048. \DeclareUnicodeCharacter{0232}{\=Y}%
  10049. \DeclareUnicodeCharacter{0233}{\=y}%
  10050. \DeclareUnicodeCharacter{0237}{\dotless{j}}%
  10051. %
  10052. \DeclareUnicodeCharacter{02BC}{'}%
  10053. %
  10054. \DeclareUnicodeCharacter{02DB}{\ogonek{ }}%
  10055. %
  10056. % Greek letters upper case
  10057. \DeclareUnicodeCharacter{0391}{{\it A}}%
  10058. \DeclareUnicodeCharacter{0392}{{\it B}}%
  10059. \DeclareUnicodeCharacter{0393}{\ensuremath{\mit\Gamma}}%
  10060. \DeclareUnicodeCharacter{0394}{\ensuremath{\mit\Delta}}%
  10061. \DeclareUnicodeCharacter{0395}{{\it E}}%
  10062. \DeclareUnicodeCharacter{0396}{{\it Z}}%
  10063. \DeclareUnicodeCharacter{0397}{{\it H}}%
  10064. \DeclareUnicodeCharacter{0398}{\ensuremath{\mit\Theta}}%
  10065. \DeclareUnicodeCharacter{0399}{{\it I}}%
  10066. \DeclareUnicodeCharacter{039A}{{\it K}}%
  10067. \DeclareUnicodeCharacter{039B}{\ensuremath{\mit\Lambda}}%
  10068. \DeclareUnicodeCharacter{039C}{{\it M}}%
  10069. \DeclareUnicodeCharacter{039D}{{\it N}}%
  10070. \DeclareUnicodeCharacter{039E}{\ensuremath{\mit\Xi}}%
  10071. \DeclareUnicodeCharacter{039F}{{\it O}}%
  10072. \DeclareUnicodeCharacter{03A0}{\ensuremath{\mit\Pi}}%
  10073. \DeclareUnicodeCharacter{03A1}{{\it P}}%
  10074. %\DeclareUnicodeCharacter{03A2}{} % none - corresponds to final sigma
  10075. \DeclareUnicodeCharacter{03A3}{\ensuremath{\mit\Sigma}}%
  10076. \DeclareUnicodeCharacter{03A4}{{\it T}}%
  10077. \DeclareUnicodeCharacter{03A5}{\ensuremath{\mit\Upsilon}}%
  10078. \DeclareUnicodeCharacter{03A6}{\ensuremath{\mit\Phi}}%
  10079. \DeclareUnicodeCharacter{03A7}{{\it X}}%
  10080. \DeclareUnicodeCharacter{03A8}{\ensuremath{\mit\Psi}}%
  10081. \DeclareUnicodeCharacter{03A9}{\ensuremath{\mit\Omega}}%
  10082. %
  10083. % Vowels with accents
  10084. \DeclareUnicodeCharacter{0390}{\ensuremath{\ddot{\acute\iota}}}%
  10085. \DeclareUnicodeCharacter{03AC}{\ensuremath{\acute\alpha}}%
  10086. \DeclareUnicodeCharacter{03AD}{\ensuremath{\acute\epsilon}}%
  10087. \DeclareUnicodeCharacter{03AE}{\ensuremath{\acute\eta}}%
  10088. \DeclareUnicodeCharacter{03AF}{\ensuremath{\acute\iota}}%
  10089. \DeclareUnicodeCharacter{03B0}{\ensuremath{\acute{\ddot\upsilon}}}%
  10090. %
  10091. % Standalone accent
  10092. \DeclareUnicodeCharacter{0384}{\ensuremath{\acute{\ }}}%
  10093. %
  10094. % Greek letters lower case
  10095. \DeclareUnicodeCharacter{03B1}{\ensuremath\alpha}%
  10096. \DeclareUnicodeCharacter{03B2}{\ensuremath\beta}%
  10097. \DeclareUnicodeCharacter{03B3}{\ensuremath\gamma}%
  10098. \DeclareUnicodeCharacter{03B4}{\ensuremath\delta}%
  10099. \DeclareUnicodeCharacter{03B5}{\ensuremath\epsilon}%
  10100. \DeclareUnicodeCharacter{03B6}{\ensuremath\zeta}%
  10101. \DeclareUnicodeCharacter{03B7}{\ensuremath\eta}%
  10102. \DeclareUnicodeCharacter{03B8}{\ensuremath\theta}%
  10103. \DeclareUnicodeCharacter{03B9}{\ensuremath\iota}%
  10104. \DeclareUnicodeCharacter{03BA}{\ensuremath\kappa}%
  10105. \DeclareUnicodeCharacter{03BB}{\ensuremath\lambda}%
  10106. \DeclareUnicodeCharacter{03BC}{\ensuremath\mu}%
  10107. \DeclareUnicodeCharacter{03BD}{\ensuremath\nu}%
  10108. \DeclareUnicodeCharacter{03BE}{\ensuremath\xi}%
  10109. \DeclareUnicodeCharacter{03BF}{{\it o}}% omicron
  10110. \DeclareUnicodeCharacter{03C0}{\ensuremath\pi}%
  10111. \DeclareUnicodeCharacter{03C1}{\ensuremath\rho}%
  10112. \DeclareUnicodeCharacter{03C2}{\ensuremath\varsigma}%
  10113. \DeclareUnicodeCharacter{03C3}{\ensuremath\sigma}%
  10114. \DeclareUnicodeCharacter{03C4}{\ensuremath\tau}%
  10115. \DeclareUnicodeCharacter{03C5}{\ensuremath\upsilon}%
  10116. \DeclareUnicodeCharacter{03C6}{\ensuremath\phi}%
  10117. \DeclareUnicodeCharacter{03C7}{\ensuremath\chi}%
  10118. \DeclareUnicodeCharacter{03C8}{\ensuremath\psi}%
  10119. \DeclareUnicodeCharacter{03C9}{\ensuremath\omega}%
  10120. %
  10121. % More Greek vowels with accents
  10122. \DeclareUnicodeCharacter{03CA}{\ensuremath{\ddot\iota}}%
  10123. \DeclareUnicodeCharacter{03CB}{\ensuremath{\ddot\upsilon}}%
  10124. \DeclareUnicodeCharacter{03CC}{\ensuremath{\acute o}}%
  10125. \DeclareUnicodeCharacter{03CD}{\ensuremath{\acute\upsilon}}%
  10126. \DeclareUnicodeCharacter{03CE}{\ensuremath{\acute\omega}}%
  10127. %
  10128. % Variant Greek letters
  10129. \DeclareUnicodeCharacter{03D1}{\ensuremath\vartheta}%
  10130. \DeclareUnicodeCharacter{03D6}{\ensuremath\varpi}%
  10131. \DeclareUnicodeCharacter{03F1}{\ensuremath\varrho}%
  10132. %
  10133. \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}%
  10134. \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}%
  10135. \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}%
  10136. \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}%
  10137. \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}%
  10138. \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}%
  10139. \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}%
  10140. \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}%
  10141. \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}%
  10142. \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}%
  10143. \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}%
  10144. \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}%
  10145. %
  10146. \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}%
  10147. \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}%
  10148. %
  10149. \DeclareUnicodeCharacter{1E20}{\=G}%
  10150. \DeclareUnicodeCharacter{1E21}{\=g}%
  10151. \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}%
  10152. \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}%
  10153. \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}%
  10154. \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}%
  10155. \DeclareUnicodeCharacter{1E26}{\"H}%
  10156. \DeclareUnicodeCharacter{1E27}{\"h}%
  10157. %
  10158. \DeclareUnicodeCharacter{1E30}{\'K}%
  10159. \DeclareUnicodeCharacter{1E31}{\'k}%
  10160. \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}%
  10161. \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}%
  10162. \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}%
  10163. \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}%
  10164. \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}%
  10165. \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}%
  10166. \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}%
  10167. \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}%
  10168. \DeclareUnicodeCharacter{1E3E}{\'M}%
  10169. \DeclareUnicodeCharacter{1E3F}{\'m}%
  10170. %
  10171. \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}%
  10172. \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}%
  10173. \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}%
  10174. \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}%
  10175. \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}%
  10176. \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}%
  10177. \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}%
  10178. \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}%
  10179. \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}%
  10180. \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}%
  10181. %
  10182. \DeclareUnicodeCharacter{1E54}{\'P}%
  10183. \DeclareUnicodeCharacter{1E55}{\'p}%
  10184. \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}%
  10185. \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}%
  10186. \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}%
  10187. \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}%
  10188. \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}%
  10189. \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}%
  10190. \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}%
  10191. \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}%
  10192. %
  10193. \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}%
  10194. \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}%
  10195. \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}%
  10196. \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}%
  10197. \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}%
  10198. \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}%
  10199. \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}%
  10200. \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}%
  10201. \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}%
  10202. \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}%
  10203. %
  10204. \DeclareUnicodeCharacter{1E7C}{\~V}%
  10205. \DeclareUnicodeCharacter{1E7D}{\~v}%
  10206. \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}%
  10207. \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}%
  10208. %
  10209. \DeclareUnicodeCharacter{1E80}{\`W}%
  10210. \DeclareUnicodeCharacter{1E81}{\`w}%
  10211. \DeclareUnicodeCharacter{1E82}{\'W}%
  10212. \DeclareUnicodeCharacter{1E83}{\'w}%
  10213. \DeclareUnicodeCharacter{1E84}{\"W}%
  10214. \DeclareUnicodeCharacter{1E85}{\"w}%
  10215. \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}%
  10216. \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}%
  10217. \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}%
  10218. \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}%
  10219. \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}%
  10220. \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}%
  10221. \DeclareUnicodeCharacter{1E8C}{\"X}%
  10222. \DeclareUnicodeCharacter{1E8D}{\"x}%
  10223. \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}%
  10224. \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}%
  10225. %
  10226. \DeclareUnicodeCharacter{1E90}{\^Z}%
  10227. \DeclareUnicodeCharacter{1E91}{\^z}%
  10228. \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}%
  10229. \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}%
  10230. \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}%
  10231. \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}%
  10232. \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}%
  10233. \DeclareUnicodeCharacter{1E97}{\"t}%
  10234. \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}%
  10235. \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}%
  10236. %
  10237. \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}%
  10238. \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}%
  10239. %
  10240. \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}%
  10241. \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}%
  10242. \DeclareUnicodeCharacter{1EBC}{\~E}%
  10243. \DeclareUnicodeCharacter{1EBD}{\~e}%
  10244. %
  10245. \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}%
  10246. \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}%
  10247. \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}%
  10248. \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}%
  10249. %
  10250. \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}%
  10251. \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}%
  10252. %
  10253. \DeclareUnicodeCharacter{1EF2}{\`Y}%
  10254. \DeclareUnicodeCharacter{1EF3}{\`y}%
  10255. \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}%
  10256. %
  10257. \DeclareUnicodeCharacter{1EF8}{\~Y}%
  10258. \DeclareUnicodeCharacter{1EF9}{\~y}%
  10259. %
  10260. % Punctuation
  10261. \DeclareUnicodeCharacter{2013}{--}%
  10262. \DeclareUnicodeCharacter{2014}{---}%
  10263. \DeclareUnicodeCharacter{2018}{\quoteleft{}}%
  10264. \DeclareUnicodeCharacter{2019}{\quoteright{}}%
  10265. \DeclareUnicodeCharacter{201A}{\quotesinglbase{}}%
  10266. \DeclareUnicodeCharacter{201C}{\quotedblleft{}}%
  10267. \DeclareUnicodeCharacter{201D}{\quotedblright{}}%
  10268. \DeclareUnicodeCharacter{201E}{\quotedblbase{}}%
  10269. \DeclareUnicodeCharacter{2020}{\ensuremath\dagger}%
  10270. \DeclareUnicodeCharacter{2021}{\ensuremath\ddagger}%
  10271. \DeclareUnicodeCharacter{2022}{\bullet{}}%
  10272. \DeclareUnicodeCharacter{202F}{\thinspace}%
  10273. \DeclareUnicodeCharacter{2026}{\dots{}}%
  10274. \DeclareUnicodeCharacter{2039}{\guilsinglleft{}}%
  10275. \DeclareUnicodeCharacter{203A}{\guilsinglright{}}%
  10276. %
  10277. \DeclareUnicodeCharacter{20AC}{\euro{}}%
  10278. %
  10279. \DeclareUnicodeCharacter{2192}{\expansion{}}%
  10280. \DeclareUnicodeCharacter{21D2}{\result{}}%
  10281. %
  10282. % Mathematical symbols
  10283. \DeclareUnicodeCharacter{2200}{\ensuremath\forall}%
  10284. \DeclareUnicodeCharacter{2203}{\ensuremath\exists}%
  10285. \DeclareUnicodeCharacter{2208}{\ensuremath\in}%
  10286. \DeclareUnicodeCharacter{2212}{\minus{}}%
  10287. \DeclareUnicodeCharacter{2217}{\ast}%
  10288. \DeclareUnicodeCharacter{221E}{\ensuremath\infty}%
  10289. \DeclareUnicodeCharacter{2225}{\ensuremath\parallel}%
  10290. \DeclareUnicodeCharacter{2227}{\ensuremath\wedge}%
  10291. \DeclareUnicodeCharacter{2229}{\ensuremath\cap}%
  10292. \DeclareUnicodeCharacter{2261}{\equiv{}}%
  10293. \DeclareUnicodeCharacter{2264}{\ensuremath\leq}%
  10294. \DeclareUnicodeCharacter{2265}{\ensuremath\geq}%
  10295. \DeclareUnicodeCharacter{2282}{\ensuremath\subset}%
  10296. \DeclareUnicodeCharacter{2287}{\ensuremath\supseteq}%
  10297. %
  10298. \DeclareUnicodeCharacter{2016}{\ensuremath\Vert}%
  10299. \DeclareUnicodeCharacter{2032}{\ensuremath\prime}%
  10300. \DeclareUnicodeCharacter{210F}{\ensuremath\hbar}%
  10301. \DeclareUnicodeCharacter{2111}{\ensuremath\Im}%
  10302. \DeclareUnicodeCharacter{2113}{\ensuremath\ell}%
  10303. \DeclareUnicodeCharacter{2118}{\ensuremath\wp}%
  10304. \DeclareUnicodeCharacter{211C}{\ensuremath\Re}%
  10305. \DeclareUnicodeCharacter{2135}{\ensuremath\aleph}%
  10306. \DeclareUnicodeCharacter{2190}{\ensuremath\leftarrow}%
  10307. \DeclareUnicodeCharacter{2191}{\ensuremath\uparrow}%
  10308. \DeclareUnicodeCharacter{2193}{\ensuremath\downarrow}%
  10309. \DeclareUnicodeCharacter{2194}{\ensuremath\leftrightarrow}%
  10310. \DeclareUnicodeCharacter{2195}{\ensuremath\updownarrow}%
  10311. \DeclareUnicodeCharacter{2196}{\ensuremath\nwarrow}%
  10312. \DeclareUnicodeCharacter{2197}{\ensuremath\nearrow}%
  10313. \DeclareUnicodeCharacter{2198}{\ensuremath\searrow}%
  10314. \DeclareUnicodeCharacter{2199}{\ensuremath\swarrow}%
  10315. \DeclareUnicodeCharacter{21A6}{\ensuremath\mapsto}%
  10316. \DeclareUnicodeCharacter{21A9}{\ensuremath\hookleftarrow}%
  10317. \DeclareUnicodeCharacter{21AA}{\ensuremath\hookrightarrow}%
  10318. \DeclareUnicodeCharacter{21BC}{\ensuremath\leftharpoonup}%
  10319. \DeclareUnicodeCharacter{21BD}{\ensuremath\leftharpoondown}%
  10320. \DeclareUnicodeCharacter{21C0}{\ensuremath\rightharpoonup}%
  10321. \DeclareUnicodeCharacter{21C1}{\ensuremath\rightharpoondown}%
  10322. \DeclareUnicodeCharacter{21CC}{\ensuremath\rightleftharpoons}%
  10323. \DeclareUnicodeCharacter{21D0}{\ensuremath\Leftarrow}%
  10324. \DeclareUnicodeCharacter{21D1}{\ensuremath\Uparrow}%
  10325. \DeclareUnicodeCharacter{21D3}{\ensuremath\Downarrow}%
  10326. \DeclareUnicodeCharacter{21D4}{\ensuremath\Leftrightarrow}%
  10327. \DeclareUnicodeCharacter{21D5}{\ensuremath\Updownarrow}%
  10328. \DeclareUnicodeCharacter{2202}{\ensuremath\partial}%
  10329. \DeclareUnicodeCharacter{2205}{\ensuremath\emptyset}%
  10330. \DeclareUnicodeCharacter{2207}{\ensuremath\nabla}%
  10331. \DeclareUnicodeCharacter{2209}{\ensuremath\notin}%
  10332. \DeclareUnicodeCharacter{220B}{\ensuremath\owns}%
  10333. \DeclareUnicodeCharacter{220F}{\ensuremath\prod}%
  10334. \DeclareUnicodeCharacter{2210}{\ensuremath\coprod}%
  10335. \DeclareUnicodeCharacter{2211}{\ensuremath\sum}%
  10336. \DeclareUnicodeCharacter{2213}{\ensuremath\mp}%
  10337. \DeclareUnicodeCharacter{2218}{\ensuremath\circ}%
  10338. \DeclareUnicodeCharacter{221A}{\ensuremath\surd}%
  10339. \DeclareUnicodeCharacter{221D}{\ensuremath\propto}%
  10340. \DeclareUnicodeCharacter{2220}{\ensuremath\angle}%
  10341. \DeclareUnicodeCharacter{2223}{\ensuremath\mid}%
  10342. \DeclareUnicodeCharacter{2228}{\ensuremath\vee}%
  10343. \DeclareUnicodeCharacter{222A}{\ensuremath\cup}%
  10344. \DeclareUnicodeCharacter{222B}{\ensuremath\smallint}%
  10345. \DeclareUnicodeCharacter{222E}{\ensuremath\oint}%
  10346. \DeclareUnicodeCharacter{223C}{\ensuremath\sim}%
  10347. \DeclareUnicodeCharacter{2240}{\ensuremath\wr}%
  10348. \DeclareUnicodeCharacter{2243}{\ensuremath\simeq}%
  10349. \DeclareUnicodeCharacter{2245}{\ensuremath\cong}%
  10350. \DeclareUnicodeCharacter{2248}{\ensuremath\approx}%
  10351. \DeclareUnicodeCharacter{224D}{\ensuremath\asymp}%
  10352. \DeclareUnicodeCharacter{2250}{\ensuremath\doteq}%
  10353. \DeclareUnicodeCharacter{2260}{\ensuremath\neq}%
  10354. \DeclareUnicodeCharacter{226A}{\ensuremath\ll}%
  10355. \DeclareUnicodeCharacter{226B}{\ensuremath\gg}%
  10356. \DeclareUnicodeCharacter{227A}{\ensuremath\prec}%
  10357. \DeclareUnicodeCharacter{227B}{\ensuremath\succ}%
  10358. \DeclareUnicodeCharacter{2283}{\ensuremath\supset}%
  10359. \DeclareUnicodeCharacter{2286}{\ensuremath\subseteq}%
  10360. \DeclareUnicodeCharacter{228E}{\ensuremath\uplus}%
  10361. \DeclareUnicodeCharacter{2291}{\ensuremath\sqsubseteq}%
  10362. \DeclareUnicodeCharacter{2292}{\ensuremath\sqsupseteq}%
  10363. \DeclareUnicodeCharacter{2293}{\ensuremath\sqcap}%
  10364. \DeclareUnicodeCharacter{2294}{\ensuremath\sqcup}%
  10365. \DeclareUnicodeCharacter{2295}{\ensuremath\oplus}%
  10366. \DeclareUnicodeCharacter{2296}{\ensuremath\ominus}%
  10367. \DeclareUnicodeCharacter{2297}{\ensuremath\otimes}%
  10368. \DeclareUnicodeCharacter{2298}{\ensuremath\oslash}%
  10369. \DeclareUnicodeCharacter{2299}{\ensuremath\odot}%
  10370. \DeclareUnicodeCharacter{22A2}{\ensuremath\vdash}%
  10371. \DeclareUnicodeCharacter{22A3}{\ensuremath\dashv}%
  10372. \DeclareUnicodeCharacter{22A4}{\ensuremath\ptextop}%
  10373. \DeclareUnicodeCharacter{22A5}{\ensuremath\bot}%
  10374. \DeclareUnicodeCharacter{22A8}{\ensuremath\models}%
  10375. \DeclareUnicodeCharacter{22C0}{\ensuremath\bigwedge}%
  10376. \DeclareUnicodeCharacter{22C1}{\ensuremath\bigvee}%
  10377. \DeclareUnicodeCharacter{22C2}{\ensuremath\bigcap}%
  10378. \DeclareUnicodeCharacter{22C3}{\ensuremath\bigcup}%
  10379. \DeclareUnicodeCharacter{22C4}{\ensuremath\diamond}%
  10380. \DeclareUnicodeCharacter{22C5}{\ensuremath\cdot}%
  10381. \DeclareUnicodeCharacter{22C6}{\ensuremath\star}%
  10382. \DeclareUnicodeCharacter{22C8}{\ensuremath\bowtie}%
  10383. \DeclareUnicodeCharacter{2308}{\ensuremath\lceil}%
  10384. \DeclareUnicodeCharacter{2309}{\ensuremath\rceil}%
  10385. \DeclareUnicodeCharacter{230A}{\ensuremath\lfloor}%
  10386. \DeclareUnicodeCharacter{230B}{\ensuremath\rfloor}%
  10387. \DeclareUnicodeCharacter{2322}{\ensuremath\frown}%
  10388. \DeclareUnicodeCharacter{2323}{\ensuremath\smile}%
  10389. %
  10390. \DeclareUnicodeCharacter{25B3}{\ensuremath\triangle}%
  10391. \DeclareUnicodeCharacter{25B7}{\ensuremath\triangleright}%
  10392. \DeclareUnicodeCharacter{25BD}{\ensuremath\bigtriangledown}%
  10393. \DeclareUnicodeCharacter{25C1}{\ensuremath\triangleleft}%
  10394. \DeclareUnicodeCharacter{25C7}{\ensuremath\diamond}%
  10395. \DeclareUnicodeCharacter{2660}{\ensuremath\spadesuit}%
  10396. \DeclareUnicodeCharacter{2661}{\ensuremath\heartsuit}%
  10397. \DeclareUnicodeCharacter{2662}{\ensuremath\diamondsuit}%
  10398. \DeclareUnicodeCharacter{2663}{\ensuremath\clubsuit}%
  10399. \DeclareUnicodeCharacter{266D}{\ensuremath\flat}%
  10400. \DeclareUnicodeCharacter{266E}{\ensuremath\natural}%
  10401. \DeclareUnicodeCharacter{266F}{\ensuremath\sharp}%
  10402. \DeclareUnicodeCharacter{26AA}{\ensuremath\bigcirc}%
  10403. \DeclareUnicodeCharacter{27B9}{\ensuremath\rangle}%
  10404. \DeclareUnicodeCharacter{27C2}{\ensuremath\perp}%
  10405. \DeclareUnicodeCharacter{27E8}{\ensuremath\langle}%
  10406. \DeclareUnicodeCharacter{27F5}{\ensuremath\longleftarrow}%
  10407. \DeclareUnicodeCharacter{27F6}{\ensuremath\longrightarrow}%
  10408. \DeclareUnicodeCharacter{27F7}{\ensuremath\longleftrightarrow}%
  10409. \DeclareUnicodeCharacter{27FC}{\ensuremath\longmapsto}%
  10410. \DeclareUnicodeCharacter{29F5}{\ensuremath\setminus}%
  10411. \DeclareUnicodeCharacter{2A00}{\ensuremath\bigodot}%
  10412. \DeclareUnicodeCharacter{2A01}{\ensuremath\bigoplus}%
  10413. \DeclareUnicodeCharacter{2A02}{\ensuremath\bigotimes}%
  10414. \DeclareUnicodeCharacter{2A04}{\ensuremath\biguplus}%
  10415. \DeclareUnicodeCharacter{2A06}{\ensuremath\bigsqcup}%
  10416. \DeclareUnicodeCharacter{2A3F}{\ensuremath\amalg}%
  10417. \DeclareUnicodeCharacter{2AAF}{\ensuremath\preceq}%
  10418. \DeclareUnicodeCharacter{2AB0}{\ensuremath\succeq}%
  10419. %
  10420. \global\mathchardef\checkmark="1370% actually the square root sign
  10421. \DeclareUnicodeCharacter{2713}{\ensuremath\checkmark}%
  10422. }% end of \unicodechardefs
  10423. % UTF-8 byte sequence (pdfTeX) definitions (replacing and @U command)
  10424. % It makes the setting that replace UTF-8 byte sequence.
  10425. \def\utfeightchardefs{%
  10426. \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterUTFviii
  10427. \unicodechardefs
  10428. }
  10429. % Whether the active definitions of non-ASCII characters expand to
  10430. % non-active tokens with the same character code. This is used to
  10431. % write characters literally, instead of using active definitions for
  10432. % printing the correct glyphs.
  10433. \newif\ifpassthroughchars
  10434. \passthroughcharsfalse
  10435. % For native Unicode handling (XeTeX and LuaTeX),
  10436. % provide a definition macro to replace/pass-through a Unicode character
  10437. %
  10438. \def\DeclareUnicodeCharacterNative#1#2{%
  10439. \catcode"#1=\active
  10440. \def\dodeclareunicodecharacternative##1##2##3{%
  10441. \begingroup
  10442. \uccode`\~="##2\relax
  10443. \uppercase{\gdef~}{%
  10444. \ifpassthroughchars
  10445. ##1%
  10446. \else
  10447. ##3%
  10448. \fi
  10449. }
  10450. \endgroup
  10451. }
  10452. \begingroup
  10453. \uccode`\.="#1\relax
  10454. \uppercase{\def\UTFNativeTmp{.}}%
  10455. \expandafter\dodeclareunicodecharacternative\UTFNativeTmp{#1}{#2}%
  10456. \endgroup
  10457. }
  10458. % Native Unicode handling (XeTeX and LuaTeX) character replacing definition.
  10459. % It activates the setting that replaces Unicode characters.
  10460. \def\nativeunicodechardefs{%
  10461. \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNative
  10462. \unicodechardefs
  10463. }
  10464. % For native Unicode handling (XeTeX and LuaTeX),
  10465. % make the character token expand
  10466. % to the sequences given in \unicodechardefs for printing.
  10467. \def\DeclareUnicodeCharacterNativeAtU#1#2{%
  10468. \def\UTFAtUTmp{#2}
  10469. \expandafter\globallet\csname uni:#1\endcsname \UTFAtUTmp
  10470. }
  10471. % @U command definitions for native Unicode handling (XeTeX and LuaTeX).
  10472. \def\nativeunicodechardefsatu{%
  10473. \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNativeAtU
  10474. \unicodechardefs
  10475. }
  10476. % US-ASCII character definitions.
  10477. \def\asciichardefs{% nothing need be done
  10478. \relax
  10479. }
  10480. % Define all Unicode characters we know about. This makes UTF-8 the default
  10481. % input encoding and allows @U to work.
  10482. \iftxinativeunicodecapable
  10483. \nativeunicodechardefsatu
  10484. \else
  10485. \utfeightchardefs
  10486. \fi
  10487. \message{formatting,}
  10488. \newdimen\defaultparindent \defaultparindent = 15pt
  10489. \chapheadingskip = 15pt plus 4pt minus 2pt
  10490. \secheadingskip = 12pt plus 3pt minus 2pt
  10491. \subsecheadingskip = 9pt plus 2pt minus 2pt
  10492. % Prevent underfull vbox error messages.
  10493. \vbadness = 10000
  10494. % Don't be very finicky about underfull hboxes, either.
  10495. \hbadness = 6666
  10496. % Following George Bush, get rid of widows and orphans.
  10497. \widowpenalty=10000
  10498. \clubpenalty=10000
  10499. % Use TeX 3.0's \emergencystretch to help line breaking, but if we're
  10500. % using an old version of TeX, don't do anything. We want the amount of
  10501. % stretch added to depend on the line length, hence the dependence on
  10502. % \hsize. We call this whenever the paper size is set.
  10503. %
  10504. \def\setemergencystretch{%
  10505. \ifx\emergencystretch\thisisundefined
  10506. % Allow us to assign to \emergencystretch anyway.
  10507. \def\emergencystretch{\dimen0}%
  10508. \else
  10509. \emergencystretch = .15\hsize
  10510. \fi
  10511. }
  10512. % Parameters in order: 1) textheight; 2) textwidth;
  10513. % 3) voffset; 4) hoffset; 5) binding offset; 6) topskip;
  10514. % 7) physical page height; 8) physical page width.
  10515. %
  10516. % We also call \setleading{\textleading}, so the caller should define
  10517. % \textleading. The caller should also set \parskip.
  10518. %
  10519. \def\internalpagesizes#1#2#3#4#5#6#7#8{%
  10520. \voffset = #3\relax
  10521. \topskip = #6\relax
  10522. \splittopskip = \topskip
  10523. %
  10524. \vsize = #1\relax
  10525. \advance\vsize by \topskip
  10526. \outervsize = \vsize
  10527. \advance\outervsize by 2\topandbottommargin
  10528. \txipageheight = \vsize
  10529. %
  10530. \hsize = #2\relax
  10531. \outerhsize = \hsize
  10532. \advance\outerhsize by 0.5in
  10533. \txipagewidth = \hsize
  10534. %
  10535. \normaloffset = #4\relax
  10536. \bindingoffset = #5\relax
  10537. %
  10538. \ifpdf
  10539. \pdfpageheight #7\relax
  10540. \pdfpagewidth #8\relax
  10541. % if we don't reset these, they will remain at "1 true in" of
  10542. % whatever layout pdftex was dumped with.
  10543. \pdfhorigin = 1 true in
  10544. \pdfvorigin = 1 true in
  10545. \else
  10546. \ifx\XeTeXrevision\thisisundefined
  10547. \special{papersize=#8,#7}%
  10548. \else
  10549. \pdfpageheight #7\relax
  10550. \pdfpagewidth #8\relax
  10551. % XeTeX does not have \pdfhorigin and \pdfvorigin.
  10552. \fi
  10553. \fi
  10554. %
  10555. \setleading{\textleading}
  10556. %
  10557. \parindent = \defaultparindent
  10558. \setemergencystretch
  10559. }
  10560. % @letterpaper (the default).
  10561. \def\letterpaper{{\globaldefs = 1
  10562. \parskip = 3pt plus 2pt minus 1pt
  10563. \textleading = 13.2pt
  10564. %
  10565. % If page is nothing but text, make it come out even.
  10566. \internalpagesizes{607.2pt}{6in}% that's 46 lines
  10567. {\voffset}{.25in}%
  10568. {\bindingoffset}{36pt}%
  10569. {11in}{8.5in}%
  10570. }}
  10571. % Use @smallbook to reset parameters for 7x9.25 trim size.
  10572. \def\smallbook{{\globaldefs = 1
  10573. \parskip = 2pt plus 1pt
  10574. \textleading = 12pt
  10575. %
  10576. \internalpagesizes{7.5in}{5in}%
  10577. {-.2in}{0in}%
  10578. {\bindingoffset}{16pt}%
  10579. {9.25in}{7in}%
  10580. %
  10581. \lispnarrowing = 0.3in
  10582. \tolerance = 700
  10583. \contentsrightmargin = 0pt
  10584. \defbodyindent = .5cm
  10585. }}
  10586. % Use @smallerbook to reset parameters for 6x9 trim size.
  10587. % (Just testing, parameters still in flux.)
  10588. \def\smallerbook{{\globaldefs = 1
  10589. \parskip = 1.5pt plus 1pt
  10590. \textleading = 12pt
  10591. %
  10592. \internalpagesizes{7.4in}{4.8in}%
  10593. {-.2in}{-.4in}%
  10594. {0pt}{14pt}%
  10595. {9in}{6in}%
  10596. %
  10597. \lispnarrowing = 0.25in
  10598. \tolerance = 700
  10599. \contentsrightmargin = 0pt
  10600. \defbodyindent = .4cm
  10601. }}
  10602. % Use @afourpaper to print on European A4 paper.
  10603. \def\afourpaper{{\globaldefs = 1
  10604. \parskip = 3pt plus 2pt minus 1pt
  10605. \textleading = 13.2pt
  10606. %
  10607. % Double-side printing via postscript on Laserjet 4050
  10608. % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
  10609. % To change the settings for a different printer or situation, adjust
  10610. % \normaloffset until the front-side and back-side texts align. Then
  10611. % do the same for \bindingoffset. You can set these for testing in
  10612. % your texinfo source file like this:
  10613. % @tex
  10614. % \global\normaloffset = -6mm
  10615. % \global\bindingoffset = 10mm
  10616. % @end tex
  10617. \internalpagesizes{673.2pt}{160mm}% that's 51 lines
  10618. {\voffset}{\hoffset}%
  10619. {\bindingoffset}{44pt}%
  10620. {297mm}{210mm}%
  10621. %
  10622. \tolerance = 700
  10623. \contentsrightmargin = 0pt
  10624. \defbodyindent = 5mm
  10625. }}
  10626. % Use @afivepaper to print on European A5 paper.
  10627. % From romildo@urano.iceb.ufop.br, 2 July 2000.
  10628. % He also recommends making @example and @lisp be small.
  10629. \def\afivepaper{{\globaldefs = 1
  10630. \parskip = 2pt plus 1pt minus 0.1pt
  10631. \textleading = 12.5pt
  10632. %
  10633. \internalpagesizes{160mm}{120mm}%
  10634. {\voffset}{\hoffset}%
  10635. {\bindingoffset}{8pt}%
  10636. {210mm}{148mm}%
  10637. %
  10638. \lispnarrowing = 0.2in
  10639. \tolerance = 800
  10640. \contentsrightmargin = 0pt
  10641. \defbodyindent = 2mm
  10642. \tableindent = 12mm
  10643. }}
  10644. % A specific text layout, 24x15cm overall, intended for A4 paper.
  10645. \def\afourlatex{{\globaldefs = 1
  10646. \afourpaper
  10647. \internalpagesizes{237mm}{150mm}%
  10648. {\voffset}{4.6mm}%
  10649. {\bindingoffset}{7mm}%
  10650. {297mm}{210mm}%
  10651. %
  10652. % Must explicitly reset to 0 because we call \afourpaper.
  10653. \globaldefs = 0
  10654. }}
  10655. % Use @afourwide to print on A4 paper in landscape format.
  10656. \def\afourwide{{\globaldefs = 1
  10657. \afourpaper
  10658. \internalpagesizes{241mm}{165mm}%
  10659. {\voffset}{-2.95mm}%
  10660. {\bindingoffset}{7mm}%
  10661. {297mm}{210mm}%
  10662. \globaldefs = 0
  10663. }}
  10664. \def\bsixpaper{{\globaldefs = 1
  10665. \afourpaper
  10666. \internalpagesizes{140mm}{100mm}%
  10667. {-6.35mm}{-12.7mm}%
  10668. {\bindingoffset}{14pt}%
  10669. {176mm}{125mm}%
  10670. \let\SETdispenvsize=\smallword
  10671. \lispnarrowing = 0.2in
  10672. \globaldefs = 0
  10673. }}
  10674. % @pagesizes TEXTHEIGHT[,TEXTWIDTH]
  10675. % Perhaps we should allow setting the margins, \topskip, \parskip,
  10676. % and/or leading, also. Or perhaps we should compute them somehow.
  10677. %
  10678. \parseargdef\pagesizes{\pagesizesyyy #1,,\finish}
  10679. \def\pagesizesyyy#1,#2,#3\finish{{%
  10680. \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
  10681. \globaldefs = 1
  10682. %
  10683. \parskip = 3pt plus 2pt minus 1pt
  10684. \setleading{\textleading}%
  10685. %
  10686. \dimen0 = #1\relax
  10687. \advance\dimen0 by 2.5in % default 1in margin above heading line
  10688. % and 1.5in to include heading, footing and
  10689. % bottom margin
  10690. %
  10691. \dimen2 = \hsize
  10692. \advance\dimen2 by 2in % default to 1 inch margin on each side
  10693. %
  10694. \internalpagesizes{#1}{\hsize}%
  10695. {\voffset}{\normaloffset}%
  10696. {\bindingoffset}{44pt}%
  10697. {\dimen0}{\dimen2}%
  10698. }}
  10699. % Set default to letter.
  10700. %
  10701. \letterpaper
  10702. % Default value of \hfuzz, for suppressing warnings about overfull hboxes.
  10703. \hfuzz = 1pt
  10704. \message{and turning on texinfo input format.}
  10705. \def^^L{\par} % remove \outer, so ^L can appear in an @comment
  10706. % DEL is a comment character, in case @c does not suffice.
  10707. \catcode`\^^? = 14
  10708. % Define macros to output various characters with catcode for normal text.
  10709. \catcode`\"=\other \def\normaldoublequote{"}
  10710. \catcode`\$=\other \def\normaldollar{$}%$ font-lock fix
  10711. \catcode`\+=\other \def\normalplus{+}
  10712. \catcode`\<=\other \def\normalless{<}
  10713. \catcode`\>=\other \def\normalgreater{>}
  10714. \catcode`\^=\other \def\normalcaret{^}
  10715. \catcode`\_=\other \def\normalunderscore{_}
  10716. \catcode`\|=\other \def\normalverticalbar{|}
  10717. \catcode`\~=\other \def\normaltilde{~}
  10718. % This macro is used to make a character print one way in \tt
  10719. % (where it can probably be output as-is), and another way in other fonts,
  10720. % where something hairier probably needs to be done.
  10721. %
  10722. % #1 is what to print if we are indeed using \tt; #2 is what to print
  10723. % otherwise. Since all the Computer Modern typewriter fonts have zero
  10724. % interword stretch (and shrink), and it is reasonable to expect all
  10725. % typewriter fonts to have this, we can check that font parameter.
  10726. %
  10727. \def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
  10728. % Same as above, but check for italic font. Actually this also catches
  10729. % non-italic slanted fonts since it is impossible to distinguish them from
  10730. % italic fonts. But since this is only used by $ and it uses \sl anyway
  10731. % this is not a problem.
  10732. \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
  10733. % Set catcodes for Texinfo file
  10734. % Active characters for printing the wanted glyph.
  10735. % Most of these we simply print from the \tt font, but for some, we can
  10736. % use math or other variants that look better in normal text.
  10737. %
  10738. \catcode`\"=\active
  10739. \def\activedoublequote{{\tt\char34}}
  10740. \let"=\activedoublequote
  10741. \catcode`\~=\active \def\activetilde{{\tt\char126}} \let~ = \activetilde
  10742. \chardef\hatchar=`\^
  10743. \catcode`\^=\active \def\activehat{{\tt \hatchar}} \let^ = \activehat
  10744. \catcode`\_=\active
  10745. \def_{\ifusingtt\normalunderscore\_}
  10746. \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
  10747. \let\realunder=_
  10748. \catcode`\|=\active \def|{{\tt\char124}}
  10749. \chardef \less=`\<
  10750. \catcode`\<=\active \def\activeless{{\tt \less}}\let< = \activeless
  10751. \chardef \gtr=`\>
  10752. \catcode`\>=\active \def\activegtr{{\tt \gtr}}\let> = \activegtr
  10753. \catcode`\+=\active \def+{{\tt \char 43}}
  10754. \catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
  10755. \catcode`\-=\active \let-=\normaldash
  10756. % used for headline/footline in the output routine, in case the page
  10757. % breaks in the middle of an @tex block.
  10758. \def\texinfochars{%
  10759. \let< = \activeless
  10760. \let> = \activegtr
  10761. \let~ = \activetilde
  10762. \let^ = \activehat
  10763. \setregularquotes
  10764. \let\b = \strong
  10765. \let\i = \smartitalic
  10766. % in principle, all other definitions in \tex have to be undone too.
  10767. }
  10768. % Used sometimes to turn off (effectively) the active characters even after
  10769. % parsing them.
  10770. \def\turnoffactive{%
  10771. \normalturnoffactive
  10772. \otherbackslash
  10773. }
  10774. \catcode`\@=0
  10775. % \backslashcurfont outputs one backslash character in current font,
  10776. % as in \char`\\.
  10777. \global\chardef\backslashcurfont=`\\
  10778. % \realbackslash is an actual character `\' with catcode other.
  10779. {\catcode`\\=\other @gdef@realbackslash{\}}
  10780. % In Texinfo, backslash is an active character; it prints the backslash
  10781. % in fixed width font.
  10782. \catcode`\\=\active % @ for escape char from now on.
  10783. % Print a typewriter backslash. For math mode, we can't simply use
  10784. % \backslashcurfont: the story here is that in math mode, the \char
  10785. % of \backslashcurfont ends up printing the roman \ from the math symbol
  10786. % font (because \char in math mode uses the \mathcode, and plain.tex
  10787. % sets \mathcode`\\="026E). Hence we use an explicit \mathchar,
  10788. % which is the decimal equivalent of "715c (class 7, e.g., use \fam;
  10789. % ignored family value; char position "5C). We can't use " for the
  10790. % usual hex value because it has already been made active.
  10791. @def@ttbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}}
  10792. @let@backslashchar = @ttbackslash % @backslashchar{} is for user documents.
  10793. % \otherbackslash defines an active \ to be a literal `\' character with
  10794. % catcode other.
  10795. @gdef@otherbackslash{@let\=@realbackslash}
  10796. % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
  10797. % the literal character `\'.
  10798. %
  10799. {@catcode`- = @active
  10800. @gdef@normalturnoffactive{%
  10801. @passthroughcharstrue
  10802. @let-=@normaldash
  10803. @let"=@normaldoublequote
  10804. @let$=@normaldollar %$ font-lock fix
  10805. @let+=@normalplus
  10806. @let<=@normalless
  10807. @let>=@normalgreater
  10808. @let^=@normalcaret
  10809. @let_=@normalunderscore
  10810. @let|=@normalverticalbar
  10811. @let~=@normaltilde
  10812. @let\=@ttbackslash
  10813. @setregularquotes
  10814. @unsepspaces
  10815. }
  10816. }
  10817. % If a .fmt file is being used, characters that might appear in a file
  10818. % name cannot be active until we have parsed the command line.
  10819. % So turn them off again, and have @fixbackslash turn them back on.
  10820. @catcode`+=@other @catcode`@_=@other
  10821. % \enablebackslashhack - allow file to begin `\input texinfo'
  10822. %
  10823. % If a .fmt file is being used, we don't want the `\input texinfo' to show up.
  10824. % That is what \eatinput is for; after that, the `\' should revert to printing
  10825. % a backslash.
  10826. % If the file did not have a `\input texinfo', then it is turned off after
  10827. % the first line; otherwise the first `\' in the file would cause an error.
  10828. % This is used on the very last line of this file, texinfo.tex.
  10829. % We also use @c to call @fixbackslash, in case ends of lines are hidden.
  10830. {
  10831. @catcode`@^=7
  10832. @catcode`@^^M=13@gdef@enablebackslashhack{%
  10833. @global@let\ = @eatinput%
  10834. @catcode`@^^M=13%
  10835. @def@c{@fixbackslash@c}%
  10836. % Definition for the newline at the end of this file.
  10837. @def ^^M{@let^^M@secondlinenl}%
  10838. % Definition for a newline in the main Texinfo file.
  10839. @gdef @secondlinenl{@fixbackslash}%
  10840. % In case the first line has a whole-line command on it
  10841. @let@originalparsearg@parsearg
  10842. @def@parsearg{@fixbackslash@originalparsearg}
  10843. }}
  10844. {@catcode`@^=7 @catcode`@^^M=13%
  10845. @gdef@eatinput input texinfo#1^^M{@fixbackslash}}
  10846. % Emergency active definition of newline, in case an active newline token
  10847. % appears by mistake.
  10848. {@catcode`@^=7 @catcode13=13%
  10849. @gdef@enableemergencynewline{%
  10850. @gdef^^M{%
  10851. @par%
  10852. %<warning: active newline>@par%
  10853. }}}
  10854. @gdef@fixbackslash{%
  10855. @ifx\@eatinput @let\ = @ttbackslash @fi
  10856. @catcode13=5 % regular end of line
  10857. @enableemergencynewline
  10858. @let@c=@comment
  10859. @let@parsearg@originalparsearg
  10860. % Also turn back on active characters that might appear in the input
  10861. % file name, in case not using a pre-dumped format.
  10862. @catcode`+=@active
  10863. @catcode`@_=@active
  10864. %
  10865. % If texinfo.cnf is present on the system, read it.
  10866. % Useful for site-wide @afourpaper, etc. This macro, @fixbackslash, gets
  10867. % called at the beginning of every Texinfo file. Not opening texinfo.cnf
  10868. % directly in this file, texinfo.tex, makes it possible to make a format
  10869. % file for Texinfo.
  10870. %
  10871. @openin 1 texinfo.cnf
  10872. @ifeof 1 @else @input texinfo.cnf @fi
  10873. @closein 1
  10874. }
  10875. % Say @foo, not \foo, in error messages.
  10876. @escapechar = `@@
  10877. % These (along with & and #) are made active for url-breaking, so need
  10878. % active definitions as the normal characters.
  10879. @def@normaldot{.}
  10880. @def@normalquest{?}
  10881. @def@normalslash{/}
  10882. % These look ok in all fonts, so just make them not special.
  10883. % @hashchar{} gets its own user-level command, because of #line.
  10884. @catcode`@& = @other @def@normalamp{&}
  10885. @catcode`@# = @other @def@normalhash{#}
  10886. @catcode`@% = @other @def@normalpercent{%}
  10887. @let @hashchar = @normalhash
  10888. @c Finally, make ` and ' active, so that txicodequoteundirected and
  10889. @c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we
  10890. @c don't make ` and ' active, @code will not get them as active chars.
  10891. @c Do this last of all since we use ` in the previous @catcode assignments.
  10892. @catcode`@'=@active
  10893. @catcode`@`=@active
  10894. @setregularquotes
  10895. @c Local variables:
  10896. @c eval: (add-hook 'before-save-hook 'time-stamp)
  10897. @c page-delimiter: "^\\\\message\\|emacs-page"
  10898. @c time-stamp-start: "def\\\\texinfoversion{"
  10899. @c time-stamp-format: "%:y-%02m-%02d.%02H"
  10900. @c time-stamp-end: "}"
  10901. @c End:
  10902. @c vim:sw=2:
  10903. @enablebackslashhack