texinfo.tex 316 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079
  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{2013-02-01.11}
  7. %
  8. % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
  9. % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
  10. % 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
  11. %
  12. % This texinfo.tex file is free software: you can redistribute it and/or
  13. % modify it under the terms of the GNU General Public License as
  14. % published by the Free Software Foundation, either version 3 of the
  15. % License, or (at your option) any later version.
  16. %
  17. % This texinfo.tex file is distributed in the hope that it will be
  18. % useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  19. % of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  20. % General Public License for more details.
  21. %
  22. % You should have received a copy of the GNU General Public License
  23. % along with this program. If not, see <http://www.gnu.org/licenses/>.
  24. %
  25. % As a special exception, when this file is read by TeX when processing
  26. % a Texinfo source document, you may use the result without
  27. % restriction. This Exception is an additional permission under section 7
  28. % of the GNU General Public License, version 3 ("GPLv3").
  29. %
  30. % Please try the latest version of texinfo.tex before submitting bug
  31. % reports; you can get the latest version from:
  32. % http://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or
  33. % http://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or
  34. % http://www.gnu.org/software/texinfo/ (the Texinfo home page)
  35. % The texinfo.tex in any given distribution could well be out
  36. % of date, so if that's what you're using, please check.
  37. %
  38. % Send bug reports to bug-texinfo@gnu.org. Please include including a
  39. % complete document in each bug report with which we can reproduce the
  40. % problem. Patches are, of course, greatly appreciated.
  41. %
  42. % To process a Texinfo manual with TeX, it's most reliable to use the
  43. % texi2dvi shell script that comes with the distribution. For a simple
  44. % manual foo.texi, however, you can get away with this:
  45. % tex foo.texi
  46. % texindex foo.??
  47. % tex foo.texi
  48. % tex foo.texi
  49. % dvips foo.dvi -o # or whatever; this makes foo.ps.
  50. % The extra TeX runs get the cross-reference information correct.
  51. % Sometimes one run after texindex suffices, and sometimes you need more
  52. % than two; texi2dvi does it as many times as necessary.
  53. %
  54. % It is possible to adapt texinfo.tex for other languages, to some
  55. % extent. You can get the existing language-specific files from the
  56. % full Texinfo distribution.
  57. %
  58. % The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
  59. \message{Loading texinfo [version \texinfoversion]:}
  60. % If in a .fmt file, print the version number
  61. % and turn on active characters that we couldn't do earlier because
  62. % they might have appeared in the input file name.
  63. \everyjob{\message{[Texinfo version \texinfoversion]}%
  64. \catcode`+=\active \catcode`\_=\active}
  65. \chardef\other=12
  66. % We never want plain's \outer definition of \+ in Texinfo.
  67. % For @tex, we can use \tabalign.
  68. \let\+ = \relax
  69. % Save some plain tex macros whose names we will redefine.
  70. \let\ptexb=\b
  71. \let\ptexbullet=\bullet
  72. \let\ptexc=\c
  73. \let\ptexcomma=\,
  74. \let\ptexdot=\.
  75. \let\ptexdots=\dots
  76. \let\ptexend=\end
  77. \let\ptexequiv=\equiv
  78. \let\ptexexclam=\!
  79. \let\ptexfootnote=\footnote
  80. \let\ptexgtr=>
  81. \let\ptexhat=^
  82. \let\ptexi=\i
  83. \let\ptexindent=\indent
  84. \let\ptexinsert=\insert
  85. \let\ptexlbrace=\{
  86. \let\ptexless=<
  87. \let\ptexnewwrite\newwrite
  88. \let\ptexnoindent=\noindent
  89. \let\ptexplus=+
  90. \let\ptexraggedright=\raggedright
  91. \let\ptexrbrace=\}
  92. \let\ptexslash=\/
  93. \let\ptexstar=\*
  94. \let\ptext=\t
  95. \let\ptextop=\top
  96. {\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode
  97. % If this character appears in an error message or help string, it
  98. % starts a new line in the output.
  99. \newlinechar = `^^J
  100. % Use TeX 3.0's \inputlineno to get the line number, for better error
  101. % messages, but if we're using an old version of TeX, don't do anything.
  102. %
  103. \ifx\inputlineno\thisisundefined
  104. \let\linenumber = \empty % Pre-3.0.
  105. \else
  106. \def\linenumber{l.\the\inputlineno:\space}
  107. \fi
  108. % Set up fixed words for English if not already set.
  109. \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
  110. \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
  111. \ifx\putworderror\undefined \gdef\putworderror{error}\fi
  112. \ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
  113. \ifx\putwordin\undefined \gdef\putwordin{in}\fi
  114. \ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
  115. \ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
  116. \ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
  117. \ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
  118. \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
  119. \ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi
  120. \ifx\putwordof\undefined \gdef\putwordof{of}\fi
  121. \ifx\putwordon\undefined \gdef\putwordon{on}\fi
  122. \ifx\putwordpage\undefined \gdef\putwordpage{page}\fi
  123. \ifx\putwordsection\undefined \gdef\putwordsection{section}\fi
  124. \ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi
  125. \ifx\putwordsee\undefined \gdef\putwordsee{see}\fi
  126. \ifx\putwordSee\undefined \gdef\putwordSee{See}\fi
  127. \ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi
  128. \ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi
  129. %
  130. \ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
  131. \ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
  132. \ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
  133. \ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
  134. \ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
  135. \ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
  136. \ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
  137. \ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
  138. \ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
  139. \ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
  140. \ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
  141. \ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
  142. %
  143. \ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi
  144. \ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi
  145. \ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi
  146. \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
  147. \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
  148. % Since the category of space is not known, we have to be careful.
  149. \chardef\spacecat = 10
  150. \def\spaceisspace{\catcode`\ =\spacecat}
  151. % sometimes characters are active, so we need control sequences.
  152. \chardef\ampChar = `\&
  153. \chardef\colonChar = `\:
  154. \chardef\commaChar = `\,
  155. \chardef\dashChar = `\-
  156. \chardef\dotChar = `\.
  157. \chardef\exclamChar= `\!
  158. \chardef\hashChar = `\#
  159. \chardef\lquoteChar= `\`
  160. \chardef\questChar = `\?
  161. \chardef\rquoteChar= `\'
  162. \chardef\semiChar = `\;
  163. \chardef\slashChar = `\/
  164. \chardef\underChar = `\_
  165. % Ignore a token.
  166. %
  167. \def\gobble#1{}
  168. % The following is used inside several \edef's.
  169. \def\makecsname#1{\expandafter\noexpand\csname#1\endcsname}
  170. % Hyphenation fixes.
  171. \hyphenation{
  172. Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script
  173. ap-pen-dix bit-map bit-maps
  174. data-base data-bases eshell fall-ing half-way long-est man-u-script
  175. man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm
  176. par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces
  177. spell-ing spell-ings
  178. stand-alone strong-est time-stamp time-stamps which-ever white-space
  179. wide-spread wrap-around
  180. }
  181. % Margin to add to right of even pages, to left of odd pages.
  182. \newdimen\bindingoffset
  183. \newdimen\normaloffset
  184. \newdimen\pagewidth \newdimen\pageheight
  185. % For a final copy, take out the rectangles
  186. % that mark overfull boxes (in case you have decided
  187. % that the text looks ok even though it passes the margin).
  188. %
  189. \def\finalout{\overfullrule=0pt }
  190. % Sometimes it is convenient to have everything in the transcript file
  191. % and nothing on the terminal. We don't just call \tracingall here,
  192. % since that produces some useless output on the terminal. We also make
  193. % some effort to order the tracing commands to reduce output in the log
  194. % file; cf. trace.sty in LaTeX.
  195. %
  196. \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
  197. \def\loggingall{%
  198. \tracingstats2
  199. \tracingpages1
  200. \tracinglostchars2 % 2 gives us more in etex
  201. \tracingparagraphs1
  202. \tracingoutput1
  203. \tracingmacros2
  204. \tracingrestores1
  205. \showboxbreadth\maxdimen \showboxdepth\maxdimen
  206. \ifx\eTeXversion\thisisundefined\else % etex gives us more logging
  207. \tracingscantokens1
  208. \tracingifs1
  209. \tracinggroups1
  210. \tracingnesting2
  211. \tracingassigns1
  212. \fi
  213. \tracingcommands3 % 3 gives us more in etex
  214. \errorcontextlines16
  215. }%
  216. % @errormsg{MSG}. Do the index-like expansions on MSG, but if things
  217. % aren't perfect, it's not the end of the world, being an error message,
  218. % after all.
  219. %
  220. \def\errormsg{\begingroup \indexnofonts \doerrormsg}
  221. \def\doerrormsg#1{\errmessage{#1}}
  222. % add check for \lastpenalty to plain's definitions. If the last thing
  223. % we did was a \nobreak, we don't want to insert more space.
  224. %
  225. \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
  226. \removelastskip\penalty-50\smallskip\fi\fi}
  227. \def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
  228. \removelastskip\penalty-100\medskip\fi\fi}
  229. \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
  230. \removelastskip\penalty-200\bigskip\fi\fi}
  231. % Do @cropmarks to get crop marks.
  232. %
  233. \newif\ifcropmarks
  234. \let\cropmarks = \cropmarkstrue
  235. %
  236. % Dimensions to add cropmarks at corners.
  237. % Added by P. A. MacKay, 12 Nov. 1986
  238. %
  239. \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
  240. \newdimen\cornerlong \cornerlong=1pc
  241. \newdimen\cornerthick \cornerthick=.3pt
  242. \newdimen\topandbottommargin \topandbottommargin=.75in
  243. % Output a mark which sets \thischapter, \thissection and \thiscolor.
  244. % We dump everything together because we only have one kind of mark.
  245. % This works because we only use \botmark / \topmark, not \firstmark.
  246. %
  247. % A mark contains a subexpression of the \ifcase ... \fi construct.
  248. % \get*marks macros below extract the needed part using \ifcase.
  249. %
  250. % Another complication is to let the user choose whether \thischapter
  251. % (\thissection) refers to the chapter (section) in effect at the top
  252. % of a page, or that at the bottom of a page. The solution is
  253. % described on page 260 of The TeXbook. It involves outputting two
  254. % marks for the sectioning macros, one before the section break, and
  255. % one after. I won't pretend I can describe this better than DEK...
  256. \def\domark{%
  257. \toks0=\expandafter{\lastchapterdefs}%
  258. \toks2=\expandafter{\lastsectiondefs}%
  259. \toks4=\expandafter{\prevchapterdefs}%
  260. \toks6=\expandafter{\prevsectiondefs}%
  261. \toks8=\expandafter{\lastcolordefs}%
  262. \mark{%
  263. \the\toks0 \the\toks2
  264. \noexpand\or \the\toks4 \the\toks6
  265. \noexpand\else \the\toks8
  266. }%
  267. }
  268. % \topmark doesn't work for the very first chapter (after the title
  269. % page or the contents), so we use \firstmark there -- this gets us
  270. % the mark with the chapter defs, unless the user sneaks in, e.g.,
  271. % @setcolor (or @url, or @link, etc.) between @contents and the very
  272. % first @chapter.
  273. \def\gettopheadingmarks{%
  274. \ifcase0\topmark\fi
  275. \ifx\thischapter\empty \ifcase0\firstmark\fi \fi
  276. }
  277. \def\getbottomheadingmarks{\ifcase1\botmark\fi}
  278. \def\getcolormarks{\ifcase2\topmark\fi}
  279. % Avoid "undefined control sequence" errors.
  280. \def\lastchapterdefs{}
  281. \def\lastsectiondefs{}
  282. \def\prevchapterdefs{}
  283. \def\prevsectiondefs{}
  284. \def\lastcolordefs{}
  285. % Main output routine.
  286. \chardef\PAGE = 255
  287. \output = {\onepageout{\pagecontents\PAGE}}
  288. \newbox\headlinebox
  289. \newbox\footlinebox
  290. % \onepageout takes a vbox as an argument. Note that \pagecontents
  291. % does insertions, but you have to call it yourself.
  292. \def\onepageout#1{%
  293. \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
  294. %
  295. \ifodd\pageno \advance\hoffset by \bindingoffset
  296. \else \advance\hoffset by -\bindingoffset\fi
  297. %
  298. % Do this outside of the \shipout so @code etc. will be expanded in
  299. % the headline as they should be, not taken literally (outputting ''code).
  300. \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
  301. \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
  302. \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
  303. \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
  304. %
  305. {%
  306. % Have to do this stuff outside the \shipout because we want it to
  307. % take effect in \write's, yet the group defined by the \vbox ends
  308. % before the \shipout runs.
  309. %
  310. \indexdummies % don't expand commands in the output.
  311. \normalturnoffactive % \ in index entries must not stay \, e.g., if
  312. % the page break happens to be in the middle of an example.
  313. % We don't want .vr (or whatever) entries like this:
  314. % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}}
  315. % "\acronym" won't work when it's read back in;
  316. % it needs to be
  317. % {\code {{\tt \backslashcurfont }acronym}
  318. \shipout\vbox{%
  319. % Do this early so pdf references go to the beginning of the page.
  320. \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
  321. %
  322. \ifcropmarks \vbox to \outervsize\bgroup
  323. \hsize = \outerhsize
  324. \vskip-\topandbottommargin
  325. \vtop to0pt{%
  326. \line{\ewtop\hfil\ewtop}%
  327. \nointerlineskip
  328. \line{%
  329. \vbox{\moveleft\cornerthick\nstop}%
  330. \hfill
  331. \vbox{\moveright\cornerthick\nstop}%
  332. }%
  333. \vss}%
  334. \vskip\topandbottommargin
  335. \line\bgroup
  336. \hfil % center the page within the outer (page) hsize.
  337. \ifodd\pageno\hskip\bindingoffset\fi
  338. \vbox\bgroup
  339. \fi
  340. %
  341. \unvbox\headlinebox
  342. \pagebody{#1}%
  343. \ifdim\ht\footlinebox > 0pt
  344. % Only leave this space if the footline is nonempty.
  345. % (We lessened \vsize for it in \oddfootingyyy.)
  346. % The \baselineskip=24pt in plain's \makefootline has no effect.
  347. \vskip 24pt
  348. \unvbox\footlinebox
  349. \fi
  350. %
  351. \ifcropmarks
  352. \egroup % end of \vbox\bgroup
  353. \hfil\egroup % end of (centering) \line\bgroup
  354. \vskip\topandbottommargin plus1fill minus1fill
  355. \boxmaxdepth = \cornerthick
  356. \vbox to0pt{\vss
  357. \line{%
  358. \vbox{\moveleft\cornerthick\nsbot}%
  359. \hfill
  360. \vbox{\moveright\cornerthick\nsbot}%
  361. }%
  362. \nointerlineskip
  363. \line{\ewbot\hfil\ewbot}%
  364. }%
  365. \egroup % \vbox from first cropmarks clause
  366. \fi
  367. }% end of \shipout\vbox
  368. }% end of group with \indexdummies
  369. \advancepageno
  370. \ifnum\outputpenalty>-20000 \else\dosupereject\fi
  371. }
  372. \newinsert\margin \dimen\margin=\maxdimen
  373. \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
  374. {\catcode`\@ =11
  375. \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
  376. % marginal hacks, juha@viisa.uucp (Juha Takala)
  377. \ifvoid\margin\else % marginal info is present
  378. \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
  379. \dimen@=\dp#1\relax \unvbox#1\relax
  380. \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
  381. \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
  382. }
  383. % Here are the rules for the cropmarks. Note that they are
  384. % offset so that the space between them is truly \outerhsize or \outervsize
  385. % (P. A. MacKay, 12 November, 1986)
  386. %
  387. \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
  388. \def\nstop{\vbox
  389. {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
  390. \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
  391. \def\nsbot{\vbox
  392. {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
  393. % Parse an argument, then pass it to #1. The argument is the rest of
  394. % the input line (except we remove a trailing comment). #1 should be a
  395. % macro which expects an ordinary undelimited TeX argument.
  396. %
  397. \def\parsearg{\parseargusing{}}
  398. \def\parseargusing#1#2{%
  399. \def\argtorun{#2}%
  400. \begingroup
  401. \obeylines
  402. \spaceisspace
  403. #1%
  404. \parseargline\empty% Insert the \empty token, see \finishparsearg below.
  405. }
  406. {\obeylines %
  407. \gdef\parseargline#1^^M{%
  408. \endgroup % End of the group started in \parsearg.
  409. \argremovecomment #1\comment\ArgTerm%
  410. }%
  411. }
  412. % First remove any @comment, then any @c comment.
  413. \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
  414. \def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
  415. % Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space.
  416. %
  417. % \argremovec might leave us with trailing space, e.g.,
  418. % @end itemize @c foo
  419. % This space token undergoes the same procedure and is eventually removed
  420. % by \finishparsearg.
  421. %
  422. \def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M}
  423. \def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M}
  424. \def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
  425. \def\temp{#3}%
  426. \ifx\temp\empty
  427. % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp:
  428. \let\temp\finishparsearg
  429. \else
  430. \let\temp\argcheckspaces
  431. \fi
  432. % Put the space token in:
  433. \temp#1 #3\ArgTerm
  434. }
  435. % If a _delimited_ argument is enclosed in braces, they get stripped; so
  436. % to get _exactly_ the rest of the line, we had to prevent such situation.
  437. % We prepended an \empty token at the very beginning and we expand it now,
  438. % just before passing the control to \argtorun.
  439. % (Similarly, we have to think about #3 of \argcheckspacesY above: it is
  440. % either the null string, or it ends with \^^M---thus there is no danger
  441. % that a pair of braces would be stripped.
  442. %
  443. % But first, we have to remove the trailing space token.
  444. %
  445. \def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}}
  446. % \parseargdef\foo{...}
  447. % is roughly equivalent to
  448. % \def\foo{\parsearg\Xfoo}
  449. % \def\Xfoo#1{...}
  450. %
  451. % Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my
  452. % favourite TeX trick. --kasal, 16nov03
  453. \def\parseargdef#1{%
  454. \expandafter \doparseargdef \csname\string#1\endcsname #1%
  455. }
  456. \def\doparseargdef#1#2{%
  457. \def#2{\parsearg#1}%
  458. \def#1##1%
  459. }
  460. % Several utility definitions with active space:
  461. {
  462. \obeyspaces
  463. \gdef\obeyedspace{ }
  464. % Make each space character in the input produce a normal interword
  465. % space in the output. Don't allow a line break at this space, as this
  466. % is used only in environments like @example, where each line of input
  467. % should produce a line of output anyway.
  468. %
  469. \gdef\sepspaces{\obeyspaces\let =\tie}
  470. % If an index command is used in an @example environment, any spaces
  471. % therein should become regular spaces in the raw index file, not the
  472. % expansion of \tie (\leavevmode \penalty \@M \ ).
  473. \gdef\unsepspaces{\let =\space}
  474. }
  475. \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
  476. % Define the framework for environments in texinfo.tex. It's used like this:
  477. %
  478. % \envdef\foo{...}
  479. % \def\Efoo{...}
  480. %
  481. % It's the responsibility of \envdef to insert \begingroup before the
  482. % actual body; @end closes the group after calling \Efoo. \envdef also
  483. % defines \thisenv, so the current environment is known; @end checks
  484. % whether the environment name matches. The \checkenv macro can also be
  485. % used to check whether the current environment is the one expected.
  486. %
  487. % Non-false conditionals (@iftex, @ifset) don't fit into this, so they
  488. % are not treated as environments; they don't open a group. (The
  489. % implementation of @end takes care not to call \endgroup in this
  490. % special case.)
  491. % At run-time, environments start with this:
  492. \def\startenvironment#1{\begingroup\def\thisenv{#1}}
  493. % initialize
  494. \let\thisenv\empty
  495. % ... but they get defined via ``\envdef\foo{...}'':
  496. \long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
  497. \def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
  498. % Check whether we're in the right environment:
  499. \def\checkenv#1{%
  500. \def\temp{#1}%
  501. \ifx\thisenv\temp
  502. \else
  503. \badenverr
  504. \fi
  505. }
  506. % Environment mismatch, #1 expected:
  507. \def\badenverr{%
  508. \errhelp = \EMsimple
  509. \errmessage{This command can appear only \inenvironment\temp,
  510. not \inenvironment\thisenv}%
  511. }
  512. \def\inenvironment#1{%
  513. \ifx#1\empty
  514. outside of any environment%
  515. \else
  516. in environment \expandafter\string#1%
  517. \fi
  518. }
  519. % @end foo executes the definition of \Efoo.
  520. % But first, it executes a specialized version of \checkenv
  521. %
  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. % \dimen0 is the vertical size of the group's box.
  619. \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox
  620. % \dimen2 is how much space is left on the page (more or less).
  621. \dimen2 = \pageheight \advance\dimen2 by -\pagetotal
  622. % if the group doesn't fit on the current page, and it's a big big
  623. % group, force a page break.
  624. \ifdim \dimen0 > \dimen2
  625. \ifdim \pagetotal < \vfilllimit\pageheight
  626. \page
  627. \fi
  628. \fi
  629. \box\groupbox
  630. \prevdepth = \dimen1
  631. \checkinserts
  632. }
  633. %
  634. % TeX puts in an \escapechar (i.e., `@') at the beginning of the help
  635. % message, so this ends up printing `@group can only ...'.
  636. %
  637. \newhelp\groupinvalidhelp{%
  638. group can only be used in environments such as @example,^^J%
  639. where each line of input produces a line of output.}
  640. % @need space-in-mils
  641. % forces a page break if there is not space-in-mils remaining.
  642. \newdimen\mil \mil=0.001in
  643. \parseargdef\need{%
  644. % Ensure vertical mode, so we don't make a big box in the middle of a
  645. % paragraph.
  646. \par
  647. %
  648. % If the @need value is less than one line space, it's useless.
  649. \dimen0 = #1\mil
  650. \dimen2 = \ht\strutbox
  651. \advance\dimen2 by \dp\strutbox
  652. \ifdim\dimen0 > \dimen2
  653. %
  654. % Do a \strut just to make the height of this box be normal, so the
  655. % normal leading is inserted relative to the preceding line.
  656. % And a page break here is fine.
  657. \vtop to #1\mil{\strut\vfil}%
  658. %
  659. % TeX does not even consider page breaks if a penalty added to the
  660. % main vertical list is 10000 or more. But in order to see if the
  661. % empty box we just added fits on the page, we must make it consider
  662. % page breaks. On the other hand, we don't want to actually break the
  663. % page after the empty box. So we use a penalty of 9999.
  664. %
  665. % There is an extremely small chance that TeX will actually break the
  666. % page at this \penalty, if there are no other feasible breakpoints in
  667. % sight. (If the user is using lots of big @group commands, which
  668. % almost-but-not-quite fill up a page, TeX will have a hard time doing
  669. % good page breaking, for example.) However, I could not construct an
  670. % example where a page broke at this \penalty; if it happens in a real
  671. % document, then we can reconsider our strategy.
  672. \penalty9999
  673. %
  674. % Back up by the size of the box, whether we did a page break or not.
  675. \kern -#1\mil
  676. %
  677. % Do not allow a page break right after this kern.
  678. \nobreak
  679. \fi
  680. }
  681. % @br forces paragraph break (and is undocumented).
  682. \let\br = \par
  683. % @page forces the start of a new page.
  684. %
  685. \def\page{\par\vfill\supereject}
  686. % @exdent text....
  687. % outputs text on separate line in roman font, starting at standard page margin
  688. % This records the amount of indent in the innermost environment.
  689. % That's how much \exdent should take out.
  690. \newskip\exdentamount
  691. % This defn is used inside fill environments such as @defun.
  692. \parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
  693. % This defn is used inside nofill environments such as @example.
  694. \parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount
  695. \leftline{\hskip\leftskip{\rm#1}}}}
  696. % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
  697. % paragraph. For more general purposes, use the \margin insertion
  698. % class. WHICH is `l' or `r'. Not documented, written for gawk manual.
  699. %
  700. \newskip\inmarginspacing \inmarginspacing=1cm
  701. \def\strutdepth{\dp\strutbox}
  702. %
  703. \def\doinmargin#1#2{\strut\vadjust{%
  704. \nobreak
  705. \kern-\strutdepth
  706. \vtop to \strutdepth{%
  707. \baselineskip=\strutdepth
  708. \vss
  709. % if you have multiple lines of stuff to put here, you'll need to
  710. % make the vbox yourself of the appropriate size.
  711. \ifx#1l%
  712. \llap{\ignorespaces #2\hskip\inmarginspacing}%
  713. \else
  714. \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
  715. \fi
  716. \null
  717. }%
  718. }}
  719. \def\inleftmargin{\doinmargin l}
  720. \def\inrightmargin{\doinmargin r}
  721. %
  722. % @inmargin{TEXT [, RIGHT-TEXT]}
  723. % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
  724. % else use TEXT for both).
  725. %
  726. \def\inmargin#1{\parseinmargin #1,,\finish}
  727. \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
  728. \setbox0 = \hbox{\ignorespaces #2}%
  729. \ifdim\wd0 > 0pt
  730. \def\lefttext{#1}% have both texts
  731. \def\righttext{#2}%
  732. \else
  733. \def\lefttext{#1}% have only one text
  734. \def\righttext{#1}%
  735. \fi
  736. %
  737. \ifodd\pageno
  738. \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
  739. \else
  740. \def\temp{\inleftmargin\lefttext}%
  741. \fi
  742. \temp
  743. }
  744. % @| inserts a changebar to the left of the current line. It should
  745. % surround any changed text. This approach does *not* work if the
  746. % change spans more than two lines of output. To handle that, we would
  747. % have adopt a much more difficult approach (putting marks into the main
  748. % vertical list for the beginning and end of each change). This command
  749. % is not documented, not supported, and doesn't work.
  750. %
  751. \def\|{%
  752. % \vadjust can only be used in horizontal mode.
  753. \leavevmode
  754. %
  755. % Append this vertical mode material after the current line in the output.
  756. \vadjust{%
  757. % We want to insert a rule with the height and depth of the current
  758. % leading; that is exactly what \strutbox is supposed to record.
  759. \vskip-\baselineskip
  760. %
  761. % \vadjust-items are inserted at the left edge of the type. So
  762. % the \llap here moves out into the left-hand margin.
  763. \llap{%
  764. %
  765. % For a thicker or thinner bar, change the `1pt'.
  766. \vrule height\baselineskip width1pt
  767. %
  768. % This is the space between the bar and the text.
  769. \hskip 12pt
  770. }%
  771. }%
  772. }
  773. % @include FILE -- \input text of FILE.
  774. %
  775. \def\include{\parseargusing\filenamecatcodes\includezzz}
  776. \def\includezzz#1{%
  777. \pushthisfilestack
  778. \def\thisfile{#1}%
  779. {%
  780. \makevalueexpandable % we want to expand any @value in FILE.
  781. \turnoffactive % and allow special characters in the expansion
  782. \indexnofonts % Allow `@@' and other weird things in file names.
  783. \wlog{texinfo.tex: doing @include of #1^^J}%
  784. \edef\temp{\noexpand\input #1 }%
  785. %
  786. % This trickery is to read FILE outside of a group, in case it makes
  787. % definitions, etc.
  788. \expandafter
  789. }\temp
  790. \popthisfilestack
  791. }
  792. \def\filenamecatcodes{%
  793. \catcode`\\=\other
  794. \catcode`~=\other
  795. \catcode`^=\other
  796. \catcode`_=\other
  797. \catcode`|=\other
  798. \catcode`<=\other
  799. \catcode`>=\other
  800. \catcode`+=\other
  801. \catcode`-=\other
  802. \catcode`\`=\other
  803. \catcode`\'=\other
  804. }
  805. \def\pushthisfilestack{%
  806. \expandafter\pushthisfilestackX\popthisfilestack\StackTerm
  807. }
  808. \def\pushthisfilestackX{%
  809. \expandafter\pushthisfilestackY\thisfile\StackTerm
  810. }
  811. \def\pushthisfilestackY #1\StackTerm #2\StackTerm {%
  812. \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}%
  813. }
  814. \def\popthisfilestack{\errthisfilestackempty}
  815. \def\errthisfilestackempty{\errmessage{Internal error:
  816. the stack of filenames is empty.}}
  817. %
  818. \def\thisfile{}
  819. % @center line
  820. % outputs that line, centered.
  821. %
  822. \parseargdef\center{%
  823. \ifhmode
  824. \let\centersub\centerH
  825. \else
  826. \let\centersub\centerV
  827. \fi
  828. \centersub{\hfil \ignorespaces#1\unskip \hfil}%
  829. \let\centersub\relax % don't let the definition persist, just in case
  830. }
  831. \def\centerH#1{{%
  832. \hfil\break
  833. \advance\hsize by -\leftskip
  834. \advance\hsize by -\rightskip
  835. \line{#1}%
  836. \break
  837. }}
  838. %
  839. \newcount\centerpenalty
  840. \def\centerV#1{%
  841. % The idea here is the same as in \startdefun, \cartouche, etc.: if
  842. % @center is the first thing after a section heading, we need to wipe
  843. % out the negative parskip inserted by \sectionheading, but still
  844. % prevent a page break here.
  845. \centerpenalty = \lastpenalty
  846. \ifnum\centerpenalty>10000 \vskip\parskip \fi
  847. \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi
  848. \line{\kern\leftskip #1\kern\rightskip}%
  849. }
  850. % @sp n outputs n lines of vertical space
  851. %
  852. \parseargdef\sp{\vskip #1\baselineskip}
  853. % @comment ...line which is ignored...
  854. % @c is the same as @comment
  855. % @ignore ... @end ignore is another way to write a comment
  856. %
  857. \def\comment{\begingroup \catcode`\^^M=\other%
  858. \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
  859. \commentxxx}
  860. {\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
  861. %
  862. \let\c=\comment
  863. % @paragraphindent NCHARS
  864. % We'll use ems for NCHARS, close enough.
  865. % NCHARS can also be the word `asis' or `none'.
  866. % We cannot feasibly implement @paragraphindent asis, though.
  867. %
  868. \def\asisword{asis} % no translation, these are keywords
  869. \def\noneword{none}
  870. %
  871. \parseargdef\paragraphindent{%
  872. \def\temp{#1}%
  873. \ifx\temp\asisword
  874. \else
  875. \ifx\temp\noneword
  876. \defaultparindent = 0pt
  877. \else
  878. \defaultparindent = #1em
  879. \fi
  880. \fi
  881. \parindent = \defaultparindent
  882. }
  883. % @exampleindent NCHARS
  884. % We'll use ems for NCHARS like @paragraphindent.
  885. % It seems @exampleindent asis isn't necessary, but
  886. % I preserve it to make it similar to @paragraphindent.
  887. \parseargdef\exampleindent{%
  888. \def\temp{#1}%
  889. \ifx\temp\asisword
  890. \else
  891. \ifx\temp\noneword
  892. \lispnarrowing = 0pt
  893. \else
  894. \lispnarrowing = #1em
  895. \fi
  896. \fi
  897. }
  898. % @firstparagraphindent WORD
  899. % If WORD is `none', then suppress indentation of the first paragraph
  900. % after a section heading. If WORD is `insert', then do indent at such
  901. % paragraphs.
  902. %
  903. % The paragraph indentation is suppressed or not by calling
  904. % \suppressfirstparagraphindent, which the sectioning commands do.
  905. % We switch the definition of this back and forth according to WORD.
  906. % By default, we suppress indentation.
  907. %
  908. \def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
  909. \def\insertword{insert}
  910. %
  911. \parseargdef\firstparagraphindent{%
  912. \def\temp{#1}%
  913. \ifx\temp\noneword
  914. \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
  915. \else\ifx\temp\insertword
  916. \let\suppressfirstparagraphindent = \relax
  917. \else
  918. \errhelp = \EMsimple
  919. \errmessage{Unknown @firstparagraphindent option `\temp'}%
  920. \fi\fi
  921. }
  922. % Here is how we actually suppress indentation. Redefine \everypar to
  923. % \kern backwards by \parindent, and then reset itself to empty.
  924. %
  925. % We also make \indent itself not actually do anything until the next
  926. % paragraph.
  927. %
  928. \gdef\dosuppressfirstparagraphindent{%
  929. \gdef\indent{%
  930. \restorefirstparagraphindent
  931. \indent
  932. }%
  933. \gdef\noindent{%
  934. \restorefirstparagraphindent
  935. \noindent
  936. }%
  937. \global\everypar = {%
  938. \kern -\parindent
  939. \restorefirstparagraphindent
  940. }%
  941. }
  942. \gdef\restorefirstparagraphindent{%
  943. \global \let \indent = \ptexindent
  944. \global \let \noindent = \ptexnoindent
  945. \global \everypar = {}%
  946. }
  947. % @refill is a no-op.
  948. \let\refill=\relax
  949. % If working on a large document in chapters, it is convenient to
  950. % be able to disable indexing, cross-referencing, and contents, for test runs.
  951. % This is done with @novalidate (before @setfilename).
  952. %
  953. \newif\iflinks \linkstrue % by default we want the aux files.
  954. \let\novalidate = \linksfalse
  955. % @setfilename is done at the beginning of every texinfo file.
  956. % So open here the files we need to have open while reading the input.
  957. % This makes it possible to make a .fmt file for texinfo.
  958. \def\setfilename{%
  959. \fixbackslash % Turn off hack to swallow `\input texinfo'.
  960. \iflinks
  961. \tryauxfile
  962. % Open the new aux file. TeX will close it automatically at exit.
  963. \immediate\openout\auxfile=\jobname.aux
  964. \fi % \openindices needs to do some work in any case.
  965. \openindices
  966. \let\setfilename=\comment % Ignore extra @setfilename cmds.
  967. %
  968. % If texinfo.cnf is present on the system, read it.
  969. % Useful for site-wide @afourpaper, etc.
  970. \openin 1 texinfo.cnf
  971. \ifeof 1 \else \input texinfo.cnf \fi
  972. \closein 1
  973. %
  974. \comment % Ignore the actual filename.
  975. }
  976. % Called from \setfilename.
  977. %
  978. \def\openindices{%
  979. \newindex{cp}%
  980. \newcodeindex{fn}%
  981. \newcodeindex{vr}%
  982. \newcodeindex{tp}%
  983. \newcodeindex{ky}%
  984. \newcodeindex{pg}%
  985. }
  986. % @bye.
  987. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
  988. \message{pdf,}
  989. % adobe `portable' document format
  990. \newcount\tempnum
  991. \newcount\lnkcount
  992. \newtoks\filename
  993. \newcount\filenamelength
  994. \newcount\pgn
  995. \newtoks\toksA
  996. \newtoks\toksB
  997. \newtoks\toksC
  998. \newtoks\toksD
  999. \newbox\boxA
  1000. \newcount\countA
  1001. \newif\ifpdf
  1002. \newif\ifpdfmakepagedest
  1003. % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
  1004. % can be set). So we test for \relax and 0 as well as being undefined.
  1005. \ifx\pdfoutput\thisisundefined
  1006. \else
  1007. \ifx\pdfoutput\relax
  1008. \else
  1009. \ifcase\pdfoutput
  1010. \else
  1011. \pdftrue
  1012. \fi
  1013. \fi
  1014. \fi
  1015. % PDF uses PostScript string constants for the names of xref targets,
  1016. % for display in the outlines, and in other places. Thus, we have to
  1017. % double any backslashes. Otherwise, a name like "\node" will be
  1018. % interpreted as a newline (\n), followed by o, d, e. Not good.
  1019. %
  1020. % See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and
  1021. % related messages. The final outcome is that it is up to the TeX user
  1022. % to double the backslashes and otherwise make the string valid, so
  1023. % that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to
  1024. % do this reliably, so we use it.
  1025. % #1 is a control sequence in which to do the replacements,
  1026. % which we \xdef.
  1027. \def\txiescapepdf#1{%
  1028. \ifx\pdfescapestring\thisisundefined
  1029. % No primitive available; should we give a warning or log?
  1030. % Many times it won't matter.
  1031. \else
  1032. % The expandable \pdfescapestring primitive escapes parentheses,
  1033. % backslashes, and other special chars.
  1034. \xdef#1{\pdfescapestring{#1}}%
  1035. \fi
  1036. }
  1037. \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
  1038. with PDF output, and none of those formats could be found. (.eps cannot
  1039. be supported due to the design of the PDF format; use regular TeX (DVI
  1040. output) for that.)}
  1041. \ifpdf
  1042. %
  1043. % Color manipulation macros based on pdfcolor.tex,
  1044. % except using rgb instead of cmyk; the latter is said to render as a
  1045. % very dark gray on-screen and a very dark halftone in print, instead
  1046. % of actual black.
  1047. \def\rgbDarkRed{0.50 0.09 0.12}
  1048. \def\rgbBlack{0 0 0}
  1049. %
  1050. % k sets the color for filling (usual text, etc.);
  1051. % K sets the color for stroking (thin rules, e.g., normal _'s).
  1052. \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}}
  1053. %
  1054. % Set color, and create a mark which defines \thiscolor accordingly,
  1055. % so that \makeheadline knows which color to restore.
  1056. \def\setcolor#1{%
  1057. \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}%
  1058. \domark
  1059. \pdfsetcolor{#1}%
  1060. }
  1061. %
  1062. \def\maincolor{\rgbBlack}
  1063. \pdfsetcolor{\maincolor}
  1064. \edef\thiscolor{\maincolor}
  1065. \def\lastcolordefs{}
  1066. %
  1067. \def\makefootline{%
  1068. \baselineskip24pt
  1069. \line{\pdfsetcolor{\maincolor}\the\footline}%
  1070. }
  1071. %
  1072. \def\makeheadline{%
  1073. \vbox to 0pt{%
  1074. \vskip-22.5pt
  1075. \line{%
  1076. \vbox to8.5pt{}%
  1077. % Extract \thiscolor definition from the marks.
  1078. \getcolormarks
  1079. % Typeset the headline with \maincolor, then restore the color.
  1080. \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
  1081. }%
  1082. \vss
  1083. }%
  1084. \nointerlineskip
  1085. }
  1086. %
  1087. %
  1088. \pdfcatalog{/PageMode /UseOutlines}
  1089. %
  1090. % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
  1091. \def\dopdfimage#1#2#3{%
  1092. \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
  1093. \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
  1094. %
  1095. % pdftex (and the PDF format) support .pdf, .png, .jpg (among
  1096. % others). Let's try in that order, PDF first since if
  1097. % someone has a scalable image, presumably better to use that than a
  1098. % bitmap.
  1099. \let\pdfimgext=\empty
  1100. \begingroup
  1101. \openin 1 #1.pdf \ifeof 1
  1102. \openin 1 #1.PDF \ifeof 1
  1103. \openin 1 #1.png \ifeof 1
  1104. \openin 1 #1.jpg \ifeof 1
  1105. \openin 1 #1.jpeg \ifeof 1
  1106. \openin 1 #1.JPG \ifeof 1
  1107. \errhelp = \nopdfimagehelp
  1108. \errmessage{Could not find image file #1 for pdf}%
  1109. \else \gdef\pdfimgext{JPG}%
  1110. \fi
  1111. \else \gdef\pdfimgext{jpeg}%
  1112. \fi
  1113. \else \gdef\pdfimgext{jpg}%
  1114. \fi
  1115. \else \gdef\pdfimgext{png}%
  1116. \fi
  1117. \else \gdef\pdfimgext{PDF}%
  1118. \fi
  1119. \else \gdef\pdfimgext{pdf}%
  1120. \fi
  1121. \closein 1
  1122. \endgroup
  1123. %
  1124. % without \immediate, ancient pdftex seg faults when the same image is
  1125. % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.)
  1126. \ifnum\pdftexversion < 14
  1127. \immediate\pdfimage
  1128. \else
  1129. \immediate\pdfximage
  1130. \fi
  1131. \ifdim \wd0 >0pt width \pdfimagewidth \fi
  1132. \ifdim \wd2 >0pt height \pdfimageheight \fi
  1133. \ifnum\pdftexversion<13
  1134. #1.\pdfimgext
  1135. \else
  1136. {#1.\pdfimgext}%
  1137. \fi
  1138. \ifnum\pdftexversion < 14 \else
  1139. \pdfrefximage \pdflastximage
  1140. \fi}
  1141. %
  1142. \def\pdfmkdest#1{{%
  1143. % We have to set dummies so commands such as @code, and characters
  1144. % such as \, aren't expanded when present in a section title.
  1145. \indexnofonts
  1146. \turnoffactive
  1147. \makevalueexpandable
  1148. \def\pdfdestname{#1}%
  1149. \txiescapepdf\pdfdestname
  1150. \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
  1151. }}
  1152. %
  1153. % used to mark target names; must be expandable.
  1154. \def\pdfmkpgn#1{#1}
  1155. %
  1156. % by default, use a color that is dark enough to print on paper as
  1157. % nearly black, but still distinguishable for online viewing.
  1158. \def\urlcolor{\rgbDarkRed}
  1159. \def\linkcolor{\rgbDarkRed}
  1160. \def\endlink{\setcolor{\maincolor}\pdfendlink}
  1161. %
  1162. % Adding outlines to PDF; macros for calculating structure of outlines
  1163. % come from Petr Olsak
  1164. \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
  1165. \else \csname#1\endcsname \fi}
  1166. \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
  1167. \advance\tempnum by 1
  1168. \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
  1169. %
  1170. % #1 is the section text, which is what will be displayed in the
  1171. % outline by the pdf viewer. #2 is the pdf expression for the number
  1172. % of subentries (or empty, for subsubsections). #3 is the node text,
  1173. % which might be empty if this toc entry had no corresponding node.
  1174. % #4 is the page number
  1175. %
  1176. \def\dopdfoutline#1#2#3#4{%
  1177. % Generate a link to the node text if that exists; else, use the
  1178. % page number. We could generate a destination for the section
  1179. % text in the case where a section has no node, but it doesn't
  1180. % seem worth the trouble, since most documents are normally structured.
  1181. \edef\pdfoutlinedest{#3}%
  1182. \ifx\pdfoutlinedest\empty
  1183. \def\pdfoutlinedest{#4}%
  1184. \else
  1185. \txiescapepdf\pdfoutlinedest
  1186. \fi
  1187. %
  1188. % Also escape PDF chars in the display string.
  1189. \edef\pdfoutlinetext{#1}%
  1190. \txiescapepdf\pdfoutlinetext
  1191. %
  1192. \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
  1193. }
  1194. %
  1195. \def\pdfmakeoutlines{%
  1196. \begingroup
  1197. % Read toc silently, to get counts of subentries for \pdfoutline.
  1198. \def\partentry##1##2##3##4{}% ignore parts in the outlines
  1199. \def\numchapentry##1##2##3##4{%
  1200. \def\thischapnum{##2}%
  1201. \def\thissecnum{0}%
  1202. \def\thissubsecnum{0}%
  1203. }%
  1204. \def\numsecentry##1##2##3##4{%
  1205. \advancenumber{chap\thischapnum}%
  1206. \def\thissecnum{##2}%
  1207. \def\thissubsecnum{0}%
  1208. }%
  1209. \def\numsubsecentry##1##2##3##4{%
  1210. \advancenumber{sec\thissecnum}%
  1211. \def\thissubsecnum{##2}%
  1212. }%
  1213. \def\numsubsubsecentry##1##2##3##4{%
  1214. \advancenumber{subsec\thissubsecnum}%
  1215. }%
  1216. \def\thischapnum{0}%
  1217. \def\thissecnum{0}%
  1218. \def\thissubsecnum{0}%
  1219. %
  1220. % use \def rather than \let here because we redefine \chapentry et
  1221. % al. a second time, below.
  1222. \def\appentry{\numchapentry}%
  1223. \def\appsecentry{\numsecentry}%
  1224. \def\appsubsecentry{\numsubsecentry}%
  1225. \def\appsubsubsecentry{\numsubsubsecentry}%
  1226. \def\unnchapentry{\numchapentry}%
  1227. \def\unnsecentry{\numsecentry}%
  1228. \def\unnsubsecentry{\numsubsecentry}%
  1229. \def\unnsubsubsecentry{\numsubsubsecentry}%
  1230. \readdatafile{toc}%
  1231. %
  1232. % Read toc second time, this time actually producing the outlines.
  1233. % The `-' means take the \expnumber as the absolute number of
  1234. % subentries, which we calculated on our first read of the .toc above.
  1235. %
  1236. % We use the node names as the destinations.
  1237. \def\numchapentry##1##2##3##4{%
  1238. \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
  1239. \def\numsecentry##1##2##3##4{%
  1240. \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
  1241. \def\numsubsecentry##1##2##3##4{%
  1242. \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%
  1243. \def\numsubsubsecentry##1##2##3##4{% count is always zero
  1244. \dopdfoutline{##1}{}{##3}{##4}}%
  1245. %
  1246. % PDF outlines are displayed using system fonts, instead of
  1247. % document fonts. Therefore we cannot use special characters,
  1248. % since the encoding is unknown. For example, the eogonek from
  1249. % Latin 2 (0xea) gets translated to a | character. Info from
  1250. % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
  1251. %
  1252. % TODO this right, we have to translate 8-bit characters to
  1253. % their "best" equivalent, based on the @documentencoding. Too
  1254. % much work for too little return. Just use the ASCII equivalents
  1255. % we use for the index sort strings.
  1256. %
  1257. \indexnofonts
  1258. \setupdatafile
  1259. % We can have normal brace characters in the PDF outlines, unlike
  1260. % Texinfo index files. So set that up.
  1261. \def\{{\lbracecharliteral}%
  1262. \def\}{\rbracecharliteral}%
  1263. \catcode`\\=\active \otherbackslash
  1264. \input \tocreadfilename
  1265. \endgroup
  1266. }
  1267. {\catcode`[=1 \catcode`]=2
  1268. \catcode`{=\other \catcode`}=\other
  1269. \gdef\lbracecharliteral[{]%
  1270. \gdef\rbracecharliteral[}]%
  1271. ]
  1272. %
  1273. \def\skipspaces#1{\def\PP{#1}\def\D{|}%
  1274. \ifx\PP\D\let\nextsp\relax
  1275. \else\let\nextsp\skipspaces
  1276. \addtokens{\filename}{\PP}%
  1277. \advance\filenamelength by 1
  1278. \fi
  1279. \nextsp}
  1280. \def\getfilename#1{%
  1281. \filenamelength=0
  1282. % If we don't expand the argument now, \skipspaces will get
  1283. % snagged on things like "@value{foo}".
  1284. \edef\temp{#1}%
  1285. \expandafter\skipspaces\temp|\relax
  1286. }
  1287. \ifnum\pdftexversion < 14
  1288. \let \startlink \pdfannotlink
  1289. \else
  1290. \let \startlink \pdfstartlink
  1291. \fi
  1292. % make a live url in pdf output.
  1293. \def\pdfurl#1{%
  1294. \begingroup
  1295. % it seems we really need yet another set of dummies; have not
  1296. % tried to figure out what each command should do in the context
  1297. % of @url. for now, just make @/ a no-op, that's the only one
  1298. % people have actually reported a problem with.
  1299. %
  1300. \normalturnoffactive
  1301. \def\@{@}%
  1302. \let\/=\empty
  1303. \makevalueexpandable
  1304. % do we want to go so far as to use \indexnofonts instead of just
  1305. % special-casing \var here?
  1306. \def\var##1{##1}%
  1307. %
  1308. \leavevmode\setcolor{\urlcolor}%
  1309. \startlink attr{/Border [0 0 0]}%
  1310. user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
  1311. \endgroup}
  1312. \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
  1313. \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
  1314. \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
  1315. \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
  1316. \def\maketoks{%
  1317. \expandafter\poptoks\the\toksA|ENDTOKS|\relax
  1318. \ifx\first0\adn0
  1319. \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
  1320. \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
  1321. \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
  1322. \else
  1323. \ifnum0=\countA\else\makelink\fi
  1324. \ifx\first.\let\next=\done\else
  1325. \let\next=\maketoks
  1326. \addtokens{\toksB}{\the\toksD}
  1327. \ifx\first,\addtokens{\toksB}{\space}\fi
  1328. \fi
  1329. \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
  1330. \next}
  1331. \def\makelink{\addtokens{\toksB}%
  1332. {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
  1333. \def\pdflink#1{%
  1334. \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
  1335. \setcolor{\linkcolor}#1\endlink}
  1336. \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
  1337. \else
  1338. % non-pdf mode
  1339. \let\pdfmkdest = \gobble
  1340. \let\pdfurl = \gobble
  1341. \let\endlink = \relax
  1342. \let\setcolor = \gobble
  1343. \let\pdfsetcolor = \gobble
  1344. \let\pdfmakeoutlines = \relax
  1345. \fi % \ifx\pdfoutput
  1346. \message{fonts,}
  1347. % Change the current font style to #1, remembering it in \curfontstyle.
  1348. % For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
  1349. % italics, not bold italics.
  1350. %
  1351. \def\setfontstyle#1{%
  1352. \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
  1353. \csname ten#1\endcsname % change the current font
  1354. }
  1355. % Select #1 fonts with the current style.
  1356. %
  1357. \def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname}
  1358. \def\rm{\fam=0 \setfontstyle{rm}}
  1359. \def\it{\fam=\itfam \setfontstyle{it}}
  1360. \def\sl{\fam=\slfam \setfontstyle{sl}}
  1361. \def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
  1362. \def\tt{\fam=\ttfam \setfontstyle{tt}}
  1363. % Unfortunately, we have to override this for titles and the like, since
  1364. % in those cases "rm" is bold. Sigh.
  1365. \def\rmisbold{\rm\def\curfontstyle{bf}}
  1366. % Texinfo sort of supports the sans serif font style, which plain TeX does not.
  1367. % So we set up a \sf.
  1368. \newfam\sffam
  1369. \def\sf{\fam=\sffam \setfontstyle{sf}}
  1370. \let\li = \sf % Sometimes we call it \li, not \sf.
  1371. % We don't need math for this font style.
  1372. \def\ttsl{\setfontstyle{ttsl}}
  1373. % Set the baselineskip to #1, and the lineskip and strut size
  1374. % correspondingly. There is no deep meaning behind these magic numbers
  1375. % used as factors; they just match (closely enough) what Knuth defined.
  1376. %
  1377. \def\lineskipfactor{.08333}
  1378. \def\strutheightpercent{.70833}
  1379. \def\strutdepthpercent {.29167}
  1380. %
  1381. % can get a sort of poor man's double spacing by redefining this.
  1382. \def\baselinefactor{1}
  1383. %
  1384. \newdimen\textleading
  1385. \def\setleading#1{%
  1386. \dimen0 = #1\relax
  1387. \normalbaselineskip = \baselinefactor\dimen0
  1388. \normallineskip = \lineskipfactor\normalbaselineskip
  1389. \normalbaselines
  1390. \setbox\strutbox =\hbox{%
  1391. \vrule width0pt height\strutheightpercent\baselineskip
  1392. depth \strutdepthpercent \baselineskip
  1393. }%
  1394. }
  1395. % PDF CMaps. See also LaTeX's t1.cmap.
  1396. %
  1397. % do nothing with this by default.
  1398. \expandafter\let\csname cmapOT1\endcsname\gobble
  1399. \expandafter\let\csname cmapOT1IT\endcsname\gobble
  1400. \expandafter\let\csname cmapOT1TT\endcsname\gobble
  1401. % if we are producing pdf, and we have \pdffontattr, then define cmaps.
  1402. % (\pdffontattr was introduced many years ago, but people still run
  1403. % older pdftex's; it's easy to conditionalize, so we do.)
  1404. \ifpdf \ifx\pdffontattr\thisisundefined \else
  1405. \begingroup
  1406. \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
  1407. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
  1408. %%DocumentNeededResources: ProcSet (CIDInit)
  1409. %%IncludeResource: ProcSet (CIDInit)
  1410. %%BeginResource: CMap (TeX-OT1-0)
  1411. %%Title: (TeX-OT1-0 TeX OT1 0)
  1412. %%Version: 1.000
  1413. %%EndComments
  1414. /CIDInit /ProcSet findresource begin
  1415. 12 dict begin
  1416. begincmap
  1417. /CIDSystemInfo
  1418. << /Registry (TeX)
  1419. /Ordering (OT1)
  1420. /Supplement 0
  1421. >> def
  1422. /CMapName /TeX-OT1-0 def
  1423. /CMapType 2 def
  1424. 1 begincodespacerange
  1425. <00> <7F>
  1426. endcodespacerange
  1427. 8 beginbfrange
  1428. <00> <01> <0393>
  1429. <09> <0A> <03A8>
  1430. <23> <26> <0023>
  1431. <28> <3B> <0028>
  1432. <3F> <5B> <003F>
  1433. <5D> <5E> <005D>
  1434. <61> <7A> <0061>
  1435. <7B> <7C> <2013>
  1436. endbfrange
  1437. 40 beginbfchar
  1438. <02> <0398>
  1439. <03> <039B>
  1440. <04> <039E>
  1441. <05> <03A0>
  1442. <06> <03A3>
  1443. <07> <03D2>
  1444. <08> <03A6>
  1445. <0B> <00660066>
  1446. <0C> <00660069>
  1447. <0D> <0066006C>
  1448. <0E> <006600660069>
  1449. <0F> <00660066006C>
  1450. <10> <0131>
  1451. <11> <0237>
  1452. <12> <0060>
  1453. <13> <00B4>
  1454. <14> <02C7>
  1455. <15> <02D8>
  1456. <16> <00AF>
  1457. <17> <02DA>
  1458. <18> <00B8>
  1459. <19> <00DF>
  1460. <1A> <00E6>
  1461. <1B> <0153>
  1462. <1C> <00F8>
  1463. <1D> <00C6>
  1464. <1E> <0152>
  1465. <1F> <00D8>
  1466. <21> <0021>
  1467. <22> <201D>
  1468. <27> <2019>
  1469. <3C> <00A1>
  1470. <3D> <003D>
  1471. <3E> <00BF>
  1472. <5C> <201C>
  1473. <5F> <02D9>
  1474. <60> <2018>
  1475. <7D> <02DD>
  1476. <7E> <007E>
  1477. <7F> <00A8>
  1478. endbfchar
  1479. endcmap
  1480. CMapName currentdict /CMap defineresource pop
  1481. end
  1482. end
  1483. %%EndResource
  1484. %%EOF
  1485. }\endgroup
  1486. \expandafter\edef\csname cmapOT1\endcsname#1{%
  1487. \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
  1488. }%
  1489. %
  1490. % \cmapOT1IT
  1491. \begingroup
  1492. \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
  1493. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
  1494. %%DocumentNeededResources: ProcSet (CIDInit)
  1495. %%IncludeResource: ProcSet (CIDInit)
  1496. %%BeginResource: CMap (TeX-OT1IT-0)
  1497. %%Title: (TeX-OT1IT-0 TeX OT1IT 0)
  1498. %%Version: 1.000
  1499. %%EndComments
  1500. /CIDInit /ProcSet findresource begin
  1501. 12 dict begin
  1502. begincmap
  1503. /CIDSystemInfo
  1504. << /Registry (TeX)
  1505. /Ordering (OT1IT)
  1506. /Supplement 0
  1507. >> def
  1508. /CMapName /TeX-OT1IT-0 def
  1509. /CMapType 2 def
  1510. 1 begincodespacerange
  1511. <00> <7F>
  1512. endcodespacerange
  1513. 8 beginbfrange
  1514. <00> <01> <0393>
  1515. <09> <0A> <03A8>
  1516. <25> <26> <0025>
  1517. <28> <3B> <0028>
  1518. <3F> <5B> <003F>
  1519. <5D> <5E> <005D>
  1520. <61> <7A> <0061>
  1521. <7B> <7C> <2013>
  1522. endbfrange
  1523. 42 beginbfchar
  1524. <02> <0398>
  1525. <03> <039B>
  1526. <04> <039E>
  1527. <05> <03A0>
  1528. <06> <03A3>
  1529. <07> <03D2>
  1530. <08> <03A6>
  1531. <0B> <00660066>
  1532. <0C> <00660069>
  1533. <0D> <0066006C>
  1534. <0E> <006600660069>
  1535. <0F> <00660066006C>
  1536. <10> <0131>
  1537. <11> <0237>
  1538. <12> <0060>
  1539. <13> <00B4>
  1540. <14> <02C7>
  1541. <15> <02D8>
  1542. <16> <00AF>
  1543. <17> <02DA>
  1544. <18> <00B8>
  1545. <19> <00DF>
  1546. <1A> <00E6>
  1547. <1B> <0153>
  1548. <1C> <00F8>
  1549. <1D> <00C6>
  1550. <1E> <0152>
  1551. <1F> <00D8>
  1552. <21> <0021>
  1553. <22> <201D>
  1554. <23> <0023>
  1555. <24> <00A3>
  1556. <27> <2019>
  1557. <3C> <00A1>
  1558. <3D> <003D>
  1559. <3E> <00BF>
  1560. <5C> <201C>
  1561. <5F> <02D9>
  1562. <60> <2018>
  1563. <7D> <02DD>
  1564. <7E> <007E>
  1565. <7F> <00A8>
  1566. endbfchar
  1567. endcmap
  1568. CMapName currentdict /CMap defineresource pop
  1569. end
  1570. end
  1571. %%EndResource
  1572. %%EOF
  1573. }\endgroup
  1574. \expandafter\edef\csname cmapOT1IT\endcsname#1{%
  1575. \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
  1576. }%
  1577. %
  1578. % \cmapOT1TT
  1579. \begingroup
  1580. \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
  1581. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
  1582. %%DocumentNeededResources: ProcSet (CIDInit)
  1583. %%IncludeResource: ProcSet (CIDInit)
  1584. %%BeginResource: CMap (TeX-OT1TT-0)
  1585. %%Title: (TeX-OT1TT-0 TeX OT1TT 0)
  1586. %%Version: 1.000
  1587. %%EndComments
  1588. /CIDInit /ProcSet findresource begin
  1589. 12 dict begin
  1590. begincmap
  1591. /CIDSystemInfo
  1592. << /Registry (TeX)
  1593. /Ordering (OT1TT)
  1594. /Supplement 0
  1595. >> def
  1596. /CMapName /TeX-OT1TT-0 def
  1597. /CMapType 2 def
  1598. 1 begincodespacerange
  1599. <00> <7F>
  1600. endcodespacerange
  1601. 5 beginbfrange
  1602. <00> <01> <0393>
  1603. <09> <0A> <03A8>
  1604. <21> <26> <0021>
  1605. <28> <5F> <0028>
  1606. <61> <7E> <0061>
  1607. endbfrange
  1608. 32 beginbfchar
  1609. <02> <0398>
  1610. <03> <039B>
  1611. <04> <039E>
  1612. <05> <03A0>
  1613. <06> <03A3>
  1614. <07> <03D2>
  1615. <08> <03A6>
  1616. <0B> <2191>
  1617. <0C> <2193>
  1618. <0D> <0027>
  1619. <0E> <00A1>
  1620. <0F> <00BF>
  1621. <10> <0131>
  1622. <11> <0237>
  1623. <12> <0060>
  1624. <13> <00B4>
  1625. <14> <02C7>
  1626. <15> <02D8>
  1627. <16> <00AF>
  1628. <17> <02DA>
  1629. <18> <00B8>
  1630. <19> <00DF>
  1631. <1A> <00E6>
  1632. <1B> <0153>
  1633. <1C> <00F8>
  1634. <1D> <00C6>
  1635. <1E> <0152>
  1636. <1F> <00D8>
  1637. <20> <2423>
  1638. <27> <2019>
  1639. <60> <2018>
  1640. <7F> <00A8>
  1641. endbfchar
  1642. endcmap
  1643. CMapName currentdict /CMap defineresource pop
  1644. end
  1645. end
  1646. %%EndResource
  1647. %%EOF
  1648. }\endgroup
  1649. \expandafter\edef\csname cmapOT1TT\endcsname#1{%
  1650. \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
  1651. }%
  1652. \fi\fi
  1653. % Set the font macro #1 to the font named \fontprefix#2.
  1654. % #3 is the font's design size, #4 is a scale factor, #5 is the CMap
  1655. % encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit).
  1656. % Example:
  1657. % #1 = \textrm
  1658. % #2 = \rmshape
  1659. % #3 = 10
  1660. % #4 = \mainmagstep
  1661. % #5 = OT1
  1662. %
  1663. \def\setfont#1#2#3#4#5{%
  1664. \font#1=\fontprefix#2#3 scaled #4
  1665. \csname cmap#5\endcsname#1%
  1666. }
  1667. % This is what gets called when #5 of \setfont is empty.
  1668. \let\cmap\gobble
  1669. %
  1670. % (end of cmaps)
  1671. % Use cm as the default font prefix.
  1672. % To specify the font prefix, you must define \fontprefix
  1673. % before you read in texinfo.tex.
  1674. \ifx\fontprefix\thisisundefined
  1675. \def\fontprefix{cm}
  1676. \fi
  1677. % Support font families that don't use the same naming scheme as CM.
  1678. \def\rmshape{r}
  1679. \def\rmbshape{bx} % where the normal face is bold
  1680. \def\bfshape{b}
  1681. \def\bxshape{bx}
  1682. \def\ttshape{tt}
  1683. \def\ttbshape{tt}
  1684. \def\ttslshape{sltt}
  1685. \def\itshape{ti}
  1686. \def\itbshape{bxti}
  1687. \def\slshape{sl}
  1688. \def\slbshape{bxsl}
  1689. \def\sfshape{ss}
  1690. \def\sfbshape{ss}
  1691. \def\scshape{csc}
  1692. \def\scbshape{csc}
  1693. % Definitions for a main text size of 11pt. (The default in Texinfo.)
  1694. %
  1695. \def\definetextfontsizexi{%
  1696. % Text fonts (11.2pt, magstep1).
  1697. \def\textnominalsize{11pt}
  1698. \edef\mainmagstep{\magstephalf}
  1699. \setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
  1700. \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
  1701. \setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
  1702. \setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
  1703. \setfont\textsl\slshape{10}{\mainmagstep}{OT1}
  1704. \setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
  1705. \setfont\textsc\scshape{10}{\mainmagstep}{OT1}
  1706. \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
  1707. \font\texti=cmmi10 scaled \mainmagstep
  1708. \font\textsy=cmsy10 scaled \mainmagstep
  1709. \def\textecsize{1095}
  1710. % A few fonts for @defun names and args.
  1711. \setfont\defbf\bfshape{10}{\magstep1}{OT1}
  1712. \setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
  1713. \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
  1714. \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
  1715. % Fonts for indices, footnotes, small examples (9pt).
  1716. \def\smallnominalsize{9pt}
  1717. \setfont\smallrm\rmshape{9}{1000}{OT1}
  1718. \setfont\smalltt\ttshape{9}{1000}{OT1TT}
  1719. \setfont\smallbf\bfshape{10}{900}{OT1}
  1720. \setfont\smallit\itshape{9}{1000}{OT1IT}
  1721. \setfont\smallsl\slshape{9}{1000}{OT1}
  1722. \setfont\smallsf\sfshape{9}{1000}{OT1}
  1723. \setfont\smallsc\scshape{10}{900}{OT1}
  1724. \setfont\smallttsl\ttslshape{10}{900}{OT1TT}
  1725. \font\smalli=cmmi9
  1726. \font\smallsy=cmsy9
  1727. \def\smallecsize{0900}
  1728. % Fonts for small examples (8pt).
  1729. \def\smallernominalsize{8pt}
  1730. \setfont\smallerrm\rmshape{8}{1000}{OT1}
  1731. \setfont\smallertt\ttshape{8}{1000}{OT1TT}
  1732. \setfont\smallerbf\bfshape{10}{800}{OT1}
  1733. \setfont\smallerit\itshape{8}{1000}{OT1IT}
  1734. \setfont\smallersl\slshape{8}{1000}{OT1}
  1735. \setfont\smallersf\sfshape{8}{1000}{OT1}
  1736. \setfont\smallersc\scshape{10}{800}{OT1}
  1737. \setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
  1738. \font\smalleri=cmmi8
  1739. \font\smallersy=cmsy8
  1740. \def\smallerecsize{0800}
  1741. % Fonts for title page (20.4pt):
  1742. \def\titlenominalsize{20pt}
  1743. \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
  1744. \setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
  1745. \setfont\titlesl\slbshape{10}{\magstep4}{OT1}
  1746. \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
  1747. \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
  1748. \setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
  1749. \let\titlebf=\titlerm
  1750. \setfont\titlesc\scbshape{10}{\magstep4}{OT1}
  1751. \font\titlei=cmmi12 scaled \magstep3
  1752. \font\titlesy=cmsy10 scaled \magstep4
  1753. \def\titleecsize{2074}
  1754. % Chapter (and unnumbered) fonts (17.28pt).
  1755. \def\chapnominalsize{17pt}
  1756. \setfont\chaprm\rmbshape{12}{\magstep2}{OT1}
  1757. \setfont\chapit\itbshape{10}{\magstep3}{OT1IT}
  1758. \setfont\chapsl\slbshape{10}{\magstep3}{OT1}
  1759. \setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT}
  1760. \setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT}
  1761. \setfont\chapsf\sfbshape{17}{1000}{OT1}
  1762. \let\chapbf=\chaprm
  1763. \setfont\chapsc\scbshape{10}{\magstep3}{OT1}
  1764. \font\chapi=cmmi12 scaled \magstep2
  1765. \font\chapsy=cmsy10 scaled \magstep3
  1766. \def\chapecsize{1728}
  1767. % Section fonts (14.4pt).
  1768. \def\secnominalsize{14pt}
  1769. \setfont\secrm\rmbshape{12}{\magstep1}{OT1}
  1770. \setfont\secit\itbshape{10}{\magstep2}{OT1IT}
  1771. \setfont\secsl\slbshape{10}{\magstep2}{OT1}
  1772. \setfont\sectt\ttbshape{12}{\magstep1}{OT1TT}
  1773. \setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT}
  1774. \setfont\secsf\sfbshape{12}{\magstep1}{OT1}
  1775. \let\secbf\secrm
  1776. \setfont\secsc\scbshape{10}{\magstep2}{OT1}
  1777. \font\seci=cmmi12 scaled \magstep1
  1778. \font\secsy=cmsy10 scaled \magstep2
  1779. \def\sececsize{1440}
  1780. % Subsection fonts (13.15pt).
  1781. \def\ssecnominalsize{13pt}
  1782. \setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1}
  1783. \setfont\ssecit\itbshape{10}{1315}{OT1IT}
  1784. \setfont\ssecsl\slbshape{10}{1315}{OT1}
  1785. \setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT}
  1786. \setfont\ssecttsl\ttslshape{10}{1315}{OT1TT}
  1787. \setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1}
  1788. \let\ssecbf\ssecrm
  1789. \setfont\ssecsc\scbshape{10}{1315}{OT1}
  1790. \font\sseci=cmmi12 scaled \magstephalf
  1791. \font\ssecsy=cmsy10 scaled 1315
  1792. \def\ssececsize{1200}
  1793. % Reduced fonts for @acro in text (10pt).
  1794. \def\reducednominalsize{10pt}
  1795. \setfont\reducedrm\rmshape{10}{1000}{OT1}
  1796. \setfont\reducedtt\ttshape{10}{1000}{OT1TT}
  1797. \setfont\reducedbf\bfshape{10}{1000}{OT1}
  1798. \setfont\reducedit\itshape{10}{1000}{OT1IT}
  1799. \setfont\reducedsl\slshape{10}{1000}{OT1}
  1800. \setfont\reducedsf\sfshape{10}{1000}{OT1}
  1801. \setfont\reducedsc\scshape{10}{1000}{OT1}
  1802. \setfont\reducedttsl\ttslshape{10}{1000}{OT1TT}
  1803. \font\reducedi=cmmi10
  1804. \font\reducedsy=cmsy10
  1805. \def\reducedecsize{1000}
  1806. \textleading = 13.2pt % line spacing for 11pt CM
  1807. \textfonts % reset the current fonts
  1808. \rm
  1809. } % end of 11pt text font size definitions, \definetextfontsizexi
  1810. % Definitions to make the main text be 10pt Computer Modern, with
  1811. % section, chapter, etc., sizes following suit. This is for the GNU
  1812. % Press printing of the Emacs 22 manual. Maybe other manuals in the
  1813. % future. Used with @smallbook, which sets the leading to 12pt.
  1814. %
  1815. \def\definetextfontsizex{%
  1816. % Text fonts (10pt).
  1817. \def\textnominalsize{10pt}
  1818. \edef\mainmagstep{1000}
  1819. \setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
  1820. \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
  1821. \setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
  1822. \setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
  1823. \setfont\textsl\slshape{10}{\mainmagstep}{OT1}
  1824. \setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
  1825. \setfont\textsc\scshape{10}{\mainmagstep}{OT1}
  1826. \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
  1827. \font\texti=cmmi10 scaled \mainmagstep
  1828. \font\textsy=cmsy10 scaled \mainmagstep
  1829. \def\textecsize{1000}
  1830. % A few fonts for @defun names and args.
  1831. \setfont\defbf\bfshape{10}{\magstephalf}{OT1}
  1832. \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
  1833. \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
  1834. \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
  1835. % Fonts for indices, footnotes, small examples (9pt).
  1836. \def\smallnominalsize{9pt}
  1837. \setfont\smallrm\rmshape{9}{1000}{OT1}
  1838. \setfont\smalltt\ttshape{9}{1000}{OT1TT}
  1839. \setfont\smallbf\bfshape{10}{900}{OT1}
  1840. \setfont\smallit\itshape{9}{1000}{OT1IT}
  1841. \setfont\smallsl\slshape{9}{1000}{OT1}
  1842. \setfont\smallsf\sfshape{9}{1000}{OT1}
  1843. \setfont\smallsc\scshape{10}{900}{OT1}
  1844. \setfont\smallttsl\ttslshape{10}{900}{OT1TT}
  1845. \font\smalli=cmmi9
  1846. \font\smallsy=cmsy9
  1847. \def\smallecsize{0900}
  1848. % Fonts for small examples (8pt).
  1849. \def\smallernominalsize{8pt}
  1850. \setfont\smallerrm\rmshape{8}{1000}{OT1}
  1851. \setfont\smallertt\ttshape{8}{1000}{OT1TT}
  1852. \setfont\smallerbf\bfshape{10}{800}{OT1}
  1853. \setfont\smallerit\itshape{8}{1000}{OT1IT}
  1854. \setfont\smallersl\slshape{8}{1000}{OT1}
  1855. \setfont\smallersf\sfshape{8}{1000}{OT1}
  1856. \setfont\smallersc\scshape{10}{800}{OT1}
  1857. \setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
  1858. \font\smalleri=cmmi8
  1859. \font\smallersy=cmsy8
  1860. \def\smallerecsize{0800}
  1861. % Fonts for title page (20.4pt):
  1862. \def\titlenominalsize{20pt}
  1863. \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
  1864. \setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
  1865. \setfont\titlesl\slbshape{10}{\magstep4}{OT1}
  1866. \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
  1867. \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
  1868. \setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
  1869. \let\titlebf=\titlerm
  1870. \setfont\titlesc\scbshape{10}{\magstep4}{OT1}
  1871. \font\titlei=cmmi12 scaled \magstep3
  1872. \font\titlesy=cmsy10 scaled \magstep4
  1873. \def\titleecsize{2074}
  1874. % Chapter fonts (14.4pt).
  1875. \def\chapnominalsize{14pt}
  1876. \setfont\chaprm\rmbshape{12}{\magstep1}{OT1}
  1877. \setfont\chapit\itbshape{10}{\magstep2}{OT1IT}
  1878. \setfont\chapsl\slbshape{10}{\magstep2}{OT1}
  1879. \setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT}
  1880. \setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT}
  1881. \setfont\chapsf\sfbshape{12}{\magstep1}{OT1}
  1882. \let\chapbf\chaprm
  1883. \setfont\chapsc\scbshape{10}{\magstep2}{OT1}
  1884. \font\chapi=cmmi12 scaled \magstep1
  1885. \font\chapsy=cmsy10 scaled \magstep2
  1886. \def\chapecsize{1440}
  1887. % Section fonts (12pt).
  1888. \def\secnominalsize{12pt}
  1889. \setfont\secrm\rmbshape{12}{1000}{OT1}
  1890. \setfont\secit\itbshape{10}{\magstep1}{OT1IT}
  1891. \setfont\secsl\slbshape{10}{\magstep1}{OT1}
  1892. \setfont\sectt\ttbshape{12}{1000}{OT1TT}
  1893. \setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT}
  1894. \setfont\secsf\sfbshape{12}{1000}{OT1}
  1895. \let\secbf\secrm
  1896. \setfont\secsc\scbshape{10}{\magstep1}{OT1}
  1897. \font\seci=cmmi12
  1898. \font\secsy=cmsy10 scaled \magstep1
  1899. \def\sececsize{1200}
  1900. % Subsection fonts (10pt).
  1901. \def\ssecnominalsize{10pt}
  1902. \setfont\ssecrm\rmbshape{10}{1000}{OT1}
  1903. \setfont\ssecit\itbshape{10}{1000}{OT1IT}
  1904. \setfont\ssecsl\slbshape{10}{1000}{OT1}
  1905. \setfont\ssectt\ttbshape{10}{1000}{OT1TT}
  1906. \setfont\ssecttsl\ttslshape{10}{1000}{OT1TT}
  1907. \setfont\ssecsf\sfbshape{10}{1000}{OT1}
  1908. \let\ssecbf\ssecrm
  1909. \setfont\ssecsc\scbshape{10}{1000}{OT1}
  1910. \font\sseci=cmmi10
  1911. \font\ssecsy=cmsy10
  1912. \def\ssececsize{1000}
  1913. % Reduced fonts for @acro in text (9pt).
  1914. \def\reducednominalsize{9pt}
  1915. \setfont\reducedrm\rmshape{9}{1000}{OT1}
  1916. \setfont\reducedtt\ttshape{9}{1000}{OT1TT}
  1917. \setfont\reducedbf\bfshape{10}{900}{OT1}
  1918. \setfont\reducedit\itshape{9}{1000}{OT1IT}
  1919. \setfont\reducedsl\slshape{9}{1000}{OT1}
  1920. \setfont\reducedsf\sfshape{9}{1000}{OT1}
  1921. \setfont\reducedsc\scshape{10}{900}{OT1}
  1922. \setfont\reducedttsl\ttslshape{10}{900}{OT1TT}
  1923. \font\reducedi=cmmi9
  1924. \font\reducedsy=cmsy9
  1925. \def\reducedecsize{0900}
  1926. \divide\parskip by 2 % reduce space between paragraphs
  1927. \textleading = 12pt % line spacing for 10pt CM
  1928. \textfonts % reset the current fonts
  1929. \rm
  1930. } % end of 10pt text font size definitions, \definetextfontsizex
  1931. % We provide the user-level command
  1932. % @fonttextsize 10
  1933. % (or 11) to redefine the text font size. pt is assumed.
  1934. %
  1935. \def\xiword{11}
  1936. \def\xword{10}
  1937. \def\xwordpt{10pt}
  1938. %
  1939. \parseargdef\fonttextsize{%
  1940. \def\textsizearg{#1}%
  1941. %\wlog{doing @fonttextsize \textsizearg}%
  1942. %
  1943. % Set \globaldefs so that documents can use this inside @tex, since
  1944. % makeinfo 4.8 does not support it, but we need it nonetheless.
  1945. %
  1946. \begingroup \globaldefs=1
  1947. \ifx\textsizearg\xword \definetextfontsizex
  1948. \else \ifx\textsizearg\xiword \definetextfontsizexi
  1949. \else
  1950. \errhelp=\EMsimple
  1951. \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
  1952. \fi\fi
  1953. \endgroup
  1954. }
  1955. % In order for the font changes to affect most math symbols and letters,
  1956. % we have to define the \textfont of the standard families. Since
  1957. % texinfo doesn't allow for producing subscripts and superscripts except
  1958. % in the main text, we don't bother to reset \scriptfont and
  1959. % \scriptscriptfont (which would also require loading a lot more fonts).
  1960. %
  1961. \def\resetmathfonts{%
  1962. \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy
  1963. \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf
  1964. \textfont\ttfam=\tentt \textfont\sffam=\tensf
  1965. }
  1966. % The font-changing commands redefine the meanings of \tenSTYLE, instead
  1967. % of just \STYLE. We do this because \STYLE needs to also set the
  1968. % current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire
  1969. % \tenSTYLE to set the current font.
  1970. %
  1971. % Each font-changing command also sets the names \lsize (one size lower)
  1972. % and \lllsize (three sizes lower). These relative commands are used in
  1973. % the LaTeX logo and acronyms.
  1974. %
  1975. % This all needs generalizing, badly.
  1976. %
  1977. \def\textfonts{%
  1978. \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
  1979. \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
  1980. \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
  1981. \let\tenttsl=\textttsl
  1982. \def\curfontsize{text}%
  1983. \def\lsize{reduced}\def\lllsize{smaller}%
  1984. \resetmathfonts \setleading{\textleading}}
  1985. \def\titlefonts{%
  1986. \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
  1987. \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
  1988. \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
  1989. \let\tenttsl=\titlettsl
  1990. \def\curfontsize{title}%
  1991. \def\lsize{chap}\def\lllsize{subsec}%
  1992. \resetmathfonts \setleading{27pt}}
  1993. \def\titlefont#1{{\titlefonts\rmisbold #1}}
  1994. \def\chapfonts{%
  1995. \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
  1996. \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
  1997. \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
  1998. \let\tenttsl=\chapttsl
  1999. \def\curfontsize{chap}%
  2000. \def\lsize{sec}\def\lllsize{text}%
  2001. \resetmathfonts \setleading{19pt}}
  2002. \def\secfonts{%
  2003. \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
  2004. \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
  2005. \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
  2006. \let\tenttsl=\secttsl
  2007. \def\curfontsize{sec}%
  2008. \def\lsize{subsec}\def\lllsize{reduced}%
  2009. \resetmathfonts \setleading{16pt}}
  2010. \def\subsecfonts{%
  2011. \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
  2012. \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
  2013. \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
  2014. \let\tenttsl=\ssecttsl
  2015. \def\curfontsize{ssec}%
  2016. \def\lsize{text}\def\lllsize{small}%
  2017. \resetmathfonts \setleading{15pt}}
  2018. \let\subsubsecfonts = \subsecfonts
  2019. \def\reducedfonts{%
  2020. \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl
  2021. \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc
  2022. \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy
  2023. \let\tenttsl=\reducedttsl
  2024. \def\curfontsize{reduced}%
  2025. \def\lsize{small}\def\lllsize{smaller}%
  2026. \resetmathfonts \setleading{10.5pt}}
  2027. \def\smallfonts{%
  2028. \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
  2029. \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
  2030. \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
  2031. \let\tenttsl=\smallttsl
  2032. \def\curfontsize{small}%
  2033. \def\lsize{smaller}\def\lllsize{smaller}%
  2034. \resetmathfonts \setleading{10.5pt}}
  2035. \def\smallerfonts{%
  2036. \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
  2037. \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
  2038. \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
  2039. \let\tenttsl=\smallerttsl
  2040. \def\curfontsize{smaller}%
  2041. \def\lsize{smaller}\def\lllsize{smaller}%
  2042. \resetmathfonts \setleading{9.5pt}}
  2043. % Fonts for short table of contents.
  2044. \setfont\shortcontrm\rmshape{12}{1000}{OT1}
  2045. \setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12
  2046. \setfont\shortcontsl\slshape{12}{1000}{OT1}
  2047. \setfont\shortconttt\ttshape{12}{1000}{OT1TT}
  2048. % Define these just so they can be easily changed for other fonts.
  2049. \def\angleleft{$\langle$}
  2050. \def\angleright{$\rangle$}
  2051. % Set the fonts to use with the @small... environments.
  2052. \let\smallexamplefonts = \smallfonts
  2053. % About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample
  2054. % can fit this many characters:
  2055. % 8.5x11=86 smallbook=72 a4=90 a5=69
  2056. % If we use \scriptfonts (8pt), then we can fit this many characters:
  2057. % 8.5x11=90+ smallbook=80 a4=90+ a5=77
  2058. % For me, subjectively, the few extra characters that fit aren't worth
  2059. % the additional smallness of 8pt. So I'm making the default 9pt.
  2060. %
  2061. % By the way, for comparison, here's what fits with @example (10pt):
  2062. % 8.5x11=71 smallbook=60 a4=75 a5=58
  2063. % --karl, 24jan03.
  2064. % Set up the default fonts, so we can use them for creating boxes.
  2065. %
  2066. \definetextfontsizexi
  2067. \message{markup,}
  2068. % Check if we are currently using a typewriter font. Since all the
  2069. % Computer Modern typewriter fonts have zero interword stretch (and
  2070. % shrink), and it is reasonable to expect all typewriter fonts to have
  2071. % this property, we can check that font parameter.
  2072. %
  2073. \def\ifmonospace{\ifdim\fontdimen3\font=0pt }
  2074. % Markup style infrastructure. \defmarkupstylesetup\INITMACRO will
  2075. % define and register \INITMACRO to be called on markup style changes.
  2076. % \INITMACRO can check \currentmarkupstyle for the innermost
  2077. % style and the set of \ifmarkupSTYLE switches for all styles
  2078. % currently in effect.
  2079. \newif\ifmarkupvar
  2080. \newif\ifmarkupsamp
  2081. \newif\ifmarkupkey
  2082. %\newif\ifmarkupfile % @file == @samp.
  2083. %\newif\ifmarkupoption % @option == @samp.
  2084. \newif\ifmarkupcode
  2085. \newif\ifmarkupkbd
  2086. %\newif\ifmarkupenv % @env == @code.
  2087. %\newif\ifmarkupcommand % @command == @code.
  2088. \newif\ifmarkuptex % @tex (and part of @math, for now).
  2089. \newif\ifmarkupexample
  2090. \newif\ifmarkupverb
  2091. \newif\ifmarkupverbatim
  2092. \let\currentmarkupstyle\empty
  2093. \def\setupmarkupstyle#1{%
  2094. \csname markup#1true\endcsname
  2095. \def\currentmarkupstyle{#1}%
  2096. \markupstylesetup
  2097. }
  2098. \let\markupstylesetup\empty
  2099. \def\defmarkupstylesetup#1{%
  2100. \expandafter\def\expandafter\markupstylesetup
  2101. \expandafter{\markupstylesetup #1}%
  2102. \def#1%
  2103. }
  2104. % Markup style setup for left and right quotes.
  2105. \defmarkupstylesetup\markupsetuplq{%
  2106. \expandafter\let\expandafter \temp
  2107. \csname markupsetuplq\currentmarkupstyle\endcsname
  2108. \ifx\temp\relax \markupsetuplqdefault \else \temp \fi
  2109. }
  2110. \defmarkupstylesetup\markupsetuprq{%
  2111. \expandafter\let\expandafter \temp
  2112. \csname markupsetuprq\currentmarkupstyle\endcsname
  2113. \ifx\temp\relax \markupsetuprqdefault \else \temp \fi
  2114. }
  2115. {
  2116. \catcode`\'=\active
  2117. \catcode`\`=\active
  2118. \gdef\markupsetuplqdefault{\let`\lq}
  2119. \gdef\markupsetuprqdefault{\let'\rq}
  2120. \gdef\markupsetcodequoteleft{\let`\codequoteleft}
  2121. \gdef\markupsetcodequoteright{\let'\codequoteright}
  2122. }
  2123. \let\markupsetuplqcode \markupsetcodequoteleft
  2124. \let\markupsetuprqcode \markupsetcodequoteright
  2125. %
  2126. \let\markupsetuplqexample \markupsetcodequoteleft
  2127. \let\markupsetuprqexample \markupsetcodequoteright
  2128. %
  2129. \let\markupsetuplqkbd \markupsetcodequoteleft
  2130. \let\markupsetuprqkbd \markupsetcodequoteright
  2131. %
  2132. \let\markupsetuplqsamp \markupsetcodequoteleft
  2133. \let\markupsetuprqsamp \markupsetcodequoteright
  2134. %
  2135. \let\markupsetuplqverb \markupsetcodequoteleft
  2136. \let\markupsetuprqverb \markupsetcodequoteright
  2137. %
  2138. \let\markupsetuplqverbatim \markupsetcodequoteleft
  2139. \let\markupsetuprqverbatim \markupsetcodequoteright
  2140. % Allow an option to not use regular directed right quote/apostrophe
  2141. % (char 0x27), but instead the undirected quote from cmtt (char 0x0d).
  2142. % The undirected quote is ugly, so don't make it the default, but it
  2143. % works for pasting with more pdf viewers (at least evince), the
  2144. % lilypond developers report. xpdf does work with the regular 0x27.
  2145. %
  2146. \def\codequoteright{%
  2147. \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
  2148. \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
  2149. '%
  2150. \else \char'15 \fi
  2151. \else \char'15 \fi
  2152. }
  2153. %
  2154. % and a similar option for the left quote char vs. a grave accent.
  2155. % Modern fonts display ASCII 0x60 as a grave accent, so some people like
  2156. % the code environments to do likewise.
  2157. %
  2158. \def\codequoteleft{%
  2159. \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
  2160. \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
  2161. % [Knuth] pp. 380,381,391
  2162. % \relax disables Spanish ligatures ?` and !` of \tt font.
  2163. \relax`%
  2164. \else \char'22 \fi
  2165. \else \char'22 \fi
  2166. }
  2167. % Commands to set the quote options.
  2168. %
  2169. \parseargdef\codequoteundirected{%
  2170. \def\temp{#1}%
  2171. \ifx\temp\onword
  2172. \expandafter\let\csname SETtxicodequoteundirected\endcsname
  2173. = t%
  2174. \else\ifx\temp\offword
  2175. \expandafter\let\csname SETtxicodequoteundirected\endcsname
  2176. = \relax
  2177. \else
  2178. \errhelp = \EMsimple
  2179. \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}%
  2180. \fi\fi
  2181. }
  2182. %
  2183. \parseargdef\codequotebacktick{%
  2184. \def\temp{#1}%
  2185. \ifx\temp\onword
  2186. \expandafter\let\csname SETtxicodequotebacktick\endcsname
  2187. = t%
  2188. \else\ifx\temp\offword
  2189. \expandafter\let\csname SETtxicodequotebacktick\endcsname
  2190. = \relax
  2191. \else
  2192. \errhelp = \EMsimple
  2193. \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}%
  2194. \fi\fi
  2195. }
  2196. % [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
  2197. \def\noligaturesquoteleft{\relax\lq}
  2198. % Count depth in font-changes, for error checks
  2199. \newcount\fontdepth \fontdepth=0
  2200. % Font commands.
  2201. % #1 is the font command (\sl or \it), #2 is the text to slant.
  2202. % If we are in a monospaced environment, however, 1) always use \ttsl,
  2203. % and 2) do not add an italic correction.
  2204. \def\dosmartslant#1#2{%
  2205. \ifusingtt
  2206. {{\ttsl #2}\let\next=\relax}%
  2207. {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}%
  2208. \next
  2209. }
  2210. \def\smartslanted{\dosmartslant\sl}
  2211. \def\smartitalic{\dosmartslant\it}
  2212. % Output an italic correction unless \next (presumed to be the following
  2213. % character) is such as not to need one.
  2214. \def\smartitaliccorrection{%
  2215. \ifx\next,%
  2216. \else\ifx\next-%
  2217. \else\ifx\next.%
  2218. \else\ptexslash
  2219. \fi\fi\fi
  2220. \aftersmartic
  2221. }
  2222. % Unconditional use \ttsl, and no ic. @var is set to this for defuns.
  2223. \def\ttslanted#1{{\ttsl #1}}
  2224. % @cite is like \smartslanted except unconditionally use \sl. We never want
  2225. % ttsl for book titles, do we?
  2226. \def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection}
  2227. \def\aftersmartic{}
  2228. \def\var#1{%
  2229. \let\saveaftersmartic = \aftersmartic
  2230. \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}%
  2231. \smartslanted{#1}%
  2232. }
  2233. \let\i=\smartitalic
  2234. \let\slanted=\smartslanted
  2235. \let\dfn=\smartslanted
  2236. \let\emph=\smartitalic
  2237. % Explicit font changes: @r, @sc, undocumented @ii.
  2238. \def\r#1{{\rm #1}} % roman font
  2239. \def\sc#1{{\smallcaps#1}} % smallcaps font
  2240. \def\ii#1{{\it #1}} % italic font
  2241. % @b, explicit bold. Also @strong.
  2242. \def\b#1{{\bf #1}}
  2243. \let\strong=\b
  2244. % @sansserif, explicit sans.
  2245. \def\sansserif#1{{\sf #1}}
  2246. % We can't just use \exhyphenpenalty, because that only has effect at
  2247. % the end of a paragraph. Restore normal hyphenation at the end of the
  2248. % group within which \nohyphenation is presumably called.
  2249. %
  2250. \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
  2251. \def\restorehyphenation{\hyphenchar\font = `- }
  2252. % Set sfcode to normal for the chars that usually have another value.
  2253. % Can't use plain's \frenchspacing because it uses the `\x notation, and
  2254. % sometimes \x has an active definition that messes things up.
  2255. %
  2256. \catcode`@=11
  2257. \def\plainfrenchspacing{%
  2258. \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m
  2259. \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m
  2260. \def\endofsentencespacefactor{1000}% for @. and friends
  2261. }
  2262. \def\plainnonfrenchspacing{%
  2263. \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000
  2264. \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250
  2265. \def\endofsentencespacefactor{3000}% for @. and friends
  2266. }
  2267. \catcode`@=\other
  2268. \def\endofsentencespacefactor{3000}% default
  2269. % @t, explicit typewriter.
  2270. \def\t#1{%
  2271. {\tt \rawbackslash \plainfrenchspacing #1}%
  2272. \null
  2273. }
  2274. % @samp.
  2275. \def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}}
  2276. % @indicateurl is \samp, that is, with quotes.
  2277. \let\indicateurl=\samp
  2278. % @code (and similar) prints in typewriter, but with spaces the same
  2279. % size as normal in the surrounding text, without hyphenation, etc.
  2280. % This is a subroutine for that.
  2281. \def\tclose#1{%
  2282. {%
  2283. % Change normal interword space to be same as for the current font.
  2284. \spaceskip = \fontdimen2\font
  2285. %
  2286. % Switch to typewriter.
  2287. \tt
  2288. %
  2289. % But `\ ' produces the large typewriter interword space.
  2290. \def\ {{\spaceskip = 0pt{} }}%
  2291. %
  2292. % Turn off hyphenation.
  2293. \nohyphenation
  2294. %
  2295. \rawbackslash
  2296. \plainfrenchspacing
  2297. #1%
  2298. }%
  2299. \null % reset spacefactor to 1000
  2300. }
  2301. % We *must* turn on hyphenation at `-' and `_' in @code.
  2302. % Otherwise, it is too hard to avoid overfull hboxes
  2303. % in the Emacs manual, the Library manual, etc.
  2304. %
  2305. % Unfortunately, TeX uses one parameter (\hyphenchar) to control
  2306. % both hyphenation at - and hyphenation within words.
  2307. % We must therefore turn them both off (\tclose does that)
  2308. % and arrange explicitly to hyphenate at a dash.
  2309. % -- rms.
  2310. {
  2311. \catcode`\-=\active \catcode`\_=\active
  2312. \catcode`\'=\active \catcode`\`=\active
  2313. \global\let'=\rq \global\let`=\lq % default definitions
  2314. %
  2315. \global\def\code{\begingroup
  2316. \setupmarkupstyle{code}%
  2317. % The following should really be moved into \setupmarkupstyle handlers.
  2318. \catcode\dashChar=\active \catcode\underChar=\active
  2319. \ifallowcodebreaks
  2320. \let-\codedash
  2321. \let_\codeunder
  2322. \else
  2323. \let-\normaldash
  2324. \let_\realunder
  2325. \fi
  2326. \codex
  2327. }
  2328. }
  2329. \def\codex #1{\tclose{#1}\endgroup}
  2330. \def\normaldash{-}
  2331. \def\codedash{-\discretionary{}{}{}}
  2332. \def\codeunder{%
  2333. % this is all so @math{@code{var_name}+1} can work. In math mode, _
  2334. % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
  2335. % will therefore expand the active definition of _, which is us
  2336. % (inside @code that is), therefore an endless loop.
  2337. \ifusingtt{\ifmmode
  2338. \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
  2339. \else\normalunderscore \fi
  2340. \discretionary{}{}{}}%
  2341. {\_}%
  2342. }
  2343. % An additional complication: the above will allow breaks after, e.g.,
  2344. % each of the four underscores in __typeof__. This is bad.
  2345. % @allowcodebreaks provides a document-level way to turn breaking at -
  2346. % and _ on and off.
  2347. %
  2348. \newif\ifallowcodebreaks \allowcodebreakstrue
  2349. \def\keywordtrue{true}
  2350. \def\keywordfalse{false}
  2351. \parseargdef\allowcodebreaks{%
  2352. \def\txiarg{#1}%
  2353. \ifx\txiarg\keywordtrue
  2354. \allowcodebreakstrue
  2355. \else\ifx\txiarg\keywordfalse
  2356. \allowcodebreaksfalse
  2357. \else
  2358. \errhelp = \EMsimple
  2359. \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}%
  2360. \fi\fi
  2361. }
  2362. % For @command, @env, @file, @option quotes seem unnecessary,
  2363. % so use \code rather than \samp.
  2364. \let\command=\code
  2365. \let\env=\code
  2366. \let\file=\code
  2367. \let\option=\code
  2368. % @uref (abbreviation for `urlref') takes an optional (comma-separated)
  2369. % second argument specifying the text to display and an optional third
  2370. % arg as text to display instead of (rather than in addition to) the url
  2371. % itself. First (mandatory) arg is the url.
  2372. % (This \urefnobreak definition isn't used now, leaving it for a while
  2373. % for comparison.)
  2374. \def\urefnobreak#1{\dourefnobreak #1,,,\finish}
  2375. \def\dourefnobreak#1,#2,#3,#4\finish{\begingroup
  2376. \unsepspaces
  2377. \pdfurl{#1}%
  2378. \setbox0 = \hbox{\ignorespaces #3}%
  2379. \ifdim\wd0 > 0pt
  2380. \unhbox0 % third arg given, show only that
  2381. \else
  2382. \setbox0 = \hbox{\ignorespaces #2}%
  2383. \ifdim\wd0 > 0pt
  2384. \ifpdf
  2385. \unhbox0 % PDF: 2nd arg given, show only it
  2386. \else
  2387. \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
  2388. \fi
  2389. \else
  2390. \code{#1}% only url given, so show it
  2391. \fi
  2392. \fi
  2393. \endlink
  2394. \endgroup}
  2395. % This \urefbreak definition is the active one.
  2396. \def\urefbreak{\begingroup \urefcatcodes \dourefbreak}
  2397. \let\uref=\urefbreak
  2398. \def\dourefbreak#1{\urefbreakfinish #1,,,\finish}
  2399. \def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example
  2400. \unsepspaces
  2401. \pdfurl{#1}%
  2402. \setbox0 = \hbox{\ignorespaces #3}%
  2403. \ifdim\wd0 > 0pt
  2404. \unhbox0 % third arg given, show only that
  2405. \else
  2406. \setbox0 = \hbox{\ignorespaces #2}%
  2407. \ifdim\wd0 > 0pt
  2408. \ifpdf
  2409. \unhbox0 % PDF: 2nd arg given, show only it
  2410. \else
  2411. \unhbox0\ (\urefcode{#1})% DVI: 2nd arg given, show both it and url
  2412. \fi
  2413. \else
  2414. \urefcode{#1}% only url given, so show it
  2415. \fi
  2416. \fi
  2417. \endlink
  2418. \endgroup}
  2419. % Allow line breaks around only a few characters (only).
  2420. \def\urefcatcodes{%
  2421. \catcode\ampChar=\active \catcode\dotChar=\active
  2422. \catcode\hashChar=\active \catcode\questChar=\active
  2423. \catcode\slashChar=\active
  2424. }
  2425. {
  2426. \urefcatcodes
  2427. %
  2428. \global\def\urefcode{\begingroup
  2429. \setupmarkupstyle{code}%
  2430. \urefcatcodes
  2431. \let&\urefcodeamp
  2432. \let.\urefcodedot
  2433. \let#\urefcodehash
  2434. \let?\urefcodequest
  2435. \let/\urefcodeslash
  2436. \codex
  2437. }
  2438. %
  2439. % By default, they are just regular characters.
  2440. \global\def&{\normalamp}
  2441. \global\def.{\normaldot}
  2442. \global\def#{\normalhash}
  2443. \global\def?{\normalquest}
  2444. \global\def/{\normalslash}
  2445. }
  2446. % we put a little stretch before and after the breakable chars, to help
  2447. % line breaking of long url's. The unequal skips make look better in
  2448. % cmtt at least, especially for dots.
  2449. \def\urefprestretch{\urefprebreak \hskip0pt plus.13em }
  2450. \def\urefpoststretch{\urefpostbreak \hskip0pt plus.1em }
  2451. %
  2452. \def\urefcodeamp{\urefprestretch \&\urefpoststretch}
  2453. \def\urefcodedot{\urefprestretch .\urefpoststretch}
  2454. \def\urefcodehash{\urefprestretch \#\urefpoststretch}
  2455. \def\urefcodequest{\urefprestretch ?\urefpoststretch}
  2456. \def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
  2457. {
  2458. \catcode`\/=\active
  2459. \global\def\urefcodeslashfinish{%
  2460. \urefprestretch \slashChar
  2461. % Allow line break only after the final / in a sequence of
  2462. % slashes, to avoid line break between the slashes in http://.
  2463. \ifx\next/\else \urefpoststretch \fi
  2464. }
  2465. }
  2466. % One more complication: by default we'll break after the special
  2467. % characters, but some people like to break before the special chars, so
  2468. % allow that. Also allow no breaking at all, for manual control.
  2469. %
  2470. \parseargdef\urefbreakstyle{%
  2471. \def\txiarg{#1}%
  2472. \ifx\txiarg\wordnone
  2473. \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
  2474. \else\ifx\txiarg\wordbefore
  2475. \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak}
  2476. \else\ifx\txiarg\wordafter
  2477. \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak}
  2478. \else
  2479. \errhelp = \EMsimple
  2480. \errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
  2481. \fi\fi\fi
  2482. }
  2483. \def\wordafter{after}
  2484. \def\wordbefore{before}
  2485. \def\wordnone{none}
  2486. \urefbreakstyle after
  2487. % @url synonym for @uref, since that's how everyone uses it.
  2488. %
  2489. \let\url=\uref
  2490. % rms does not like angle brackets --karl, 17may97.
  2491. % So now @email is just like @uref, unless we are pdf.
  2492. %
  2493. %\def\email#1{\angleleft{\tt #1}\angleright}
  2494. \ifpdf
  2495. \def\email#1{\doemail#1,,\finish}
  2496. \def\doemail#1,#2,#3\finish{\begingroup
  2497. \unsepspaces
  2498. \pdfurl{mailto:#1}%
  2499. \setbox0 = \hbox{\ignorespaces #2}%
  2500. \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
  2501. \endlink
  2502. \endgroup}
  2503. \else
  2504. \let\email=\uref
  2505. \fi
  2506. % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
  2507. % `example' (@kbd uses ttsl only inside of @example and friends),
  2508. % or `code' (@kbd uses normal tty font always).
  2509. \parseargdef\kbdinputstyle{%
  2510. \def\txiarg{#1}%
  2511. \ifx\txiarg\worddistinct
  2512. \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
  2513. \else\ifx\txiarg\wordexample
  2514. \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
  2515. \else\ifx\txiarg\wordcode
  2516. \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
  2517. \else
  2518. \errhelp = \EMsimple
  2519. \errmessage{Unknown @kbdinputstyle setting `\txiarg'}%
  2520. \fi\fi\fi
  2521. }
  2522. \def\worddistinct{distinct}
  2523. \def\wordexample{example}
  2524. \def\wordcode{code}
  2525. % Default is `distinct'.
  2526. \kbdinputstyle distinct
  2527. % @kbd is like @code, except that if the argument is just one @key command,
  2528. % then @kbd has no effect.
  2529. \def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}}
  2530. \def\xkey{\key}
  2531. \def\kbdsub#1#2#3\par{%
  2532. \def\one{#1}\def\three{#3}\def\threex{??}%
  2533. \ifx\one\xkey\ifx\threex\three \key{#2}%
  2534. \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
  2535. \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
  2536. }
  2537. % definition of @key that produces a lozenge. Doesn't adjust to text size.
  2538. %\setfont\keyrm\rmshape{8}{1000}{OT1}
  2539. %\font\keysy=cmsy9
  2540. %\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
  2541. % \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
  2542. % \vbox{\hrule\kern-0.4pt
  2543. % \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
  2544. % \kern-0.4pt\hrule}%
  2545. % \kern-.06em\raise0.4pt\hbox{\angleright}}}}
  2546. % definition of @key with no lozenge. If the current font is already
  2547. % monospace, don't change it; that way, we respect @kbdinputstyle. But
  2548. % if it isn't monospace, then use \tt.
  2549. %
  2550. \def\key#1{{\setupmarkupstyle{key}%
  2551. \nohyphenation
  2552. \ifmonospace\else\tt\fi
  2553. #1}\null}
  2554. % @clicksequence{File @click{} Open ...}
  2555. \def\clicksequence#1{\begingroup #1\endgroup}
  2556. % @clickstyle @arrow (by default)
  2557. \parseargdef\clickstyle{\def\click{#1}}
  2558. \def\click{\arrow}
  2559. % Typeset a dimension, e.g., `in' or `pt'. The only reason for the
  2560. % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
  2561. %
  2562. \def\dmn#1{\thinspace #1}
  2563. % @l was never documented to mean ``switch to the Lisp font'',
  2564. % and it is not used as such in any manual I can find. We need it for
  2565. % Polish suppressed-l. --karl, 22sep96.
  2566. %\def\l#1{{\li #1}\null}
  2567. % @acronym for "FBI", "NATO", and the like.
  2568. % We print this one point size smaller, since it's intended for
  2569. % all-uppercase.
  2570. %
  2571. \def\acronym#1{\doacronym #1,,\finish}
  2572. \def\doacronym#1,#2,#3\finish{%
  2573. {\selectfonts\lsize #1}%
  2574. \def\temp{#2}%
  2575. \ifx\temp\empty \else
  2576. \space ({\unsepspaces \ignorespaces \temp \unskip})%
  2577. \fi
  2578. \null % reset \spacefactor=1000
  2579. }
  2580. % @abbr for "Comput. J." and the like.
  2581. % No font change, but don't do end-of-sentence spacing.
  2582. %
  2583. \def\abbr#1{\doabbr #1,,\finish}
  2584. \def\doabbr#1,#2,#3\finish{%
  2585. {\plainfrenchspacing #1}%
  2586. \def\temp{#2}%
  2587. \ifx\temp\empty \else
  2588. \space ({\unsepspaces \ignorespaces \temp \unskip})%
  2589. \fi
  2590. \null % reset \spacefactor=1000
  2591. }
  2592. % @asis just yields its argument. Used with @table, for example.
  2593. %
  2594. \def\asis#1{#1}
  2595. % @math outputs its argument in math mode.
  2596. %
  2597. % One complication: _ usually means subscripts, but it could also mean
  2598. % an actual _ character, as in @math{@var{some_variable} + 1}. So make
  2599. % _ active, and distinguish by seeing if the current family is \slfam,
  2600. % which is what @var uses.
  2601. {
  2602. \catcode`\_ = \active
  2603. \gdef\mathunderscore{%
  2604. \catcode`\_=\active
  2605. \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
  2606. }
  2607. }
  2608. % Another complication: we want \\ (and @\) to output a math (or tt) \.
  2609. % FYI, plain.tex uses \\ as a temporary control sequence (for no
  2610. % particular reason), but this is not advertised and we don't care.
  2611. %
  2612. % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
  2613. \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
  2614. %
  2615. \def\math{%
  2616. \tex
  2617. \mathunderscore
  2618. \let\\ = \mathbackslash
  2619. \mathactive
  2620. % make the texinfo accent commands work in math mode
  2621. \let\"=\ddot
  2622. \let\'=\acute
  2623. \let\==\bar
  2624. \let\^=\hat
  2625. \let\`=\grave
  2626. \let\u=\breve
  2627. \let\v=\check
  2628. \let\~=\tilde
  2629. \let\dotaccent=\dot
  2630. $\finishmath
  2631. }
  2632. \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
  2633. % Some active characters (such as <) are spaced differently in math.
  2634. % We have to reset their definitions in case the @math was an argument
  2635. % to a command which sets the catcodes (such as @item or @section).
  2636. %
  2637. {
  2638. \catcode`^ = \active
  2639. \catcode`< = \active
  2640. \catcode`> = \active
  2641. \catcode`+ = \active
  2642. \catcode`' = \active
  2643. \gdef\mathactive{%
  2644. \let^ = \ptexhat
  2645. \let< = \ptexless
  2646. \let> = \ptexgtr
  2647. \let+ = \ptexplus
  2648. \let' = \ptexquoteright
  2649. }
  2650. }
  2651. % ctrl is no longer a Texinfo command, but leave this definition for fun.
  2652. \def\ctrl #1{{\tt \rawbackslash \hat}#1}
  2653. % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
  2654. % Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
  2655. % except specified as a normal braced arg, so no newlines to worry about.
  2656. %
  2657. \def\outfmtnametex{tex}
  2658. %
  2659. \long\def\inlinefmt#1{\doinlinefmt #1,\finish}
  2660. \long\def\doinlinefmt#1,#2,\finish{%
  2661. \def\inlinefmtname{#1}%
  2662. \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
  2663. }
  2664. % For raw, must switch into @tex before parsing the argument, to avoid
  2665. % setting catcodes prematurely. Doing it this way means that, for
  2666. % example, @inlineraw{html, foo{bar} gets a parse error instead of being
  2667. % ignored. But this isn't important because if people want a literal
  2668. % *right* brace they would have to use a command anyway, so they may as
  2669. % well use a command to get a left brace too. We could re-use the
  2670. % delimiter character idea from \verb, but it seems like overkill.
  2671. %
  2672. \long\def\inlineraw{\tex \doinlineraw}
  2673. \long\def\doinlineraw#1{\doinlinerawtwo #1,\finish}
  2674. \def\doinlinerawtwo#1,#2,\finish{%
  2675. \def\inlinerawname{#1}%
  2676. \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi
  2677. \endgroup % close group opened by \tex.
  2678. }
  2679. \message{glyphs,}
  2680. % and logos.
  2681. % @@ prints an @, as does @atchar{}.
  2682. \def\@{\char64 }
  2683. \let\atchar=\@
  2684. % @{ @} @lbracechar{} @rbracechar{} all generate brace characters.
  2685. % Unless we're in typewriter, use \ecfont because the CM text fonts do
  2686. % not have braces, and we don't want to switch into math.
  2687. \def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}}
  2688. \def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}}
  2689. \let\{=\mylbrace \let\lbracechar=\{
  2690. \let\}=\myrbrace \let\rbracechar=\}
  2691. \begingroup
  2692. % Definitions to produce \{ and \} commands for indices,
  2693. % and @{ and @} for the aux/toc files.
  2694. \catcode`\{ = \other \catcode`\} = \other
  2695. \catcode`\[ = 1 \catcode`\] = 2
  2696. \catcode`\! = 0 \catcode`\\ = \other
  2697. !gdef!lbracecmd[\{]%
  2698. !gdef!rbracecmd[\}]%
  2699. !gdef!lbraceatcmd[@{]%
  2700. !gdef!rbraceatcmd[@}]%
  2701. !endgroup
  2702. % @comma{} to avoid , parsing problems.
  2703. \let\comma = ,
  2704. % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
  2705. % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
  2706. \let\, = \ptexc
  2707. \let\dotaccent = \ptexdot
  2708. \def\ringaccent#1{{\accent23 #1}}
  2709. \let\tieaccent = \ptext
  2710. \let\ubaraccent = \ptexb
  2711. \let\udotaccent = \d
  2712. % Other special characters: @questiondown @exclamdown @ordf @ordm
  2713. % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
  2714. \def\questiondown{?`}
  2715. \def\exclamdown{!`}
  2716. \def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
  2717. \def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
  2718. % Dotless i and dotless j, used for accents.
  2719. \def\imacro{i}
  2720. \def\jmacro{j}
  2721. \def\dotless#1{%
  2722. \def\temp{#1}%
  2723. \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
  2724. \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
  2725. \else \errmessage{@dotless can be used only with i or j}%
  2726. \fi\fi
  2727. }
  2728. % The \TeX{} logo, as in plain, but resetting the spacing so that a
  2729. % period following counts as ending a sentence. (Idea found in latex.)
  2730. %
  2731. \edef\TeX{\TeX \spacefactor=1000 }
  2732. % @LaTeX{} logo. Not quite the same results as the definition in
  2733. % latex.ltx, since we use a different font for the raised A; it's most
  2734. % convenient for us to use an explicitly smaller font, rather than using
  2735. % the \scriptstyle font (since we don't reset \scriptstyle and
  2736. % \scriptscriptstyle).
  2737. %
  2738. \def\LaTeX{%
  2739. L\kern-.36em
  2740. {\setbox0=\hbox{T}%
  2741. \vbox to \ht0{\hbox{%
  2742. \ifx\textnominalsize\xwordpt
  2743. % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX.
  2744. % Revert to plain's \scriptsize, which is 7pt.
  2745. \count255=\the\fam $\fam\count255 \scriptstyle A$%
  2746. \else
  2747. % For 11pt, we can use our lllsize.
  2748. \selectfonts\lllsize A%
  2749. \fi
  2750. }%
  2751. \vss
  2752. }}%
  2753. \kern-.15em
  2754. \TeX
  2755. }
  2756. % Some math mode symbols.
  2757. \def\bullet{$\ptexbullet$}
  2758. \def\geq{\ifmmode \ge\else $\ge$\fi}
  2759. \def\leq{\ifmmode \le\else $\le$\fi}
  2760. \def\minus{\ifmmode -\else $-$\fi}
  2761. % @dots{} outputs an ellipsis using the current font.
  2762. % We do .5em per period so that it has the same spacing in the cm
  2763. % typewriter fonts as three actual period characters; on the other hand,
  2764. % in other typewriter fonts three periods are wider than 1.5em. So do
  2765. % whichever is larger.
  2766. %
  2767. \def\dots{%
  2768. \leavevmode
  2769. \setbox0=\hbox{...}% get width of three periods
  2770. \ifdim\wd0 > 1.5em
  2771. \dimen0 = \wd0
  2772. \else
  2773. \dimen0 = 1.5em
  2774. \fi
  2775. \hbox to \dimen0{%
  2776. \hskip 0pt plus.25fil
  2777. .\hskip 0pt plus1fil
  2778. .\hskip 0pt plus1fil
  2779. .\hskip 0pt plus.5fil
  2780. }%
  2781. }
  2782. % @enddots{} is an end-of-sentence ellipsis.
  2783. %
  2784. \def\enddots{%
  2785. \dots
  2786. \spacefactor=\endofsentencespacefactor
  2787. }
  2788. % @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
  2789. %
  2790. % Since these characters are used in examples, they should be an even number of
  2791. % \tt widths. Each \tt character is 1en, so two makes it 1em.
  2792. %
  2793. \def\point{$\star$}
  2794. \def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}}
  2795. \def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
  2796. \def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}}
  2797. \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
  2798. \def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}}
  2799. % The @error{} command.
  2800. % Adapted from the TeXbook's \boxit.
  2801. %
  2802. \newbox\errorbox
  2803. %
  2804. {\tentt \global\dimen0 = 3em}% Width of the box.
  2805. \dimen2 = .55pt % Thickness of rules
  2806. % The text. (`r' is open on the right, `e' somewhat less so on the left.)
  2807. \setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt}
  2808. %
  2809. \setbox\errorbox=\hbox to \dimen0{\hfil
  2810. \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
  2811. \advance\hsize by -2\dimen2 % Rules.
  2812. \vbox{%
  2813. \hrule height\dimen2
  2814. \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
  2815. \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
  2816. \kern3pt\vrule width\dimen2}% Space to right.
  2817. \hrule height\dimen2}
  2818. \hfil}
  2819. %
  2820. \def\error{\leavevmode\lower.7ex\copy\errorbox}
  2821. % @pounds{} is a sterling sign, which Knuth put in the CM italic font.
  2822. %
  2823. \def\pounds{{\it\$}}
  2824. % @euro{} comes from a separate font, depending on the current style.
  2825. % We use the free feym* fonts from the eurosym package by Henrik
  2826. % Theiling, which support regular, slanted, bold and bold slanted (and
  2827. % "outlined" (blackboard board, sort of) versions, which we don't need).
  2828. % It is available from http://www.ctan.org/tex-archive/fonts/eurosym.
  2829. %
  2830. % Although only regular is the truly official Euro symbol, we ignore
  2831. % that. The Euro is designed to be slightly taller than the regular
  2832. % font height.
  2833. %
  2834. % feymr - regular
  2835. % feymo - slanted
  2836. % feybr - bold
  2837. % feybo - bold slanted
  2838. %
  2839. % There is no good (free) typewriter version, to my knowledge.
  2840. % A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
  2841. % Hmm.
  2842. %
  2843. % Also doesn't work in math. Do we need to do math with euro symbols?
  2844. % Hope not.
  2845. %
  2846. %
  2847. \def\euro{{\eurofont e}}
  2848. \def\eurofont{%
  2849. % We set the font at each command, rather than predefining it in
  2850. % \textfonts and the other font-switching commands, so that
  2851. % installations which never need the symbol don't have to have the
  2852. % font installed.
  2853. %
  2854. % There is only one designed size (nominal 10pt), so we always scale
  2855. % that to the current nominal size.
  2856. %
  2857. % By the way, simply using "at 1em" works for cmr10 and the like, but
  2858. % does not work for cmbx10 and other extended/shrunken fonts.
  2859. %
  2860. \def\eurosize{\csname\curfontsize nominalsize\endcsname}%
  2861. %
  2862. \ifx\curfontstyle\bfstylename
  2863. % bold:
  2864. \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
  2865. \else
  2866. % regular:
  2867. \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
  2868. \fi
  2869. \thiseurofont
  2870. }
  2871. % Glyphs from the EC fonts. We don't use \let for the aliases, because
  2872. % sometimes we redefine the original macro, and the alias should reflect
  2873. % the redefinition.
  2874. %
  2875. % Use LaTeX names for the Icelandic letters.
  2876. \def\DH{{\ecfont \char"D0}} % Eth
  2877. \def\dh{{\ecfont \char"F0}} % eth
  2878. \def\TH{{\ecfont \char"DE}} % Thorn
  2879. \def\th{{\ecfont \char"FE}} % thorn
  2880. %
  2881. \def\guillemetleft{{\ecfont \char"13}}
  2882. \def\guillemotleft{\guillemetleft}
  2883. \def\guillemetright{{\ecfont \char"14}}
  2884. \def\guillemotright{\guillemetright}
  2885. \def\guilsinglleft{{\ecfont \char"0E}}
  2886. \def\guilsinglright{{\ecfont \char"0F}}
  2887. \def\quotedblbase{{\ecfont \char"12}}
  2888. \def\quotesinglbase{{\ecfont \char"0D}}
  2889. %
  2890. % This positioning is not perfect (see the ogonek LaTeX package), but
  2891. % we have the precomposed glyphs for the most common cases. We put the
  2892. % tests to use those glyphs in the single \ogonek macro so we have fewer
  2893. % dummy definitions to worry about for index entries, etc.
  2894. %
  2895. % ogonek is also used with other letters in Lithuanian (IOU), but using
  2896. % the precomposed glyphs for those is not so easy since they aren't in
  2897. % the same EC font.
  2898. \def\ogonek#1{{%
  2899. \def\temp{#1}%
  2900. \ifx\temp\macrocharA\Aogonek
  2901. \else\ifx\temp\macrochara\aogonek
  2902. \else\ifx\temp\macrocharE\Eogonek
  2903. \else\ifx\temp\macrochare\eogonek
  2904. \else
  2905. \ecfont \setbox0=\hbox{#1}%
  2906. \ifdim\ht0=1ex\accent"0C #1%
  2907. \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}%
  2908. \fi
  2909. \fi\fi\fi\fi
  2910. }%
  2911. }
  2912. \def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A}
  2913. \def\aogonek{{\ecfont \char"A1}}\def\macrochara{a}
  2914. \def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E}
  2915. \def\eogonek{{\ecfont \char"A6}}\def\macrochare{e}
  2916. %
  2917. % Use the ec* fonts (cm-super in outline format) for non-CM glyphs.
  2918. \def\ecfont{%
  2919. % We can't distinguish serif/sans and italic/slanted, but this
  2920. % is used for crude hacks anyway (like adding French and German
  2921. % quotes to documents typeset with CM, where we lose kerning), so
  2922. % hopefully nobody will notice/care.
  2923. \edef\ecsize{\csname\curfontsize ecsize\endcsname}%
  2924. \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
  2925. \ifmonospace
  2926. % typewriter:
  2927. \font\thisecfont = ectt\ecsize \space at \nominalsize
  2928. \else
  2929. \ifx\curfontstyle\bfstylename
  2930. % bold:
  2931. \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize
  2932. \else
  2933. % regular:
  2934. \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize
  2935. \fi
  2936. \fi
  2937. \thisecfont
  2938. }
  2939. % @registeredsymbol - R in a circle. The font for the R should really
  2940. % be smaller yet, but lllsize is the best we can do for now.
  2941. % Adapted from the plain.tex definition of \copyright.
  2942. %
  2943. \def\registeredsymbol{%
  2944. $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}%
  2945. \hfil\crcr\Orb}}%
  2946. }$%
  2947. }
  2948. % @textdegree - the normal degrees sign.
  2949. %
  2950. \def\textdegree{$^\circ$}
  2951. % Laurent Siebenmann reports \Orb undefined with:
  2952. % Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38
  2953. % so we'll define it if necessary.
  2954. %
  2955. \ifx\Orb\thisisundefined
  2956. \def\Orb{\mathhexbox20D}
  2957. \fi
  2958. % Quotes.
  2959. \chardef\quotedblleft="5C
  2960. \chardef\quotedblright=`\"
  2961. \chardef\quoteleft=`\`
  2962. \chardef\quoteright=`\'
  2963. \message{page headings,}
  2964. \newskip\titlepagetopglue \titlepagetopglue = 1.5in
  2965. \newskip\titlepagebottomglue \titlepagebottomglue = 2pc
  2966. % First the title page. Must do @settitle before @titlepage.
  2967. \newif\ifseenauthor
  2968. \newif\iffinishedtitlepage
  2969. % Do an implicit @contents or @shortcontents after @end titlepage if the
  2970. % user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
  2971. %
  2972. \newif\ifsetcontentsaftertitlepage
  2973. \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
  2974. \newif\ifsetshortcontentsaftertitlepage
  2975. \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
  2976. \parseargdef\shorttitlepage{%
  2977. \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
  2978. \endgroup\page\hbox{}\page}
  2979. \envdef\titlepage{%
  2980. % Open one extra group, as we want to close it in the middle of \Etitlepage.
  2981. \begingroup
  2982. \parindent=0pt \textfonts
  2983. % Leave some space at the very top of the page.
  2984. \vglue\titlepagetopglue
  2985. % No rule at page bottom unless we print one at the top with @title.
  2986. \finishedtitlepagetrue
  2987. %
  2988. % Most title ``pages'' are actually two pages long, with space
  2989. % at the top of the second. We don't want the ragged left on the second.
  2990. \let\oldpage = \page
  2991. \def\page{%
  2992. \iffinishedtitlepage\else
  2993. \finishtitlepage
  2994. \fi
  2995. \let\page = \oldpage
  2996. \page
  2997. \null
  2998. }%
  2999. }
  3000. \def\Etitlepage{%
  3001. \iffinishedtitlepage\else
  3002. \finishtitlepage
  3003. \fi
  3004. % It is important to do the page break before ending the group,
  3005. % because the headline and footline are only empty inside the group.
  3006. % If we use the new definition of \page, we always get a blank page
  3007. % after the title page, which we certainly don't want.
  3008. \oldpage
  3009. \endgroup
  3010. %
  3011. % Need this before the \...aftertitlepage checks so that if they are
  3012. % in effect the toc pages will come out with page numbers.
  3013. \HEADINGSon
  3014. %
  3015. % If they want short, they certainly want long too.
  3016. \ifsetshortcontentsaftertitlepage
  3017. \shortcontents
  3018. \contents
  3019. \global\let\shortcontents = \relax
  3020. \global\let\contents = \relax
  3021. \fi
  3022. %
  3023. \ifsetcontentsaftertitlepage
  3024. \contents
  3025. \global\let\contents = \relax
  3026. \global\let\shortcontents = \relax
  3027. \fi
  3028. }
  3029. \def\finishtitlepage{%
  3030. \vskip4pt \hrule height 2pt width \hsize
  3031. \vskip\titlepagebottomglue
  3032. \finishedtitlepagetrue
  3033. }
  3034. % Settings used for typesetting titles: no hyphenation, no indentation,
  3035. % don't worry much about spacing, ragged right. This should be used
  3036. % inside a \vbox, and fonts need to be set appropriately first. Because
  3037. % it is always used for titles, nothing else, we call \rmisbold. \par
  3038. % should be specified before the end of the \vbox, since a vbox is a group.
  3039. %
  3040. \def\raggedtitlesettings{%
  3041. \rmisbold
  3042. \hyphenpenalty=10000
  3043. \parindent=0pt
  3044. \tolerance=5000
  3045. \ptexraggedright
  3046. }
  3047. % Macros to be used within @titlepage:
  3048. \let\subtitlerm=\tenrm
  3049. \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
  3050. \parseargdef\title{%
  3051. \checkenv\titlepage
  3052. \vbox{\titlefonts \raggedtitlesettings #1\par}%
  3053. % print a rule at the page bottom also.
  3054. \finishedtitlepagefalse
  3055. \vskip4pt \hrule height 4pt width \hsize \vskip4pt
  3056. }
  3057. \parseargdef\subtitle{%
  3058. \checkenv\titlepage
  3059. {\subtitlefont \rightline{#1}}%
  3060. }
  3061. % @author should come last, but may come many times.
  3062. % It can also be used inside @quotation.
  3063. %
  3064. \parseargdef\author{%
  3065. \def\temp{\quotation}%
  3066. \ifx\thisenv\temp
  3067. \def\quotationauthor{#1}% printed in \Equotation.
  3068. \else
  3069. \checkenv\titlepage
  3070. \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
  3071. {\secfonts\rmisbold \leftline{#1}}%
  3072. \fi
  3073. }
  3074. % Set up page headings and footings.
  3075. \let\thispage=\folio
  3076. \newtoks\evenheadline % headline on even pages
  3077. \newtoks\oddheadline % headline on odd pages
  3078. \newtoks\evenfootline % footline on even pages
  3079. \newtoks\oddfootline % footline on odd pages
  3080. % Now make TeX use those variables
  3081. \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
  3082. \else \the\evenheadline \fi}}
  3083. \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
  3084. \else \the\evenfootline \fi}\HEADINGShook}
  3085. \let\HEADINGShook=\relax
  3086. % Commands to set those variables.
  3087. % For example, this is what @headings on does
  3088. % @evenheading @thistitle|@thispage|@thischapter
  3089. % @oddheading @thischapter|@thispage|@thistitle
  3090. % @evenfooting @thisfile||
  3091. % @oddfooting ||@thisfile
  3092. \def\evenheading{\parsearg\evenheadingxxx}
  3093. \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
  3094. \def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
  3095. \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  3096. \def\oddheading{\parsearg\oddheadingxxx}
  3097. \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
  3098. \def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
  3099. \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  3100. \parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
  3101. \def\evenfooting{\parsearg\evenfootingxxx}
  3102. \def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}
  3103. \def\evenfootingyyy #1\|#2\|#3\|#4\finish{%
  3104. \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  3105. \def\oddfooting{\parsearg\oddfootingxxx}
  3106. \def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}
  3107. \def\oddfootingyyy #1\|#2\|#3\|#4\finish{%
  3108. \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
  3109. %
  3110. % Leave some space for the footline. Hopefully ok to assume
  3111. % @evenfooting will not be used by itself.
  3112. \global\advance\pageheight by -12pt
  3113. \global\advance\vsize by -12pt
  3114. }
  3115. \parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
  3116. % @evenheadingmarks top \thischapter <- chapter at the top of a page
  3117. % @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page
  3118. %
  3119. % The same set of arguments for:
  3120. %
  3121. % @oddheadingmarks
  3122. % @evenfootingmarks
  3123. % @oddfootingmarks
  3124. % @everyheadingmarks
  3125. % @everyfootingmarks
  3126. \def\evenheadingmarks{\headingmarks{even}{heading}}
  3127. \def\oddheadingmarks{\headingmarks{odd}{heading}}
  3128. \def\evenfootingmarks{\headingmarks{even}{footing}}
  3129. \def\oddfootingmarks{\headingmarks{odd}{footing}}
  3130. \def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1}
  3131. \headingmarks{odd}{heading}{#1} }
  3132. \def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1}
  3133. \headingmarks{odd}{footing}{#1} }
  3134. % #1 = even/odd, #2 = heading/footing, #3 = top/bottom.
  3135. \def\headingmarks#1#2#3 {%
  3136. \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname
  3137. \global\expandafter\let\csname get#1#2marks\endcsname \temp
  3138. }
  3139. \everyheadingmarks bottom
  3140. \everyfootingmarks bottom
  3141. % @headings double turns headings on for double-sided printing.
  3142. % @headings single turns headings on for single-sided printing.
  3143. % @headings off turns them off.
  3144. % @headings on same as @headings double, retained for compatibility.
  3145. % @headings after turns on double-sided headings after this page.
  3146. % @headings doubleafter turns on double-sided headings after this page.
  3147. % @headings singleafter turns on single-sided headings after this page.
  3148. % By default, they are off at the start of a document,
  3149. % and turned `on' after @end titlepage.
  3150. \def\headings #1 {\csname HEADINGS#1\endcsname}
  3151. \def\headingsoff{% non-global headings elimination
  3152. \evenheadline={\hfil}\evenfootline={\hfil}%
  3153. \oddheadline={\hfil}\oddfootline={\hfil}%
  3154. }
  3155. \def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
  3156. \HEADINGSoff % it's the default
  3157. % When we turn headings on, set the page number to 1.
  3158. % For double-sided printing, put current file name in lower left corner,
  3159. % chapter name on inside top of right hand pages, document
  3160. % title on inside top of left hand pages, and page numbers on outside top
  3161. % edge of all pages.
  3162. \def\HEADINGSdouble{%
  3163. \global\pageno=1
  3164. \global\evenfootline={\hfil}
  3165. \global\oddfootline={\hfil}
  3166. \global\evenheadline={\line{\folio\hfil\thistitle}}
  3167. \global\oddheadline={\line{\thischapter\hfil\folio}}
  3168. \global\let\contentsalignmacro = \chapoddpage
  3169. }
  3170. \let\contentsalignmacro = \chappager
  3171. % For single-sided printing, chapter title goes across top left of page,
  3172. % page number on top right.
  3173. \def\HEADINGSsingle{%
  3174. \global\pageno=1
  3175. \global\evenfootline={\hfil}
  3176. \global\oddfootline={\hfil}
  3177. \global\evenheadline={\line{\thischapter\hfil\folio}}
  3178. \global\oddheadline={\line{\thischapter\hfil\folio}}
  3179. \global\let\contentsalignmacro = \chappager
  3180. }
  3181. \def\HEADINGSon{\HEADINGSdouble}
  3182. \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
  3183. \let\HEADINGSdoubleafter=\HEADINGSafter
  3184. \def\HEADINGSdoublex{%
  3185. \global\evenfootline={\hfil}
  3186. \global\oddfootline={\hfil}
  3187. \global\evenheadline={\line{\folio\hfil\thistitle}}
  3188. \global\oddheadline={\line{\thischapter\hfil\folio}}
  3189. \global\let\contentsalignmacro = \chapoddpage
  3190. }
  3191. \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
  3192. \def\HEADINGSsinglex{%
  3193. \global\evenfootline={\hfil}
  3194. \global\oddfootline={\hfil}
  3195. \global\evenheadline={\line{\thischapter\hfil\folio}}
  3196. \global\oddheadline={\line{\thischapter\hfil\folio}}
  3197. \global\let\contentsalignmacro = \chappager
  3198. }
  3199. % Subroutines used in generating headings
  3200. % This produces Day Month Year style of output.
  3201. % Only define if not already defined, in case a txi-??.tex file has set
  3202. % up a different format (e.g., txi-cs.tex does this).
  3203. \ifx\today\thisisundefined
  3204. \def\today{%
  3205. \number\day\space
  3206. \ifcase\month
  3207. \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
  3208. \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
  3209. \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
  3210. \fi
  3211. \space\number\year}
  3212. \fi
  3213. % @settitle line... specifies the title of the document, for headings.
  3214. % It generates no output of its own.
  3215. \def\thistitle{\putwordNoTitle}
  3216. \def\settitle{\parsearg{\gdef\thistitle}}
  3217. \message{tables,}
  3218. % Tables -- @table, @ftable, @vtable, @item(x).
  3219. % default indentation of table text
  3220. \newdimen\tableindent \tableindent=.8in
  3221. % default indentation of @itemize and @enumerate text
  3222. \newdimen\itemindent \itemindent=.3in
  3223. % margin between end of table item and start of table text.
  3224. \newdimen\itemmargin \itemmargin=.1in
  3225. % used internally for \itemindent minus \itemmargin
  3226. \newdimen\itemmax
  3227. % Note @table, @ftable, and @vtable define @item, @itemx, etc., with
  3228. % these defs.
  3229. % They also define \itemindex
  3230. % to index the item name in whatever manner is desired (perhaps none).
  3231. \newif\ifitemxneedsnegativevskip
  3232. \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
  3233. \def\internalBitem{\smallbreak \parsearg\itemzzz}
  3234. \def\internalBitemx{\itemxpar \parsearg\itemzzz}
  3235. \def\itemzzz #1{\begingroup %
  3236. \advance\hsize by -\rightskip
  3237. \advance\hsize by -\tableindent
  3238. \setbox0=\hbox{\itemindicate{#1}}%
  3239. \itemindex{#1}%
  3240. \nobreak % This prevents a break before @itemx.
  3241. %
  3242. % If the item text does not fit in the space we have, put it on a line
  3243. % by itself, and do not allow a page break either before or after that
  3244. % line. We do not start a paragraph here because then if the next
  3245. % command is, e.g., @kindex, the whatsit would get put into the
  3246. % horizontal list on a line by itself, resulting in extra blank space.
  3247. \ifdim \wd0>\itemmax
  3248. %
  3249. % Make this a paragraph so we get the \parskip glue and wrapping,
  3250. % but leave it ragged-right.
  3251. \begingroup
  3252. \advance\leftskip by-\tableindent
  3253. \advance\hsize by\tableindent
  3254. \advance\rightskip by0pt plus1fil\relax
  3255. \leavevmode\unhbox0\par
  3256. \endgroup
  3257. %
  3258. % We're going to be starting a paragraph, but we don't want the
  3259. % \parskip glue -- logically it's part of the @item we just started.
  3260. \nobreak \vskip-\parskip
  3261. %
  3262. % Stop a page break at the \parskip glue coming up. However, if
  3263. % what follows is an environment such as @example, there will be no
  3264. % \parskip glue; then the negative vskip we just inserted would
  3265. % cause the example and the item to crash together. So we use this
  3266. % bizarre value of 10001 as a signal to \aboveenvbreak to insert
  3267. % \parskip glue after all. Section titles are handled this way also.
  3268. %
  3269. \penalty 10001
  3270. \endgroup
  3271. \itemxneedsnegativevskipfalse
  3272. \else
  3273. % The item text fits into the space. Start a paragraph, so that the
  3274. % following text (if any) will end up on the same line.
  3275. \noindent
  3276. % Do this with kerns and \unhbox so that if there is a footnote in
  3277. % the item text, it can migrate to the main vertical list and
  3278. % eventually be printed.
  3279. \nobreak\kern-\tableindent
  3280. \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
  3281. \unhbox0
  3282. \nobreak\kern\dimen0
  3283. \endgroup
  3284. \itemxneedsnegativevskiptrue
  3285. \fi
  3286. }
  3287. \def\item{\errmessage{@item while not in a list environment}}
  3288. \def\itemx{\errmessage{@itemx while not in a list environment}}
  3289. % @table, @ftable, @vtable.
  3290. \envdef\table{%
  3291. \let\itemindex\gobble
  3292. \tablecheck{table}%
  3293. }
  3294. \envdef\ftable{%
  3295. \def\itemindex ##1{\doind {fn}{\code{##1}}}%
  3296. \tablecheck{ftable}%
  3297. }
  3298. \envdef\vtable{%
  3299. \def\itemindex ##1{\doind {vr}{\code{##1}}}%
  3300. \tablecheck{vtable}%
  3301. }
  3302. \def\tablecheck#1{%
  3303. \ifnum \the\catcode`\^^M=\active
  3304. \endgroup
  3305. \errmessage{This command won't work in this context; perhaps the problem is
  3306. that we are \inenvironment\thisenv}%
  3307. \def\next{\doignore{#1}}%
  3308. \else
  3309. \let\next\tablex
  3310. \fi
  3311. \next
  3312. }
  3313. \def\tablex#1{%
  3314. \def\itemindicate{#1}%
  3315. \parsearg\tabley
  3316. }
  3317. \def\tabley#1{%
  3318. {%
  3319. \makevalueexpandable
  3320. \edef\temp{\noexpand\tablez #1\space\space\space}%
  3321. \expandafter
  3322. }\temp \endtablez
  3323. }
  3324. \def\tablez #1 #2 #3 #4\endtablez{%
  3325. \aboveenvbreak
  3326. \ifnum 0#1>0 \advance \leftskip by #1\mil \fi
  3327. \ifnum 0#2>0 \tableindent=#2\mil \fi
  3328. \ifnum 0#3>0 \advance \rightskip by #3\mil \fi
  3329. \itemmax=\tableindent
  3330. \advance \itemmax by -\itemmargin
  3331. \advance \leftskip by \tableindent
  3332. \exdentamount=\tableindent
  3333. \parindent = 0pt
  3334. \parskip = \smallskipamount
  3335. \ifdim \parskip=0pt \parskip=2pt \fi
  3336. \let\item = \internalBitem
  3337. \let\itemx = \internalBitemx
  3338. }
  3339. \def\Etable{\endgraf\afterenvbreak}
  3340. \let\Eftable\Etable
  3341. \let\Evtable\Etable
  3342. \let\Eitemize\Etable
  3343. \let\Eenumerate\Etable
  3344. % This is the counter used by @enumerate, which is really @itemize
  3345. \newcount \itemno
  3346. \envdef\itemize{\parsearg\doitemize}
  3347. \def\doitemize#1{%
  3348. \aboveenvbreak
  3349. \itemmax=\itemindent
  3350. \advance\itemmax by -\itemmargin
  3351. \advance\leftskip by \itemindent
  3352. \exdentamount=\itemindent
  3353. \parindent=0pt
  3354. \parskip=\smallskipamount
  3355. \ifdim\parskip=0pt \parskip=2pt \fi
  3356. %
  3357. % Try typesetting the item mark that if the document erroneously says
  3358. % something like @itemize @samp (intending @table), there's an error
  3359. % right away at the @itemize. It's not the best error message in the
  3360. % world, but it's better than leaving it to the @item. This means if
  3361. % the user wants an empty mark, they have to say @w{} not just @w.
  3362. \def\itemcontents{#1}%
  3363. \setbox0 = \hbox{\itemcontents}%
  3364. %
  3365. % @itemize with no arg is equivalent to @itemize @bullet.
  3366. \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
  3367. %
  3368. \let\item=\itemizeitem
  3369. }
  3370. % Definition of @item while inside @itemize and @enumerate.
  3371. %
  3372. \def\itemizeitem{%
  3373. \advance\itemno by 1 % for enumerations
  3374. {\let\par=\endgraf \smallbreak}% reasonable place to break
  3375. {%
  3376. % If the document has an @itemize directly after a section title, a
  3377. % \nobreak will be last on the list, and \sectionheading will have
  3378. % done a \vskip-\parskip. In that case, we don't want to zero
  3379. % parskip, or the item text will crash with the heading. On the
  3380. % other hand, when there is normal text preceding the item (as there
  3381. % usually is), we do want to zero parskip, or there would be too much
  3382. % space. In that case, we won't have a \nobreak before. At least
  3383. % that's the theory.
  3384. \ifnum\lastpenalty<10000 \parskip=0in \fi
  3385. \noindent
  3386. \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
  3387. %
  3388. \vadjust{\penalty 1200}}% not good to break after first line of item.
  3389. \flushcr
  3390. }
  3391. % \splitoff TOKENS\endmark defines \first to be the first token in
  3392. % TOKENS, and \rest to be the remainder.
  3393. %
  3394. \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
  3395. % Allow an optional argument of an uppercase letter, lowercase letter,
  3396. % or number, to specify the first label in the enumerated list. No
  3397. % argument is the same as `1'.
  3398. %
  3399. \envparseargdef\enumerate{\enumeratey #1 \endenumeratey}
  3400. \def\enumeratey #1 #2\endenumeratey{%
  3401. % If we were given no argument, pretend we were given `1'.
  3402. \def\thearg{#1}%
  3403. \ifx\thearg\empty \def\thearg{1}\fi
  3404. %
  3405. % Detect if the argument is a single token. If so, it might be a
  3406. % letter. Otherwise, the only valid thing it can be is a number.
  3407. % (We will always have one token, because of the test we just made.
  3408. % This is a good thing, since \splitoff doesn't work given nothing at
  3409. % all -- the first parameter is undelimited.)
  3410. \expandafter\splitoff\thearg\endmark
  3411. \ifx\rest\empty
  3412. % Only one token in the argument. It could still be anything.
  3413. % A ``lowercase letter'' is one whose \lccode is nonzero.
  3414. % An ``uppercase letter'' is one whose \lccode is both nonzero, and
  3415. % not equal to itself.
  3416. % Otherwise, we assume it's a number.
  3417. %
  3418. % We need the \relax at the end of the \ifnum lines to stop TeX from
  3419. % continuing to look for a <number>.
  3420. %
  3421. \ifnum\lccode\expandafter`\thearg=0\relax
  3422. \numericenumerate % a number (we hope)
  3423. \else
  3424. % It's a letter.
  3425. \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
  3426. \lowercaseenumerate % lowercase letter
  3427. \else
  3428. \uppercaseenumerate % uppercase letter
  3429. \fi
  3430. \fi
  3431. \else
  3432. % Multiple tokens in the argument. We hope it's a number.
  3433. \numericenumerate
  3434. \fi
  3435. }
  3436. % An @enumerate whose labels are integers. The starting integer is
  3437. % given in \thearg.
  3438. %
  3439. \def\numericenumerate{%
  3440. \itemno = \thearg
  3441. \startenumeration{\the\itemno}%
  3442. }
  3443. % The starting (lowercase) letter is in \thearg.
  3444. \def\lowercaseenumerate{%
  3445. \itemno = \expandafter`\thearg
  3446. \startenumeration{%
  3447. % Be sure we're not beyond the end of the alphabet.
  3448. \ifnum\itemno=0
  3449. \errmessage{No more lowercase letters in @enumerate; get a bigger
  3450. alphabet}%
  3451. \fi
  3452. \char\lccode\itemno
  3453. }%
  3454. }
  3455. % The starting (uppercase) letter is in \thearg.
  3456. \def\uppercaseenumerate{%
  3457. \itemno = \expandafter`\thearg
  3458. \startenumeration{%
  3459. % Be sure we're not beyond the end of the alphabet.
  3460. \ifnum\itemno=0
  3461. \errmessage{No more uppercase letters in @enumerate; get a bigger
  3462. alphabet}
  3463. \fi
  3464. \char\uccode\itemno
  3465. }%
  3466. }
  3467. % Call \doitemize, adding a period to the first argument and supplying the
  3468. % common last two arguments. Also subtract one from the initial value in
  3469. % \itemno, since @item increments \itemno.
  3470. %
  3471. \def\startenumeration#1{%
  3472. \advance\itemno by -1
  3473. \doitemize{#1.}\flushcr
  3474. }
  3475. % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
  3476. % to @enumerate.
  3477. %
  3478. \def\alphaenumerate{\enumerate{a}}
  3479. \def\capsenumerate{\enumerate{A}}
  3480. \def\Ealphaenumerate{\Eenumerate}
  3481. \def\Ecapsenumerate{\Eenumerate}
  3482. % @multitable macros
  3483. % Amy Hendrickson, 8/18/94, 3/6/96
  3484. %
  3485. % @multitable ... @end multitable will make as many columns as desired.
  3486. % Contents of each column will wrap at width given in preamble. Width
  3487. % can be specified either with sample text given in a template line,
  3488. % or in percent of \hsize, the current width of text on page.
  3489. % Table can continue over pages but will only break between lines.
  3490. % To make preamble:
  3491. %
  3492. % Either define widths of columns in terms of percent of \hsize:
  3493. % @multitable @columnfractions .25 .3 .45
  3494. % @item ...
  3495. %
  3496. % Numbers following @columnfractions are the percent of the total
  3497. % current hsize to be used for each column. You may use as many
  3498. % columns as desired.
  3499. % Or use a template:
  3500. % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
  3501. % @item ...
  3502. % using the widest term desired in each column.
  3503. % Each new table line starts with @item, each subsequent new column
  3504. % starts with @tab. Empty columns may be produced by supplying @tab's
  3505. % with nothing between them for as many times as empty columns are needed,
  3506. % ie, @tab@tab@tab will produce two empty columns.
  3507. % @item, @tab do not need to be on their own lines, but it will not hurt
  3508. % if they are.
  3509. % Sample multitable:
  3510. % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
  3511. % @item first col stuff @tab second col stuff @tab third col
  3512. % @item
  3513. % first col stuff
  3514. % @tab
  3515. % second col stuff
  3516. % @tab
  3517. % third col
  3518. % @item first col stuff @tab second col stuff
  3519. % @tab Many paragraphs of text may be used in any column.
  3520. %
  3521. % They will wrap at the width determined by the template.
  3522. % @item@tab@tab This will be in third column.
  3523. % @end multitable
  3524. % Default dimensions may be reset by user.
  3525. % @multitableparskip is vertical space between paragraphs in table.
  3526. % @multitableparindent is paragraph indent in table.
  3527. % @multitablecolmargin is horizontal space to be left between columns.
  3528. % @multitablelinespace is space to leave between table items, baseline
  3529. % to baseline.
  3530. % 0pt means it depends on current normal line spacing.
  3531. %
  3532. \newskip\multitableparskip
  3533. \newskip\multitableparindent
  3534. \newdimen\multitablecolspace
  3535. \newskip\multitablelinespace
  3536. \multitableparskip=0pt
  3537. \multitableparindent=6pt
  3538. \multitablecolspace=12pt
  3539. \multitablelinespace=0pt
  3540. % Macros used to set up halign preamble:
  3541. %
  3542. \let\endsetuptable\relax
  3543. \def\xendsetuptable{\endsetuptable}
  3544. \let\columnfractions\relax
  3545. \def\xcolumnfractions{\columnfractions}
  3546. \newif\ifsetpercent
  3547. % #1 is the @columnfraction, usually a decimal number like .5, but might
  3548. % be just 1. We just use it, whatever it is.
  3549. %
  3550. \def\pickupwholefraction#1 {%
  3551. \global\advance\colcount by 1
  3552. \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}%
  3553. \setuptable
  3554. }
  3555. \newcount\colcount
  3556. \def\setuptable#1{%
  3557. \def\firstarg{#1}%
  3558. \ifx\firstarg\xendsetuptable
  3559. \let\go = \relax
  3560. \else
  3561. \ifx\firstarg\xcolumnfractions
  3562. \global\setpercenttrue
  3563. \else
  3564. \ifsetpercent
  3565. \let\go\pickupwholefraction
  3566. \else
  3567. \global\advance\colcount by 1
  3568. \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
  3569. % separator; typically that is always in the input, anyway.
  3570. \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
  3571. \fi
  3572. \fi
  3573. \ifx\go\pickupwholefraction
  3574. % Put the argument back for the \pickupwholefraction call, so
  3575. % we'll always have a period there to be parsed.
  3576. \def\go{\pickupwholefraction#1}%
  3577. \else
  3578. \let\go = \setuptable
  3579. \fi%
  3580. \fi
  3581. \go
  3582. }
  3583. % multitable-only commands.
  3584. %
  3585. % @headitem starts a heading row, which we typeset in bold.
  3586. % Assignments have to be global since we are inside the implicit group
  3587. % of an alignment entry. \everycr resets \everytab so we don't have to
  3588. % undo it ourselves.
  3589. \def\headitemfont{\b}% for people to use in the template row; not changeable
  3590. \def\headitem{%
  3591. \checkenv\multitable
  3592. \crcr
  3593. \global\everytab={\bf}% can't use \headitemfont since the parsing differs
  3594. \the\everytab % for the first item
  3595. }%
  3596. %
  3597. % A \tab used to include \hskip1sp. But then the space in a template
  3598. % line is not enough. That is bad. So let's go back to just `&' until
  3599. % we again encounter the problem the 1sp was intended to solve.
  3600. % --karl, nathan@acm.org, 20apr99.
  3601. \def\tab{\checkenv\multitable &\the\everytab}%
  3602. % @multitable ... @end multitable definitions:
  3603. %
  3604. \newtoks\everytab % insert after every tab.
  3605. %
  3606. \envdef\multitable{%
  3607. \vskip\parskip
  3608. \startsavinginserts
  3609. %
  3610. % @item within a multitable starts a normal row.
  3611. % We use \def instead of \let so that if one of the multitable entries
  3612. % contains an @itemize, we don't choke on the \item (seen as \crcr aka
  3613. % \endtemplate) expanding \doitemize.
  3614. \def\item{\crcr}%
  3615. %
  3616. \tolerance=9500
  3617. \hbadness=9500
  3618. \setmultitablespacing
  3619. \parskip=\multitableparskip
  3620. \parindent=\multitableparindent
  3621. \overfullrule=0pt
  3622. \global\colcount=0
  3623. %
  3624. \everycr = {%
  3625. \noalign{%
  3626. \global\everytab={}%
  3627. \global\colcount=0 % Reset the column counter.
  3628. % Check for saved footnotes, etc.
  3629. \checkinserts
  3630. % Keeps underfull box messages off when table breaks over pages.
  3631. %\filbreak
  3632. % Maybe so, but it also creates really weird page breaks when the
  3633. % table breaks over pages. Wouldn't \vfil be better? Wait until the
  3634. % problem manifests itself, so it can be fixed for real --karl.
  3635. }%
  3636. }%
  3637. %
  3638. \parsearg\domultitable
  3639. }
  3640. \def\domultitable#1{%
  3641. % To parse everything between @multitable and @item:
  3642. \setuptable#1 \endsetuptable
  3643. %
  3644. % This preamble sets up a generic column definition, which will
  3645. % be used as many times as user calls for columns.
  3646. % \vtop will set a single line and will also let text wrap and
  3647. % continue for many paragraphs if desired.
  3648. \halign\bgroup &%
  3649. \global\advance\colcount by 1
  3650. \multistrut
  3651. \vtop{%
  3652. % Use the current \colcount to find the correct column width:
  3653. \hsize=\expandafter\csname col\the\colcount\endcsname
  3654. %
  3655. % In order to keep entries from bumping into each other
  3656. % we will add a \leftskip of \multitablecolspace to all columns after
  3657. % the first one.
  3658. %
  3659. % If a template has been used, we will add \multitablecolspace
  3660. % to the width of each template entry.
  3661. %
  3662. % If the user has set preamble in terms of percent of \hsize we will
  3663. % use that dimension as the width of the column, and the \leftskip
  3664. % will keep entries from bumping into each other. Table will start at
  3665. % left margin and final column will justify at right margin.
  3666. %
  3667. % Make sure we don't inherit \rightskip from the outer environment.
  3668. \rightskip=0pt
  3669. \ifnum\colcount=1
  3670. % The first column will be indented with the surrounding text.
  3671. \advance\hsize by\leftskip
  3672. \else
  3673. \ifsetpercent \else
  3674. % If user has not set preamble in terms of percent of \hsize
  3675. % we will advance \hsize by \multitablecolspace.
  3676. \advance\hsize by \multitablecolspace
  3677. \fi
  3678. % In either case we will make \leftskip=\multitablecolspace:
  3679. \leftskip=\multitablecolspace
  3680. \fi
  3681. % Ignoring space at the beginning and end avoids an occasional spurious
  3682. % blank line, when TeX decides to break the line at the space before the
  3683. % box from the multistrut, so the strut ends up on a line by itself.
  3684. % For example:
  3685. % @multitable @columnfractions .11 .89
  3686. % @item @code{#}
  3687. % @tab Legal holiday which is valid in major parts of the whole country.
  3688. % Is automatically provided with highlighting sequences respectively
  3689. % marking characters.
  3690. \noindent\ignorespaces##\unskip\multistrut
  3691. }\cr
  3692. }
  3693. \def\Emultitable{%
  3694. \crcr
  3695. \egroup % end the \halign
  3696. \global\setpercentfalse
  3697. }
  3698. \def\setmultitablespacing{%
  3699. \def\multistrut{\strut}% just use the standard line spacing
  3700. %
  3701. % Compute \multitablelinespace (if not defined by user) for use in
  3702. % \multitableparskip calculation. We used define \multistrut based on
  3703. % this, but (ironically) that caused the spacing to be off.
  3704. % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100.
  3705. \ifdim\multitablelinespace=0pt
  3706. \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
  3707. \global\advance\multitablelinespace by-\ht0
  3708. \fi
  3709. % Test to see if parskip is larger than space between lines of
  3710. % table. If not, do nothing.
  3711. % If so, set to same dimension as multitablelinespace.
  3712. \ifdim\multitableparskip>\multitablelinespace
  3713. \global\multitableparskip=\multitablelinespace
  3714. \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
  3715. % than skip between lines in the table.
  3716. \fi%
  3717. \ifdim\multitableparskip=0pt
  3718. \global\multitableparskip=\multitablelinespace
  3719. \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
  3720. % than skip between lines in the table.
  3721. \fi}
  3722. \message{conditionals,}
  3723. % @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext,
  3724. % @ifnotxml always succeed. They currently do nothing; we don't
  3725. % attempt to check whether the conditionals are properly nested. But we
  3726. % have to remember that they are conditionals, so that @end doesn't
  3727. % attempt to close an environment group.
  3728. %
  3729. \def\makecond#1{%
  3730. \expandafter\let\csname #1\endcsname = \relax
  3731. \expandafter\let\csname iscond.#1\endcsname = 1
  3732. }
  3733. \makecond{iftex}
  3734. \makecond{ifnotdocbook}
  3735. \makecond{ifnothtml}
  3736. \makecond{ifnotinfo}
  3737. \makecond{ifnotplaintext}
  3738. \makecond{ifnotxml}
  3739. % Ignore @ignore, @ifhtml, @ifinfo, and the like.
  3740. %
  3741. \def\direntry{\doignore{direntry}}
  3742. \def\documentdescription{\doignore{documentdescription}}
  3743. \def\docbook{\doignore{docbook}}
  3744. \def\html{\doignore{html}}
  3745. \def\ifdocbook{\doignore{ifdocbook}}
  3746. \def\ifhtml{\doignore{ifhtml}}
  3747. \def\ifinfo{\doignore{ifinfo}}
  3748. \def\ifnottex{\doignore{ifnottex}}
  3749. \def\ifplaintext{\doignore{ifplaintext}}
  3750. \def\ifxml{\doignore{ifxml}}
  3751. \def\ignore{\doignore{ignore}}
  3752. \def\menu{\doignore{menu}}
  3753. \def\xml{\doignore{xml}}
  3754. % Ignore text until a line `@end #1', keeping track of nested conditionals.
  3755. %
  3756. % A count to remember the depth of nesting.
  3757. \newcount\doignorecount
  3758. \def\doignore#1{\begingroup
  3759. % Scan in ``verbatim'' mode:
  3760. \obeylines
  3761. \catcode`\@ = \other
  3762. \catcode`\{ = \other
  3763. \catcode`\} = \other
  3764. %
  3765. % Make sure that spaces turn into tokens that match what \doignoretext wants.
  3766. \spaceisspace
  3767. %
  3768. % Count number of #1's that we've seen.
  3769. \doignorecount = 0
  3770. %
  3771. % Swallow text until we reach the matching `@end #1'.
  3772. \dodoignore{#1}%
  3773. }
  3774. { \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source.
  3775. \obeylines %
  3776. %
  3777. \gdef\dodoignore#1{%
  3778. % #1 contains the command name as a string, e.g., `ifinfo'.
  3779. %
  3780. % Define a command to find the next `@end #1'.
  3781. \long\def\doignoretext##1^^M@end #1{%
  3782. \doignoretextyyy##1^^M@#1\_STOP_}%
  3783. %
  3784. % And this command to find another #1 command, at the beginning of a
  3785. % line. (Otherwise, we would consider a line `@c @ifset', for
  3786. % example, to count as an @ifset for nesting.)
  3787. \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%
  3788. %
  3789. % And now expand that command.
  3790. \doignoretext ^^M%
  3791. }%
  3792. }
  3793. \def\doignoreyyy#1{%
  3794. \def\temp{#1}%
  3795. \ifx\temp\empty % Nothing found.
  3796. \let\next\doignoretextzzz
  3797. \else % Found a nested condition, ...
  3798. \advance\doignorecount by 1
  3799. \let\next\doignoretextyyy % ..., look for another.
  3800. % If we're here, #1 ends with ^^M\ifinfo (for example).
  3801. \fi
  3802. \next #1% the token \_STOP_ is present just after this macro.
  3803. }
  3804. % We have to swallow the remaining "\_STOP_".
  3805. %
  3806. \def\doignoretextzzz#1{%
  3807. \ifnum\doignorecount = 0 % We have just found the outermost @end.
  3808. \let\next\enddoignore
  3809. \else % Still inside a nested condition.
  3810. \advance\doignorecount by -1
  3811. \let\next\doignoretext % Look for the next @end.
  3812. \fi
  3813. \next
  3814. }
  3815. % Finish off ignored text.
  3816. { \obeylines%
  3817. % Ignore anything after the last `@end #1'; this matters in verbatim
  3818. % environments, where otherwise the newline after an ignored conditional
  3819. % would result in a blank line in the output.
  3820. \gdef\enddoignore#1^^M{\endgroup\ignorespaces}%
  3821. }
  3822. % @set VAR sets the variable VAR to an empty value.
  3823. % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
  3824. %
  3825. % Since we want to separate VAR from REST-OF-LINE (which might be
  3826. % empty), we can't just use \parsearg; we have to insert a space of our
  3827. % own to delimit the rest of the line, and then take it out again if we
  3828. % didn't need it.
  3829. % We rely on the fact that \parsearg sets \catcode`\ =10.
  3830. %
  3831. \parseargdef\set{\setyyy#1 \endsetyyy}
  3832. \def\setyyy#1 #2\endsetyyy{%
  3833. {%
  3834. \makevalueexpandable
  3835. \def\temp{#2}%
  3836. \edef\next{\gdef\makecsname{SET#1}}%
  3837. \ifx\temp\empty
  3838. \next{}%
  3839. \else
  3840. \setzzz#2\endsetzzz
  3841. \fi
  3842. }%
  3843. }
  3844. % Remove the trailing space \setxxx inserted.
  3845. \def\setzzz#1 \endsetzzz{\next{#1}}
  3846. % @clear VAR clears (i.e., unsets) the variable VAR.
  3847. %
  3848. \parseargdef\clear{%
  3849. {%
  3850. \makevalueexpandable
  3851. \global\expandafter\let\csname SET#1\endcsname=\relax
  3852. }%
  3853. }
  3854. % @value{foo} gets the text saved in variable foo.
  3855. \def\value{\begingroup\makevalueexpandable\valuexxx}
  3856. \def\valuexxx#1{\expandablevalue{#1}\endgroup}
  3857. {
  3858. \catcode`\- = \active \catcode`\_ = \active
  3859. %
  3860. \gdef\makevalueexpandable{%
  3861. \let\value = \expandablevalue
  3862. % We don't want these characters active, ...
  3863. \catcode`\-=\other \catcode`\_=\other
  3864. % ..., but we might end up with active ones in the argument if
  3865. % we're called from @code, as @code{@value{foo-bar_}}, though.
  3866. % So \let them to their normal equivalents.
  3867. \let-\normaldash \let_\normalunderscore
  3868. }
  3869. }
  3870. % We have this subroutine so that we can handle at least some @value's
  3871. % properly in indexes (we call \makevalueexpandable in \indexdummies).
  3872. % The command has to be fully expandable (if the variable is set), since
  3873. % the result winds up in the index file. This means that if the
  3874. % variable's value contains other Texinfo commands, it's almost certain
  3875. % it will fail (although perhaps we could fix that with sufficient work
  3876. % to do a one-level expansion on the result, instead of complete).
  3877. %
  3878. \def\expandablevalue#1{%
  3879. \expandafter\ifx\csname SET#1\endcsname\relax
  3880. {[No value for ``#1'']}%
  3881. \message{Variable `#1', used in @value, is not set.}%
  3882. \else
  3883. \csname SET#1\endcsname
  3884. \fi
  3885. }
  3886. % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
  3887. % with @set.
  3888. %
  3889. % To get special treatment of `@end ifset,' call \makeond and the redefine.
  3890. %
  3891. \makecond{ifset}
  3892. \def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}
  3893. \def\doifset#1#2{%
  3894. {%
  3895. \makevalueexpandable
  3896. \let\next=\empty
  3897. \expandafter\ifx\csname SET#2\endcsname\relax
  3898. #1% If not set, redefine \next.
  3899. \fi
  3900. \expandafter
  3901. }\next
  3902. }
  3903. \def\ifsetfail{\doignore{ifset}}
  3904. % @ifclear VAR ... @end executes the `...' iff VAR has never been
  3905. % defined with @set, or has been undefined with @clear.
  3906. %
  3907. % The `\else' inside the `\doifset' parameter is a trick to reuse the
  3908. % above code: if the variable is not set, do nothing, if it is set,
  3909. % then redefine \next to \ifclearfail.
  3910. %
  3911. \makecond{ifclear}
  3912. \def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
  3913. \def\ifclearfail{\doignore{ifclear}}
  3914. % @ifcommandisdefined CMD ... @end executes the `...' if CMD (written
  3915. % without the @) is in fact defined. We can only feasibly check at the
  3916. % TeX level, so something like `mathcode' is going to considered
  3917. % defined even though it is not a Texinfo command.
  3918. %
  3919. \makecond{ifcommanddefined}
  3920. \def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}}
  3921. %
  3922. \def\doifcmddefined#1#2{{%
  3923. \makevalueexpandable
  3924. \let\next=\empty
  3925. \expandafter\ifx\csname #2\endcsname\relax
  3926. #1% If not defined, \let\next as above.
  3927. \fi
  3928. \expandafter
  3929. }\next
  3930. }
  3931. \def\ifcmddefinedfail{\doignore{ifcommanddefined}}
  3932. % @ifcommandnotdefined CMD ... handled similar to @ifclear above.
  3933. \makecond{ifcommandnotdefined}
  3934. \def\ifcommandnotdefined{%
  3935. \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}}
  3936. \def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}}
  3937. % Set the `txicommandconditionals' variable, so documents have a way to
  3938. % test if the @ifcommand...defined conditionals are available.
  3939. \set txicommandconditionals
  3940. % @dircategory CATEGORY -- specify a category of the dir file
  3941. % which this file should belong to. Ignore this in TeX.
  3942. \let\dircategory=\comment
  3943. % @defininfoenclose.
  3944. \let\definfoenclose=\comment
  3945. \message{indexing,}
  3946. % Index generation facilities
  3947. % Define \newwrite to be identical to plain tex's \newwrite
  3948. % except not \outer, so it can be used within macros and \if's.
  3949. \edef\newwrite{\makecsname{ptexnewwrite}}
  3950. % \newindex {foo} defines an index named foo.
  3951. % It automatically defines \fooindex such that
  3952. % \fooindex ...rest of line... puts an entry in the index foo.
  3953. % It also defines \fooindfile to be the number of the output channel for
  3954. % the file that accumulates this index. The file's extension is foo.
  3955. % The name of an index should be no more than 2 characters long
  3956. % for the sake of vms.
  3957. %
  3958. \def\newindex#1{%
  3959. \iflinks
  3960. \expandafter\newwrite \csname#1indfile\endcsname
  3961. \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
  3962. \fi
  3963. \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
  3964. \noexpand\doindex{#1}}
  3965. }
  3966. % @defindex foo == \newindex{foo}
  3967. %
  3968. \def\defindex{\parsearg\newindex}
  3969. % Define @defcodeindex, like @defindex except put all entries in @code.
  3970. %
  3971. \def\defcodeindex{\parsearg\newcodeindex}
  3972. %
  3973. \def\newcodeindex#1{%
  3974. \iflinks
  3975. \expandafter\newwrite \csname#1indfile\endcsname
  3976. \openout \csname#1indfile\endcsname \jobname.#1
  3977. \fi
  3978. \expandafter\xdef\csname#1index\endcsname{%
  3979. \noexpand\docodeindex{#1}}%
  3980. }
  3981. % @synindex foo bar makes index foo feed into index bar.
  3982. % Do this instead of @defindex foo if you don't want it as a separate index.
  3983. %
  3984. % @syncodeindex foo bar similar, but put all entries made for index foo
  3985. % inside @code.
  3986. %
  3987. \def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
  3988. \def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
  3989. % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
  3990. % #3 the target index (bar).
  3991. \def\dosynindex#1#2#3{%
  3992. % Only do \closeout if we haven't already done it, else we'll end up
  3993. % closing the target index.
  3994. \expandafter \ifx\csname donesynindex#2\endcsname \relax
  3995. % The \closeout helps reduce unnecessary open files; the limit on the
  3996. % Acorn RISC OS is a mere 16 files.
  3997. \expandafter\closeout\csname#2indfile\endcsname
  3998. \expandafter\let\csname donesynindex#2\endcsname = 1
  3999. \fi
  4000. % redefine \fooindfile:
  4001. \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
  4002. \expandafter\let\csname#2indfile\endcsname=\temp
  4003. % redefine \fooindex:
  4004. \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
  4005. }
  4006. % Define \doindex, the driver for all \fooindex macros.
  4007. % Argument #1 is generated by the calling \fooindex macro,
  4008. % and it is "foo", the name of the index.
  4009. % \doindex just uses \parsearg; it calls \doind for the actual work.
  4010. % This is because \doind is more useful to call from other macros.
  4011. % There is also \dosubind {index}{topic}{subtopic}
  4012. % which makes an entry in a two-level index such as the operation index.
  4013. \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
  4014. \def\singleindexer #1{\doind{\indexname}{#1}}
  4015. % like the previous two, but they put @code around the argument.
  4016. \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
  4017. \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
  4018. % Take care of Texinfo commands that can appear in an index entry.
  4019. % Since there are some commands we want to expand, and others we don't,
  4020. % we have to laboriously prevent expansion for those that we don't.
  4021. %
  4022. \def\indexdummies{%
  4023. \escapechar = `\\ % use backslash in output files.
  4024. \def\@{@}% change to @@ when we switch to @ as escape char in index files.
  4025. \def\ {\realbackslash\space }%
  4026. %
  4027. % Need these unexpandable (because we define \tt as a dummy)
  4028. % definitions when @{ or @} appear in index entry text. Also, more
  4029. % complicated, when \tex is in effect and \{ is a \delimiter again.
  4030. % We can't use \lbracecmd and \rbracecmd because texindex assumes
  4031. % braces and backslashes are used only as delimiters. Perhaps we
  4032. % should define @lbrace and @rbrace commands a la @comma.
  4033. \def\{{{\tt\char123}}%
  4034. \def\}{{\tt\char125}}%
  4035. %
  4036. % I don't entirely understand this, but when an index entry is
  4037. % generated from a macro call, the \endinput which \scanmacro inserts
  4038. % causes processing to be prematurely terminated. This is,
  4039. % apparently, because \indexsorttmp is fully expanded, and \endinput
  4040. % is an expandable command. The redefinition below makes \endinput
  4041. % disappear altogether for that purpose -- although logging shows that
  4042. % processing continues to some further point. On the other hand, it
  4043. % seems \endinput does not hurt in the printed index arg, since that
  4044. % is still getting written without apparent harm.
  4045. %
  4046. % Sample source (mac-idx3.tex, reported by Graham Percival to
  4047. % help-texinfo, 22may06):
  4048. % @macro funindex {WORD}
  4049. % @findex xyz
  4050. % @end macro
  4051. % ...
  4052. % @funindex commtest
  4053. %
  4054. % The above is not enough to reproduce the bug, but it gives the flavor.
  4055. %
  4056. % Sample whatsit resulting:
  4057. % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}}
  4058. %
  4059. % So:
  4060. \let\endinput = \empty
  4061. %
  4062. % Do the redefinitions.
  4063. \commondummies
  4064. }
  4065. % For the aux and toc files, @ is the escape character. So we want to
  4066. % redefine everything using @ as the escape character (instead of
  4067. % \realbackslash, still used for index files). When everything uses @,
  4068. % this will be simpler.
  4069. %
  4070. \def\atdummies{%
  4071. \def\@{@@}%
  4072. \def\ {@ }%
  4073. \let\{ = \lbraceatcmd
  4074. \let\} = \rbraceatcmd
  4075. %
  4076. % Do the redefinitions.
  4077. \commondummies
  4078. \otherbackslash
  4079. }
  4080. % Called from \indexdummies and \atdummies.
  4081. %
  4082. \def\commondummies{%
  4083. %
  4084. % \definedummyword defines \#1 as \string\#1\space, thus effectively
  4085. % preventing its expansion. This is used only for control words,
  4086. % not control letters, because the \space would be incorrect for
  4087. % control characters, but is needed to separate the control word
  4088. % from whatever follows.
  4089. %
  4090. % For control letters, we have \definedummyletter, which omits the
  4091. % space.
  4092. %
  4093. % These can be used both for control words that take an argument and
  4094. % those that do not. If it is followed by {arg} in the input, then
  4095. % that will dutifully get written to the index (or wherever).
  4096. %
  4097. \def\definedummyword ##1{\def##1{\string##1\space}}%
  4098. \def\definedummyletter##1{\def##1{\string##1}}%
  4099. \let\definedummyaccent\definedummyletter
  4100. %
  4101. \commondummiesnofonts
  4102. %
  4103. \definedummyletter\_%
  4104. \definedummyletter\-%
  4105. %
  4106. % Non-English letters.
  4107. \definedummyword\AA
  4108. \definedummyword\AE
  4109. \definedummyword\DH
  4110. \definedummyword\L
  4111. \definedummyword\O
  4112. \definedummyword\OE
  4113. \definedummyword\TH
  4114. \definedummyword\aa
  4115. \definedummyword\ae
  4116. \definedummyword\dh
  4117. \definedummyword\exclamdown
  4118. \definedummyword\l
  4119. \definedummyword\o
  4120. \definedummyword\oe
  4121. \definedummyword\ordf
  4122. \definedummyword\ordm
  4123. \definedummyword\questiondown
  4124. \definedummyword\ss
  4125. \definedummyword\th
  4126. %
  4127. % Although these internal commands shouldn't show up, sometimes they do.
  4128. \definedummyword\bf
  4129. \definedummyword\gtr
  4130. \definedummyword\hat
  4131. \definedummyword\less
  4132. \definedummyword\sf
  4133. \definedummyword\sl
  4134. \definedummyword\tclose
  4135. \definedummyword\tt
  4136. %
  4137. \definedummyword\LaTeX
  4138. \definedummyword\TeX
  4139. %
  4140. % Assorted special characters.
  4141. \definedummyword\arrow
  4142. \definedummyword\bullet
  4143. \definedummyword\comma
  4144. \definedummyword\copyright
  4145. \definedummyword\registeredsymbol
  4146. \definedummyword\dots
  4147. \definedummyword\enddots
  4148. \definedummyword\entrybreak
  4149. \definedummyword\equiv
  4150. \definedummyword\error
  4151. \definedummyword\euro
  4152. \definedummyword\expansion
  4153. \definedummyword\geq
  4154. \definedummyword\guillemetleft
  4155. \definedummyword\guillemetright
  4156. \definedummyword\guilsinglleft
  4157. \definedummyword\guilsinglright
  4158. \definedummyword\lbracechar
  4159. \definedummyword\leq
  4160. \definedummyword\minus
  4161. \definedummyword\ogonek
  4162. \definedummyword\pounds
  4163. \definedummyword\point
  4164. \definedummyword\print
  4165. \definedummyword\quotedblbase
  4166. \definedummyword\quotedblleft
  4167. \definedummyword\quotedblright
  4168. \definedummyword\quoteleft
  4169. \definedummyword\quoteright
  4170. \definedummyword\quotesinglbase
  4171. \definedummyword\rbracechar
  4172. \definedummyword\result
  4173. \definedummyword\textdegree
  4174. %
  4175. % We want to disable all macros so that they are not expanded by \write.
  4176. \macrolist
  4177. %
  4178. \normalturnoffactive
  4179. %
  4180. % Handle some cases of @value -- where it does not contain any
  4181. % (non-fully-expandable) commands.
  4182. \makevalueexpandable
  4183. }
  4184. % \commondummiesnofonts: common to \commondummies and \indexnofonts.
  4185. %
  4186. \def\commondummiesnofonts{%
  4187. % Control letters and accents.
  4188. \definedummyletter\!%
  4189. \definedummyaccent\"%
  4190. \definedummyaccent\'%
  4191. \definedummyletter\*%
  4192. \definedummyaccent\,%
  4193. \definedummyletter\.%
  4194. \definedummyletter\/%
  4195. \definedummyletter\:%
  4196. \definedummyaccent\=%
  4197. \definedummyletter\?%
  4198. \definedummyaccent\^%
  4199. \definedummyaccent\`%
  4200. \definedummyaccent\~%
  4201. \definedummyword\u
  4202. \definedummyword\v
  4203. \definedummyword\H
  4204. \definedummyword\dotaccent
  4205. \definedummyword\ogonek
  4206. \definedummyword\ringaccent
  4207. \definedummyword\tieaccent
  4208. \definedummyword\ubaraccent
  4209. \definedummyword\udotaccent
  4210. \definedummyword\dotless
  4211. %
  4212. % Texinfo font commands.
  4213. \definedummyword\b
  4214. \definedummyword\i
  4215. \definedummyword\r
  4216. \definedummyword\sansserif
  4217. \definedummyword\sc
  4218. \definedummyword\slanted
  4219. \definedummyword\t
  4220. %
  4221. % Commands that take arguments.
  4222. \definedummyword\abbr
  4223. \definedummyword\acronym
  4224. \definedummyword\anchor
  4225. \definedummyword\cite
  4226. \definedummyword\code
  4227. \definedummyword\command
  4228. \definedummyword\dfn
  4229. \definedummyword\dmn
  4230. \definedummyword\email
  4231. \definedummyword\emph
  4232. \definedummyword\env
  4233. \definedummyword\file
  4234. \definedummyword\image
  4235. \definedummyword\indicateurl
  4236. \definedummyword\inforef
  4237. \definedummyword\kbd
  4238. \definedummyword\key
  4239. \definedummyword\math
  4240. \definedummyword\option
  4241. \definedummyword\pxref
  4242. \definedummyword\ref
  4243. \definedummyword\samp
  4244. \definedummyword\strong
  4245. \definedummyword\tie
  4246. \definedummyword\uref
  4247. \definedummyword\url
  4248. \definedummyword\var
  4249. \definedummyword\verb
  4250. \definedummyword\w
  4251. \definedummyword\xref
  4252. }
  4253. % \indexnofonts is used when outputting the strings to sort the index
  4254. % by, and when constructing control sequence names. It eliminates all
  4255. % control sequences and just writes whatever the best ASCII sort string
  4256. % would be for a given command (usually its argument).
  4257. %
  4258. \def\indexnofonts{%
  4259. % Accent commands should become @asis.
  4260. \def\definedummyaccent##1{\let##1\asis}%
  4261. % We can just ignore other control letters.
  4262. \def\definedummyletter##1{\let##1\empty}%
  4263. % All control words become @asis by default; overrides below.
  4264. \let\definedummyword\definedummyaccent
  4265. %
  4266. \commondummiesnofonts
  4267. %
  4268. % Don't no-op \tt, since it isn't a user-level command
  4269. % and is used in the definitions of the active chars like <, >, |, etc.
  4270. % Likewise with the other plain tex font commands.
  4271. %\let\tt=\asis
  4272. %
  4273. \def\ { }%
  4274. \def\@{@}%
  4275. \def\_{\normalunderscore}%
  4276. \def\-{}% @- shouldn't affect sorting
  4277. %
  4278. % Unfortunately, texindex is not prepared to handle braces in the
  4279. % content at all. So for index sorting, we map @{ and @} to strings
  4280. % starting with |, since that ASCII character is between ASCII { and }.
  4281. \def\{{|a}%
  4282. \def\lbracechar{|a}%
  4283. %
  4284. \def\}{|b}%
  4285. \def\rbracechar{|b}%
  4286. %
  4287. % Non-English letters.
  4288. \def\AA{AA}%
  4289. \def\AE{AE}%
  4290. \def\DH{DZZ}%
  4291. \def\L{L}%
  4292. \def\OE{OE}%
  4293. \def\O{O}%
  4294. \def\TH{ZZZ}%
  4295. \def\aa{aa}%
  4296. \def\ae{ae}%
  4297. \def\dh{dzz}%
  4298. \def\exclamdown{!}%
  4299. \def\l{l}%
  4300. \def\oe{oe}%
  4301. \def\ordf{a}%
  4302. \def\ordm{o}%
  4303. \def\o{o}%
  4304. \def\questiondown{?}%
  4305. \def\ss{ss}%
  4306. \def\th{zzz}%
  4307. %
  4308. \def\LaTeX{LaTeX}%
  4309. \def\TeX{TeX}%
  4310. %
  4311. % Assorted special characters.
  4312. % (The following {} will end up in the sort string, but that's ok.)
  4313. \def\arrow{->}%
  4314. \def\bullet{bullet}%
  4315. \def\comma{,}%
  4316. \def\copyright{copyright}%
  4317. \def\dots{...}%
  4318. \def\enddots{...}%
  4319. \def\equiv{==}%
  4320. \def\error{error}%
  4321. \def\euro{euro}%
  4322. \def\expansion{==>}%
  4323. \def\geq{>=}%
  4324. \def\guillemetleft{<<}%
  4325. \def\guillemetright{>>}%
  4326. \def\guilsinglleft{<}%
  4327. \def\guilsinglright{>}%
  4328. \def\leq{<=}%
  4329. \def\minus{-}%
  4330. \def\point{.}%
  4331. \def\pounds{pounds}%
  4332. \def\print{-|}%
  4333. \def\quotedblbase{"}%
  4334. \def\quotedblleft{"}%
  4335. \def\quotedblright{"}%
  4336. \def\quoteleft{`}%
  4337. \def\quoteright{'}%
  4338. \def\quotesinglbase{,}%
  4339. \def\registeredsymbol{R}%
  4340. \def\result{=>}%
  4341. \def\textdegree{o}%
  4342. %
  4343. \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax
  4344. \else \indexlquoteignore \fi
  4345. %
  4346. % We need to get rid of all macros, leaving only the arguments (if present).
  4347. % Of course this is not nearly correct, but it is the best we can do for now.
  4348. % makeinfo does not expand macros in the argument to @deffn, which ends up
  4349. % writing an index entry, and texindex isn't prepared for an index sort entry
  4350. % that starts with \.
  4351. %
  4352. % Since macro invocations are followed by braces, we can just redefine them
  4353. % to take a single TeX argument. The case of a macro invocation that
  4354. % goes to end-of-line is not handled.
  4355. %
  4356. \macrolist
  4357. }
  4358. % Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us
  4359. % ignore left quotes in the sort term.
  4360. {\catcode`\`=\active
  4361. \gdef\indexlquoteignore{\let`=\empty}}
  4362. \let\indexbackslash=0 %overridden during \printindex.
  4363. \let\SETmarginindex=\relax % put index entries in margin (undocumented)?
  4364. % Most index entries go through here, but \dosubind is the general case.
  4365. % #1 is the index name, #2 is the entry text.
  4366. \def\doind#1#2{\dosubind{#1}{#2}{}}
  4367. % Workhorse for all \fooindexes.
  4368. % #1 is name of index, #2 is stuff to put there, #3 is subentry --
  4369. % empty if called from \doind, as we usually are (the main exception
  4370. % is with most defuns, which call us directly).
  4371. %
  4372. \def\dosubind#1#2#3{%
  4373. \iflinks
  4374. {%
  4375. % Store the main index entry text (including the third arg).
  4376. \toks0 = {#2}%
  4377. % If third arg is present, precede it with a space.
  4378. \def\thirdarg{#3}%
  4379. \ifx\thirdarg\empty \else
  4380. \toks0 = \expandafter{\the\toks0 \space #3}%
  4381. \fi
  4382. %
  4383. \edef\writeto{\csname#1indfile\endcsname}%
  4384. %
  4385. \safewhatsit\dosubindwrite
  4386. }%
  4387. \fi
  4388. }
  4389. % Write the entry in \toks0 to the index file:
  4390. %
  4391. \def\dosubindwrite{%
  4392. % Put the index entry in the margin if desired.
  4393. \ifx\SETmarginindex\relax\else
  4394. \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}%
  4395. \fi
  4396. %
  4397. % Remember, we are within a group.
  4398. \indexdummies % Must do this here, since \bf, etc expand at this stage
  4399. \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now
  4400. % so it will be output as is; and it will print as backslash.
  4401. %
  4402. % Process the index entry with all font commands turned off, to
  4403. % get the string to sort by.
  4404. {\indexnofonts
  4405. \edef\temp{\the\toks0}% need full expansion
  4406. \xdef\indexsorttmp{\temp}%
  4407. }%
  4408. %
  4409. % Set up the complete index entry, with both the sort key and
  4410. % the original text, including any font commands. We write
  4411. % three arguments to \entry to the .?? file (four in the
  4412. % subentry case), texindex reduces to two when writing the .??s
  4413. % sorted result.
  4414. \edef\temp{%
  4415. \write\writeto{%
  4416. \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}%
  4417. }%
  4418. \temp
  4419. }
  4420. % Take care of unwanted page breaks/skips around a whatsit:
  4421. %
  4422. % If a skip is the last thing on the list now, preserve it
  4423. % by backing up by \lastskip, doing the \write, then inserting
  4424. % the skip again. Otherwise, the whatsit generated by the
  4425. % \write or \pdfdest will make \lastskip zero. The result is that
  4426. % sequences like this:
  4427. % @end defun
  4428. % @tindex whatever
  4429. % @defun ...
  4430. % will have extra space inserted, because the \medbreak in the
  4431. % start of the @defun won't see the skip inserted by the @end of
  4432. % the previous defun.
  4433. %
  4434. % But don't do any of this if we're not in vertical mode. We
  4435. % don't want to do a \vskip and prematurely end a paragraph.
  4436. %
  4437. % Avoid page breaks due to these extra skips, too.
  4438. %
  4439. % But wait, there is a catch there:
  4440. % We'll have to check whether \lastskip is zero skip. \ifdim is not
  4441. % sufficient for this purpose, as it ignores stretch and shrink parts
  4442. % of the skip. The only way seems to be to check the textual
  4443. % representation of the skip.
  4444. %
  4445. % The following is almost like \def\zeroskipmacro{0.0pt} except that
  4446. % the ``p'' and ``t'' characters have catcode \other, not 11 (letter).
  4447. %
  4448. \edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname}
  4449. %
  4450. \newskip\whatsitskip
  4451. \newcount\whatsitpenalty
  4452. %
  4453. % ..., ready, GO:
  4454. %
  4455. \def\safewhatsit#1{\ifhmode
  4456. #1%
  4457. \else
  4458. % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
  4459. \whatsitskip = \lastskip
  4460. \edef\lastskipmacro{\the\lastskip}%
  4461. \whatsitpenalty = \lastpenalty
  4462. %
  4463. % If \lastskip is nonzero, that means the last item was a
  4464. % skip. And since a skip is discardable, that means this
  4465. % -\whatsitskip glue we're inserting is preceded by a
  4466. % non-discardable item, therefore it is not a potential
  4467. % breakpoint, therefore no \nobreak needed.
  4468. \ifx\lastskipmacro\zeroskipmacro
  4469. \else
  4470. \vskip-\whatsitskip
  4471. \fi
  4472. %
  4473. #1%
  4474. %
  4475. \ifx\lastskipmacro\zeroskipmacro
  4476. % If \lastskip was zero, perhaps the last item was a penalty, and
  4477. % perhaps it was >=10000, e.g., a \nobreak. In that case, we want
  4478. % to re-insert the same penalty (values >10000 are used for various
  4479. % signals); since we just inserted a non-discardable item, any
  4480. % following glue (such as a \parskip) would be a breakpoint. For example:
  4481. % @deffn deffn-whatever
  4482. % @vindex index-whatever
  4483. % Description.
  4484. % would allow a break between the index-whatever whatsit
  4485. % and the "Description." paragraph.
  4486. \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi
  4487. \else
  4488. % On the other hand, if we had a nonzero \lastskip,
  4489. % this make-up glue would be preceded by a non-discardable item
  4490. % (the whatsit from the \write), so we must insert a \nobreak.
  4491. \nobreak\vskip\whatsitskip
  4492. \fi
  4493. \fi}
  4494. % The index entry written in the file actually looks like
  4495. % \entry {sortstring}{page}{topic}
  4496. % or
  4497. % \entry {sortstring}{page}{topic}{subtopic}
  4498. % The texindex program reads in these files and writes files
  4499. % containing these kinds of lines:
  4500. % \initial {c}
  4501. % before the first topic whose initial is c
  4502. % \entry {topic}{pagelist}
  4503. % for a topic that is used without subtopics
  4504. % \primary {topic}
  4505. % for the beginning of a topic that is used with subtopics
  4506. % \secondary {subtopic}{pagelist}
  4507. % for each subtopic.
  4508. % Define the user-accessible indexing commands
  4509. % @findex, @vindex, @kindex, @cindex.
  4510. \def\findex {\fnindex}
  4511. \def\kindex {\kyindex}
  4512. \def\cindex {\cpindex}
  4513. \def\vindex {\vrindex}
  4514. \def\tindex {\tpindex}
  4515. \def\pindex {\pgindex}
  4516. \def\cindexsub {\begingroup\obeylines\cindexsub}
  4517. {\obeylines %
  4518. \gdef\cindexsub "#1" #2^^M{\endgroup %
  4519. \dosubind{cp}{#2}{#1}}}
  4520. % Define the macros used in formatting output of the sorted index material.
  4521. % @printindex causes a particular index (the ??s file) to get printed.
  4522. % It does not print any chapter heading (usually an @unnumbered).
  4523. %
  4524. \parseargdef\printindex{\begingroup
  4525. \dobreak \chapheadingskip{10000}%
  4526. %
  4527. \smallfonts \rm
  4528. \tolerance = 9500
  4529. \plainfrenchspacing
  4530. \everypar = {}% don't want the \kern\-parindent from indentation suppression.
  4531. %
  4532. % See if the index file exists and is nonempty.
  4533. % Change catcode of @ here so that if the index file contains
  4534. % \initial {@}
  4535. % as its first line, TeX doesn't complain about mismatched braces
  4536. % (because it thinks @} is a control sequence).
  4537. \catcode`\@ = 11
  4538. \openin 1 \jobname.#1s
  4539. \ifeof 1
  4540. % \enddoublecolumns gets confused if there is no text in the index,
  4541. % and it loses the chapter title and the aux file entries for the
  4542. % index. The easiest way to prevent this problem is to make sure
  4543. % there is some text.
  4544. \putwordIndexNonexistent
  4545. \else
  4546. %
  4547. % If the index file exists but is empty, then \openin leaves \ifeof
  4548. % false. We have to make TeX try to read something from the file, so
  4549. % it can discover if there is anything in it.
  4550. \read 1 to \temp
  4551. \ifeof 1
  4552. \putwordIndexIsEmpty
  4553. \else
  4554. % Index files are almost Texinfo source, but we use \ as the escape
  4555. % character. It would be better to use @, but that's too big a change
  4556. % to make right now.
  4557. \def\indexbackslash{\backslashcurfont}%
  4558. \catcode`\\ = 0
  4559. \escapechar = `\\
  4560. \begindoublecolumns
  4561. \input \jobname.#1s
  4562. \enddoublecolumns
  4563. \fi
  4564. \fi
  4565. \closein 1
  4566. \endgroup}
  4567. % These macros are used by the sorted index file itself.
  4568. % Change them to control the appearance of the index.
  4569. \def\initial#1{{%
  4570. % Some minor font changes for the special characters.
  4571. \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
  4572. %
  4573. % Remove any glue we may have, we'll be inserting our own.
  4574. \removelastskip
  4575. %
  4576. % We like breaks before the index initials, so insert a bonus.
  4577. \nobreak
  4578. \vskip 0pt plus 3\baselineskip
  4579. \penalty 0
  4580. \vskip 0pt plus -3\baselineskip
  4581. %
  4582. % Typeset the initial. Making this add up to a whole number of
  4583. % baselineskips increases the chance of the dots lining up from column
  4584. % to column. It still won't often be perfect, because of the stretch
  4585. % we need before each entry, but it's better.
  4586. %
  4587. % No shrink because it confuses \balancecolumns.
  4588. \vskip 1.67\baselineskip plus .5\baselineskip
  4589. \leftline{\secbf #1}%
  4590. % Do our best not to break after the initial.
  4591. \nobreak
  4592. \vskip .33\baselineskip plus .1\baselineskip
  4593. }}
  4594. % \entry typesets a paragraph consisting of the text (#1), dot leaders, and
  4595. % then page number (#2) flushed to the right margin. It is used for index
  4596. % and table of contents entries. The paragraph is indented by \leftskip.
  4597. %
  4598. % A straightforward implementation would start like this:
  4599. % \def\entry#1#2{...
  4600. % But this freezes the catcodes in the argument, and can cause problems to
  4601. % @code, which sets - active. This problem was fixed by a kludge---
  4602. % ``-'' was active throughout whole index, but this isn't really right.
  4603. % The right solution is to prevent \entry from swallowing the whole text.
  4604. % --kasal, 21nov03
  4605. \def\entry{%
  4606. \begingroup
  4607. %
  4608. % Start a new paragraph if necessary, so our assignments below can't
  4609. % affect previous text.
  4610. \par
  4611. %
  4612. % Do not fill out the last line with white space.
  4613. \parfillskip = 0in
  4614. %
  4615. % No extra space above this paragraph.
  4616. \parskip = 0in
  4617. %
  4618. % Do not prefer a separate line ending with a hyphen to fewer lines.
  4619. \finalhyphendemerits = 0
  4620. %
  4621. % \hangindent is only relevant when the entry text and page number
  4622. % don't both fit on one line. In that case, bob suggests starting the
  4623. % dots pretty far over on the line. Unfortunately, a large
  4624. % indentation looks wrong when the entry text itself is broken across
  4625. % lines. So we use a small indentation and put up with long leaders.
  4626. %
  4627. % \hangafter is reset to 1 (which is the value we want) at the start
  4628. % of each paragraph, so we need not do anything with that.
  4629. \hangindent = 2em
  4630. %
  4631. % When the entry text needs to be broken, just fill out the first line
  4632. % with blank space.
  4633. \rightskip = 0pt plus1fil
  4634. %
  4635. % A bit of stretch before each entry for the benefit of balancing
  4636. % columns.
  4637. \vskip 0pt plus1pt
  4638. %
  4639. % When reading the text of entry, convert explicit line breaks
  4640. % from @* into spaces. The user might give these in long section
  4641. % titles, for instance.
  4642. \def\*{\unskip\space\ignorespaces}%
  4643. \def\entrybreak{\hfil\break}%
  4644. %
  4645. % Swallow the left brace of the text (first parameter):
  4646. \afterassignment\doentry
  4647. \let\temp =
  4648. }
  4649. \def\entrybreak{\unskip\space\ignorespaces}%
  4650. \def\doentry{%
  4651. \bgroup % Instead of the swallowed brace.
  4652. \noindent
  4653. \aftergroup\finishentry
  4654. % And now comes the text of the entry.
  4655. }
  4656. \def\finishentry#1{%
  4657. % #1 is the page number.
  4658. %
  4659. % The following is kludged to not output a line of dots in the index if
  4660. % there are no page numbers. The next person who breaks this will be
  4661. % cursed by a Unix daemon.
  4662. \setbox\boxA = \hbox{#1}%
  4663. \ifdim\wd\boxA = 0pt
  4664. \ %
  4665. \else
  4666. %
  4667. % If we must, put the page number on a line of its own, and fill out
  4668. % this line with blank space. (The \hfil is overwhelmed with the
  4669. % fill leaders glue in \indexdotfill if the page number does fit.)
  4670. \hfil\penalty50
  4671. \null\nobreak\indexdotfill % Have leaders before the page number.
  4672. %
  4673. % The `\ ' here is removed by the implicit \unskip that TeX does as
  4674. % part of (the primitive) \par. Without it, a spurious underfull
  4675. % \hbox ensues.
  4676. \ifpdf
  4677. \pdfgettoks#1.%
  4678. \ \the\toksA
  4679. \else
  4680. \ #1%
  4681. \fi
  4682. \fi
  4683. \par
  4684. \endgroup
  4685. }
  4686. % Like plain.tex's \dotfill, except uses up at least 1 em.
  4687. \def\indexdotfill{\cleaders
  4688. \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill}
  4689. \def\primary #1{\line{#1\hfil}}
  4690. \newskip\secondaryindent \secondaryindent=0.5cm
  4691. \def\secondary#1#2{{%
  4692. \parfillskip=0in
  4693. \parskip=0in
  4694. \hangindent=1in
  4695. \hangafter=1
  4696. \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
  4697. \ifpdf
  4698. \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
  4699. \else
  4700. #2
  4701. \fi
  4702. \par
  4703. }}
  4704. % Define two-column mode, which we use to typeset indexes.
  4705. % Adapted from the TeXbook, page 416, which is to say,
  4706. % the manmac.tex format used to print the TeXbook itself.
  4707. \catcode`\@=11
  4708. \newbox\partialpage
  4709. \newdimen\doublecolumnhsize
  4710. \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
  4711. % Grab any single-column material above us.
  4712. \output = {%
  4713. %
  4714. % Here is a possibility not foreseen in manmac: if we accumulate a
  4715. % whole lot of material, we might end up calling this \output
  4716. % routine twice in a row (see the doublecol-lose test, which is
  4717. % essentially a couple of indexes with @setchapternewpage off). In
  4718. % that case we just ship out what is in \partialpage with the normal
  4719. % output routine. Generally, \partialpage will be empty when this
  4720. % runs and this will be a no-op. See the indexspread.tex test case.
  4721. \ifvoid\partialpage \else
  4722. \onepageout{\pagecontents\partialpage}%
  4723. \fi
  4724. %
  4725. \global\setbox\partialpage = \vbox{%
  4726. % Unvbox the main output page.
  4727. \unvbox\PAGE
  4728. \kern-\topskip \kern\baselineskip
  4729. }%
  4730. }%
  4731. \eject % run that output routine to set \partialpage
  4732. %
  4733. % Use the double-column output routine for subsequent pages.
  4734. \output = {\doublecolumnout}%
  4735. %
  4736. % Change the page size parameters. We could do this once outside this
  4737. % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
  4738. % format, but then we repeat the same computation. Repeating a couple
  4739. % of assignments once per index is clearly meaningless for the
  4740. % execution time, so we may as well do it in one place.
  4741. %
  4742. % First we halve the line length, less a little for the gutter between
  4743. % the columns. We compute the gutter based on the line length, so it
  4744. % changes automatically with the paper format. The magic constant
  4745. % below is chosen so that the gutter has the same value (well, +-<1pt)
  4746. % as it did when we hard-coded it.
  4747. %
  4748. % We put the result in a separate register, \doublecolumhsize, so we
  4749. % can restore it in \pagesofar, after \hsize itself has (potentially)
  4750. % been clobbered.
  4751. %
  4752. \doublecolumnhsize = \hsize
  4753. \advance\doublecolumnhsize by -.04154\hsize
  4754. \divide\doublecolumnhsize by 2
  4755. \hsize = \doublecolumnhsize
  4756. %
  4757. % Double the \vsize as well. (We don't need a separate register here,
  4758. % since nobody clobbers \vsize.)
  4759. \vsize = 2\vsize
  4760. }
  4761. % The double-column output routine for all double-column pages except
  4762. % the last.
  4763. %
  4764. \def\doublecolumnout{%
  4765. \splittopskip=\topskip \splitmaxdepth=\maxdepth
  4766. % Get the available space for the double columns -- the normal
  4767. % (undoubled) page height minus any material left over from the
  4768. % previous page.
  4769. \dimen@ = \vsize
  4770. \divide\dimen@ by 2
  4771. \advance\dimen@ by -\ht\partialpage
  4772. %
  4773. % box0 will be the left-hand column, box2 the right.
  4774. \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
  4775. \onepageout\pagesofar
  4776. \unvbox255
  4777. \penalty\outputpenalty
  4778. }
  4779. %
  4780. % Re-output the contents of the output page -- any previous material,
  4781. % followed by the two boxes we just split, in box0 and box2.
  4782. \def\pagesofar{%
  4783. \unvbox\partialpage
  4784. %
  4785. \hsize = \doublecolumnhsize
  4786. \wd0=\hsize \wd2=\hsize
  4787. \hbox to\pagewidth{\box0\hfil\box2}%
  4788. }
  4789. %
  4790. % All done with double columns.
  4791. \def\enddoublecolumns{%
  4792. % The following penalty ensures that the page builder is exercised
  4793. % _before_ we change the output routine. This is necessary in the
  4794. % following situation:
  4795. %
  4796. % The last section of the index consists only of a single entry.
  4797. % Before this section, \pagetotal is less than \pagegoal, so no
  4798. % break occurs before the last section starts. However, the last
  4799. % section, consisting of \initial and the single \entry, does not
  4800. % fit on the page and has to be broken off. Without the following
  4801. % penalty the page builder will not be exercised until \eject
  4802. % below, and by that time we'll already have changed the output
  4803. % routine to the \balancecolumns version, so the next-to-last
  4804. % double-column page will be processed with \balancecolumns, which
  4805. % is wrong: The two columns will go to the main vertical list, with
  4806. % the broken-off section in the recent contributions. As soon as
  4807. % the output routine finishes, TeX starts reconsidering the page
  4808. % break. The two columns and the broken-off section both fit on the
  4809. % page, because the two columns now take up only half of the page
  4810. % goal. When TeX sees \eject from below which follows the final
  4811. % section, it invokes the new output routine that we've set after
  4812. % \balancecolumns below; \onepageout will try to fit the two columns
  4813. % and the final section into the vbox of \pageheight (see
  4814. % \pagebody), causing an overfull box.
  4815. %
  4816. % Note that glue won't work here, because glue does not exercise the
  4817. % page builder, unlike penalties (see The TeXbook, pp. 280-281).
  4818. \penalty0
  4819. %
  4820. \output = {%
  4821. % Split the last of the double-column material. Leave it on the
  4822. % current page, no automatic page break.
  4823. \balancecolumns
  4824. %
  4825. % If we end up splitting too much material for the current page,
  4826. % though, there will be another page break right after this \output
  4827. % invocation ends. Having called \balancecolumns once, we do not
  4828. % want to call it again. Therefore, reset \output to its normal
  4829. % definition right away. (We hope \balancecolumns will never be
  4830. % called on to balance too much material, but if it is, this makes
  4831. % the output somewhat more palatable.)
  4832. \global\output = {\onepageout{\pagecontents\PAGE}}%
  4833. }%
  4834. \eject
  4835. \endgroup % started in \begindoublecolumns
  4836. %
  4837. % \pagegoal was set to the doubled \vsize above, since we restarted
  4838. % the current page. We're now back to normal single-column
  4839. % typesetting, so reset \pagegoal to the normal \vsize (after the
  4840. % \endgroup where \vsize got restored).
  4841. \pagegoal = \vsize
  4842. }
  4843. %
  4844. % Called at the end of the double column material.
  4845. \def\balancecolumns{%
  4846. \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
  4847. \dimen@ = \ht0
  4848. \advance\dimen@ by \topskip
  4849. \advance\dimen@ by-\baselineskip
  4850. \divide\dimen@ by 2 % target to split to
  4851. %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
  4852. \splittopskip = \topskip
  4853. % Loop until we get a decent breakpoint.
  4854. {%
  4855. \vbadness = 10000
  4856. \loop
  4857. \global\setbox3 = \copy0
  4858. \global\setbox1 = \vsplit3 to \dimen@
  4859. \ifdim\ht3>\dimen@
  4860. \global\advance\dimen@ by 1pt
  4861. \repeat
  4862. }%
  4863. %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
  4864. \setbox0=\vbox to\dimen@{\unvbox1}%
  4865. \setbox2=\vbox to\dimen@{\unvbox3}%
  4866. %
  4867. \pagesofar
  4868. }
  4869. \catcode`\@ = \other
  4870. \message{sectioning,}
  4871. % Chapters, sections, etc.
  4872. % Let's start with @part.
  4873. \outer\parseargdef\part{\partzzz{#1}}
  4874. \def\partzzz#1{%
  4875. \chapoddpage
  4876. \null
  4877. \vskip.3\vsize % move it down on the page a bit
  4878. \begingroup
  4879. \noindent \titlefonts\rmisbold #1\par % the text
  4880. \let\lastnode=\empty % no node to associate with
  4881. \writetocentry{part}{#1}{}% but put it in the toc
  4882. \headingsoff % no headline or footline on the part page
  4883. \chapoddpage
  4884. \endgroup
  4885. }
  4886. % \unnumberedno is an oxymoron. But we count the unnumbered
  4887. % sections so that we can refer to them unambiguously in the pdf
  4888. % outlines by their "section number". We avoid collisions with chapter
  4889. % numbers by starting them at 10000. (If a document ever has 10000
  4890. % chapters, we're in trouble anyway, I'm sure.)
  4891. \newcount\unnumberedno \unnumberedno = 10000
  4892. \newcount\chapno
  4893. \newcount\secno \secno=0
  4894. \newcount\subsecno \subsecno=0
  4895. \newcount\subsubsecno \subsubsecno=0
  4896. % This counter is funny since it counts through charcodes of letters A, B, ...
  4897. \newcount\appendixno \appendixno = `\@
  4898. %
  4899. % \def\appendixletter{\char\the\appendixno}
  4900. % We do the following ugly conditional instead of the above simple
  4901. % construct for the sake of pdftex, which needs the actual
  4902. % letter in the expansion, not just typeset.
  4903. %
  4904. \def\appendixletter{%
  4905. \ifnum\appendixno=`A A%
  4906. \else\ifnum\appendixno=`B B%
  4907. \else\ifnum\appendixno=`C C%
  4908. \else\ifnum\appendixno=`D D%
  4909. \else\ifnum\appendixno=`E E%
  4910. \else\ifnum\appendixno=`F F%
  4911. \else\ifnum\appendixno=`G G%
  4912. \else\ifnum\appendixno=`H H%
  4913. \else\ifnum\appendixno=`I I%
  4914. \else\ifnum\appendixno=`J J%
  4915. \else\ifnum\appendixno=`K K%
  4916. \else\ifnum\appendixno=`L L%
  4917. \else\ifnum\appendixno=`M M%
  4918. \else\ifnum\appendixno=`N N%
  4919. \else\ifnum\appendixno=`O O%
  4920. \else\ifnum\appendixno=`P P%
  4921. \else\ifnum\appendixno=`Q Q%
  4922. \else\ifnum\appendixno=`R R%
  4923. \else\ifnum\appendixno=`S S%
  4924. \else\ifnum\appendixno=`T T%
  4925. \else\ifnum\appendixno=`U U%
  4926. \else\ifnum\appendixno=`V V%
  4927. \else\ifnum\appendixno=`W W%
  4928. \else\ifnum\appendixno=`X X%
  4929. \else\ifnum\appendixno=`Y Y%
  4930. \else\ifnum\appendixno=`Z Z%
  4931. % The \the is necessary, despite appearances, because \appendixletter is
  4932. % expanded while writing the .toc file. \char\appendixno is not
  4933. % expandable, thus it is written literally, thus all appendixes come out
  4934. % with the same letter (or @) in the toc without it.
  4935. \else\char\the\appendixno
  4936. \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
  4937. \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
  4938. % Each @chapter defines these (using marks) as the number+name, number
  4939. % and name of the chapter. Page headings and footings can use
  4940. % these. @section does likewise.
  4941. \def\thischapter{}
  4942. \def\thischapternum{}
  4943. \def\thischaptername{}
  4944. \def\thissection{}
  4945. \def\thissectionnum{}
  4946. \def\thissectionname{}
  4947. \newcount\absseclevel % used to calculate proper heading level
  4948. \newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
  4949. % @raisesections: treat @section as chapter, @subsection as section, etc.
  4950. \def\raisesections{\global\advance\secbase by -1}
  4951. \let\up=\raisesections % original BFox name
  4952. % @lowersections: treat @chapter as section, @section as subsection, etc.
  4953. \def\lowersections{\global\advance\secbase by 1}
  4954. \let\down=\lowersections % original BFox name
  4955. % we only have subsub.
  4956. \chardef\maxseclevel = 3
  4957. %
  4958. % A numbered section within an unnumbered changes to unnumbered too.
  4959. % To achieve this, remember the "biggest" unnum. sec. we are currently in:
  4960. \chardef\unnlevel = \maxseclevel
  4961. %
  4962. % Trace whether the current chapter is an appendix or not:
  4963. % \chapheadtype is "N" or "A", unnumbered chapters are ignored.
  4964. \def\chapheadtype{N}
  4965. % Choose a heading macro
  4966. % #1 is heading type
  4967. % #2 is heading level
  4968. % #3 is text for heading
  4969. \def\genhead#1#2#3{%
  4970. % Compute the abs. sec. level:
  4971. \absseclevel=#2
  4972. \advance\absseclevel by \secbase
  4973. % Make sure \absseclevel doesn't fall outside the range:
  4974. \ifnum \absseclevel < 0
  4975. \absseclevel = 0
  4976. \else
  4977. \ifnum \absseclevel > 3
  4978. \absseclevel = 3
  4979. \fi
  4980. \fi
  4981. % The heading type:
  4982. \def\headtype{#1}%
  4983. \if \headtype U%
  4984. \ifnum \absseclevel < \unnlevel
  4985. \chardef\unnlevel = \absseclevel
  4986. \fi
  4987. \else
  4988. % Check for appendix sections:
  4989. \ifnum \absseclevel = 0
  4990. \edef\chapheadtype{\headtype}%
  4991. \else
  4992. \if \headtype A\if \chapheadtype N%
  4993. \errmessage{@appendix... within a non-appendix chapter}%
  4994. \fi\fi
  4995. \fi
  4996. % Check for numbered within unnumbered:
  4997. \ifnum \absseclevel > \unnlevel
  4998. \def\headtype{U}%
  4999. \else
  5000. \chardef\unnlevel = 3
  5001. \fi
  5002. \fi
  5003. % Now print the heading:
  5004. \if \headtype U%
  5005. \ifcase\absseclevel
  5006. \unnumberedzzz{#3}%
  5007. \or \unnumberedseczzz{#3}%
  5008. \or \unnumberedsubseczzz{#3}%
  5009. \or \unnumberedsubsubseczzz{#3}%
  5010. \fi
  5011. \else
  5012. \if \headtype A%
  5013. \ifcase\absseclevel
  5014. \appendixzzz{#3}%
  5015. \or \appendixsectionzzz{#3}%
  5016. \or \appendixsubseczzz{#3}%
  5017. \or \appendixsubsubseczzz{#3}%
  5018. \fi
  5019. \else
  5020. \ifcase\absseclevel
  5021. \chapterzzz{#3}%
  5022. \or \seczzz{#3}%
  5023. \or \numberedsubseczzz{#3}%
  5024. \or \numberedsubsubseczzz{#3}%
  5025. \fi
  5026. \fi
  5027. \fi
  5028. \suppressfirstparagraphindent
  5029. }
  5030. % an interface:
  5031. \def\numhead{\genhead N}
  5032. \def\apphead{\genhead A}
  5033. \def\unnmhead{\genhead U}
  5034. % @chapter, @appendix, @unnumbered. Increment top-level counter, reset
  5035. % all lower-level sectioning counters to zero.
  5036. %
  5037. % Also set \chaplevelprefix, which we prepend to @float sequence numbers
  5038. % (e.g., figures), q.v. By default (before any chapter), that is empty.
  5039. \let\chaplevelprefix = \empty
  5040. %
  5041. \outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz
  5042. \def\chapterzzz#1{%
  5043. % section resetting is \global in case the chapter is in a group, such
  5044. % as an @include file.
  5045. \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
  5046. \global\advance\chapno by 1
  5047. %
  5048. % Used for \float.
  5049. \gdef\chaplevelprefix{\the\chapno.}%
  5050. \resetallfloatnos
  5051. %
  5052. % \putwordChapter can contain complex things in translations.
  5053. \toks0=\expandafter{\putwordChapter}%
  5054. \message{\the\toks0 \space \the\chapno}%
  5055. %
  5056. % Write the actual heading.
  5057. \chapmacro{#1}{Ynumbered}{\the\chapno}%
  5058. %
  5059. % So @section and the like are numbered underneath this chapter.
  5060. \global\let\section = \numberedsec
  5061. \global\let\subsection = \numberedsubsec
  5062. \global\let\subsubsection = \numberedsubsubsec
  5063. }
  5064. \outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz
  5065. %
  5066. \def\appendixzzz#1{%
  5067. \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
  5068. \global\advance\appendixno by 1
  5069. \gdef\chaplevelprefix{\appendixletter.}%
  5070. \resetallfloatnos
  5071. %
  5072. % \putwordAppendix can contain complex things in translations.
  5073. \toks0=\expandafter{\putwordAppendix}%
  5074. \message{\the\toks0 \space \appendixletter}%
  5075. %
  5076. \chapmacro{#1}{Yappendix}{\appendixletter}%
  5077. %
  5078. \global\let\section = \appendixsec
  5079. \global\let\subsection = \appendixsubsec
  5080. \global\let\subsubsection = \appendixsubsubsec
  5081. }
  5082. % normally unnmhead0 calls unnumberedzzz:
  5083. \outer\parseargdef\unnumbered{\unnmhead0{#1}}
  5084. \def\unnumberedzzz#1{%
  5085. \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
  5086. \global\advance\unnumberedno by 1
  5087. %
  5088. % Since an unnumbered has no number, no prefix for figures.
  5089. \global\let\chaplevelprefix = \empty
  5090. \resetallfloatnos
  5091. %
  5092. % This used to be simply \message{#1}, but TeX fully expands the
  5093. % argument to \message. Therefore, if #1 contained @-commands, TeX
  5094. % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
  5095. % expanded @cite (which turns out to cause errors because \cite is meant
  5096. % to be executed, not expanded).
  5097. %
  5098. % Anyway, we don't want the fully-expanded definition of @cite to appear
  5099. % as a result of the \message, we just want `@cite' itself. We use
  5100. % \the<toks register> to achieve this: TeX expands \the<toks> only once,
  5101. % simply yielding the contents of <toks register>. (We also do this for
  5102. % the toc entries.)
  5103. \toks0 = {#1}%
  5104. \message{(\the\toks0)}%
  5105. %
  5106. \chapmacro{#1}{Ynothing}{\the\unnumberedno}%
  5107. %
  5108. \global\let\section = \unnumberedsec
  5109. \global\let\subsection = \unnumberedsubsec
  5110. \global\let\subsubsection = \unnumberedsubsubsec
  5111. }
  5112. % @centerchap is like @unnumbered, but the heading is centered.
  5113. \outer\parseargdef\centerchap{%
  5114. % Well, we could do the following in a group, but that would break
  5115. % an assumption that \chapmacro is called at the outermost level.
  5116. % Thus we are safer this way: --kasal, 24feb04
  5117. \let\centerparametersmaybe = \centerparameters
  5118. \unnmhead0{#1}%
  5119. \let\centerparametersmaybe = \relax
  5120. }
  5121. % @top is like @unnumbered.
  5122. \let\top\unnumbered
  5123. % Sections.
  5124. %
  5125. \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
  5126. \def\seczzz#1{%
  5127. \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
  5128. \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
  5129. }
  5130. % normally calls appendixsectionzzz:
  5131. \outer\parseargdef\appendixsection{\apphead1{#1}}
  5132. \def\appendixsectionzzz#1{%
  5133. \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
  5134. \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
  5135. }
  5136. \let\appendixsec\appendixsection
  5137. % normally calls unnumberedseczzz:
  5138. \outer\parseargdef\unnumberedsec{\unnmhead1{#1}}
  5139. \def\unnumberedseczzz#1{%
  5140. \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
  5141. \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
  5142. }
  5143. % Subsections.
  5144. %
  5145. % normally calls numberedsubseczzz:
  5146. \outer\parseargdef\numberedsubsec{\numhead2{#1}}
  5147. \def\numberedsubseczzz#1{%
  5148. \global\subsubsecno=0 \global\advance\subsecno by 1
  5149. \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
  5150. }
  5151. % normally calls appendixsubseczzz:
  5152. \outer\parseargdef\appendixsubsec{\apphead2{#1}}
  5153. \def\appendixsubseczzz#1{%
  5154. \global\subsubsecno=0 \global\advance\subsecno by 1
  5155. \sectionheading{#1}{subsec}{Yappendix}%
  5156. {\appendixletter.\the\secno.\the\subsecno}%
  5157. }
  5158. % normally calls unnumberedsubseczzz:
  5159. \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}}
  5160. \def\unnumberedsubseczzz#1{%
  5161. \global\subsubsecno=0 \global\advance\subsecno by 1
  5162. \sectionheading{#1}{subsec}{Ynothing}%
  5163. {\the\unnumberedno.\the\secno.\the\subsecno}%
  5164. }
  5165. % Subsubsections.
  5166. %
  5167. % normally numberedsubsubseczzz:
  5168. \outer\parseargdef\numberedsubsubsec{\numhead3{#1}}
  5169. \def\numberedsubsubseczzz#1{%
  5170. \global\advance\subsubsecno by 1
  5171. \sectionheading{#1}{subsubsec}{Ynumbered}%
  5172. {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
  5173. }
  5174. % normally appendixsubsubseczzz:
  5175. \outer\parseargdef\appendixsubsubsec{\apphead3{#1}}
  5176. \def\appendixsubsubseczzz#1{%
  5177. \global\advance\subsubsecno by 1
  5178. \sectionheading{#1}{subsubsec}{Yappendix}%
  5179. {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
  5180. }
  5181. % normally unnumberedsubsubseczzz:
  5182. \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}}
  5183. \def\unnumberedsubsubseczzz#1{%
  5184. \global\advance\subsubsecno by 1
  5185. \sectionheading{#1}{subsubsec}{Ynothing}%
  5186. {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}%
  5187. }
  5188. % These macros control what the section commands do, according
  5189. % to what kind of chapter we are in (ordinary, appendix, or unnumbered).
  5190. % Define them by default for a numbered chapter.
  5191. \let\section = \numberedsec
  5192. \let\subsection = \numberedsubsec
  5193. \let\subsubsection = \numberedsubsubsec
  5194. % Define @majorheading, @heading and @subheading
  5195. \def\majorheading{%
  5196. {\advance\chapheadingskip by 10pt \chapbreak }%
  5197. \parsearg\chapheadingzzz
  5198. }
  5199. \def\chapheading{\chapbreak \parsearg\chapheadingzzz}
  5200. \def\chapheadingzzz#1{%
  5201. \vbox{\chapfonts \raggedtitlesettings #1\par}%
  5202. \nobreak\bigskip \nobreak
  5203. \suppressfirstparagraphindent
  5204. }
  5205. % @heading, @subheading, @subsubheading.
  5206. \parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{}
  5207. \suppressfirstparagraphindent}
  5208. \parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{}
  5209. \suppressfirstparagraphindent}
  5210. \parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
  5211. \suppressfirstparagraphindent}
  5212. % These macros generate a chapter, section, etc. heading only
  5213. % (including whitespace, linebreaking, etc. around it),
  5214. % given all the information in convenient, parsed form.
  5215. % Args are the skip and penalty (usually negative)
  5216. \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
  5217. % Parameter controlling skip before chapter headings (if needed)
  5218. \newskip\chapheadingskip
  5219. % Define plain chapter starts, and page on/off switching for it.
  5220. \def\chapbreak{\dobreak \chapheadingskip {-4000}}
  5221. \def\chappager{\par\vfill\supereject}
  5222. % Because \domark is called before \chapoddpage, the filler page will
  5223. % get the headings for the next chapter, which is wrong. But we don't
  5224. % care -- we just disable all headings on the filler page.
  5225. \def\chapoddpage{%
  5226. \chappager
  5227. \ifodd\pageno \else
  5228. \begingroup
  5229. \headingsoff
  5230. \null
  5231. \chappager
  5232. \endgroup
  5233. \fi
  5234. }
  5235. \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
  5236. \def\CHAPPAGoff{%
  5237. \global\let\contentsalignmacro = \chappager
  5238. \global\let\pchapsepmacro=\chapbreak
  5239. \global\let\pagealignmacro=\chappager}
  5240. \def\CHAPPAGon{%
  5241. \global\let\contentsalignmacro = \chappager
  5242. \global\let\pchapsepmacro=\chappager
  5243. \global\let\pagealignmacro=\chappager
  5244. \global\def\HEADINGSon{\HEADINGSsingle}}
  5245. \def\CHAPPAGodd{%
  5246. \global\let\contentsalignmacro = \chapoddpage
  5247. \global\let\pchapsepmacro=\chapoddpage
  5248. \global\let\pagealignmacro=\chapoddpage
  5249. \global\def\HEADINGSon{\HEADINGSdouble}}
  5250. \CHAPPAGon
  5251. % Chapter opening.
  5252. %
  5253. % #1 is the text, #2 is the section type (Ynumbered, Ynothing,
  5254. % Yappendix, Yomitfromtoc), #3 the chapter number.
  5255. %
  5256. % To test against our argument.
  5257. \def\Ynothingkeyword{Ynothing}
  5258. \def\Yomitfromtockeyword{Yomitfromtoc}
  5259. \def\Yappendixkeyword{Yappendix}
  5260. %
  5261. \def\chapmacro#1#2#3{%
  5262. % Insert the first mark before the heading break (see notes for \domark).
  5263. \let\prevchapterdefs=\lastchapterdefs
  5264. \let\prevsectiondefs=\lastsectiondefs
  5265. \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
  5266. \gdef\thissection{}}%
  5267. %
  5268. \def\temptype{#2}%
  5269. \ifx\temptype\Ynothingkeyword
  5270. \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
  5271. \gdef\thischapter{\thischaptername}}%
  5272. \else\ifx\temptype\Yomitfromtockeyword
  5273. \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
  5274. \gdef\thischapter{}}%
  5275. \else\ifx\temptype\Yappendixkeyword
  5276. \toks0={#1}%
  5277. \xdef\lastchapterdefs{%
  5278. \gdef\noexpand\thischaptername{\the\toks0}%
  5279. \gdef\noexpand\thischapternum{\appendixletter}%
  5280. % \noexpand\putwordAppendix avoids expanding indigestible
  5281. % commands in some of the translations.
  5282. \gdef\noexpand\thischapter{\noexpand\putwordAppendix{}
  5283. \noexpand\thischapternum:
  5284. \noexpand\thischaptername}%
  5285. }%
  5286. \else
  5287. \toks0={#1}%
  5288. \xdef\lastchapterdefs{%
  5289. \gdef\noexpand\thischaptername{\the\toks0}%
  5290. \gdef\noexpand\thischapternum{\the\chapno}%
  5291. % \noexpand\putwordChapter avoids expanding indigestible
  5292. % commands in some of the translations.
  5293. \gdef\noexpand\thischapter{\noexpand\putwordChapter{}
  5294. \noexpand\thischapternum:
  5295. \noexpand\thischaptername}%
  5296. }%
  5297. \fi\fi\fi
  5298. %
  5299. % Output the mark. Pass it through \safewhatsit, to take care of
  5300. % the preceding space.
  5301. \safewhatsit\domark
  5302. %
  5303. % Insert the chapter heading break.
  5304. \pchapsepmacro
  5305. %
  5306. % Now the second mark, after the heading break. No break points
  5307. % between here and the heading.
  5308. \let\prevchapterdefs=\lastchapterdefs
  5309. \let\prevsectiondefs=\lastsectiondefs
  5310. \domark
  5311. %
  5312. {%
  5313. \chapfonts \rmisbold
  5314. %
  5315. % Have to define \lastsection before calling \donoderef, because the
  5316. % xref code eventually uses it. On the other hand, it has to be called
  5317. % after \pchapsepmacro, or the headline will change too soon.
  5318. \gdef\lastsection{#1}%
  5319. %
  5320. % Only insert the separating space if we have a chapter/appendix
  5321. % number, and don't print the unnumbered ``number''.
  5322. \ifx\temptype\Ynothingkeyword
  5323. \setbox0 = \hbox{}%
  5324. \def\toctype{unnchap}%
  5325. \else\ifx\temptype\Yomitfromtockeyword
  5326. \setbox0 = \hbox{}% contents like unnumbered, but no toc entry
  5327. \def\toctype{omit}%
  5328. \else\ifx\temptype\Yappendixkeyword
  5329. \setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
  5330. \def\toctype{app}%
  5331. \else
  5332. \setbox0 = \hbox{#3\enspace}%
  5333. \def\toctype{numchap}%
  5334. \fi\fi\fi
  5335. %
  5336. % Write the toc entry for this chapter. Must come before the
  5337. % \donoderef, because we include the current node name in the toc
  5338. % entry, and \donoderef resets it to empty.
  5339. \writetocentry{\toctype}{#1}{#3}%
  5340. %
  5341. % For pdftex, we have to write out the node definition (aka, make
  5342. % the pdfdest) after any page break, but before the actual text has
  5343. % been typeset. If the destination for the pdf outline is after the
  5344. % text, then jumping from the outline may wind up with the text not
  5345. % being visible, for instance under high magnification.
  5346. \donoderef{#2}%
  5347. %
  5348. % Typeset the actual heading.
  5349. \nobreak % Avoid page breaks at the interline glue.
  5350. \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe
  5351. \unhbox0 #1\par}%
  5352. }%
  5353. \nobreak\bigskip % no page break after a chapter title
  5354. \nobreak
  5355. }
  5356. % @centerchap -- centered and unnumbered.
  5357. \let\centerparametersmaybe = \relax
  5358. \def\centerparameters{%
  5359. \advance\rightskip by 3\rightskip
  5360. \leftskip = \rightskip
  5361. \parfillskip = 0pt
  5362. }
  5363. % I don't think this chapter style is supported any more, so I'm not
  5364. % updating it with the new noderef stuff. We'll see. --karl, 11aug03.
  5365. %
  5366. \def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
  5367. %
  5368. \def\unnchfopen #1{%
  5369. \chapoddpage
  5370. \vbox{\chapfonts \raggedtitlesettings #1\par}%
  5371. \nobreak\bigskip\nobreak
  5372. }
  5373. \def\chfopen #1#2{\chapoddpage {\chapfonts
  5374. \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
  5375. \par\penalty 5000 %
  5376. }
  5377. \def\centerchfopen #1{%
  5378. \chapoddpage
  5379. \vbox{\chapfonts \raggedtitlesettings \hfill #1\hfill}%
  5380. \nobreak\bigskip \nobreak
  5381. }
  5382. \def\CHAPFopen{%
  5383. \global\let\chapmacro=\chfopen
  5384. \global\let\centerchapmacro=\centerchfopen}
  5385. % Section titles. These macros combine the section number parts and
  5386. % call the generic \sectionheading to do the printing.
  5387. %
  5388. \newskip\secheadingskip
  5389. \def\secheadingbreak{\dobreak \secheadingskip{-1000}}
  5390. % Subsection titles.
  5391. \newskip\subsecheadingskip
  5392. \def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}}
  5393. % Subsubsection titles.
  5394. \def\subsubsecheadingskip{\subsecheadingskip}
  5395. \def\subsubsecheadingbreak{\subsecheadingbreak}
  5396. % Print any size, any type, section title.
  5397. %
  5398. % #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is
  5399. % the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the
  5400. % section number.
  5401. %
  5402. \def\seckeyword{sec}
  5403. %
  5404. \def\sectionheading#1#2#3#4{%
  5405. {%
  5406. \checkenv{}% should not be in an environment.
  5407. %
  5408. % Switch to the right set of fonts.
  5409. \csname #2fonts\endcsname \rmisbold
  5410. %
  5411. \def\sectionlevel{#2}%
  5412. \def\temptype{#3}%
  5413. %
  5414. % Insert first mark before the heading break (see notes for \domark).
  5415. \let\prevsectiondefs=\lastsectiondefs
  5416. \ifx\temptype\Ynothingkeyword
  5417. \ifx\sectionlevel\seckeyword
  5418. \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
  5419. \gdef\thissection{\thissectionname}}%
  5420. \fi
  5421. \else\ifx\temptype\Yomitfromtockeyword
  5422. % Don't redefine \thissection.
  5423. \else\ifx\temptype\Yappendixkeyword
  5424. \ifx\sectionlevel\seckeyword
  5425. \toks0={#1}%
  5426. \xdef\lastsectiondefs{%
  5427. \gdef\noexpand\thissectionname{\the\toks0}%
  5428. \gdef\noexpand\thissectionnum{#4}%
  5429. % \noexpand\putwordSection avoids expanding indigestible
  5430. % commands in some of the translations.
  5431. \gdef\noexpand\thissection{\noexpand\putwordSection{}
  5432. \noexpand\thissectionnum:
  5433. \noexpand\thissectionname}%
  5434. }%
  5435. \fi
  5436. \else
  5437. \ifx\sectionlevel\seckeyword
  5438. \toks0={#1}%
  5439. \xdef\lastsectiondefs{%
  5440. \gdef\noexpand\thissectionname{\the\toks0}%
  5441. \gdef\noexpand\thissectionnum{#4}%
  5442. % \noexpand\putwordSection avoids expanding indigestible
  5443. % commands in some of the translations.
  5444. \gdef\noexpand\thissection{\noexpand\putwordSection{}
  5445. \noexpand\thissectionnum:
  5446. \noexpand\thissectionname}%
  5447. }%
  5448. \fi
  5449. \fi\fi\fi
  5450. %
  5451. % Go into vertical mode. Usually we'll already be there, but we
  5452. % don't want the following whatsit to end up in a preceding paragraph
  5453. % if the document didn't happen to have a blank line.
  5454. \par
  5455. %
  5456. % Output the mark. Pass it through \safewhatsit, to take care of
  5457. % the preceding space.
  5458. \safewhatsit\domark
  5459. %
  5460. % Insert space above the heading.
  5461. \csname #2headingbreak\endcsname
  5462. %
  5463. % Now the second mark, after the heading break. No break points
  5464. % between here and the heading.
  5465. \let\prevsectiondefs=\lastsectiondefs
  5466. \domark
  5467. %
  5468. % Only insert the space after the number if we have a section number.
  5469. \ifx\temptype\Ynothingkeyword
  5470. \setbox0 = \hbox{}%
  5471. \def\toctype{unn}%
  5472. \gdef\lastsection{#1}%
  5473. \else\ifx\temptype\Yomitfromtockeyword
  5474. % for @headings -- no section number, don't include in toc,
  5475. % and don't redefine \lastsection.
  5476. \setbox0 = \hbox{}%
  5477. \def\toctype{omit}%
  5478. \let\sectionlevel=\empty
  5479. \else\ifx\temptype\Yappendixkeyword
  5480. \setbox0 = \hbox{#4\enspace}%
  5481. \def\toctype{app}%
  5482. \gdef\lastsection{#1}%
  5483. \else
  5484. \setbox0 = \hbox{#4\enspace}%
  5485. \def\toctype{num}%
  5486. \gdef\lastsection{#1}%
  5487. \fi\fi\fi
  5488. %
  5489. % Write the toc entry (before \donoderef). See comments in \chapmacro.
  5490. \writetocentry{\toctype\sectionlevel}{#1}{#4}%
  5491. %
  5492. % Write the node reference (= pdf destination for pdftex).
  5493. % Again, see comments in \chapmacro.
  5494. \donoderef{#3}%
  5495. %
  5496. % Interline glue will be inserted when the vbox is completed.
  5497. % That glue will be a valid breakpoint for the page, since it'll be
  5498. % preceded by a whatsit (usually from the \donoderef, or from the
  5499. % \writetocentry if there was no node). We don't want to allow that
  5500. % break, since then the whatsits could end up on page n while the
  5501. % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000.
  5502. \nobreak
  5503. %
  5504. % Output the actual section heading.
  5505. \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
  5506. \hangindent=\wd0 % zero if no section number
  5507. \unhbox0 #1}%
  5508. }%
  5509. % Add extra space after the heading -- half of whatever came above it.
  5510. % Don't allow stretch, though.
  5511. \kern .5 \csname #2headingskip\endcsname
  5512. %
  5513. % Do not let the kern be a potential breakpoint, as it would be if it
  5514. % was followed by glue.
  5515. \nobreak
  5516. %
  5517. % We'll almost certainly start a paragraph next, so don't let that
  5518. % glue accumulate. (Not a breakpoint because it's preceded by a
  5519. % discardable item.) However, when a paragraph is not started next
  5520. % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out
  5521. % or the negative glue will cause weirdly wrong output, typically
  5522. % obscuring the section heading with something else.
  5523. \vskip-\parskip
  5524. %
  5525. % This is so the last item on the main vertical list is a known
  5526. % \penalty > 10000, so \startdefun, etc., can recognize the situation
  5527. % and do the needful.
  5528. \penalty 10001
  5529. }
  5530. \message{toc,}
  5531. % Table of contents.
  5532. \newwrite\tocfile
  5533. % Write an entry to the toc file, opening it if necessary.
  5534. % Called from @chapter, etc.
  5535. %
  5536. % Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno}
  5537. % We append the current node name (if any) and page number as additional
  5538. % arguments for the \{chap,sec,...}entry macros which will eventually
  5539. % read this. The node name is used in the pdf outlines as the
  5540. % destination to jump to.
  5541. %
  5542. % We open the .toc file for writing here instead of at @setfilename (or
  5543. % any other fixed time) so that @contents can be anywhere in the document.
  5544. % But if #1 is `omit', then we don't do anything. This is used for the
  5545. % table of contents chapter openings themselves.
  5546. %
  5547. \newif\iftocfileopened
  5548. \def\omitkeyword{omit}%
  5549. %
  5550. \def\writetocentry#1#2#3{%
  5551. \edef\writetoctype{#1}%
  5552. \ifx\writetoctype\omitkeyword \else
  5553. \iftocfileopened\else
  5554. \immediate\openout\tocfile = \jobname.toc
  5555. \global\tocfileopenedtrue
  5556. \fi
  5557. %
  5558. \iflinks
  5559. {\atdummies
  5560. \edef\temp{%
  5561. \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}%
  5562. \temp
  5563. }%
  5564. \fi
  5565. \fi
  5566. %
  5567. % Tell \shipout to create a pdf destination on each page, if we're
  5568. % writing pdf. These are used in the table of contents. We can't
  5569. % just write one on every page because the title pages are numbered
  5570. % 1 and 2 (the page numbers aren't printed), and so are the first
  5571. % two pages of the document. Thus, we'd have two destinations named
  5572. % `1', and two named `2'.
  5573. \ifpdf \global\pdfmakepagedesttrue \fi
  5574. }
  5575. % These characters do not print properly in the Computer Modern roman
  5576. % fonts, so we must take special care. This is more or less redundant
  5577. % with the Texinfo input format setup at the end of this file.
  5578. %
  5579. \def\activecatcodes{%
  5580. \catcode`\"=\active
  5581. \catcode`\$=\active
  5582. \catcode`\<=\active
  5583. \catcode`\>=\active
  5584. \catcode`\\=\active
  5585. \catcode`\^=\active
  5586. \catcode`\_=\active
  5587. \catcode`\|=\active
  5588. \catcode`\~=\active
  5589. }
  5590. % Read the toc file, which is essentially Texinfo input.
  5591. \def\readtocfile{%
  5592. \setupdatafile
  5593. \activecatcodes
  5594. \input \tocreadfilename
  5595. }
  5596. \newskip\contentsrightmargin \contentsrightmargin=1in
  5597. \newcount\savepageno
  5598. \newcount\lastnegativepageno \lastnegativepageno = -1
  5599. % Prepare to read what we've written to \tocfile.
  5600. %
  5601. \def\startcontents#1{%
  5602. % If @setchapternewpage on, and @headings double, the contents should
  5603. % start on an odd page, unlike chapters. Thus, we maintain
  5604. % \contentsalignmacro in parallel with \pagealignmacro.
  5605. % From: Torbjorn Granlund <tege@matematik.su.se>
  5606. \contentsalignmacro
  5607. \immediate\closeout\tocfile
  5608. %
  5609. % Don't need to put `Contents' or `Short Contents' in the headline.
  5610. % It is abundantly clear what they are.
  5611. \chapmacro{#1}{Yomitfromtoc}{}%
  5612. %
  5613. \savepageno = \pageno
  5614. \begingroup % Set up to handle contents files properly.
  5615. \raggedbottom % Worry more about breakpoints than the bottom.
  5616. \advance\hsize by -\contentsrightmargin % Don't use the full line length.
  5617. %
  5618. % Roman numerals for page numbers.
  5619. \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
  5620. }
  5621. % redefined for the two-volume lispref. We always output on
  5622. % \jobname.toc even if this is redefined.
  5623. %
  5624. \def\tocreadfilename{\jobname.toc}
  5625. % Normal (long) toc.
  5626. %
  5627. \def\contents{%
  5628. \startcontents{\putwordTOC}%
  5629. \openin 1 \tocreadfilename\space
  5630. \ifeof 1 \else
  5631. \readtocfile
  5632. \fi
  5633. \vfill \eject
  5634. \contentsalignmacro % in case @setchapternewpage odd is in effect
  5635. \ifeof 1 \else
  5636. \pdfmakeoutlines
  5637. \fi
  5638. \closein 1
  5639. \endgroup
  5640. \lastnegativepageno = \pageno
  5641. \global\pageno = \savepageno
  5642. }
  5643. % And just the chapters.
  5644. \def\summarycontents{%
  5645. \startcontents{\putwordShortTOC}%
  5646. %
  5647. \let\partentry = \shortpartentry
  5648. \let\numchapentry = \shortchapentry
  5649. \let\appentry = \shortchapentry
  5650. \let\unnchapentry = \shortunnchapentry
  5651. % We want a true roman here for the page numbers.
  5652. \secfonts
  5653. \let\rm=\shortcontrm \let\bf=\shortcontbf
  5654. \let\sl=\shortcontsl \let\tt=\shortconttt
  5655. \rm
  5656. \hyphenpenalty = 10000
  5657. \advance\baselineskip by 1pt % Open it up a little.
  5658. \def\numsecentry##1##2##3##4{}
  5659. \let\appsecentry = \numsecentry
  5660. \let\unnsecentry = \numsecentry
  5661. \let\numsubsecentry = \numsecentry
  5662. \let\appsubsecentry = \numsecentry
  5663. \let\unnsubsecentry = \numsecentry
  5664. \let\numsubsubsecentry = \numsecentry
  5665. \let\appsubsubsecentry = \numsecentry
  5666. \let\unnsubsubsecentry = \numsecentry
  5667. \openin 1 \tocreadfilename\space
  5668. \ifeof 1 \else
  5669. \readtocfile
  5670. \fi
  5671. \closein 1
  5672. \vfill \eject
  5673. \contentsalignmacro % in case @setchapternewpage odd is in effect
  5674. \endgroup
  5675. \lastnegativepageno = \pageno
  5676. \global\pageno = \savepageno
  5677. }
  5678. \let\shortcontents = \summarycontents
  5679. % Typeset the label for a chapter or appendix for the short contents.
  5680. % The arg is, e.g., `A' for an appendix, or `3' for a chapter.
  5681. %
  5682. \def\shortchaplabel#1{%
  5683. % This space should be enough, since a single number is .5em, and the
  5684. % widest letter (M) is 1em, at least in the Computer Modern fonts.
  5685. % But use \hss just in case.
  5686. % (This space doesn't include the extra space that gets added after
  5687. % the label; that gets put in by \shortchapentry above.)
  5688. %
  5689. % We'd like to right-justify chapter numbers, but that looks strange
  5690. % with appendix letters. And right-justifying numbers and
  5691. % left-justifying letters looks strange when there is less than 10
  5692. % chapters. Have to read the whole toc once to know how many chapters
  5693. % there are before deciding ...
  5694. \hbox to 1em{#1\hss}%
  5695. }
  5696. % These macros generate individual entries in the table of contents.
  5697. % The first argument is the chapter or section name.
  5698. % The last argument is the page number.
  5699. % The arguments in between are the chapter number, section number, ...
  5700. % Parts, in the main contents. Replace the part number, which doesn't
  5701. % exist, with an empty box. Let's hope all the numbers have the same width.
  5702. % Also ignore the page number, which is conventionally not printed.
  5703. \def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}}
  5704. \def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}}
  5705. %
  5706. % Parts, in the short toc.
  5707. \def\shortpartentry#1#2#3#4{%
  5708. \penalty-300
  5709. \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip
  5710. \shortchapentry{{\bf #1}}{\numeralbox}{}{}%
  5711. }
  5712. % Chapters, in the main contents.
  5713. \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
  5714. %
  5715. % Chapters, in the short toc.
  5716. % See comments in \dochapentry re vbox and related settings.
  5717. \def\shortchapentry#1#2#3#4{%
  5718. \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}%
  5719. }
  5720. % Appendices, in the main contents.
  5721. % Need the word Appendix, and a fixed-size box.
  5722. %
  5723. \def\appendixbox#1{%
  5724. % We use M since it's probably the widest letter.
  5725. \setbox0 = \hbox{\putwordAppendix{} M}%
  5726. \hbox to \wd0{\putwordAppendix{} #1\hss}}
  5727. %
  5728. \def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}}
  5729. % Unnumbered chapters.
  5730. \def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}
  5731. \def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}}
  5732. % Sections.
  5733. \def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}}
  5734. \let\appsecentry=\numsecentry
  5735. \def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}}
  5736. % Subsections.
  5737. \def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}}
  5738. \let\appsubsecentry=\numsubsecentry
  5739. \def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}
  5740. % And subsubsections.
  5741. \def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}}
  5742. \let\appsubsubsecentry=\numsubsubsecentry
  5743. \def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}}
  5744. % This parameter controls the indentation of the various levels.
  5745. % Same as \defaultparindent.
  5746. \newdimen\tocindent \tocindent = 15pt
  5747. % Now for the actual typesetting. In all these, #1 is the text and #2 is the
  5748. % page number.
  5749. %
  5750. % If the toc has to be broken over pages, we want it to be at chapters
  5751. % if at all possible; hence the \penalty.
  5752. \def\dochapentry#1#2{%
  5753. \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
  5754. \begingroup
  5755. \chapentryfonts
  5756. \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  5757. \endgroup
  5758. \nobreak\vskip .25\baselineskip plus.1\baselineskip
  5759. }
  5760. \def\dosecentry#1#2{\begingroup
  5761. \secentryfonts \leftskip=\tocindent
  5762. \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  5763. \endgroup}
  5764. \def\dosubsecentry#1#2{\begingroup
  5765. \subsecentryfonts \leftskip=2\tocindent
  5766. \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  5767. \endgroup}
  5768. \def\dosubsubsecentry#1#2{\begingroup
  5769. \subsubsecentryfonts \leftskip=3\tocindent
  5770. \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  5771. \endgroup}
  5772. % We use the same \entry macro as for the index entries.
  5773. \let\tocentry = \entry
  5774. % Space between chapter (or whatever) number and the title.
  5775. \def\labelspace{\hskip1em \relax}
  5776. \def\dopageno#1{{\rm #1}}
  5777. \def\doshortpageno#1{{\rm #1}}
  5778. \def\chapentryfonts{\secfonts \rm}
  5779. \def\secentryfonts{\textfonts}
  5780. \def\subsecentryfonts{\textfonts}
  5781. \def\subsubsecentryfonts{\textfonts}
  5782. \message{environments,}
  5783. % @foo ... @end foo.
  5784. % @tex ... @end tex escapes into raw TeX temporarily.
  5785. % One exception: @ is still an escape character, so that @end tex works.
  5786. % But \@ or @@ will get a plain @ character.
  5787. \envdef\tex{%
  5788. \setupmarkupstyle{tex}%
  5789. \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
  5790. \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
  5791. \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
  5792. \catcode `\%=14
  5793. \catcode `\+=\other
  5794. \catcode `\"=\other
  5795. \catcode `\|=\other
  5796. \catcode `\<=\other
  5797. \catcode `\>=\other
  5798. \catcode`\`=\other
  5799. \catcode`\'=\other
  5800. \escapechar=`\\
  5801. %
  5802. % ' is active in math mode (mathcode"8000). So reset it, and all our
  5803. % other math active characters (just in case), to plain's definitions.
  5804. \mathactive
  5805. %
  5806. \let\b=\ptexb
  5807. \let\bullet=\ptexbullet
  5808. \let\c=\ptexc
  5809. \let\,=\ptexcomma
  5810. \let\.=\ptexdot
  5811. \let\dots=\ptexdots
  5812. \let\equiv=\ptexequiv
  5813. \let\!=\ptexexclam
  5814. \let\i=\ptexi
  5815. \let\indent=\ptexindent
  5816. \let\noindent=\ptexnoindent
  5817. \let\{=\ptexlbrace
  5818. \let\+=\tabalign
  5819. \let\}=\ptexrbrace
  5820. \let\/=\ptexslash
  5821. \let\*=\ptexstar
  5822. \let\t=\ptext
  5823. \expandafter \let\csname top\endcsname=\ptextop % outer
  5824. \let\frenchspacing=\plainfrenchspacing
  5825. %
  5826. \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
  5827. \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
  5828. \def\@{@}%
  5829. }
  5830. % There is no need to define \Etex.
  5831. % Define @lisp ... @end lisp.
  5832. % @lisp environment forms a group so it can rebind things,
  5833. % including the definition of @end lisp (which normally is erroneous).
  5834. % Amount to narrow the margins by for @lisp.
  5835. \newskip\lispnarrowing \lispnarrowing=0.4in
  5836. % This is the definition that ^^M gets inside @lisp, @example, and other
  5837. % such environments. \null is better than a space, since it doesn't
  5838. % have any width.
  5839. \def\lisppar{\null\endgraf}
  5840. % This space is always present above and below environments.
  5841. \newskip\envskipamount \envskipamount = 0pt
  5842. % Make spacing and below environment symmetrical. We use \parskip here
  5843. % to help in doing that, since in @example-like environments \parskip
  5844. % is reset to zero; thus the \afterenvbreak inserts no space -- but the
  5845. % start of the next paragraph will insert \parskip.
  5846. %
  5847. \def\aboveenvbreak{{%
  5848. % =10000 instead of <10000 because of a special case in \itemzzz and
  5849. % \sectionheading, q.v.
  5850. \ifnum \lastpenalty=10000 \else
  5851. \advance\envskipamount by \parskip
  5852. \endgraf
  5853. \ifdim\lastskip<\envskipamount
  5854. \removelastskip
  5855. % it's not a good place to break if the last penalty was \nobreak
  5856. % or better ...
  5857. \ifnum\lastpenalty<10000 \penalty-50 \fi
  5858. \vskip\envskipamount
  5859. \fi
  5860. \fi
  5861. }}
  5862. \let\afterenvbreak = \aboveenvbreak
  5863. % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will
  5864. % also clear it, so that its embedded environments do the narrowing again.
  5865. \let\nonarrowing=\relax
  5866. % @cartouche ... @end cartouche: draw rectangle w/rounded corners around
  5867. % environment contents.
  5868. \font\circle=lcircle10
  5869. \newdimen\circthick
  5870. \newdimen\cartouter\newdimen\cartinner
  5871. \newskip\normbskip\newskip\normpskip\newskip\normlskip
  5872. \circthick=\fontdimen8\circle
  5873. %
  5874. \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
  5875. \def\ctr{{\hskip 6pt\circle\char'010}}
  5876. \def\cbl{{\circle\char'012\hskip -6pt}}
  5877. \def\cbr{{\hskip 6pt\circle\char'011}}
  5878. \def\carttop{\hbox to \cartouter{\hskip\lskip
  5879. \ctl\leaders\hrule height\circthick\hfil\ctr
  5880. \hskip\rskip}}
  5881. \def\cartbot{\hbox to \cartouter{\hskip\lskip
  5882. \cbl\leaders\hrule height\circthick\hfil\cbr
  5883. \hskip\rskip}}
  5884. %
  5885. \newskip\lskip\newskip\rskip
  5886. \envdef\cartouche{%
  5887. \ifhmode\par\fi % can't be in the midst of a paragraph.
  5888. \startsavinginserts
  5889. \lskip=\leftskip \rskip=\rightskip
  5890. \leftskip=0pt\rightskip=0pt % we want these *outside*.
  5891. \cartinner=\hsize \advance\cartinner by-\lskip
  5892. \advance\cartinner by-\rskip
  5893. \cartouter=\hsize
  5894. \advance\cartouter by 18.4pt % allow for 3pt kerns on either
  5895. % side, and for 6pt waste from
  5896. % each corner char, and rule thickness
  5897. \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
  5898. % Flag to tell @lisp, etc., not to narrow margin.
  5899. \let\nonarrowing = t%
  5900. %
  5901. % If this cartouche directly follows a sectioning command, we need the
  5902. % \parskip glue (backspaced over by default) or the cartouche can
  5903. % collide with the section heading.
  5904. \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi
  5905. %
  5906. \vbox\bgroup
  5907. \baselineskip=0pt\parskip=0pt\lineskip=0pt
  5908. \carttop
  5909. \hbox\bgroup
  5910. \hskip\lskip
  5911. \vrule\kern3pt
  5912. \vbox\bgroup
  5913. \kern3pt
  5914. \hsize=\cartinner
  5915. \baselineskip=\normbskip
  5916. \lineskip=\normlskip
  5917. \parskip=\normpskip
  5918. \vskip -\parskip
  5919. \comment % For explanation, see the end of def\group.
  5920. }
  5921. \def\Ecartouche{%
  5922. \ifhmode\par\fi
  5923. \kern3pt
  5924. \egroup
  5925. \kern3pt\vrule
  5926. \hskip\rskip
  5927. \egroup
  5928. \cartbot
  5929. \egroup
  5930. \checkinserts
  5931. }
  5932. % This macro is called at the beginning of all the @example variants,
  5933. % inside a group.
  5934. \newdimen\nonfillparindent
  5935. \def\nonfillstart{%
  5936. \aboveenvbreak
  5937. \hfuzz = 12pt % Don't be fussy
  5938. \sepspaces % Make spaces be word-separators rather than space tokens.
  5939. \let\par = \lisppar % don't ignore blank lines
  5940. \obeylines % each line of input is a line of output
  5941. \parskip = 0pt
  5942. % Turn off paragraph indentation but redefine \indent to emulate
  5943. % the normal \indent.
  5944. \nonfillparindent=\parindent
  5945. \parindent = 0pt
  5946. \let\indent\nonfillindent
  5947. %
  5948. \emergencystretch = 0pt % don't try to avoid overfull boxes
  5949. \ifx\nonarrowing\relax
  5950. \advance \leftskip by \lispnarrowing
  5951. \exdentamount=\lispnarrowing
  5952. \else
  5953. \let\nonarrowing = \relax
  5954. \fi
  5955. \let\exdent=\nofillexdent
  5956. }
  5957. \begingroup
  5958. \obeyspaces
  5959. % We want to swallow spaces (but not other tokens) after the fake
  5960. % @indent in our nonfill-environments, where spaces are normally
  5961. % active and set to @tie, resulting in them not being ignored after
  5962. % @indent.
  5963. \gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}%
  5964. \gdef\nonfillindentcheck{%
  5965. \ifx\temp %
  5966. \expandafter\nonfillindentgobble%
  5967. \else%
  5968. \leavevmode\nonfillindentbox%
  5969. \fi%
  5970. }%
  5971. \endgroup
  5972. \def\nonfillindentgobble#1{\nonfillindent}
  5973. \def\nonfillindentbox{\hbox to \nonfillparindent{\hss}}
  5974. % If you want all examples etc. small: @set dispenvsize small.
  5975. % If you want even small examples the full size: @set dispenvsize nosmall.
  5976. % This affects the following displayed environments:
  5977. % @example, @display, @format, @lisp
  5978. %
  5979. \def\smallword{small}
  5980. \def\nosmallword{nosmall}
  5981. \let\SETdispenvsize\relax
  5982. \def\setnormaldispenv{%
  5983. \ifx\SETdispenvsize\smallword
  5984. % end paragraph for sake of leading, in case document has no blank
  5985. % line. This is redundant with what happens in \aboveenvbreak, but
  5986. % we need to do it before changing the fonts, and it's inconvenient
  5987. % to change the fonts afterward.
  5988. \ifnum \lastpenalty=10000 \else \endgraf \fi
  5989. \smallexamplefonts \rm
  5990. \fi
  5991. }
  5992. \def\setsmalldispenv{%
  5993. \ifx\SETdispenvsize\nosmallword
  5994. \else
  5995. \ifnum \lastpenalty=10000 \else \endgraf \fi
  5996. \smallexamplefonts \rm
  5997. \fi
  5998. }
  5999. % We often define two environments, @foo and @smallfoo.
  6000. % Let's do it in one command. #1 is the env name, #2 the definition.
  6001. \def\makedispenvdef#1#2{%
  6002. \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}%
  6003. \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}%
  6004. \expandafter\let\csname E#1\endcsname \afterenvbreak
  6005. \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
  6006. }
  6007. % Define two environment synonyms (#1 and #2) for an environment.
  6008. \def\maketwodispenvdef#1#2#3{%
  6009. \makedispenvdef{#1}{#3}%
  6010. \makedispenvdef{#2}{#3}%
  6011. }
  6012. %
  6013. % @lisp: indented, narrowed, typewriter font;
  6014. % @example: same as @lisp.
  6015. %
  6016. % @smallexample and @smalllisp: use smaller fonts.
  6017. % Originally contributed by Pavel@xerox.
  6018. %
  6019. \maketwodispenvdef{lisp}{example}{%
  6020. \nonfillstart
  6021. \tt\setupmarkupstyle{example}%
  6022. \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
  6023. \gobble % eat return
  6024. }
  6025. % @display/@smalldisplay: same as @lisp except keep current font.
  6026. %
  6027. \makedispenvdef{display}{%
  6028. \nonfillstart
  6029. \gobble
  6030. }
  6031. % @format/@smallformat: same as @display except don't narrow margins.
  6032. %
  6033. \makedispenvdef{format}{%
  6034. \let\nonarrowing = t%
  6035. \nonfillstart
  6036. \gobble
  6037. }
  6038. % @flushleft: same as @format, but doesn't obey \SETdispenvsize.
  6039. \envdef\flushleft{%
  6040. \let\nonarrowing = t%
  6041. \nonfillstart
  6042. \gobble
  6043. }
  6044. \let\Eflushleft = \afterenvbreak
  6045. % @flushright.
  6046. %
  6047. \envdef\flushright{%
  6048. \let\nonarrowing = t%
  6049. \nonfillstart
  6050. \advance\leftskip by 0pt plus 1fill\relax
  6051. \gobble
  6052. }
  6053. \let\Eflushright = \afterenvbreak
  6054. % @raggedright does more-or-less normal line breaking but no right
  6055. % justification. From plain.tex.
  6056. \envdef\raggedright{%
  6057. \rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax
  6058. }
  6059. \let\Eraggedright\par
  6060. \envdef\raggedleft{%
  6061. \parindent=0pt \leftskip0pt plus2em
  6062. \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
  6063. \hbadness=10000 % Last line will usually be underfull, so turn off
  6064. % badness reporting.
  6065. }
  6066. \let\Eraggedleft\par
  6067. \envdef\raggedcenter{%
  6068. \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em
  6069. \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
  6070. \hbadness=10000 % Last line will usually be underfull, so turn off
  6071. % badness reporting.
  6072. }
  6073. \let\Eraggedcenter\par
  6074. % @quotation does normal linebreaking (hence we can't use \nonfillstart)
  6075. % and narrows the margins. We keep \parskip nonzero in general, since
  6076. % we're doing normal filling. So, when using \aboveenvbreak and
  6077. % \afterenvbreak, temporarily make \parskip 0.
  6078. %
  6079. \makedispenvdef{quotation}{\quotationstart}
  6080. %
  6081. \def\quotationstart{%
  6082. \indentedblockstart % same as \indentedblock, but increase right margin too.
  6083. \ifx\nonarrowing\relax
  6084. \advance\rightskip by \lispnarrowing
  6085. \fi
  6086. \parsearg\quotationlabel
  6087. }
  6088. % We have retained a nonzero parskip for the environment, since we're
  6089. % doing normal filling.
  6090. %
  6091. \def\Equotation{%
  6092. \par
  6093. \ifx\quotationauthor\thisisundefined\else
  6094. % indent a bit.
  6095. \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
  6096. \fi
  6097. {\parskip=0pt \afterenvbreak}%
  6098. }
  6099. \def\Esmallquotation{\Equotation}
  6100. % If we're given an argument, typeset it in bold with a colon after.
  6101. \def\quotationlabel#1{%
  6102. \def\temp{#1}%
  6103. \ifx\temp\empty \else
  6104. {\bf #1: }%
  6105. \fi
  6106. }
  6107. % @indentedblock is like @quotation, but indents only on the left and
  6108. % has no optional argument.
  6109. %
  6110. \makedispenvdef{indentedblock}{\indentedblockstart}
  6111. %
  6112. \def\indentedblockstart{%
  6113. {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
  6114. \parindent=0pt
  6115. %
  6116. % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
  6117. \ifx\nonarrowing\relax
  6118. \advance\leftskip by \lispnarrowing
  6119. \exdentamount = \lispnarrowing
  6120. \else
  6121. \let\nonarrowing = \relax
  6122. \fi
  6123. }
  6124. % Keep a nonzero parskip for the environment, since we're doing normal filling.
  6125. %
  6126. \def\Eindentedblock{%
  6127. \par
  6128. {\parskip=0pt \afterenvbreak}%
  6129. }
  6130. \def\Esmallindentedblock{\Eindentedblock}
  6131. % LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
  6132. % If we want to allow any <char> as delimiter,
  6133. % we need the curly braces so that makeinfo sees the @verb command, eg:
  6134. % `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
  6135. %
  6136. % [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
  6137. %
  6138. % [Knuth] p.344; only we need to do the other characters Texinfo sets
  6139. % active too. Otherwise, they get lost as the first character on a
  6140. % verbatim line.
  6141. \def\dospecials{%
  6142. \do\ \do\\\do\{\do\}\do\$\do\&%
  6143. \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
  6144. \do\<\do\>\do\|\do\@\do+\do\"%
  6145. % Don't do the quotes -- if we do, @set txicodequoteundirected and
  6146. % @set txicodequotebacktick will not have effect on @verb and
  6147. % @verbatim, and ?` and !` ligatures won't get disabled.
  6148. %\do\`\do\'%
  6149. }
  6150. %
  6151. % [Knuth] p. 380
  6152. \def\uncatcodespecials{%
  6153. \def\do##1{\catcode`##1=\other}\dospecials}
  6154. %
  6155. % Setup for the @verb command.
  6156. %
  6157. % Eight spaces for a tab
  6158. \begingroup
  6159. \catcode`\^^I=\active
  6160. \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
  6161. \endgroup
  6162. %
  6163. \def\setupverb{%
  6164. \tt % easiest (and conventionally used) font for verbatim
  6165. \def\par{\leavevmode\endgraf}%
  6166. \setupmarkupstyle{verb}%
  6167. \tabeightspaces
  6168. % Respect line breaks,
  6169. % print special symbols as themselves, and
  6170. % make each space count
  6171. % must do in this order:
  6172. \obeylines \uncatcodespecials \sepspaces
  6173. }
  6174. % Setup for the @verbatim environment
  6175. %
  6176. % Real tab expansion.
  6177. \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
  6178. %
  6179. % We typeset each line of the verbatim in an \hbox, so we can handle
  6180. % tabs. The \global is in case the verbatim line starts with an accent,
  6181. % or some other command that starts with a begin-group. Otherwise, the
  6182. % entire \verbbox would disappear at the corresponding end-group, before
  6183. % it is typeset. Meanwhile, we can't have nested verbatim commands
  6184. % (can we?), so the \global won't be overwriting itself.
  6185. \newbox\verbbox
  6186. \def\starttabbox{\global\setbox\verbbox=\hbox\bgroup}
  6187. %
  6188. \begingroup
  6189. \catcode`\^^I=\active
  6190. \gdef\tabexpand{%
  6191. \catcode`\^^I=\active
  6192. \def^^I{\leavevmode\egroup
  6193. \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab
  6194. \divide\dimen\verbbox by\tabw
  6195. \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw
  6196. \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw
  6197. \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox
  6198. }%
  6199. }
  6200. \endgroup
  6201. % start the verbatim environment.
  6202. \def\setupverbatim{%
  6203. \let\nonarrowing = t%
  6204. \nonfillstart
  6205. \tt % easiest (and conventionally used) font for verbatim
  6206. % The \leavevmode here is for blank lines. Otherwise, we would
  6207. % never \starttabox and the \egroup would end verbatim mode.
  6208. \def\par{\leavevmode\egroup\box\verbbox\endgraf}%
  6209. \tabexpand
  6210. \setupmarkupstyle{verbatim}%
  6211. % Respect line breaks,
  6212. % print special symbols as themselves, and
  6213. % make each space count.
  6214. % Must do in this order:
  6215. \obeylines \uncatcodespecials \sepspaces
  6216. \everypar{\starttabbox}%
  6217. }
  6218. % Do the @verb magic: verbatim text is quoted by unique
  6219. % delimiter characters. Before first delimiter expect a
  6220. % right brace, after last delimiter expect closing brace:
  6221. %
  6222. % \def\doverb'{'<char>#1<char>'}'{#1}
  6223. %
  6224. % [Knuth] p. 382; only eat outer {}
  6225. \begingroup
  6226. \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other
  6227. \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
  6228. \endgroup
  6229. %
  6230. \def\verb{\begingroup\setupverb\doverb}
  6231. %
  6232. %
  6233. % Do the @verbatim magic: define the macro \doverbatim so that
  6234. % the (first) argument ends when '@end verbatim' is reached, ie:
  6235. %
  6236. % \def\doverbatim#1@end verbatim{#1}
  6237. %
  6238. % For Texinfo it's a lot easier than for LaTeX,
  6239. % because texinfo's \verbatim doesn't stop at '\end{verbatim}':
  6240. % we need not redefine '\', '{' and '}'.
  6241. %
  6242. % Inspired by LaTeX's verbatim command set [latex.ltx]
  6243. %
  6244. \begingroup
  6245. \catcode`\ =\active
  6246. \obeylines %
  6247. % ignore everything up to the first ^^M, that's the newline at the end
  6248. % of the @verbatim input line itself. Otherwise we get an extra blank
  6249. % line in the output.
  6250. \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}%
  6251. % We really want {...\end verbatim} in the body of the macro, but
  6252. % without the active space; thus we have to use \xdef and \gobble.
  6253. \endgroup
  6254. %
  6255. \envdef\verbatim{%
  6256. \setupverbatim\doverbatim
  6257. }
  6258. \let\Everbatim = \afterenvbreak
  6259. % @verbatiminclude FILE - insert text of file in verbatim environment.
  6260. %
  6261. \def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude}
  6262. %
  6263. \def\doverbatiminclude#1{%
  6264. {%
  6265. \makevalueexpandable
  6266. \setupverbatim
  6267. \indexnofonts % Allow `@@' and other weird things in file names.
  6268. \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
  6269. \input #1
  6270. \afterenvbreak
  6271. }%
  6272. }
  6273. % @copying ... @end copying.
  6274. % Save the text away for @insertcopying later.
  6275. %
  6276. % We save the uninterpreted tokens, rather than creating a box.
  6277. % Saving the text in a box would be much easier, but then all the
  6278. % typesetting commands (@smallbook, font changes, etc.) have to be done
  6279. % beforehand -- and a) we want @copying to be done first in the source
  6280. % file; b) letting users define the frontmatter in as flexible order as
  6281. % possible is very desirable.
  6282. %
  6283. \def\copying{\checkenv{}\begingroup\scanargctxt\docopying}
  6284. \def\docopying#1@end copying{\endgroup\def\copyingtext{#1}}
  6285. %
  6286. \def\insertcopying{%
  6287. \begingroup
  6288. \parindent = 0pt % paragraph indentation looks wrong on title page
  6289. \scanexp\copyingtext
  6290. \endgroup
  6291. }
  6292. \message{defuns,}
  6293. % @defun etc.
  6294. \newskip\defbodyindent \defbodyindent=.4in
  6295. \newskip\defargsindent \defargsindent=50pt
  6296. \newskip\deflastargmargin \deflastargmargin=18pt
  6297. \newcount\defunpenalty
  6298. % Start the processing of @deffn:
  6299. \def\startdefun{%
  6300. \ifnum\lastpenalty<10000
  6301. \medbreak
  6302. \defunpenalty=10003 % Will keep this @deffn together with the
  6303. % following @def command, see below.
  6304. \else
  6305. % If there are two @def commands in a row, we'll have a \nobreak,
  6306. % which is there to keep the function description together with its
  6307. % header. But if there's nothing but headers, we need to allow a
  6308. % break somewhere. Check specifically for penalty 10002, inserted
  6309. % by \printdefunline, instead of 10000, since the sectioning
  6310. % commands also insert a nobreak penalty, and we don't want to allow
  6311. % a break between a section heading and a defun.
  6312. %
  6313. % As a further refinement, we avoid "club" headers by signalling
  6314. % with penalty of 10003 after the very first @deffn in the
  6315. % sequence (see above), and penalty of 10002 after any following
  6316. % @def command.
  6317. \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi
  6318. %
  6319. % Similarly, after a section heading, do not allow a break.
  6320. % But do insert the glue.
  6321. \medskip % preceded by discardable penalty, so not a breakpoint
  6322. \fi
  6323. %
  6324. \parindent=0in
  6325. \advance\leftskip by \defbodyindent
  6326. \exdentamount=\defbodyindent
  6327. }
  6328. \def\dodefunx#1{%
  6329. % First, check whether we are in the right environment:
  6330. \checkenv#1%
  6331. %
  6332. % As above, allow line break if we have multiple x headers in a row.
  6333. % It's not a great place, though.
  6334. \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi
  6335. %
  6336. % And now, it's time to reuse the body of the original defun:
  6337. \expandafter\gobbledefun#1%
  6338. }
  6339. \def\gobbledefun#1\startdefun{}
  6340. % \printdefunline \deffnheader{text}
  6341. %
  6342. \def\printdefunline#1#2{%
  6343. \begingroup
  6344. % call \deffnheader:
  6345. #1#2 \endheader
  6346. % common ending:
  6347. \interlinepenalty = 10000
  6348. \advance\rightskip by 0pt plus 1fil\relax
  6349. \endgraf
  6350. \nobreak\vskip -\parskip
  6351. \penalty\defunpenalty % signal to \startdefun and \dodefunx
  6352. % Some of the @defun-type tags do not enable magic parentheses,
  6353. % rendering the following check redundant. But we don't optimize.
  6354. \checkparencounts
  6355. \endgroup
  6356. }
  6357. \def\Edefun{\endgraf\medbreak}
  6358. % \makedefun{deffn} creates \deffn, \deffnx and \Edeffn;
  6359. % the only thing remaining is to define \deffnheader.
  6360. %
  6361. \def\makedefun#1{%
  6362. \expandafter\let\csname E#1\endcsname = \Edefun
  6363. \edef\temp{\noexpand\domakedefun
  6364. \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}%
  6365. \temp
  6366. }
  6367. % \domakedefun \deffn \deffnx \deffnheader
  6368. %
  6369. % Define \deffn and \deffnx, without parameters.
  6370. % \deffnheader has to be defined explicitly.
  6371. %
  6372. \def\domakedefun#1#2#3{%
  6373. \envdef#1{%
  6374. \startdefun
  6375. \doingtypefnfalse % distinguish typed functions from all else
  6376. \parseargusing\activeparens{\printdefunline#3}%
  6377. }%
  6378. \def#2{\dodefunx#1}%
  6379. \def#3%
  6380. }
  6381. \newif\ifdoingtypefn % doing typed function?
  6382. \newif\ifrettypeownline % typeset return type on its own line?
  6383. % @deftypefnnewline on|off says whether the return type of typed functions
  6384. % are printed on their own line. This affects @deftypefn, @deftypefun,
  6385. % @deftypeop, and @deftypemethod.
  6386. %
  6387. \parseargdef\deftypefnnewline{%
  6388. \def\temp{#1}%
  6389. \ifx\temp\onword
  6390. \expandafter\let\csname SETtxideftypefnnl\endcsname
  6391. = \empty
  6392. \else\ifx\temp\offword
  6393. \expandafter\let\csname SETtxideftypefnnl\endcsname
  6394. = \relax
  6395. \else
  6396. \errhelp = \EMsimple
  6397. \errmessage{Unknown @txideftypefnnl value `\temp',
  6398. must be on|off}%
  6399. \fi\fi
  6400. }
  6401. % Untyped functions:
  6402. % @deffn category name args
  6403. \makedefun{deffn}{\deffngeneral{}}
  6404. % @deffn category class name args
  6405. \makedefun{defop}#1 {\defopon{#1\ \putwordon}}
  6406. % \defopon {category on}class name args
  6407. \def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
  6408. % \deffngeneral {subind}category name args
  6409. %
  6410. \def\deffngeneral#1#2 #3 #4\endheader{%
  6411. % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}.
  6412. \dosubind{fn}{\code{#3}}{#1}%
  6413. \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
  6414. }
  6415. % Typed functions:
  6416. % @deftypefn category type name args
  6417. \makedefun{deftypefn}{\deftypefngeneral{}}
  6418. % @deftypeop category class type name args
  6419. \makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}}
  6420. % \deftypeopon {category on}class type name args
  6421. \def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
  6422. % \deftypefngeneral {subind}category type name args
  6423. %
  6424. \def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
  6425. \dosubind{fn}{\code{#4}}{#1}%
  6426. \doingtypefntrue
  6427. \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
  6428. }
  6429. % Typed variables:
  6430. % @deftypevr category type var args
  6431. \makedefun{deftypevr}{\deftypecvgeneral{}}
  6432. % @deftypecv category class type var args
  6433. \makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}}
  6434. % \deftypecvof {category of}class type var args
  6435. \def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} }
  6436. % \deftypecvgeneral {subind}category type var args
  6437. %
  6438. \def\deftypecvgeneral#1#2 #3 #4 #5\endheader{%
  6439. \dosubind{vr}{\code{#4}}{#1}%
  6440. \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
  6441. }
  6442. % Untyped variables:
  6443. % @defvr category var args
  6444. \makedefun{defvr}#1 {\deftypevrheader{#1} {} }
  6445. % @defcv category class var args
  6446. \makedefun{defcv}#1 {\defcvof{#1\ \putwordof}}
  6447. % \defcvof {category of}class var args
  6448. \def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
  6449. % Types:
  6450. % @deftp category name args
  6451. \makedefun{deftp}#1 #2 #3\endheader{%
  6452. \doind{tp}{\code{#2}}%
  6453. \defname{#1}{}{#2}\defunargs{#3\unskip}%
  6454. }
  6455. % Remaining @defun-like shortcuts:
  6456. \makedefun{defun}{\deffnheader{\putwordDeffunc} }
  6457. \makedefun{defmac}{\deffnheader{\putwordDefmac} }
  6458. \makedefun{defspec}{\deffnheader{\putwordDefspec} }
  6459. \makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} }
  6460. \makedefun{defvar}{\defvrheader{\putwordDefvar} }
  6461. \makedefun{defopt}{\defvrheader{\putwordDefopt} }
  6462. \makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} }
  6463. \makedefun{defmethod}{\defopon\putwordMethodon}
  6464. \makedefun{deftypemethod}{\deftypeopon\putwordMethodon}
  6465. \makedefun{defivar}{\defcvof\putwordInstanceVariableof}
  6466. \makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof}
  6467. % \defname, which formats the name of the @def (not the args).
  6468. % #1 is the category, such as "Function".
  6469. % #2 is the return type, if any.
  6470. % #3 is the function name.
  6471. %
  6472. % We are followed by (but not passed) the arguments, if any.
  6473. %
  6474. \def\defname#1#2#3{%
  6475. \par
  6476. % Get the values of \leftskip and \rightskip as they were outside the @def...
  6477. \advance\leftskip by -\defbodyindent
  6478. %
  6479. % Determine if we are typesetting the return type of a typed function
  6480. % on a line by itself.
  6481. \rettypeownlinefalse
  6482. \ifdoingtypefn % doing a typed function specifically?
  6483. % then check user option for putting return type on its own line:
  6484. \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else
  6485. \rettypeownlinetrue
  6486. \fi
  6487. \fi
  6488. %
  6489. % How we'll format the category name. Putting it in brackets helps
  6490. % distinguish it from the body text that may end up on the next line
  6491. % just below it.
  6492. \def\temp{#1}%
  6493. \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
  6494. %
  6495. % Figure out line sizes for the paragraph shape. We'll always have at
  6496. % least two.
  6497. \tempnum = 2
  6498. %
  6499. % The first line needs space for \box0; but if \rightskip is nonzero,
  6500. % we need only space for the part of \box0 which exceeds it:
  6501. \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip
  6502. %
  6503. % If doing a return type on its own line, we'll have another line.
  6504. \ifrettypeownline
  6505. \advance\tempnum by 1
  6506. \def\maybeshapeline{0in \hsize}%
  6507. \else
  6508. \def\maybeshapeline{}%
  6509. \fi
  6510. %
  6511. % The continuations:
  6512. \dimen2=\hsize \advance\dimen2 by -\defargsindent
  6513. %
  6514. % The final paragraph shape:
  6515. \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2
  6516. %
  6517. % Put the category name at the right margin.
  6518. \noindent
  6519. \hbox to 0pt{%
  6520. \hfil\box0 \kern-\hsize
  6521. % \hsize has to be shortened this way:
  6522. \kern\leftskip
  6523. % Intentionally do not respect \rightskip, since we need the space.
  6524. }%
  6525. %
  6526. % Allow all lines to be underfull without complaint:
  6527. \tolerance=10000 \hbadness=10000
  6528. \exdentamount=\defbodyindent
  6529. {%
  6530. % defun fonts. We use typewriter by default (used to be bold) because:
  6531. % . we're printing identifiers, they should be in tt in principle.
  6532. % . in languages with many accents, such as Czech or French, it's
  6533. % common to leave accents off identifiers. The result looks ok in
  6534. % tt, but exceedingly strange in rm.
  6535. % . we don't want -- and --- to be treated as ligatures.
  6536. % . this still does not fix the ?` and !` ligatures, but so far no
  6537. % one has made identifiers using them :).
  6538. \df \tt
  6539. \def\temp{#2}% text of the return type
  6540. \ifx\temp\empty\else
  6541. \tclose{\temp}% typeset the return type
  6542. \ifrettypeownline
  6543. % put return type on its own line; prohibit line break following:
  6544. \hfil\vadjust{\nobreak}\break
  6545. \else
  6546. \space % type on same line, so just followed by a space
  6547. \fi
  6548. \fi % no return type
  6549. #3% output function name
  6550. }%
  6551. {\rm\enskip}% hskip 0.5 em of \tenrm
  6552. %
  6553. \boldbrax
  6554. % arguments will be output next, if any.
  6555. }
  6556. % Print arguments in slanted roman (not ttsl), inconsistently with using
  6557. % tt for the name. This is because literal text is sometimes needed in
  6558. % the argument list (groff manual), and ttsl and tt are not very
  6559. % distinguishable. Prevent hyphenation at `-' chars.
  6560. %
  6561. \def\defunargs#1{%
  6562. % use sl by default (not ttsl),
  6563. % tt for the names.
  6564. \df \sl \hyphenchar\font=0
  6565. %
  6566. % On the other hand, if an argument has two dashes (for instance), we
  6567. % want a way to get ttsl. We used to recommend @var for that, so
  6568. % leave the code in, but it's strange for @var to lead to typewriter.
  6569. % Nowadays we recommend @code, since the difference between a ttsl hyphen
  6570. % and a tt hyphen is pretty tiny. @code also disables ?` !`.
  6571. \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}%
  6572. #1%
  6573. \sl\hyphenchar\font=45
  6574. }
  6575. % We want ()&[] to print specially on the defun line.
  6576. %
  6577. \def\activeparens{%
  6578. \catcode`\(=\active \catcode`\)=\active
  6579. \catcode`\[=\active \catcode`\]=\active
  6580. \catcode`\&=\active
  6581. }
  6582. % Make control sequences which act like normal parenthesis chars.
  6583. \let\lparen = ( \let\rparen = )
  6584. % Be sure that we always have a definition for `(', etc. For example,
  6585. % if the fn name has parens in it, \boldbrax will not be in effect yet,
  6586. % so TeX would otherwise complain about undefined control sequence.
  6587. {
  6588. \activeparens
  6589. \global\let(=\lparen \global\let)=\rparen
  6590. \global\let[=\lbrack \global\let]=\rbrack
  6591. \global\let& = \&
  6592. \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
  6593. \gdef\magicamp{\let&=\amprm}
  6594. }
  6595. \newcount\parencount
  6596. % If we encounter &foo, then turn on ()-hacking afterwards
  6597. \newif\ifampseen
  6598. \def\amprm#1 {\ampseentrue{\bf\&#1 }}
  6599. \def\parenfont{%
  6600. \ifampseen
  6601. % At the first level, print parens in roman,
  6602. % otherwise use the default font.
  6603. \ifnum \parencount=1 \rm \fi
  6604. \else
  6605. % The \sf parens (in \boldbrax) actually are a little bolder than
  6606. % the contained text. This is especially needed for [ and ] .
  6607. \sf
  6608. \fi
  6609. }
  6610. \def\infirstlevel#1{%
  6611. \ifampseen
  6612. \ifnum\parencount=1
  6613. #1%
  6614. \fi
  6615. \fi
  6616. }
  6617. \def\bfafterword#1 {#1 \bf}
  6618. \def\opnr{%
  6619. \global\advance\parencount by 1
  6620. {\parenfont(}%
  6621. \infirstlevel \bfafterword
  6622. }
  6623. \def\clnr{%
  6624. {\parenfont)}%
  6625. \infirstlevel \sl
  6626. \global\advance\parencount by -1
  6627. }
  6628. \newcount\brackcount
  6629. \def\lbrb{%
  6630. \global\advance\brackcount by 1
  6631. {\bf[}%
  6632. }
  6633. \def\rbrb{%
  6634. {\bf]}%
  6635. \global\advance\brackcount by -1
  6636. }
  6637. \def\checkparencounts{%
  6638. \ifnum\parencount=0 \else \badparencount \fi
  6639. \ifnum\brackcount=0 \else \badbrackcount \fi
  6640. }
  6641. % these should not use \errmessage; the glibc manual, at least, actually
  6642. % has such constructs (when documenting function pointers).
  6643. \def\badparencount{%
  6644. \message{Warning: unbalanced parentheses in @def...}%
  6645. \global\parencount=0
  6646. }
  6647. \def\badbrackcount{%
  6648. \message{Warning: unbalanced square brackets in @def...}%
  6649. \global\brackcount=0
  6650. }
  6651. \message{macros,}
  6652. % @macro.
  6653. % To do this right we need a feature of e-TeX, \scantokens,
  6654. % which we arrange to emulate with a temporary file in ordinary TeX.
  6655. \ifx\eTeXversion\thisisundefined
  6656. \newwrite\macscribble
  6657. \def\scantokens#1{%
  6658. \toks0={#1}%
  6659. \immediate\openout\macscribble=\jobname.tmp
  6660. \immediate\write\macscribble{\the\toks0}%
  6661. \immediate\closeout\macscribble
  6662. \input \jobname.tmp
  6663. }
  6664. \fi
  6665. \def\scanmacro#1{\begingroup
  6666. \newlinechar`\^^M
  6667. \let\xeatspaces\eatspaces
  6668. %
  6669. % Undo catcode changes of \startcontents and \doprintindex
  6670. % When called from @insertcopying or (short)caption, we need active
  6671. % backslash to get it printed correctly. Previously, we had
  6672. % \catcode`\\=\other instead. We'll see whether a problem appears
  6673. % with macro expansion. --kasal, 19aug04
  6674. \catcode`\@=0 \catcode`\\=\active \escapechar=`\@
  6675. %
  6676. % ... and for \example:
  6677. \spaceisspace
  6678. %
  6679. % The \empty here causes a following catcode 5 newline to be eaten as
  6680. % part of reading whitespace after a control sequence. It does not
  6681. % eat a catcode 13 newline. There's no good way to handle the two
  6682. % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX
  6683. % would then have different behavior). See the Macro Details node in
  6684. % the manual for the workaround we recommend for macros and
  6685. % line-oriented commands.
  6686. %
  6687. \scantokens{#1\empty}%
  6688. \endgroup}
  6689. \def\scanexp#1{%
  6690. \edef\temp{\noexpand\scanmacro{#1}}%
  6691. \temp
  6692. }
  6693. \newcount\paramno % Count of parameters
  6694. \newtoks\macname % Macro name
  6695. \newif\ifrecursive % Is it recursive?
  6696. % List of all defined macros in the form
  6697. % \definedummyword\macro1\definedummyword\macro2...
  6698. % Currently is also contains all @aliases; the list can be split
  6699. % if there is a need.
  6700. \def\macrolist{}
  6701. % Add the macro to \macrolist
  6702. \def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname}
  6703. \def\addtomacrolistxxx#1{%
  6704. \toks0 = \expandafter{\macrolist\definedummyword#1}%
  6705. \xdef\macrolist{\the\toks0}%
  6706. }
  6707. % Utility routines.
  6708. % This does \let #1 = #2, with \csnames; that is,
  6709. % \let \csname#1\endcsname = \csname#2\endcsname
  6710. % (except of course we have to play expansion games).
  6711. %
  6712. \def\cslet#1#2{%
  6713. \expandafter\let
  6714. \csname#1\expandafter\endcsname
  6715. \csname#2\endcsname
  6716. }
  6717. % Trim leading and trailing spaces off a string.
  6718. % Concepts from aro-bend problem 15 (see CTAN).
  6719. {\catcode`\@=11
  6720. \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
  6721. \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
  6722. \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
  6723. \def\unbrace#1{#1}
  6724. \unbrace{\gdef\trim@@@ #1 } #2@{#1}
  6725. }
  6726. % Trim a single trailing ^^M off a string.
  6727. {\catcode`\^^M=\other \catcode`\Q=3%
  6728. \gdef\eatcr #1{\eatcra #1Q^^MQ}%
  6729. \gdef\eatcra#1^^MQ{\eatcrb#1Q}%
  6730. \gdef\eatcrb#1Q#2Q{#1}%
  6731. }
  6732. % Macro bodies are absorbed as an argument in a context where
  6733. % all characters are catcode 10, 11 or 12, except \ which is active
  6734. % (as in normal texinfo). It is necessary to change the definition of \
  6735. % to recognize macro arguments; this is the job of \mbodybackslash.
  6736. %
  6737. % Non-ASCII encodings make 8-bit characters active, so un-activate
  6738. % them to avoid their expansion. Must do this non-globally, to
  6739. % confine the change to the current group.
  6740. %
  6741. % It's necessary to have hard CRs when the macro is executed. This is
  6742. % done by making ^^M (\endlinechar) catcode 12 when reading the macro
  6743. % body, and then making it the \newlinechar in \scanmacro.
  6744. %
  6745. \def\scanctxt{% used as subroutine
  6746. \catcode`\"=\other
  6747. \catcode`\+=\other
  6748. \catcode`\<=\other
  6749. \catcode`\>=\other
  6750. \catcode`\@=\other
  6751. \catcode`\^=\other
  6752. \catcode`\_=\other
  6753. \catcode`\|=\other
  6754. \catcode`\~=\other
  6755. \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi
  6756. }
  6757. \def\scanargctxt{% used for copying and captions, not macros.
  6758. \scanctxt
  6759. \catcode`\\=\other
  6760. \catcode`\^^M=\other
  6761. }
  6762. \def\macrobodyctxt{% used for @macro definitions
  6763. \scanctxt
  6764. \catcode`\{=\other
  6765. \catcode`\}=\other
  6766. \catcode`\^^M=\other
  6767. \usembodybackslash
  6768. }
  6769. \def\macroargctxt{% used when scanning invocations
  6770. \scanctxt
  6771. \catcode`\\=0
  6772. }
  6773. % why catcode 0 for \ in the above? To recognize \\ \{ \} as "escapes"
  6774. % for the single characters \ { }. Thus, we end up with the "commands"
  6775. % that would be written @\ @{ @} in a Texinfo document.
  6776. %
  6777. % We already have @{ and @}. For @\, we define it here, and only for
  6778. % this purpose, to produce a typewriter backslash (so, the @\ that we
  6779. % define for @math can't be used with @macro calls):
  6780. %
  6781. \def\\{\normalbackslash}%
  6782. %
  6783. % We would like to do this for \, too, since that is what makeinfo does.
  6784. % But it is not possible, because Texinfo already has a command @, for a
  6785. % cedilla accent. Documents must use @comma{} instead.
  6786. %
  6787. % \anythingelse will almost certainly be an error of some kind.
  6788. % \mbodybackslash is the definition of \ in @macro bodies.
  6789. % It maps \foo\ => \csname macarg.foo\endcsname => #N
  6790. % where N is the macro parameter number.
  6791. % We define \csname macarg.\endcsname to be \realbackslash, so
  6792. % \\ in macro replacement text gets you a backslash.
  6793. %
  6794. {\catcode`@=0 @catcode`@\=@active
  6795. @gdef@usembodybackslash{@let\=@mbodybackslash}
  6796. @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
  6797. }
  6798. \expandafter\def\csname macarg.\endcsname{\realbackslash}
  6799. \def\margbackslash#1{\char`\#1 }
  6800. \def\macro{\recursivefalse\parsearg\macroxxx}
  6801. \def\rmacro{\recursivetrue\parsearg\macroxxx}
  6802. \def\macroxxx#1{%
  6803. \getargs{#1}% now \macname is the macname and \argl the arglist
  6804. \ifx\argl\empty % no arguments
  6805. \paramno=0\relax
  6806. \else
  6807. \expandafter\parsemargdef \argl;%
  6808. \if\paramno>256\relax
  6809. \ifx\eTeXversion\thisisundefined
  6810. \errhelp = \EMsimple
  6811. \errmessage{You need eTeX to compile a file with macros with more than 256 arguments}
  6812. \fi
  6813. \fi
  6814. \fi
  6815. \if1\csname ismacro.\the\macname\endcsname
  6816. \message{Warning: redefining \the\macname}%
  6817. \else
  6818. \expandafter\ifx\csname \the\macname\endcsname \relax
  6819. \else \errmessage{Macro name \the\macname\space already defined}\fi
  6820. \global\cslet{macsave.\the\macname}{\the\macname}%
  6821. \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
  6822. \addtomacrolist{\the\macname}%
  6823. \fi
  6824. \begingroup \macrobodyctxt
  6825. \ifrecursive \expandafter\parsermacbody
  6826. \else \expandafter\parsemacbody
  6827. \fi}
  6828. \parseargdef\unmacro{%
  6829. \if1\csname ismacro.#1\endcsname
  6830. \global\cslet{#1}{macsave.#1}%
  6831. \global\expandafter\let \csname ismacro.#1\endcsname=0%
  6832. % Remove the macro name from \macrolist:
  6833. \begingroup
  6834. \expandafter\let\csname#1\endcsname \relax
  6835. \let\definedummyword\unmacrodo
  6836. \xdef\macrolist{\macrolist}%
  6837. \endgroup
  6838. \else
  6839. \errmessage{Macro #1 not defined}%
  6840. \fi
  6841. }
  6842. % Called by \do from \dounmacro on each macro. The idea is to omit any
  6843. % macro definitions that have been changed to \relax.
  6844. %
  6845. \def\unmacrodo#1{%
  6846. \ifx #1\relax
  6847. % remove this
  6848. \else
  6849. \noexpand\definedummyword \noexpand#1%
  6850. \fi
  6851. }
  6852. % This makes use of the obscure feature that if the last token of a
  6853. % <parameter list> is #, then the preceding argument is delimited by
  6854. % an opening brace, and that opening brace is not consumed.
  6855. \def\getargs#1{\getargsxxx#1{}}
  6856. \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
  6857. \def\getmacname#1 #2\relax{\macname={#1}}
  6858. \def\getmacargs#1{\def\argl{#1}}
  6859. % For macro processing make @ a letter so that we can make Texinfo private macro names.
  6860. \edef\texiatcatcode{\the\catcode`\@}
  6861. \catcode `@=11\relax
  6862. % Parse the optional {params} list. Set up \paramno and \paramlist
  6863. % so \defmacro knows what to do. Define \macarg.BLAH for each BLAH
  6864. % in the params list to some hook where the argument si to be expanded. If
  6865. % there are less than 10 arguments that hook is to be replaced by ##N where N
  6866. % is the position in that list, that is to say the macro arguments are to be
  6867. % defined `a la TeX in the macro body.
  6868. %
  6869. % That gets used by \mbodybackslash (above).
  6870. %
  6871. % We need to get `macro parameter char #' into several definitions.
  6872. % The technique used is stolen from LaTeX: let \hash be something
  6873. % unexpandable, insert that wherever you need a #, and then redefine
  6874. % it to # just before using the token list produced.
  6875. %
  6876. % The same technique is used to protect \eatspaces till just before
  6877. % the macro is used.
  6878. %
  6879. % If there are 10 or more arguments, a different technique is used, where the
  6880. % hook remains in the body, and when macro is to be expanded the body is
  6881. % processed again to replace the arguments.
  6882. %
  6883. % In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the
  6884. % argument N value and then \edef the body (nothing else will expand because of
  6885. % the catcode regime underwhich the body was input).
  6886. %
  6887. % If you compile with TeX (not eTeX), and you have macros with 10 or more
  6888. % arguments, you need that no macro has more than 256 arguments, otherwise an
  6889. % error is produced.
  6890. \def\parsemargdef#1;{%
  6891. \paramno=0\def\paramlist{}%
  6892. \let\hash\relax
  6893. \let\xeatspaces\relax
  6894. \parsemargdefxxx#1,;,%
  6895. % In case that there are 10 or more arguments we parse again the arguments
  6896. % list to set new definitions for the \macarg.BLAH macros corresponding to
  6897. % each BLAH argument. It was anyhow needed to parse already once this list
  6898. % in order to count the arguments, and as macros with at most 9 arguments
  6899. % are by far more frequent than macro with 10 or more arguments, defining
  6900. % twice the \macarg.BLAH macros does not cost too much processing power.
  6901. \ifnum\paramno<10\relax\else
  6902. \paramno0\relax
  6903. \parsemmanyargdef@@#1,;,% 10 or more arguments
  6904. \fi
  6905. }
  6906. \def\parsemargdefxxx#1,{%
  6907. \if#1;\let\next=\relax
  6908. \else \let\next=\parsemargdefxxx
  6909. \advance\paramno by 1
  6910. \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
  6911. {\xeatspaces{\hash\the\paramno}}%
  6912. \edef\paramlist{\paramlist\hash\the\paramno,}%
  6913. \fi\next}
  6914. \def\parsemmanyargdef@@#1,{%
  6915. \if#1;\let\next=\relax
  6916. \else
  6917. \let\next=\parsemmanyargdef@@
  6918. \edef\tempb{\eatspaces{#1}}%
  6919. \expandafter\def\expandafter\tempa
  6920. \expandafter{\csname macarg.\tempb\endcsname}%
  6921. % Note that we need some extra \noexpand\noexpand, this is because we
  6922. % don't want \the to be expanded in the \parsermacbody as it uses an
  6923. % \xdef .
  6924. \expandafter\edef\tempa
  6925. {\noexpand\noexpand\noexpand\the\toks\the\paramno}%
  6926. \advance\paramno by 1\relax
  6927. \fi\next}
  6928. % These two commands read recursive and nonrecursive macro bodies.
  6929. % (They're different since rec and nonrec macros end differently.)
  6930. %
  6931. \catcode `\@\texiatcatcode
  6932. \long\def\parsemacbody#1@end macro%
  6933. {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
  6934. \long\def\parsermacbody#1@end rmacro%
  6935. {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
  6936. \catcode `\@=11\relax
  6937. \let\endargs@\relax
  6938. \let\nil@\relax
  6939. \def\nilm@{\nil@}%
  6940. \long\def\nillm@{\nil@}%
  6941. % This macro is expanded during the Texinfo macro expansion, not during its
  6942. % definition. It gets all the arguments values and assigns them to macros
  6943. % macarg.ARGNAME
  6944. %
  6945. % #1 is the macro name
  6946. % #2 is the list of argument names
  6947. % #3 is the list of argument values
  6948. \def\getargvals@#1#2#3{%
  6949. \def\macargdeflist@{}%
  6950. \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion.
  6951. \def\paramlist{#2,\nil@}%
  6952. \def\macroname{#1}%
  6953. \begingroup
  6954. \macroargctxt
  6955. \def\argvaluelist{#3,\nil@}%
  6956. \def\@tempa{#3}%
  6957. \ifx\@tempa\empty
  6958. \setemptyargvalues@
  6959. \else
  6960. \getargvals@@
  6961. \fi
  6962. }
  6963. %
  6964. \def\getargvals@@{%
  6965. \ifx\paramlist\nilm@
  6966. % Some sanity check needed here that \argvaluelist is also empty.
  6967. \ifx\argvaluelist\nillm@
  6968. \else
  6969. \errhelp = \EMsimple
  6970. \errmessage{Too many arguments in macro `\macroname'!}%
  6971. \fi
  6972. \let\next\macargexpandinbody@
  6973. \else
  6974. \ifx\argvaluelist\nillm@
  6975. % No more arguments values passed to macro. Set remaining named-arg
  6976. % macros to empty.
  6977. \let\next\setemptyargvalues@
  6978. \else
  6979. % pop current arg name into \@tempb
  6980. \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}%
  6981. \expandafter\@tempa\expandafter{\paramlist}%
  6982. % pop current argument value into \@tempc
  6983. \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}%
  6984. \expandafter\@tempa\expandafter{\argvaluelist}%
  6985. % Here \@tempb is the current arg name and \@tempc is the current arg value.
  6986. % First place the new argument macro definition into \@tempd
  6987. \expandafter\macname\expandafter{\@tempc}%
  6988. \expandafter\let\csname macarg.\@tempb\endcsname\relax
  6989. \expandafter\def\expandafter\@tempe\expandafter{%
  6990. \csname macarg.\@tempb\endcsname}%
  6991. \edef\@tempd{\long\def\@tempe{\the\macname}}%
  6992. \push@\@tempd\macargdeflist@
  6993. \let\next\getargvals@@
  6994. \fi
  6995. \fi
  6996. \next
  6997. }
  6998. \def\push@#1#2{%
  6999. \expandafter\expandafter\expandafter\def
  7000. \expandafter\expandafter\expandafter#2%
  7001. \expandafter\expandafter\expandafter{%
  7002. \expandafter#1#2}%
  7003. }
  7004. % Replace arguments by their values in the macro body, and place the result
  7005. % in macro \@tempa
  7006. \def\macvalstoargs@{%
  7007. % To do this we use the property that token registers that are \the'ed
  7008. % within an \edef expand only once. So we are going to place all argument
  7009. % values into respective token registers.
  7010. %
  7011. % First we save the token context, and initialize argument numbering.
  7012. \begingroup
  7013. \paramno0\relax
  7014. % Then, for each argument number #N, we place the corresponding argument
  7015. % value into a new token list register \toks#N
  7016. \expandafter\putargsintokens@\saveparamlist@,;,%
  7017. % Then, we expand the body so that argument are replaced by their
  7018. % values. The trick for values not to be expanded themselves is that they
  7019. % are within tokens and that tokens expand only once in an \edef .
  7020. \edef\@tempc{\csname mac.\macroname .body\endcsname}%
  7021. % Now we restore the token stack pointer to free the token list registers
  7022. % which we have used, but we make sure that expanded body is saved after
  7023. % group.
  7024. \expandafter
  7025. \endgroup
  7026. \expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
  7027. }
  7028. \def\macargexpandinbody@{%
  7029. %% Define the named-macro outside of this group and then close this group.
  7030. \expandafter
  7031. \endgroup
  7032. \macargdeflist@
  7033. % First the replace in body the macro arguments by their values, the result
  7034. % is in \@tempa .
  7035. \macvalstoargs@
  7036. % Then we point at the \norecurse or \gobble (for recursive) macro value
  7037. % with \@tempb .
  7038. \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname
  7039. % Depending on whether it is recursive or not, we need some tailing
  7040. % \egroup .
  7041. \ifx\@tempb\gobble
  7042. \let\@tempc\relax
  7043. \else
  7044. \let\@tempc\egroup
  7045. \fi
  7046. % And now we do the real job:
  7047. \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}%
  7048. \@tempd
  7049. }
  7050. \def\putargsintokens@#1,{%
  7051. \if#1;\let\next\relax
  7052. \else
  7053. \let\next\putargsintokens@
  7054. % First we allocate the new token list register, and give it a temporary
  7055. % alias \@tempb .
  7056. \toksdef\@tempb\the\paramno
  7057. % Then we place the argument value into that token list register.
  7058. \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname
  7059. \expandafter\@tempb\expandafter{\@tempa}%
  7060. \advance\paramno by 1\relax
  7061. \fi
  7062. \next
  7063. }
  7064. % Save the token stack pointer into macro #1
  7065. \def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}}
  7066. % Restore the token stack pointer from number in macro #1
  7067. \def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax}
  7068. % newtoks that can be used non \outer .
  7069. \def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi}
  7070. % Tailing missing arguments are set to empty
  7071. \def\setemptyargvalues@{%
  7072. \ifx\paramlist\nilm@
  7073. \let\next\macargexpandinbody@
  7074. \else
  7075. \expandafter\setemptyargvaluesparser@\paramlist\endargs@
  7076. \let\next\setemptyargvalues@
  7077. \fi
  7078. \next
  7079. }
  7080. \def\setemptyargvaluesparser@#1,#2\endargs@{%
  7081. \expandafter\def\expandafter\@tempa\expandafter{%
  7082. \expandafter\def\csname macarg.#1\endcsname{}}%
  7083. \push@\@tempa\macargdeflist@
  7084. \def\paramlist{#2}%
  7085. }
  7086. % #1 is the element target macro
  7087. % #2 is the list macro
  7088. % #3,#4\endargs@ is the list value
  7089. \def\pop@#1#2#3,#4\endargs@{%
  7090. \def#1{#3}%
  7091. \def#2{#4}%
  7092. }
  7093. \long\def\longpop@#1#2#3,#4\endargs@{%
  7094. \long\def#1{#3}%
  7095. \long\def#2{#4}%
  7096. }
  7097. % This defines a Texinfo @macro. There are eight cases: recursive and
  7098. % nonrecursive macros of zero, one, up to nine, and many arguments.
  7099. % Much magic with \expandafter here.
  7100. % \xdef is used so that macro definitions will survive the file
  7101. % they're defined in; @include reads the file inside a group.
  7102. %
  7103. \def\defmacro{%
  7104. \let\hash=##% convert placeholders to macro parameter chars
  7105. \ifrecursive
  7106. \ifcase\paramno
  7107. % 0
  7108. \expandafter\xdef\csname\the\macname\endcsname{%
  7109. \noexpand\scanmacro{\temp}}%
  7110. \or % 1
  7111. \expandafter\xdef\csname\the\macname\endcsname{%
  7112. \bgroup\noexpand\macroargctxt
  7113. \noexpand\braceorline
  7114. \expandafter\noexpand\csname\the\macname xxx\endcsname}%
  7115. \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
  7116. \egroup\noexpand\scanmacro{\temp}}%
  7117. \else
  7118. \ifnum\paramno<10\relax % at most 9
  7119. \expandafter\xdef\csname\the\macname\endcsname{%
  7120. \bgroup\noexpand\macroargctxt
  7121. \noexpand\csname\the\macname xx\endcsname}%
  7122. \expandafter\xdef\csname\the\macname xx\endcsname##1{%
  7123. \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
  7124. \expandafter\expandafter
  7125. \expandafter\xdef
  7126. \expandafter\expandafter
  7127. \csname\the\macname xxx\endcsname
  7128. \paramlist{\egroup\noexpand\scanmacro{\temp}}%
  7129. \else % 10 or more
  7130. \expandafter\xdef\csname\the\macname\endcsname{%
  7131. \noexpand\getargvals@{\the\macname}{\argl}%
  7132. }%
  7133. \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
  7134. \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble
  7135. \fi
  7136. \fi
  7137. \else
  7138. \ifcase\paramno
  7139. % 0
  7140. \expandafter\xdef\csname\the\macname\endcsname{%
  7141. \noexpand\norecurse{\the\macname}%
  7142. \noexpand\scanmacro{\temp}\egroup}%
  7143. \or % 1
  7144. \expandafter\xdef\csname\the\macname\endcsname{%
  7145. \bgroup\noexpand\macroargctxt
  7146. \noexpand\braceorline
  7147. \expandafter\noexpand\csname\the\macname xxx\endcsname}%
  7148. \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
  7149. \egroup
  7150. \noexpand\norecurse{\the\macname}%
  7151. \noexpand\scanmacro{\temp}\egroup}%
  7152. \else % at most 9
  7153. \ifnum\paramno<10\relax
  7154. \expandafter\xdef\csname\the\macname\endcsname{%
  7155. \bgroup\noexpand\macroargctxt
  7156. \expandafter\noexpand\csname\the\macname xx\endcsname}%
  7157. \expandafter\xdef\csname\the\macname xx\endcsname##1{%
  7158. \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
  7159. \expandafter\expandafter
  7160. \expandafter\xdef
  7161. \expandafter\expandafter
  7162. \csname\the\macname xxx\endcsname
  7163. \paramlist{%
  7164. \egroup
  7165. \noexpand\norecurse{\the\macname}%
  7166. \noexpand\scanmacro{\temp}\egroup}%
  7167. \else % 10 or more:
  7168. \expandafter\xdef\csname\the\macname\endcsname{%
  7169. \noexpand\getargvals@{\the\macname}{\argl}%
  7170. }%
  7171. \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
  7172. \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse
  7173. \fi
  7174. \fi
  7175. \fi}
  7176. \catcode `\@\texiatcatcode\relax
  7177. \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
  7178. % \braceorline decides whether the next nonwhitespace character is a
  7179. % {. If so it reads up to the closing }, if not, it reads the whole
  7180. % line. Whatever was read is then fed to the next control sequence
  7181. % as an argument (by \parsebrace or \parsearg).
  7182. %
  7183. \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
  7184. \def\braceorlinexxx{%
  7185. \ifx\nchar\bgroup\else
  7186. \expandafter\parsearg
  7187. \fi \macnamexxx}
  7188. % @alias.
  7189. % We need some trickery to remove the optional spaces around the equal
  7190. % sign. Make them active and then expand them all to nothing.
  7191. %
  7192. \def\alias{\parseargusing\obeyspaces\aliasxxx}
  7193. \def\aliasxxx #1{\aliasyyy#1\relax}
  7194. \def\aliasyyy #1=#2\relax{%
  7195. {%
  7196. \expandafter\let\obeyedspace=\empty
  7197. \addtomacrolist{#1}%
  7198. \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%
  7199. }%
  7200. \next
  7201. }
  7202. \message{cross references,}
  7203. \newwrite\auxfile
  7204. \newif\ifhavexrefs % True if xref values are known.
  7205. \newif\ifwarnedxrefs % True if we warned once that they aren't known.
  7206. % @inforef is relatively simple.
  7207. \def\inforef #1{\inforefzzz #1,,,,**}
  7208. \def\inforefzzz #1,#2,#3,#4**{%
  7209. \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
  7210. node \samp{\ignorespaces#1{}}}
  7211. % @node's only job in TeX is to define \lastnode, which is used in
  7212. % cross-references. The @node line might or might not have commas, and
  7213. % might or might not have spaces before the first comma, like:
  7214. % @node foo , bar , ...
  7215. % We don't want such trailing spaces in the node name.
  7216. %
  7217. \parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse}
  7218. %
  7219. % also remove a trailing comma, in case of something like this:
  7220. % @node Help-Cross, , , Cross-refs
  7221. \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
  7222. \def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}}
  7223. \let\nwnode=\node
  7224. \let\lastnode=\empty
  7225. % Write a cross-reference definition for the current node. #1 is the
  7226. % type (Ynumbered, Yappendix, Ynothing).
  7227. %
  7228. \def\donoderef#1{%
  7229. \ifx\lastnode\empty\else
  7230. \setref{\lastnode}{#1}%
  7231. \global\let\lastnode=\empty
  7232. \fi
  7233. }
  7234. % @anchor{NAME} -- define xref target at arbitrary point.
  7235. %
  7236. \newcount\savesfregister
  7237. %
  7238. \def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
  7239. \def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
  7240. \def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
  7241. % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
  7242. % anchor), which consists of three parts:
  7243. % 1) NAME-title - the current sectioning name taken from \lastsection,
  7244. % or the anchor name.
  7245. % 2) NAME-snt - section number and type, passed as the SNT arg, or
  7246. % empty for anchors.
  7247. % 3) NAME-pg - the page number.
  7248. %
  7249. % This is called from \donoderef, \anchor, and \dofloat. In the case of
  7250. % floats, there is an additional part, which is not written here:
  7251. % 4) NAME-lof - the text as it should appear in a @listoffloats.
  7252. %
  7253. \def\setref#1#2{%
  7254. \pdfmkdest{#1}%
  7255. \iflinks
  7256. {%
  7257. \atdummies % preserve commands, but don't expand them
  7258. \edef\writexrdef##1##2{%
  7259. \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
  7260. ##1}{##2}}% these are parameters of \writexrdef
  7261. }%
  7262. \toks0 = \expandafter{\lastsection}%
  7263. \immediate \writexrdef{title}{\the\toks0 }%
  7264. \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
  7265. \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout
  7266. }%
  7267. \fi
  7268. }
  7269. % @xrefautosectiontitle on|off says whether @section(ing) names are used
  7270. % automatically in xrefs, if the third arg is not explicitly specified.
  7271. % This was provided as a "secret" @set xref-automatic-section-title
  7272. % variable, now it's official.
  7273. %
  7274. \parseargdef\xrefautomaticsectiontitle{%
  7275. \def\temp{#1}%
  7276. \ifx\temp\onword
  7277. \expandafter\let\csname SETxref-automatic-section-title\endcsname
  7278. = \empty
  7279. \else\ifx\temp\offword
  7280. \expandafter\let\csname SETxref-automatic-section-title\endcsname
  7281. = \relax
  7282. \else
  7283. \errhelp = \EMsimple
  7284. \errmessage{Unknown @xrefautomaticsectiontitle value `\temp',
  7285. must be on|off}%
  7286. \fi\fi
  7287. }
  7288. %
  7289. % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
  7290. % the node name, #2 the name of the Info cross-reference, #3 the printed
  7291. % node name, #4 the name of the Info file, #5 the name of the printed
  7292. % manual. All but the node name can be omitted.
  7293. %
  7294. \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
  7295. \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
  7296. \def\ref#1{\xrefX[#1,,,,,,,]}
  7297. %
  7298. \newbox\toprefbox
  7299. \newbox\printedrefnamebox
  7300. \newbox\infofilenamebox
  7301. \newbox\printedmanualbox
  7302. %
  7303. \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
  7304. \unsepspaces
  7305. %
  7306. % Get args without leading/trailing spaces.
  7307. \def\printedrefname{\ignorespaces #3}%
  7308. \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}%
  7309. %
  7310. \def\infofilename{\ignorespaces #4}%
  7311. \setbox\infofilenamebox = \hbox{\infofilename\unskip}%
  7312. %
  7313. \def\printedmanual{\ignorespaces #5}%
  7314. \setbox\printedmanualbox = \hbox{\printedmanual\unskip}%
  7315. %
  7316. % If the printed reference name (arg #3) was not explicitly given in
  7317. % the @xref, figure out what we want to use.
  7318. \ifdim \wd\printedrefnamebox = 0pt
  7319. % No printed node name was explicitly given.
  7320. \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax
  7321. % Not auto section-title: use node name inside the square brackets.
  7322. \def\printedrefname{\ignorespaces #1}%
  7323. \else
  7324. % Auto section-title: use chapter/section title inside
  7325. % the square brackets if we have it.
  7326. \ifdim \wd\printedmanualbox > 0pt
  7327. % It is in another manual, so we don't have it; use node name.
  7328. \def\printedrefname{\ignorespaces #1}%
  7329. \else
  7330. \ifhavexrefs
  7331. % We (should) know the real title if we have the xref values.
  7332. \def\printedrefname{\refx{#1-title}{}}%
  7333. \else
  7334. % Otherwise just copy the Info node name.
  7335. \def\printedrefname{\ignorespaces #1}%
  7336. \fi%
  7337. \fi
  7338. \fi
  7339. \fi
  7340. %
  7341. % Make link in pdf output.
  7342. \ifpdf
  7343. {\indexnofonts
  7344. \turnoffactive
  7345. \makevalueexpandable
  7346. % This expands tokens, so do it after making catcode changes, so _
  7347. % etc. don't get their TeX definitions. This ignores all spaces in
  7348. % #4, including (wrongly) those in the middle of the filename.
  7349. \getfilename{#4}%
  7350. %
  7351. % This (wrongly) does not take account of leading or trailing
  7352. % spaces in #1, which should be ignored.
  7353. \edef\pdfxrefdest{#1}%
  7354. \ifx\pdfxrefdest\empty
  7355. \def\pdfxrefdest{Top}% no empty targets
  7356. \else
  7357. \txiescapepdf\pdfxrefdest % escape PDF special chars
  7358. \fi
  7359. %
  7360. \leavevmode
  7361. \startlink attr{/Border [0 0 0]}%
  7362. \ifnum\filenamelength>0
  7363. goto file{\the\filename.pdf} name{\pdfxrefdest}%
  7364. \else
  7365. goto name{\pdfmkpgn{\pdfxrefdest}}%
  7366. \fi
  7367. }%
  7368. \setcolor{\linkcolor}%
  7369. \fi
  7370. %
  7371. % Float references are printed completely differently: "Figure 1.2"
  7372. % instead of "[somenode], p.3". We distinguish them by the
  7373. % LABEL-title being set to a magic string.
  7374. {%
  7375. % Have to otherify everything special to allow the \csname to
  7376. % include an _ in the xref name, etc.
  7377. \indexnofonts
  7378. \turnoffactive
  7379. \expandafter\global\expandafter\let\expandafter\Xthisreftitle
  7380. \csname XR#1-title\endcsname
  7381. }%
  7382. \iffloat\Xthisreftitle
  7383. % If the user specified the print name (third arg) to the ref,
  7384. % print it instead of our usual "Figure 1.2".
  7385. \ifdim\wd\printedrefnamebox = 0pt
  7386. \refx{#1-snt}{}%
  7387. \else
  7388. \printedrefname
  7389. \fi
  7390. %
  7391. % If the user also gave the printed manual name (fifth arg), append
  7392. % "in MANUALNAME".
  7393. \ifdim \wd\printedmanualbox > 0pt
  7394. \space \putwordin{} \cite{\printedmanual}%
  7395. \fi
  7396. \else
  7397. % node/anchor (non-float) references.
  7398. %
  7399. % If we use \unhbox to print the node names, TeX does not insert
  7400. % empty discretionaries after hyphens, which means that it will not
  7401. % find a line break at a hyphen in a node names. Since some manuals
  7402. % are best written with fairly long node names, containing hyphens,
  7403. % this is a loss. Therefore, we give the text of the node name
  7404. % again, so it is as if TeX is seeing it for the first time.
  7405. %
  7406. \ifdim \wd\printedmanualbox > 0pt
  7407. % Cross-manual reference with a printed manual name.
  7408. %
  7409. \crossmanualxref{\cite{\printedmanual\unskip}}%
  7410. %
  7411. \else\ifdim \wd\infofilenamebox > 0pt
  7412. % Cross-manual reference with only an info filename (arg 4), no
  7413. % printed manual name (arg 5). This is essentially the same as
  7414. % the case above; we output the filename, since we have nothing else.
  7415. %
  7416. \crossmanualxref{\code{\infofilename\unskip}}%
  7417. %
  7418. \else
  7419. % Reference within this manual.
  7420. %
  7421. % _ (for example) has to be the character _ for the purposes of the
  7422. % control sequence corresponding to the node, but it has to expand
  7423. % into the usual \leavevmode...\vrule stuff for purposes of
  7424. % printing. So we \turnoffactive for the \refx-snt, back on for the
  7425. % printing, back off for the \refx-pg.
  7426. {\turnoffactive
  7427. % Only output a following space if the -snt ref is nonempty; for
  7428. % @unnumbered and @anchor, it won't be.
  7429. \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
  7430. \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
  7431. }%
  7432. % output the `[mynode]' via the macro below so it can be overridden.
  7433. \xrefprintnodename\printedrefname
  7434. %
  7435. % But we always want a comma and a space:
  7436. ,\space
  7437. %
  7438. % output the `page 3'.
  7439. \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
  7440. \fi\fi
  7441. \fi
  7442. \endlink
  7443. \endgroup}
  7444. % Output a cross-manual xref to #1. Used just above (twice).
  7445. %
  7446. % Only include the text "Section ``foo'' in" if the foo is neither
  7447. % missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply
  7448. % "see The Foo Manual", the idea being to refer to the whole manual.
  7449. %
  7450. % But, this being TeX, we can't easily compare our node name against the
  7451. % string "Top" while ignoring the possible spaces before and after in
  7452. % the input. By adding the arbitrary 7sp below, we make it much less
  7453. % likely that a real node name would have the same width as "Top" (e.g.,
  7454. % in a monospaced font). Hopefully it will never happen in practice.
  7455. %
  7456. % For the same basic reason, we retypeset the "Top" at every
  7457. % reference, since the current font is indeterminate.
  7458. %
  7459. \def\crossmanualxref#1{%
  7460. \setbox\toprefbox = \hbox{Top\kern7sp}%
  7461. \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
  7462. \ifdim \wd2 > 7sp % nonempty?
  7463. \ifdim \wd2 = \wd\toprefbox \else % same as Top?
  7464. \putwordSection{} ``\printedrefname'' \putwordin{}\space
  7465. \fi
  7466. \fi
  7467. #1%
  7468. }
  7469. % This macro is called from \xrefX for the `[nodename]' part of xref
  7470. % output. It's a separate macro only so it can be changed more easily,
  7471. % since square brackets don't work well in some documents. Particularly
  7472. % one that Bob is working on :).
  7473. %
  7474. \def\xrefprintnodename#1{[#1]}
  7475. % Things referred to by \setref.
  7476. %
  7477. \def\Ynothing{}
  7478. \def\Yomitfromtoc{}
  7479. \def\Ynumbered{%
  7480. \ifnum\secno=0
  7481. \putwordChapter@tie \the\chapno
  7482. \else \ifnum\subsecno=0
  7483. \putwordSection@tie \the\chapno.\the\secno
  7484. \else \ifnum\subsubsecno=0
  7485. \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
  7486. \else
  7487. \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
  7488. \fi\fi\fi
  7489. }
  7490. \def\Yappendix{%
  7491. \ifnum\secno=0
  7492. \putwordAppendix@tie @char\the\appendixno{}%
  7493. \else \ifnum\subsecno=0
  7494. \putwordSection@tie @char\the\appendixno.\the\secno
  7495. \else \ifnum\subsubsecno=0
  7496. \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
  7497. \else
  7498. \putwordSection@tie
  7499. @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
  7500. \fi\fi\fi
  7501. }
  7502. % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
  7503. % If its value is nonempty, SUFFIX is output afterward.
  7504. %
  7505. \def\refx#1#2{%
  7506. {%
  7507. \indexnofonts
  7508. \otherbackslash
  7509. \expandafter\global\expandafter\let\expandafter\thisrefX
  7510. \csname XR#1\endcsname
  7511. }%
  7512. \ifx\thisrefX\relax
  7513. % If not defined, say something at least.
  7514. \angleleft un\-de\-fined\angleright
  7515. \iflinks
  7516. \ifhavexrefs
  7517. {\toks0 = {#1}% avoid expansion of possibly-complex value
  7518. \message{\linenumber Undefined cross reference `\the\toks0'.}}%
  7519. \else
  7520. \ifwarnedxrefs\else
  7521. \global\warnedxrefstrue
  7522. \message{Cross reference values unknown; you must run TeX again.}%
  7523. \fi
  7524. \fi
  7525. \fi
  7526. \else
  7527. % It's defined, so just use it.
  7528. \thisrefX
  7529. \fi
  7530. #2% Output the suffix in any case.
  7531. }
  7532. % This is the macro invoked by entries in the aux file. Usually it's
  7533. % just a \def (we prepend XR to the control sequence name to avoid
  7534. % collisions). But if this is a float type, we have more work to do.
  7535. %
  7536. \def\xrdef#1#2{%
  7537. {% The node name might contain 8-bit characters, which in our current
  7538. % implementation are changed to commands like @'e. Don't let these
  7539. % mess up the control sequence name.
  7540. \indexnofonts
  7541. \turnoffactive
  7542. \xdef\safexrefname{#1}%
  7543. }%
  7544. %
  7545. \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref
  7546. %
  7547. % Was that xref control sequence that we just defined for a float?
  7548. \expandafter\iffloat\csname XR\safexrefname\endcsname
  7549. % it was a float, and we have the (safe) float type in \iffloattype.
  7550. \expandafter\let\expandafter\floatlist
  7551. \csname floatlist\iffloattype\endcsname
  7552. %
  7553. % Is this the first time we've seen this float type?
  7554. \expandafter\ifx\floatlist\relax
  7555. \toks0 = {\do}% yes, so just \do
  7556. \else
  7557. % had it before, so preserve previous elements in list.
  7558. \toks0 = \expandafter{\floatlist\do}%
  7559. \fi
  7560. %
  7561. % Remember this xref in the control sequence \floatlistFLOATTYPE,
  7562. % for later use in \listoffloats.
  7563. \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0
  7564. {\safexrefname}}%
  7565. \fi
  7566. }
  7567. % Read the last existing aux file, if any. No error if none exists.
  7568. %
  7569. \def\tryauxfile{%
  7570. \openin 1 \jobname.aux
  7571. \ifeof 1 \else
  7572. \readdatafile{aux}%
  7573. \global\havexrefstrue
  7574. \fi
  7575. \closein 1
  7576. }
  7577. \def\setupdatafile{%
  7578. \catcode`\^^@=\other
  7579. \catcode`\^^A=\other
  7580. \catcode`\^^B=\other
  7581. \catcode`\^^C=\other
  7582. \catcode`\^^D=\other
  7583. \catcode`\^^E=\other
  7584. \catcode`\^^F=\other
  7585. \catcode`\^^G=\other
  7586. \catcode`\^^H=\other
  7587. \catcode`\^^K=\other
  7588. \catcode`\^^L=\other
  7589. \catcode`\^^N=\other
  7590. \catcode`\^^P=\other
  7591. \catcode`\^^Q=\other
  7592. \catcode`\^^R=\other
  7593. \catcode`\^^S=\other
  7594. \catcode`\^^T=\other
  7595. \catcode`\^^U=\other
  7596. \catcode`\^^V=\other
  7597. \catcode`\^^W=\other
  7598. \catcode`\^^X=\other
  7599. \catcode`\^^Z=\other
  7600. \catcode`\^^[=\other
  7601. \catcode`\^^\=\other
  7602. \catcode`\^^]=\other
  7603. \catcode`\^^^=\other
  7604. \catcode`\^^_=\other
  7605. % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
  7606. % in xref tags, i.e., node names. But since ^^e4 notation isn't
  7607. % supported in the main text, it doesn't seem desirable. Furthermore,
  7608. % that is not enough: for node names that actually contain a ^
  7609. % character, we would end up writing a line like this: 'xrdef {'hat
  7610. % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
  7611. % argument, and \hat is not an expandable control sequence. It could
  7612. % all be worked out, but why? Either we support ^^ or we don't.
  7613. %
  7614. % The other change necessary for this was to define \auxhat:
  7615. % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
  7616. % and then to call \auxhat in \setq.
  7617. %
  7618. \catcode`\^=\other
  7619. %
  7620. % Special characters. Should be turned off anyway, but...
  7621. \catcode`\~=\other
  7622. \catcode`\[=\other
  7623. \catcode`\]=\other
  7624. \catcode`\"=\other
  7625. \catcode`\_=\other
  7626. \catcode`\|=\other
  7627. \catcode`\<=\other
  7628. \catcode`\>=\other
  7629. \catcode`\$=\other
  7630. \catcode`\#=\other
  7631. \catcode`\&=\other
  7632. \catcode`\%=\other
  7633. \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
  7634. %
  7635. % This is to support \ in node names and titles, since the \
  7636. % characters end up in a \csname. It's easier than
  7637. % leaving it active and making its active definition an actual \
  7638. % character. What I don't understand is why it works in the *value*
  7639. % of the xrdef. Seems like it should be a catcode12 \, and that
  7640. % should not typeset properly. But it works, so I'm moving on for
  7641. % now. --karl, 15jan04.
  7642. \catcode`\\=\other
  7643. %
  7644. % Make the characters 128-255 be printing characters.
  7645. {%
  7646. \count1=128
  7647. \def\loop{%
  7648. \catcode\count1=\other
  7649. \advance\count1 by 1
  7650. \ifnum \count1<256 \loop \fi
  7651. }%
  7652. }%
  7653. %
  7654. % @ is our escape character in .aux files, and we need braces.
  7655. \catcode`\{=1
  7656. \catcode`\}=2
  7657. \catcode`\@=0
  7658. }
  7659. \def\readdatafile#1{%
  7660. \begingroup
  7661. \setupdatafile
  7662. \input\jobname.#1
  7663. \endgroup}
  7664. \message{insertions,}
  7665. % including footnotes.
  7666. \newcount \footnoteno
  7667. % The trailing space in the following definition for supereject is
  7668. % vital for proper filling; pages come out unaligned when you do a
  7669. % pagealignmacro call if that space before the closing brace is
  7670. % removed. (Generally, numeric constants should always be followed by a
  7671. % space to prevent strange expansion errors.)
  7672. \def\supereject{\par\penalty -20000\footnoteno =0 }
  7673. % @footnotestyle is meaningful for Info output only.
  7674. \let\footnotestyle=\comment
  7675. {\catcode `\@=11
  7676. %
  7677. % Auto-number footnotes. Otherwise like plain.
  7678. \gdef\footnote{%
  7679. \let\indent=\ptexindent
  7680. \let\noindent=\ptexnoindent
  7681. \global\advance\footnoteno by \@ne
  7682. \edef\thisfootno{$^{\the\footnoteno}$}%
  7683. %
  7684. % In case the footnote comes at the end of a sentence, preserve the
  7685. % extra spacing after we do the footnote number.
  7686. \let\@sf\empty
  7687. \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
  7688. %
  7689. % Remove inadvertent blank space before typesetting the footnote number.
  7690. \unskip
  7691. \thisfootno\@sf
  7692. \dofootnote
  7693. }%
  7694. % Don't bother with the trickery in plain.tex to not require the
  7695. % footnote text as a parameter. Our footnotes don't need to be so general.
  7696. %
  7697. % Oh yes, they do; otherwise, @ifset (and anything else that uses
  7698. % \parseargline) fails inside footnotes because the tokens are fixed when
  7699. % the footnote is read. --karl, 16nov96.
  7700. %
  7701. \gdef\dofootnote{%
  7702. \insert\footins\bgroup
  7703. % We want to typeset this text as a normal paragraph, even if the
  7704. % footnote reference occurs in (for example) a display environment.
  7705. % So reset some parameters.
  7706. \hsize=\pagewidth
  7707. \interlinepenalty\interfootnotelinepenalty
  7708. \splittopskip\ht\strutbox % top baseline for broken footnotes
  7709. \splitmaxdepth\dp\strutbox
  7710. \floatingpenalty\@MM
  7711. \leftskip\z@skip
  7712. \rightskip\z@skip
  7713. \spaceskip\z@skip
  7714. \xspaceskip\z@skip
  7715. \parindent\defaultparindent
  7716. %
  7717. \smallfonts \rm
  7718. %
  7719. % Because we use hanging indentation in footnotes, a @noindent appears
  7720. % to exdent this text, so make it be a no-op. makeinfo does not use
  7721. % hanging indentation so @noindent can still be needed within footnote
  7722. % text after an @example or the like (not that this is good style).
  7723. \let\noindent = \relax
  7724. %
  7725. % Hang the footnote text off the number. Use \everypar in case the
  7726. % footnote extends for more than one paragraph.
  7727. \everypar = {\hang}%
  7728. \textindent{\thisfootno}%
  7729. %
  7730. % Don't crash into the line above the footnote text. Since this
  7731. % expands into a box, it must come within the paragraph, lest it
  7732. % provide a place where TeX can split the footnote.
  7733. \footstrut
  7734. %
  7735. % Invoke rest of plain TeX footnote routine.
  7736. \futurelet\next\fo@t
  7737. }
  7738. }%end \catcode `\@=11
  7739. % In case a @footnote appears in a vbox, save the footnote text and create
  7740. % the real \insert just after the vbox finished. Otherwise, the insertion
  7741. % would be lost.
  7742. % Similarly, if a @footnote appears inside an alignment, save the footnote
  7743. % text to a box and make the \insert when a row of the table is finished.
  7744. % And the same can be done for other insert classes. --kasal, 16nov03.
  7745. % Replace the \insert primitive by a cheating macro.
  7746. % Deeper inside, just make sure that the saved insertions are not spilled
  7747. % out prematurely.
  7748. %
  7749. \def\startsavinginserts{%
  7750. \ifx \insert\ptexinsert
  7751. \let\insert\saveinsert
  7752. \else
  7753. \let\checkinserts\relax
  7754. \fi
  7755. }
  7756. % This \insert replacement works for both \insert\footins{foo} and
  7757. % \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}.
  7758. %
  7759. \def\saveinsert#1{%
  7760. \edef\next{\noexpand\savetobox \makeSAVEname#1}%
  7761. \afterassignment\next
  7762. % swallow the left brace
  7763. \let\temp =
  7764. }
  7765. \def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}}
  7766. \def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1}
  7767. \def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi}
  7768. \def\placesaveins#1{%
  7769. \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname
  7770. {\box#1}%
  7771. }
  7772. % eat @SAVE -- beware, all of them have catcode \other:
  7773. {
  7774. \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-)
  7775. \gdef\gobblesave @SAVE{}
  7776. }
  7777. % initialization:
  7778. \def\newsaveins #1{%
  7779. \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}%
  7780. \next
  7781. }
  7782. \def\newsaveinsX #1{%
  7783. \csname newbox\endcsname #1%
  7784. \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts
  7785. \checksaveins #1}%
  7786. }
  7787. % initialize:
  7788. \let\checkinserts\empty
  7789. \newsaveins\footins
  7790. \newsaveins\margin
  7791. % @image. We use the macros from epsf.tex to support this.
  7792. % If epsf.tex is not installed and @image is used, we complain.
  7793. %
  7794. % Check for and read epsf.tex up front. If we read it only at @image
  7795. % time, we might be inside a group, and then its definitions would get
  7796. % undone and the next image would fail.
  7797. \openin 1 = epsf.tex
  7798. \ifeof 1 \else
  7799. % Do not bother showing banner with epsf.tex v2.7k (available in
  7800. % doc/epsf.tex and on ctan).
  7801. \def\epsfannounce{\toks0 = }%
  7802. \input epsf.tex
  7803. \fi
  7804. \closein 1
  7805. %
  7806. % We will only complain once about lack of epsf.tex.
  7807. \newif\ifwarnednoepsf
  7808. \newhelp\noepsfhelp{epsf.tex must be installed for images to
  7809. work. It is also included in the Texinfo distribution, or you can get
  7810. it from ftp://tug.org/tex/epsf.tex.}
  7811. %
  7812. \def\image#1{%
  7813. \ifx\epsfbox\thisisundefined
  7814. \ifwarnednoepsf \else
  7815. \errhelp = \noepsfhelp
  7816. \errmessage{epsf.tex not found, images will be ignored}%
  7817. \global\warnednoepsftrue
  7818. \fi
  7819. \else
  7820. \imagexxx #1,,,,,\finish
  7821. \fi
  7822. }
  7823. %
  7824. % Arguments to @image:
  7825. % #1 is (mandatory) image filename; we tack on .eps extension.
  7826. % #2 is (optional) width, #3 is (optional) height.
  7827. % #4 is (ignored optional) html alt text.
  7828. % #5 is (ignored optional) extension.
  7829. % #6 is just the usual extra ignored arg for parsing stuff.
  7830. \newif\ifimagevmode
  7831. \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
  7832. \catcode`\^^M = 5 % in case we're inside an example
  7833. \normalturnoffactive % allow _ et al. in names
  7834. % If the image is by itself, center it.
  7835. \ifvmode
  7836. \imagevmodetrue
  7837. \else \ifx\centersub\centerV
  7838. % for @center @image, we need a vbox so we can have our vertical space
  7839. \imagevmodetrue
  7840. \vbox\bgroup % vbox has better behavior than vtop herev
  7841. \fi\fi
  7842. %
  7843. \ifimagevmode
  7844. \nobreak\medskip
  7845. % Usually we'll have text after the image which will insert
  7846. % \parskip glue, so insert it here too to equalize the space
  7847. % above and below.
  7848. \nobreak\vskip\parskip
  7849. \nobreak
  7850. \fi
  7851. %
  7852. % Leave vertical mode so that indentation from an enclosing
  7853. % environment such as @quotation is respected.
  7854. % However, if we're at the top level, we don't want the
  7855. % normal paragraph indentation.
  7856. % On the other hand, if we are in the case of @center @image, we don't
  7857. % want to start a paragraph, which will create a hsize-width box and
  7858. % eradicate the centering.
  7859. \ifx\centersub\centerV\else \noindent \fi
  7860. %
  7861. % Output the image.
  7862. \ifpdf
  7863. \dopdfimage{#1}{#2}{#3}%
  7864. \else
  7865. % \epsfbox itself resets \epsf?size at each figure.
  7866. \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
  7867. \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
  7868. \epsfbox{#1.eps}%
  7869. \fi
  7870. %
  7871. \ifimagevmode
  7872. \medskip % space after a standalone image
  7873. \fi
  7874. \ifx\centersub\centerV \egroup \fi
  7875. \endgroup}
  7876. % @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables,
  7877. % etc. We don't actually implement floating yet, we always include the
  7878. % float "here". But it seemed the best name for the future.
  7879. %
  7880. \envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish}
  7881. % There may be a space before second and/or third parameter; delete it.
  7882. \def\eatcommaspace#1, {#1,}
  7883. % #1 is the optional FLOATTYPE, the text label for this float, typically
  7884. % "Figure", "Table", "Example", etc. Can't contain commas. If omitted,
  7885. % this float will not be numbered and cannot be referred to.
  7886. %
  7887. % #2 is the optional xref label. Also must be present for the float to
  7888. % be referable.
  7889. %
  7890. % #3 is the optional positioning argument; for now, it is ignored. It
  7891. % will somehow specify the positions allowed to float to (here, top, bottom).
  7892. %
  7893. % We keep a separate counter for each FLOATTYPE, which we reset at each
  7894. % chapter-level command.
  7895. \let\resetallfloatnos=\empty
  7896. %
  7897. \def\dofloat#1,#2,#3,#4\finish{%
  7898. \let\thiscaption=\empty
  7899. \let\thisshortcaption=\empty
  7900. %
  7901. % don't lose footnotes inside @float.
  7902. %
  7903. % BEWARE: when the floats start float, we have to issue warning whenever an
  7904. % insert appears inside a float which could possibly float. --kasal, 26may04
  7905. %
  7906. \startsavinginserts
  7907. %
  7908. % We can't be used inside a paragraph.
  7909. \par
  7910. %
  7911. \vtop\bgroup
  7912. \def\floattype{#1}%
  7913. \def\floatlabel{#2}%
  7914. \def\floatloc{#3}% we do nothing with this yet.
  7915. %
  7916. \ifx\floattype\empty
  7917. \let\safefloattype=\empty
  7918. \else
  7919. {%
  7920. % the floattype might have accents or other special characters,
  7921. % but we need to use it in a control sequence name.
  7922. \indexnofonts
  7923. \turnoffactive
  7924. \xdef\safefloattype{\floattype}%
  7925. }%
  7926. \fi
  7927. %
  7928. % If label is given but no type, we handle that as the empty type.
  7929. \ifx\floatlabel\empty \else
  7930. % We want each FLOATTYPE to be numbered separately (Figure 1,
  7931. % Table 1, Figure 2, ...). (And if no label, no number.)
  7932. %
  7933. \expandafter\getfloatno\csname\safefloattype floatno\endcsname
  7934. \global\advance\floatno by 1
  7935. %
  7936. {%
  7937. % This magic value for \lastsection is output by \setref as the
  7938. % XREFLABEL-title value. \xrefX uses it to distinguish float
  7939. % labels (which have a completely different output format) from
  7940. % node and anchor labels. And \xrdef uses it to construct the
  7941. % lists of floats.
  7942. %
  7943. \edef\lastsection{\floatmagic=\safefloattype}%
  7944. \setref{\floatlabel}{Yfloat}%
  7945. }%
  7946. \fi
  7947. %
  7948. % start with \parskip glue, I guess.
  7949. \vskip\parskip
  7950. %
  7951. % Don't suppress indentation if a float happens to start a section.
  7952. \restorefirstparagraphindent
  7953. }
  7954. % we have these possibilities:
  7955. % @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap
  7956. % @float Foo,lbl & no caption: Foo 1.1
  7957. % @float Foo & @caption{Cap}: Foo: Cap
  7958. % @float Foo & no caption: Foo
  7959. % @float ,lbl & Caption{Cap}: 1.1: Cap
  7960. % @float ,lbl & no caption: 1.1
  7961. % @float & @caption{Cap}: Cap
  7962. % @float & no caption:
  7963. %
  7964. \def\Efloat{%
  7965. \let\floatident = \empty
  7966. %
  7967. % In all cases, if we have a float type, it comes first.
  7968. \ifx\floattype\empty \else \def\floatident{\floattype}\fi
  7969. %
  7970. % If we have an xref label, the number comes next.
  7971. \ifx\floatlabel\empty \else
  7972. \ifx\floattype\empty \else % if also had float type, need tie first.
  7973. \appendtomacro\floatident{\tie}%
  7974. \fi
  7975. % the number.
  7976. \appendtomacro\floatident{\chaplevelprefix\the\floatno}%
  7977. \fi
  7978. %
  7979. % Start the printed caption with what we've constructed in
  7980. % \floatident, but keep it separate; we need \floatident again.
  7981. \let\captionline = \floatident
  7982. %
  7983. \ifx\thiscaption\empty \else
  7984. \ifx\floatident\empty \else
  7985. \appendtomacro\captionline{: }% had ident, so need a colon between
  7986. \fi
  7987. %
  7988. % caption text.
  7989. \appendtomacro\captionline{\scanexp\thiscaption}%
  7990. \fi
  7991. %
  7992. % If we have anything to print, print it, with space before.
  7993. % Eventually this needs to become an \insert.
  7994. \ifx\captionline\empty \else
  7995. \vskip.5\parskip
  7996. \captionline
  7997. %
  7998. % Space below caption.
  7999. \vskip\parskip
  8000. \fi
  8001. %
  8002. % If have an xref label, write the list of floats info. Do this
  8003. % after the caption, to avoid chance of it being a breakpoint.
  8004. \ifx\floatlabel\empty \else
  8005. % Write the text that goes in the lof to the aux file as
  8006. % \floatlabel-lof. Besides \floatident, we include the short
  8007. % caption if specified, else the full caption if specified, else nothing.
  8008. {%
  8009. \atdummies
  8010. %
  8011. % since we read the caption text in the macro world, where ^^M
  8012. % is turned into a normal character, we have to scan it back, so
  8013. % we don't write the literal three characters "^^M" into the aux file.
  8014. \scanexp{%
  8015. \xdef\noexpand\gtemp{%
  8016. \ifx\thisshortcaption\empty
  8017. \thiscaption
  8018. \else
  8019. \thisshortcaption
  8020. \fi
  8021. }%
  8022. }%
  8023. \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident
  8024. \ifx\gtemp\empty \else : \gtemp \fi}}%
  8025. }%
  8026. \fi
  8027. \egroup % end of \vtop
  8028. %
  8029. % place the captured inserts
  8030. %
  8031. % BEWARE: when the floats start floating, we have to issue warning
  8032. % whenever an insert appears inside a float which could possibly
  8033. % float. --kasal, 26may04
  8034. %
  8035. \checkinserts
  8036. }
  8037. % Append the tokens #2 to the definition of macro #1, not expanding either.
  8038. %
  8039. \def\appendtomacro#1#2{%
  8040. \expandafter\def\expandafter#1\expandafter{#1#2}%
  8041. }
  8042. % @caption, @shortcaption
  8043. %
  8044. \def\caption{\docaption\thiscaption}
  8045. \def\shortcaption{\docaption\thisshortcaption}
  8046. \def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption}
  8047. \def\defcaption#1#2{\egroup \def#1{#2}}
  8048. % The parameter is the control sequence identifying the counter we are
  8049. % going to use. Create it if it doesn't exist and assign it to \floatno.
  8050. \def\getfloatno#1{%
  8051. \ifx#1\relax
  8052. % Haven't seen this figure type before.
  8053. \csname newcount\endcsname #1%
  8054. %
  8055. % Remember to reset this floatno at the next chap.
  8056. \expandafter\gdef\expandafter\resetallfloatnos
  8057. \expandafter{\resetallfloatnos #1=0 }%
  8058. \fi
  8059. \let\floatno#1%
  8060. }
  8061. % \setref calls this to get the XREFLABEL-snt value. We want an @xref
  8062. % to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we
  8063. % first read the @float command.
  8064. %
  8065. \def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}%
  8066. % Magic string used for the XREFLABEL-title value, so \xrefX can
  8067. % distinguish floats from other xref types.
  8068. \def\floatmagic{!!float!!}
  8069. % #1 is the control sequence we are passed; we expand into a conditional
  8070. % which is true if #1 represents a float ref. That is, the magic
  8071. % \lastsection value which we \setref above.
  8072. %
  8073. \def\iffloat#1{\expandafter\doiffloat#1==\finish}
  8074. %
  8075. % #1 is (maybe) the \floatmagic string. If so, #2 will be the
  8076. % (safe) float type for this float. We set \iffloattype to #2.
  8077. %
  8078. \def\doiffloat#1=#2=#3\finish{%
  8079. \def\temp{#1}%
  8080. \def\iffloattype{#2}%
  8081. \ifx\temp\floatmagic
  8082. }
  8083. % @listoffloats FLOATTYPE - print a list of floats like a table of contents.
  8084. %
  8085. \parseargdef\listoffloats{%
  8086. \def\floattype{#1}% floattype
  8087. {%
  8088. % the floattype might have accents or other special characters,
  8089. % but we need to use it in a control sequence name.
  8090. \indexnofonts
  8091. \turnoffactive
  8092. \xdef\safefloattype{\floattype}%
  8093. }%
  8094. %
  8095. % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE.
  8096. \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax
  8097. \ifhavexrefs
  8098. % if the user said @listoffloats foo but never @float foo.
  8099. \message{\linenumber No `\safefloattype' floats to list.}%
  8100. \fi
  8101. \else
  8102. \begingroup
  8103. \leftskip=\tocindent % indent these entries like a toc
  8104. \let\do=\listoffloatsdo
  8105. \csname floatlist\safefloattype\endcsname
  8106. \endgroup
  8107. \fi
  8108. }
  8109. % This is called on each entry in a list of floats. We're passed the
  8110. % xref label, in the form LABEL-title, which is how we save it in the
  8111. % aux file. We strip off the -title and look up \XRLABEL-lof, which
  8112. % has the text we're supposed to typeset here.
  8113. %
  8114. % Figures without xref labels will not be included in the list (since
  8115. % they won't appear in the aux file).
  8116. %
  8117. \def\listoffloatsdo#1{\listoffloatsdoentry#1\finish}
  8118. \def\listoffloatsdoentry#1-title\finish{{%
  8119. % Can't fully expand XR#1-lof because it can contain anything. Just
  8120. % pass the control sequence. On the other hand, XR#1-pg is just the
  8121. % page number, and we want to fully expand that so we can get a link
  8122. % in pdf output.
  8123. \toksA = \expandafter{\csname XR#1-lof\endcsname}%
  8124. %
  8125. % use the same \entry macro we use to generate the TOC and index.
  8126. \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}%
  8127. \writeentry
  8128. }}
  8129. \message{localization,}
  8130. % For single-language documents, @documentlanguage is usually given very
  8131. % early, just after @documentencoding. Single argument is the language
  8132. % (de) or locale (de_DE) abbreviation.
  8133. %
  8134. {
  8135. \catcode`\_ = \active
  8136. \globaldefs=1
  8137. \parseargdef\documentlanguage{\begingroup
  8138. \let_=\normalunderscore % normal _ character for filenames
  8139. \tex % read txi-??.tex file in plain TeX.
  8140. % Read the file by the name they passed if it exists.
  8141. \openin 1 txi-#1.tex
  8142. \ifeof 1
  8143. \documentlanguagetrywithoutunderscore{#1_\finish}%
  8144. \else
  8145. \globaldefs = 1 % everything in the txi-LL files needs to persist
  8146. \input txi-#1.tex
  8147. \fi
  8148. \closein 1
  8149. \endgroup % end raw TeX
  8150. \endgroup}
  8151. %
  8152. % If they passed de_DE, and txi-de_DE.tex doesn't exist,
  8153. % try txi-de.tex.
  8154. %
  8155. \gdef\documentlanguagetrywithoutunderscore#1_#2\finish{%
  8156. \openin 1 txi-#1.tex
  8157. \ifeof 1
  8158. \errhelp = \nolanghelp
  8159. \errmessage{Cannot read language file txi-#1.tex}%
  8160. \else
  8161. \globaldefs = 1 % everything in the txi-LL files needs to persist
  8162. \input txi-#1.tex
  8163. \fi
  8164. \closein 1
  8165. }
  8166. }% end of special _ catcode
  8167. %
  8168. \newhelp\nolanghelp{The given language definition file cannot be found or
  8169. is empty. Maybe you need to install it? Putting it in the current
  8170. directory should work if nowhere else does.}
  8171. % This macro is called from txi-??.tex files; the first argument is the
  8172. % \language name to set (without the "\lang@" prefix), the second and
  8173. % third args are \{left,right}hyphenmin.
  8174. %
  8175. % The language names to pass are determined when the format is built.
  8176. % See the etex.log file created at that time, e.g.,
  8177. % /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log.
  8178. %
  8179. % With TeX Live 2008, etex now includes hyphenation patterns for all
  8180. % available languages. This means we can support hyphenation in
  8181. % Texinfo, at least to some extent. (This still doesn't solve the
  8182. % accented characters problem.)
  8183. %
  8184. \catcode`@=11
  8185. \def\txisetlanguage#1#2#3{%
  8186. % do not set the language if the name is undefined in the current TeX.
  8187. \expandafter\ifx\csname lang@#1\endcsname \relax
  8188. \message{no patterns for #1}%
  8189. \else
  8190. \global\language = \csname lang@#1\endcsname
  8191. \fi
  8192. % but there is no harm in adjusting the hyphenmin values regardless.
  8193. \global\lefthyphenmin = #2\relax
  8194. \global\righthyphenmin = #3\relax
  8195. }
  8196. % Helpers for encodings.
  8197. % Set the catcode of characters 128 through 255 to the specified number.
  8198. %
  8199. \def\setnonasciicharscatcode#1{%
  8200. \count255=128
  8201. \loop\ifnum\count255<256
  8202. \global\catcode\count255=#1\relax
  8203. \advance\count255 by 1
  8204. \repeat
  8205. }
  8206. \def\setnonasciicharscatcodenonglobal#1{%
  8207. \count255=128
  8208. \loop\ifnum\count255<256
  8209. \catcode\count255=#1\relax
  8210. \advance\count255 by 1
  8211. \repeat
  8212. }
  8213. % @documentencoding sets the definition of non-ASCII characters
  8214. % according to the specified encoding.
  8215. %
  8216. \parseargdef\documentencoding{%
  8217. % Encoding being declared for the document.
  8218. \def\declaredencoding{\csname #1.enc\endcsname}%
  8219. %
  8220. % Supported encodings: names converted to tokens in order to be able
  8221. % to compare them with \ifx.
  8222. \def\ascii{\csname US-ASCII.enc\endcsname}%
  8223. \def\latnine{\csname ISO-8859-15.enc\endcsname}%
  8224. \def\latone{\csname ISO-8859-1.enc\endcsname}%
  8225. \def\lattwo{\csname ISO-8859-2.enc\endcsname}%
  8226. \def\utfeight{\csname UTF-8.enc\endcsname}%
  8227. %
  8228. \ifx \declaredencoding \ascii
  8229. \asciichardefs
  8230. %
  8231. \else \ifx \declaredencoding \lattwo
  8232. \setnonasciicharscatcode\active
  8233. \lattwochardefs
  8234. %
  8235. \else \ifx \declaredencoding \latone
  8236. \setnonasciicharscatcode\active
  8237. \latonechardefs
  8238. %
  8239. \else \ifx \declaredencoding \latnine
  8240. \setnonasciicharscatcode\active
  8241. \latninechardefs
  8242. %
  8243. \else \ifx \declaredencoding \utfeight
  8244. \setnonasciicharscatcode\active
  8245. \utfeightchardefs
  8246. %
  8247. \else
  8248. \message{Unknown document encoding #1, ignoring.}%
  8249. %
  8250. \fi % utfeight
  8251. \fi % latnine
  8252. \fi % latone
  8253. \fi % lattwo
  8254. \fi % ascii
  8255. }
  8256. % A message to be logged when using a character that isn't available
  8257. % the default font encoding (OT1).
  8258. %
  8259. \def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}}
  8260. % Take account of \c (plain) vs. \, (Texinfo) difference.
  8261. \def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
  8262. % First, make active non-ASCII characters in order for them to be
  8263. % correctly categorized when TeX reads the replacement text of
  8264. % macros containing the character definitions.
  8265. \setnonasciicharscatcode\active
  8266. %
  8267. % Latin1 (ISO-8859-1) character definitions.
  8268. \def\latonechardefs{%
  8269. \gdef^^a0{\tie}
  8270. \gdef^^a1{\exclamdown}
  8271. \gdef^^a2{\missingcharmsg{CENT SIGN}}
  8272. \gdef^^a3{{\pounds}}
  8273. \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
  8274. \gdef^^a5{\missingcharmsg{YEN SIGN}}
  8275. \gdef^^a6{\missingcharmsg{BROKEN BAR}}
  8276. \gdef^^a7{\S}
  8277. \gdef^^a8{\"{}}
  8278. \gdef^^a9{\copyright}
  8279. \gdef^^aa{\ordf}
  8280. \gdef^^ab{\guillemetleft}
  8281. \gdef^^ac{$\lnot$}
  8282. \gdef^^ad{\-}
  8283. \gdef^^ae{\registeredsymbol}
  8284. \gdef^^af{\={}}
  8285. %
  8286. \gdef^^b0{\textdegree}
  8287. \gdef^^b1{$\pm$}
  8288. \gdef^^b2{$^2$}
  8289. \gdef^^b3{$^3$}
  8290. \gdef^^b4{\'{}}
  8291. \gdef^^b5{$\mu$}
  8292. \gdef^^b6{\P}
  8293. %
  8294. \gdef^^b7{$^.$}
  8295. \gdef^^b8{\cedilla\ }
  8296. \gdef^^b9{$^1$}
  8297. \gdef^^ba{\ordm}
  8298. %
  8299. \gdef^^bb{\guillemetright}
  8300. \gdef^^bc{$1\over4$}
  8301. \gdef^^bd{$1\over2$}
  8302. \gdef^^be{$3\over4$}
  8303. \gdef^^bf{\questiondown}
  8304. %
  8305. \gdef^^c0{\`A}
  8306. \gdef^^c1{\'A}
  8307. \gdef^^c2{\^A}
  8308. \gdef^^c3{\~A}
  8309. \gdef^^c4{\"A}
  8310. \gdef^^c5{\ringaccent A}
  8311. \gdef^^c6{\AE}
  8312. \gdef^^c7{\cedilla C}
  8313. \gdef^^c8{\`E}
  8314. \gdef^^c9{\'E}
  8315. \gdef^^ca{\^E}
  8316. \gdef^^cb{\"E}
  8317. \gdef^^cc{\`I}
  8318. \gdef^^cd{\'I}
  8319. \gdef^^ce{\^I}
  8320. \gdef^^cf{\"I}
  8321. %
  8322. \gdef^^d0{\DH}
  8323. \gdef^^d1{\~N}
  8324. \gdef^^d2{\`O}
  8325. \gdef^^d3{\'O}
  8326. \gdef^^d4{\^O}
  8327. \gdef^^d5{\~O}
  8328. \gdef^^d6{\"O}
  8329. \gdef^^d7{$\times$}
  8330. \gdef^^d8{\O}
  8331. \gdef^^d9{\`U}
  8332. \gdef^^da{\'U}
  8333. \gdef^^db{\^U}
  8334. \gdef^^dc{\"U}
  8335. \gdef^^dd{\'Y}
  8336. \gdef^^de{\TH}
  8337. \gdef^^df{\ss}
  8338. %
  8339. \gdef^^e0{\`a}
  8340. \gdef^^e1{\'a}
  8341. \gdef^^e2{\^a}
  8342. \gdef^^e3{\~a}
  8343. \gdef^^e4{\"a}
  8344. \gdef^^e5{\ringaccent a}
  8345. \gdef^^e6{\ae}
  8346. \gdef^^e7{\cedilla c}
  8347. \gdef^^e8{\`e}
  8348. \gdef^^e9{\'e}
  8349. \gdef^^ea{\^e}
  8350. \gdef^^eb{\"e}
  8351. \gdef^^ec{\`{\dotless i}}
  8352. \gdef^^ed{\'{\dotless i}}
  8353. \gdef^^ee{\^{\dotless i}}
  8354. \gdef^^ef{\"{\dotless i}}
  8355. %
  8356. \gdef^^f0{\dh}
  8357. \gdef^^f1{\~n}
  8358. \gdef^^f2{\`o}
  8359. \gdef^^f3{\'o}
  8360. \gdef^^f4{\^o}
  8361. \gdef^^f5{\~o}
  8362. \gdef^^f6{\"o}
  8363. \gdef^^f7{$\div$}
  8364. \gdef^^f8{\o}
  8365. \gdef^^f9{\`u}
  8366. \gdef^^fa{\'u}
  8367. \gdef^^fb{\^u}
  8368. \gdef^^fc{\"u}
  8369. \gdef^^fd{\'y}
  8370. \gdef^^fe{\th}
  8371. \gdef^^ff{\"y}
  8372. }
  8373. % Latin9 (ISO-8859-15) encoding character definitions.
  8374. \def\latninechardefs{%
  8375. % Encoding is almost identical to Latin1.
  8376. \latonechardefs
  8377. %
  8378. \gdef^^a4{\euro}
  8379. \gdef^^a6{\v S}
  8380. \gdef^^a8{\v s}
  8381. \gdef^^b4{\v Z}
  8382. \gdef^^b8{\v z}
  8383. \gdef^^bc{\OE}
  8384. \gdef^^bd{\oe}
  8385. \gdef^^be{\"Y}
  8386. }
  8387. % Latin2 (ISO-8859-2) character definitions.
  8388. \def\lattwochardefs{%
  8389. \gdef^^a0{\tie}
  8390. \gdef^^a1{\ogonek{A}}
  8391. \gdef^^a2{\u{}}
  8392. \gdef^^a3{\L}
  8393. \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
  8394. \gdef^^a5{\v L}
  8395. \gdef^^a6{\'S}
  8396. \gdef^^a7{\S}
  8397. \gdef^^a8{\"{}}
  8398. \gdef^^a9{\v S}
  8399. \gdef^^aa{\cedilla S}
  8400. \gdef^^ab{\v T}
  8401. \gdef^^ac{\'Z}
  8402. \gdef^^ad{\-}
  8403. \gdef^^ae{\v Z}
  8404. \gdef^^af{\dotaccent Z}
  8405. %
  8406. \gdef^^b0{\textdegree}
  8407. \gdef^^b1{\ogonek{a}}
  8408. \gdef^^b2{\ogonek{ }}
  8409. \gdef^^b3{\l}
  8410. \gdef^^b4{\'{}}
  8411. \gdef^^b5{\v l}
  8412. \gdef^^b6{\'s}
  8413. \gdef^^b7{\v{}}
  8414. \gdef^^b8{\cedilla\ }
  8415. \gdef^^b9{\v s}
  8416. \gdef^^ba{\cedilla s}
  8417. \gdef^^bb{\v t}
  8418. \gdef^^bc{\'z}
  8419. \gdef^^bd{\H{}}
  8420. \gdef^^be{\v z}
  8421. \gdef^^bf{\dotaccent z}
  8422. %
  8423. \gdef^^c0{\'R}
  8424. \gdef^^c1{\'A}
  8425. \gdef^^c2{\^A}
  8426. \gdef^^c3{\u A}
  8427. \gdef^^c4{\"A}
  8428. \gdef^^c5{\'L}
  8429. \gdef^^c6{\'C}
  8430. \gdef^^c7{\cedilla C}
  8431. \gdef^^c8{\v C}
  8432. \gdef^^c9{\'E}
  8433. \gdef^^ca{\ogonek{E}}
  8434. \gdef^^cb{\"E}
  8435. \gdef^^cc{\v E}
  8436. \gdef^^cd{\'I}
  8437. \gdef^^ce{\^I}
  8438. \gdef^^cf{\v D}
  8439. %
  8440. \gdef^^d0{\DH}
  8441. \gdef^^d1{\'N}
  8442. \gdef^^d2{\v N}
  8443. \gdef^^d3{\'O}
  8444. \gdef^^d4{\^O}
  8445. \gdef^^d5{\H O}
  8446. \gdef^^d6{\"O}
  8447. \gdef^^d7{$\times$}
  8448. \gdef^^d8{\v R}
  8449. \gdef^^d9{\ringaccent U}
  8450. \gdef^^da{\'U}
  8451. \gdef^^db{\H U}
  8452. \gdef^^dc{\"U}
  8453. \gdef^^dd{\'Y}
  8454. \gdef^^de{\cedilla T}
  8455. \gdef^^df{\ss}
  8456. %
  8457. \gdef^^e0{\'r}
  8458. \gdef^^e1{\'a}
  8459. \gdef^^e2{\^a}
  8460. \gdef^^e3{\u a}
  8461. \gdef^^e4{\"a}
  8462. \gdef^^e5{\'l}
  8463. \gdef^^e6{\'c}
  8464. \gdef^^e7{\cedilla c}
  8465. \gdef^^e8{\v c}
  8466. \gdef^^e9{\'e}
  8467. \gdef^^ea{\ogonek{e}}
  8468. \gdef^^eb{\"e}
  8469. \gdef^^ec{\v e}
  8470. \gdef^^ed{\'{\dotless{i}}}
  8471. \gdef^^ee{\^{\dotless{i}}}
  8472. \gdef^^ef{\v d}
  8473. %
  8474. \gdef^^f0{\dh}
  8475. \gdef^^f1{\'n}
  8476. \gdef^^f2{\v n}
  8477. \gdef^^f3{\'o}
  8478. \gdef^^f4{\^o}
  8479. \gdef^^f5{\H o}
  8480. \gdef^^f6{\"o}
  8481. \gdef^^f7{$\div$}
  8482. \gdef^^f8{\v r}
  8483. \gdef^^f9{\ringaccent u}
  8484. \gdef^^fa{\'u}
  8485. \gdef^^fb{\H u}
  8486. \gdef^^fc{\"u}
  8487. \gdef^^fd{\'y}
  8488. \gdef^^fe{\cedilla t}
  8489. \gdef^^ff{\dotaccent{}}
  8490. }
  8491. % UTF-8 character definitions.
  8492. %
  8493. % This code to support UTF-8 is based on LaTeX's utf8.def, with some
  8494. % changes for Texinfo conventions. It is included here under the GPL by
  8495. % permission from Frank Mittelbach and the LaTeX team.
  8496. %
  8497. \newcount\countUTFx
  8498. \newcount\countUTFy
  8499. \newcount\countUTFz
  8500. \gdef\UTFviiiTwoOctets#1#2{\expandafter
  8501. \UTFviiiDefined\csname u8:#1\string #2\endcsname}
  8502. %
  8503. \gdef\UTFviiiThreeOctets#1#2#3{\expandafter
  8504. \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname}
  8505. %
  8506. \gdef\UTFviiiFourOctets#1#2#3#4{\expandafter
  8507. \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname}
  8508. \gdef\UTFviiiDefined#1{%
  8509. \ifx #1\relax
  8510. \message{\linenumber Unicode char \string #1 not defined for Texinfo}%
  8511. \else
  8512. \expandafter #1%
  8513. \fi
  8514. }
  8515. \begingroup
  8516. \catcode`\~13
  8517. \catcode`\"12
  8518. \def\UTFviiiLoop{%
  8519. \global\catcode\countUTFx\active
  8520. \uccode`\~\countUTFx
  8521. \uppercase\expandafter{\UTFviiiTmp}%
  8522. \advance\countUTFx by 1
  8523. \ifnum\countUTFx < \countUTFy
  8524. \expandafter\UTFviiiLoop
  8525. \fi}
  8526. \countUTFx = "C2
  8527. \countUTFy = "E0
  8528. \def\UTFviiiTmp{%
  8529. \xdef~{\noexpand\UTFviiiTwoOctets\string~}}
  8530. \UTFviiiLoop
  8531. \countUTFx = "E0
  8532. \countUTFy = "F0
  8533. \def\UTFviiiTmp{%
  8534. \xdef~{\noexpand\UTFviiiThreeOctets\string~}}
  8535. \UTFviiiLoop
  8536. \countUTFx = "F0
  8537. \countUTFy = "F4
  8538. \def\UTFviiiTmp{%
  8539. \xdef~{\noexpand\UTFviiiFourOctets\string~}}
  8540. \UTFviiiLoop
  8541. \endgroup
  8542. \begingroup
  8543. \catcode`\"=12
  8544. \catcode`\<=12
  8545. \catcode`\.=12
  8546. \catcode`\,=12
  8547. \catcode`\;=12
  8548. \catcode`\!=12
  8549. \catcode`\~=13
  8550. \gdef\DeclareUnicodeCharacter#1#2{%
  8551. \countUTFz = "#1\relax
  8552. %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%
  8553. \begingroup
  8554. \parseXMLCharref
  8555. \def\UTFviiiTwoOctets##1##2{%
  8556. \csname u8:##1\string ##2\endcsname}%
  8557. \def\UTFviiiThreeOctets##1##2##3{%
  8558. \csname u8:##1\string ##2\string ##3\endcsname}%
  8559. \def\UTFviiiFourOctets##1##2##3##4{%
  8560. \csname u8:##1\string ##2\string ##3\string ##4\endcsname}%
  8561. \expandafter\expandafter\expandafter\expandafter
  8562. \expandafter\expandafter\expandafter
  8563. \gdef\UTFviiiTmp{#2}%
  8564. \endgroup}
  8565. \gdef\parseXMLCharref{%
  8566. \ifnum\countUTFz < "A0\relax
  8567. \errhelp = \EMsimple
  8568. \errmessage{Cannot define Unicode char value < 00A0}%
  8569. \else\ifnum\countUTFz < "800\relax
  8570. \parseUTFviiiA,%
  8571. \parseUTFviiiB C\UTFviiiTwoOctets.,%
  8572. \else\ifnum\countUTFz < "10000\relax
  8573. \parseUTFviiiA;%
  8574. \parseUTFviiiA,%
  8575. \parseUTFviiiB E\UTFviiiThreeOctets.{,;}%
  8576. \else
  8577. \parseUTFviiiA;%
  8578. \parseUTFviiiA,%
  8579. \parseUTFviiiA!%
  8580. \parseUTFviiiB F\UTFviiiFourOctets.{!,;}%
  8581. \fi\fi\fi
  8582. }
  8583. \gdef\parseUTFviiiA#1{%
  8584. \countUTFx = \countUTFz
  8585. \divide\countUTFz by 64
  8586. \countUTFy = \countUTFz
  8587. \multiply\countUTFz by 64
  8588. \advance\countUTFx by -\countUTFz
  8589. \advance\countUTFx by 128
  8590. \uccode `#1\countUTFx
  8591. \countUTFz = \countUTFy}
  8592. \gdef\parseUTFviiiB#1#2#3#4{%
  8593. \advance\countUTFz by "#10\relax
  8594. \uccode `#3\countUTFz
  8595. \uppercase{\gdef\UTFviiiTmp{#2#3#4}}}
  8596. \endgroup
  8597. \def\utfeightchardefs{%
  8598. \DeclareUnicodeCharacter{00A0}{\tie}
  8599. \DeclareUnicodeCharacter{00A1}{\exclamdown}
  8600. \DeclareUnicodeCharacter{00A3}{\pounds}
  8601. \DeclareUnicodeCharacter{00A8}{\"{ }}
  8602. \DeclareUnicodeCharacter{00A9}{\copyright}
  8603. \DeclareUnicodeCharacter{00AA}{\ordf}
  8604. \DeclareUnicodeCharacter{00AB}{\guillemetleft}
  8605. \DeclareUnicodeCharacter{00AD}{\-}
  8606. \DeclareUnicodeCharacter{00AE}{\registeredsymbol}
  8607. \DeclareUnicodeCharacter{00AF}{\={ }}
  8608. \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}
  8609. \DeclareUnicodeCharacter{00B4}{\'{ }}
  8610. \DeclareUnicodeCharacter{00B8}{\cedilla{ }}
  8611. \DeclareUnicodeCharacter{00BA}{\ordm}
  8612. \DeclareUnicodeCharacter{00BB}{\guillemetright}
  8613. \DeclareUnicodeCharacter{00BF}{\questiondown}
  8614. \DeclareUnicodeCharacter{00C0}{\`A}
  8615. \DeclareUnicodeCharacter{00C1}{\'A}
  8616. \DeclareUnicodeCharacter{00C2}{\^A}
  8617. \DeclareUnicodeCharacter{00C3}{\~A}
  8618. \DeclareUnicodeCharacter{00C4}{\"A}
  8619. \DeclareUnicodeCharacter{00C5}{\AA}
  8620. \DeclareUnicodeCharacter{00C6}{\AE}
  8621. \DeclareUnicodeCharacter{00C7}{\cedilla{C}}
  8622. \DeclareUnicodeCharacter{00C8}{\`E}
  8623. \DeclareUnicodeCharacter{00C9}{\'E}
  8624. \DeclareUnicodeCharacter{00CA}{\^E}
  8625. \DeclareUnicodeCharacter{00CB}{\"E}
  8626. \DeclareUnicodeCharacter{00CC}{\`I}
  8627. \DeclareUnicodeCharacter{00CD}{\'I}
  8628. \DeclareUnicodeCharacter{00CE}{\^I}
  8629. \DeclareUnicodeCharacter{00CF}{\"I}
  8630. \DeclareUnicodeCharacter{00D0}{\DH}
  8631. \DeclareUnicodeCharacter{00D1}{\~N}
  8632. \DeclareUnicodeCharacter{00D2}{\`O}
  8633. \DeclareUnicodeCharacter{00D3}{\'O}
  8634. \DeclareUnicodeCharacter{00D4}{\^O}
  8635. \DeclareUnicodeCharacter{00D5}{\~O}
  8636. \DeclareUnicodeCharacter{00D6}{\"O}
  8637. \DeclareUnicodeCharacter{00D8}{\O}
  8638. \DeclareUnicodeCharacter{00D9}{\`U}
  8639. \DeclareUnicodeCharacter{00DA}{\'U}
  8640. \DeclareUnicodeCharacter{00DB}{\^U}
  8641. \DeclareUnicodeCharacter{00DC}{\"U}
  8642. \DeclareUnicodeCharacter{00DD}{\'Y}
  8643. \DeclareUnicodeCharacter{00DE}{\TH}
  8644. \DeclareUnicodeCharacter{00DF}{\ss}
  8645. \DeclareUnicodeCharacter{00E0}{\`a}
  8646. \DeclareUnicodeCharacter{00E1}{\'a}
  8647. \DeclareUnicodeCharacter{00E2}{\^a}
  8648. \DeclareUnicodeCharacter{00E3}{\~a}
  8649. \DeclareUnicodeCharacter{00E4}{\"a}
  8650. \DeclareUnicodeCharacter{00E5}{\aa}
  8651. \DeclareUnicodeCharacter{00E6}{\ae}
  8652. \DeclareUnicodeCharacter{00E7}{\cedilla{c}}
  8653. \DeclareUnicodeCharacter{00E8}{\`e}
  8654. \DeclareUnicodeCharacter{00E9}{\'e}
  8655. \DeclareUnicodeCharacter{00EA}{\^e}
  8656. \DeclareUnicodeCharacter{00EB}{\"e}
  8657. \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}
  8658. \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}
  8659. \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}
  8660. \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}
  8661. \DeclareUnicodeCharacter{00F0}{\dh}
  8662. \DeclareUnicodeCharacter{00F1}{\~n}
  8663. \DeclareUnicodeCharacter{00F2}{\`o}
  8664. \DeclareUnicodeCharacter{00F3}{\'o}
  8665. \DeclareUnicodeCharacter{00F4}{\^o}
  8666. \DeclareUnicodeCharacter{00F5}{\~o}
  8667. \DeclareUnicodeCharacter{00F6}{\"o}
  8668. \DeclareUnicodeCharacter{00F8}{\o}
  8669. \DeclareUnicodeCharacter{00F9}{\`u}
  8670. \DeclareUnicodeCharacter{00FA}{\'u}
  8671. \DeclareUnicodeCharacter{00FB}{\^u}
  8672. \DeclareUnicodeCharacter{00FC}{\"u}
  8673. \DeclareUnicodeCharacter{00FD}{\'y}
  8674. \DeclareUnicodeCharacter{00FE}{\th}
  8675. \DeclareUnicodeCharacter{00FF}{\"y}
  8676. \DeclareUnicodeCharacter{0100}{\=A}
  8677. \DeclareUnicodeCharacter{0101}{\=a}
  8678. \DeclareUnicodeCharacter{0102}{\u{A}}
  8679. \DeclareUnicodeCharacter{0103}{\u{a}}
  8680. \DeclareUnicodeCharacter{0104}{\ogonek{A}}
  8681. \DeclareUnicodeCharacter{0105}{\ogonek{a}}
  8682. \DeclareUnicodeCharacter{0106}{\'C}
  8683. \DeclareUnicodeCharacter{0107}{\'c}
  8684. \DeclareUnicodeCharacter{0108}{\^C}
  8685. \DeclareUnicodeCharacter{0109}{\^c}
  8686. \DeclareUnicodeCharacter{0118}{\ogonek{E}}
  8687. \DeclareUnicodeCharacter{0119}{\ogonek{e}}
  8688. \DeclareUnicodeCharacter{010A}{\dotaccent{C}}
  8689. \DeclareUnicodeCharacter{010B}{\dotaccent{c}}
  8690. \DeclareUnicodeCharacter{010C}{\v{C}}
  8691. \DeclareUnicodeCharacter{010D}{\v{c}}
  8692. \DeclareUnicodeCharacter{010E}{\v{D}}
  8693. \DeclareUnicodeCharacter{0112}{\=E}
  8694. \DeclareUnicodeCharacter{0113}{\=e}
  8695. \DeclareUnicodeCharacter{0114}{\u{E}}
  8696. \DeclareUnicodeCharacter{0115}{\u{e}}
  8697. \DeclareUnicodeCharacter{0116}{\dotaccent{E}}
  8698. \DeclareUnicodeCharacter{0117}{\dotaccent{e}}
  8699. \DeclareUnicodeCharacter{011A}{\v{E}}
  8700. \DeclareUnicodeCharacter{011B}{\v{e}}
  8701. \DeclareUnicodeCharacter{011C}{\^G}
  8702. \DeclareUnicodeCharacter{011D}{\^g}
  8703. \DeclareUnicodeCharacter{011E}{\u{G}}
  8704. \DeclareUnicodeCharacter{011F}{\u{g}}
  8705. \DeclareUnicodeCharacter{0120}{\dotaccent{G}}
  8706. \DeclareUnicodeCharacter{0121}{\dotaccent{g}}
  8707. \DeclareUnicodeCharacter{0124}{\^H}
  8708. \DeclareUnicodeCharacter{0125}{\^h}
  8709. \DeclareUnicodeCharacter{0128}{\~I}
  8710. \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}
  8711. \DeclareUnicodeCharacter{012A}{\=I}
  8712. \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}
  8713. \DeclareUnicodeCharacter{012C}{\u{I}}
  8714. \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}
  8715. \DeclareUnicodeCharacter{0130}{\dotaccent{I}}
  8716. \DeclareUnicodeCharacter{0131}{\dotless{i}}
  8717. \DeclareUnicodeCharacter{0132}{IJ}
  8718. \DeclareUnicodeCharacter{0133}{ij}
  8719. \DeclareUnicodeCharacter{0134}{\^J}
  8720. \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}
  8721. \DeclareUnicodeCharacter{0139}{\'L}
  8722. \DeclareUnicodeCharacter{013A}{\'l}
  8723. \DeclareUnicodeCharacter{0141}{\L}
  8724. \DeclareUnicodeCharacter{0142}{\l}
  8725. \DeclareUnicodeCharacter{0143}{\'N}
  8726. \DeclareUnicodeCharacter{0144}{\'n}
  8727. \DeclareUnicodeCharacter{0147}{\v{N}}
  8728. \DeclareUnicodeCharacter{0148}{\v{n}}
  8729. \DeclareUnicodeCharacter{014C}{\=O}
  8730. \DeclareUnicodeCharacter{014D}{\=o}
  8731. \DeclareUnicodeCharacter{014E}{\u{O}}
  8732. \DeclareUnicodeCharacter{014F}{\u{o}}
  8733. \DeclareUnicodeCharacter{0150}{\H{O}}
  8734. \DeclareUnicodeCharacter{0151}{\H{o}}
  8735. \DeclareUnicodeCharacter{0152}{\OE}
  8736. \DeclareUnicodeCharacter{0153}{\oe}
  8737. \DeclareUnicodeCharacter{0154}{\'R}
  8738. \DeclareUnicodeCharacter{0155}{\'r}
  8739. \DeclareUnicodeCharacter{0158}{\v{R}}
  8740. \DeclareUnicodeCharacter{0159}{\v{r}}
  8741. \DeclareUnicodeCharacter{015A}{\'S}
  8742. \DeclareUnicodeCharacter{015B}{\'s}
  8743. \DeclareUnicodeCharacter{015C}{\^S}
  8744. \DeclareUnicodeCharacter{015D}{\^s}
  8745. \DeclareUnicodeCharacter{015E}{\cedilla{S}}
  8746. \DeclareUnicodeCharacter{015F}{\cedilla{s}}
  8747. \DeclareUnicodeCharacter{0160}{\v{S}}
  8748. \DeclareUnicodeCharacter{0161}{\v{s}}
  8749. \DeclareUnicodeCharacter{0162}{\cedilla{t}}
  8750. \DeclareUnicodeCharacter{0163}{\cedilla{T}}
  8751. \DeclareUnicodeCharacter{0164}{\v{T}}
  8752. \DeclareUnicodeCharacter{0168}{\~U}
  8753. \DeclareUnicodeCharacter{0169}{\~u}
  8754. \DeclareUnicodeCharacter{016A}{\=U}
  8755. \DeclareUnicodeCharacter{016B}{\=u}
  8756. \DeclareUnicodeCharacter{016C}{\u{U}}
  8757. \DeclareUnicodeCharacter{016D}{\u{u}}
  8758. \DeclareUnicodeCharacter{016E}{\ringaccent{U}}
  8759. \DeclareUnicodeCharacter{016F}{\ringaccent{u}}
  8760. \DeclareUnicodeCharacter{0170}{\H{U}}
  8761. \DeclareUnicodeCharacter{0171}{\H{u}}
  8762. \DeclareUnicodeCharacter{0174}{\^W}
  8763. \DeclareUnicodeCharacter{0175}{\^w}
  8764. \DeclareUnicodeCharacter{0176}{\^Y}
  8765. \DeclareUnicodeCharacter{0177}{\^y}
  8766. \DeclareUnicodeCharacter{0178}{\"Y}
  8767. \DeclareUnicodeCharacter{0179}{\'Z}
  8768. \DeclareUnicodeCharacter{017A}{\'z}
  8769. \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}
  8770. \DeclareUnicodeCharacter{017C}{\dotaccent{z}}
  8771. \DeclareUnicodeCharacter{017D}{\v{Z}}
  8772. \DeclareUnicodeCharacter{017E}{\v{z}}
  8773. \DeclareUnicodeCharacter{01C4}{D\v{Z}}
  8774. \DeclareUnicodeCharacter{01C5}{D\v{z}}
  8775. \DeclareUnicodeCharacter{01C6}{d\v{z}}
  8776. \DeclareUnicodeCharacter{01C7}{LJ}
  8777. \DeclareUnicodeCharacter{01C8}{Lj}
  8778. \DeclareUnicodeCharacter{01C9}{lj}
  8779. \DeclareUnicodeCharacter{01CA}{NJ}
  8780. \DeclareUnicodeCharacter{01CB}{Nj}
  8781. \DeclareUnicodeCharacter{01CC}{nj}
  8782. \DeclareUnicodeCharacter{01CD}{\v{A}}
  8783. \DeclareUnicodeCharacter{01CE}{\v{a}}
  8784. \DeclareUnicodeCharacter{01CF}{\v{I}}
  8785. \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}
  8786. \DeclareUnicodeCharacter{01D1}{\v{O}}
  8787. \DeclareUnicodeCharacter{01D2}{\v{o}}
  8788. \DeclareUnicodeCharacter{01D3}{\v{U}}
  8789. \DeclareUnicodeCharacter{01D4}{\v{u}}
  8790. \DeclareUnicodeCharacter{01E2}{\={\AE}}
  8791. \DeclareUnicodeCharacter{01E3}{\={\ae}}
  8792. \DeclareUnicodeCharacter{01E6}{\v{G}}
  8793. \DeclareUnicodeCharacter{01E7}{\v{g}}
  8794. \DeclareUnicodeCharacter{01E8}{\v{K}}
  8795. \DeclareUnicodeCharacter{01E9}{\v{k}}
  8796. \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}
  8797. \DeclareUnicodeCharacter{01F1}{DZ}
  8798. \DeclareUnicodeCharacter{01F2}{Dz}
  8799. \DeclareUnicodeCharacter{01F3}{dz}
  8800. \DeclareUnicodeCharacter{01F4}{\'G}
  8801. \DeclareUnicodeCharacter{01F5}{\'g}
  8802. \DeclareUnicodeCharacter{01F8}{\`N}
  8803. \DeclareUnicodeCharacter{01F9}{\`n}
  8804. \DeclareUnicodeCharacter{01FC}{\'{\AE}}
  8805. \DeclareUnicodeCharacter{01FD}{\'{\ae}}
  8806. \DeclareUnicodeCharacter{01FE}{\'{\O}}
  8807. \DeclareUnicodeCharacter{01FF}{\'{\o}}
  8808. \DeclareUnicodeCharacter{021E}{\v{H}}
  8809. \DeclareUnicodeCharacter{021F}{\v{h}}
  8810. \DeclareUnicodeCharacter{0226}{\dotaccent{A}}
  8811. \DeclareUnicodeCharacter{0227}{\dotaccent{a}}
  8812. \DeclareUnicodeCharacter{0228}{\cedilla{E}}
  8813. \DeclareUnicodeCharacter{0229}{\cedilla{e}}
  8814. \DeclareUnicodeCharacter{022E}{\dotaccent{O}}
  8815. \DeclareUnicodeCharacter{022F}{\dotaccent{o}}
  8816. \DeclareUnicodeCharacter{0232}{\=Y}
  8817. \DeclareUnicodeCharacter{0233}{\=y}
  8818. \DeclareUnicodeCharacter{0237}{\dotless{j}}
  8819. \DeclareUnicodeCharacter{02DB}{\ogonek{ }}
  8820. \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}
  8821. \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}
  8822. \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}
  8823. \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}
  8824. \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}
  8825. \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}
  8826. \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}
  8827. \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}
  8828. \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}
  8829. \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}
  8830. \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}
  8831. \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}
  8832. \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}
  8833. \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}
  8834. \DeclareUnicodeCharacter{1E20}{\=G}
  8835. \DeclareUnicodeCharacter{1E21}{\=g}
  8836. \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}
  8837. \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}
  8838. \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}
  8839. \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}
  8840. \DeclareUnicodeCharacter{1E26}{\"H}
  8841. \DeclareUnicodeCharacter{1E27}{\"h}
  8842. \DeclareUnicodeCharacter{1E30}{\'K}
  8843. \DeclareUnicodeCharacter{1E31}{\'k}
  8844. \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}
  8845. \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}
  8846. \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}
  8847. \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}
  8848. \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}
  8849. \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}
  8850. \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}
  8851. \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}
  8852. \DeclareUnicodeCharacter{1E3E}{\'M}
  8853. \DeclareUnicodeCharacter{1E3F}{\'m}
  8854. \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}
  8855. \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}
  8856. \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}
  8857. \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}
  8858. \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}
  8859. \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}
  8860. \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}
  8861. \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}
  8862. \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}
  8863. \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}
  8864. \DeclareUnicodeCharacter{1E54}{\'P}
  8865. \DeclareUnicodeCharacter{1E55}{\'p}
  8866. \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}
  8867. \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}
  8868. \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}
  8869. \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}
  8870. \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}
  8871. \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}
  8872. \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}
  8873. \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}
  8874. \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}
  8875. \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}
  8876. \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}
  8877. \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}
  8878. \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}
  8879. \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}
  8880. \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}
  8881. \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}
  8882. \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}
  8883. \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}
  8884. \DeclareUnicodeCharacter{1E7C}{\~V}
  8885. \DeclareUnicodeCharacter{1E7D}{\~v}
  8886. \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}
  8887. \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}
  8888. \DeclareUnicodeCharacter{1E80}{\`W}
  8889. \DeclareUnicodeCharacter{1E81}{\`w}
  8890. \DeclareUnicodeCharacter{1E82}{\'W}
  8891. \DeclareUnicodeCharacter{1E83}{\'w}
  8892. \DeclareUnicodeCharacter{1E84}{\"W}
  8893. \DeclareUnicodeCharacter{1E85}{\"w}
  8894. \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}
  8895. \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}
  8896. \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}
  8897. \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}
  8898. \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}
  8899. \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}
  8900. \DeclareUnicodeCharacter{1E8C}{\"X}
  8901. \DeclareUnicodeCharacter{1E8D}{\"x}
  8902. \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}
  8903. \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}
  8904. \DeclareUnicodeCharacter{1E90}{\^Z}
  8905. \DeclareUnicodeCharacter{1E91}{\^z}
  8906. \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}
  8907. \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}
  8908. \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}
  8909. \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}
  8910. \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}
  8911. \DeclareUnicodeCharacter{1E97}{\"t}
  8912. \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}
  8913. \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}
  8914. \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}
  8915. \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}
  8916. \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}
  8917. \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}
  8918. \DeclareUnicodeCharacter{1EBC}{\~E}
  8919. \DeclareUnicodeCharacter{1EBD}{\~e}
  8920. \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}
  8921. \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}
  8922. \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}
  8923. \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}
  8924. \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}
  8925. \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}
  8926. \DeclareUnicodeCharacter{1EF2}{\`Y}
  8927. \DeclareUnicodeCharacter{1EF3}{\`y}
  8928. \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}
  8929. \DeclareUnicodeCharacter{1EF8}{\~Y}
  8930. \DeclareUnicodeCharacter{1EF9}{\~y}
  8931. \DeclareUnicodeCharacter{2013}{--}
  8932. \DeclareUnicodeCharacter{2014}{---}
  8933. \DeclareUnicodeCharacter{2018}{\quoteleft}
  8934. \DeclareUnicodeCharacter{2019}{\quoteright}
  8935. \DeclareUnicodeCharacter{201A}{\quotesinglbase}
  8936. \DeclareUnicodeCharacter{201C}{\quotedblleft}
  8937. \DeclareUnicodeCharacter{201D}{\quotedblright}
  8938. \DeclareUnicodeCharacter{201E}{\quotedblbase}
  8939. \DeclareUnicodeCharacter{2022}{\bullet}
  8940. \DeclareUnicodeCharacter{2026}{\dots}
  8941. \DeclareUnicodeCharacter{2039}{\guilsinglleft}
  8942. \DeclareUnicodeCharacter{203A}{\guilsinglright}
  8943. \DeclareUnicodeCharacter{20AC}{\euro}
  8944. \DeclareUnicodeCharacter{2192}{\expansion}
  8945. \DeclareUnicodeCharacter{21D2}{\result}
  8946. \DeclareUnicodeCharacter{2212}{\minus}
  8947. \DeclareUnicodeCharacter{2217}{\point}
  8948. \DeclareUnicodeCharacter{2261}{\equiv}
  8949. }% end of \utfeightchardefs
  8950. % US-ASCII character definitions.
  8951. \def\asciichardefs{% nothing need be done
  8952. \relax
  8953. }
  8954. % Make non-ASCII characters printable again for compatibility with
  8955. % existing Texinfo documents that may use them, even without declaring a
  8956. % document encoding.
  8957. %
  8958. \setnonasciicharscatcode \other
  8959. \message{formatting,}
  8960. \newdimen\defaultparindent \defaultparindent = 15pt
  8961. \chapheadingskip = 15pt plus 4pt minus 2pt
  8962. \secheadingskip = 12pt plus 3pt minus 2pt
  8963. \subsecheadingskip = 9pt plus 2pt minus 2pt
  8964. % Prevent underfull vbox error messages.
  8965. \vbadness = 10000
  8966. % Don't be very finicky about underfull hboxes, either.
  8967. \hbadness = 6666
  8968. % Following George Bush, get rid of widows and orphans.
  8969. \widowpenalty=10000
  8970. \clubpenalty=10000
  8971. % Use TeX 3.0's \emergencystretch to help line breaking, but if we're
  8972. % using an old version of TeX, don't do anything. We want the amount of
  8973. % stretch added to depend on the line length, hence the dependence on
  8974. % \hsize. We call this whenever the paper size is set.
  8975. %
  8976. \def\setemergencystretch{%
  8977. \ifx\emergencystretch\thisisundefined
  8978. % Allow us to assign to \emergencystretch anyway.
  8979. \def\emergencystretch{\dimen0}%
  8980. \else
  8981. \emergencystretch = .15\hsize
  8982. \fi
  8983. }
  8984. % Parameters in order: 1) textheight; 2) textwidth;
  8985. % 3) voffset; 4) hoffset; 5) binding offset; 6) topskip;
  8986. % 7) physical page height; 8) physical page width.
  8987. %
  8988. % We also call \setleading{\textleading}, so the caller should define
  8989. % \textleading. The caller should also set \parskip.
  8990. %
  8991. \def\internalpagesizes#1#2#3#4#5#6#7#8{%
  8992. \voffset = #3\relax
  8993. \topskip = #6\relax
  8994. \splittopskip = \topskip
  8995. %
  8996. \vsize = #1\relax
  8997. \advance\vsize by \topskip
  8998. \outervsize = \vsize
  8999. \advance\outervsize by 2\topandbottommargin
  9000. \pageheight = \vsize
  9001. %
  9002. \hsize = #2\relax
  9003. \outerhsize = \hsize
  9004. \advance\outerhsize by 0.5in
  9005. \pagewidth = \hsize
  9006. %
  9007. \normaloffset = #4\relax
  9008. \bindingoffset = #5\relax
  9009. %
  9010. \ifpdf
  9011. \pdfpageheight #7\relax
  9012. \pdfpagewidth #8\relax
  9013. % if we don't reset these, they will remain at "1 true in" of
  9014. % whatever layout pdftex was dumped with.
  9015. \pdfhorigin = 1 true in
  9016. \pdfvorigin = 1 true in
  9017. \fi
  9018. %
  9019. \setleading{\textleading}
  9020. %
  9021. \parindent = \defaultparindent
  9022. \setemergencystretch
  9023. }
  9024. % @letterpaper (the default).
  9025. \def\letterpaper{{\globaldefs = 1
  9026. \parskip = 3pt plus 2pt minus 1pt
  9027. \textleading = 13.2pt
  9028. %
  9029. % If page is nothing but text, make it come out even.
  9030. \internalpagesizes{607.2pt}{6in}% that's 46 lines
  9031. {\voffset}{.25in}%
  9032. {\bindingoffset}{36pt}%
  9033. {11in}{8.5in}%
  9034. }}
  9035. % Use @smallbook to reset parameters for 7x9.25 trim size.
  9036. \def\smallbook{{\globaldefs = 1
  9037. \parskip = 2pt plus 1pt
  9038. \textleading = 12pt
  9039. %
  9040. \internalpagesizes{7.5in}{5in}%
  9041. {-.2in}{0in}%
  9042. {\bindingoffset}{16pt}%
  9043. {9.25in}{7in}%
  9044. %
  9045. \lispnarrowing = 0.3in
  9046. \tolerance = 700
  9047. \hfuzz = 1pt
  9048. \contentsrightmargin = 0pt
  9049. \defbodyindent = .5cm
  9050. }}
  9051. % Use @smallerbook to reset parameters for 6x9 trim size.
  9052. % (Just testing, parameters still in flux.)
  9053. \def\smallerbook{{\globaldefs = 1
  9054. \parskip = 1.5pt plus 1pt
  9055. \textleading = 12pt
  9056. %
  9057. \internalpagesizes{7.4in}{4.8in}%
  9058. {-.2in}{-.4in}%
  9059. {0pt}{14pt}%
  9060. {9in}{6in}%
  9061. %
  9062. \lispnarrowing = 0.25in
  9063. \tolerance = 700
  9064. \hfuzz = 1pt
  9065. \contentsrightmargin = 0pt
  9066. \defbodyindent = .4cm
  9067. }}
  9068. % Use @afourpaper to print on European A4 paper.
  9069. \def\afourpaper{{\globaldefs = 1
  9070. \parskip = 3pt plus 2pt minus 1pt
  9071. \textleading = 13.2pt
  9072. %
  9073. % Double-side printing via postscript on Laserjet 4050
  9074. % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
  9075. % To change the settings for a different printer or situation, adjust
  9076. % \normaloffset until the front-side and back-side texts align. Then
  9077. % do the same for \bindingoffset. You can set these for testing in
  9078. % your texinfo source file like this:
  9079. % @tex
  9080. % \global\normaloffset = -6mm
  9081. % \global\bindingoffset = 10mm
  9082. % @end tex
  9083. \internalpagesizes{673.2pt}{160mm}% that's 51 lines
  9084. {\voffset}{\hoffset}%
  9085. {\bindingoffset}{44pt}%
  9086. {297mm}{210mm}%
  9087. %
  9088. \tolerance = 700
  9089. \hfuzz = 1pt
  9090. \contentsrightmargin = 0pt
  9091. \defbodyindent = 5mm
  9092. }}
  9093. % Use @afivepaper to print on European A5 paper.
  9094. % From romildo@urano.iceb.ufop.br, 2 July 2000.
  9095. % He also recommends making @example and @lisp be small.
  9096. \def\afivepaper{{\globaldefs = 1
  9097. \parskip = 2pt plus 1pt minus 0.1pt
  9098. \textleading = 12.5pt
  9099. %
  9100. \internalpagesizes{160mm}{120mm}%
  9101. {\voffset}{\hoffset}%
  9102. {\bindingoffset}{8pt}%
  9103. {210mm}{148mm}%
  9104. %
  9105. \lispnarrowing = 0.2in
  9106. \tolerance = 800
  9107. \hfuzz = 1.2pt
  9108. \contentsrightmargin = 0pt
  9109. \defbodyindent = 2mm
  9110. \tableindent = 12mm
  9111. }}
  9112. % A specific text layout, 24x15cm overall, intended for A4 paper.
  9113. \def\afourlatex{{\globaldefs = 1
  9114. \afourpaper
  9115. \internalpagesizes{237mm}{150mm}%
  9116. {\voffset}{4.6mm}%
  9117. {\bindingoffset}{7mm}%
  9118. {297mm}{210mm}%
  9119. %
  9120. % Must explicitly reset to 0 because we call \afourpaper.
  9121. \globaldefs = 0
  9122. }}
  9123. % Use @afourwide to print on A4 paper in landscape format.
  9124. \def\afourwide{{\globaldefs = 1
  9125. \afourpaper
  9126. \internalpagesizes{241mm}{165mm}%
  9127. {\voffset}{-2.95mm}%
  9128. {\bindingoffset}{7mm}%
  9129. {297mm}{210mm}%
  9130. \globaldefs = 0
  9131. }}
  9132. % @pagesizes TEXTHEIGHT[,TEXTWIDTH]
  9133. % Perhaps we should allow setting the margins, \topskip, \parskip,
  9134. % and/or leading, also. Or perhaps we should compute them somehow.
  9135. %
  9136. \parseargdef\pagesizes{\pagesizesyyy #1,,\finish}
  9137. \def\pagesizesyyy#1,#2,#3\finish{{%
  9138. \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
  9139. \globaldefs = 1
  9140. %
  9141. \parskip = 3pt plus 2pt minus 1pt
  9142. \setleading{\textleading}%
  9143. %
  9144. \dimen0 = #1\relax
  9145. \advance\dimen0 by \voffset
  9146. %
  9147. \dimen2 = \hsize
  9148. \advance\dimen2 by \normaloffset
  9149. %
  9150. \internalpagesizes{#1}{\hsize}%
  9151. {\voffset}{\normaloffset}%
  9152. {\bindingoffset}{44pt}%
  9153. {\dimen0}{\dimen2}%
  9154. }}
  9155. % Set default to letter.
  9156. %
  9157. \letterpaper
  9158. \message{and turning on texinfo input format.}
  9159. \def^^L{\par} % remove \outer, so ^L can appear in an @comment
  9160. % DEL is a comment character, in case @c does not suffice.
  9161. \catcode`\^^? = 14
  9162. % Define macros to output various characters with catcode for normal text.
  9163. \catcode`\"=\other \def\normaldoublequote{"}
  9164. \catcode`\$=\other \def\normaldollar{$}%$ font-lock fix
  9165. \catcode`\+=\other \def\normalplus{+}
  9166. \catcode`\<=\other \def\normalless{<}
  9167. \catcode`\>=\other \def\normalgreater{>}
  9168. \catcode`\^=\other \def\normalcaret{^}
  9169. \catcode`\_=\other \def\normalunderscore{_}
  9170. \catcode`\|=\other \def\normalverticalbar{|}
  9171. \catcode`\~=\other \def\normaltilde{~}
  9172. % This macro is used to make a character print one way in \tt
  9173. % (where it can probably be output as-is), and another way in other fonts,
  9174. % where something hairier probably needs to be done.
  9175. %
  9176. % #1 is what to print if we are indeed using \tt; #2 is what to print
  9177. % otherwise. Since all the Computer Modern typewriter fonts have zero
  9178. % interword stretch (and shrink), and it is reasonable to expect all
  9179. % typewriter fonts to have this, we can check that font parameter.
  9180. %
  9181. \def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
  9182. % Same as above, but check for italic font. Actually this also catches
  9183. % non-italic slanted fonts since it is impossible to distinguish them from
  9184. % italic fonts. But since this is only used by $ and it uses \sl anyway
  9185. % this is not a problem.
  9186. \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
  9187. % Turn off all special characters except @
  9188. % (and those which the user can use as if they were ordinary).
  9189. % Most of these we simply print from the \tt font, but for some, we can
  9190. % use math or other variants that look better in normal text.
  9191. \catcode`\"=\active
  9192. \def\activedoublequote{{\tt\char34}}
  9193. \let"=\activedoublequote
  9194. \catcode`\~=\active
  9195. \def~{{\tt\char126}}
  9196. \chardef\hat=`\^
  9197. \catcode`\^=\active
  9198. \def^{{\tt \hat}}
  9199. \catcode`\_=\active
  9200. \def_{\ifusingtt\normalunderscore\_}
  9201. \let\realunder=_
  9202. % Subroutine for the previous macro.
  9203. \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
  9204. \catcode`\|=\active
  9205. \def|{{\tt\char124}}
  9206. \chardef \less=`\<
  9207. \catcode`\<=\active
  9208. \def<{{\tt \less}}
  9209. \chardef \gtr=`\>
  9210. \catcode`\>=\active
  9211. \def>{{\tt \gtr}}
  9212. \catcode`\+=\active
  9213. \def+{{\tt \char 43}}
  9214. \catcode`\$=\active
  9215. \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
  9216. % If a .fmt file is being used, characters that might appear in a file
  9217. % name cannot be active until we have parsed the command line.
  9218. % So turn them off again, and have \everyjob (or @setfilename) turn them on.
  9219. % \otherifyactive is called near the end of this file.
  9220. \def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
  9221. % Used sometimes to turn off (effectively) the active characters even after
  9222. % parsing them.
  9223. \def\turnoffactive{%
  9224. \normalturnoffactive
  9225. \otherbackslash
  9226. }
  9227. \catcode`\@=0
  9228. % \backslashcurfont outputs one backslash character in current font,
  9229. % as in \char`\\.
  9230. \global\chardef\backslashcurfont=`\\
  9231. \global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work
  9232. % \realbackslash is an actual character `\' with catcode other, and
  9233. % \doublebackslash is two of them (for the pdf outlines).
  9234. {\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}}
  9235. % In texinfo, backslash is an active character; it prints the backslash
  9236. % in fixed width font.
  9237. \catcode`\\=\active % @ for escape char from now on.
  9238. % The story here is that in math mode, the \char of \backslashcurfont
  9239. % ends up printing the roman \ from the math symbol font (because \char
  9240. % in math mode uses the \mathcode, and plain.tex sets
  9241. % \mathcode`\\="026E). It seems better for @backslashchar{} to always
  9242. % print a typewriter backslash, hence we use an explicit \mathchar,
  9243. % which is the decimal equivalent of "715c (class 7, e.g., use \fam;
  9244. % ignored family value; char position "5C). We can't use " for the
  9245. % usual hex value because it has already been made active.
  9246. @def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}}
  9247. @let@backslashchar = @normalbackslash % @backslashchar{} is for user documents.
  9248. % On startup, @fixbackslash assigns:
  9249. % @let \ = @normalbackslash
  9250. % \rawbackslash defines an active \ to do \backslashcurfont.
  9251. % \otherbackslash defines an active \ to be a literal `\' character with
  9252. % catcode other. We switch back and forth between these.
  9253. @gdef@rawbackslash{@let\=@backslashcurfont}
  9254. @gdef@otherbackslash{@let\=@realbackslash}
  9255. % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
  9256. % the literal character `\'. Also revert - to its normal character, in
  9257. % case the active - from code has slipped in.
  9258. %
  9259. {@catcode`- = @active
  9260. @gdef@normalturnoffactive{%
  9261. @let-=@normaldash
  9262. @let"=@normaldoublequote
  9263. @let$=@normaldollar %$ font-lock fix
  9264. @let+=@normalplus
  9265. @let<=@normalless
  9266. @let>=@normalgreater
  9267. @let\=@normalbackslash
  9268. @let^=@normalcaret
  9269. @let_=@normalunderscore
  9270. @let|=@normalverticalbar
  9271. @let~=@normaltilde
  9272. @markupsetuplqdefault
  9273. @markupsetuprqdefault
  9274. @unsepspaces
  9275. }
  9276. }
  9277. % Make _ and + \other characters, temporarily.
  9278. % This is canceled by @fixbackslash.
  9279. @otherifyactive
  9280. % If a .fmt file is being used, we don't want the `\input texinfo' to show up.
  9281. % That is what \eatinput is for; after that, the `\' should revert to printing
  9282. % a backslash.
  9283. %
  9284. @gdef@eatinput input texinfo{@fixbackslash}
  9285. @global@let\ = @eatinput
  9286. % On the other hand, perhaps the file did not have a `\input texinfo'. Then
  9287. % the first `\' in the file would cause an error. This macro tries to fix
  9288. % that, assuming it is called before the first `\' could plausibly occur.
  9289. % Also turn back on active characters that might appear in the input
  9290. % file name, in case not using a pre-dumped format.
  9291. %
  9292. @gdef@fixbackslash{%
  9293. @ifx\@eatinput @let\ = @normalbackslash @fi
  9294. @catcode`+=@active
  9295. @catcode`@_=@active
  9296. }
  9297. % Say @foo, not \foo, in error messages.
  9298. @escapechar = `@@
  9299. % These (along with & and #) are made active for url-breaking, so need
  9300. % active definitions as the normal characters.
  9301. @def@normaldot{.}
  9302. @def@normalquest{?}
  9303. @def@normalslash{/}
  9304. % These look ok in all fonts, so just make them not special.
  9305. % @hashchar{} gets its own user-level command, because of #line.
  9306. @catcode`@& = @other @def@normalamp{&}
  9307. @catcode`@# = @other @def@normalhash{#}
  9308. @catcode`@% = @other @def@normalpercent{%}
  9309. @let @hashchar = @normalhash
  9310. @c Finally, make ` and ' active, so that txicodequoteundirected and
  9311. @c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we
  9312. @c don't make ` and ' active, @code will not get them as active chars.
  9313. @c Do this last of all since we use ` in the previous @catcode assignments.
  9314. @catcode`@'=@active
  9315. @catcode`@`=@active
  9316. @markupsetuplqdefault
  9317. @markupsetuprqdefault
  9318. @c Local variables:
  9319. @c eval: (add-hook 'write-file-hooks 'time-stamp)
  9320. @c page-delimiter: "^\\\\message"
  9321. @c time-stamp-start: "def\\\\texinfoversion{"
  9322. @c time-stamp-format: "%:y-%02m-%02d.%02H"
  9323. @c time-stamp-end: "}"
  9324. @c End:
  9325. @c vim:sw=2:
  9326. @ignore
  9327. arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115
  9328. @end ignore