texinfo.tex 318 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145
  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-09-11.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 <https://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. % https://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or
  33. % https://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or
  34. % https://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 https://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 % 0: top marks (\last...)
  264. \noexpand\or \the\toks4 \the\toks6 % 1: bottom marks (default, \prev...)
  265. \noexpand\else \the\toks8 % 2: color marks
  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. \def\commmonheadfootline{\let\hsize=\pagewidth \texinfochars}
  301. %
  302. \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
  303. \global\setbox\headlinebox = \vbox{\commmonheadfootline \makeheadline}%
  304. %
  305. \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
  306. \global\setbox\footlinebox = \vbox{\commmonheadfootline \makefootline}%
  307. %
  308. {%
  309. % Have to do this stuff outside the \shipout because we want it to
  310. % take effect in \write's, yet the group defined by the \vbox ends
  311. % before the \shipout runs.
  312. %
  313. \indexdummies % don't expand commands in the output.
  314. \normalturnoffactive % \ in index entries must not stay \, e.g., if
  315. % the page break happens to be in the middle of an example.
  316. % We don't want .vr (or whatever) entries like this:
  317. % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}}
  318. % "\acronym" won't work when it's read back in;
  319. % it needs to be
  320. % {\code {{\tt \backslashcurfont }acronym}
  321. \shipout\vbox{%
  322. % Do this early so pdf references go to the beginning of the page.
  323. \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
  324. %
  325. \ifcropmarks \vbox to \outervsize\bgroup
  326. \hsize = \outerhsize
  327. \vskip-\topandbottommargin
  328. \vtop to0pt{%
  329. \line{\ewtop\hfil\ewtop}%
  330. \nointerlineskip
  331. \line{%
  332. \vbox{\moveleft\cornerthick\nstop}%
  333. \hfill
  334. \vbox{\moveright\cornerthick\nstop}%
  335. }%
  336. \vss}%
  337. \vskip\topandbottommargin
  338. \line\bgroup
  339. \hfil % center the page within the outer (page) hsize.
  340. \ifodd\pageno\hskip\bindingoffset\fi
  341. \vbox\bgroup
  342. \fi
  343. %
  344. \unvbox\headlinebox
  345. \pagebody{#1}%
  346. \ifdim\ht\footlinebox > 0pt
  347. % Only leave this space if the footline is nonempty.
  348. % (We lessened \vsize for it in \oddfootingyyy.)
  349. % The \baselineskip=24pt in plain's \makefootline has no effect.
  350. \vskip 24pt
  351. \unvbox\footlinebox
  352. \fi
  353. %
  354. \ifcropmarks
  355. \egroup % end of \vbox\bgroup
  356. \hfil\egroup % end of (centering) \line\bgroup
  357. \vskip\topandbottommargin plus1fill minus1fill
  358. \boxmaxdepth = \cornerthick
  359. \vbox to0pt{\vss
  360. \line{%
  361. \vbox{\moveleft\cornerthick\nsbot}%
  362. \hfill
  363. \vbox{\moveright\cornerthick\nsbot}%
  364. }%
  365. \nointerlineskip
  366. \line{\ewbot\hfil\ewbot}%
  367. }%
  368. \egroup % \vbox from first cropmarks clause
  369. \fi
  370. }% end of \shipout\vbox
  371. }% end of group with \indexdummies
  372. \advancepageno
  373. \ifnum\outputpenalty>-20000 \else\dosupereject\fi
  374. }
  375. \newinsert\margin \dimen\margin=\maxdimen
  376. \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
  377. {\catcode`\@ =11
  378. \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
  379. % marginal hacks, juha@viisa.uucp (Juha Takala)
  380. \ifvoid\margin\else % marginal info is present
  381. \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
  382. \dimen@=\dp#1\relax \unvbox#1\relax
  383. \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
  384. \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
  385. }
  386. % Here are the rules for the cropmarks. Note that they are
  387. % offset so that the space between them is truly \outerhsize or \outervsize
  388. % (P. A. MacKay, 12 November, 1986)
  389. %
  390. \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
  391. \def\nstop{\vbox
  392. {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
  393. \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
  394. \def\nsbot{\vbox
  395. {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
  396. % Parse an argument, then pass it to #1. The argument is the rest of
  397. % the input line (except we remove a trailing comment). #1 should be a
  398. % macro which expects an ordinary undelimited TeX argument.
  399. %
  400. \def\parsearg{\parseargusing{}}
  401. \def\parseargusing#1#2{%
  402. \def\argtorun{#2}%
  403. \begingroup
  404. \obeylines
  405. \spaceisspace
  406. #1%
  407. \parseargline\empty% Insert the \empty token, see \finishparsearg below.
  408. }
  409. {\obeylines %
  410. \gdef\parseargline#1^^M{%
  411. \endgroup % End of the group started in \parsearg.
  412. \argremovecomment #1\comment\ArgTerm%
  413. }%
  414. }
  415. % First remove any @comment, then any @c comment.
  416. \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
  417. \def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
  418. % Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space.
  419. %
  420. % \argremovec might leave us with trailing space, e.g.,
  421. % @end itemize @c foo
  422. % This space token undergoes the same procedure and is eventually removed
  423. % by \finishparsearg.
  424. %
  425. \def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M}
  426. \def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M}
  427. \def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
  428. \def\temp{#3}%
  429. \ifx\temp\empty
  430. % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp:
  431. \let\temp\finishparsearg
  432. \else
  433. \let\temp\argcheckspaces
  434. \fi
  435. % Put the space token in:
  436. \temp#1 #3\ArgTerm
  437. }
  438. % If a _delimited_ argument is enclosed in braces, they get stripped; so
  439. % to get _exactly_ the rest of the line, we had to prevent such situation.
  440. % We prepended an \empty token at the very beginning and we expand it now,
  441. % just before passing the control to \argtorun.
  442. % (Similarly, we have to think about #3 of \argcheckspacesY above: it is
  443. % either the null string, or it ends with \^^M---thus there is no danger
  444. % that a pair of braces would be stripped.
  445. %
  446. % But first, we have to remove the trailing space token.
  447. %
  448. \def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}}
  449. % \parseargdef\foo{...}
  450. % is roughly equivalent to
  451. % \def\foo{\parsearg\Xfoo}
  452. % \def\Xfoo#1{...}
  453. %
  454. % Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my
  455. % favourite TeX trick. --kasal, 16nov03
  456. \def\parseargdef#1{%
  457. \expandafter \doparseargdef \csname\string#1\endcsname #1%
  458. }
  459. \def\doparseargdef#1#2{%
  460. \def#2{\parsearg#1}%
  461. \def#1##1%
  462. }
  463. % Several utility definitions with active space:
  464. {
  465. \obeyspaces
  466. \gdef\obeyedspace{ }
  467. % Make each space character in the input produce a normal interword
  468. % space in the output. Don't allow a line break at this space, as this
  469. % is used only in environments like @example, where each line of input
  470. % should produce a line of output anyway.
  471. %
  472. \gdef\sepspaces{\obeyspaces\let =\tie}
  473. % If an index command is used in an @example environment, any spaces
  474. % therein should become regular spaces in the raw index file, not the
  475. % expansion of \tie (\leavevmode \penalty \@M \ ).
  476. \gdef\unsepspaces{\let =\space}
  477. }
  478. \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
  479. % Define the framework for environments in texinfo.tex. It's used like this:
  480. %
  481. % \envdef\foo{...}
  482. % \def\Efoo{...}
  483. %
  484. % It's the responsibility of \envdef to insert \begingroup before the
  485. % actual body; @end closes the group after calling \Efoo. \envdef also
  486. % defines \thisenv, so the current environment is known; @end checks
  487. % whether the environment name matches. The \checkenv macro can also be
  488. % used to check whether the current environment is the one expected.
  489. %
  490. % Non-false conditionals (@iftex, @ifset) don't fit into this, so they
  491. % are not treated as environments; they don't open a group. (The
  492. % implementation of @end takes care not to call \endgroup in this
  493. % special case.)
  494. % At run-time, environments start with this:
  495. \def\startenvironment#1{\begingroup\def\thisenv{#1}}
  496. % initialize
  497. \let\thisenv\empty
  498. % ... but they get defined via ``\envdef\foo{...}'':
  499. \long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
  500. \def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
  501. % Check whether we're in the right environment:
  502. \def\checkenv#1{%
  503. \def\temp{#1}%
  504. \ifx\thisenv\temp
  505. \else
  506. \badenverr
  507. \fi
  508. }
  509. % Environment mismatch, #1 expected:
  510. \def\badenverr{%
  511. \errhelp = \EMsimple
  512. \errmessage{This command can appear only \inenvironment\temp,
  513. not \inenvironment\thisenv}%
  514. }
  515. \def\inenvironment#1{%
  516. \ifx#1\empty
  517. outside of any environment%
  518. \else
  519. in environment \expandafter\string#1%
  520. \fi
  521. }
  522. % @end foo executes the definition of \Efoo.
  523. % But first, it executes a specialized version of \checkenv
  524. %
  525. \parseargdef\end{%
  526. \if 1\csname iscond.#1\endcsname
  527. \else
  528. % The general wording of \badenverr may not be ideal.
  529. \expandafter\checkenv\csname#1\endcsname
  530. \csname E#1\endcsname
  531. \endgroup
  532. \fi
  533. }
  534. \newhelp\EMsimple{Press RETURN to continue.}
  535. % Be sure we're in horizontal mode when doing a tie, since we make space
  536. % equivalent to this in @example-like environments. Otherwise, a space
  537. % at the beginning of a line will start with \penalty -- and
  538. % since \penalty is valid in vertical mode, we'd end up putting the
  539. % penalty on the vertical list instead of in the new paragraph.
  540. {\catcode`@ = 11
  541. % Avoid using \@M directly, because that causes trouble
  542. % if the definition is written into an index file.
  543. \global\let\tiepenalty = \@M
  544. \gdef\tie{\leavevmode\penalty\tiepenalty\ }
  545. }
  546. % @: forces normal size whitespace following.
  547. \def\:{\spacefactor=1000 }
  548. % @* forces a line break.
  549. \def\*{\unskip\hfil\break\hbox{}\ignorespaces}
  550. % @/ allows a line break.
  551. \let\/=\allowbreak
  552. % @. is an end-of-sentence period.
  553. \def\.{.\spacefactor=\endofsentencespacefactor\space}
  554. % @! is an end-of-sentence bang.
  555. \def\!{!\spacefactor=\endofsentencespacefactor\space}
  556. % @? is an end-of-sentence query.
  557. \def\?{?\spacefactor=\endofsentencespacefactor\space}
  558. % @frenchspacing on|off says whether to put extra space after punctuation.
  559. %
  560. \def\onword{on}
  561. \def\offword{off}
  562. %
  563. \parseargdef\frenchspacing{%
  564. \def\temp{#1}%
  565. \ifx\temp\onword \plainfrenchspacing
  566. \else\ifx\temp\offword \plainnonfrenchspacing
  567. \else
  568. \errhelp = \EMsimple
  569. \errmessage{Unknown @frenchspacing option `\temp', must be on|off}%
  570. \fi\fi
  571. }
  572. % @w prevents a word break. Without the \leavevmode, @w at the
  573. % beginning of a paragraph, when TeX is still in vertical mode, would
  574. % produce a whole line of output instead of starting the paragraph.
  575. \def\w#1{\leavevmode\hbox{#1}}
  576. % @group ... @end group forces ... to be all on one page, by enclosing
  577. % it in a TeX vbox. We use \vtop instead of \vbox to construct the box
  578. % to keep its height that of a normal line. According to the rules for
  579. % \topskip (p.114 of the TeXbook), the glue inserted is
  580. % max (\topskip - \ht (first item), 0). If that height is large,
  581. % therefore, no glue is inserted, and the space between the headline and
  582. % the text is small, which looks bad.
  583. %
  584. % Another complication is that the group might be very large. This can
  585. % cause the glue on the previous page to be unduly stretched, because it
  586. % does not have much material. In this case, it's better to add an
  587. % explicit \vfill so that the extra space is at the bottom. The
  588. % threshold for doing this is if the group is more than \vfilllimit
  589. % percent of a page (\vfilllimit can be changed inside of @tex).
  590. %
  591. \newbox\groupbox
  592. \def\vfilllimit{0.7}
  593. %
  594. \envdef\group{%
  595. \ifnum\catcode`\^^M=\active \else
  596. \errhelp = \groupinvalidhelp
  597. \errmessage{@group invalid in context where filling is enabled}%
  598. \fi
  599. \startsavinginserts
  600. %
  601. \setbox\groupbox = \vtop\bgroup
  602. % Do @comment since we are called inside an environment such as
  603. % @example, where each end-of-line in the input causes an
  604. % end-of-line in the output. We don't want the end-of-line after
  605. % the `@group' to put extra space in the output. Since @group
  606. % should appear on a line by itself (according to the Texinfo
  607. % manual), we don't worry about eating any user text.
  608. \comment
  609. }
  610. %
  611. % The \vtop produces a box with normal height and large depth; thus, TeX puts
  612. % \baselineskip glue before it, and (when the next line of text is done)
  613. % \lineskip glue after it. Thus, space below is not quite equal to space
  614. % above. But it's pretty close.
  615. \def\Egroup{%
  616. % To get correct interline space between the last line of the group
  617. % and the first line afterwards, we have to propagate \prevdepth.
  618. \endgraf % Not \par, as it may have been set to \lisppar.
  619. \global\dimen1 = \prevdepth
  620. \egroup % End the \vtop.
  621. % \dimen0 is the vertical size of the group's box.
  622. \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox
  623. % \dimen2 is how much space is left on the page (more or less).
  624. \dimen2 = \pageheight \advance\dimen2 by -\pagetotal
  625. % if the group doesn't fit on the current page, and it's a big big
  626. % group, force a page break.
  627. \ifdim \dimen0 > \dimen2
  628. \ifdim \pagetotal < \vfilllimit\pageheight
  629. \page
  630. \fi
  631. \fi
  632. \box\groupbox
  633. \prevdepth = \dimen1
  634. \checkinserts
  635. }
  636. %
  637. % TeX puts in an \escapechar (i.e., `@') at the beginning of the help
  638. % message, so this ends up printing `@group can only ...'.
  639. %
  640. \newhelp\groupinvalidhelp{%
  641. group can only be used in environments such as @example,^^J%
  642. where each line of input produces a line of output.}
  643. % @need space-in-mils
  644. % forces a page break if there is not space-in-mils remaining.
  645. \newdimen\mil \mil=0.001in
  646. \parseargdef\need{%
  647. % Ensure vertical mode, so we don't make a big box in the middle of a
  648. % paragraph.
  649. \par
  650. %
  651. % If the @need value is less than one line space, it's useless.
  652. \dimen0 = #1\mil
  653. \dimen2 = \ht\strutbox
  654. \advance\dimen2 by \dp\strutbox
  655. \ifdim\dimen0 > \dimen2
  656. %
  657. % Do a \strut just to make the height of this box be normal, so the
  658. % normal leading is inserted relative to the preceding line.
  659. % And a page break here is fine.
  660. \vtop to #1\mil{\strut\vfil}%
  661. %
  662. % TeX does not even consider page breaks if a penalty added to the
  663. % main vertical list is 10000 or more. But in order to see if the
  664. % empty box we just added fits on the page, we must make it consider
  665. % page breaks. On the other hand, we don't want to actually break the
  666. % page after the empty box. So we use a penalty of 9999.
  667. %
  668. % There is an extremely small chance that TeX will actually break the
  669. % page at this \penalty, if there are no other feasible breakpoints in
  670. % sight. (If the user is using lots of big @group commands, which
  671. % almost-but-not-quite fill up a page, TeX will have a hard time doing
  672. % good page breaking, for example.) However, I could not construct an
  673. % example where a page broke at this \penalty; if it happens in a real
  674. % document, then we can reconsider our strategy.
  675. \penalty9999
  676. %
  677. % Back up by the size of the box, whether we did a page break or not.
  678. \kern -#1\mil
  679. %
  680. % Do not allow a page break right after this kern.
  681. \nobreak
  682. \fi
  683. }
  684. % @br forces paragraph break (and is undocumented).
  685. \let\br = \par
  686. % @page forces the start of a new page.
  687. %
  688. \def\page{\par\vfill\supereject}
  689. % @exdent text....
  690. % outputs text on separate line in roman font, starting at standard page margin
  691. % This records the amount of indent in the innermost environment.
  692. % That's how much \exdent should take out.
  693. \newskip\exdentamount
  694. % This defn is used inside fill environments such as @defun.
  695. \parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
  696. % This defn is used inside nofill environments such as @example.
  697. \parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount
  698. \leftline{\hskip\leftskip{\rm#1}}}}
  699. % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
  700. % paragraph. For more general purposes, use the \margin insertion
  701. % class. WHICH is `l' or `r'. Not documented, written for gawk manual.
  702. %
  703. \newskip\inmarginspacing \inmarginspacing=1cm
  704. \def\strutdepth{\dp\strutbox}
  705. %
  706. \def\doinmargin#1#2{\strut\vadjust{%
  707. \nobreak
  708. \kern-\strutdepth
  709. \vtop to \strutdepth{%
  710. \baselineskip=\strutdepth
  711. \vss
  712. % if you have multiple lines of stuff to put here, you'll need to
  713. % make the vbox yourself of the appropriate size.
  714. \ifx#1l%
  715. \llap{\ignorespaces #2\hskip\inmarginspacing}%
  716. \else
  717. \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
  718. \fi
  719. \null
  720. }%
  721. }}
  722. \def\inleftmargin{\doinmargin l}
  723. \def\inrightmargin{\doinmargin r}
  724. %
  725. % @inmargin{TEXT [, RIGHT-TEXT]}
  726. % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
  727. % else use TEXT for both).
  728. %
  729. \def\inmargin#1{\parseinmargin #1,,\finish}
  730. \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
  731. \setbox0 = \hbox{\ignorespaces #2}%
  732. \ifdim\wd0 > 0pt
  733. \def\lefttext{#1}% have both texts
  734. \def\righttext{#2}%
  735. \else
  736. \def\lefttext{#1}% have only one text
  737. \def\righttext{#1}%
  738. \fi
  739. %
  740. \ifodd\pageno
  741. \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
  742. \else
  743. \def\temp{\inleftmargin\lefttext}%
  744. \fi
  745. \temp
  746. }
  747. % @| inserts a changebar to the left of the current line. It should
  748. % surround any changed text. This approach does *not* work if the
  749. % change spans more than two lines of output. To handle that, we would
  750. % have adopt a much more difficult approach (putting marks into the main
  751. % vertical list for the beginning and end of each change). This command
  752. % is not documented, not supported, and doesn't work.
  753. %
  754. \def\|{%
  755. % \vadjust can only be used in horizontal mode.
  756. \leavevmode
  757. %
  758. % Append this vertical mode material after the current line in the output.
  759. \vadjust{%
  760. % We want to insert a rule with the height and depth of the current
  761. % leading; that is exactly what \strutbox is supposed to record.
  762. \vskip-\baselineskip
  763. %
  764. % \vadjust-items are inserted at the left edge of the type. So
  765. % the \llap here moves out into the left-hand margin.
  766. \llap{%
  767. %
  768. % For a thicker or thinner bar, change the `1pt'.
  769. \vrule height\baselineskip width1pt
  770. %
  771. % This is the space between the bar and the text.
  772. \hskip 12pt
  773. }%
  774. }%
  775. }
  776. % @include FILE -- \input text of FILE.
  777. %
  778. \def\include{\parseargusing\filenamecatcodes\includezzz}
  779. \def\includezzz#1{%
  780. \pushthisfilestack
  781. \def\thisfile{#1}%
  782. {%
  783. \makevalueexpandable % we want to expand any @value in FILE.
  784. \turnoffactive % and allow special characters in the expansion
  785. \indexnofonts % Allow `@@' and other weird things in file names.
  786. \wlog{texinfo.tex: doing @include of #1^^J}%
  787. \edef\temp{\noexpand\input #1 }%
  788. %
  789. % This trickery is to read FILE outside of a group, in case it makes
  790. % definitions, etc.
  791. \expandafter
  792. }\temp
  793. \popthisfilestack
  794. }
  795. \def\filenamecatcodes{%
  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. \catcode`-=\other
  805. \catcode`\`=\other
  806. \catcode`\'=\other
  807. }
  808. \def\pushthisfilestack{%
  809. \expandafter\pushthisfilestackX\popthisfilestack\StackTerm
  810. }
  811. \def\pushthisfilestackX{%
  812. \expandafter\pushthisfilestackY\thisfile\StackTerm
  813. }
  814. \def\pushthisfilestackY #1\StackTerm #2\StackTerm {%
  815. \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}%
  816. }
  817. \def\popthisfilestack{\errthisfilestackempty}
  818. \def\errthisfilestackempty{\errmessage{Internal error:
  819. the stack of filenames is empty.}}
  820. %
  821. \def\thisfile{}
  822. % @center line
  823. % outputs that line, centered.
  824. %
  825. \parseargdef\center{%
  826. \ifhmode
  827. \let\centersub\centerH
  828. \else
  829. \let\centersub\centerV
  830. \fi
  831. \centersub{\hfil \ignorespaces#1\unskip \hfil}%
  832. \let\centersub\relax % don't let the definition persist, just in case
  833. }
  834. \def\centerH#1{{%
  835. \hfil\break
  836. \advance\hsize by -\leftskip
  837. \advance\hsize by -\rightskip
  838. \line{#1}%
  839. \break
  840. }}
  841. %
  842. \newcount\centerpenalty
  843. \def\centerV#1{%
  844. % The idea here is the same as in \startdefun, \cartouche, etc.: if
  845. % @center is the first thing after a section heading, we need to wipe
  846. % out the negative parskip inserted by \sectionheading, but still
  847. % prevent a page break here.
  848. \centerpenalty = \lastpenalty
  849. \ifnum\centerpenalty>10000 \vskip\parskip \fi
  850. \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi
  851. \line{\kern\leftskip #1\kern\rightskip}%
  852. }
  853. % @sp n outputs n lines of vertical space
  854. %
  855. \parseargdef\sp{\vskip #1\baselineskip}
  856. % @comment ...line which is ignored...
  857. % @c is the same as @comment
  858. % @ignore ... @end ignore is another way to write a comment
  859. %
  860. \def\comment{\begingroup \catcode`\^^M=\other%
  861. \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
  862. \commentxxx}
  863. {\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
  864. %
  865. \let\c=\comment
  866. % @paragraphindent NCHARS
  867. % We'll use ems for NCHARS, close enough.
  868. % NCHARS can also be the word `asis' or `none'.
  869. % We cannot feasibly implement @paragraphindent asis, though.
  870. %
  871. \def\asisword{asis} % no translation, these are keywords
  872. \def\noneword{none}
  873. %
  874. \parseargdef\paragraphindent{%
  875. \def\temp{#1}%
  876. \ifx\temp\asisword
  877. \else
  878. \ifx\temp\noneword
  879. \defaultparindent = 0pt
  880. \else
  881. \defaultparindent = #1em
  882. \fi
  883. \fi
  884. \parindent = \defaultparindent
  885. }
  886. % @exampleindent NCHARS
  887. % We'll use ems for NCHARS like @paragraphindent.
  888. % It seems @exampleindent asis isn't necessary, but
  889. % I preserve it to make it similar to @paragraphindent.
  890. \parseargdef\exampleindent{%
  891. \def\temp{#1}%
  892. \ifx\temp\asisword
  893. \else
  894. \ifx\temp\noneword
  895. \lispnarrowing = 0pt
  896. \else
  897. \lispnarrowing = #1em
  898. \fi
  899. \fi
  900. }
  901. % @firstparagraphindent WORD
  902. % If WORD is `none', then suppress indentation of the first paragraph
  903. % after a section heading. If WORD is `insert', then do indent at such
  904. % paragraphs.
  905. %
  906. % The paragraph indentation is suppressed or not by calling
  907. % \suppressfirstparagraphindent, which the sectioning commands do.
  908. % We switch the definition of this back and forth according to WORD.
  909. % By default, we suppress indentation.
  910. %
  911. \def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
  912. \def\insertword{insert}
  913. %
  914. \parseargdef\firstparagraphindent{%
  915. \def\temp{#1}%
  916. \ifx\temp\noneword
  917. \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
  918. \else\ifx\temp\insertword
  919. \let\suppressfirstparagraphindent = \relax
  920. \else
  921. \errhelp = \EMsimple
  922. \errmessage{Unknown @firstparagraphindent option `\temp'}%
  923. \fi\fi
  924. }
  925. % Here is how we actually suppress indentation. Redefine \everypar to
  926. % \kern backwards by \parindent, and then reset itself to empty.
  927. %
  928. % We also make \indent itself not actually do anything until the next
  929. % paragraph.
  930. %
  931. \gdef\dosuppressfirstparagraphindent{%
  932. \gdef\indent{%
  933. \restorefirstparagraphindent
  934. \indent
  935. }%
  936. \gdef\noindent{%
  937. \restorefirstparagraphindent
  938. \noindent
  939. }%
  940. \global\everypar = {%
  941. \kern -\parindent
  942. \restorefirstparagraphindent
  943. }%
  944. }
  945. \gdef\restorefirstparagraphindent{%
  946. \global \let \indent = \ptexindent
  947. \global \let \noindent = \ptexnoindent
  948. \global \everypar = {}%
  949. }
  950. % @refill is a no-op.
  951. \let\refill=\relax
  952. % If working on a large document in chapters, it is convenient to
  953. % be able to disable indexing, cross-referencing, and contents, for test runs.
  954. % This is done with @novalidate (before @setfilename).
  955. %
  956. \newif\iflinks \linkstrue % by default we want the aux files.
  957. \let\novalidate = \linksfalse
  958. % @setfilename is done at the beginning of every texinfo file.
  959. % So open here the files we need to have open while reading the input.
  960. % This makes it possible to make a .fmt file for texinfo.
  961. \def\setfilename{%
  962. \fixbackslash % Turn off hack to swallow `\input texinfo'.
  963. \iflinks
  964. \tryauxfile
  965. % Open the new aux file. TeX will close it automatically at exit.
  966. \immediate\openout\auxfile=\jobname.aux
  967. \fi % \openindices needs to do some work in any case.
  968. \openindices
  969. \let\setfilename=\comment % Ignore extra @setfilename cmds.
  970. %
  971. % If texinfo.cnf is present on the system, read it.
  972. % Useful for site-wide @afourpaper, etc.
  973. \openin 1 texinfo.cnf
  974. \ifeof 1 \else \input texinfo.cnf \fi
  975. \closein 1
  976. %
  977. \comment % Ignore the actual filename.
  978. }
  979. % Called from \setfilename.
  980. %
  981. \def\openindices{%
  982. \newindex{cp}%
  983. \newcodeindex{fn}%
  984. \newcodeindex{vr}%
  985. \newcodeindex{tp}%
  986. \newcodeindex{ky}%
  987. \newcodeindex{pg}%
  988. }
  989. % @bye.
  990. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
  991. \message{pdf,}
  992. % adobe `portable' document format
  993. \newcount\tempnum
  994. \newcount\lnkcount
  995. \newtoks\filename
  996. \newcount\filenamelength
  997. \newcount\pgn
  998. \newtoks\toksA
  999. \newtoks\toksB
  1000. \newtoks\toksC
  1001. \newtoks\toksD
  1002. \newbox\boxA
  1003. \newcount\countA
  1004. \newif\ifpdf
  1005. \newif\ifpdfmakepagedest
  1006. % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
  1007. % can be set). So we test for \relax and 0 as well as being undefined.
  1008. \ifx\pdfoutput\thisisundefined
  1009. \else
  1010. \ifx\pdfoutput\relax
  1011. \else
  1012. \ifcase\pdfoutput
  1013. \else
  1014. \pdftrue
  1015. \fi
  1016. \fi
  1017. \fi
  1018. % PDF uses PostScript string constants for the names of xref targets,
  1019. % for display in the outlines, and in other places. Thus, we have to
  1020. % double any backslashes. Otherwise, a name like "\node" will be
  1021. % interpreted as a newline (\n), followed by o, d, e. Not good.
  1022. %
  1023. % See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and
  1024. % related messages. The final outcome is that it is up to the TeX user
  1025. % to double the backslashes and otherwise make the string valid, so
  1026. % that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to
  1027. % do this reliably, so we use it.
  1028. % #1 is a control sequence in which to do the replacements,
  1029. % which we \xdef.
  1030. \def\txiescapepdf#1{%
  1031. \ifx\pdfescapestring\thisisundefined
  1032. % No primitive available; should we give a warning or log?
  1033. % Many times it won't matter.
  1034. \else
  1035. % The expandable \pdfescapestring primitive escapes parentheses,
  1036. % backslashes, and other special chars.
  1037. \xdef#1{\pdfescapestring{#1}}%
  1038. \fi
  1039. }
  1040. \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
  1041. with PDF output, and none of those formats could be found. (.eps cannot
  1042. be supported due to the design of the PDF format; use regular TeX (DVI
  1043. output) for that.)}
  1044. \ifpdf
  1045. %
  1046. % Color manipulation macros based on pdfcolor.tex,
  1047. % except using rgb instead of cmyk; the latter is said to render as a
  1048. % very dark gray on-screen and a very dark halftone in print, instead
  1049. % of actual black.
  1050. \def\rgbDarkRed{0.50 0.09 0.12}
  1051. \def\rgbBlack{0 0 0}
  1052. %
  1053. % k sets the color for filling (usual text, etc.);
  1054. % K sets the color for stroking (thin rules, e.g., normal _'s).
  1055. \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}}
  1056. %
  1057. % Set color, and create a mark which defines \thiscolor accordingly,
  1058. % so that \makeheadline knows which color to restore.
  1059. \def\setcolor#1{%
  1060. \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}%
  1061. \domark
  1062. \pdfsetcolor{#1}%
  1063. }
  1064. %
  1065. \def\maincolor{\rgbBlack}
  1066. \pdfsetcolor{\maincolor}
  1067. \edef\thiscolor{\maincolor}
  1068. \def\lastcolordefs{}
  1069. %
  1070. \def\makefootline{%
  1071. \baselineskip24pt
  1072. \line{\pdfsetcolor{\maincolor}\the\footline}%
  1073. }
  1074. %
  1075. \def\makeheadline{%
  1076. \vbox to 0pt{%
  1077. \vskip-22.5pt
  1078. \line{%
  1079. \vbox to8.5pt{}%
  1080. % Extract \thiscolor definition from the marks.
  1081. \getcolormarks
  1082. % Typeset the headline with \maincolor, then restore the color.
  1083. \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
  1084. }%
  1085. \vss
  1086. }%
  1087. \nointerlineskip
  1088. }
  1089. %
  1090. %
  1091. \pdfcatalog{/PageMode /UseOutlines}
  1092. %
  1093. % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
  1094. \def\dopdfimage#1#2#3{%
  1095. \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
  1096. \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
  1097. %
  1098. % pdftex (and the PDF format) support .pdf, .png, .jpg (among
  1099. % others). Let's try in that order, PDF first since if
  1100. % someone has a scalable image, presumably better to use that than a
  1101. % bitmap.
  1102. \let\pdfimgext=\empty
  1103. \begingroup
  1104. \openin 1 #1.pdf \ifeof 1
  1105. \openin 1 #1.PDF \ifeof 1
  1106. \openin 1 #1.png \ifeof 1
  1107. \openin 1 #1.jpg \ifeof 1
  1108. \openin 1 #1.jpeg \ifeof 1
  1109. \openin 1 #1.JPG \ifeof 1
  1110. \errhelp = \nopdfimagehelp
  1111. \errmessage{Could not find image file #1 for pdf}%
  1112. \else \gdef\pdfimgext{JPG}%
  1113. \fi
  1114. \else \gdef\pdfimgext{jpeg}%
  1115. \fi
  1116. \else \gdef\pdfimgext{jpg}%
  1117. \fi
  1118. \else \gdef\pdfimgext{png}%
  1119. \fi
  1120. \else \gdef\pdfimgext{PDF}%
  1121. \fi
  1122. \else \gdef\pdfimgext{pdf}%
  1123. \fi
  1124. \closein 1
  1125. \endgroup
  1126. %
  1127. % without \immediate, ancient pdftex seg faults when the same image is
  1128. % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.)
  1129. \ifnum\pdftexversion < 14
  1130. \immediate\pdfimage
  1131. \else
  1132. \immediate\pdfximage
  1133. \fi
  1134. \ifdim \wd0 >0pt width \pdfimagewidth \fi
  1135. \ifdim \wd2 >0pt height \pdfimageheight \fi
  1136. \ifnum\pdftexversion<13
  1137. #1.\pdfimgext
  1138. \else
  1139. {#1.\pdfimgext}%
  1140. \fi
  1141. \ifnum\pdftexversion < 14 \else
  1142. \pdfrefximage \pdflastximage
  1143. \fi}
  1144. %
  1145. \def\pdfmkdest#1{{%
  1146. % We have to set dummies so commands such as @code, and characters
  1147. % such as \, aren't expanded when present in a section title.
  1148. \indexnofonts
  1149. \turnoffactive
  1150. \makevalueexpandable
  1151. \def\pdfdestname{#1}%
  1152. \txiescapepdf\pdfdestname
  1153. \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
  1154. }}
  1155. %
  1156. % used to mark target names; must be expandable.
  1157. \def\pdfmkpgn#1{#1}
  1158. %
  1159. % by default, use a color that is dark enough to print on paper as
  1160. % nearly black, but still distinguishable for online viewing.
  1161. \def\urlcolor{\rgbDarkRed}
  1162. \def\linkcolor{\rgbDarkRed}
  1163. \def\endlink{\setcolor{\maincolor}\pdfendlink}
  1164. %
  1165. % Adding outlines to PDF; macros for calculating structure of outlines
  1166. % come from Petr Olsak
  1167. \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
  1168. \else \csname#1\endcsname \fi}
  1169. \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
  1170. \advance\tempnum by 1
  1171. \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
  1172. %
  1173. % #1 is the section text, which is what will be displayed in the
  1174. % outline by the pdf viewer. #2 is the pdf expression for the number
  1175. % of subentries (or empty, for subsubsections). #3 is the node text,
  1176. % which might be empty if this toc entry had no corresponding node.
  1177. % #4 is the page number
  1178. %
  1179. \def\dopdfoutline#1#2#3#4{%
  1180. % Generate a link to the node text if that exists; else, use the
  1181. % page number. We could generate a destination for the section
  1182. % text in the case where a section has no node, but it doesn't
  1183. % seem worth the trouble, since most documents are normally structured.
  1184. \edef\pdfoutlinedest{#3}%
  1185. \ifx\pdfoutlinedest\empty
  1186. \def\pdfoutlinedest{#4}%
  1187. \else
  1188. \txiescapepdf\pdfoutlinedest
  1189. \fi
  1190. %
  1191. % Also escape PDF chars in the display string.
  1192. \edef\pdfoutlinetext{#1}%
  1193. \txiescapepdf\pdfoutlinetext
  1194. %
  1195. \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
  1196. }
  1197. %
  1198. \def\pdfmakeoutlines{%
  1199. \begingroup
  1200. % Read toc silently, to get counts of subentries for \pdfoutline.
  1201. \def\partentry##1##2##3##4{}% ignore parts in the outlines
  1202. \def\numchapentry##1##2##3##4{%
  1203. \def\thischapnum{##2}%
  1204. \def\thissecnum{0}%
  1205. \def\thissubsecnum{0}%
  1206. }%
  1207. \def\numsecentry##1##2##3##4{%
  1208. \advancenumber{chap\thischapnum}%
  1209. \def\thissecnum{##2}%
  1210. \def\thissubsecnum{0}%
  1211. }%
  1212. \def\numsubsecentry##1##2##3##4{%
  1213. \advancenumber{sec\thissecnum}%
  1214. \def\thissubsecnum{##2}%
  1215. }%
  1216. \def\numsubsubsecentry##1##2##3##4{%
  1217. \advancenumber{subsec\thissubsecnum}%
  1218. }%
  1219. \def\thischapnum{0}%
  1220. \def\thissecnum{0}%
  1221. \def\thissubsecnum{0}%
  1222. %
  1223. % use \def rather than \let here because we redefine \chapentry et
  1224. % al. a second time, below.
  1225. \def\appentry{\numchapentry}%
  1226. \def\appsecentry{\numsecentry}%
  1227. \def\appsubsecentry{\numsubsecentry}%
  1228. \def\appsubsubsecentry{\numsubsubsecentry}%
  1229. \def\unnchapentry{\numchapentry}%
  1230. \def\unnsecentry{\numsecentry}%
  1231. \def\unnsubsecentry{\numsubsecentry}%
  1232. \def\unnsubsubsecentry{\numsubsubsecentry}%
  1233. \readdatafile{toc}%
  1234. %
  1235. % Read toc second time, this time actually producing the outlines.
  1236. % The `-' means take the \expnumber as the absolute number of
  1237. % subentries, which we calculated on our first read of the .toc above.
  1238. %
  1239. % We use the node names as the destinations.
  1240. \def\numchapentry##1##2##3##4{%
  1241. \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
  1242. \def\numsecentry##1##2##3##4{%
  1243. \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
  1244. \def\numsubsecentry##1##2##3##4{%
  1245. \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%
  1246. \def\numsubsubsecentry##1##2##3##4{% count is always zero
  1247. \dopdfoutline{##1}{}{##3}{##4}}%
  1248. %
  1249. % PDF outlines are displayed using system fonts, instead of
  1250. % document fonts. Therefore we cannot use special characters,
  1251. % since the encoding is unknown. For example, the eogonek from
  1252. % Latin 2 (0xea) gets translated to a | character. Info from
  1253. % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
  1254. %
  1255. % TODO this right, we have to translate 8-bit characters to
  1256. % their "best" equivalent, based on the @documentencoding. Too
  1257. % much work for too little return. Just use the ASCII equivalents
  1258. % we use for the index sort strings.
  1259. %
  1260. \indexnofonts
  1261. \setupdatafile
  1262. % We can have normal brace characters in the PDF outlines, unlike
  1263. % Texinfo index files. So set that up.
  1264. \def\{{\lbracecharliteral}%
  1265. \def\}{\rbracecharliteral}%
  1266. \catcode`\\=\active \otherbackslash
  1267. \input \tocreadfilename
  1268. \endgroup
  1269. }
  1270. {\catcode`[=1 \catcode`]=2
  1271. \catcode`{=\other \catcode`}=\other
  1272. \gdef\lbracecharliteral[{]%
  1273. \gdef\rbracecharliteral[}]%
  1274. ]
  1275. %
  1276. \def\skipspaces#1{\def\PP{#1}\def\D{|}%
  1277. \ifx\PP\D\let\nextsp\relax
  1278. \else\let\nextsp\skipspaces
  1279. \addtokens{\filename}{\PP}%
  1280. \advance\filenamelength by 1
  1281. \fi
  1282. \nextsp}
  1283. \def\getfilename#1{%
  1284. \filenamelength=0
  1285. % If we don't expand the argument now, \skipspaces will get
  1286. % snagged on things like "@value{foo}".
  1287. \edef\temp{#1}%
  1288. \expandafter\skipspaces\temp|\relax
  1289. }
  1290. \ifnum\pdftexversion < 14
  1291. \let \startlink \pdfannotlink
  1292. \else
  1293. \let \startlink \pdfstartlink
  1294. \fi
  1295. % make a live url in pdf output.
  1296. \def\pdfurl#1{%
  1297. \begingroup
  1298. % it seems we really need yet another set of dummies; have not
  1299. % tried to figure out what each command should do in the context
  1300. % of @url. for now, just make @/ a no-op, that's the only one
  1301. % people have actually reported a problem with.
  1302. %
  1303. \normalturnoffactive
  1304. \def\@{@}%
  1305. \let\/=\empty
  1306. \makevalueexpandable
  1307. % do we want to go so far as to use \indexnofonts instead of just
  1308. % special-casing \var here?
  1309. \def\var##1{##1}%
  1310. %
  1311. \leavevmode\setcolor{\urlcolor}%
  1312. \startlink attr{/Border [0 0 0]}%
  1313. user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
  1314. \endgroup}
  1315. \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
  1316. \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
  1317. \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
  1318. \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
  1319. \def\maketoks{%
  1320. \expandafter\poptoks\the\toksA|ENDTOKS|\relax
  1321. \ifx\first0\adn0
  1322. \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
  1323. \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
  1324. \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
  1325. \else
  1326. \ifnum0=\countA\else\makelink\fi
  1327. \ifx\first.\let\next=\done\else
  1328. \let\next=\maketoks
  1329. \addtokens{\toksB}{\the\toksD}
  1330. \ifx\first,\addtokens{\toksB}{\space}\fi
  1331. \fi
  1332. \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
  1333. \next}
  1334. \def\makelink{\addtokens{\toksB}%
  1335. {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
  1336. \def\pdflink#1{%
  1337. \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
  1338. \setcolor{\linkcolor}#1\endlink}
  1339. \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
  1340. \else
  1341. % non-pdf mode
  1342. \let\pdfmkdest = \gobble
  1343. \let\pdfurl = \gobble
  1344. \let\endlink = \relax
  1345. \let\setcolor = \gobble
  1346. \let\pdfsetcolor = \gobble
  1347. \let\pdfmakeoutlines = \relax
  1348. \fi % \ifx\pdfoutput
  1349. \message{fonts,}
  1350. % Change the current font style to #1, remembering it in \curfontstyle.
  1351. % For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
  1352. % italics, not bold italics.
  1353. %
  1354. \def\setfontstyle#1{%
  1355. \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
  1356. \csname ten#1\endcsname % change the current font
  1357. }
  1358. % Select #1 fonts with the current style.
  1359. %
  1360. \def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname}
  1361. \def\rm{\fam=0 \setfontstyle{rm}}
  1362. \def\it{\fam=\itfam \setfontstyle{it}}
  1363. \def\sl{\fam=\slfam \setfontstyle{sl}}
  1364. \def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
  1365. \def\tt{\fam=\ttfam \setfontstyle{tt}}
  1366. % Unfortunately, we have to override this for titles and the like, since
  1367. % in those cases "rm" is bold. Sigh.
  1368. \def\rmisbold{\rm\def\curfontstyle{bf}}
  1369. % Texinfo sort of supports the sans serif font style, which plain TeX does not.
  1370. % So we set up a \sf.
  1371. \newfam\sffam
  1372. \def\sf{\fam=\sffam \setfontstyle{sf}}
  1373. \let\li = \sf % Sometimes we call it \li, not \sf.
  1374. % We don't need math for this font style.
  1375. \def\ttsl{\setfontstyle{ttsl}}
  1376. % Set the baselineskip to #1, and the lineskip and strut size
  1377. % correspondingly. There is no deep meaning behind these magic numbers
  1378. % used as factors; they just match (closely enough) what Knuth defined.
  1379. %
  1380. \def\lineskipfactor{.08333}
  1381. \def\strutheightpercent{.70833}
  1382. \def\strutdepthpercent {.29167}
  1383. %
  1384. % can get a sort of poor man's double spacing by redefining this.
  1385. \def\baselinefactor{1}
  1386. %
  1387. \newdimen\textleading
  1388. \def\setleading#1{%
  1389. \dimen0 = #1\relax
  1390. \normalbaselineskip = \baselinefactor\dimen0
  1391. \normallineskip = \lineskipfactor\normalbaselineskip
  1392. \normalbaselines
  1393. \setbox\strutbox =\hbox{%
  1394. \vrule width0pt height\strutheightpercent\baselineskip
  1395. depth \strutdepthpercent \baselineskip
  1396. }%
  1397. }
  1398. % PDF CMaps. See also LaTeX's t1.cmap.
  1399. %
  1400. % do nothing with this by default.
  1401. \expandafter\let\csname cmapOT1\endcsname\gobble
  1402. \expandafter\let\csname cmapOT1IT\endcsname\gobble
  1403. \expandafter\let\csname cmapOT1TT\endcsname\gobble
  1404. % if we are producing pdf, and we have \pdffontattr, then define cmaps.
  1405. % (\pdffontattr was introduced many years ago, but people still run
  1406. % older pdftex's; it's easy to conditionalize, so we do.)
  1407. \ifpdf \ifx\pdffontattr\thisisundefined \else
  1408. \begingroup
  1409. \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
  1410. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
  1411. %%DocumentNeededResources: ProcSet (CIDInit)
  1412. %%IncludeResource: ProcSet (CIDInit)
  1413. %%BeginResource: CMap (TeX-OT1-0)
  1414. %%Title: (TeX-OT1-0 TeX OT1 0)
  1415. %%Version: 1.000
  1416. %%EndComments
  1417. /CIDInit /ProcSet findresource begin
  1418. 12 dict begin
  1419. begincmap
  1420. /CIDSystemInfo
  1421. << /Registry (TeX)
  1422. /Ordering (OT1)
  1423. /Supplement 0
  1424. >> def
  1425. /CMapName /TeX-OT1-0 def
  1426. /CMapType 2 def
  1427. 1 begincodespacerange
  1428. <00> <7F>
  1429. endcodespacerange
  1430. 8 beginbfrange
  1431. <00> <01> <0393>
  1432. <09> <0A> <03A8>
  1433. <23> <26> <0023>
  1434. <28> <3B> <0028>
  1435. <3F> <5B> <003F>
  1436. <5D> <5E> <005D>
  1437. <61> <7A> <0061>
  1438. <7B> <7C> <2013>
  1439. endbfrange
  1440. 40 beginbfchar
  1441. <02> <0398>
  1442. <03> <039B>
  1443. <04> <039E>
  1444. <05> <03A0>
  1445. <06> <03A3>
  1446. <07> <03D2>
  1447. <08> <03A6>
  1448. <0B> <00660066>
  1449. <0C> <00660069>
  1450. <0D> <0066006C>
  1451. <0E> <006600660069>
  1452. <0F> <00660066006C>
  1453. <10> <0131>
  1454. <11> <0237>
  1455. <12> <0060>
  1456. <13> <00B4>
  1457. <14> <02C7>
  1458. <15> <02D8>
  1459. <16> <00AF>
  1460. <17> <02DA>
  1461. <18> <00B8>
  1462. <19> <00DF>
  1463. <1A> <00E6>
  1464. <1B> <0153>
  1465. <1C> <00F8>
  1466. <1D> <00C6>
  1467. <1E> <0152>
  1468. <1F> <00D8>
  1469. <21> <0021>
  1470. <22> <201D>
  1471. <27> <2019>
  1472. <3C> <00A1>
  1473. <3D> <003D>
  1474. <3E> <00BF>
  1475. <5C> <201C>
  1476. <5F> <02D9>
  1477. <60> <2018>
  1478. <7D> <02DD>
  1479. <7E> <007E>
  1480. <7F> <00A8>
  1481. endbfchar
  1482. endcmap
  1483. CMapName currentdict /CMap defineresource pop
  1484. end
  1485. end
  1486. %%EndResource
  1487. %%EOF
  1488. }\endgroup
  1489. \expandafter\edef\csname cmapOT1\endcsname#1{%
  1490. \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
  1491. }%
  1492. %
  1493. % \cmapOT1IT
  1494. \begingroup
  1495. \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
  1496. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
  1497. %%DocumentNeededResources: ProcSet (CIDInit)
  1498. %%IncludeResource: ProcSet (CIDInit)
  1499. %%BeginResource: CMap (TeX-OT1IT-0)
  1500. %%Title: (TeX-OT1IT-0 TeX OT1IT 0)
  1501. %%Version: 1.000
  1502. %%EndComments
  1503. /CIDInit /ProcSet findresource begin
  1504. 12 dict begin
  1505. begincmap
  1506. /CIDSystemInfo
  1507. << /Registry (TeX)
  1508. /Ordering (OT1IT)
  1509. /Supplement 0
  1510. >> def
  1511. /CMapName /TeX-OT1IT-0 def
  1512. /CMapType 2 def
  1513. 1 begincodespacerange
  1514. <00> <7F>
  1515. endcodespacerange
  1516. 8 beginbfrange
  1517. <00> <01> <0393>
  1518. <09> <0A> <03A8>
  1519. <25> <26> <0025>
  1520. <28> <3B> <0028>
  1521. <3F> <5B> <003F>
  1522. <5D> <5E> <005D>
  1523. <61> <7A> <0061>
  1524. <7B> <7C> <2013>
  1525. endbfrange
  1526. 42 beginbfchar
  1527. <02> <0398>
  1528. <03> <039B>
  1529. <04> <039E>
  1530. <05> <03A0>
  1531. <06> <03A3>
  1532. <07> <03D2>
  1533. <08> <03A6>
  1534. <0B> <00660066>
  1535. <0C> <00660069>
  1536. <0D> <0066006C>
  1537. <0E> <006600660069>
  1538. <0F> <00660066006C>
  1539. <10> <0131>
  1540. <11> <0237>
  1541. <12> <0060>
  1542. <13> <00B4>
  1543. <14> <02C7>
  1544. <15> <02D8>
  1545. <16> <00AF>
  1546. <17> <02DA>
  1547. <18> <00B8>
  1548. <19> <00DF>
  1549. <1A> <00E6>
  1550. <1B> <0153>
  1551. <1C> <00F8>
  1552. <1D> <00C6>
  1553. <1E> <0152>
  1554. <1F> <00D8>
  1555. <21> <0021>
  1556. <22> <201D>
  1557. <23> <0023>
  1558. <24> <00A3>
  1559. <27> <2019>
  1560. <3C> <00A1>
  1561. <3D> <003D>
  1562. <3E> <00BF>
  1563. <5C> <201C>
  1564. <5F> <02D9>
  1565. <60> <2018>
  1566. <7D> <02DD>
  1567. <7E> <007E>
  1568. <7F> <00A8>
  1569. endbfchar
  1570. endcmap
  1571. CMapName currentdict /CMap defineresource pop
  1572. end
  1573. end
  1574. %%EndResource
  1575. %%EOF
  1576. }\endgroup
  1577. \expandafter\edef\csname cmapOT1IT\endcsname#1{%
  1578. \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
  1579. }%
  1580. %
  1581. % \cmapOT1TT
  1582. \begingroup
  1583. \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
  1584. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
  1585. %%DocumentNeededResources: ProcSet (CIDInit)
  1586. %%IncludeResource: ProcSet (CIDInit)
  1587. %%BeginResource: CMap (TeX-OT1TT-0)
  1588. %%Title: (TeX-OT1TT-0 TeX OT1TT 0)
  1589. %%Version: 1.000
  1590. %%EndComments
  1591. /CIDInit /ProcSet findresource begin
  1592. 12 dict begin
  1593. begincmap
  1594. /CIDSystemInfo
  1595. << /Registry (TeX)
  1596. /Ordering (OT1TT)
  1597. /Supplement 0
  1598. >> def
  1599. /CMapName /TeX-OT1TT-0 def
  1600. /CMapType 2 def
  1601. 1 begincodespacerange
  1602. <00> <7F>
  1603. endcodespacerange
  1604. 5 beginbfrange
  1605. <00> <01> <0393>
  1606. <09> <0A> <03A8>
  1607. <21> <26> <0021>
  1608. <28> <5F> <0028>
  1609. <61> <7E> <0061>
  1610. endbfrange
  1611. 32 beginbfchar
  1612. <02> <0398>
  1613. <03> <039B>
  1614. <04> <039E>
  1615. <05> <03A0>
  1616. <06> <03A3>
  1617. <07> <03D2>
  1618. <08> <03A6>
  1619. <0B> <2191>
  1620. <0C> <2193>
  1621. <0D> <0027>
  1622. <0E> <00A1>
  1623. <0F> <00BF>
  1624. <10> <0131>
  1625. <11> <0237>
  1626. <12> <0060>
  1627. <13> <00B4>
  1628. <14> <02C7>
  1629. <15> <02D8>
  1630. <16> <00AF>
  1631. <17> <02DA>
  1632. <18> <00B8>
  1633. <19> <00DF>
  1634. <1A> <00E6>
  1635. <1B> <0153>
  1636. <1C> <00F8>
  1637. <1D> <00C6>
  1638. <1E> <0152>
  1639. <1F> <00D8>
  1640. <20> <2423>
  1641. <27> <2019>
  1642. <60> <2018>
  1643. <7F> <00A8>
  1644. endbfchar
  1645. endcmap
  1646. CMapName currentdict /CMap defineresource pop
  1647. end
  1648. end
  1649. %%EndResource
  1650. %%EOF
  1651. }\endgroup
  1652. \expandafter\edef\csname cmapOT1TT\endcsname#1{%
  1653. \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
  1654. }%
  1655. \fi\fi
  1656. % Set the font macro #1 to the font named \fontprefix#2.
  1657. % #3 is the font's design size, #4 is a scale factor, #5 is the CMap
  1658. % encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit).
  1659. % Example:
  1660. % #1 = \textrm
  1661. % #2 = \rmshape
  1662. % #3 = 10
  1663. % #4 = \mainmagstep
  1664. % #5 = OT1
  1665. %
  1666. \def\setfont#1#2#3#4#5{%
  1667. \font#1=\fontprefix#2#3 scaled #4
  1668. \csname cmap#5\endcsname#1%
  1669. }
  1670. % This is what gets called when #5 of \setfont is empty.
  1671. \let\cmap\gobble
  1672. %
  1673. % (end of cmaps)
  1674. % Use cm as the default font prefix.
  1675. % To specify the font prefix, you must define \fontprefix
  1676. % before you read in texinfo.tex.
  1677. \ifx\fontprefix\thisisundefined
  1678. \def\fontprefix{cm}
  1679. \fi
  1680. % Support font families that don't use the same naming scheme as CM.
  1681. \def\rmshape{r}
  1682. \def\rmbshape{bx} % where the normal face is bold
  1683. \def\bfshape{b}
  1684. \def\bxshape{bx}
  1685. \def\ttshape{tt}
  1686. \def\ttbshape{tt}
  1687. \def\ttslshape{sltt}
  1688. \def\itshape{ti}
  1689. \def\itbshape{bxti}
  1690. \def\slshape{sl}
  1691. \def\slbshape{bxsl}
  1692. \def\sfshape{ss}
  1693. \def\sfbshape{ss}
  1694. \def\scshape{csc}
  1695. \def\scbshape{csc}
  1696. % Definitions for a main text size of 11pt. (The default in Texinfo.)
  1697. %
  1698. \def\definetextfontsizexi{%
  1699. % Text fonts (11.2pt, magstep1).
  1700. \def\textnominalsize{11pt}
  1701. \edef\mainmagstep{\magstephalf}
  1702. \setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
  1703. \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
  1704. \setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
  1705. \setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
  1706. \setfont\textsl\slshape{10}{\mainmagstep}{OT1}
  1707. \setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
  1708. \setfont\textsc\scshape{10}{\mainmagstep}{OT1}
  1709. \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
  1710. \font\texti=cmmi10 scaled \mainmagstep
  1711. \font\textsy=cmsy10 scaled \mainmagstep
  1712. \def\textecsize{1095}
  1713. % A few fonts for @defun names and args.
  1714. \setfont\defbf\bfshape{10}{\magstep1}{OT1}
  1715. \setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
  1716. \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
  1717. \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
  1718. % Fonts for indices, footnotes, small examples (9pt).
  1719. \def\smallnominalsize{9pt}
  1720. \setfont\smallrm\rmshape{9}{1000}{OT1}
  1721. \setfont\smalltt\ttshape{9}{1000}{OT1TT}
  1722. \setfont\smallbf\bfshape{10}{900}{OT1}
  1723. \setfont\smallit\itshape{9}{1000}{OT1IT}
  1724. \setfont\smallsl\slshape{9}{1000}{OT1}
  1725. \setfont\smallsf\sfshape{9}{1000}{OT1}
  1726. \setfont\smallsc\scshape{10}{900}{OT1}
  1727. \setfont\smallttsl\ttslshape{10}{900}{OT1TT}
  1728. \font\smalli=cmmi9
  1729. \font\smallsy=cmsy9
  1730. \def\smallecsize{0900}
  1731. % Fonts for small examples (8pt).
  1732. \def\smallernominalsize{8pt}
  1733. \setfont\smallerrm\rmshape{8}{1000}{OT1}
  1734. \setfont\smallertt\ttshape{8}{1000}{OT1TT}
  1735. \setfont\smallerbf\bfshape{10}{800}{OT1}
  1736. \setfont\smallerit\itshape{8}{1000}{OT1IT}
  1737. \setfont\smallersl\slshape{8}{1000}{OT1}
  1738. \setfont\smallersf\sfshape{8}{1000}{OT1}
  1739. \setfont\smallersc\scshape{10}{800}{OT1}
  1740. \setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
  1741. \font\smalleri=cmmi8
  1742. \font\smallersy=cmsy8
  1743. \def\smallerecsize{0800}
  1744. % Fonts for title page (20.4pt):
  1745. \def\titlenominalsize{20pt}
  1746. \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
  1747. \setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
  1748. \setfont\titlesl\slbshape{10}{\magstep4}{OT1}
  1749. \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
  1750. \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
  1751. \setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
  1752. \let\titlebf=\titlerm
  1753. \setfont\titlesc\scbshape{10}{\magstep4}{OT1}
  1754. \font\titlei=cmmi12 scaled \magstep3
  1755. \font\titlesy=cmsy10 scaled \magstep4
  1756. \def\titleecsize{2074}
  1757. % Chapter (and unnumbered) fonts (17.28pt).
  1758. \def\chapnominalsize{17pt}
  1759. \setfont\chaprm\rmbshape{12}{\magstep2}{OT1}
  1760. \setfont\chapit\itbshape{10}{\magstep3}{OT1IT}
  1761. \setfont\chapsl\slbshape{10}{\magstep3}{OT1}
  1762. \setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT}
  1763. \setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT}
  1764. \setfont\chapsf\sfbshape{17}{1000}{OT1}
  1765. \let\chapbf=\chaprm
  1766. \setfont\chapsc\scbshape{10}{\magstep3}{OT1}
  1767. \font\chapi=cmmi12 scaled \magstep2
  1768. \font\chapsy=cmsy10 scaled \magstep3
  1769. \def\chapecsize{1728}
  1770. % Section fonts (14.4pt).
  1771. \def\secnominalsize{14pt}
  1772. \setfont\secrm\rmbshape{12}{\magstep1}{OT1}
  1773. \setfont\secit\itbshape{10}{\magstep2}{OT1IT}
  1774. \setfont\secsl\slbshape{10}{\magstep2}{OT1}
  1775. \setfont\sectt\ttbshape{12}{\magstep1}{OT1TT}
  1776. \setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT}
  1777. \setfont\secsf\sfbshape{12}{\magstep1}{OT1}
  1778. \let\secbf\secrm
  1779. \setfont\secsc\scbshape{10}{\magstep2}{OT1}
  1780. \font\seci=cmmi12 scaled \magstep1
  1781. \font\secsy=cmsy10 scaled \magstep2
  1782. \def\sececsize{1440}
  1783. % Subsection fonts (13.15pt).
  1784. \def\ssecnominalsize{13pt}
  1785. \setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1}
  1786. \setfont\ssecit\itbshape{10}{1315}{OT1IT}
  1787. \setfont\ssecsl\slbshape{10}{1315}{OT1}
  1788. \setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT}
  1789. \setfont\ssecttsl\ttslshape{10}{1315}{OT1TT}
  1790. \setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1}
  1791. \let\ssecbf\ssecrm
  1792. \setfont\ssecsc\scbshape{10}{1315}{OT1}
  1793. \font\sseci=cmmi12 scaled \magstephalf
  1794. \font\ssecsy=cmsy10 scaled 1315
  1795. \def\ssececsize{1200}
  1796. % Reduced fonts for @acro in text (10pt).
  1797. \def\reducednominalsize{10pt}
  1798. \setfont\reducedrm\rmshape{10}{1000}{OT1}
  1799. \setfont\reducedtt\ttshape{10}{1000}{OT1TT}
  1800. \setfont\reducedbf\bfshape{10}{1000}{OT1}
  1801. \setfont\reducedit\itshape{10}{1000}{OT1IT}
  1802. \setfont\reducedsl\slshape{10}{1000}{OT1}
  1803. \setfont\reducedsf\sfshape{10}{1000}{OT1}
  1804. \setfont\reducedsc\scshape{10}{1000}{OT1}
  1805. \setfont\reducedttsl\ttslshape{10}{1000}{OT1TT}
  1806. \font\reducedi=cmmi10
  1807. \font\reducedsy=cmsy10
  1808. \def\reducedecsize{1000}
  1809. \textleading = 13.2pt % line spacing for 11pt CM
  1810. \textfonts % reset the current fonts
  1811. \rm
  1812. } % end of 11pt text font size definitions, \definetextfontsizexi
  1813. % Definitions to make the main text be 10pt Computer Modern, with
  1814. % section, chapter, etc., sizes following suit. This is for the GNU
  1815. % Press printing of the Emacs 22 manual. Maybe other manuals in the
  1816. % future. Used with @smallbook, which sets the leading to 12pt.
  1817. %
  1818. \def\definetextfontsizex{%
  1819. % Text fonts (10pt).
  1820. \def\textnominalsize{10pt}
  1821. \edef\mainmagstep{1000}
  1822. \setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
  1823. \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
  1824. \setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
  1825. \setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
  1826. \setfont\textsl\slshape{10}{\mainmagstep}{OT1}
  1827. \setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
  1828. \setfont\textsc\scshape{10}{\mainmagstep}{OT1}
  1829. \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
  1830. \font\texti=cmmi10 scaled \mainmagstep
  1831. \font\textsy=cmsy10 scaled \mainmagstep
  1832. \def\textecsize{1000}
  1833. % A few fonts for @defun names and args.
  1834. \setfont\defbf\bfshape{10}{\magstephalf}{OT1}
  1835. \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
  1836. \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
  1837. \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
  1838. % Fonts for indices, footnotes, small examples (9pt).
  1839. \def\smallnominalsize{9pt}
  1840. \setfont\smallrm\rmshape{9}{1000}{OT1}
  1841. \setfont\smalltt\ttshape{9}{1000}{OT1TT}
  1842. \setfont\smallbf\bfshape{10}{900}{OT1}
  1843. \setfont\smallit\itshape{9}{1000}{OT1IT}
  1844. \setfont\smallsl\slshape{9}{1000}{OT1}
  1845. \setfont\smallsf\sfshape{9}{1000}{OT1}
  1846. \setfont\smallsc\scshape{10}{900}{OT1}
  1847. \setfont\smallttsl\ttslshape{10}{900}{OT1TT}
  1848. \font\smalli=cmmi9
  1849. \font\smallsy=cmsy9
  1850. \def\smallecsize{0900}
  1851. % Fonts for small examples (8pt).
  1852. \def\smallernominalsize{8pt}
  1853. \setfont\smallerrm\rmshape{8}{1000}{OT1}
  1854. \setfont\smallertt\ttshape{8}{1000}{OT1TT}
  1855. \setfont\smallerbf\bfshape{10}{800}{OT1}
  1856. \setfont\smallerit\itshape{8}{1000}{OT1IT}
  1857. \setfont\smallersl\slshape{8}{1000}{OT1}
  1858. \setfont\smallersf\sfshape{8}{1000}{OT1}
  1859. \setfont\smallersc\scshape{10}{800}{OT1}
  1860. \setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
  1861. \font\smalleri=cmmi8
  1862. \font\smallersy=cmsy8
  1863. \def\smallerecsize{0800}
  1864. % Fonts for title page (20.4pt):
  1865. \def\titlenominalsize{20pt}
  1866. \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
  1867. \setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
  1868. \setfont\titlesl\slbshape{10}{\magstep4}{OT1}
  1869. \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
  1870. \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
  1871. \setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
  1872. \let\titlebf=\titlerm
  1873. \setfont\titlesc\scbshape{10}{\magstep4}{OT1}
  1874. \font\titlei=cmmi12 scaled \magstep3
  1875. \font\titlesy=cmsy10 scaled \magstep4
  1876. \def\titleecsize{2074}
  1877. % Chapter fonts (14.4pt).
  1878. \def\chapnominalsize{14pt}
  1879. \setfont\chaprm\rmbshape{12}{\magstep1}{OT1}
  1880. \setfont\chapit\itbshape{10}{\magstep2}{OT1IT}
  1881. \setfont\chapsl\slbshape{10}{\magstep2}{OT1}
  1882. \setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT}
  1883. \setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT}
  1884. \setfont\chapsf\sfbshape{12}{\magstep1}{OT1}
  1885. \let\chapbf\chaprm
  1886. \setfont\chapsc\scbshape{10}{\magstep2}{OT1}
  1887. \font\chapi=cmmi12 scaled \magstep1
  1888. \font\chapsy=cmsy10 scaled \magstep2
  1889. \def\chapecsize{1440}
  1890. % Section fonts (12pt).
  1891. \def\secnominalsize{12pt}
  1892. \setfont\secrm\rmbshape{12}{1000}{OT1}
  1893. \setfont\secit\itbshape{10}{\magstep1}{OT1IT}
  1894. \setfont\secsl\slbshape{10}{\magstep1}{OT1}
  1895. \setfont\sectt\ttbshape{12}{1000}{OT1TT}
  1896. \setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT}
  1897. \setfont\secsf\sfbshape{12}{1000}{OT1}
  1898. \let\secbf\secrm
  1899. \setfont\secsc\scbshape{10}{\magstep1}{OT1}
  1900. \font\seci=cmmi12
  1901. \font\secsy=cmsy10 scaled \magstep1
  1902. \def\sececsize{1200}
  1903. % Subsection fonts (10pt).
  1904. \def\ssecnominalsize{10pt}
  1905. \setfont\ssecrm\rmbshape{10}{1000}{OT1}
  1906. \setfont\ssecit\itbshape{10}{1000}{OT1IT}
  1907. \setfont\ssecsl\slbshape{10}{1000}{OT1}
  1908. \setfont\ssectt\ttbshape{10}{1000}{OT1TT}
  1909. \setfont\ssecttsl\ttslshape{10}{1000}{OT1TT}
  1910. \setfont\ssecsf\sfbshape{10}{1000}{OT1}
  1911. \let\ssecbf\ssecrm
  1912. \setfont\ssecsc\scbshape{10}{1000}{OT1}
  1913. \font\sseci=cmmi10
  1914. \font\ssecsy=cmsy10
  1915. \def\ssececsize{1000}
  1916. % Reduced fonts for @acro in text (9pt).
  1917. \def\reducednominalsize{9pt}
  1918. \setfont\reducedrm\rmshape{9}{1000}{OT1}
  1919. \setfont\reducedtt\ttshape{9}{1000}{OT1TT}
  1920. \setfont\reducedbf\bfshape{10}{900}{OT1}
  1921. \setfont\reducedit\itshape{9}{1000}{OT1IT}
  1922. \setfont\reducedsl\slshape{9}{1000}{OT1}
  1923. \setfont\reducedsf\sfshape{9}{1000}{OT1}
  1924. \setfont\reducedsc\scshape{10}{900}{OT1}
  1925. \setfont\reducedttsl\ttslshape{10}{900}{OT1TT}
  1926. \font\reducedi=cmmi9
  1927. \font\reducedsy=cmsy9
  1928. \def\reducedecsize{0900}
  1929. \divide\parskip by 2 % reduce space between paragraphs
  1930. \textleading = 12pt % line spacing for 10pt CM
  1931. \textfonts % reset the current fonts
  1932. \rm
  1933. } % end of 10pt text font size definitions, \definetextfontsizex
  1934. % We provide the user-level command
  1935. % @fonttextsize 10
  1936. % (or 11) to redefine the text font size. pt is assumed.
  1937. %
  1938. \def\xiword{11}
  1939. \def\xword{10}
  1940. \def\xwordpt{10pt}
  1941. %
  1942. \parseargdef\fonttextsize{%
  1943. \def\textsizearg{#1}%
  1944. %\wlog{doing @fonttextsize \textsizearg}%
  1945. %
  1946. % Set \globaldefs so that documents can use this inside @tex, since
  1947. % makeinfo 4.8 does not support it, but we need it nonetheless.
  1948. %
  1949. \begingroup \globaldefs=1
  1950. \ifx\textsizearg\xword \definetextfontsizex
  1951. \else \ifx\textsizearg\xiword \definetextfontsizexi
  1952. \else
  1953. \errhelp=\EMsimple
  1954. \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
  1955. \fi\fi
  1956. \endgroup
  1957. }
  1958. % In order for the font changes to affect most math symbols and letters,
  1959. % we have to define the \textfont of the standard families. Since
  1960. % texinfo doesn't allow for producing subscripts and superscripts except
  1961. % in the main text, we don't bother to reset \scriptfont and
  1962. % \scriptscriptfont (which would also require loading a lot more fonts).
  1963. %
  1964. \def\resetmathfonts{%
  1965. \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy
  1966. \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf
  1967. \textfont\ttfam=\tentt \textfont\sffam=\tensf
  1968. }
  1969. % The font-changing commands redefine the meanings of \tenSTYLE, instead
  1970. % of just \STYLE. We do this because \STYLE needs to also set the
  1971. % current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire
  1972. % \tenSTYLE to set the current font.
  1973. %
  1974. % Each font-changing command also sets the names \lsize (one size lower)
  1975. % and \lllsize (three sizes lower). These relative commands are used in
  1976. % the LaTeX logo and acronyms.
  1977. %
  1978. % This all needs generalizing, badly.
  1979. %
  1980. \def\textfonts{%
  1981. \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
  1982. \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
  1983. \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
  1984. \let\tenttsl=\textttsl
  1985. \def\curfontsize{text}%
  1986. \def\lsize{reduced}\def\lllsize{smaller}%
  1987. \resetmathfonts \setleading{\textleading}}
  1988. \def\titlefonts{%
  1989. \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
  1990. \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
  1991. \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
  1992. \let\tenttsl=\titlettsl
  1993. \def\curfontsize{title}%
  1994. \def\lsize{chap}\def\lllsize{subsec}%
  1995. \resetmathfonts \setleading{27pt}}
  1996. \def\titlefont#1{{\titlefonts\rmisbold #1}}
  1997. \def\chapfonts{%
  1998. \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
  1999. \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
  2000. \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
  2001. \let\tenttsl=\chapttsl
  2002. \def\curfontsize{chap}%
  2003. \def\lsize{sec}\def\lllsize{text}%
  2004. \resetmathfonts \setleading{19pt}}
  2005. \def\secfonts{%
  2006. \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
  2007. \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
  2008. \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
  2009. \let\tenttsl=\secttsl
  2010. \def\curfontsize{sec}%
  2011. \def\lsize{subsec}\def\lllsize{reduced}%
  2012. \resetmathfonts \setleading{16pt}}
  2013. \def\subsecfonts{%
  2014. \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
  2015. \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
  2016. \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
  2017. \let\tenttsl=\ssecttsl
  2018. \def\curfontsize{ssec}%
  2019. \def\lsize{text}\def\lllsize{small}%
  2020. \resetmathfonts \setleading{15pt}}
  2021. \let\subsubsecfonts = \subsecfonts
  2022. \def\reducedfonts{%
  2023. \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl
  2024. \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc
  2025. \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy
  2026. \let\tenttsl=\reducedttsl
  2027. \def\curfontsize{reduced}%
  2028. \def\lsize{small}\def\lllsize{smaller}%
  2029. \resetmathfonts \setleading{10.5pt}}
  2030. \def\smallfonts{%
  2031. \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
  2032. \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
  2033. \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
  2034. \let\tenttsl=\smallttsl
  2035. \def\curfontsize{small}%
  2036. \def\lsize{smaller}\def\lllsize{smaller}%
  2037. \resetmathfonts \setleading{10.5pt}}
  2038. \def\smallerfonts{%
  2039. \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
  2040. \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
  2041. \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
  2042. \let\tenttsl=\smallerttsl
  2043. \def\curfontsize{smaller}%
  2044. \def\lsize{smaller}\def\lllsize{smaller}%
  2045. \resetmathfonts \setleading{9.5pt}}
  2046. % Fonts for short table of contents.
  2047. \setfont\shortcontrm\rmshape{12}{1000}{OT1}
  2048. \setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12
  2049. \setfont\shortcontsl\slshape{12}{1000}{OT1}
  2050. \setfont\shortconttt\ttshape{12}{1000}{OT1TT}
  2051. % Define these just so they can be easily changed for other fonts.
  2052. \def\angleleft{$\langle$}
  2053. \def\angleright{$\rangle$}
  2054. % Set the fonts to use with the @small... environments.
  2055. \let\smallexamplefonts = \smallfonts
  2056. % About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample
  2057. % can fit this many characters:
  2058. % 8.5x11=86 smallbook=72 a4=90 a5=69
  2059. % If we use \scriptfonts (8pt), then we can fit this many characters:
  2060. % 8.5x11=90+ smallbook=80 a4=90+ a5=77
  2061. % For me, subjectively, the few extra characters that fit aren't worth
  2062. % the additional smallness of 8pt. So I'm making the default 9pt.
  2063. %
  2064. % By the way, for comparison, here's what fits with @example (10pt):
  2065. % 8.5x11=71 smallbook=60 a4=75 a5=58
  2066. % --karl, 24jan03.
  2067. % Set up the default fonts, so we can use them for creating boxes.
  2068. %
  2069. \definetextfontsizexi
  2070. \message{markup,}
  2071. % Check if we are currently using a typewriter font. Since all the
  2072. % Computer Modern typewriter fonts have zero interword stretch (and
  2073. % shrink), and it is reasonable to expect all typewriter fonts to have
  2074. % this property, we can check that font parameter.
  2075. %
  2076. \def\ifmonospace{\ifdim\fontdimen3\font=0pt }
  2077. % Markup style infrastructure. \defmarkupstylesetup\INITMACRO will
  2078. % define and register \INITMACRO to be called on markup style changes.
  2079. % \INITMACRO can check \currentmarkupstyle for the innermost
  2080. % style and the set of \ifmarkupSTYLE switches for all styles
  2081. % currently in effect.
  2082. \newif\ifmarkupvar
  2083. \newif\ifmarkupsamp
  2084. \newif\ifmarkupkey
  2085. %\newif\ifmarkupfile % @file == @samp.
  2086. %\newif\ifmarkupoption % @option == @samp.
  2087. \newif\ifmarkupcode
  2088. \newif\ifmarkupkbd
  2089. %\newif\ifmarkupenv % @env == @code.
  2090. %\newif\ifmarkupcommand % @command == @code.
  2091. \newif\ifmarkuptex % @tex (and part of @math, for now).
  2092. \newif\ifmarkupexample
  2093. \newif\ifmarkupverb
  2094. \newif\ifmarkupverbatim
  2095. \let\currentmarkupstyle\empty
  2096. \def\setupmarkupstyle#1{%
  2097. \csname markup#1true\endcsname
  2098. \def\currentmarkupstyle{#1}%
  2099. \markupstylesetup
  2100. }
  2101. \let\markupstylesetup\empty
  2102. \def\defmarkupstylesetup#1{%
  2103. \expandafter\def\expandafter\markupstylesetup
  2104. \expandafter{\markupstylesetup #1}%
  2105. \def#1%
  2106. }
  2107. % Markup style setup for left and right quotes.
  2108. \defmarkupstylesetup\markupsetuplq{%
  2109. \expandafter\let\expandafter \temp
  2110. \csname markupsetuplq\currentmarkupstyle\endcsname
  2111. \ifx\temp\relax \markupsetuplqdefault \else \temp \fi
  2112. }
  2113. \defmarkupstylesetup\markupsetuprq{%
  2114. \expandafter\let\expandafter \temp
  2115. \csname markupsetuprq\currentmarkupstyle\endcsname
  2116. \ifx\temp\relax \markupsetuprqdefault \else \temp \fi
  2117. }
  2118. {
  2119. \catcode`\'=\active
  2120. \catcode`\`=\active
  2121. \gdef\markupsetuplqdefault{\let`\lq}
  2122. \gdef\markupsetuprqdefault{\let'\rq}
  2123. \gdef\markupsetcodequoteleft{\let`\codequoteleft}
  2124. \gdef\markupsetcodequoteright{\let'\codequoteright}
  2125. }
  2126. \let\markupsetuplqcode \markupsetcodequoteleft
  2127. \let\markupsetuprqcode \markupsetcodequoteright
  2128. %
  2129. \let\markupsetuplqexample \markupsetcodequoteleft
  2130. \let\markupsetuprqexample \markupsetcodequoteright
  2131. %
  2132. \let\markupsetuplqkbd \markupsetcodequoteleft
  2133. \let\markupsetuprqkbd \markupsetcodequoteright
  2134. %
  2135. \let\markupsetuplqsamp \markupsetcodequoteleft
  2136. \let\markupsetuprqsamp \markupsetcodequoteright
  2137. %
  2138. \let\markupsetuplqverb \markupsetcodequoteleft
  2139. \let\markupsetuprqverb \markupsetcodequoteright
  2140. %
  2141. \let\markupsetuplqverbatim \markupsetcodequoteleft
  2142. \let\markupsetuprqverbatim \markupsetcodequoteright
  2143. % Allow an option to not use regular directed right quote/apostrophe
  2144. % (char 0x27), but instead the undirected quote from cmtt (char 0x0d).
  2145. % The undirected quote is ugly, so don't make it the default, but it
  2146. % works for pasting with more pdf viewers (at least evince), the
  2147. % lilypond developers report. xpdf does work with the regular 0x27.
  2148. %
  2149. \def\codequoteright{%
  2150. \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
  2151. \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
  2152. '%
  2153. \else \char'15 \fi
  2154. \else \char'15 \fi
  2155. }
  2156. %
  2157. % and a similar option for the left quote char vs. a grave accent.
  2158. % Modern fonts display ASCII 0x60 as a grave accent, so some people like
  2159. % the code environments to do likewise.
  2160. %
  2161. \def\codequoteleft{%
  2162. \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
  2163. \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
  2164. % [Knuth] pp. 380,381,391
  2165. % \relax disables Spanish ligatures ?` and !` of \tt font.
  2166. \relax`%
  2167. \else \char'22 \fi
  2168. \else \char'22 \fi
  2169. }
  2170. % Commands to set the quote options.
  2171. %
  2172. \parseargdef\codequoteundirected{%
  2173. \def\temp{#1}%
  2174. \ifx\temp\onword
  2175. \expandafter\let\csname SETtxicodequoteundirected\endcsname
  2176. = t%
  2177. \else\ifx\temp\offword
  2178. \expandafter\let\csname SETtxicodequoteundirected\endcsname
  2179. = \relax
  2180. \else
  2181. \errhelp = \EMsimple
  2182. \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}%
  2183. \fi\fi
  2184. }
  2185. %
  2186. \parseargdef\codequotebacktick{%
  2187. \def\temp{#1}%
  2188. \ifx\temp\onword
  2189. \expandafter\let\csname SETtxicodequotebacktick\endcsname
  2190. = t%
  2191. \else\ifx\temp\offword
  2192. \expandafter\let\csname SETtxicodequotebacktick\endcsname
  2193. = \relax
  2194. \else
  2195. \errhelp = \EMsimple
  2196. \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}%
  2197. \fi\fi
  2198. }
  2199. % [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
  2200. \def\noligaturesquoteleft{\relax\lq}
  2201. % Count depth in font-changes, for error checks
  2202. \newcount\fontdepth \fontdepth=0
  2203. % Font commands.
  2204. % #1 is the font command (\sl or \it), #2 is the text to slant.
  2205. % If we are in a monospaced environment, however, 1) always use \ttsl,
  2206. % and 2) do not add an italic correction.
  2207. \def\dosmartslant#1#2{%
  2208. \ifusingtt
  2209. {{\ttsl #2}\let\next=\relax}%
  2210. {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}%
  2211. \next
  2212. }
  2213. \def\smartslanted{\dosmartslant\sl}
  2214. \def\smartitalic{\dosmartslant\it}
  2215. % Output an italic correction unless \next (presumed to be the following
  2216. % character) is such as not to need one.
  2217. \def\smartitaliccorrection{%
  2218. \ifx\next,%
  2219. \else\ifx\next-%
  2220. \else\ifx\next.%
  2221. \else\ifx\next\.%
  2222. \else\ifx\next\comma%
  2223. \else\ptexslash
  2224. \fi\fi\fi\fi\fi
  2225. \aftersmartic
  2226. }
  2227. % Unconditional use \ttsl, and no ic. @var is set to this for defuns.
  2228. \def\ttslanted#1{{\ttsl #1}}
  2229. % @cite is like \smartslanted except unconditionally use \sl. We never want
  2230. % ttsl for book titles, do we?
  2231. \def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection}
  2232. \def\aftersmartic{}
  2233. \def\var#1{%
  2234. \let\saveaftersmartic = \aftersmartic
  2235. \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}%
  2236. \smartslanted{#1}%
  2237. }
  2238. \let\i=\smartitalic
  2239. \let\slanted=\smartslanted
  2240. \let\dfn=\smartslanted
  2241. \let\emph=\smartitalic
  2242. % Explicit font changes: @r, @sc, undocumented @ii.
  2243. \def\r#1{{\rm #1}} % roman font
  2244. \def\sc#1{{\smallcaps#1}} % smallcaps font
  2245. \def\ii#1{{\it #1}} % italic font
  2246. % @b, explicit bold. Also @strong.
  2247. \def\b#1{{\bf #1}}
  2248. \let\strong=\b
  2249. % @sansserif, explicit sans.
  2250. \def\sansserif#1{{\sf #1}}
  2251. % We can't just use \exhyphenpenalty, because that only has effect at
  2252. % the end of a paragraph. Restore normal hyphenation at the end of the
  2253. % group within which \nohyphenation is presumably called.
  2254. %
  2255. \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
  2256. \def\restorehyphenation{\hyphenchar\font = `- }
  2257. % Set sfcode to normal for the chars that usually have another value.
  2258. % Can't use plain's \frenchspacing because it uses the `\x notation, and
  2259. % sometimes \x has an active definition that messes things up.
  2260. %
  2261. \catcode`@=11
  2262. \def\plainfrenchspacing{%
  2263. \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m
  2264. \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m
  2265. \def\endofsentencespacefactor{1000}% for @. and friends
  2266. }
  2267. \def\plainnonfrenchspacing{%
  2268. \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000
  2269. \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250
  2270. \def\endofsentencespacefactor{3000}% for @. and friends
  2271. }
  2272. \catcode`@=\other
  2273. \def\endofsentencespacefactor{3000}% default
  2274. % @t, explicit typewriter.
  2275. \def\t#1{%
  2276. {\tt \rawbackslash \plainfrenchspacing #1}%
  2277. \null
  2278. }
  2279. % @samp.
  2280. \def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}}
  2281. % @indicateurl is \samp, that is, with quotes.
  2282. \let\indicateurl=\samp
  2283. % @code (and similar) prints in typewriter, but with spaces the same
  2284. % size as normal in the surrounding text, without hyphenation, etc.
  2285. % This is a subroutine for that.
  2286. \def\tclose#1{%
  2287. {%
  2288. % Change normal interword space to be same as for the current font.
  2289. \spaceskip = \fontdimen2\font
  2290. %
  2291. % Switch to typewriter.
  2292. \tt
  2293. %
  2294. % But `\ ' produces the large typewriter interword space.
  2295. \def\ {{\spaceskip = 0pt{} }}%
  2296. %
  2297. % Turn off hyphenation.
  2298. \nohyphenation
  2299. %
  2300. \rawbackslash
  2301. \plainfrenchspacing
  2302. #1%
  2303. }%
  2304. \null % reset spacefactor to 1000
  2305. }
  2306. % We *must* turn on hyphenation at `-' and `_' in @code.
  2307. % (But see \codedashfinish below.)
  2308. % Otherwise, it is too hard to avoid overfull hboxes
  2309. % in the Emacs manual, the Library manual, etc.
  2310. %
  2311. % Unfortunately, TeX uses one parameter (\hyphenchar) to control
  2312. % both hyphenation at - and hyphenation within words.
  2313. % We must therefore turn them both off (\tclose does that)
  2314. % and arrange explicitly to hyphenate at a dash. -- rms.
  2315. {
  2316. \catcode`\-=\active \catcode`\_=\active
  2317. \catcode`\'=\active \catcode`\`=\active
  2318. \global\let'=\rq \global\let`=\lq % default definitions
  2319. %
  2320. \global\def\code{\begingroup
  2321. \setupmarkupstyle{code}%
  2322. % The following should really be moved into \setupmarkupstyle handlers.
  2323. \catcode\dashChar=\active \catcode\underChar=\active
  2324. \ifallowcodebreaks
  2325. \let-\codedash
  2326. \let_\codeunder
  2327. \else
  2328. \let-\normaldash
  2329. \let_\realunder
  2330. \fi
  2331. % Given -foo (with a single dash), we do not want to allow a break
  2332. % after the hyphen.
  2333. \global\let\codedashprev=\codedash
  2334. %
  2335. \codex
  2336. }
  2337. %
  2338. \gdef\codedash{\futurelet\next\codedashfinish}
  2339. \gdef\codedashfinish{%
  2340. \normaldash % always output the dash character itself.
  2341. %
  2342. % Now, output a discretionary to allow a line break, unless
  2343. % (a) the next character is a -, or
  2344. % (b) the preceding character is a -.
  2345. % E.g., given --posix, we do not want to allow a break after either -.
  2346. % Given --foo-bar, we do want to allow a break between the - and the b.
  2347. \ifx\next\codedash \else
  2348. \ifx\codedashprev\codedash
  2349. \else \discretionary{}{}{}\fi
  2350. \fi
  2351. % we need the space after the = for the case when \next itself is a
  2352. % space token; it would get swallowed otherwise. As in @code{- a}.
  2353. \global\let\codedashprev= \next
  2354. }
  2355. }
  2356. \def\normaldash{-}
  2357. %
  2358. \def\codex #1{\tclose{#1}\endgroup}
  2359. \def\codeunder{%
  2360. % this is all so @math{@code{var_name}+1} can work. In math mode, _
  2361. % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
  2362. % will therefore expand the active definition of _, which is us
  2363. % (inside @code that is), therefore an endless loop.
  2364. \ifusingtt{\ifmmode
  2365. \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
  2366. \else\normalunderscore \fi
  2367. \discretionary{}{}{}}%
  2368. {\_}%
  2369. }
  2370. % An additional complication: the above will allow breaks after, e.g.,
  2371. % each of the four underscores in __typeof__. This is bad.
  2372. % @allowcodebreaks provides a document-level way to turn breaking at -
  2373. % and _ on and off.
  2374. %
  2375. \newif\ifallowcodebreaks \allowcodebreakstrue
  2376. \def\keywordtrue{true}
  2377. \def\keywordfalse{false}
  2378. \parseargdef\allowcodebreaks{%
  2379. \def\txiarg{#1}%
  2380. \ifx\txiarg\keywordtrue
  2381. \allowcodebreakstrue
  2382. \else\ifx\txiarg\keywordfalse
  2383. \allowcodebreaksfalse
  2384. \else
  2385. \errhelp = \EMsimple
  2386. \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}%
  2387. \fi\fi
  2388. }
  2389. % For @command, @env, @file, @option quotes seem unnecessary,
  2390. % so use \code rather than \samp.
  2391. \let\command=\code
  2392. \let\env=\code
  2393. \let\file=\code
  2394. \let\option=\code
  2395. % @uref (abbreviation for `urlref') takes an optional (comma-separated)
  2396. % second argument specifying the text to display and an optional third
  2397. % arg as text to display instead of (rather than in addition to) the url
  2398. % itself. First (mandatory) arg is the url.
  2399. % (This \urefnobreak definition isn't used now, leaving it for a while
  2400. % for comparison.)
  2401. \def\urefnobreak#1{\dourefnobreak #1,,,\finish}
  2402. \def\dourefnobreak#1,#2,#3,#4\finish{\begingroup
  2403. \unsepspaces
  2404. \pdfurl{#1}%
  2405. \setbox0 = \hbox{\ignorespaces #3}%
  2406. \ifdim\wd0 > 0pt
  2407. \unhbox0 % third arg given, show only that
  2408. \else
  2409. \setbox0 = \hbox{\ignorespaces #2}%
  2410. \ifdim\wd0 > 0pt
  2411. \ifpdf
  2412. \unhbox0 % PDF: 2nd arg given, show only it
  2413. \else
  2414. \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
  2415. \fi
  2416. \else
  2417. \code{#1}% only url given, so show it
  2418. \fi
  2419. \fi
  2420. \endlink
  2421. \endgroup}
  2422. % This \urefbreak definition is the active one.
  2423. \def\urefbreak{\begingroup \urefcatcodes \dourefbreak}
  2424. \let\uref=\urefbreak
  2425. \def\dourefbreak#1{\urefbreakfinish #1,,,\finish}
  2426. \def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example
  2427. \unsepspaces
  2428. \pdfurl{#1}%
  2429. \setbox0 = \hbox{\ignorespaces #3}%
  2430. \ifdim\wd0 > 0pt
  2431. \unhbox0 % third arg given, show only that
  2432. \else
  2433. \setbox0 = \hbox{\ignorespaces #2}%
  2434. \ifdim\wd0 > 0pt
  2435. \ifpdf
  2436. \unhbox0 % PDF: 2nd arg given, show only it
  2437. \else
  2438. \unhbox0\ (\urefcode{#1})% DVI: 2nd arg given, show both it and url
  2439. \fi
  2440. \else
  2441. \urefcode{#1}% only url given, so show it
  2442. \fi
  2443. \fi
  2444. \endlink
  2445. \endgroup}
  2446. % Allow line breaks around only a few characters (only).
  2447. \def\urefcatcodes{%
  2448. \catcode\ampChar=\active \catcode\dotChar=\active
  2449. \catcode\hashChar=\active \catcode\questChar=\active
  2450. \catcode\slashChar=\active
  2451. }
  2452. {
  2453. \urefcatcodes
  2454. %
  2455. \global\def\urefcode{\begingroup
  2456. \setupmarkupstyle{code}%
  2457. \urefcatcodes
  2458. \let&\urefcodeamp
  2459. \let.\urefcodedot
  2460. \let#\urefcodehash
  2461. \let?\urefcodequest
  2462. \let/\urefcodeslash
  2463. \codex
  2464. }
  2465. %
  2466. % By default, they are just regular characters.
  2467. \global\def&{\normalamp}
  2468. \global\def.{\normaldot}
  2469. \global\def#{\normalhash}
  2470. \global\def?{\normalquest}
  2471. \global\def/{\normalslash}
  2472. }
  2473. % we put a little stretch before and after the breakable chars, to help
  2474. % line breaking of long url's. The unequal skips make look better in
  2475. % cmtt at least, especially for dots.
  2476. \def\urefprestretch{\urefprebreak \hskip0pt plus.13em }
  2477. \def\urefpoststretch{\urefpostbreak \hskip0pt plus.1em }
  2478. %
  2479. \def\urefcodeamp{\urefprestretch \&\urefpoststretch}
  2480. \def\urefcodedot{\urefprestretch .\urefpoststretch}
  2481. \def\urefcodehash{\urefprestretch \#\urefpoststretch}
  2482. \def\urefcodequest{\urefprestretch ?\urefpoststretch}
  2483. \def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
  2484. {
  2485. \catcode`\/=\active
  2486. \global\def\urefcodeslashfinish{%
  2487. \urefprestretch \slashChar
  2488. % Allow line break only after the final / in a sequence of
  2489. % slashes, to avoid line break between the slashes in http://.
  2490. \ifx\next/\else \urefpoststretch \fi
  2491. }
  2492. }
  2493. % One more complication: by default we'll break after the special
  2494. % characters, but some people like to break before the special chars, so
  2495. % allow that. Also allow no breaking at all, for manual control.
  2496. %
  2497. \parseargdef\urefbreakstyle{%
  2498. \def\txiarg{#1}%
  2499. \ifx\txiarg\wordnone
  2500. \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
  2501. \else\ifx\txiarg\wordbefore
  2502. \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak}
  2503. \else\ifx\txiarg\wordafter
  2504. \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak}
  2505. \else
  2506. \errhelp = \EMsimple
  2507. \errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
  2508. \fi\fi\fi
  2509. }
  2510. \def\wordafter{after}
  2511. \def\wordbefore{before}
  2512. \def\wordnone{none}
  2513. \urefbreakstyle after
  2514. % @url synonym for @uref, since that's how everyone uses it.
  2515. %
  2516. \let\url=\uref
  2517. % rms does not like angle brackets --karl, 17may97.
  2518. % So now @email is just like @uref, unless we are pdf.
  2519. %
  2520. %\def\email#1{\angleleft{\tt #1}\angleright}
  2521. \ifpdf
  2522. \def\email#1{\doemail#1,,\finish}
  2523. \def\doemail#1,#2,#3\finish{\begingroup
  2524. \unsepspaces
  2525. \pdfurl{mailto:#1}%
  2526. \setbox0 = \hbox{\ignorespaces #2}%
  2527. \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
  2528. \endlink
  2529. \endgroup}
  2530. \else
  2531. \let\email=\uref
  2532. \fi
  2533. % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
  2534. % `example' (@kbd uses ttsl only inside of @example and friends),
  2535. % or `code' (@kbd uses normal tty font always).
  2536. \parseargdef\kbdinputstyle{%
  2537. \def\txiarg{#1}%
  2538. \ifx\txiarg\worddistinct
  2539. \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
  2540. \else\ifx\txiarg\wordexample
  2541. \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
  2542. \else\ifx\txiarg\wordcode
  2543. \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
  2544. \else
  2545. \errhelp = \EMsimple
  2546. \errmessage{Unknown @kbdinputstyle setting `\txiarg'}%
  2547. \fi\fi\fi
  2548. }
  2549. \def\worddistinct{distinct}
  2550. \def\wordexample{example}
  2551. \def\wordcode{code}
  2552. % Default is `distinct'.
  2553. \kbdinputstyle distinct
  2554. % @kbd is like @code, except that if the argument is just one @key command,
  2555. % then @kbd has no effect.
  2556. \def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}}
  2557. \def\xkey{\key}
  2558. \def\kbdsub#1#2#3\par{%
  2559. \def\one{#1}\def\three{#3}\def\threex{??}%
  2560. \ifx\one\xkey\ifx\threex\three \key{#2}%
  2561. \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
  2562. \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
  2563. }
  2564. % definition of @key that produces a lozenge. Doesn't adjust to text size.
  2565. %\setfont\keyrm\rmshape{8}{1000}{OT1}
  2566. %\font\keysy=cmsy9
  2567. %\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
  2568. % \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
  2569. % \vbox{\hrule\kern-0.4pt
  2570. % \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
  2571. % \kern-0.4pt\hrule}%
  2572. % \kern-.06em\raise0.4pt\hbox{\angleright}}}}
  2573. % definition of @key with no lozenge. If the current font is already
  2574. % monospace, don't change it; that way, we respect @kbdinputstyle. But
  2575. % if it isn't monospace, then use \tt.
  2576. %
  2577. \def\key#1{{\setupmarkupstyle{key}%
  2578. \nohyphenation
  2579. \ifmonospace\else\tt\fi
  2580. #1}\null}
  2581. % @clicksequence{File @click{} Open ...}
  2582. \def\clicksequence#1{\begingroup #1\endgroup}
  2583. % @clickstyle @arrow (by default)
  2584. \parseargdef\clickstyle{\def\click{#1}}
  2585. \def\click{\arrow}
  2586. % Typeset a dimension, e.g., `in' or `pt'. The only reason for the
  2587. % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
  2588. %
  2589. \def\dmn#1{\thinspace #1}
  2590. % @l was never documented to mean ``switch to the Lisp font'',
  2591. % and it is not used as such in any manual I can find. We need it for
  2592. % Polish suppressed-l. --karl, 22sep96.
  2593. %\def\l#1{{\li #1}\null}
  2594. % @acronym for "FBI", "NATO", and the like.
  2595. % We print this one point size smaller, since it's intended for
  2596. % all-uppercase.
  2597. %
  2598. \def\acronym#1{\doacronym #1,,\finish}
  2599. \def\doacronym#1,#2,#3\finish{%
  2600. {\selectfonts\lsize #1}%
  2601. \def\temp{#2}%
  2602. \ifx\temp\empty \else
  2603. \space ({\unsepspaces \ignorespaces \temp \unskip})%
  2604. \fi
  2605. \null % reset \spacefactor=1000
  2606. }
  2607. % @abbr for "Comput. J." and the like.
  2608. % No font change, but don't do end-of-sentence spacing.
  2609. %
  2610. \def\abbr#1{\doabbr #1,,\finish}
  2611. \def\doabbr#1,#2,#3\finish{%
  2612. {\plainfrenchspacing #1}%
  2613. \def\temp{#2}%
  2614. \ifx\temp\empty \else
  2615. \space ({\unsepspaces \ignorespaces \temp \unskip})%
  2616. \fi
  2617. \null % reset \spacefactor=1000
  2618. }
  2619. % @asis just yields its argument. Used with @table, for example.
  2620. %
  2621. \def\asis#1{#1}
  2622. % @math outputs its argument in math mode.
  2623. %
  2624. % One complication: _ usually means subscripts, but it could also mean
  2625. % an actual _ character, as in @math{@var{some_variable} + 1}. So make
  2626. % _ active, and distinguish by seeing if the current family is \slfam,
  2627. % which is what @var uses.
  2628. {
  2629. \catcode`\_ = \active
  2630. \gdef\mathunderscore{%
  2631. \catcode`\_=\active
  2632. \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
  2633. }
  2634. }
  2635. % Another complication: we want \\ (and @\) to output a math (or tt) \.
  2636. % FYI, plain.tex uses \\ as a temporary control sequence (for no
  2637. % particular reason), but this is not advertised and we don't care.
  2638. %
  2639. % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
  2640. \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
  2641. %
  2642. \def\math{%
  2643. \tex
  2644. \mathunderscore
  2645. \let\\ = \mathbackslash
  2646. \mathactive
  2647. % make the texinfo accent commands work in math mode
  2648. \let\"=\ddot
  2649. \let\'=\acute
  2650. \let\==\bar
  2651. \let\^=\hat
  2652. \let\`=\grave
  2653. \let\u=\breve
  2654. \let\v=\check
  2655. \let\~=\tilde
  2656. \let\dotaccent=\dot
  2657. $\finishmath
  2658. }
  2659. \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
  2660. % Some active characters (such as <) are spaced differently in math.
  2661. % We have to reset their definitions in case the @math was an argument
  2662. % to a command which sets the catcodes (such as @item or @section).
  2663. %
  2664. {
  2665. \catcode`^ = \active
  2666. \catcode`< = \active
  2667. \catcode`> = \active
  2668. \catcode`+ = \active
  2669. \catcode`' = \active
  2670. \gdef\mathactive{%
  2671. \let^ = \ptexhat
  2672. \let< = \ptexless
  2673. \let> = \ptexgtr
  2674. \let+ = \ptexplus
  2675. \let' = \ptexquoteright
  2676. }
  2677. }
  2678. % ctrl is no longer a Texinfo command, but leave this definition for fun.
  2679. \def\ctrl #1{{\tt \rawbackslash \hat}#1}
  2680. % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
  2681. % Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
  2682. % except specified as a normal braced arg, so no newlines to worry about.
  2683. %
  2684. \def\outfmtnametex{tex}
  2685. %
  2686. \long\def\inlinefmt#1{\doinlinefmt #1,\finish}
  2687. \long\def\doinlinefmt#1,#2,\finish{%
  2688. \def\inlinefmtname{#1}%
  2689. \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
  2690. }
  2691. %
  2692. % @inlinefmtifelse{FMTNAME,THEN-TEXT,ELSE-TEXT} expands THEN-TEXT if
  2693. % FMTNAME is tex, else ELSE-TEXT.
  2694. \long\def\inlinefmtifelse#1{\doinlinefmtifelse #1,,,\finish}
  2695. \long\def\doinlinefmtifelse#1,#2,#3,#4,\finish{%
  2696. \def\inlinefmtname{#1}%
  2697. \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\else \ignorespaces #3\fi
  2698. }
  2699. %
  2700. % For raw, must switch into @tex before parsing the argument, to avoid
  2701. % setting catcodes prematurely. Doing it this way means that, for
  2702. % example, @inlineraw{html, foo{bar} gets a parse error instead of being
  2703. % ignored. But this isn't important because if people want a literal
  2704. % *right* brace they would have to use a command anyway, so they may as
  2705. % well use a command to get a left brace too. We could re-use the
  2706. % delimiter character idea from \verb, but it seems like overkill.
  2707. %
  2708. \long\def\inlineraw{\tex \doinlineraw}
  2709. \long\def\doinlineraw#1{\doinlinerawtwo #1,\finish}
  2710. \def\doinlinerawtwo#1,#2,\finish{%
  2711. \def\inlinerawname{#1}%
  2712. \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi
  2713. \endgroup % close group opened by \tex.
  2714. }
  2715. % @inlineifset{VAR, TEXT} expands TEXT if VAR is @set.
  2716. %
  2717. \long\def\inlineifset#1{\doinlineifset #1,\finish}
  2718. \long\def\doinlineifset#1,#2,\finish{%
  2719. \def\inlinevarname{#1}%
  2720. \expandafter\ifx\csname SET\inlinevarname\endcsname\relax
  2721. \else\ignorespaces#2\fi
  2722. }
  2723. % @inlineifclear{VAR, TEXT} expands TEXT if VAR is not @set.
  2724. %
  2725. \long\def\inlineifclear#1{\doinlineifclear #1,\finish}
  2726. \long\def\doinlineifclear#1,#2,\finish{%
  2727. \def\inlinevarname{#1}%
  2728. \expandafter\ifx\csname SET\inlinevarname\endcsname\relax \ignorespaces#2\fi
  2729. }
  2730. \message{glyphs,}
  2731. % and logos.
  2732. % @@ prints an @, as does @atchar{}.
  2733. \def\@{\char64 }
  2734. \let\atchar=\@
  2735. % @{ @} @lbracechar{} @rbracechar{} all generate brace characters.
  2736. % Unless we're in typewriter, use \ecfont because the CM text fonts do
  2737. % not have braces, and we don't want to switch into math.
  2738. \def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}}
  2739. \def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}}
  2740. \let\{=\mylbrace \let\lbracechar=\{
  2741. \let\}=\myrbrace \let\rbracechar=\}
  2742. \begingroup
  2743. % Definitions to produce \{ and \} commands for indices,
  2744. % and @{ and @} for the aux/toc files.
  2745. \catcode`\{ = \other \catcode`\} = \other
  2746. \catcode`\[ = 1 \catcode`\] = 2
  2747. \catcode`\! = 0 \catcode`\\ = \other
  2748. !gdef!lbracecmd[\{]%
  2749. !gdef!rbracecmd[\}]%
  2750. !gdef!lbraceatcmd[@{]%
  2751. !gdef!rbraceatcmd[@}]%
  2752. !endgroup
  2753. % @comma{} to avoid , parsing problems.
  2754. \let\comma = ,
  2755. % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
  2756. % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
  2757. \let\, = \ptexc
  2758. \let\dotaccent = \ptexdot
  2759. \def\ringaccent#1{{\accent23 #1}}
  2760. \let\tieaccent = \ptext
  2761. \let\ubaraccent = \ptexb
  2762. \let\udotaccent = \d
  2763. % Other special characters: @questiondown @exclamdown @ordf @ordm
  2764. % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
  2765. \def\questiondown{?`}
  2766. \def\exclamdown{!`}
  2767. \def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
  2768. \def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
  2769. % Dotless i and dotless j, used for accents.
  2770. \def\imacro{i}
  2771. \def\jmacro{j}
  2772. \def\dotless#1{%
  2773. \def\temp{#1}%
  2774. \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
  2775. \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
  2776. \else \errmessage{@dotless can be used only with i or j}%
  2777. \fi\fi
  2778. }
  2779. % The \TeX{} logo, as in plain, but resetting the spacing so that a
  2780. % period following counts as ending a sentence. (Idea found in latex.)
  2781. %
  2782. \edef\TeX{\TeX \spacefactor=1000 }
  2783. % @LaTeX{} logo. Not quite the same results as the definition in
  2784. % latex.ltx, since we use a different font for the raised A; it's most
  2785. % convenient for us to use an explicitly smaller font, rather than using
  2786. % the \scriptstyle font (since we don't reset \scriptstyle and
  2787. % \scriptscriptstyle).
  2788. %
  2789. \def\LaTeX{%
  2790. L\kern-.36em
  2791. {\setbox0=\hbox{T}%
  2792. \vbox to \ht0{\hbox{%
  2793. \ifx\textnominalsize\xwordpt
  2794. % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX.
  2795. % Revert to plain's \scriptsize, which is 7pt.
  2796. \count255=\the\fam $\fam\count255 \scriptstyle A$%
  2797. \else
  2798. % For 11pt, we can use our lllsize.
  2799. \selectfonts\lllsize A%
  2800. \fi
  2801. }%
  2802. \vss
  2803. }}%
  2804. \kern-.15em
  2805. \TeX
  2806. }
  2807. % Some math mode symbols.
  2808. \def\bullet{$\ptexbullet$}
  2809. \def\geq{\ifmmode \ge\else $\ge$\fi}
  2810. \def\leq{\ifmmode \le\else $\le$\fi}
  2811. \def\minus{\ifmmode -\else $-$\fi}
  2812. % @dots{} outputs an ellipsis using the current font.
  2813. % We do .5em per period so that it has the same spacing in the cm
  2814. % typewriter fonts as three actual period characters; on the other hand,
  2815. % in other typewriter fonts three periods are wider than 1.5em. So do
  2816. % whichever is larger.
  2817. %
  2818. \def\dots{%
  2819. \leavevmode
  2820. \setbox0=\hbox{...}% get width of three periods
  2821. \ifdim\wd0 > 1.5em
  2822. \dimen0 = \wd0
  2823. \else
  2824. \dimen0 = 1.5em
  2825. \fi
  2826. \hbox to \dimen0{%
  2827. \hskip 0pt plus.25fil
  2828. .\hskip 0pt plus1fil
  2829. .\hskip 0pt plus1fil
  2830. .\hskip 0pt plus.5fil
  2831. }%
  2832. }
  2833. % @enddots{} is an end-of-sentence ellipsis.
  2834. %
  2835. \def\enddots{%
  2836. \dots
  2837. \spacefactor=\endofsentencespacefactor
  2838. }
  2839. % @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
  2840. %
  2841. % Since these characters are used in examples, they should be an even number of
  2842. % \tt widths. Each \tt character is 1en, so two makes it 1em.
  2843. %
  2844. \def\point{$\star$}
  2845. \def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}}
  2846. \def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
  2847. \def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}}
  2848. \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
  2849. \def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}}
  2850. % The @error{} command.
  2851. % Adapted from the TeXbook's \boxit.
  2852. %
  2853. \newbox\errorbox
  2854. %
  2855. {\tentt \global\dimen0 = 3em}% Width of the box.
  2856. \dimen2 = .55pt % Thickness of rules
  2857. % The text. (`r' is open on the right, `e' somewhat less so on the left.)
  2858. \setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt}
  2859. %
  2860. \setbox\errorbox=\hbox to \dimen0{\hfil
  2861. \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
  2862. \advance\hsize by -2\dimen2 % Rules.
  2863. \vbox{%
  2864. \hrule height\dimen2
  2865. \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
  2866. \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
  2867. \kern3pt\vrule width\dimen2}% Space to right.
  2868. \hrule height\dimen2}
  2869. \hfil}
  2870. %
  2871. \def\error{\leavevmode\lower.7ex\copy\errorbox}
  2872. % @pounds{} is a sterling sign, which Knuth put in the CM italic font.
  2873. %
  2874. \def\pounds{{\it\$}}
  2875. % @euro{} comes from a separate font, depending on the current style.
  2876. % We use the free feym* fonts from the eurosym package by Henrik
  2877. % Theiling, which support regular, slanted, bold and bold slanted (and
  2878. % "outlined" (blackboard board, sort of) versions, which we don't need).
  2879. % It is available from https://www.ctan.org/tex-archive/fonts/eurosym.
  2880. %
  2881. % Although only regular is the truly official Euro symbol, we ignore
  2882. % that. The Euro is designed to be slightly taller than the regular
  2883. % font height.
  2884. %
  2885. % feymr - regular
  2886. % feymo - slanted
  2887. % feybr - bold
  2888. % feybo - bold slanted
  2889. %
  2890. % There is no good (free) typewriter version, to my knowledge.
  2891. % A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
  2892. % Hmm.
  2893. %
  2894. % Also doesn't work in math. Do we need to do math with euro symbols?
  2895. % Hope not.
  2896. %
  2897. %
  2898. \def\euro{{\eurofont e}}
  2899. \def\eurofont{%
  2900. % We set the font at each command, rather than predefining it in
  2901. % \textfonts and the other font-switching commands, so that
  2902. % installations which never need the symbol don't have to have the
  2903. % font installed.
  2904. %
  2905. % There is only one designed size (nominal 10pt), so we always scale
  2906. % that to the current nominal size.
  2907. %
  2908. % By the way, simply using "at 1em" works for cmr10 and the like, but
  2909. % does not work for cmbx10 and other extended/shrunken fonts.
  2910. %
  2911. \def\eurosize{\csname\curfontsize nominalsize\endcsname}%
  2912. %
  2913. \ifx\curfontstyle\bfstylename
  2914. % bold:
  2915. \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
  2916. \else
  2917. % regular:
  2918. \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
  2919. \fi
  2920. \thiseurofont
  2921. }
  2922. % Glyphs from the EC fonts. We don't use \let for the aliases, because
  2923. % sometimes we redefine the original macro, and the alias should reflect
  2924. % the redefinition.
  2925. %
  2926. % Use LaTeX names for the Icelandic letters.
  2927. \def\DH{{\ecfont \char"D0}} % Eth
  2928. \def\dh{{\ecfont \char"F0}} % eth
  2929. \def\TH{{\ecfont \char"DE}} % Thorn
  2930. \def\th{{\ecfont \char"FE}} % thorn
  2931. %
  2932. \def\guillemetleft{{\ecfont \char"13}}
  2933. \def\guillemotleft{\guillemetleft}
  2934. \def\guillemetright{{\ecfont \char"14}}
  2935. \def\guillemotright{\guillemetright}
  2936. \def\guilsinglleft{{\ecfont \char"0E}}
  2937. \def\guilsinglright{{\ecfont \char"0F}}
  2938. \def\quotedblbase{{\ecfont \char"12}}
  2939. \def\quotesinglbase{{\ecfont \char"0D}}
  2940. %
  2941. % This positioning is not perfect (see the ogonek LaTeX package), but
  2942. % we have the precomposed glyphs for the most common cases. We put the
  2943. % tests to use those glyphs in the single \ogonek macro so we have fewer
  2944. % dummy definitions to worry about for index entries, etc.
  2945. %
  2946. % ogonek is also used with other letters in Lithuanian (IOU), but using
  2947. % the precomposed glyphs for those is not so easy since they aren't in
  2948. % the same EC font.
  2949. \def\ogonek#1{{%
  2950. \def\temp{#1}%
  2951. \ifx\temp\macrocharA\Aogonek
  2952. \else\ifx\temp\macrochara\aogonek
  2953. \else\ifx\temp\macrocharE\Eogonek
  2954. \else\ifx\temp\macrochare\eogonek
  2955. \else
  2956. \ecfont \setbox0=\hbox{#1}%
  2957. \ifdim\ht0=1ex\accent"0C #1%
  2958. \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}%
  2959. \fi
  2960. \fi\fi\fi\fi
  2961. }%
  2962. }
  2963. \def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A}
  2964. \def\aogonek{{\ecfont \char"A1}}\def\macrochara{a}
  2965. \def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E}
  2966. \def\eogonek{{\ecfont \char"A6}}\def\macrochare{e}
  2967. %
  2968. % Use the ec* fonts (cm-super in outline format) for non-CM glyphs.
  2969. \def\ecfont{%
  2970. % We can't distinguish serif/sans and italic/slanted, but this
  2971. % is used for crude hacks anyway (like adding French and German
  2972. % quotes to documents typeset with CM, where we lose kerning), so
  2973. % hopefully nobody will notice/care.
  2974. \edef\ecsize{\csname\curfontsize ecsize\endcsname}%
  2975. \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
  2976. \ifmonospace
  2977. % typewriter:
  2978. \font\thisecfont = ectt\ecsize \space at \nominalsize
  2979. \else
  2980. \ifx\curfontstyle\bfstylename
  2981. % bold:
  2982. \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize
  2983. \else
  2984. % regular:
  2985. \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize
  2986. \fi
  2987. \fi
  2988. \thisecfont
  2989. }
  2990. % @registeredsymbol - R in a circle. The font for the R should really
  2991. % be smaller yet, but lllsize is the best we can do for now.
  2992. % Adapted from the plain.tex definition of \copyright.
  2993. %
  2994. \def\registeredsymbol{%
  2995. $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}%
  2996. \hfil\crcr\Orb}}%
  2997. }$%
  2998. }
  2999. % @textdegree - the normal degrees sign.
  3000. %
  3001. \def\textdegree{$^\circ$}
  3002. % Laurent Siebenmann reports \Orb undefined with:
  3003. % Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38
  3004. % so we'll define it if necessary.
  3005. %
  3006. \ifx\Orb\thisisundefined
  3007. \def\Orb{\mathhexbox20D}
  3008. \fi
  3009. % Quotes.
  3010. \chardef\quotedblleft="5C
  3011. \chardef\quotedblright=`\"
  3012. \chardef\quoteleft=`\`
  3013. \chardef\quoteright=`\'
  3014. \message{page headings,}
  3015. \newskip\titlepagetopglue \titlepagetopglue = 1.5in
  3016. \newskip\titlepagebottomglue \titlepagebottomglue = 2pc
  3017. % First the title page. Must do @settitle before @titlepage.
  3018. \newif\ifseenauthor
  3019. \newif\iffinishedtitlepage
  3020. % Do an implicit @contents or @shortcontents after @end titlepage if the
  3021. % user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
  3022. %
  3023. \newif\ifsetcontentsaftertitlepage
  3024. \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
  3025. \newif\ifsetshortcontentsaftertitlepage
  3026. \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
  3027. \parseargdef\shorttitlepage{%
  3028. \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
  3029. \endgroup\page\hbox{}\page}
  3030. \envdef\titlepage{%
  3031. % Open one extra group, as we want to close it in the middle of \Etitlepage.
  3032. \begingroup
  3033. \parindent=0pt \textfonts
  3034. % Leave some space at the very top of the page.
  3035. \vglue\titlepagetopglue
  3036. % No rule at page bottom unless we print one at the top with @title.
  3037. \finishedtitlepagetrue
  3038. %
  3039. % Most title ``pages'' are actually two pages long, with space
  3040. % at the top of the second. We don't want the ragged left on the second.
  3041. \let\oldpage = \page
  3042. \def\page{%
  3043. \iffinishedtitlepage\else
  3044. \finishtitlepage
  3045. \fi
  3046. \let\page = \oldpage
  3047. \page
  3048. \null
  3049. }%
  3050. }
  3051. \def\Etitlepage{%
  3052. \iffinishedtitlepage\else
  3053. \finishtitlepage
  3054. \fi
  3055. % It is important to do the page break before ending the group,
  3056. % because the headline and footline are only empty inside the group.
  3057. % If we use the new definition of \page, we always get a blank page
  3058. % after the title page, which we certainly don't want.
  3059. \oldpage
  3060. \endgroup
  3061. %
  3062. % Need this before the \...aftertitlepage checks so that if they are
  3063. % in effect the toc pages will come out with page numbers.
  3064. \HEADINGSon
  3065. %
  3066. % If they want short, they certainly want long too.
  3067. \ifsetshortcontentsaftertitlepage
  3068. \shortcontents
  3069. \contents
  3070. \global\let\shortcontents = \relax
  3071. \global\let\contents = \relax
  3072. \fi
  3073. %
  3074. \ifsetcontentsaftertitlepage
  3075. \contents
  3076. \global\let\contents = \relax
  3077. \global\let\shortcontents = \relax
  3078. \fi
  3079. }
  3080. \def\finishtitlepage{%
  3081. \vskip4pt \hrule height 2pt width \hsize
  3082. \vskip\titlepagebottomglue
  3083. \finishedtitlepagetrue
  3084. }
  3085. % Settings used for typesetting titles: no hyphenation, no indentation,
  3086. % don't worry much about spacing, ragged right. This should be used
  3087. % inside a \vbox, and fonts need to be set appropriately first. Because
  3088. % it is always used for titles, nothing else, we call \rmisbold. \par
  3089. % should be specified before the end of the \vbox, since a vbox is a group.
  3090. %
  3091. \def\raggedtitlesettings{%
  3092. \rmisbold
  3093. \hyphenpenalty=10000
  3094. \parindent=0pt
  3095. \tolerance=5000
  3096. \ptexraggedright
  3097. }
  3098. % Macros to be used within @titlepage:
  3099. \let\subtitlerm=\tenrm
  3100. \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
  3101. \parseargdef\title{%
  3102. \checkenv\titlepage
  3103. \vbox{\titlefonts \raggedtitlesettings #1\par}%
  3104. % print a rule at the page bottom also.
  3105. \finishedtitlepagefalse
  3106. \vskip4pt \hrule height 4pt width \hsize \vskip4pt
  3107. }
  3108. \parseargdef\subtitle{%
  3109. \checkenv\titlepage
  3110. {\subtitlefont \rightline{#1}}%
  3111. }
  3112. % @author should come last, but may come many times.
  3113. % It can also be used inside @quotation.
  3114. %
  3115. \parseargdef\author{%
  3116. \def\temp{\quotation}%
  3117. \ifx\thisenv\temp
  3118. \def\quotationauthor{#1}% printed in \Equotation.
  3119. \else
  3120. \checkenv\titlepage
  3121. \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
  3122. {\secfonts\rmisbold \leftline{#1}}%
  3123. \fi
  3124. }
  3125. % Set up page headings and footings.
  3126. \let\thispage=\folio
  3127. \newtoks\evenheadline % headline on even pages
  3128. \newtoks\oddheadline % headline on odd pages
  3129. \newtoks\evenfootline % footline on even pages
  3130. \newtoks\oddfootline % footline on odd pages
  3131. % Now make TeX use those variables
  3132. \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
  3133. \else \the\evenheadline \fi}}
  3134. \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
  3135. \else \the\evenfootline \fi}\HEADINGShook}
  3136. \let\HEADINGShook=\relax
  3137. % Commands to set those variables.
  3138. % For example, this is what @headings on does
  3139. % @evenheading @thistitle|@thispage|@thischapter
  3140. % @oddheading @thischapter|@thispage|@thistitle
  3141. % @evenfooting @thisfile||
  3142. % @oddfooting ||@thisfile
  3143. \def\evenheading{\parsearg\evenheadingxxx}
  3144. \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
  3145. \def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
  3146. \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  3147. \def\oddheading{\parsearg\oddheadingxxx}
  3148. \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
  3149. \def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
  3150. \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  3151. \parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
  3152. \def\evenfooting{\parsearg\evenfootingxxx}
  3153. \def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}
  3154. \def\evenfootingyyy #1\|#2\|#3\|#4\finish{%
  3155. \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  3156. \def\oddfooting{\parsearg\oddfootingxxx}
  3157. \def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}
  3158. \def\oddfootingyyy #1\|#2\|#3\|#4\finish{%
  3159. \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
  3160. %
  3161. % Leave some space for the footline. Hopefully ok to assume
  3162. % @evenfooting will not be used by itself.
  3163. \global\advance\pageheight by -12pt
  3164. \global\advance\vsize by -12pt
  3165. }
  3166. \parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
  3167. % @evenheadingmarks top \thischapter <- chapter at the top of a page
  3168. % @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page
  3169. %
  3170. % The same set of arguments for:
  3171. %
  3172. % @oddheadingmarks
  3173. % @evenfootingmarks
  3174. % @oddfootingmarks
  3175. % @everyheadingmarks
  3176. % @everyfootingmarks
  3177. \def\evenheadingmarks{\headingmarks{even}{heading}}
  3178. \def\oddheadingmarks{\headingmarks{odd}{heading}}
  3179. \def\evenfootingmarks{\headingmarks{even}{footing}}
  3180. \def\oddfootingmarks{\headingmarks{odd}{footing}}
  3181. \def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1}
  3182. \headingmarks{odd}{heading}{#1} }
  3183. \def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1}
  3184. \headingmarks{odd}{footing}{#1} }
  3185. % #1 = even/odd, #2 = heading/footing, #3 = top/bottom.
  3186. \def\headingmarks#1#2#3 {%
  3187. \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname
  3188. \global\expandafter\let\csname get#1#2marks\endcsname \temp
  3189. }
  3190. \everyheadingmarks bottom
  3191. \everyfootingmarks bottom
  3192. % @headings double turns headings on for double-sided printing.
  3193. % @headings single turns headings on for single-sided printing.
  3194. % @headings off turns them off.
  3195. % @headings on same as @headings double, retained for compatibility.
  3196. % @headings after turns on double-sided headings after this page.
  3197. % @headings doubleafter turns on double-sided headings after this page.
  3198. % @headings singleafter turns on single-sided headings after this page.
  3199. % By default, they are off at the start of a document,
  3200. % and turned `on' after @end titlepage.
  3201. \def\headings #1 {\csname HEADINGS#1\endcsname}
  3202. \def\headingsoff{% non-global headings elimination
  3203. \evenheadline={\hfil}\evenfootline={\hfil}%
  3204. \oddheadline={\hfil}\oddfootline={\hfil}%
  3205. }
  3206. \def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
  3207. \HEADINGSoff % it's the default
  3208. % When we turn headings on, set the page number to 1.
  3209. % For double-sided printing, put current file name in lower left corner,
  3210. % chapter name on inside top of right hand pages, document
  3211. % title on inside top of left hand pages, and page numbers on outside top
  3212. % edge of all pages.
  3213. \def\HEADINGSdouble{%
  3214. \global\pageno=1
  3215. \global\evenfootline={\hfil}
  3216. \global\oddfootline={\hfil}
  3217. \global\evenheadline={\line{\folio\hfil\thistitle}}
  3218. \global\oddheadline={\line{\thischapter\hfil\folio}}
  3219. \global\let\contentsalignmacro = \chapoddpage
  3220. }
  3221. \let\contentsalignmacro = \chappager
  3222. % For single-sided printing, chapter title goes across top left of page,
  3223. % page number on top right.
  3224. \def\HEADINGSsingle{%
  3225. \global\pageno=1
  3226. \global\evenfootline={\hfil}
  3227. \global\oddfootline={\hfil}
  3228. \global\evenheadline={\line{\thischapter\hfil\folio}}
  3229. \global\oddheadline={\line{\thischapter\hfil\folio}}
  3230. \global\let\contentsalignmacro = \chappager
  3231. }
  3232. \def\HEADINGSon{\HEADINGSdouble}
  3233. \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
  3234. \let\HEADINGSdoubleafter=\HEADINGSafter
  3235. \def\HEADINGSdoublex{%
  3236. \global\evenfootline={\hfil}
  3237. \global\oddfootline={\hfil}
  3238. \global\evenheadline={\line{\folio\hfil\thistitle}}
  3239. \global\oddheadline={\line{\thischapter\hfil\folio}}
  3240. \global\let\contentsalignmacro = \chapoddpage
  3241. }
  3242. \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
  3243. \def\HEADINGSsinglex{%
  3244. \global\evenfootline={\hfil}
  3245. \global\oddfootline={\hfil}
  3246. \global\evenheadline={\line{\thischapter\hfil\folio}}
  3247. \global\oddheadline={\line{\thischapter\hfil\folio}}
  3248. \global\let\contentsalignmacro = \chappager
  3249. }
  3250. % Subroutines used in generating headings
  3251. % This produces Day Month Year style of output.
  3252. % Only define if not already defined, in case a txi-??.tex file has set
  3253. % up a different format (e.g., txi-cs.tex does this).
  3254. \ifx\today\thisisundefined
  3255. \def\today{%
  3256. \number\day\space
  3257. \ifcase\month
  3258. \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
  3259. \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
  3260. \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
  3261. \fi
  3262. \space\number\year}
  3263. \fi
  3264. % @settitle line... specifies the title of the document, for headings.
  3265. % It generates no output of its own.
  3266. \def\thistitle{\putwordNoTitle}
  3267. \def\settitle{\parsearg{\gdef\thistitle}}
  3268. \message{tables,}
  3269. % Tables -- @table, @ftable, @vtable, @item(x).
  3270. % default indentation of table text
  3271. \newdimen\tableindent \tableindent=.8in
  3272. % default indentation of @itemize and @enumerate text
  3273. \newdimen\itemindent \itemindent=.3in
  3274. % margin between end of table item and start of table text.
  3275. \newdimen\itemmargin \itemmargin=.1in
  3276. % used internally for \itemindent minus \itemmargin
  3277. \newdimen\itemmax
  3278. % Note @table, @ftable, and @vtable define @item, @itemx, etc., with
  3279. % these defs.
  3280. % They also define \itemindex
  3281. % to index the item name in whatever manner is desired (perhaps none).
  3282. \newif\ifitemxneedsnegativevskip
  3283. \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
  3284. \def\internalBitem{\smallbreak \parsearg\itemzzz}
  3285. \def\internalBitemx{\itemxpar \parsearg\itemzzz}
  3286. \def\itemzzz #1{\begingroup %
  3287. \advance\hsize by -\rightskip
  3288. \advance\hsize by -\tableindent
  3289. \setbox0=\hbox{\itemindicate{#1}}%
  3290. \itemindex{#1}%
  3291. \nobreak % This prevents a break before @itemx.
  3292. %
  3293. % If the item text does not fit in the space we have, put it on a line
  3294. % by itself, and do not allow a page break either before or after that
  3295. % line. We do not start a paragraph here because then if the next
  3296. % command is, e.g., @kindex, the whatsit would get put into the
  3297. % horizontal list on a line by itself, resulting in extra blank space.
  3298. \ifdim \wd0>\itemmax
  3299. %
  3300. % Make this a paragraph so we get the \parskip glue and wrapping,
  3301. % but leave it ragged-right.
  3302. \begingroup
  3303. \advance\leftskip by-\tableindent
  3304. \advance\hsize by\tableindent
  3305. \advance\rightskip by0pt plus1fil\relax
  3306. \leavevmode\unhbox0\par
  3307. \endgroup
  3308. %
  3309. % We're going to be starting a paragraph, but we don't want the
  3310. % \parskip glue -- logically it's part of the @item we just started.
  3311. \nobreak \vskip-\parskip
  3312. %
  3313. % Stop a page break at the \parskip glue coming up. However, if
  3314. % what follows is an environment such as @example, there will be no
  3315. % \parskip glue; then the negative vskip we just inserted would
  3316. % cause the example and the item to crash together. So we use this
  3317. % bizarre value of 10001 as a signal to \aboveenvbreak to insert
  3318. % \parskip glue after all. Section titles are handled this way also.
  3319. %
  3320. \penalty 10001
  3321. \endgroup
  3322. \itemxneedsnegativevskipfalse
  3323. \else
  3324. % The item text fits into the space. Start a paragraph, so that the
  3325. % following text (if any) will end up on the same line.
  3326. \noindent
  3327. % Do this with kerns and \unhbox so that if there is a footnote in
  3328. % the item text, it can migrate to the main vertical list and
  3329. % eventually be printed.
  3330. \nobreak\kern-\tableindent
  3331. \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
  3332. \unhbox0
  3333. \nobreak\kern\dimen0
  3334. \endgroup
  3335. \itemxneedsnegativevskiptrue
  3336. \fi
  3337. }
  3338. \def\item{\errmessage{@item while not in a list environment}}
  3339. \def\itemx{\errmessage{@itemx while not in a list environment}}
  3340. % @table, @ftable, @vtable.
  3341. \envdef\table{%
  3342. \let\itemindex\gobble
  3343. \tablecheck{table}%
  3344. }
  3345. \envdef\ftable{%
  3346. \def\itemindex ##1{\doind {fn}{\code{##1}}}%
  3347. \tablecheck{ftable}%
  3348. }
  3349. \envdef\vtable{%
  3350. \def\itemindex ##1{\doind {vr}{\code{##1}}}%
  3351. \tablecheck{vtable}%
  3352. }
  3353. \def\tablecheck#1{%
  3354. \ifnum \the\catcode`\^^M=\active
  3355. \endgroup
  3356. \errmessage{This command won't work in this context; perhaps the problem is
  3357. that we are \inenvironment\thisenv}%
  3358. \def\next{\doignore{#1}}%
  3359. \else
  3360. \let\next\tablex
  3361. \fi
  3362. \next
  3363. }
  3364. \def\tablex#1{%
  3365. \def\itemindicate{#1}%
  3366. \parsearg\tabley
  3367. }
  3368. \def\tabley#1{%
  3369. {%
  3370. \makevalueexpandable
  3371. \edef\temp{\noexpand\tablez #1\space\space\space}%
  3372. \expandafter
  3373. }\temp \endtablez
  3374. }
  3375. \def\tablez #1 #2 #3 #4\endtablez{%
  3376. \aboveenvbreak
  3377. \ifnum 0#1>0 \advance \leftskip by #1\mil \fi
  3378. \ifnum 0#2>0 \tableindent=#2\mil \fi
  3379. \ifnum 0#3>0 \advance \rightskip by #3\mil \fi
  3380. \itemmax=\tableindent
  3381. \advance \itemmax by -\itemmargin
  3382. \advance \leftskip by \tableindent
  3383. \exdentamount=\tableindent
  3384. \parindent = 0pt
  3385. \parskip = \smallskipamount
  3386. \ifdim \parskip=0pt \parskip=2pt \fi
  3387. \let\item = \internalBitem
  3388. \let\itemx = \internalBitemx
  3389. }
  3390. \def\Etable{\endgraf\afterenvbreak}
  3391. \let\Eftable\Etable
  3392. \let\Evtable\Etable
  3393. \let\Eitemize\Etable
  3394. \let\Eenumerate\Etable
  3395. % This is the counter used by @enumerate, which is really @itemize
  3396. \newcount \itemno
  3397. \envdef\itemize{\parsearg\doitemize}
  3398. \def\doitemize#1{%
  3399. \aboveenvbreak
  3400. \itemmax=\itemindent
  3401. \advance\itemmax by -\itemmargin
  3402. \advance\leftskip by \itemindent
  3403. \exdentamount=\itemindent
  3404. \parindent=0pt
  3405. \parskip=\smallskipamount
  3406. \ifdim\parskip=0pt \parskip=2pt \fi
  3407. %
  3408. % Try typesetting the item mark that if the document erroneously says
  3409. % something like @itemize @samp (intending @table), there's an error
  3410. % right away at the @itemize. It's not the best error message in the
  3411. % world, but it's better than leaving it to the @item. This means if
  3412. % the user wants an empty mark, they have to say @w{} not just @w.
  3413. \def\itemcontents{#1}%
  3414. \setbox0 = \hbox{\itemcontents}%
  3415. %
  3416. % @itemize with no arg is equivalent to @itemize @bullet.
  3417. \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
  3418. %
  3419. \let\item=\itemizeitem
  3420. }
  3421. % Definition of @item while inside @itemize and @enumerate.
  3422. %
  3423. \def\itemizeitem{%
  3424. \advance\itemno by 1 % for enumerations
  3425. {\let\par=\endgraf \smallbreak}% reasonable place to break
  3426. {%
  3427. % If the document has an @itemize directly after a section title, a
  3428. % \nobreak will be last on the list, and \sectionheading will have
  3429. % done a \vskip-\parskip. In that case, we don't want to zero
  3430. % parskip, or the item text will crash with the heading. On the
  3431. % other hand, when there is normal text preceding the item (as there
  3432. % usually is), we do want to zero parskip, or there would be too much
  3433. % space. In that case, we won't have a \nobreak before. At least
  3434. % that's the theory.
  3435. \ifnum\lastpenalty<10000 \parskip=0in \fi
  3436. \noindent
  3437. \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
  3438. %
  3439. \vadjust{\penalty 1200}}% not good to break after first line of item.
  3440. \flushcr
  3441. }
  3442. % \splitoff TOKENS\endmark defines \first to be the first token in
  3443. % TOKENS, and \rest to be the remainder.
  3444. %
  3445. \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
  3446. % Allow an optional argument of an uppercase letter, lowercase letter,
  3447. % or number, to specify the first label in the enumerated list. No
  3448. % argument is the same as `1'.
  3449. %
  3450. \envparseargdef\enumerate{\enumeratey #1 \endenumeratey}
  3451. \def\enumeratey #1 #2\endenumeratey{%
  3452. % If we were given no argument, pretend we were given `1'.
  3453. \def\thearg{#1}%
  3454. \ifx\thearg\empty \def\thearg{1}\fi
  3455. %
  3456. % Detect if the argument is a single token. If so, it might be a
  3457. % letter. Otherwise, the only valid thing it can be is a number.
  3458. % (We will always have one token, because of the test we just made.
  3459. % This is a good thing, since \splitoff doesn't work given nothing at
  3460. % all -- the first parameter is undelimited.)
  3461. \expandafter\splitoff\thearg\endmark
  3462. \ifx\rest\empty
  3463. % Only one token in the argument. It could still be anything.
  3464. % A ``lowercase letter'' is one whose \lccode is nonzero.
  3465. % An ``uppercase letter'' is one whose \lccode is both nonzero, and
  3466. % not equal to itself.
  3467. % Otherwise, we assume it's a number.
  3468. %
  3469. % We need the \relax at the end of the \ifnum lines to stop TeX from
  3470. % continuing to look for a <number>.
  3471. %
  3472. \ifnum\lccode\expandafter`\thearg=0\relax
  3473. \numericenumerate % a number (we hope)
  3474. \else
  3475. % It's a letter.
  3476. \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
  3477. \lowercaseenumerate % lowercase letter
  3478. \else
  3479. \uppercaseenumerate % uppercase letter
  3480. \fi
  3481. \fi
  3482. \else
  3483. % Multiple tokens in the argument. We hope it's a number.
  3484. \numericenumerate
  3485. \fi
  3486. }
  3487. % An @enumerate whose labels are integers. The starting integer is
  3488. % given in \thearg.
  3489. %
  3490. \def\numericenumerate{%
  3491. \itemno = \thearg
  3492. \startenumeration{\the\itemno}%
  3493. }
  3494. % The starting (lowercase) letter is in \thearg.
  3495. \def\lowercaseenumerate{%
  3496. \itemno = \expandafter`\thearg
  3497. \startenumeration{%
  3498. % Be sure we're not beyond the end of the alphabet.
  3499. \ifnum\itemno=0
  3500. \errmessage{No more lowercase letters in @enumerate; get a bigger
  3501. alphabet}%
  3502. \fi
  3503. \char\lccode\itemno
  3504. }%
  3505. }
  3506. % The starting (uppercase) letter is in \thearg.
  3507. \def\uppercaseenumerate{%
  3508. \itemno = \expandafter`\thearg
  3509. \startenumeration{%
  3510. % Be sure we're not beyond the end of the alphabet.
  3511. \ifnum\itemno=0
  3512. \errmessage{No more uppercase letters in @enumerate; get a bigger
  3513. alphabet}
  3514. \fi
  3515. \char\uccode\itemno
  3516. }%
  3517. }
  3518. % Call \doitemize, adding a period to the first argument and supplying the
  3519. % common last two arguments. Also subtract one from the initial value in
  3520. % \itemno, since @item increments \itemno.
  3521. %
  3522. \def\startenumeration#1{%
  3523. \advance\itemno by -1
  3524. \doitemize{#1.}\flushcr
  3525. }
  3526. % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
  3527. % to @enumerate.
  3528. %
  3529. \def\alphaenumerate{\enumerate{a}}
  3530. \def\capsenumerate{\enumerate{A}}
  3531. \def\Ealphaenumerate{\Eenumerate}
  3532. \def\Ecapsenumerate{\Eenumerate}
  3533. % @multitable macros
  3534. % Amy Hendrickson, 8/18/94, 3/6/96
  3535. %
  3536. % @multitable ... @end multitable will make as many columns as desired.
  3537. % Contents of each column will wrap at width given in preamble. Width
  3538. % can be specified either with sample text given in a template line,
  3539. % or in percent of \hsize, the current width of text on page.
  3540. % Table can continue over pages but will only break between lines.
  3541. % To make preamble:
  3542. %
  3543. % Either define widths of columns in terms of percent of \hsize:
  3544. % @multitable @columnfractions .25 .3 .45
  3545. % @item ...
  3546. %
  3547. % Numbers following @columnfractions are the percent of the total
  3548. % current hsize to be used for each column. You may use as many
  3549. % columns as desired.
  3550. % Or use a template:
  3551. % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
  3552. % @item ...
  3553. % using the widest term desired in each column.
  3554. % Each new table line starts with @item, each subsequent new column
  3555. % starts with @tab. Empty columns may be produced by supplying @tab's
  3556. % with nothing between them for as many times as empty columns are needed,
  3557. % ie, @tab@tab@tab will produce two empty columns.
  3558. % @item, @tab do not need to be on their own lines, but it will not hurt
  3559. % if they are.
  3560. % Sample multitable:
  3561. % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
  3562. % @item first col stuff @tab second col stuff @tab third col
  3563. % @item
  3564. % first col stuff
  3565. % @tab
  3566. % second col stuff
  3567. % @tab
  3568. % third col
  3569. % @item first col stuff @tab second col stuff
  3570. % @tab Many paragraphs of text may be used in any column.
  3571. %
  3572. % They will wrap at the width determined by the template.
  3573. % @item@tab@tab This will be in third column.
  3574. % @end multitable
  3575. % Default dimensions may be reset by user.
  3576. % @multitableparskip is vertical space between paragraphs in table.
  3577. % @multitableparindent is paragraph indent in table.
  3578. % @multitablecolmargin is horizontal space to be left between columns.
  3579. % @multitablelinespace is space to leave between table items, baseline
  3580. % to baseline.
  3581. % 0pt means it depends on current normal line spacing.
  3582. %
  3583. \newskip\multitableparskip
  3584. \newskip\multitableparindent
  3585. \newdimen\multitablecolspace
  3586. \newskip\multitablelinespace
  3587. \multitableparskip=0pt
  3588. \multitableparindent=6pt
  3589. \multitablecolspace=12pt
  3590. \multitablelinespace=0pt
  3591. % Macros used to set up halign preamble:
  3592. %
  3593. \let\endsetuptable\relax
  3594. \def\xendsetuptable{\endsetuptable}
  3595. \let\columnfractions\relax
  3596. \def\xcolumnfractions{\columnfractions}
  3597. \newif\ifsetpercent
  3598. % #1 is the @columnfraction, usually a decimal number like .5, but might
  3599. % be just 1. We just use it, whatever it is.
  3600. %
  3601. \def\pickupwholefraction#1 {%
  3602. \global\advance\colcount by 1
  3603. \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}%
  3604. \setuptable
  3605. }
  3606. \newcount\colcount
  3607. \def\setuptable#1{%
  3608. \def\firstarg{#1}%
  3609. \ifx\firstarg\xendsetuptable
  3610. \let\go = \relax
  3611. \else
  3612. \ifx\firstarg\xcolumnfractions
  3613. \global\setpercenttrue
  3614. \else
  3615. \ifsetpercent
  3616. \let\go\pickupwholefraction
  3617. \else
  3618. \global\advance\colcount by 1
  3619. \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
  3620. % separator; typically that is always in the input, anyway.
  3621. \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
  3622. \fi
  3623. \fi
  3624. \ifx\go\pickupwholefraction
  3625. % Put the argument back for the \pickupwholefraction call, so
  3626. % we'll always have a period there to be parsed.
  3627. \def\go{\pickupwholefraction#1}%
  3628. \else
  3629. \let\go = \setuptable
  3630. \fi%
  3631. \fi
  3632. \go
  3633. }
  3634. % multitable-only commands.
  3635. %
  3636. % @headitem starts a heading row, which we typeset in bold.
  3637. % Assignments have to be global since we are inside the implicit group
  3638. % of an alignment entry. \everycr resets \everytab so we don't have to
  3639. % undo it ourselves.
  3640. \def\headitemfont{\b}% for people to use in the template row; not changeable
  3641. \def\headitem{%
  3642. \checkenv\multitable
  3643. \crcr
  3644. \global\everytab={\bf}% can't use \headitemfont since the parsing differs
  3645. \the\everytab % for the first item
  3646. }%
  3647. %
  3648. % A \tab used to include \hskip1sp. But then the space in a template
  3649. % line is not enough. That is bad. So let's go back to just `&' until
  3650. % we again encounter the problem the 1sp was intended to solve.
  3651. % --karl, nathan@acm.org, 20apr99.
  3652. \def\tab{\checkenv\multitable &\the\everytab}%
  3653. % @multitable ... @end multitable definitions:
  3654. %
  3655. \newtoks\everytab % insert after every tab.
  3656. %
  3657. \envdef\multitable{%
  3658. \vskip\parskip
  3659. \startsavinginserts
  3660. %
  3661. % @item within a multitable starts a normal row.
  3662. % We use \def instead of \let so that if one of the multitable entries
  3663. % contains an @itemize, we don't choke on the \item (seen as \crcr aka
  3664. % \endtemplate) expanding \doitemize.
  3665. \def\item{\crcr}%
  3666. %
  3667. \tolerance=9500
  3668. \hbadness=9500
  3669. \setmultitablespacing
  3670. \parskip=\multitableparskip
  3671. \parindent=\multitableparindent
  3672. \overfullrule=0pt
  3673. \global\colcount=0
  3674. %
  3675. \everycr = {%
  3676. \noalign{%
  3677. \global\everytab={}%
  3678. \global\colcount=0 % Reset the column counter.
  3679. % Check for saved footnotes, etc.
  3680. \checkinserts
  3681. % Keeps underfull box messages off when table breaks over pages.
  3682. %\filbreak
  3683. % Maybe so, but it also creates really weird page breaks when the
  3684. % table breaks over pages. Wouldn't \vfil be better? Wait until the
  3685. % problem manifests itself, so it can be fixed for real --karl.
  3686. }%
  3687. }%
  3688. %
  3689. \parsearg\domultitable
  3690. }
  3691. \def\domultitable#1{%
  3692. % To parse everything between @multitable and @item:
  3693. \setuptable#1 \endsetuptable
  3694. %
  3695. % This preamble sets up a generic column definition, which will
  3696. % be used as many times as user calls for columns.
  3697. % \vtop will set a single line and will also let text wrap and
  3698. % continue for many paragraphs if desired.
  3699. \halign\bgroup &%
  3700. \global\advance\colcount by 1
  3701. \multistrut
  3702. \vtop{%
  3703. % Use the current \colcount to find the correct column width:
  3704. \hsize=\expandafter\csname col\the\colcount\endcsname
  3705. %
  3706. % In order to keep entries from bumping into each other
  3707. % we will add a \leftskip of \multitablecolspace to all columns after
  3708. % the first one.
  3709. %
  3710. % If a template has been used, we will add \multitablecolspace
  3711. % to the width of each template entry.
  3712. %
  3713. % If the user has set preamble in terms of percent of \hsize we will
  3714. % use that dimension as the width of the column, and the \leftskip
  3715. % will keep entries from bumping into each other. Table will start at
  3716. % left margin and final column will justify at right margin.
  3717. %
  3718. % Make sure we don't inherit \rightskip from the outer environment.
  3719. \rightskip=0pt
  3720. \ifnum\colcount=1
  3721. % The first column will be indented with the surrounding text.
  3722. \advance\hsize by\leftskip
  3723. \else
  3724. \ifsetpercent \else
  3725. % If user has not set preamble in terms of percent of \hsize
  3726. % we will advance \hsize by \multitablecolspace.
  3727. \advance\hsize by \multitablecolspace
  3728. \fi
  3729. % In either case we will make \leftskip=\multitablecolspace:
  3730. \leftskip=\multitablecolspace
  3731. \fi
  3732. % Ignoring space at the beginning and end avoids an occasional spurious
  3733. % blank line, when TeX decides to break the line at the space before the
  3734. % box from the multistrut, so the strut ends up on a line by itself.
  3735. % For example:
  3736. % @multitable @columnfractions .11 .89
  3737. % @item @code{#}
  3738. % @tab Legal holiday which is valid in major parts of the whole country.
  3739. % Is automatically provided with highlighting sequences respectively
  3740. % marking characters.
  3741. \noindent\ignorespaces##\unskip\multistrut
  3742. }\cr
  3743. }
  3744. \def\Emultitable{%
  3745. \crcr
  3746. \egroup % end the \halign
  3747. \global\setpercentfalse
  3748. }
  3749. \def\setmultitablespacing{%
  3750. \def\multistrut{\strut}% just use the standard line spacing
  3751. %
  3752. % Compute \multitablelinespace (if not defined by user) for use in
  3753. % \multitableparskip calculation. We used define \multistrut based on
  3754. % this, but (ironically) that caused the spacing to be off.
  3755. % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100.
  3756. \ifdim\multitablelinespace=0pt
  3757. \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
  3758. \global\advance\multitablelinespace by-\ht0
  3759. \fi
  3760. % Test to see if parskip is larger than space between lines of
  3761. % table. If not, do nothing.
  3762. % If so, set to same dimension as multitablelinespace.
  3763. \ifdim\multitableparskip>\multitablelinespace
  3764. \global\multitableparskip=\multitablelinespace
  3765. \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
  3766. % than skip between lines in the table.
  3767. \fi%
  3768. \ifdim\multitableparskip=0pt
  3769. \global\multitableparskip=\multitablelinespace
  3770. \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
  3771. % than skip between lines in the table.
  3772. \fi}
  3773. \message{conditionals,}
  3774. % @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext,
  3775. % @ifnotxml always succeed. They currently do nothing; we don't
  3776. % attempt to check whether the conditionals are properly nested. But we
  3777. % have to remember that they are conditionals, so that @end doesn't
  3778. % attempt to close an environment group.
  3779. %
  3780. \def\makecond#1{%
  3781. \expandafter\let\csname #1\endcsname = \relax
  3782. \expandafter\let\csname iscond.#1\endcsname = 1
  3783. }
  3784. \makecond{iftex}
  3785. \makecond{ifnotdocbook}
  3786. \makecond{ifnothtml}
  3787. \makecond{ifnotinfo}
  3788. \makecond{ifnotplaintext}
  3789. \makecond{ifnotxml}
  3790. % Ignore @ignore, @ifhtml, @ifinfo, and the like.
  3791. %
  3792. \def\direntry{\doignore{direntry}}
  3793. \def\documentdescription{\doignore{documentdescription}}
  3794. \def\docbook{\doignore{docbook}}
  3795. \def\html{\doignore{html}}
  3796. \def\ifdocbook{\doignore{ifdocbook}}
  3797. \def\ifhtml{\doignore{ifhtml}}
  3798. \def\ifinfo{\doignore{ifinfo}}
  3799. \def\ifnottex{\doignore{ifnottex}}
  3800. \def\ifplaintext{\doignore{ifplaintext}}
  3801. \def\ifxml{\doignore{ifxml}}
  3802. \def\ignore{\doignore{ignore}}
  3803. \def\menu{\doignore{menu}}
  3804. \def\xml{\doignore{xml}}
  3805. % Ignore text until a line `@end #1', keeping track of nested conditionals.
  3806. %
  3807. % A count to remember the depth of nesting.
  3808. \newcount\doignorecount
  3809. \def\doignore#1{\begingroup
  3810. % Scan in ``verbatim'' mode:
  3811. \obeylines
  3812. \catcode`\@ = \other
  3813. \catcode`\{ = \other
  3814. \catcode`\} = \other
  3815. %
  3816. % Make sure that spaces turn into tokens that match what \doignoretext wants.
  3817. \spaceisspace
  3818. %
  3819. % Count number of #1's that we've seen.
  3820. \doignorecount = 0
  3821. %
  3822. % Swallow text until we reach the matching `@end #1'.
  3823. \dodoignore{#1}%
  3824. }
  3825. { \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source.
  3826. \obeylines %
  3827. %
  3828. \gdef\dodoignore#1{%
  3829. % #1 contains the command name as a string, e.g., `ifinfo'.
  3830. %
  3831. % Define a command to find the next `@end #1'.
  3832. \long\def\doignoretext##1^^M@end #1{%
  3833. \doignoretextyyy##1^^M@#1\_STOP_}%
  3834. %
  3835. % And this command to find another #1 command, at the beginning of a
  3836. % line. (Otherwise, we would consider a line `@c @ifset', for
  3837. % example, to count as an @ifset for nesting.)
  3838. \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%
  3839. %
  3840. % And now expand that command.
  3841. \doignoretext ^^M%
  3842. }%
  3843. }
  3844. \def\doignoreyyy#1{%
  3845. \def\temp{#1}%
  3846. \ifx\temp\empty % Nothing found.
  3847. \let\next\doignoretextzzz
  3848. \else % Found a nested condition, ...
  3849. \advance\doignorecount by 1
  3850. \let\next\doignoretextyyy % ..., look for another.
  3851. % If we're here, #1 ends with ^^M\ifinfo (for example).
  3852. \fi
  3853. \next #1% the token \_STOP_ is present just after this macro.
  3854. }
  3855. % We have to swallow the remaining "\_STOP_".
  3856. %
  3857. \def\doignoretextzzz#1{%
  3858. \ifnum\doignorecount = 0 % We have just found the outermost @end.
  3859. \let\next\enddoignore
  3860. \else % Still inside a nested condition.
  3861. \advance\doignorecount by -1
  3862. \let\next\doignoretext % Look for the next @end.
  3863. \fi
  3864. \next
  3865. }
  3866. % Finish off ignored text.
  3867. { \obeylines%
  3868. % Ignore anything after the last `@end #1'; this matters in verbatim
  3869. % environments, where otherwise the newline after an ignored conditional
  3870. % would result in a blank line in the output.
  3871. \gdef\enddoignore#1^^M{\endgroup\ignorespaces}%
  3872. }
  3873. % @set VAR sets the variable VAR to an empty value.
  3874. % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
  3875. %
  3876. % Since we want to separate VAR from REST-OF-LINE (which might be
  3877. % empty), we can't just use \parsearg; we have to insert a space of our
  3878. % own to delimit the rest of the line, and then take it out again if we
  3879. % didn't need it.
  3880. % We rely on the fact that \parsearg sets \catcode`\ =10.
  3881. %
  3882. \parseargdef\set{\setyyy#1 \endsetyyy}
  3883. \def\setyyy#1 #2\endsetyyy{%
  3884. {%
  3885. \makevalueexpandable
  3886. \def\temp{#2}%
  3887. \edef\next{\gdef\makecsname{SET#1}}%
  3888. \ifx\temp\empty
  3889. \next{}%
  3890. \else
  3891. \setzzz#2\endsetzzz
  3892. \fi
  3893. }%
  3894. }
  3895. % Remove the trailing space \setxxx inserted.
  3896. \def\setzzz#1 \endsetzzz{\next{#1}}
  3897. % @clear VAR clears (i.e., unsets) the variable VAR.
  3898. %
  3899. \parseargdef\clear{%
  3900. {%
  3901. \makevalueexpandable
  3902. \global\expandafter\let\csname SET#1\endcsname=\relax
  3903. }%
  3904. }
  3905. % @value{foo} gets the text saved in variable foo.
  3906. \def\value{\begingroup\makevalueexpandable\valuexxx}
  3907. \def\valuexxx#1{\expandablevalue{#1}\endgroup}
  3908. {
  3909. \catcode`\-=\active \catcode`\_=\active
  3910. %
  3911. \gdef\makevalueexpandable{%
  3912. \let\value = \expandablevalue
  3913. % We don't want these characters active, ...
  3914. \catcode`\-=\other \catcode`\_=\other
  3915. % ..., but we might end up with active ones in the argument if
  3916. % we're called from @code, as @code{@value{foo-bar_}}, though.
  3917. % So \let them to their normal equivalents.
  3918. \let-\normaldash \let_\normalunderscore
  3919. }
  3920. }
  3921. % We have this subroutine so that we can handle at least some @value's
  3922. % properly in indexes (we call \makevalueexpandable in \indexdummies).
  3923. % The command has to be fully expandable (if the variable is set), since
  3924. % the result winds up in the index file. This means that if the
  3925. % variable's value contains other Texinfo commands, it's almost certain
  3926. % it will fail (although perhaps we could fix that with sufficient work
  3927. % to do a one-level expansion on the result, instead of complete).
  3928. %
  3929. % Unfortunately, this has the consequence that when _ is in the *value*
  3930. % of an @set, it does not print properly in the roman fonts (get the cmr
  3931. % dot accent at position 126 instead). No fix comes to mind, and it's
  3932. % been this way since 2003 or earlier, so just ignore it.
  3933. %
  3934. \def\expandablevalue#1{%
  3935. \expandafter\ifx\csname SET#1\endcsname\relax
  3936. {[No value for ``#1'']}%
  3937. \message{Variable `#1', used in @value, is not set.}%
  3938. \else
  3939. \csname SET#1\endcsname
  3940. \fi
  3941. }
  3942. % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
  3943. % with @set.
  3944. %
  3945. % To get the special treatment we need for `@end ifset,' we call
  3946. % \makecond and then redefine.
  3947. %
  3948. \makecond{ifset}
  3949. \def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}
  3950. \def\doifset#1#2{%
  3951. {%
  3952. \makevalueexpandable
  3953. \let\next=\empty
  3954. \expandafter\ifx\csname SET#2\endcsname\relax
  3955. #1% If not set, redefine \next.
  3956. \fi
  3957. \expandafter
  3958. }\next
  3959. }
  3960. \def\ifsetfail{\doignore{ifset}}
  3961. % @ifclear VAR ... @end executes the `...' iff VAR has never been
  3962. % defined with @set, or has been undefined with @clear.
  3963. %
  3964. % The `\else' inside the `\doifset' parameter is a trick to reuse the
  3965. % above code: if the variable is not set, do nothing, if it is set,
  3966. % then redefine \next to \ifclearfail.
  3967. %
  3968. \makecond{ifclear}
  3969. \def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
  3970. \def\ifclearfail{\doignore{ifclear}}
  3971. % @ifcommandisdefined CMD ... @end executes the `...' if CMD (written
  3972. % without the @) is in fact defined. We can only feasibly check at the
  3973. % TeX level, so something like `mathcode' is going to considered
  3974. % defined even though it is not a Texinfo command.
  3975. %
  3976. \makecond{ifcommanddefined}
  3977. \def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}}
  3978. %
  3979. \def\doifcmddefined#1#2{{%
  3980. \makevalueexpandable
  3981. \let\next=\empty
  3982. \expandafter\ifx\csname #2\endcsname\relax
  3983. #1% If not defined, \let\next as above.
  3984. \fi
  3985. \expandafter
  3986. }\next
  3987. }
  3988. \def\ifcmddefinedfail{\doignore{ifcommanddefined}}
  3989. % @ifcommandnotdefined CMD ... handled similar to @ifclear above.
  3990. \makecond{ifcommandnotdefined}
  3991. \def\ifcommandnotdefined{%
  3992. \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}}
  3993. \def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}}
  3994. % Set the `txicommandconditionals' variable, so documents have a way to
  3995. % test if the @ifcommand...defined conditionals are available.
  3996. \set txicommandconditionals
  3997. % @dircategory CATEGORY -- specify a category of the dir file
  3998. % which this file should belong to. Ignore this in TeX.
  3999. \let\dircategory=\comment
  4000. % @defininfoenclose.
  4001. \let\definfoenclose=\comment
  4002. \message{indexing,}
  4003. % Index generation facilities
  4004. % Define \newwrite to be identical to plain tex's \newwrite
  4005. % except not \outer, so it can be used within macros and \if's.
  4006. \edef\newwrite{\makecsname{ptexnewwrite}}
  4007. % \newindex {foo} defines an index named foo.
  4008. % It automatically defines \fooindex such that
  4009. % \fooindex ...rest of line... puts an entry in the index foo.
  4010. % It also defines \fooindfile to be the number of the output channel for
  4011. % the file that accumulates this index. The file's extension is foo.
  4012. % The name of an index should be no more than 2 characters long
  4013. % for the sake of vms.
  4014. %
  4015. \def\newindex#1{%
  4016. \iflinks
  4017. \expandafter\newwrite \csname#1indfile\endcsname
  4018. \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
  4019. \fi
  4020. \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
  4021. \noexpand\doindex{#1}}
  4022. }
  4023. % @defindex foo == \newindex{foo}
  4024. %
  4025. \def\defindex{\parsearg\newindex}
  4026. % Define @defcodeindex, like @defindex except put all entries in @code.
  4027. %
  4028. \def\defcodeindex{\parsearg\newcodeindex}
  4029. %
  4030. \def\newcodeindex#1{%
  4031. \iflinks
  4032. \expandafter\newwrite \csname#1indfile\endcsname
  4033. \openout \csname#1indfile\endcsname \jobname.#1
  4034. \fi
  4035. \expandafter\xdef\csname#1index\endcsname{%
  4036. \noexpand\docodeindex{#1}}%
  4037. }
  4038. % @synindex foo bar makes index foo feed into index bar.
  4039. % Do this instead of @defindex foo if you don't want it as a separate index.
  4040. %
  4041. % @syncodeindex foo bar similar, but put all entries made for index foo
  4042. % inside @code.
  4043. %
  4044. \def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
  4045. \def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
  4046. % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
  4047. % #3 the target index (bar).
  4048. \def\dosynindex#1#2#3{%
  4049. % Only do \closeout if we haven't already done it, else we'll end up
  4050. % closing the target index.
  4051. \expandafter \ifx\csname donesynindex#2\endcsname \relax
  4052. % The \closeout helps reduce unnecessary open files; the limit on the
  4053. % Acorn RISC OS is a mere 16 files.
  4054. \expandafter\closeout\csname#2indfile\endcsname
  4055. \expandafter\let\csname donesynindex#2\endcsname = 1
  4056. \fi
  4057. % redefine \fooindfile:
  4058. \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
  4059. \expandafter\let\csname#2indfile\endcsname=\temp
  4060. % redefine \fooindex:
  4061. \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
  4062. }
  4063. % Define \doindex, the driver for all \fooindex macros.
  4064. % Argument #1 is generated by the calling \fooindex macro,
  4065. % and it is "foo", the name of the index.
  4066. % \doindex just uses \parsearg; it calls \doind for the actual work.
  4067. % This is because \doind is more useful to call from other macros.
  4068. % There is also \dosubind {index}{topic}{subtopic}
  4069. % which makes an entry in a two-level index such as the operation index.
  4070. \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
  4071. \def\singleindexer #1{\doind{\indexname}{#1}}
  4072. % like the previous two, but they put @code around the argument.
  4073. \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
  4074. \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
  4075. % Take care of Texinfo commands that can appear in an index entry.
  4076. % Since there are some commands we want to expand, and others we don't,
  4077. % we have to laboriously prevent expansion for those that we don't.
  4078. %
  4079. \def\indexdummies{%
  4080. \escapechar = `\\ % use backslash in output files.
  4081. \def\@{@}% change to @@ when we switch to @ as escape char in index files.
  4082. \def\ {\realbackslash\space }%
  4083. %
  4084. % Need these unexpandable (because we define \tt as a dummy)
  4085. % definitions when @{ or @} appear in index entry text. Also, more
  4086. % complicated, when \tex is in effect and \{ is a \delimiter again.
  4087. % We can't use \lbracecmd and \rbracecmd because texindex assumes
  4088. % braces and backslashes are used only as delimiters. Perhaps we
  4089. % should define @lbrace and @rbrace commands a la @comma.
  4090. \def\{{{\tt\char123}}%
  4091. \def\}{{\tt\char125}}%
  4092. %
  4093. % I don't entirely understand this, but when an index entry is
  4094. % generated from a macro call, the \endinput which \scanmacro inserts
  4095. % causes processing to be prematurely terminated. This is,
  4096. % apparently, because \indexsorttmp is fully expanded, and \endinput
  4097. % is an expandable command. The redefinition below makes \endinput
  4098. % disappear altogether for that purpose -- although logging shows that
  4099. % processing continues to some further point. On the other hand, it
  4100. % seems \endinput does not hurt in the printed index arg, since that
  4101. % is still getting written without apparent harm.
  4102. %
  4103. % Sample source (mac-idx3.tex, reported by Graham Percival to
  4104. % help-texinfo, 22may06):
  4105. % @macro funindex {WORD}
  4106. % @findex xyz
  4107. % @end macro
  4108. % ...
  4109. % @funindex commtest
  4110. %
  4111. % The above is not enough to reproduce the bug, but it gives the flavor.
  4112. %
  4113. % Sample whatsit resulting:
  4114. % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}}
  4115. %
  4116. % So:
  4117. \let\endinput = \empty
  4118. %
  4119. % Do the redefinitions.
  4120. \commondummies
  4121. }
  4122. % For the aux and toc files, @ is the escape character. So we want to
  4123. % redefine everything using @ as the escape character (instead of
  4124. % \realbackslash, still used for index files). When everything uses @,
  4125. % this will be simpler.
  4126. %
  4127. \def\atdummies{%
  4128. \def\@{@@}%
  4129. \def\ {@ }%
  4130. \let\{ = \lbraceatcmd
  4131. \let\} = \rbraceatcmd
  4132. %
  4133. % Do the redefinitions.
  4134. \commondummies
  4135. \otherbackslash
  4136. }
  4137. % Called from \indexdummies and \atdummies.
  4138. %
  4139. \def\commondummies{%
  4140. %
  4141. % \definedummyword defines \#1 as \string\#1\space, thus effectively
  4142. % preventing its expansion. This is used only for control words,
  4143. % not control letters, because the \space would be incorrect for
  4144. % control characters, but is needed to separate the control word
  4145. % from whatever follows.
  4146. %
  4147. % For control letters, we have \definedummyletter, which omits the
  4148. % space.
  4149. %
  4150. % These can be used both for control words that take an argument and
  4151. % those that do not. If it is followed by {arg} in the input, then
  4152. % that will dutifully get written to the index (or wherever).
  4153. %
  4154. \def\definedummyword ##1{\def##1{\string##1\space}}%
  4155. \def\definedummyletter##1{\def##1{\string##1}}%
  4156. \let\definedummyaccent\definedummyletter
  4157. %
  4158. \commondummiesnofonts
  4159. %
  4160. \definedummyletter\_%
  4161. \definedummyletter\-%
  4162. %
  4163. % Non-English letters.
  4164. \definedummyword\AA
  4165. \definedummyword\AE
  4166. \definedummyword\DH
  4167. \definedummyword\L
  4168. \definedummyword\O
  4169. \definedummyword\OE
  4170. \definedummyword\TH
  4171. \definedummyword\aa
  4172. \definedummyword\ae
  4173. \definedummyword\dh
  4174. \definedummyword\exclamdown
  4175. \definedummyword\l
  4176. \definedummyword\o
  4177. \definedummyword\oe
  4178. \definedummyword\ordf
  4179. \definedummyword\ordm
  4180. \definedummyword\questiondown
  4181. \definedummyword\ss
  4182. \definedummyword\th
  4183. %
  4184. % Although these internal commands shouldn't show up, sometimes they do.
  4185. \definedummyword\bf
  4186. \definedummyword\gtr
  4187. \definedummyword\hat
  4188. \definedummyword\less
  4189. \definedummyword\sf
  4190. \definedummyword\sl
  4191. \definedummyword\tclose
  4192. \definedummyword\tt
  4193. %
  4194. \definedummyword\LaTeX
  4195. \definedummyword\TeX
  4196. %
  4197. % Assorted special characters.
  4198. \definedummyword\arrow
  4199. \definedummyword\bullet
  4200. \definedummyword\comma
  4201. \definedummyword\copyright
  4202. \definedummyword\registeredsymbol
  4203. \definedummyword\dots
  4204. \definedummyword\enddots
  4205. \definedummyword\entrybreak
  4206. \definedummyword\equiv
  4207. \definedummyword\error
  4208. \definedummyword\euro
  4209. \definedummyword\expansion
  4210. \definedummyword\geq
  4211. \definedummyword\guillemetleft
  4212. \definedummyword\guillemetright
  4213. \definedummyword\guilsinglleft
  4214. \definedummyword\guilsinglright
  4215. \definedummyword\lbracechar
  4216. \definedummyword\leq
  4217. \definedummyword\minus
  4218. \definedummyword\ogonek
  4219. \definedummyword\pounds
  4220. \definedummyword\point
  4221. \definedummyword\print
  4222. \definedummyword\quotedblbase
  4223. \definedummyword\quotedblleft
  4224. \definedummyword\quotedblright
  4225. \definedummyword\quoteleft
  4226. \definedummyword\quoteright
  4227. \definedummyword\quotesinglbase
  4228. \definedummyword\rbracechar
  4229. \definedummyword\result
  4230. \definedummyword\textdegree
  4231. %
  4232. % We want to disable all macros so that they are not expanded by \write.
  4233. \macrolist
  4234. %
  4235. \normalturnoffactive
  4236. %
  4237. % Handle some cases of @value -- where it does not contain any
  4238. % (non-fully-expandable) commands.
  4239. \makevalueexpandable
  4240. }
  4241. % \commondummiesnofonts: common to \commondummies and \indexnofonts.
  4242. %
  4243. \def\commondummiesnofonts{%
  4244. % Control letters and accents.
  4245. \definedummyletter\!%
  4246. \definedummyaccent\"%
  4247. \definedummyaccent\'%
  4248. \definedummyletter\*%
  4249. \definedummyaccent\,%
  4250. \definedummyletter\.%
  4251. \definedummyletter\/%
  4252. \definedummyletter\:%
  4253. \definedummyaccent\=%
  4254. \definedummyletter\?%
  4255. \definedummyaccent\^%
  4256. \definedummyaccent\`%
  4257. \definedummyaccent\~%
  4258. \definedummyword\u
  4259. \definedummyword\v
  4260. \definedummyword\H
  4261. \definedummyword\dotaccent
  4262. \definedummyword\ogonek
  4263. \definedummyword\ringaccent
  4264. \definedummyword\tieaccent
  4265. \definedummyword\ubaraccent
  4266. \definedummyword\udotaccent
  4267. \definedummyword\dotless
  4268. %
  4269. % Texinfo font commands.
  4270. \definedummyword\b
  4271. \definedummyword\i
  4272. \definedummyword\r
  4273. \definedummyword\sansserif
  4274. \definedummyword\sc
  4275. \definedummyword\slanted
  4276. \definedummyword\t
  4277. %
  4278. % Commands that take arguments.
  4279. \definedummyword\abbr
  4280. \definedummyword\acronym
  4281. \definedummyword\anchor
  4282. \definedummyword\cite
  4283. \definedummyword\code
  4284. \definedummyword\command
  4285. \definedummyword\dfn
  4286. \definedummyword\dmn
  4287. \definedummyword\email
  4288. \definedummyword\emph
  4289. \definedummyword\env
  4290. \definedummyword\file
  4291. \definedummyword\image
  4292. \definedummyword\indicateurl
  4293. \definedummyword\inforef
  4294. \definedummyword\kbd
  4295. \definedummyword\key
  4296. \definedummyword\math
  4297. \definedummyword\option
  4298. \definedummyword\pxref
  4299. \definedummyword\ref
  4300. \definedummyword\samp
  4301. \definedummyword\strong
  4302. \definedummyword\tie
  4303. \definedummyword\uref
  4304. \definedummyword\url
  4305. \definedummyword\var
  4306. \definedummyword\verb
  4307. \definedummyword\w
  4308. \definedummyword\xref
  4309. }
  4310. % \indexnofonts is used when outputting the strings to sort the index
  4311. % by, and when constructing control sequence names. It eliminates all
  4312. % control sequences and just writes whatever the best ASCII sort string
  4313. % would be for a given command (usually its argument).
  4314. %
  4315. \def\indexnofonts{%
  4316. % Accent commands should become @asis.
  4317. \def\definedummyaccent##1{\let##1\asis}%
  4318. % We can just ignore other control letters.
  4319. \def\definedummyletter##1{\let##1\empty}%
  4320. % All control words become @asis by default; overrides below.
  4321. \let\definedummyword\definedummyaccent
  4322. %
  4323. \commondummiesnofonts
  4324. %
  4325. % Don't no-op \tt, since it isn't a user-level command
  4326. % and is used in the definitions of the active chars like <, >, |, etc.
  4327. % Likewise with the other plain tex font commands.
  4328. %\let\tt=\asis
  4329. %
  4330. \def\ { }%
  4331. \def\@{@}%
  4332. \def\_{\normalunderscore}%
  4333. \def\-{}% @- shouldn't affect sorting
  4334. %
  4335. % Unfortunately, texindex is not prepared to handle braces in the
  4336. % content at all. So for index sorting, we map @{ and @} to strings
  4337. % starting with |, since that ASCII character is between ASCII { and }.
  4338. \def\{{|a}%
  4339. \def\lbracechar{|a}%
  4340. %
  4341. \def\}{|b}%
  4342. \def\rbracechar{|b}%
  4343. %
  4344. % Non-English letters.
  4345. \def\AA{AA}%
  4346. \def\AE{AE}%
  4347. \def\DH{DZZ}%
  4348. \def\L{L}%
  4349. \def\OE{OE}%
  4350. \def\O{O}%
  4351. \def\TH{ZZZ}%
  4352. \def\aa{aa}%
  4353. \def\ae{ae}%
  4354. \def\dh{dzz}%
  4355. \def\exclamdown{!}%
  4356. \def\l{l}%
  4357. \def\oe{oe}%
  4358. \def\ordf{a}%
  4359. \def\ordm{o}%
  4360. \def\o{o}%
  4361. \def\questiondown{?}%
  4362. \def\ss{ss}%
  4363. \def\th{zzz}%
  4364. %
  4365. \def\LaTeX{LaTeX}%
  4366. \def\TeX{TeX}%
  4367. %
  4368. % Assorted special characters.
  4369. % (The following {} will end up in the sort string, but that's ok.)
  4370. \def\arrow{->}%
  4371. \def\bullet{bullet}%
  4372. \def\comma{,}%
  4373. \def\copyright{copyright}%
  4374. \def\dots{...}%
  4375. \def\enddots{...}%
  4376. \def\equiv{==}%
  4377. \def\error{error}%
  4378. \def\euro{euro}%
  4379. \def\expansion{==>}%
  4380. \def\geq{>=}%
  4381. \def\guillemetleft{<<}%
  4382. \def\guillemetright{>>}%
  4383. \def\guilsinglleft{<}%
  4384. \def\guilsinglright{>}%
  4385. \def\leq{<=}%
  4386. \def\minus{-}%
  4387. \def\point{.}%
  4388. \def\pounds{pounds}%
  4389. \def\print{-|}%
  4390. \def\quotedblbase{"}%
  4391. \def\quotedblleft{"}%
  4392. \def\quotedblright{"}%
  4393. \def\quoteleft{`}%
  4394. \def\quoteright{'}%
  4395. \def\quotesinglbase{,}%
  4396. \def\registeredsymbol{R}%
  4397. \def\result{=>}%
  4398. \def\textdegree{o}%
  4399. %
  4400. \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax
  4401. \else \indexlquoteignore \fi
  4402. %
  4403. % We need to get rid of all macros, leaving only the arguments (if present).
  4404. % Of course this is not nearly correct, but it is the best we can do for now.
  4405. % makeinfo does not expand macros in the argument to @deffn, which ends up
  4406. % writing an index entry, and texindex isn't prepared for an index sort entry
  4407. % that starts with \.
  4408. %
  4409. % Since macro invocations are followed by braces, we can just redefine them
  4410. % to take a single TeX argument. The case of a macro invocation that
  4411. % goes to end-of-line is not handled.
  4412. %
  4413. \macrolist
  4414. }
  4415. % Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us
  4416. % ignore left quotes in the sort term.
  4417. {\catcode`\`=\active
  4418. \gdef\indexlquoteignore{\let`=\empty}}
  4419. \let\indexbackslash=0 %overridden during \printindex.
  4420. \let\SETmarginindex=\relax % put index entries in margin (undocumented)?
  4421. % Most index entries go through here, but \dosubind is the general case.
  4422. % #1 is the index name, #2 is the entry text.
  4423. \def\doind#1#2{\dosubind{#1}{#2}{}}
  4424. % Workhorse for all \fooindexes.
  4425. % #1 is name of index, #2 is stuff to put there, #3 is subentry --
  4426. % empty if called from \doind, as we usually are (the main exception
  4427. % is with most defuns, which call us directly).
  4428. %
  4429. \def\dosubind#1#2#3{%
  4430. \iflinks
  4431. {%
  4432. % Store the main index entry text (including the third arg).
  4433. \toks0 = {#2}%
  4434. % If third arg is present, precede it with a space.
  4435. \def\thirdarg{#3}%
  4436. \ifx\thirdarg\empty \else
  4437. \toks0 = \expandafter{\the\toks0 \space #3}%
  4438. \fi
  4439. %
  4440. \edef\writeto{\csname#1indfile\endcsname}%
  4441. %
  4442. \safewhatsit\dosubindwrite
  4443. }%
  4444. \fi
  4445. }
  4446. % Write the entry in \toks0 to the index file:
  4447. %
  4448. \def\dosubindwrite{%
  4449. % Put the index entry in the margin if desired.
  4450. \ifx\SETmarginindex\relax\else
  4451. \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}%
  4452. \fi
  4453. %
  4454. % Remember, we are within a group.
  4455. \indexdummies % Must do this here, since \bf, etc expand at this stage
  4456. \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now
  4457. % so it will be output as is; and it will print as backslash.
  4458. %
  4459. % Process the index entry with all font commands turned off, to
  4460. % get the string to sort by.
  4461. {\indexnofonts
  4462. \edef\temp{\the\toks0}% need full expansion
  4463. \xdef\indexsorttmp{\temp}%
  4464. }%
  4465. %
  4466. % Set up the complete index entry, with both the sort key and
  4467. % the original text, including any font commands. We write
  4468. % three arguments to \entry to the .?? file (four in the
  4469. % subentry case), texindex reduces to two when writing the .??s
  4470. % sorted result.
  4471. \edef\temp{%
  4472. \write\writeto{%
  4473. \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}%
  4474. }%
  4475. \temp
  4476. }
  4477. % Take care of unwanted page breaks/skips around a whatsit:
  4478. %
  4479. % If a skip is the last thing on the list now, preserve it
  4480. % by backing up by \lastskip, doing the \write, then inserting
  4481. % the skip again. Otherwise, the whatsit generated by the
  4482. % \write or \pdfdest will make \lastskip zero. The result is that
  4483. % sequences like this:
  4484. % @end defun
  4485. % @tindex whatever
  4486. % @defun ...
  4487. % will have extra space inserted, because the \medbreak in the
  4488. % start of the @defun won't see the skip inserted by the @end of
  4489. % the previous defun.
  4490. %
  4491. % But don't do any of this if we're not in vertical mode. We
  4492. % don't want to do a \vskip and prematurely end a paragraph.
  4493. %
  4494. % Avoid page breaks due to these extra skips, too.
  4495. %
  4496. % But wait, there is a catch there:
  4497. % We'll have to check whether \lastskip is zero skip. \ifdim is not
  4498. % sufficient for this purpose, as it ignores stretch and shrink parts
  4499. % of the skip. The only way seems to be to check the textual
  4500. % representation of the skip.
  4501. %
  4502. % The following is almost like \def\zeroskipmacro{0.0pt} except that
  4503. % the ``p'' and ``t'' characters have catcode \other, not 11 (letter).
  4504. %
  4505. \edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname}
  4506. %
  4507. \newskip\whatsitskip
  4508. \newcount\whatsitpenalty
  4509. %
  4510. % ..., ready, GO:
  4511. %
  4512. \def\safewhatsit#1{\ifhmode
  4513. #1%
  4514. \else
  4515. % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
  4516. \whatsitskip = \lastskip
  4517. \edef\lastskipmacro{\the\lastskip}%
  4518. \whatsitpenalty = \lastpenalty
  4519. %
  4520. % If \lastskip is nonzero, that means the last item was a
  4521. % skip. And since a skip is discardable, that means this
  4522. % -\whatsitskip glue we're inserting is preceded by a
  4523. % non-discardable item, therefore it is not a potential
  4524. % breakpoint, therefore no \nobreak needed.
  4525. \ifx\lastskipmacro\zeroskipmacro
  4526. \else
  4527. \vskip-\whatsitskip
  4528. \fi
  4529. %
  4530. #1%
  4531. %
  4532. \ifx\lastskipmacro\zeroskipmacro
  4533. % If \lastskip was zero, perhaps the last item was a penalty, and
  4534. % perhaps it was >=10000, e.g., a \nobreak. In that case, we want
  4535. % to re-insert the same penalty (values >10000 are used for various
  4536. % signals); since we just inserted a non-discardable item, any
  4537. % following glue (such as a \parskip) would be a breakpoint. For example:
  4538. % @deffn deffn-whatever
  4539. % @vindex index-whatever
  4540. % Description.
  4541. % would allow a break between the index-whatever whatsit
  4542. % and the "Description." paragraph.
  4543. \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi
  4544. \else
  4545. % On the other hand, if we had a nonzero \lastskip,
  4546. % this make-up glue would be preceded by a non-discardable item
  4547. % (the whatsit from the \write), so we must insert a \nobreak.
  4548. \nobreak\vskip\whatsitskip
  4549. \fi
  4550. \fi}
  4551. % The index entry written in the file actually looks like
  4552. % \entry {sortstring}{page}{topic}
  4553. % or
  4554. % \entry {sortstring}{page}{topic}{subtopic}
  4555. % The texindex program reads in these files and writes files
  4556. % containing these kinds of lines:
  4557. % \initial {c}
  4558. % before the first topic whose initial is c
  4559. % \entry {topic}{pagelist}
  4560. % for a topic that is used without subtopics
  4561. % \primary {topic}
  4562. % for the beginning of a topic that is used with subtopics
  4563. % \secondary {subtopic}{pagelist}
  4564. % for each subtopic.
  4565. % Define the user-accessible indexing commands
  4566. % @findex, @vindex, @kindex, @cindex.
  4567. \def\findex {\fnindex}
  4568. \def\kindex {\kyindex}
  4569. \def\cindex {\cpindex}
  4570. \def\vindex {\vrindex}
  4571. \def\tindex {\tpindex}
  4572. \def\pindex {\pgindex}
  4573. \def\cindexsub {\begingroup\obeylines\cindexsub}
  4574. {\obeylines %
  4575. \gdef\cindexsub "#1" #2^^M{\endgroup %
  4576. \dosubind{cp}{#2}{#1}}}
  4577. % Define the macros used in formatting output of the sorted index material.
  4578. % @printindex causes a particular index (the ??s file) to get printed.
  4579. % It does not print any chapter heading (usually an @unnumbered).
  4580. %
  4581. \parseargdef\printindex{\begingroup
  4582. \dobreak \chapheadingskip{10000}%
  4583. %
  4584. \smallfonts \rm
  4585. \tolerance = 9500
  4586. \plainfrenchspacing
  4587. \everypar = {}% don't want the \kern\-parindent from indentation suppression.
  4588. %
  4589. % See if the index file exists and is nonempty.
  4590. % Change catcode of @ here so that if the index file contains
  4591. % \initial {@}
  4592. % as its first line, TeX doesn't complain about mismatched braces
  4593. % (because it thinks @} is a control sequence).
  4594. \catcode`\@ = 11
  4595. \openin 1 \jobname.#1s
  4596. \ifeof 1
  4597. % \enddoublecolumns gets confused if there is no text in the index,
  4598. % and it loses the chapter title and the aux file entries for the
  4599. % index. The easiest way to prevent this problem is to make sure
  4600. % there is some text.
  4601. \putwordIndexNonexistent
  4602. \else
  4603. %
  4604. % If the index file exists but is empty, then \openin leaves \ifeof
  4605. % false. We have to make TeX try to read something from the file, so
  4606. % it can discover if there is anything in it.
  4607. \read 1 to \temp
  4608. \ifeof 1
  4609. \putwordIndexIsEmpty
  4610. \else
  4611. % Index files are almost Texinfo source, but we use \ as the escape
  4612. % character. It would be better to use @, but that's too big a change
  4613. % to make right now.
  4614. \def\indexbackslash{\backslashcurfont}%
  4615. \catcode`\\ = 0
  4616. \escapechar = `\\
  4617. \begindoublecolumns
  4618. \input \jobname.#1s
  4619. \enddoublecolumns
  4620. \fi
  4621. \fi
  4622. \closein 1
  4623. \endgroup}
  4624. % These macros are used by the sorted index file itself.
  4625. % Change them to control the appearance of the index.
  4626. \def\initial#1{{%
  4627. % Some minor font changes for the special characters.
  4628. \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
  4629. %
  4630. % Remove any glue we may have, we'll be inserting our own.
  4631. \removelastskip
  4632. %
  4633. % We like breaks before the index initials, so insert a bonus.
  4634. \nobreak
  4635. \vskip 0pt plus 3\baselineskip
  4636. \penalty 0
  4637. \vskip 0pt plus -3\baselineskip
  4638. %
  4639. % Typeset the initial. Making this add up to a whole number of
  4640. % baselineskips increases the chance of the dots lining up from column
  4641. % to column. It still won't often be perfect, because of the stretch
  4642. % we need before each entry, but it's better.
  4643. %
  4644. % No shrink because it confuses \balancecolumns.
  4645. \vskip 1.67\baselineskip plus .5\baselineskip
  4646. \leftline{\secbf #1}%
  4647. % Do our best not to break after the initial.
  4648. \nobreak
  4649. \vskip .33\baselineskip plus .1\baselineskip
  4650. }}
  4651. % \entry typesets a paragraph consisting of the text (#1), dot leaders, and
  4652. % then page number (#2) flushed to the right margin. It is used for index
  4653. % and table of contents entries. The paragraph is indented by \leftskip.
  4654. %
  4655. % A straightforward implementation would start like this:
  4656. % \def\entry#1#2{...
  4657. % But this freezes the catcodes in the argument, and can cause problems to
  4658. % @code, which sets - active. This problem was fixed by a kludge---
  4659. % ``-'' was active throughout whole index, but this isn't really right.
  4660. % The right solution is to prevent \entry from swallowing the whole text.
  4661. % --kasal, 21nov03
  4662. \def\entry{%
  4663. \begingroup
  4664. %
  4665. % Start a new paragraph if necessary, so our assignments below can't
  4666. % affect previous text.
  4667. \par
  4668. %
  4669. % Do not fill out the last line with white space.
  4670. \parfillskip = 0in
  4671. %
  4672. % No extra space above this paragraph.
  4673. \parskip = 0in
  4674. %
  4675. % Do not prefer a separate line ending with a hyphen to fewer lines.
  4676. \finalhyphendemerits = 0
  4677. %
  4678. % \hangindent is only relevant when the entry text and page number
  4679. % don't both fit on one line. In that case, bob suggests starting the
  4680. % dots pretty far over on the line. Unfortunately, a large
  4681. % indentation looks wrong when the entry text itself is broken across
  4682. % lines. So we use a small indentation and put up with long leaders.
  4683. %
  4684. % \hangafter is reset to 1 (which is the value we want) at the start
  4685. % of each paragraph, so we need not do anything with that.
  4686. \hangindent = 2em
  4687. %
  4688. % When the entry text needs to be broken, just fill out the first line
  4689. % with blank space.
  4690. \rightskip = 0pt plus1fil
  4691. %
  4692. % A bit of stretch before each entry for the benefit of balancing
  4693. % columns.
  4694. \vskip 0pt plus1pt
  4695. %
  4696. % When reading the text of entry, convert explicit line breaks
  4697. % from @* into spaces. The user might give these in long section
  4698. % titles, for instance.
  4699. \def\*{\unskip\space\ignorespaces}%
  4700. \def\entrybreak{\hfil\break}%
  4701. %
  4702. % Swallow the left brace of the text (first parameter):
  4703. \afterassignment\doentry
  4704. \let\temp =
  4705. }
  4706. \def\entrybreak{\unskip\space\ignorespaces}%
  4707. \def\doentry{%
  4708. \bgroup % Instead of the swallowed brace.
  4709. \noindent
  4710. \aftergroup\finishentry
  4711. % And now comes the text of the entry.
  4712. }
  4713. \def\finishentry#1{%
  4714. % #1 is the page number.
  4715. %
  4716. % The following is kludged to not output a line of dots in the index if
  4717. % there are no page numbers. The next person who breaks this will be
  4718. % cursed by a Unix daemon.
  4719. \setbox\boxA = \hbox{#1}%
  4720. \ifdim\wd\boxA = 0pt
  4721. \ %
  4722. \else
  4723. %
  4724. % If we must, put the page number on a line of its own, and fill out
  4725. % this line with blank space. (The \hfil is overwhelmed with the
  4726. % fill leaders glue in \indexdotfill if the page number does fit.)
  4727. \hfil\penalty50
  4728. \null\nobreak\indexdotfill % Have leaders before the page number.
  4729. %
  4730. % The `\ ' here is removed by the implicit \unskip that TeX does as
  4731. % part of (the primitive) \par. Without it, a spurious underfull
  4732. % \hbox ensues.
  4733. \ifpdf
  4734. \pdfgettoks#1.%
  4735. \ \the\toksA
  4736. \else
  4737. \ #1%
  4738. \fi
  4739. \fi
  4740. \par
  4741. \endgroup
  4742. }
  4743. % Like plain.tex's \dotfill, except uses up at least 1 em.
  4744. \def\indexdotfill{\cleaders
  4745. \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill}
  4746. \def\primary #1{\line{#1\hfil}}
  4747. \newskip\secondaryindent \secondaryindent=0.5cm
  4748. \def\secondary#1#2{{%
  4749. \parfillskip=0in
  4750. \parskip=0in
  4751. \hangindent=1in
  4752. \hangafter=1
  4753. \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
  4754. \ifpdf
  4755. \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
  4756. \else
  4757. #2
  4758. \fi
  4759. \par
  4760. }}
  4761. % Define two-column mode, which we use to typeset indexes.
  4762. % Adapted from the TeXbook, page 416, which is to say,
  4763. % the manmac.tex format used to print the TeXbook itself.
  4764. \catcode`\@=11
  4765. \newbox\partialpage
  4766. \newdimen\doublecolumnhsize
  4767. \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
  4768. % Grab any single-column material above us.
  4769. \output = {%
  4770. %
  4771. % Here is a possibility not foreseen in manmac: if we accumulate a
  4772. % whole lot of material, we might end up calling this \output
  4773. % routine twice in a row (see the doublecol-lose test, which is
  4774. % essentially a couple of indexes with @setchapternewpage off). In
  4775. % that case we just ship out what is in \partialpage with the normal
  4776. % output routine. Generally, \partialpage will be empty when this
  4777. % runs and this will be a no-op. See the indexspread.tex test case.
  4778. \ifvoid\partialpage \else
  4779. \onepageout{\pagecontents\partialpage}%
  4780. \fi
  4781. %
  4782. \global\setbox\partialpage = \vbox{%
  4783. % Unvbox the main output page.
  4784. \unvbox\PAGE
  4785. \kern-\topskip \kern\baselineskip
  4786. }%
  4787. }%
  4788. \eject % run that output routine to set \partialpage
  4789. %
  4790. % Use the double-column output routine for subsequent pages.
  4791. \output = {\doublecolumnout}%
  4792. %
  4793. % Change the page size parameters. We could do this once outside this
  4794. % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
  4795. % format, but then we repeat the same computation. Repeating a couple
  4796. % of assignments once per index is clearly meaningless for the
  4797. % execution time, so we may as well do it in one place.
  4798. %
  4799. % First we halve the line length, less a little for the gutter between
  4800. % the columns. We compute the gutter based on the line length, so it
  4801. % changes automatically with the paper format. The magic constant
  4802. % below is chosen so that the gutter has the same value (well, +-<1pt)
  4803. % as it did when we hard-coded it.
  4804. %
  4805. % We put the result in a separate register, \doublecolumhsize, so we
  4806. % can restore it in \pagesofar, after \hsize itself has (potentially)
  4807. % been clobbered.
  4808. %
  4809. \doublecolumnhsize = \hsize
  4810. \advance\doublecolumnhsize by -.04154\hsize
  4811. \divide\doublecolumnhsize by 2
  4812. \hsize = \doublecolumnhsize
  4813. %
  4814. % Double the \vsize as well. (We don't need a separate register here,
  4815. % since nobody clobbers \vsize.)
  4816. \vsize = 2\vsize
  4817. }
  4818. % The double-column output routine for all double-column pages except
  4819. % the last.
  4820. %
  4821. \def\doublecolumnout{%
  4822. \splittopskip=\topskip \splitmaxdepth=\maxdepth
  4823. % Get the available space for the double columns -- the normal
  4824. % (undoubled) page height minus any material left over from the
  4825. % previous page.
  4826. \dimen@ = \vsize
  4827. \divide\dimen@ by 2
  4828. \advance\dimen@ by -\ht\partialpage
  4829. %
  4830. % box0 will be the left-hand column, box2 the right.
  4831. \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
  4832. \onepageout\pagesofar
  4833. \unvbox255
  4834. \penalty\outputpenalty
  4835. }
  4836. %
  4837. % Re-output the contents of the output page -- any previous material,
  4838. % followed by the two boxes we just split, in box0 and box2.
  4839. \def\pagesofar{%
  4840. \unvbox\partialpage
  4841. %
  4842. \hsize = \doublecolumnhsize
  4843. \wd0=\hsize \wd2=\hsize
  4844. \hbox to\pagewidth{\box0\hfil\box2}%
  4845. }
  4846. %
  4847. % All done with double columns.
  4848. \def\enddoublecolumns{%
  4849. % The following penalty ensures that the page builder is exercised
  4850. % _before_ we change the output routine. This is necessary in the
  4851. % following situation:
  4852. %
  4853. % The last section of the index consists only of a single entry.
  4854. % Before this section, \pagetotal is less than \pagegoal, so no
  4855. % break occurs before the last section starts. However, the last
  4856. % section, consisting of \initial and the single \entry, does not
  4857. % fit on the page and has to be broken off. Without the following
  4858. % penalty the page builder will not be exercised until \eject
  4859. % below, and by that time we'll already have changed the output
  4860. % routine to the \balancecolumns version, so the next-to-last
  4861. % double-column page will be processed with \balancecolumns, which
  4862. % is wrong: The two columns will go to the main vertical list, with
  4863. % the broken-off section in the recent contributions. As soon as
  4864. % the output routine finishes, TeX starts reconsidering the page
  4865. % break. The two columns and the broken-off section both fit on the
  4866. % page, because the two columns now take up only half of the page
  4867. % goal. When TeX sees \eject from below which follows the final
  4868. % section, it invokes the new output routine that we've set after
  4869. % \balancecolumns below; \onepageout will try to fit the two columns
  4870. % and the final section into the vbox of \pageheight (see
  4871. % \pagebody), causing an overfull box.
  4872. %
  4873. % Note that glue won't work here, because glue does not exercise the
  4874. % page builder, unlike penalties (see The TeXbook, pp. 280-281).
  4875. \penalty0
  4876. %
  4877. \output = {%
  4878. % Split the last of the double-column material. Leave it on the
  4879. % current page, no automatic page break.
  4880. \balancecolumns
  4881. %
  4882. % If we end up splitting too much material for the current page,
  4883. % though, there will be another page break right after this \output
  4884. % invocation ends. Having called \balancecolumns once, we do not
  4885. % want to call it again. Therefore, reset \output to its normal
  4886. % definition right away. (We hope \balancecolumns will never be
  4887. % called on to balance too much material, but if it is, this makes
  4888. % the output somewhat more palatable.)
  4889. \global\output = {\onepageout{\pagecontents\PAGE}}%
  4890. }%
  4891. \eject
  4892. \endgroup % started in \begindoublecolumns
  4893. %
  4894. % \pagegoal was set to the doubled \vsize above, since we restarted
  4895. % the current page. We're now back to normal single-column
  4896. % typesetting, so reset \pagegoal to the normal \vsize (after the
  4897. % \endgroup where \vsize got restored).
  4898. \pagegoal = \vsize
  4899. }
  4900. %
  4901. % Called at the end of the double column material.
  4902. \def\balancecolumns{%
  4903. \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
  4904. \dimen@ = \ht0
  4905. \advance\dimen@ by \topskip
  4906. \advance\dimen@ by-\baselineskip
  4907. \divide\dimen@ by 2 % target to split to
  4908. %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
  4909. \splittopskip = \topskip
  4910. % Loop until we get a decent breakpoint.
  4911. {%
  4912. \vbadness = 10000
  4913. \loop
  4914. \global\setbox3 = \copy0
  4915. \global\setbox1 = \vsplit3 to \dimen@
  4916. \ifdim\ht3>\dimen@
  4917. \global\advance\dimen@ by 1pt
  4918. \repeat
  4919. }%
  4920. %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
  4921. \setbox0=\vbox to\dimen@{\unvbox1}%
  4922. \setbox2=\vbox to\dimen@{\unvbox3}%
  4923. %
  4924. \pagesofar
  4925. }
  4926. \catcode`\@ = \other
  4927. \message{sectioning,}
  4928. % Chapters, sections, etc.
  4929. % Let's start with @part.
  4930. \outer\parseargdef\part{\partzzz{#1}}
  4931. \def\partzzz#1{%
  4932. \chapoddpage
  4933. \null
  4934. \vskip.3\vsize % move it down on the page a bit
  4935. \begingroup
  4936. \noindent \titlefonts\rmisbold #1\par % the text
  4937. \let\lastnode=\empty % no node to associate with
  4938. \writetocentry{part}{#1}{}% but put it in the toc
  4939. \headingsoff % no headline or footline on the part page
  4940. \chapoddpage
  4941. \endgroup
  4942. }
  4943. % \unnumberedno is an oxymoron. But we count the unnumbered
  4944. % sections so that we can refer to them unambiguously in the pdf
  4945. % outlines by their "section number". We avoid collisions with chapter
  4946. % numbers by starting them at 10000. (If a document ever has 10000
  4947. % chapters, we're in trouble anyway, I'm sure.)
  4948. \newcount\unnumberedno \unnumberedno = 10000
  4949. \newcount\chapno
  4950. \newcount\secno \secno=0
  4951. \newcount\subsecno \subsecno=0
  4952. \newcount\subsubsecno \subsubsecno=0
  4953. % This counter is funny since it counts through charcodes of letters A, B, ...
  4954. \newcount\appendixno \appendixno = `\@
  4955. %
  4956. % \def\appendixletter{\char\the\appendixno}
  4957. % We do the following ugly conditional instead of the above simple
  4958. % construct for the sake of pdftex, which needs the actual
  4959. % letter in the expansion, not just typeset.
  4960. %
  4961. \def\appendixletter{%
  4962. \ifnum\appendixno=`A A%
  4963. \else\ifnum\appendixno=`B B%
  4964. \else\ifnum\appendixno=`C C%
  4965. \else\ifnum\appendixno=`D D%
  4966. \else\ifnum\appendixno=`E E%
  4967. \else\ifnum\appendixno=`F F%
  4968. \else\ifnum\appendixno=`G G%
  4969. \else\ifnum\appendixno=`H H%
  4970. \else\ifnum\appendixno=`I I%
  4971. \else\ifnum\appendixno=`J J%
  4972. \else\ifnum\appendixno=`K K%
  4973. \else\ifnum\appendixno=`L L%
  4974. \else\ifnum\appendixno=`M M%
  4975. \else\ifnum\appendixno=`N N%
  4976. \else\ifnum\appendixno=`O O%
  4977. \else\ifnum\appendixno=`P P%
  4978. \else\ifnum\appendixno=`Q Q%
  4979. \else\ifnum\appendixno=`R R%
  4980. \else\ifnum\appendixno=`S S%
  4981. \else\ifnum\appendixno=`T T%
  4982. \else\ifnum\appendixno=`U U%
  4983. \else\ifnum\appendixno=`V V%
  4984. \else\ifnum\appendixno=`W W%
  4985. \else\ifnum\appendixno=`X X%
  4986. \else\ifnum\appendixno=`Y Y%
  4987. \else\ifnum\appendixno=`Z Z%
  4988. % The \the is necessary, despite appearances, because \appendixletter is
  4989. % expanded while writing the .toc file. \char\appendixno is not
  4990. % expandable, thus it is written literally, thus all appendixes come out
  4991. % with the same letter (or @) in the toc without it.
  4992. \else\char\the\appendixno
  4993. \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
  4994. \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
  4995. % Each @chapter defines these (using marks) as the number+name, number
  4996. % and name of the chapter. Page headings and footings can use
  4997. % these. @section does likewise.
  4998. \def\thischapter{}
  4999. \def\thischapternum{}
  5000. \def\thischaptername{}
  5001. \def\thissection{}
  5002. \def\thissectionnum{}
  5003. \def\thissectionname{}
  5004. \newcount\absseclevel % used to calculate proper heading level
  5005. \newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
  5006. % @raisesections: treat @section as chapter, @subsection as section, etc.
  5007. \def\raisesections{\global\advance\secbase by -1}
  5008. \let\up=\raisesections % original BFox name
  5009. % @lowersections: treat @chapter as section, @section as subsection, etc.
  5010. \def\lowersections{\global\advance\secbase by 1}
  5011. \let\down=\lowersections % original BFox name
  5012. % we only have subsub.
  5013. \chardef\maxseclevel = 3
  5014. %
  5015. % A numbered section within an unnumbered changes to unnumbered too.
  5016. % To achieve this, remember the "biggest" unnum. sec. we are currently in:
  5017. \chardef\unnlevel = \maxseclevel
  5018. %
  5019. % Trace whether the current chapter is an appendix or not:
  5020. % \chapheadtype is "N" or "A", unnumbered chapters are ignored.
  5021. \def\chapheadtype{N}
  5022. % Choose a heading macro
  5023. % #1 is heading type
  5024. % #2 is heading level
  5025. % #3 is text for heading
  5026. \def\genhead#1#2#3{%
  5027. % Compute the abs. sec. level:
  5028. \absseclevel=#2
  5029. \advance\absseclevel by \secbase
  5030. % Make sure \absseclevel doesn't fall outside the range:
  5031. \ifnum \absseclevel < 0
  5032. \absseclevel = 0
  5033. \else
  5034. \ifnum \absseclevel > 3
  5035. \absseclevel = 3
  5036. \fi
  5037. \fi
  5038. % The heading type:
  5039. \def\headtype{#1}%
  5040. \if \headtype U%
  5041. \ifnum \absseclevel < \unnlevel
  5042. \chardef\unnlevel = \absseclevel
  5043. \fi
  5044. \else
  5045. % Check for appendix sections:
  5046. \ifnum \absseclevel = 0
  5047. \edef\chapheadtype{\headtype}%
  5048. \else
  5049. \if \headtype A\if \chapheadtype N%
  5050. \errmessage{@appendix... within a non-appendix chapter}%
  5051. \fi\fi
  5052. \fi
  5053. % Check for numbered within unnumbered:
  5054. \ifnum \absseclevel > \unnlevel
  5055. \def\headtype{U}%
  5056. \else
  5057. \chardef\unnlevel = 3
  5058. \fi
  5059. \fi
  5060. % Now print the heading:
  5061. \if \headtype U%
  5062. \ifcase\absseclevel
  5063. \unnumberedzzz{#3}%
  5064. \or \unnumberedseczzz{#3}%
  5065. \or \unnumberedsubseczzz{#3}%
  5066. \or \unnumberedsubsubseczzz{#3}%
  5067. \fi
  5068. \else
  5069. \if \headtype A%
  5070. \ifcase\absseclevel
  5071. \appendixzzz{#3}%
  5072. \or \appendixsectionzzz{#3}%
  5073. \or \appendixsubseczzz{#3}%
  5074. \or \appendixsubsubseczzz{#3}%
  5075. \fi
  5076. \else
  5077. \ifcase\absseclevel
  5078. \chapterzzz{#3}%
  5079. \or \seczzz{#3}%
  5080. \or \numberedsubseczzz{#3}%
  5081. \or \numberedsubsubseczzz{#3}%
  5082. \fi
  5083. \fi
  5084. \fi
  5085. \suppressfirstparagraphindent
  5086. }
  5087. % an interface:
  5088. \def\numhead{\genhead N}
  5089. \def\apphead{\genhead A}
  5090. \def\unnmhead{\genhead U}
  5091. % @chapter, @appendix, @unnumbered. Increment top-level counter, reset
  5092. % all lower-level sectioning counters to zero.
  5093. %
  5094. % Also set \chaplevelprefix, which we prepend to @float sequence numbers
  5095. % (e.g., figures), q.v. By default (before any chapter), that is empty.
  5096. \let\chaplevelprefix = \empty
  5097. %
  5098. \outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz
  5099. \def\chapterzzz#1{%
  5100. % section resetting is \global in case the chapter is in a group, such
  5101. % as an @include file.
  5102. \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
  5103. \global\advance\chapno by 1
  5104. %
  5105. % Used for \float.
  5106. \gdef\chaplevelprefix{\the\chapno.}%
  5107. \resetallfloatnos
  5108. %
  5109. % \putwordChapter can contain complex things in translations.
  5110. \toks0=\expandafter{\putwordChapter}%
  5111. \message{\the\toks0 \space \the\chapno}%
  5112. %
  5113. % Write the actual heading.
  5114. \chapmacro{#1}{Ynumbered}{\the\chapno}%
  5115. %
  5116. % So @section and the like are numbered underneath this chapter.
  5117. \global\let\section = \numberedsec
  5118. \global\let\subsection = \numberedsubsec
  5119. \global\let\subsubsection = \numberedsubsubsec
  5120. }
  5121. \outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz
  5122. %
  5123. \def\appendixzzz#1{%
  5124. \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
  5125. \global\advance\appendixno by 1
  5126. \gdef\chaplevelprefix{\appendixletter.}%
  5127. \resetallfloatnos
  5128. %
  5129. % \putwordAppendix can contain complex things in translations.
  5130. \toks0=\expandafter{\putwordAppendix}%
  5131. \message{\the\toks0 \space \appendixletter}%
  5132. %
  5133. \chapmacro{#1}{Yappendix}{\appendixletter}%
  5134. %
  5135. \global\let\section = \appendixsec
  5136. \global\let\subsection = \appendixsubsec
  5137. \global\let\subsubsection = \appendixsubsubsec
  5138. }
  5139. % normally unnmhead0 calls unnumberedzzz:
  5140. \outer\parseargdef\unnumbered{\unnmhead0{#1}}
  5141. \def\unnumberedzzz#1{%
  5142. \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
  5143. \global\advance\unnumberedno by 1
  5144. %
  5145. % Since an unnumbered has no number, no prefix for figures.
  5146. \global\let\chaplevelprefix = \empty
  5147. \resetallfloatnos
  5148. %
  5149. % This used to be simply \message{#1}, but TeX fully expands the
  5150. % argument to \message. Therefore, if #1 contained @-commands, TeX
  5151. % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
  5152. % expanded @cite (which turns out to cause errors because \cite is meant
  5153. % to be executed, not expanded).
  5154. %
  5155. % Anyway, we don't want the fully-expanded definition of @cite to appear
  5156. % as a result of the \message, we just want `@cite' itself. We use
  5157. % \the<toks register> to achieve this: TeX expands \the<toks> only once,
  5158. % simply yielding the contents of <toks register>. (We also do this for
  5159. % the toc entries.)
  5160. \toks0 = {#1}%
  5161. \message{(\the\toks0)}%
  5162. %
  5163. \chapmacro{#1}{Ynothing}{\the\unnumberedno}%
  5164. %
  5165. \global\let\section = \unnumberedsec
  5166. \global\let\subsection = \unnumberedsubsec
  5167. \global\let\subsubsection = \unnumberedsubsubsec
  5168. }
  5169. % @centerchap is like @unnumbered, but the heading is centered.
  5170. \outer\parseargdef\centerchap{%
  5171. % Well, we could do the following in a group, but that would break
  5172. % an assumption that \chapmacro is called at the outermost level.
  5173. % Thus we are safer this way: --kasal, 24feb04
  5174. \let\centerparametersmaybe = \centerparameters
  5175. \unnmhead0{#1}%
  5176. \let\centerparametersmaybe = \relax
  5177. }
  5178. % @top is like @unnumbered.
  5179. \let\top\unnumbered
  5180. % Sections.
  5181. %
  5182. \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
  5183. \def\seczzz#1{%
  5184. \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
  5185. \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
  5186. }
  5187. % normally calls appendixsectionzzz:
  5188. \outer\parseargdef\appendixsection{\apphead1{#1}}
  5189. \def\appendixsectionzzz#1{%
  5190. \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
  5191. \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
  5192. }
  5193. \let\appendixsec\appendixsection
  5194. % normally calls unnumberedseczzz:
  5195. \outer\parseargdef\unnumberedsec{\unnmhead1{#1}}
  5196. \def\unnumberedseczzz#1{%
  5197. \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
  5198. \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
  5199. }
  5200. % Subsections.
  5201. %
  5202. % normally calls numberedsubseczzz:
  5203. \outer\parseargdef\numberedsubsec{\numhead2{#1}}
  5204. \def\numberedsubseczzz#1{%
  5205. \global\subsubsecno=0 \global\advance\subsecno by 1
  5206. \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
  5207. }
  5208. % normally calls appendixsubseczzz:
  5209. \outer\parseargdef\appendixsubsec{\apphead2{#1}}
  5210. \def\appendixsubseczzz#1{%
  5211. \global\subsubsecno=0 \global\advance\subsecno by 1
  5212. \sectionheading{#1}{subsec}{Yappendix}%
  5213. {\appendixletter.\the\secno.\the\subsecno}%
  5214. }
  5215. % normally calls unnumberedsubseczzz:
  5216. \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}}
  5217. \def\unnumberedsubseczzz#1{%
  5218. \global\subsubsecno=0 \global\advance\subsecno by 1
  5219. \sectionheading{#1}{subsec}{Ynothing}%
  5220. {\the\unnumberedno.\the\secno.\the\subsecno}%
  5221. }
  5222. % Subsubsections.
  5223. %
  5224. % normally numberedsubsubseczzz:
  5225. \outer\parseargdef\numberedsubsubsec{\numhead3{#1}}
  5226. \def\numberedsubsubseczzz#1{%
  5227. \global\advance\subsubsecno by 1
  5228. \sectionheading{#1}{subsubsec}{Ynumbered}%
  5229. {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
  5230. }
  5231. % normally appendixsubsubseczzz:
  5232. \outer\parseargdef\appendixsubsubsec{\apphead3{#1}}
  5233. \def\appendixsubsubseczzz#1{%
  5234. \global\advance\subsubsecno by 1
  5235. \sectionheading{#1}{subsubsec}{Yappendix}%
  5236. {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
  5237. }
  5238. % normally unnumberedsubsubseczzz:
  5239. \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}}
  5240. \def\unnumberedsubsubseczzz#1{%
  5241. \global\advance\subsubsecno by 1
  5242. \sectionheading{#1}{subsubsec}{Ynothing}%
  5243. {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}%
  5244. }
  5245. % These macros control what the section commands do, according
  5246. % to what kind of chapter we are in (ordinary, appendix, or unnumbered).
  5247. % Define them by default for a numbered chapter.
  5248. \let\section = \numberedsec
  5249. \let\subsection = \numberedsubsec
  5250. \let\subsubsection = \numberedsubsubsec
  5251. % Define @majorheading, @heading and @subheading
  5252. \def\majorheading{%
  5253. {\advance\chapheadingskip by 10pt \chapbreak }%
  5254. \parsearg\chapheadingzzz
  5255. }
  5256. \def\chapheading{\chapbreak \parsearg\chapheadingzzz}
  5257. \def\chapheadingzzz#1{%
  5258. \vbox{\chapfonts \raggedtitlesettings #1\par}%
  5259. \nobreak\bigskip \nobreak
  5260. \suppressfirstparagraphindent
  5261. }
  5262. % @heading, @subheading, @subsubheading.
  5263. \parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{}
  5264. \suppressfirstparagraphindent}
  5265. \parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{}
  5266. \suppressfirstparagraphindent}
  5267. \parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
  5268. \suppressfirstparagraphindent}
  5269. % These macros generate a chapter, section, etc. heading only
  5270. % (including whitespace, linebreaking, etc. around it),
  5271. % given all the information in convenient, parsed form.
  5272. % Args are the skip and penalty (usually negative)
  5273. \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
  5274. % Parameter controlling skip before chapter headings (if needed)
  5275. \newskip\chapheadingskip
  5276. % Define plain chapter starts, and page on/off switching for it.
  5277. \def\chapbreak{\dobreak \chapheadingskip {-4000}}
  5278. \def\chappager{\par\vfill\supereject}
  5279. % Because \domark is called before \chapoddpage, the filler page will
  5280. % get the headings for the next chapter, which is wrong. But we don't
  5281. % care -- we just disable all headings on the filler page.
  5282. \def\chapoddpage{%
  5283. \chappager
  5284. \ifodd\pageno \else
  5285. \begingroup
  5286. \headingsoff
  5287. \null
  5288. \chappager
  5289. \endgroup
  5290. \fi
  5291. }
  5292. \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
  5293. \def\CHAPPAGoff{%
  5294. \global\let\contentsalignmacro = \chappager
  5295. \global\let\pchapsepmacro=\chapbreak
  5296. \global\let\pagealignmacro=\chappager}
  5297. \def\CHAPPAGon{%
  5298. \global\let\contentsalignmacro = \chappager
  5299. \global\let\pchapsepmacro=\chappager
  5300. \global\let\pagealignmacro=\chappager
  5301. \global\def\HEADINGSon{\HEADINGSsingle}}
  5302. \def\CHAPPAGodd{%
  5303. \global\let\contentsalignmacro = \chapoddpage
  5304. \global\let\pchapsepmacro=\chapoddpage
  5305. \global\let\pagealignmacro=\chapoddpage
  5306. \global\def\HEADINGSon{\HEADINGSdouble}}
  5307. \CHAPPAGon
  5308. % Chapter opening.
  5309. %
  5310. % #1 is the text, #2 is the section type (Ynumbered, Ynothing,
  5311. % Yappendix, Yomitfromtoc), #3 the chapter number.
  5312. %
  5313. % To test against our argument.
  5314. \def\Ynothingkeyword{Ynothing}
  5315. \def\Yomitfromtockeyword{Yomitfromtoc}
  5316. \def\Yappendixkeyword{Yappendix}
  5317. %
  5318. \def\chapmacro#1#2#3{%
  5319. % Insert the first mark before the heading break (see notes for \domark).
  5320. \let\prevchapterdefs=\lastchapterdefs
  5321. \let\prevsectiondefs=\lastsectiondefs
  5322. \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
  5323. \gdef\thissection{}}%
  5324. %
  5325. \def\temptype{#2}%
  5326. \ifx\temptype\Ynothingkeyword
  5327. \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
  5328. \gdef\thischapter{\thischaptername}}%
  5329. \else\ifx\temptype\Yomitfromtockeyword
  5330. \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
  5331. \gdef\thischapter{}}%
  5332. \else\ifx\temptype\Yappendixkeyword
  5333. \toks0={#1}%
  5334. \xdef\lastchapterdefs{%
  5335. \gdef\noexpand\thischaptername{\the\toks0}%
  5336. \gdef\noexpand\thischapternum{\appendixletter}%
  5337. % \noexpand\putwordAppendix avoids expanding indigestible
  5338. % commands in some of the translations.
  5339. \gdef\noexpand\thischapter{\noexpand\putwordAppendix{}
  5340. \noexpand\thischapternum:
  5341. \noexpand\thischaptername}%
  5342. }%
  5343. \else
  5344. \toks0={#1}%
  5345. \xdef\lastchapterdefs{%
  5346. \gdef\noexpand\thischaptername{\the\toks0}%
  5347. \gdef\noexpand\thischapternum{\the\chapno}%
  5348. % \noexpand\putwordChapter avoids expanding indigestible
  5349. % commands in some of the translations.
  5350. \gdef\noexpand\thischapter{\noexpand\putwordChapter{}
  5351. \noexpand\thischapternum:
  5352. \noexpand\thischaptername}%
  5353. }%
  5354. \fi\fi\fi
  5355. %
  5356. % Output the mark. Pass it through \safewhatsit, to take care of
  5357. % the preceding space.
  5358. \safewhatsit\domark
  5359. %
  5360. % Insert the chapter heading break.
  5361. \pchapsepmacro
  5362. %
  5363. % Now the second mark, after the heading break. No break points
  5364. % between here and the heading.
  5365. \let\prevchapterdefs=\lastchapterdefs
  5366. \let\prevsectiondefs=\lastsectiondefs
  5367. \domark
  5368. %
  5369. {%
  5370. \chapfonts \rmisbold
  5371. %
  5372. % Have to define \lastsection before calling \donoderef, because the
  5373. % xref code eventually uses it. On the other hand, it has to be called
  5374. % after \pchapsepmacro, or the headline will change too soon.
  5375. \gdef\lastsection{#1}%
  5376. %
  5377. % Only insert the separating space if we have a chapter/appendix
  5378. % number, and don't print the unnumbered ``number''.
  5379. \ifx\temptype\Ynothingkeyword
  5380. \setbox0 = \hbox{}%
  5381. \def\toctype{unnchap}%
  5382. \else\ifx\temptype\Yomitfromtockeyword
  5383. \setbox0 = \hbox{}% contents like unnumbered, but no toc entry
  5384. \def\toctype{omit}%
  5385. \else\ifx\temptype\Yappendixkeyword
  5386. \setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
  5387. \def\toctype{app}%
  5388. \else
  5389. \setbox0 = \hbox{#3\enspace}%
  5390. \def\toctype{numchap}%
  5391. \fi\fi\fi
  5392. %
  5393. % Write the toc entry for this chapter. Must come before the
  5394. % \donoderef, because we include the current node name in the toc
  5395. % entry, and \donoderef resets it to empty.
  5396. \writetocentry{\toctype}{#1}{#3}%
  5397. %
  5398. % For pdftex, we have to write out the node definition (aka, make
  5399. % the pdfdest) after any page break, but before the actual text has
  5400. % been typeset. If the destination for the pdf outline is after the
  5401. % text, then jumping from the outline may wind up with the text not
  5402. % being visible, for instance under high magnification.
  5403. \donoderef{#2}%
  5404. %
  5405. % Typeset the actual heading.
  5406. \nobreak % Avoid page breaks at the interline glue.
  5407. \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe
  5408. \unhbox0 #1\par}%
  5409. }%
  5410. \nobreak\bigskip % no page break after a chapter title
  5411. \nobreak
  5412. }
  5413. % @centerchap -- centered and unnumbered.
  5414. \let\centerparametersmaybe = \relax
  5415. \def\centerparameters{%
  5416. \advance\rightskip by 3\rightskip
  5417. \leftskip = \rightskip
  5418. \parfillskip = 0pt
  5419. }
  5420. % I don't think this chapter style is supported any more, so I'm not
  5421. % updating it with the new noderef stuff. We'll see. --karl, 11aug03.
  5422. %
  5423. \def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
  5424. %
  5425. \def\unnchfopen #1{%
  5426. \chapoddpage
  5427. \vbox{\chapfonts \raggedtitlesettings #1\par}%
  5428. \nobreak\bigskip\nobreak
  5429. }
  5430. \def\chfopen #1#2{\chapoddpage {\chapfonts
  5431. \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
  5432. \par\penalty 5000 %
  5433. }
  5434. \def\centerchfopen #1{%
  5435. \chapoddpage
  5436. \vbox{\chapfonts \raggedtitlesettings \hfill #1\hfill}%
  5437. \nobreak\bigskip \nobreak
  5438. }
  5439. \def\CHAPFopen{%
  5440. \global\let\chapmacro=\chfopen
  5441. \global\let\centerchapmacro=\centerchfopen}
  5442. % Section titles. These macros combine the section number parts and
  5443. % call the generic \sectionheading to do the printing.
  5444. %
  5445. \newskip\secheadingskip
  5446. \def\secheadingbreak{\dobreak \secheadingskip{-1000}}
  5447. % Subsection titles.
  5448. \newskip\subsecheadingskip
  5449. \def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}}
  5450. % Subsubsection titles.
  5451. \def\subsubsecheadingskip{\subsecheadingskip}
  5452. \def\subsubsecheadingbreak{\subsecheadingbreak}
  5453. % Print any size, any type, section title.
  5454. %
  5455. % #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is
  5456. % the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the
  5457. % section number.
  5458. %
  5459. \def\seckeyword{sec}
  5460. %
  5461. \def\sectionheading#1#2#3#4{%
  5462. {%
  5463. \checkenv{}% should not be in an environment.
  5464. %
  5465. % Switch to the right set of fonts.
  5466. \csname #2fonts\endcsname \rmisbold
  5467. %
  5468. \def\sectionlevel{#2}%
  5469. \def\temptype{#3}%
  5470. %
  5471. % Insert first mark before the heading break (see notes for \domark).
  5472. \let\prevsectiondefs=\lastsectiondefs
  5473. \ifx\temptype\Ynothingkeyword
  5474. \ifx\sectionlevel\seckeyword
  5475. \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
  5476. \gdef\thissection{\thissectionname}}%
  5477. \fi
  5478. \else\ifx\temptype\Yomitfromtockeyword
  5479. % Don't redefine \thissection.
  5480. \else\ifx\temptype\Yappendixkeyword
  5481. \ifx\sectionlevel\seckeyword
  5482. \toks0={#1}%
  5483. \xdef\lastsectiondefs{%
  5484. \gdef\noexpand\thissectionname{\the\toks0}%
  5485. \gdef\noexpand\thissectionnum{#4}%
  5486. % \noexpand\putwordSection avoids expanding indigestible
  5487. % commands in some of the translations.
  5488. \gdef\noexpand\thissection{\noexpand\putwordSection{}
  5489. \noexpand\thissectionnum:
  5490. \noexpand\thissectionname}%
  5491. }%
  5492. \fi
  5493. \else
  5494. \ifx\sectionlevel\seckeyword
  5495. \toks0={#1}%
  5496. \xdef\lastsectiondefs{%
  5497. \gdef\noexpand\thissectionname{\the\toks0}%
  5498. \gdef\noexpand\thissectionnum{#4}%
  5499. % \noexpand\putwordSection avoids expanding indigestible
  5500. % commands in some of the translations.
  5501. \gdef\noexpand\thissection{\noexpand\putwordSection{}
  5502. \noexpand\thissectionnum:
  5503. \noexpand\thissectionname}%
  5504. }%
  5505. \fi
  5506. \fi\fi\fi
  5507. %
  5508. % Go into vertical mode. Usually we'll already be there, but we
  5509. % don't want the following whatsit to end up in a preceding paragraph
  5510. % if the document didn't happen to have a blank line.
  5511. \par
  5512. %
  5513. % Output the mark. Pass it through \safewhatsit, to take care of
  5514. % the preceding space.
  5515. \safewhatsit\domark
  5516. %
  5517. % Insert space above the heading.
  5518. \csname #2headingbreak\endcsname
  5519. %
  5520. % Now the second mark, after the heading break. No break points
  5521. % between here and the heading.
  5522. \global\let\prevsectiondefs=\lastsectiondefs
  5523. \domark
  5524. %
  5525. % Only insert the space after the number if we have a section number.
  5526. \ifx\temptype\Ynothingkeyword
  5527. \setbox0 = \hbox{}%
  5528. \def\toctype{unn}%
  5529. \gdef\lastsection{#1}%
  5530. \else\ifx\temptype\Yomitfromtockeyword
  5531. % for @headings -- no section number, don't include in toc,
  5532. % and don't redefine \lastsection.
  5533. \setbox0 = \hbox{}%
  5534. \def\toctype{omit}%
  5535. \let\sectionlevel=\empty
  5536. \else\ifx\temptype\Yappendixkeyword
  5537. \setbox0 = \hbox{#4\enspace}%
  5538. \def\toctype{app}%
  5539. \gdef\lastsection{#1}%
  5540. \else
  5541. \setbox0 = \hbox{#4\enspace}%
  5542. \def\toctype{num}%
  5543. \gdef\lastsection{#1}%
  5544. \fi\fi\fi
  5545. %
  5546. % Write the toc entry (before \donoderef). See comments in \chapmacro.
  5547. \writetocentry{\toctype\sectionlevel}{#1}{#4}%
  5548. %
  5549. % Write the node reference (= pdf destination for pdftex).
  5550. % Again, see comments in \chapmacro.
  5551. \donoderef{#3}%
  5552. %
  5553. % Interline glue will be inserted when the vbox is completed.
  5554. % That glue will be a valid breakpoint for the page, since it'll be
  5555. % preceded by a whatsit (usually from the \donoderef, or from the
  5556. % \writetocentry if there was no node). We don't want to allow that
  5557. % break, since then the whatsits could end up on page n while the
  5558. % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000.
  5559. \nobreak
  5560. %
  5561. % Output the actual section heading.
  5562. \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
  5563. \hangindent=\wd0 % zero if no section number
  5564. \unhbox0 #1}%
  5565. }%
  5566. % Add extra space after the heading -- half of whatever came above it.
  5567. % Don't allow stretch, though.
  5568. \kern .5 \csname #2headingskip\endcsname
  5569. %
  5570. % Do not let the kern be a potential breakpoint, as it would be if it
  5571. % was followed by glue.
  5572. \nobreak
  5573. %
  5574. % We'll almost certainly start a paragraph next, so don't let that
  5575. % glue accumulate. (Not a breakpoint because it's preceded by a
  5576. % discardable item.) However, when a paragraph is not started next
  5577. % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out
  5578. % or the negative glue will cause weirdly wrong output, typically
  5579. % obscuring the section heading with something else.
  5580. \vskip-\parskip
  5581. %
  5582. % This is so the last item on the main vertical list is a known
  5583. % \penalty > 10000, so \startdefun, etc., can recognize the situation
  5584. % and do the needful.
  5585. \penalty 10001
  5586. }
  5587. \message{toc,}
  5588. % Table of contents.
  5589. \newwrite\tocfile
  5590. % Write an entry to the toc file, opening it if necessary.
  5591. % Called from @chapter, etc.
  5592. %
  5593. % Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno}
  5594. % We append the current node name (if any) and page number as additional
  5595. % arguments for the \{chap,sec,...}entry macros which will eventually
  5596. % read this. The node name is used in the pdf outlines as the
  5597. % destination to jump to.
  5598. %
  5599. % We open the .toc file for writing here instead of at @setfilename (or
  5600. % any other fixed time) so that @contents can be anywhere in the document.
  5601. % But if #1 is `omit', then we don't do anything. This is used for the
  5602. % table of contents chapter openings themselves.
  5603. %
  5604. \newif\iftocfileopened
  5605. \def\omitkeyword{omit}%
  5606. %
  5607. \def\writetocentry#1#2#3{%
  5608. \edef\writetoctype{#1}%
  5609. \ifx\writetoctype\omitkeyword \else
  5610. \iftocfileopened\else
  5611. \immediate\openout\tocfile = \jobname.toc
  5612. \global\tocfileopenedtrue
  5613. \fi
  5614. %
  5615. \iflinks
  5616. {\atdummies
  5617. \edef\temp{%
  5618. \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}%
  5619. \temp
  5620. }%
  5621. \fi
  5622. \fi
  5623. %
  5624. % Tell \shipout to create a pdf destination on each page, if we're
  5625. % writing pdf. These are used in the table of contents. We can't
  5626. % just write one on every page because the title pages are numbered
  5627. % 1 and 2 (the page numbers aren't printed), and so are the first
  5628. % two pages of the document. Thus, we'd have two destinations named
  5629. % `1', and two named `2'.
  5630. \ifpdf \global\pdfmakepagedesttrue \fi
  5631. }
  5632. % These characters do not print properly in the Computer Modern roman
  5633. % fonts, so we must take special care. This is more or less redundant
  5634. % with the Texinfo input format setup at the end of this file.
  5635. %
  5636. \def\activecatcodes{%
  5637. \catcode`\"=\active
  5638. \catcode`\$=\active
  5639. \catcode`\<=\active
  5640. \catcode`\>=\active
  5641. \catcode`\\=\active
  5642. \catcode`\^=\active
  5643. \catcode`\_=\active
  5644. \catcode`\|=\active
  5645. \catcode`\~=\active
  5646. }
  5647. % Read the toc file, which is essentially Texinfo input.
  5648. \def\readtocfile{%
  5649. \setupdatafile
  5650. \activecatcodes
  5651. \input \tocreadfilename
  5652. }
  5653. \newskip\contentsrightmargin \contentsrightmargin=1in
  5654. \newcount\savepageno
  5655. \newcount\lastnegativepageno \lastnegativepageno = -1
  5656. % Prepare to read what we've written to \tocfile.
  5657. %
  5658. \def\startcontents#1{%
  5659. % If @setchapternewpage on, and @headings double, the contents should
  5660. % start on an odd page, unlike chapters. Thus, we maintain
  5661. % \contentsalignmacro in parallel with \pagealignmacro.
  5662. % From: Torbjorn Granlund <tege@matematik.su.se>
  5663. \contentsalignmacro
  5664. \immediate\closeout\tocfile
  5665. %
  5666. % Don't need to put `Contents' or `Short Contents' in the headline.
  5667. % It is abundantly clear what they are.
  5668. \chapmacro{#1}{Yomitfromtoc}{}%
  5669. %
  5670. \savepageno = \pageno
  5671. \begingroup % Set up to handle contents files properly.
  5672. \raggedbottom % Worry more about breakpoints than the bottom.
  5673. \advance\hsize by -\contentsrightmargin % Don't use the full line length.
  5674. %
  5675. % Roman numerals for page numbers.
  5676. \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
  5677. }
  5678. % redefined for the two-volume lispref. We always output on
  5679. % \jobname.toc even if this is redefined.
  5680. %
  5681. \def\tocreadfilename{\jobname.toc}
  5682. % Normal (long) toc.
  5683. %
  5684. \def\contents{%
  5685. \startcontents{\putwordTOC}%
  5686. \openin 1 \tocreadfilename\space
  5687. \ifeof 1 \else
  5688. \readtocfile
  5689. \fi
  5690. \vfill \eject
  5691. \contentsalignmacro % in case @setchapternewpage odd is in effect
  5692. \ifeof 1 \else
  5693. \pdfmakeoutlines
  5694. \fi
  5695. \closein 1
  5696. \endgroup
  5697. \lastnegativepageno = \pageno
  5698. \global\pageno = \savepageno
  5699. }
  5700. % And just the chapters.
  5701. \def\summarycontents{%
  5702. \startcontents{\putwordShortTOC}%
  5703. %
  5704. \let\partentry = \shortpartentry
  5705. \let\numchapentry = \shortchapentry
  5706. \let\appentry = \shortchapentry
  5707. \let\unnchapentry = \shortunnchapentry
  5708. % We want a true roman here for the page numbers.
  5709. \secfonts
  5710. \let\rm=\shortcontrm \let\bf=\shortcontbf
  5711. \let\sl=\shortcontsl \let\tt=\shortconttt
  5712. \rm
  5713. \hyphenpenalty = 10000
  5714. \advance\baselineskip by 1pt % Open it up a little.
  5715. \def\numsecentry##1##2##3##4{}
  5716. \let\appsecentry = \numsecentry
  5717. \let\unnsecentry = \numsecentry
  5718. \let\numsubsecentry = \numsecentry
  5719. \let\appsubsecentry = \numsecentry
  5720. \let\unnsubsecentry = \numsecentry
  5721. \let\numsubsubsecentry = \numsecentry
  5722. \let\appsubsubsecentry = \numsecentry
  5723. \let\unnsubsubsecentry = \numsecentry
  5724. \openin 1 \tocreadfilename\space
  5725. \ifeof 1 \else
  5726. \readtocfile
  5727. \fi
  5728. \closein 1
  5729. \vfill \eject
  5730. \contentsalignmacro % in case @setchapternewpage odd is in effect
  5731. \endgroup
  5732. \lastnegativepageno = \pageno
  5733. \global\pageno = \savepageno
  5734. }
  5735. \let\shortcontents = \summarycontents
  5736. % Typeset the label for a chapter or appendix for the short contents.
  5737. % The arg is, e.g., `A' for an appendix, or `3' for a chapter.
  5738. %
  5739. \def\shortchaplabel#1{%
  5740. % This space should be enough, since a single number is .5em, and the
  5741. % widest letter (M) is 1em, at least in the Computer Modern fonts.
  5742. % But use \hss just in case.
  5743. % (This space doesn't include the extra space that gets added after
  5744. % the label; that gets put in by \shortchapentry above.)
  5745. %
  5746. % We'd like to right-justify chapter numbers, but that looks strange
  5747. % with appendix letters. And right-justifying numbers and
  5748. % left-justifying letters looks strange when there is less than 10
  5749. % chapters. Have to read the whole toc once to know how many chapters
  5750. % there are before deciding ...
  5751. \hbox to 1em{#1\hss}%
  5752. }
  5753. % These macros generate individual entries in the table of contents.
  5754. % The first argument is the chapter or section name.
  5755. % The last argument is the page number.
  5756. % The arguments in between are the chapter number, section number, ...
  5757. % Parts, in the main contents. Replace the part number, which doesn't
  5758. % exist, with an empty box. Let's hope all the numbers have the same width.
  5759. % Also ignore the page number, which is conventionally not printed.
  5760. \def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}}
  5761. \def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}}
  5762. %
  5763. % Parts, in the short toc.
  5764. \def\shortpartentry#1#2#3#4{%
  5765. \penalty-300
  5766. \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip
  5767. \shortchapentry{{\bf #1}}{\numeralbox}{}{}%
  5768. }
  5769. % Chapters, in the main contents.
  5770. \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
  5771. %
  5772. % Chapters, in the short toc.
  5773. % See comments in \dochapentry re vbox and related settings.
  5774. \def\shortchapentry#1#2#3#4{%
  5775. \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}%
  5776. }
  5777. % Appendices, in the main contents.
  5778. % Need the word Appendix, and a fixed-size box.
  5779. %
  5780. \def\appendixbox#1{%
  5781. % We use M since it's probably the widest letter.
  5782. \setbox0 = \hbox{\putwordAppendix{} M}%
  5783. \hbox to \wd0{\putwordAppendix{} #1\hss}}
  5784. %
  5785. \def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}}
  5786. % Unnumbered chapters.
  5787. \def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}
  5788. \def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}}
  5789. % Sections.
  5790. \def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}}
  5791. \let\appsecentry=\numsecentry
  5792. \def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}}
  5793. % Subsections.
  5794. \def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}}
  5795. \let\appsubsecentry=\numsubsecentry
  5796. \def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}
  5797. % And subsubsections.
  5798. \def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}}
  5799. \let\appsubsubsecentry=\numsubsubsecentry
  5800. \def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}}
  5801. % This parameter controls the indentation of the various levels.
  5802. % Same as \defaultparindent.
  5803. \newdimen\tocindent \tocindent = 15pt
  5804. % Now for the actual typesetting. In all these, #1 is the text and #2 is the
  5805. % page number.
  5806. %
  5807. % If the toc has to be broken over pages, we want it to be at chapters
  5808. % if at all possible; hence the \penalty.
  5809. \def\dochapentry#1#2{%
  5810. \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
  5811. \begingroup
  5812. \chapentryfonts
  5813. \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  5814. \endgroup
  5815. \nobreak\vskip .25\baselineskip plus.1\baselineskip
  5816. }
  5817. \def\dosecentry#1#2{\begingroup
  5818. \secentryfonts \leftskip=\tocindent
  5819. \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  5820. \endgroup}
  5821. \def\dosubsecentry#1#2{\begingroup
  5822. \subsecentryfonts \leftskip=2\tocindent
  5823. \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  5824. \endgroup}
  5825. \def\dosubsubsecentry#1#2{\begingroup
  5826. \subsubsecentryfonts \leftskip=3\tocindent
  5827. \tocentry{#1}{\dopageno\bgroup#2\egroup}%
  5828. \endgroup}
  5829. % We use the same \entry macro as for the index entries.
  5830. \let\tocentry = \entry
  5831. % Space between chapter (or whatever) number and the title.
  5832. \def\labelspace{\hskip1em \relax}
  5833. \def\dopageno#1{{\rm #1}}
  5834. \def\doshortpageno#1{{\rm #1}}
  5835. \def\chapentryfonts{\secfonts \rm}
  5836. \def\secentryfonts{\textfonts}
  5837. \def\subsecentryfonts{\textfonts}
  5838. \def\subsubsecentryfonts{\textfonts}
  5839. \message{environments,}
  5840. % @foo ... @end foo.
  5841. % @tex ... @end tex escapes into raw TeX temporarily.
  5842. % One exception: @ is still an escape character, so that @end tex works.
  5843. % But \@ or @@ will get a plain @ character.
  5844. \envdef\tex{%
  5845. \setupmarkupstyle{tex}%
  5846. \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
  5847. \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
  5848. \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
  5849. \catcode `\%=14
  5850. \catcode `\+=\other
  5851. \catcode `\"=\other
  5852. \catcode `\|=\other
  5853. \catcode `\<=\other
  5854. \catcode `\>=\other
  5855. \catcode `\`=\other
  5856. \catcode `\'=\other
  5857. \escapechar=`\\
  5858. %
  5859. % ' is active in math mode (mathcode"8000). So reset it, and all our
  5860. % other math active characters (just in case), to plain's definitions.
  5861. \mathactive
  5862. %
  5863. \let\b=\ptexb
  5864. \let\bullet=\ptexbullet
  5865. \let\c=\ptexc
  5866. \let\,=\ptexcomma
  5867. \let\.=\ptexdot
  5868. \let\dots=\ptexdots
  5869. \let\equiv=\ptexequiv
  5870. \let\!=\ptexexclam
  5871. \let\i=\ptexi
  5872. \let\indent=\ptexindent
  5873. \let\noindent=\ptexnoindent
  5874. \let\{=\ptexlbrace
  5875. \let\+=\tabalign
  5876. \let\}=\ptexrbrace
  5877. \let\/=\ptexslash
  5878. \let\*=\ptexstar
  5879. \let\t=\ptext
  5880. \expandafter \let\csname top\endcsname=\ptextop % we've made it outer
  5881. \let\frenchspacing=\plainfrenchspacing
  5882. %
  5883. \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
  5884. \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
  5885. \def\@{@}%
  5886. }
  5887. % There is no need to define \Etex.
  5888. % Define @lisp ... @end lisp.
  5889. % @lisp environment forms a group so it can rebind things,
  5890. % including the definition of @end lisp (which normally is erroneous).
  5891. % Amount to narrow the margins by for @lisp.
  5892. \newskip\lispnarrowing \lispnarrowing=0.4in
  5893. % This is the definition that ^^M gets inside @lisp, @example, and other
  5894. % such environments. \null is better than a space, since it doesn't
  5895. % have any width.
  5896. \def\lisppar{\null\endgraf}
  5897. % This space is always present above and below environments.
  5898. \newskip\envskipamount \envskipamount = 0pt
  5899. % Make spacing and below environment symmetrical. We use \parskip here
  5900. % to help in doing that, since in @example-like environments \parskip
  5901. % is reset to zero; thus the \afterenvbreak inserts no space -- but the
  5902. % start of the next paragraph will insert \parskip.
  5903. %
  5904. \def\aboveenvbreak{{%
  5905. % =10000 instead of <10000 because of a special case in \itemzzz and
  5906. % \sectionheading, q.v.
  5907. \ifnum \lastpenalty=10000 \else
  5908. \advance\envskipamount by \parskip
  5909. \endgraf
  5910. \ifdim\lastskip<\envskipamount
  5911. \removelastskip
  5912. % it's not a good place to break if the last penalty was \nobreak
  5913. % or better ...
  5914. \ifnum\lastpenalty<10000 \penalty-50 \fi
  5915. \vskip\envskipamount
  5916. \fi
  5917. \fi
  5918. }}
  5919. \let\afterenvbreak = \aboveenvbreak
  5920. % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will
  5921. % also clear it, so that its embedded environments do the narrowing again.
  5922. \let\nonarrowing=\relax
  5923. % @cartouche ... @end cartouche: draw rectangle w/rounded corners around
  5924. % environment contents.
  5925. \font\circle=lcircle10
  5926. \newdimen\circthick
  5927. \newdimen\cartouter\newdimen\cartinner
  5928. \newskip\normbskip\newskip\normpskip\newskip\normlskip
  5929. \circthick=\fontdimen8\circle
  5930. %
  5931. \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
  5932. \def\ctr{{\hskip 6pt\circle\char'010}}
  5933. \def\cbl{{\circle\char'012\hskip -6pt}}
  5934. \def\cbr{{\hskip 6pt\circle\char'011}}
  5935. \def\carttop{\hbox to \cartouter{\hskip\lskip
  5936. \ctl\leaders\hrule height\circthick\hfil\ctr
  5937. \hskip\rskip}}
  5938. \def\cartbot{\hbox to \cartouter{\hskip\lskip
  5939. \cbl\leaders\hrule height\circthick\hfil\cbr
  5940. \hskip\rskip}}
  5941. %
  5942. \newskip\lskip\newskip\rskip
  5943. \envdef\cartouche{%
  5944. \ifhmode\par\fi % can't be in the midst of a paragraph.
  5945. \startsavinginserts
  5946. \lskip=\leftskip \rskip=\rightskip
  5947. \leftskip=0pt\rightskip=0pt % we want these *outside*.
  5948. \cartinner=\hsize \advance\cartinner by-\lskip
  5949. \advance\cartinner by-\rskip
  5950. \cartouter=\hsize
  5951. \advance\cartouter by 18.4pt % allow for 3pt kerns on either
  5952. % side, and for 6pt waste from
  5953. % each corner char, and rule thickness
  5954. \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
  5955. % Flag to tell @lisp, etc., not to narrow margin.
  5956. \let\nonarrowing = t%
  5957. %
  5958. % If this cartouche directly follows a sectioning command, we need the
  5959. % \parskip glue (backspaced over by default) or the cartouche can
  5960. % collide with the section heading.
  5961. \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi
  5962. %
  5963. \vbox\bgroup
  5964. \baselineskip=0pt\parskip=0pt\lineskip=0pt
  5965. \carttop
  5966. \hbox\bgroup
  5967. \hskip\lskip
  5968. \vrule\kern3pt
  5969. \vbox\bgroup
  5970. \kern3pt
  5971. \hsize=\cartinner
  5972. \baselineskip=\normbskip
  5973. \lineskip=\normlskip
  5974. \parskip=\normpskip
  5975. \vskip -\parskip
  5976. \comment % For explanation, see the end of def\group.
  5977. }
  5978. \def\Ecartouche{%
  5979. \ifhmode\par\fi
  5980. \kern3pt
  5981. \egroup
  5982. \kern3pt\vrule
  5983. \hskip\rskip
  5984. \egroup
  5985. \cartbot
  5986. \egroup
  5987. \checkinserts
  5988. }
  5989. % This macro is called at the beginning of all the @example variants,
  5990. % inside a group.
  5991. \newdimen\nonfillparindent
  5992. \def\nonfillstart{%
  5993. \aboveenvbreak
  5994. \ifdim\hfuzz < 12pt \hfuzz = 12pt \fi % Don't be fussy
  5995. \sepspaces % Make spaces be word-separators rather than space tokens.
  5996. \let\par = \lisppar % don't ignore blank lines
  5997. \obeylines % each line of input is a line of output
  5998. \parskip = 0pt
  5999. % Turn off paragraph indentation but redefine \indent to emulate
  6000. % the normal \indent.
  6001. \nonfillparindent=\parindent
  6002. \parindent = 0pt
  6003. \let\indent\nonfillindent
  6004. %
  6005. \emergencystretch = 0pt % don't try to avoid overfull boxes
  6006. \ifx\nonarrowing\relax
  6007. \advance \leftskip by \lispnarrowing
  6008. \exdentamount=\lispnarrowing
  6009. \else
  6010. \let\nonarrowing = \relax
  6011. \fi
  6012. \let\exdent=\nofillexdent
  6013. }
  6014. \begingroup
  6015. \obeyspaces
  6016. % We want to swallow spaces (but not other tokens) after the fake
  6017. % @indent in our nonfill-environments, where spaces are normally
  6018. % active and set to @tie, resulting in them not being ignored after
  6019. % @indent.
  6020. \gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}%
  6021. \gdef\nonfillindentcheck{%
  6022. \ifx\temp %
  6023. \expandafter\nonfillindentgobble%
  6024. \else%
  6025. \leavevmode\nonfillindentbox%
  6026. \fi%
  6027. }%
  6028. \endgroup
  6029. \def\nonfillindentgobble#1{\nonfillindent}
  6030. \def\nonfillindentbox{\hbox to \nonfillparindent{\hss}}
  6031. % If you want all examples etc. small: @set dispenvsize small.
  6032. % If you want even small examples the full size: @set dispenvsize nosmall.
  6033. % This affects the following displayed environments:
  6034. % @example, @display, @format, @lisp
  6035. %
  6036. \def\smallword{small}
  6037. \def\nosmallword{nosmall}
  6038. \let\SETdispenvsize\relax
  6039. \def\setnormaldispenv{%
  6040. \ifx\SETdispenvsize\smallword
  6041. % end paragraph for sake of leading, in case document has no blank
  6042. % line. This is redundant with what happens in \aboveenvbreak, but
  6043. % we need to do it before changing the fonts, and it's inconvenient
  6044. % to change the fonts afterward.
  6045. \ifnum \lastpenalty=10000 \else \endgraf \fi
  6046. \smallexamplefonts \rm
  6047. \fi
  6048. }
  6049. \def\setsmalldispenv{%
  6050. \ifx\SETdispenvsize\nosmallword
  6051. \else
  6052. \ifnum \lastpenalty=10000 \else \endgraf \fi
  6053. \smallexamplefonts \rm
  6054. \fi
  6055. }
  6056. % We often define two environments, @foo and @smallfoo.
  6057. % Let's do it in one command. #1 is the env name, #2 the definition.
  6058. \def\makedispenvdef#1#2{%
  6059. \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}%
  6060. \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}%
  6061. \expandafter\let\csname E#1\endcsname \afterenvbreak
  6062. \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
  6063. }
  6064. % Define two environment synonyms (#1 and #2) for an environment.
  6065. \def\maketwodispenvdef#1#2#3{%
  6066. \makedispenvdef{#1}{#3}%
  6067. \makedispenvdef{#2}{#3}%
  6068. }
  6069. %
  6070. % @lisp: indented, narrowed, typewriter font;
  6071. % @example: same as @lisp.
  6072. %
  6073. % @smallexample and @smalllisp: use smaller fonts.
  6074. % Originally contributed by Pavel@xerox.
  6075. %
  6076. \maketwodispenvdef{lisp}{example}{%
  6077. \nonfillstart
  6078. \tt\setupmarkupstyle{example}%
  6079. \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
  6080. \gobble % eat return
  6081. }
  6082. % @display/@smalldisplay: same as @lisp except keep current font.
  6083. %
  6084. \makedispenvdef{display}{%
  6085. \nonfillstart
  6086. \gobble
  6087. }
  6088. % @format/@smallformat: same as @display except don't narrow margins.
  6089. %
  6090. \makedispenvdef{format}{%
  6091. \let\nonarrowing = t%
  6092. \nonfillstart
  6093. \gobble
  6094. }
  6095. % @flushleft: same as @format, but doesn't obey \SETdispenvsize.
  6096. \envdef\flushleft{%
  6097. \let\nonarrowing = t%
  6098. \nonfillstart
  6099. \gobble
  6100. }
  6101. \let\Eflushleft = \afterenvbreak
  6102. % @flushright.
  6103. %
  6104. \envdef\flushright{%
  6105. \let\nonarrowing = t%
  6106. \nonfillstart
  6107. \advance\leftskip by 0pt plus 1fill\relax
  6108. \gobble
  6109. }
  6110. \let\Eflushright = \afterenvbreak
  6111. % @raggedright does more-or-less normal line breaking but no right
  6112. % justification. From plain.tex.
  6113. \envdef\raggedright{%
  6114. \rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax
  6115. }
  6116. \let\Eraggedright\par
  6117. \envdef\raggedleft{%
  6118. \parindent=0pt \leftskip0pt plus2em
  6119. \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
  6120. \hbadness=10000 % Last line will usually be underfull, so turn off
  6121. % badness reporting.
  6122. }
  6123. \let\Eraggedleft\par
  6124. \envdef\raggedcenter{%
  6125. \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em
  6126. \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
  6127. \hbadness=10000 % Last line will usually be underfull, so turn off
  6128. % badness reporting.
  6129. }
  6130. \let\Eraggedcenter\par
  6131. % @quotation does normal linebreaking (hence we can't use \nonfillstart)
  6132. % and narrows the margins. We keep \parskip nonzero in general, since
  6133. % we're doing normal filling. So, when using \aboveenvbreak and
  6134. % \afterenvbreak, temporarily make \parskip 0.
  6135. %
  6136. \makedispenvdef{quotation}{\quotationstart}
  6137. %
  6138. \def\quotationstart{%
  6139. \indentedblockstart % same as \indentedblock, but increase right margin too.
  6140. \ifx\nonarrowing\relax
  6141. \advance\rightskip by \lispnarrowing
  6142. \fi
  6143. \parsearg\quotationlabel
  6144. }
  6145. % We have retained a nonzero parskip for the environment, since we're
  6146. % doing normal filling.
  6147. %
  6148. \def\Equotation{%
  6149. \par
  6150. \ifx\quotationauthor\thisisundefined\else
  6151. % indent a bit.
  6152. \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
  6153. \fi
  6154. {\parskip=0pt \afterenvbreak}%
  6155. }
  6156. \def\Esmallquotation{\Equotation}
  6157. % If we're given an argument, typeset it in bold with a colon after.
  6158. \def\quotationlabel#1{%
  6159. \def\temp{#1}%
  6160. \ifx\temp\empty \else
  6161. {\bf #1: }%
  6162. \fi
  6163. }
  6164. % @indentedblock is like @quotation, but indents only on the left and
  6165. % has no optional argument.
  6166. %
  6167. \makedispenvdef{indentedblock}{\indentedblockstart}
  6168. %
  6169. \def\indentedblockstart{%
  6170. {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
  6171. \parindent=0pt
  6172. %
  6173. % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
  6174. \ifx\nonarrowing\relax
  6175. \advance\leftskip by \lispnarrowing
  6176. \exdentamount = \lispnarrowing
  6177. \else
  6178. \let\nonarrowing = \relax
  6179. \fi
  6180. }
  6181. % Keep a nonzero parskip for the environment, since we're doing normal filling.
  6182. %
  6183. \def\Eindentedblock{%
  6184. \par
  6185. {\parskip=0pt \afterenvbreak}%
  6186. }
  6187. \def\Esmallindentedblock{\Eindentedblock}
  6188. % LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
  6189. % If we want to allow any <char> as delimiter,
  6190. % we need the curly braces so that makeinfo sees the @verb command, eg:
  6191. % `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
  6192. %
  6193. % [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
  6194. %
  6195. % [Knuth] p.344; only we need to do the other characters Texinfo sets
  6196. % active too. Otherwise, they get lost as the first character on a
  6197. % verbatim line.
  6198. \def\dospecials{%
  6199. \do\ \do\\\do\{\do\}\do\$\do\&%
  6200. \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
  6201. \do\<\do\>\do\|\do\@\do+\do\"%
  6202. % Don't do the quotes -- if we do, @set txicodequoteundirected and
  6203. % @set txicodequotebacktick will not have effect on @verb and
  6204. % @verbatim, and ?` and !` ligatures won't get disabled.
  6205. %\do\`\do\'%
  6206. }
  6207. %
  6208. % [Knuth] p. 380
  6209. \def\uncatcodespecials{%
  6210. \def\do##1{\catcode`##1=\other}\dospecials}
  6211. %
  6212. % Setup for the @verb command.
  6213. %
  6214. % Eight spaces for a tab
  6215. \begingroup
  6216. \catcode`\^^I=\active
  6217. \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
  6218. \endgroup
  6219. %
  6220. \def\setupverb{%
  6221. \tt % easiest (and conventionally used) font for verbatim
  6222. \def\par{\leavevmode\endgraf}%
  6223. \setupmarkupstyle{verb}%
  6224. \tabeightspaces
  6225. % Respect line breaks,
  6226. % print special symbols as themselves, and
  6227. % make each space count
  6228. % must do in this order:
  6229. \obeylines \uncatcodespecials \sepspaces
  6230. }
  6231. % Setup for the @verbatim environment
  6232. %
  6233. % Real tab expansion.
  6234. \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
  6235. %
  6236. % We typeset each line of the verbatim in an \hbox, so we can handle
  6237. % tabs. The \global is in case the verbatim line starts with an accent,
  6238. % or some other command that starts with a begin-group. Otherwise, the
  6239. % entire \verbbox would disappear at the corresponding end-group, before
  6240. % it is typeset. Meanwhile, we can't have nested verbatim commands
  6241. % (can we?), so the \global won't be overwriting itself.
  6242. \newbox\verbbox
  6243. \def\starttabbox{\global\setbox\verbbox=\hbox\bgroup}
  6244. %
  6245. \begingroup
  6246. \catcode`\^^I=\active
  6247. \gdef\tabexpand{%
  6248. \catcode`\^^I=\active
  6249. \def^^I{\leavevmode\egroup
  6250. \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab
  6251. \divide\dimen\verbbox by\tabw
  6252. \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw
  6253. \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw
  6254. \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox
  6255. }%
  6256. }
  6257. \endgroup
  6258. % start the verbatim environment.
  6259. \def\setupverbatim{%
  6260. \let\nonarrowing = t%
  6261. \nonfillstart
  6262. \tt % easiest (and conventionally used) font for verbatim
  6263. % The \leavevmode here is for blank lines. Otherwise, we would
  6264. % never \starttabox and the \egroup would end verbatim mode.
  6265. \def\par{\leavevmode\egroup\box\verbbox\endgraf}%
  6266. \tabexpand
  6267. \setupmarkupstyle{verbatim}%
  6268. % Respect line breaks,
  6269. % print special symbols as themselves, and
  6270. % make each space count.
  6271. % Must do in this order:
  6272. \obeylines \uncatcodespecials \sepspaces
  6273. \everypar{\starttabbox}%
  6274. }
  6275. % Do the @verb magic: verbatim text is quoted by unique
  6276. % delimiter characters. Before first delimiter expect a
  6277. % right brace, after last delimiter expect closing brace:
  6278. %
  6279. % \def\doverb'{'<char>#1<char>'}'{#1}
  6280. %
  6281. % [Knuth] p. 382; only eat outer {}
  6282. \begingroup
  6283. \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other
  6284. \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
  6285. \endgroup
  6286. %
  6287. \def\verb{\begingroup\setupverb\doverb}
  6288. %
  6289. %
  6290. % Do the @verbatim magic: define the macro \doverbatim so that
  6291. % the (first) argument ends when '@end verbatim' is reached, ie:
  6292. %
  6293. % \def\doverbatim#1@end verbatim{#1}
  6294. %
  6295. % For Texinfo it's a lot easier than for LaTeX,
  6296. % because texinfo's \verbatim doesn't stop at '\end{verbatim}':
  6297. % we need not redefine '\', '{' and '}'.
  6298. %
  6299. % Inspired by LaTeX's verbatim command set [latex.ltx]
  6300. %
  6301. \begingroup
  6302. \catcode`\ =\active
  6303. \obeylines %
  6304. % ignore everything up to the first ^^M, that's the newline at the end
  6305. % of the @verbatim input line itself. Otherwise we get an extra blank
  6306. % line in the output.
  6307. \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}%
  6308. % We really want {...\end verbatim} in the body of the macro, but
  6309. % without the active space; thus we have to use \xdef and \gobble.
  6310. \endgroup
  6311. %
  6312. \envdef\verbatim{%
  6313. \setupverbatim\doverbatim
  6314. }
  6315. \let\Everbatim = \afterenvbreak
  6316. % @verbatiminclude FILE - insert text of file in verbatim environment.
  6317. %
  6318. \def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude}
  6319. %
  6320. \def\doverbatiminclude#1{%
  6321. {%
  6322. \makevalueexpandable
  6323. \setupverbatim
  6324. \indexnofonts % Allow `@@' and other weird things in file names.
  6325. \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
  6326. \input #1
  6327. \afterenvbreak
  6328. }%
  6329. }
  6330. % @copying ... @end copying.
  6331. % Save the text away for @insertcopying later.
  6332. %
  6333. % We save the uninterpreted tokens, rather than creating a box.
  6334. % Saving the text in a box would be much easier, but then all the
  6335. % typesetting commands (@smallbook, font changes, etc.) have to be done
  6336. % beforehand -- and a) we want @copying to be done first in the source
  6337. % file; b) letting users define the frontmatter in as flexible order as
  6338. % possible is very desirable.
  6339. %
  6340. \def\copying{\checkenv{}\begingroup\scanargctxt\docopying}
  6341. \def\docopying#1@end copying{\endgroup\def\copyingtext{#1}}
  6342. %
  6343. \def\insertcopying{%
  6344. \begingroup
  6345. \parindent = 0pt % paragraph indentation looks wrong on title page
  6346. \scanexp\copyingtext
  6347. \endgroup
  6348. }
  6349. \message{defuns,}
  6350. % @defun etc.
  6351. \newskip\defbodyindent \defbodyindent=.4in
  6352. \newskip\defargsindent \defargsindent=50pt
  6353. \newskip\deflastargmargin \deflastargmargin=18pt
  6354. \newcount\defunpenalty
  6355. % Start the processing of @deffn:
  6356. \def\startdefun{%
  6357. \ifnum\lastpenalty<10000
  6358. \medbreak
  6359. \defunpenalty=10003 % Will keep this @deffn together with the
  6360. % following @def command, see below.
  6361. \else
  6362. % If there are two @def commands in a row, we'll have a \nobreak,
  6363. % which is there to keep the function description together with its
  6364. % header. But if there's nothing but headers, we need to allow a
  6365. % break somewhere. Check specifically for penalty 10002, inserted
  6366. % by \printdefunline, instead of 10000, since the sectioning
  6367. % commands also insert a nobreak penalty, and we don't want to allow
  6368. % a break between a section heading and a defun.
  6369. %
  6370. % As a further refinement, we avoid "club" headers by signalling
  6371. % with penalty of 10003 after the very first @deffn in the
  6372. % sequence (see above), and penalty of 10002 after any following
  6373. % @def command.
  6374. \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi
  6375. %
  6376. % Similarly, after a section heading, do not allow a break.
  6377. % But do insert the glue.
  6378. \medskip % preceded by discardable penalty, so not a breakpoint
  6379. \fi
  6380. %
  6381. \parindent=0in
  6382. \advance\leftskip by \defbodyindent
  6383. \exdentamount=\defbodyindent
  6384. }
  6385. \def\dodefunx#1{%
  6386. % First, check whether we are in the right environment:
  6387. \checkenv#1%
  6388. %
  6389. % As above, allow line break if we have multiple x headers in a row.
  6390. % It's not a great place, though.
  6391. \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi
  6392. %
  6393. % And now, it's time to reuse the body of the original defun:
  6394. \expandafter\gobbledefun#1%
  6395. }
  6396. \def\gobbledefun#1\startdefun{}
  6397. % \printdefunline \deffnheader{text}
  6398. %
  6399. \def\printdefunline#1#2{%
  6400. \begingroup
  6401. % call \deffnheader:
  6402. #1#2 \endheader
  6403. % common ending:
  6404. \interlinepenalty = 10000
  6405. \advance\rightskip by 0pt plus 1fil\relax
  6406. \endgraf
  6407. \nobreak\vskip -\parskip
  6408. \penalty\defunpenalty % signal to \startdefun and \dodefunx
  6409. % Some of the @defun-type tags do not enable magic parentheses,
  6410. % rendering the following check redundant. But we don't optimize.
  6411. \checkparencounts
  6412. \endgroup
  6413. }
  6414. \def\Edefun{\endgraf\medbreak}
  6415. % \makedefun{deffn} creates \deffn, \deffnx and \Edeffn;
  6416. % the only thing remaining is to define \deffnheader.
  6417. %
  6418. \def\makedefun#1{%
  6419. \expandafter\let\csname E#1\endcsname = \Edefun
  6420. \edef\temp{\noexpand\domakedefun
  6421. \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}%
  6422. \temp
  6423. }
  6424. % \domakedefun \deffn \deffnx \deffnheader
  6425. %
  6426. % Define \deffn and \deffnx, without parameters.
  6427. % \deffnheader has to be defined explicitly.
  6428. %
  6429. \def\domakedefun#1#2#3{%
  6430. \envdef#1{%
  6431. \startdefun
  6432. \doingtypefnfalse % distinguish typed functions from all else
  6433. \parseargusing\activeparens{\printdefunline#3}%
  6434. }%
  6435. \def#2{\dodefunx#1}%
  6436. \def#3%
  6437. }
  6438. \newif\ifdoingtypefn % doing typed function?
  6439. \newif\ifrettypeownline % typeset return type on its own line?
  6440. % @deftypefnnewline on|off says whether the return type of typed functions
  6441. % are printed on their own line. This affects @deftypefn, @deftypefun,
  6442. % @deftypeop, and @deftypemethod.
  6443. %
  6444. \parseargdef\deftypefnnewline{%
  6445. \def\temp{#1}%
  6446. \ifx\temp\onword
  6447. \expandafter\let\csname SETtxideftypefnnl\endcsname
  6448. = \empty
  6449. \else\ifx\temp\offword
  6450. \expandafter\let\csname SETtxideftypefnnl\endcsname
  6451. = \relax
  6452. \else
  6453. \errhelp = \EMsimple
  6454. \errmessage{Unknown @txideftypefnnl value `\temp',
  6455. must be on|off}%
  6456. \fi\fi
  6457. }
  6458. % Untyped functions:
  6459. % @deffn category name args
  6460. \makedefun{deffn}{\deffngeneral{}}
  6461. % @deffn category class name args
  6462. \makedefun{defop}#1 {\defopon{#1\ \putwordon}}
  6463. % \defopon {category on}class name args
  6464. \def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
  6465. % \deffngeneral {subind}category name args
  6466. %
  6467. \def\deffngeneral#1#2 #3 #4\endheader{%
  6468. % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}.
  6469. \dosubind{fn}{\code{#3}}{#1}%
  6470. \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
  6471. }
  6472. % Typed functions:
  6473. % @deftypefn category type name args
  6474. \makedefun{deftypefn}{\deftypefngeneral{}}
  6475. % @deftypeop category class type name args
  6476. \makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}}
  6477. % \deftypeopon {category on}class type name args
  6478. \def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
  6479. % \deftypefngeneral {subind}category type name args
  6480. %
  6481. \def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
  6482. \dosubind{fn}{\code{#4}}{#1}%
  6483. \doingtypefntrue
  6484. \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
  6485. }
  6486. % Typed variables:
  6487. % @deftypevr category type var args
  6488. \makedefun{deftypevr}{\deftypecvgeneral{}}
  6489. % @deftypecv category class type var args
  6490. \makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}}
  6491. % \deftypecvof {category of}class type var args
  6492. \def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} }
  6493. % \deftypecvgeneral {subind}category type var args
  6494. %
  6495. \def\deftypecvgeneral#1#2 #3 #4 #5\endheader{%
  6496. \dosubind{vr}{\code{#4}}{#1}%
  6497. \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
  6498. }
  6499. % Untyped variables:
  6500. % @defvr category var args
  6501. \makedefun{defvr}#1 {\deftypevrheader{#1} {} }
  6502. % @defcv category class var args
  6503. \makedefun{defcv}#1 {\defcvof{#1\ \putwordof}}
  6504. % \defcvof {category of}class var args
  6505. \def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
  6506. % Types:
  6507. % @deftp category name args
  6508. \makedefun{deftp}#1 #2 #3\endheader{%
  6509. \doind{tp}{\code{#2}}%
  6510. \defname{#1}{}{#2}\defunargs{#3\unskip}%
  6511. }
  6512. % Remaining @defun-like shortcuts:
  6513. \makedefun{defun}{\deffnheader{\putwordDeffunc} }
  6514. \makedefun{defmac}{\deffnheader{\putwordDefmac} }
  6515. \makedefun{defspec}{\deffnheader{\putwordDefspec} }
  6516. \makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} }
  6517. \makedefun{defvar}{\defvrheader{\putwordDefvar} }
  6518. \makedefun{defopt}{\defvrheader{\putwordDefopt} }
  6519. \makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} }
  6520. \makedefun{defmethod}{\defopon\putwordMethodon}
  6521. \makedefun{deftypemethod}{\deftypeopon\putwordMethodon}
  6522. \makedefun{defivar}{\defcvof\putwordInstanceVariableof}
  6523. \makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof}
  6524. % \defname, which formats the name of the @def (not the args).
  6525. % #1 is the category, such as "Function".
  6526. % #2 is the return type, if any.
  6527. % #3 is the function name.
  6528. %
  6529. % We are followed by (but not passed) the arguments, if any.
  6530. %
  6531. \def\defname#1#2#3{%
  6532. \par
  6533. % Get the values of \leftskip and \rightskip as they were outside the @def...
  6534. \advance\leftskip by -\defbodyindent
  6535. %
  6536. % Determine if we are typesetting the return type of a typed function
  6537. % on a line by itself.
  6538. \rettypeownlinefalse
  6539. \ifdoingtypefn % doing a typed function specifically?
  6540. % then check user option for putting return type on its own line:
  6541. \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else
  6542. \rettypeownlinetrue
  6543. \fi
  6544. \fi
  6545. %
  6546. % How we'll format the category name. Putting it in brackets helps
  6547. % distinguish it from the body text that may end up on the next line
  6548. % just below it.
  6549. \def\temp{#1}%
  6550. \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
  6551. %
  6552. % Figure out line sizes for the paragraph shape. We'll always have at
  6553. % least two.
  6554. \tempnum = 2
  6555. %
  6556. % The first line needs space for \box0; but if \rightskip is nonzero,
  6557. % we need only space for the part of \box0 which exceeds it:
  6558. \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip
  6559. %
  6560. % If doing a return type on its own line, we'll have another line.
  6561. \ifrettypeownline
  6562. \advance\tempnum by 1
  6563. \def\maybeshapeline{0in \hsize}%
  6564. \else
  6565. \def\maybeshapeline{}%
  6566. \fi
  6567. %
  6568. % The continuations:
  6569. \dimen2=\hsize \advance\dimen2 by -\defargsindent
  6570. %
  6571. % The final paragraph shape:
  6572. \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2
  6573. %
  6574. % Put the category name at the right margin.
  6575. \noindent
  6576. \hbox to 0pt{%
  6577. \hfil\box0 \kern-\hsize
  6578. % \hsize has to be shortened this way:
  6579. \kern\leftskip
  6580. % Intentionally do not respect \rightskip, since we need the space.
  6581. }%
  6582. %
  6583. % Allow all lines to be underfull without complaint:
  6584. \tolerance=10000 \hbadness=10000
  6585. \exdentamount=\defbodyindent
  6586. {%
  6587. % defun fonts. We use typewriter by default (used to be bold) because:
  6588. % . we're printing identifiers, they should be in tt in principle.
  6589. % . in languages with many accents, such as Czech or French, it's
  6590. % common to leave accents off identifiers. The result looks ok in
  6591. % tt, but exceedingly strange in rm.
  6592. % . we don't want -- and --- to be treated as ligatures.
  6593. % . this still does not fix the ?` and !` ligatures, but so far no
  6594. % one has made identifiers using them :).
  6595. \df \tt
  6596. \def\temp{#2}% text of the return type
  6597. \ifx\temp\empty\else
  6598. \tclose{\temp}% typeset the return type
  6599. \ifrettypeownline
  6600. % put return type on its own line; prohibit line break following:
  6601. \hfil\vadjust{\nobreak}\break
  6602. \else
  6603. \space % type on same line, so just followed by a space
  6604. \fi
  6605. \fi % no return type
  6606. #3% output function name
  6607. }%
  6608. {\rm\enskip}% hskip 0.5 em of \tenrm
  6609. %
  6610. \boldbrax
  6611. % arguments will be output next, if any.
  6612. }
  6613. % Print arguments in slanted roman (not ttsl), inconsistently with using
  6614. % tt for the name. This is because literal text is sometimes needed in
  6615. % the argument list (groff manual), and ttsl and tt are not very
  6616. % distinguishable. Prevent hyphenation at `-' chars.
  6617. %
  6618. \def\defunargs#1{%
  6619. % use sl by default (not ttsl),
  6620. % tt for the names.
  6621. \df \sl \hyphenchar\font=0
  6622. %
  6623. % On the other hand, if an argument has two dashes (for instance), we
  6624. % want a way to get ttsl. We used to recommend @var for that, so
  6625. % leave the code in, but it's strange for @var to lead to typewriter.
  6626. % Nowadays we recommend @code, since the difference between a ttsl hyphen
  6627. % and a tt hyphen is pretty tiny. @code also disables ?` !`.
  6628. \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}%
  6629. #1%
  6630. \sl\hyphenchar\font=45
  6631. }
  6632. % We want ()&[] to print specially on the defun line.
  6633. %
  6634. \def\activeparens{%
  6635. \catcode`\(=\active \catcode`\)=\active
  6636. \catcode`\[=\active \catcode`\]=\active
  6637. \catcode`\&=\active
  6638. }
  6639. % Make control sequences which act like normal parenthesis chars.
  6640. \let\lparen = ( \let\rparen = )
  6641. % Be sure that we always have a definition for `(', etc. For example,
  6642. % if the fn name has parens in it, \boldbrax will not be in effect yet,
  6643. % so TeX would otherwise complain about undefined control sequence.
  6644. {
  6645. \activeparens
  6646. \global\let(=\lparen \global\let)=\rparen
  6647. \global\let[=\lbrack \global\let]=\rbrack
  6648. \global\let& = \&
  6649. \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
  6650. \gdef\magicamp{\let&=\amprm}
  6651. }
  6652. \newcount\parencount
  6653. % If we encounter &foo, then turn on ()-hacking afterwards
  6654. \newif\ifampseen
  6655. \def\amprm#1 {\ampseentrue{\bf\&#1 }}
  6656. \def\parenfont{%
  6657. \ifampseen
  6658. % At the first level, print parens in roman,
  6659. % otherwise use the default font.
  6660. \ifnum \parencount=1 \rm \fi
  6661. \else
  6662. % The \sf parens (in \boldbrax) actually are a little bolder than
  6663. % the contained text. This is especially needed for [ and ] .
  6664. \sf
  6665. \fi
  6666. }
  6667. \def\infirstlevel#1{%
  6668. \ifampseen
  6669. \ifnum\parencount=1
  6670. #1%
  6671. \fi
  6672. \fi
  6673. }
  6674. \def\bfafterword#1 {#1 \bf}
  6675. \def\opnr{%
  6676. \global\advance\parencount by 1
  6677. {\parenfont(}%
  6678. \infirstlevel \bfafterword
  6679. }
  6680. \def\clnr{%
  6681. {\parenfont)}%
  6682. \infirstlevel \sl
  6683. \global\advance\parencount by -1
  6684. }
  6685. \newcount\brackcount
  6686. \def\lbrb{%
  6687. \global\advance\brackcount by 1
  6688. {\bf[}%
  6689. }
  6690. \def\rbrb{%
  6691. {\bf]}%
  6692. \global\advance\brackcount by -1
  6693. }
  6694. \def\checkparencounts{%
  6695. \ifnum\parencount=0 \else \badparencount \fi
  6696. \ifnum\brackcount=0 \else \badbrackcount \fi
  6697. }
  6698. % these should not use \errmessage; the glibc manual, at least, actually
  6699. % has such constructs (when documenting function pointers).
  6700. \def\badparencount{%
  6701. \message{Warning: unbalanced parentheses in @def...}%
  6702. \global\parencount=0
  6703. }
  6704. \def\badbrackcount{%
  6705. \message{Warning: unbalanced square brackets in @def...}%
  6706. \global\brackcount=0
  6707. }
  6708. \message{macros,}
  6709. % @macro.
  6710. % To do this right we need a feature of e-TeX, \scantokens,
  6711. % which we arrange to emulate with a temporary file in ordinary TeX.
  6712. \ifx\eTeXversion\thisisundefined
  6713. \newwrite\macscribble
  6714. \def\scantokens#1{%
  6715. \toks0={#1}%
  6716. \immediate\openout\macscribble=\jobname.tmp
  6717. \immediate\write\macscribble{\the\toks0}%
  6718. \immediate\closeout\macscribble
  6719. \input \jobname.tmp
  6720. }
  6721. \fi
  6722. \def\scanmacro#1{\begingroup
  6723. \newlinechar`\^^M
  6724. \let\xeatspaces\eatspaces
  6725. %
  6726. % Undo catcode changes of \startcontents and \doprintindex
  6727. % When called from @insertcopying or (short)caption, we need active
  6728. % backslash to get it printed correctly. Previously, we had
  6729. % \catcode`\\=\other instead. We'll see whether a problem appears
  6730. % with macro expansion. --kasal, 19aug04
  6731. \catcode`\@=0 \catcode`\\=\active \escapechar=`\@
  6732. %
  6733. % ... and for \example:
  6734. \spaceisspace
  6735. %
  6736. % The \empty here causes a following catcode 5 newline to be eaten as
  6737. % part of reading whitespace after a control sequence. It does not
  6738. % eat a catcode 13 newline. There's no good way to handle the two
  6739. % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX
  6740. % would then have different behavior). See the Macro Details node in
  6741. % the manual for the workaround we recommend for macros and
  6742. % line-oriented commands.
  6743. %
  6744. \scantokens{#1\empty}%
  6745. \endgroup}
  6746. \def\scanexp#1{%
  6747. \edef\temp{\noexpand\scanmacro{#1}}%
  6748. \temp
  6749. }
  6750. \newcount\paramno % Count of parameters
  6751. \newtoks\macname % Macro name
  6752. \newif\ifrecursive % Is it recursive?
  6753. % List of all defined macros in the form
  6754. % \definedummyword\macro1\definedummyword\macro2...
  6755. % Currently is also contains all @aliases; the list can be split
  6756. % if there is a need.
  6757. \def\macrolist{}
  6758. % Add the macro to \macrolist
  6759. \def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname}
  6760. \def\addtomacrolistxxx#1{%
  6761. \toks0 = \expandafter{\macrolist\definedummyword#1}%
  6762. \xdef\macrolist{\the\toks0}%
  6763. }
  6764. % Utility routines.
  6765. % This does \let #1 = #2, with \csnames; that is,
  6766. % \let \csname#1\endcsname = \csname#2\endcsname
  6767. % (except of course we have to play expansion games).
  6768. %
  6769. \def\cslet#1#2{%
  6770. \expandafter\let
  6771. \csname#1\expandafter\endcsname
  6772. \csname#2\endcsname
  6773. }
  6774. % Trim leading and trailing spaces off a string.
  6775. % Concepts from aro-bend problem 15 (see CTAN).
  6776. {\catcode`\@=11
  6777. \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
  6778. \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
  6779. \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
  6780. \def\unbrace#1{#1}
  6781. \unbrace{\gdef\trim@@@ #1 } #2@{#1}
  6782. }
  6783. % Trim a single trailing ^^M off a string.
  6784. {\catcode`\^^M=\other \catcode`\Q=3%
  6785. \gdef\eatcr #1{\eatcra #1Q^^MQ}%
  6786. \gdef\eatcra#1^^MQ{\eatcrb#1Q}%
  6787. \gdef\eatcrb#1Q#2Q{#1}%
  6788. }
  6789. % Macro bodies are absorbed as an argument in a context where
  6790. % all characters are catcode 10, 11 or 12, except \ which is active
  6791. % (as in normal texinfo). It is necessary to change the definition of \
  6792. % to recognize macro arguments; this is the job of \mbodybackslash.
  6793. %
  6794. % Non-ASCII encodings make 8-bit characters active, so un-activate
  6795. % them to avoid their expansion. Must do this non-globally, to
  6796. % confine the change to the current group.
  6797. %
  6798. % It's necessary to have hard CRs when the macro is executed. This is
  6799. % done by making ^^M (\endlinechar) catcode 12 when reading the macro
  6800. % body, and then making it the \newlinechar in \scanmacro.
  6801. %
  6802. \def\scanctxt{% used as subroutine
  6803. \catcode`\"=\other
  6804. \catcode`\+=\other
  6805. \catcode`\<=\other
  6806. \catcode`\>=\other
  6807. \catcode`\@=\other
  6808. \catcode`\^=\other
  6809. \catcode`\_=\other
  6810. \catcode`\|=\other
  6811. \catcode`\~=\other
  6812. \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi
  6813. }
  6814. \def\scanargctxt{% used for copying and captions, not macros.
  6815. \scanctxt
  6816. \catcode`\\=\other
  6817. \catcode`\^^M=\other
  6818. }
  6819. \def\macrobodyctxt{% used for @macro definitions
  6820. \scanctxt
  6821. \catcode`\{=\other
  6822. \catcode`\}=\other
  6823. \catcode`\^^M=\other
  6824. \usembodybackslash
  6825. }
  6826. \def\macroargctxt{% used when scanning invocations
  6827. \scanctxt
  6828. \catcode`\\=0
  6829. }
  6830. % why catcode 0 for \ in the above? To recognize \\ \{ \} as "escapes"
  6831. % for the single characters \ { }. Thus, we end up with the "commands"
  6832. % that would be written @\ @{ @} in a Texinfo document.
  6833. %
  6834. % We already have @{ and @}. For @\, we define it here, and only for
  6835. % this purpose, to produce a typewriter backslash (so, the @\ that we
  6836. % define for @math can't be used with @macro calls):
  6837. %
  6838. \def\\{\normalbackslash}%
  6839. %
  6840. % We would like to do this for \, too, since that is what makeinfo does.
  6841. % But it is not possible, because Texinfo already has a command @, for a
  6842. % cedilla accent. Documents must use @comma{} instead.
  6843. %
  6844. % \anythingelse will almost certainly be an error of some kind.
  6845. % \mbodybackslash is the definition of \ in @macro bodies.
  6846. % It maps \foo\ => \csname macarg.foo\endcsname => #N
  6847. % where N is the macro parameter number.
  6848. % We define \csname macarg.\endcsname to be \realbackslash, so
  6849. % \\ in macro replacement text gets you a backslash.
  6850. %
  6851. {\catcode`@=0 @catcode`@\=@active
  6852. @gdef@usembodybackslash{@let\=@mbodybackslash}
  6853. @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
  6854. }
  6855. \expandafter\def\csname macarg.\endcsname{\realbackslash}
  6856. \def\margbackslash#1{\char`\#1 }
  6857. \def\macro{\recursivefalse\parsearg\macroxxx}
  6858. \def\rmacro{\recursivetrue\parsearg\macroxxx}
  6859. \def\macroxxx#1{%
  6860. \getargs{#1}% now \macname is the macname and \argl the arglist
  6861. \ifx\argl\empty % no arguments
  6862. \paramno=0\relax
  6863. \else
  6864. \expandafter\parsemargdef \argl;%
  6865. \if\paramno>256\relax
  6866. \ifx\eTeXversion\thisisundefined
  6867. \errhelp = \EMsimple
  6868. \errmessage{You need eTeX to compile a file with macros with more than 256 arguments}
  6869. \fi
  6870. \fi
  6871. \fi
  6872. \if1\csname ismacro.\the\macname\endcsname
  6873. \message{Warning: redefining \the\macname}%
  6874. \else
  6875. \expandafter\ifx\csname \the\macname\endcsname \relax
  6876. \else \errmessage{Macro name \the\macname\space already defined}\fi
  6877. \global\cslet{macsave.\the\macname}{\the\macname}%
  6878. \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
  6879. \addtomacrolist{\the\macname}%
  6880. \fi
  6881. \begingroup \macrobodyctxt
  6882. \ifrecursive \expandafter\parsermacbody
  6883. \else \expandafter\parsemacbody
  6884. \fi}
  6885. \parseargdef\unmacro{%
  6886. \if1\csname ismacro.#1\endcsname
  6887. \global\cslet{#1}{macsave.#1}%
  6888. \global\expandafter\let \csname ismacro.#1\endcsname=0%
  6889. % Remove the macro name from \macrolist:
  6890. \begingroup
  6891. \expandafter\let\csname#1\endcsname \relax
  6892. \let\definedummyword\unmacrodo
  6893. \xdef\macrolist{\macrolist}%
  6894. \endgroup
  6895. \else
  6896. \errmessage{Macro #1 not defined}%
  6897. \fi
  6898. }
  6899. % Called by \do from \dounmacro on each macro. The idea is to omit any
  6900. % macro definitions that have been changed to \relax.
  6901. %
  6902. \def\unmacrodo#1{%
  6903. \ifx #1\relax
  6904. % remove this
  6905. \else
  6906. \noexpand\definedummyword \noexpand#1%
  6907. \fi
  6908. }
  6909. % This makes use of the obscure feature that if the last token of a
  6910. % <parameter list> is #, then the preceding argument is delimited by
  6911. % an opening brace, and that opening brace is not consumed.
  6912. \def\getargs#1{\getargsxxx#1{}}
  6913. \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
  6914. \def\getmacname#1 #2\relax{\macname={#1}}
  6915. \def\getmacargs#1{\def\argl{#1}}
  6916. % For macro processing make @ a letter so that we can make Texinfo private macro names.
  6917. \edef\texiatcatcode{\the\catcode`\@}
  6918. \catcode `@=11\relax
  6919. % Parse the optional {params} list. Set up \paramno and \paramlist
  6920. % so \defmacro knows what to do. Define \macarg.BLAH for each BLAH
  6921. % in the params list to some hook where the argument si to be expanded. If
  6922. % there are less than 10 arguments that hook is to be replaced by ##N where N
  6923. % is the position in that list, that is to say the macro arguments are to be
  6924. % defined `a la TeX in the macro body.
  6925. %
  6926. % That gets used by \mbodybackslash (above).
  6927. %
  6928. % We need to get `macro parameter char #' into several definitions.
  6929. % The technique used is stolen from LaTeX: let \hash be something
  6930. % unexpandable, insert that wherever you need a #, and then redefine
  6931. % it to # just before using the token list produced.
  6932. %
  6933. % The same technique is used to protect \eatspaces till just before
  6934. % the macro is used.
  6935. %
  6936. % If there are 10 or more arguments, a different technique is used, where the
  6937. % hook remains in the body, and when macro is to be expanded the body is
  6938. % processed again to replace the arguments.
  6939. %
  6940. % In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the
  6941. % argument N value and then \edef the body (nothing else will expand because of
  6942. % the catcode regime underwhich the body was input).
  6943. %
  6944. % If you compile with TeX (not eTeX), and you have macros with 10 or more
  6945. % arguments, you need that no macro has more than 256 arguments, otherwise an
  6946. % error is produced.
  6947. \def\parsemargdef#1;{%
  6948. \paramno=0\def\paramlist{}%
  6949. \let\hash\relax
  6950. \let\xeatspaces\relax
  6951. \parsemargdefxxx#1,;,%
  6952. % In case that there are 10 or more arguments we parse again the arguments
  6953. % list to set new definitions for the \macarg.BLAH macros corresponding to
  6954. % each BLAH argument. It was anyhow needed to parse already once this list
  6955. % in order to count the arguments, and as macros with at most 9 arguments
  6956. % are by far more frequent than macro with 10 or more arguments, defining
  6957. % twice the \macarg.BLAH macros does not cost too much processing power.
  6958. \ifnum\paramno<10\relax\else
  6959. \paramno0\relax
  6960. \parsemmanyargdef@@#1,;,% 10 or more arguments
  6961. \fi
  6962. }
  6963. \def\parsemargdefxxx#1,{%
  6964. \if#1;\let\next=\relax
  6965. \else \let\next=\parsemargdefxxx
  6966. \advance\paramno by 1
  6967. \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
  6968. {\xeatspaces{\hash\the\paramno}}%
  6969. \edef\paramlist{\paramlist\hash\the\paramno,}%
  6970. \fi\next}
  6971. \def\parsemmanyargdef@@#1,{%
  6972. \if#1;\let\next=\relax
  6973. \else
  6974. \let\next=\parsemmanyargdef@@
  6975. \edef\tempb{\eatspaces{#1}}%
  6976. \expandafter\def\expandafter\tempa
  6977. \expandafter{\csname macarg.\tempb\endcsname}%
  6978. % Note that we need some extra \noexpand\noexpand, this is because we
  6979. % don't want \the to be expanded in the \parsermacbody as it uses an
  6980. % \xdef .
  6981. \expandafter\edef\tempa
  6982. {\noexpand\noexpand\noexpand\the\toks\the\paramno}%
  6983. \advance\paramno by 1\relax
  6984. \fi\next}
  6985. % These two commands read recursive and nonrecursive macro bodies.
  6986. % (They're different since rec and nonrec macros end differently.)
  6987. %
  6988. \catcode `\@\texiatcatcode
  6989. \long\def\parsemacbody#1@end macro%
  6990. {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
  6991. \long\def\parsermacbody#1@end rmacro%
  6992. {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
  6993. \catcode `\@=11\relax
  6994. \let\endargs@\relax
  6995. \let\nil@\relax
  6996. \def\nilm@{\nil@}%
  6997. \long\def\nillm@{\nil@}%
  6998. % This macro is expanded during the Texinfo macro expansion, not during its
  6999. % definition. It gets all the arguments values and assigns them to macros
  7000. % macarg.ARGNAME
  7001. %
  7002. % #1 is the macro name
  7003. % #2 is the list of argument names
  7004. % #3 is the list of argument values
  7005. \def\getargvals@#1#2#3{%
  7006. \def\macargdeflist@{}%
  7007. \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion.
  7008. \def\paramlist{#2,\nil@}%
  7009. \def\macroname{#1}%
  7010. \begingroup
  7011. \macroargctxt
  7012. \def\argvaluelist{#3,\nil@}%
  7013. \def\@tempa{#3}%
  7014. \ifx\@tempa\empty
  7015. \setemptyargvalues@
  7016. \else
  7017. \getargvals@@
  7018. \fi
  7019. }
  7020. %
  7021. \def\getargvals@@{%
  7022. \ifx\paramlist\nilm@
  7023. % Some sanity check needed here that \argvaluelist is also empty.
  7024. \ifx\argvaluelist\nillm@
  7025. \else
  7026. \errhelp = \EMsimple
  7027. \errmessage{Too many arguments in macro `\macroname'!}%
  7028. \fi
  7029. \let\next\macargexpandinbody@
  7030. \else
  7031. \ifx\argvaluelist\nillm@
  7032. % No more arguments values passed to macro. Set remaining named-arg
  7033. % macros to empty.
  7034. \let\next\setemptyargvalues@
  7035. \else
  7036. % pop current arg name into \@tempb
  7037. \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}%
  7038. \expandafter\@tempa\expandafter{\paramlist}%
  7039. % pop current argument value into \@tempc
  7040. \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}%
  7041. \expandafter\@tempa\expandafter{\argvaluelist}%
  7042. % Here \@tempb is the current arg name and \@tempc is the current arg value.
  7043. % First place the new argument macro definition into \@tempd
  7044. \expandafter\macname\expandafter{\@tempc}%
  7045. \expandafter\let\csname macarg.\@tempb\endcsname\relax
  7046. \expandafter\def\expandafter\@tempe\expandafter{%
  7047. \csname macarg.\@tempb\endcsname}%
  7048. \edef\@tempd{\long\def\@tempe{\the\macname}}%
  7049. \push@\@tempd\macargdeflist@
  7050. \let\next\getargvals@@
  7051. \fi
  7052. \fi
  7053. \next
  7054. }
  7055. \def\push@#1#2{%
  7056. \expandafter\expandafter\expandafter\def
  7057. \expandafter\expandafter\expandafter#2%
  7058. \expandafter\expandafter\expandafter{%
  7059. \expandafter#1#2}%
  7060. }
  7061. % Replace arguments by their values in the macro body, and place the result
  7062. % in macro \@tempa
  7063. \def\macvalstoargs@{%
  7064. % To do this we use the property that token registers that are \the'ed
  7065. % within an \edef expand only once. So we are going to place all argument
  7066. % values into respective token registers.
  7067. %
  7068. % First we save the token context, and initialize argument numbering.
  7069. \begingroup
  7070. \paramno0\relax
  7071. % Then, for each argument number #N, we place the corresponding argument
  7072. % value into a new token list register \toks#N
  7073. \expandafter\putargsintokens@\saveparamlist@,;,%
  7074. % Then, we expand the body so that argument are replaced by their
  7075. % values. The trick for values not to be expanded themselves is that they
  7076. % are within tokens and that tokens expand only once in an \edef .
  7077. \edef\@tempc{\csname mac.\macroname .body\endcsname}%
  7078. % Now we restore the token stack pointer to free the token list registers
  7079. % which we have used, but we make sure that expanded body is saved after
  7080. % group.
  7081. \expandafter
  7082. \endgroup
  7083. \expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
  7084. }
  7085. \def\macargexpandinbody@{%
  7086. %% Define the named-macro outside of this group and then close this group.
  7087. \expandafter
  7088. \endgroup
  7089. \macargdeflist@
  7090. % First the replace in body the macro arguments by their values, the result
  7091. % is in \@tempa .
  7092. \macvalstoargs@
  7093. % Then we point at the \norecurse or \gobble (for recursive) macro value
  7094. % with \@tempb .
  7095. \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname
  7096. % Depending on whether it is recursive or not, we need some tailing
  7097. % \egroup .
  7098. \ifx\@tempb\gobble
  7099. \let\@tempc\relax
  7100. \else
  7101. \let\@tempc\egroup
  7102. \fi
  7103. % And now we do the real job:
  7104. \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}%
  7105. \@tempd
  7106. }
  7107. \def\putargsintokens@#1,{%
  7108. \if#1;\let\next\relax
  7109. \else
  7110. \let\next\putargsintokens@
  7111. % First we allocate the new token list register, and give it a temporary
  7112. % alias \@tempb .
  7113. \toksdef\@tempb\the\paramno
  7114. % Then we place the argument value into that token list register.
  7115. \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname
  7116. \expandafter\@tempb\expandafter{\@tempa}%
  7117. \advance\paramno by 1\relax
  7118. \fi
  7119. \next
  7120. }
  7121. % Save the token stack pointer into macro #1
  7122. \def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}}
  7123. % Restore the token stack pointer from number in macro #1
  7124. \def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax}
  7125. % newtoks that can be used non \outer .
  7126. \def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi}
  7127. % Tailing missing arguments are set to empty
  7128. \def\setemptyargvalues@{%
  7129. \ifx\paramlist\nilm@
  7130. \let\next\macargexpandinbody@
  7131. \else
  7132. \expandafter\setemptyargvaluesparser@\paramlist\endargs@
  7133. \let\next\setemptyargvalues@
  7134. \fi
  7135. \next
  7136. }
  7137. \def\setemptyargvaluesparser@#1,#2\endargs@{%
  7138. \expandafter\def\expandafter\@tempa\expandafter{%
  7139. \expandafter\def\csname macarg.#1\endcsname{}}%
  7140. \push@\@tempa\macargdeflist@
  7141. \def\paramlist{#2}%
  7142. }
  7143. % #1 is the element target macro
  7144. % #2 is the list macro
  7145. % #3,#4\endargs@ is the list value
  7146. \def\pop@#1#2#3,#4\endargs@{%
  7147. \def#1{#3}%
  7148. \def#2{#4}%
  7149. }
  7150. \long\def\longpop@#1#2#3,#4\endargs@{%
  7151. \long\def#1{#3}%
  7152. \long\def#2{#4}%
  7153. }
  7154. % This defines a Texinfo @macro. There are eight cases: recursive and
  7155. % nonrecursive macros of zero, one, up to nine, and many arguments.
  7156. % Much magic with \expandafter here.
  7157. % \xdef is used so that macro definitions will survive the file
  7158. % they're defined in; @include reads the file inside a group.
  7159. %
  7160. \def\defmacro{%
  7161. \let\hash=##% convert placeholders to macro parameter chars
  7162. \ifrecursive
  7163. \ifcase\paramno
  7164. % 0
  7165. \expandafter\xdef\csname\the\macname\endcsname{%
  7166. \noexpand\scanmacro{\temp}}%
  7167. \or % 1
  7168. \expandafter\xdef\csname\the\macname\endcsname{%
  7169. \bgroup\noexpand\macroargctxt
  7170. \noexpand\braceorline
  7171. \expandafter\noexpand\csname\the\macname xxx\endcsname}%
  7172. \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
  7173. \egroup\noexpand\scanmacro{\temp}}%
  7174. \else
  7175. \ifnum\paramno<10\relax % at most 9
  7176. \expandafter\xdef\csname\the\macname\endcsname{%
  7177. \bgroup\noexpand\macroargctxt
  7178. \noexpand\csname\the\macname xx\endcsname}%
  7179. \expandafter\xdef\csname\the\macname xx\endcsname##1{%
  7180. \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
  7181. \expandafter\expandafter
  7182. \expandafter\xdef
  7183. \expandafter\expandafter
  7184. \csname\the\macname xxx\endcsname
  7185. \paramlist{\egroup\noexpand\scanmacro{\temp}}%
  7186. \else % 10 or more
  7187. \expandafter\xdef\csname\the\macname\endcsname{%
  7188. \noexpand\getargvals@{\the\macname}{\argl}%
  7189. }%
  7190. \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
  7191. \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble
  7192. \fi
  7193. \fi
  7194. \else
  7195. \ifcase\paramno
  7196. % 0
  7197. \expandafter\xdef\csname\the\macname\endcsname{%
  7198. \noexpand\norecurse{\the\macname}%
  7199. \noexpand\scanmacro{\temp}\egroup}%
  7200. \or % 1
  7201. \expandafter\xdef\csname\the\macname\endcsname{%
  7202. \bgroup\noexpand\macroargctxt
  7203. \noexpand\braceorline
  7204. \expandafter\noexpand\csname\the\macname xxx\endcsname}%
  7205. \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
  7206. \egroup
  7207. \noexpand\norecurse{\the\macname}%
  7208. \noexpand\scanmacro{\temp}\egroup}%
  7209. \else % at most 9
  7210. \ifnum\paramno<10\relax
  7211. \expandafter\xdef\csname\the\macname\endcsname{%
  7212. \bgroup\noexpand\macroargctxt
  7213. \expandafter\noexpand\csname\the\macname xx\endcsname}%
  7214. \expandafter\xdef\csname\the\macname xx\endcsname##1{%
  7215. \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
  7216. \expandafter\expandafter
  7217. \expandafter\xdef
  7218. \expandafter\expandafter
  7219. \csname\the\macname xxx\endcsname
  7220. \paramlist{%
  7221. \egroup
  7222. \noexpand\norecurse{\the\macname}%
  7223. \noexpand\scanmacro{\temp}\egroup}%
  7224. \else % 10 or more:
  7225. \expandafter\xdef\csname\the\macname\endcsname{%
  7226. \noexpand\getargvals@{\the\macname}{\argl}%
  7227. }%
  7228. \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
  7229. \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse
  7230. \fi
  7231. \fi
  7232. \fi}
  7233. \catcode `\@\texiatcatcode\relax
  7234. \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
  7235. % \braceorline decides whether the next nonwhitespace character is a
  7236. % {. If so it reads up to the closing }, if not, it reads the whole
  7237. % line. Whatever was read is then fed to the next control sequence
  7238. % as an argument (by \parsebrace or \parsearg).
  7239. %
  7240. \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
  7241. \def\braceorlinexxx{%
  7242. \ifx\nchar\bgroup\else
  7243. \expandafter\parsearg
  7244. \fi \macnamexxx}
  7245. % @alias.
  7246. % We need some trickery to remove the optional spaces around the equal
  7247. % sign. Make them active and then expand them all to nothing.
  7248. %
  7249. \def\alias{\parseargusing\obeyspaces\aliasxxx}
  7250. \def\aliasxxx #1{\aliasyyy#1\relax}
  7251. \def\aliasyyy #1=#2\relax{%
  7252. {%
  7253. \expandafter\let\obeyedspace=\empty
  7254. \addtomacrolist{#1}%
  7255. \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%
  7256. }%
  7257. \next
  7258. }
  7259. \message{cross references,}
  7260. \newwrite\auxfile
  7261. \newif\ifhavexrefs % True if xref values are known.
  7262. \newif\ifwarnedxrefs % True if we warned once that they aren't known.
  7263. % @inforef is relatively simple.
  7264. \def\inforef #1{\inforefzzz #1,,,,**}
  7265. \def\inforefzzz #1,#2,#3,#4**{%
  7266. \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
  7267. node \samp{\ignorespaces#1{}}}
  7268. % @node's only job in TeX is to define \lastnode, which is used in
  7269. % cross-references. The @node line might or might not have commas, and
  7270. % might or might not have spaces before the first comma, like:
  7271. % @node foo , bar , ...
  7272. % We don't want such trailing spaces in the node name.
  7273. %
  7274. \parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse}
  7275. %
  7276. % also remove a trailing comma, in case of something like this:
  7277. % @node Help-Cross, , , Cross-refs
  7278. \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
  7279. \def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}}
  7280. \let\nwnode=\node
  7281. \let\lastnode=\empty
  7282. % Write a cross-reference definition for the current node. #1 is the
  7283. % type (Ynumbered, Yappendix, Ynothing).
  7284. %
  7285. \def\donoderef#1{%
  7286. \ifx\lastnode\empty\else
  7287. \setref{\lastnode}{#1}%
  7288. \global\let\lastnode=\empty
  7289. \fi
  7290. }
  7291. % @anchor{NAME} -- define xref target at arbitrary point.
  7292. %
  7293. \newcount\savesfregister
  7294. %
  7295. \def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
  7296. \def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
  7297. \def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
  7298. % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
  7299. % anchor), which consists of three parts:
  7300. % 1) NAME-title - the current sectioning name taken from \lastsection,
  7301. % or the anchor name.
  7302. % 2) NAME-snt - section number and type, passed as the SNT arg, or
  7303. % empty for anchors.
  7304. % 3) NAME-pg - the page number.
  7305. %
  7306. % This is called from \donoderef, \anchor, and \dofloat. In the case of
  7307. % floats, there is an additional part, which is not written here:
  7308. % 4) NAME-lof - the text as it should appear in a @listoffloats.
  7309. %
  7310. \def\setref#1#2{%
  7311. \pdfmkdest{#1}%
  7312. \iflinks
  7313. {%
  7314. \atdummies % preserve commands, but don't expand them
  7315. \edef\writexrdef##1##2{%
  7316. \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
  7317. ##1}{##2}}% these are parameters of \writexrdef
  7318. }%
  7319. \toks0 = \expandafter{\lastsection}%
  7320. \immediate \writexrdef{title}{\the\toks0 }%
  7321. \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
  7322. \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout
  7323. }%
  7324. \fi
  7325. }
  7326. % @xrefautosectiontitle on|off says whether @section(ing) names are used
  7327. % automatically in xrefs, if the third arg is not explicitly specified.
  7328. % This was provided as a "secret" @set xref-automatic-section-title
  7329. % variable, now it's official.
  7330. %
  7331. \parseargdef\xrefautomaticsectiontitle{%
  7332. \def\temp{#1}%
  7333. \ifx\temp\onword
  7334. \expandafter\let\csname SETxref-automatic-section-title\endcsname
  7335. = \empty
  7336. \else\ifx\temp\offword
  7337. \expandafter\let\csname SETxref-automatic-section-title\endcsname
  7338. = \relax
  7339. \else
  7340. \errhelp = \EMsimple
  7341. \errmessage{Unknown @xrefautomaticsectiontitle value `\temp',
  7342. must be on|off}%
  7343. \fi\fi
  7344. }
  7345. %
  7346. % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
  7347. % the node name, #2 the name of the Info cross-reference, #3 the printed
  7348. % node name, #4 the name of the Info file, #5 the name of the printed
  7349. % manual. All but the node name can be omitted.
  7350. %
  7351. \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
  7352. \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
  7353. \def\ref#1{\xrefX[#1,,,,,,,]}
  7354. %
  7355. \newbox\toprefbox
  7356. \newbox\printedrefnamebox
  7357. \newbox\infofilenamebox
  7358. \newbox\printedmanualbox
  7359. %
  7360. \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
  7361. \unsepspaces
  7362. %
  7363. % Get args without leading/trailing spaces.
  7364. \def\printedrefname{\ignorespaces #3}%
  7365. \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}%
  7366. %
  7367. \def\infofilename{\ignorespaces #4}%
  7368. \setbox\infofilenamebox = \hbox{\infofilename\unskip}%
  7369. %
  7370. \def\printedmanual{\ignorespaces #5}%
  7371. \setbox\printedmanualbox = \hbox{\printedmanual\unskip}%
  7372. %
  7373. % If the printed reference name (arg #3) was not explicitly given in
  7374. % the @xref, figure out what we want to use.
  7375. \ifdim \wd\printedrefnamebox = 0pt
  7376. % No printed node name was explicitly given.
  7377. \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax
  7378. % Not auto section-title: use node name inside the square brackets.
  7379. \def\printedrefname{\ignorespaces #1}%
  7380. \else
  7381. % Auto section-title: use chapter/section title inside
  7382. % the square brackets if we have it.
  7383. \ifdim \wd\printedmanualbox > 0pt
  7384. % It is in another manual, so we don't have it; use node name.
  7385. \def\printedrefname{\ignorespaces #1}%
  7386. \else
  7387. \ifhavexrefs
  7388. % We (should) know the real title if we have the xref values.
  7389. \def\printedrefname{\refx{#1-title}{}}%
  7390. \else
  7391. % Otherwise just copy the Info node name.
  7392. \def\printedrefname{\ignorespaces #1}%
  7393. \fi%
  7394. \fi
  7395. \fi
  7396. \fi
  7397. %
  7398. % Make link in pdf output.
  7399. \ifpdf
  7400. {\indexnofonts
  7401. \turnoffactive
  7402. \makevalueexpandable
  7403. % This expands tokens, so do it after making catcode changes, so _
  7404. % etc. don't get their TeX definitions. This ignores all spaces in
  7405. % #4, including (wrongly) those in the middle of the filename.
  7406. \getfilename{#4}%
  7407. %
  7408. % This (wrongly) does not take account of leading or trailing
  7409. % spaces in #1, which should be ignored.
  7410. \edef\pdfxrefdest{#1}%
  7411. \ifx\pdfxrefdest\empty
  7412. \def\pdfxrefdest{Top}% no empty targets
  7413. \else
  7414. \txiescapepdf\pdfxrefdest % escape PDF special chars
  7415. \fi
  7416. %
  7417. \leavevmode
  7418. \startlink attr{/Border [0 0 0]}%
  7419. \ifnum\filenamelength>0
  7420. goto file{\the\filename.pdf} name{\pdfxrefdest}%
  7421. \else
  7422. goto name{\pdfmkpgn{\pdfxrefdest}}%
  7423. \fi
  7424. }%
  7425. \setcolor{\linkcolor}%
  7426. \fi
  7427. %
  7428. % Float references are printed completely differently: "Figure 1.2"
  7429. % instead of "[somenode], p.3". We distinguish them by the
  7430. % LABEL-title being set to a magic string.
  7431. {%
  7432. % Have to otherify everything special to allow the \csname to
  7433. % include an _ in the xref name, etc.
  7434. \indexnofonts
  7435. \turnoffactive
  7436. \expandafter\global\expandafter\let\expandafter\Xthisreftitle
  7437. \csname XR#1-title\endcsname
  7438. }%
  7439. \iffloat\Xthisreftitle
  7440. % If the user specified the print name (third arg) to the ref,
  7441. % print it instead of our usual "Figure 1.2".
  7442. \ifdim\wd\printedrefnamebox = 0pt
  7443. \refx{#1-snt}{}%
  7444. \else
  7445. \printedrefname
  7446. \fi
  7447. %
  7448. % If the user also gave the printed manual name (fifth arg), append
  7449. % "in MANUALNAME".
  7450. \ifdim \wd\printedmanualbox > 0pt
  7451. \space \putwordin{} \cite{\printedmanual}%
  7452. \fi
  7453. \else
  7454. % node/anchor (non-float) references.
  7455. %
  7456. % If we use \unhbox to print the node names, TeX does not insert
  7457. % empty discretionaries after hyphens, which means that it will not
  7458. % find a line break at a hyphen in a node names. Since some manuals
  7459. % are best written with fairly long node names, containing hyphens,
  7460. % this is a loss. Therefore, we give the text of the node name
  7461. % again, so it is as if TeX is seeing it for the first time.
  7462. %
  7463. \ifdim \wd\printedmanualbox > 0pt
  7464. % Cross-manual reference with a printed manual name.
  7465. %
  7466. \crossmanualxref{\cite{\printedmanual\unskip}}%
  7467. %
  7468. \else\ifdim \wd\infofilenamebox > 0pt
  7469. % Cross-manual reference with only an info filename (arg 4), no
  7470. % printed manual name (arg 5). This is essentially the same as
  7471. % the case above; we output the filename, since we have nothing else.
  7472. %
  7473. \crossmanualxref{\code{\infofilename\unskip}}%
  7474. %
  7475. \else
  7476. % Reference within this manual.
  7477. %
  7478. % _ (for example) has to be the character _ for the purposes of the
  7479. % control sequence corresponding to the node, but it has to expand
  7480. % into the usual \leavevmode...\vrule stuff for purposes of
  7481. % printing. So we \turnoffactive for the \refx-snt, back on for the
  7482. % printing, back off for the \refx-pg.
  7483. {\turnoffactive
  7484. % Only output a following space if the -snt ref is nonempty; for
  7485. % @unnumbered and @anchor, it won't be.
  7486. \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
  7487. \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
  7488. }%
  7489. % output the `[mynode]' via the macro below so it can be overridden.
  7490. \xrefprintnodename\printedrefname
  7491. %
  7492. % But we always want a comma and a space:
  7493. ,\space
  7494. %
  7495. % output the `page 3'.
  7496. \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
  7497. \fi\fi
  7498. \fi
  7499. \endlink
  7500. \endgroup}
  7501. % Output a cross-manual xref to #1. Used just above (twice).
  7502. %
  7503. % Only include the text "Section ``foo'' in" if the foo is neither
  7504. % missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply
  7505. % "see The Foo Manual", the idea being to refer to the whole manual.
  7506. %
  7507. % But, this being TeX, we can't easily compare our node name against the
  7508. % string "Top" while ignoring the possible spaces before and after in
  7509. % the input. By adding the arbitrary 7sp below, we make it much less
  7510. % likely that a real node name would have the same width as "Top" (e.g.,
  7511. % in a monospaced font). Hopefully it will never happen in practice.
  7512. %
  7513. % For the same basic reason, we retypeset the "Top" at every
  7514. % reference, since the current font is indeterminate.
  7515. %
  7516. \def\crossmanualxref#1{%
  7517. \setbox\toprefbox = \hbox{Top\kern7sp}%
  7518. \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
  7519. \ifdim \wd2 > 7sp % nonempty?
  7520. \ifdim \wd2 = \wd\toprefbox \else % same as Top?
  7521. \putwordSection{} ``\printedrefname'' \putwordin{}\space
  7522. \fi
  7523. \fi
  7524. #1%
  7525. }
  7526. % This macro is called from \xrefX for the `[nodename]' part of xref
  7527. % output. It's a separate macro only so it can be changed more easily,
  7528. % since square brackets don't work well in some documents. Particularly
  7529. % one that Bob is working on :).
  7530. %
  7531. \def\xrefprintnodename#1{[#1]}
  7532. % Things referred to by \setref.
  7533. %
  7534. \def\Ynothing{}
  7535. \def\Yomitfromtoc{}
  7536. \def\Ynumbered{%
  7537. \ifnum\secno=0
  7538. \putwordChapter@tie \the\chapno
  7539. \else \ifnum\subsecno=0
  7540. \putwordSection@tie \the\chapno.\the\secno
  7541. \else \ifnum\subsubsecno=0
  7542. \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
  7543. \else
  7544. \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
  7545. \fi\fi\fi
  7546. }
  7547. \def\Yappendix{%
  7548. \ifnum\secno=0
  7549. \putwordAppendix@tie @char\the\appendixno{}%
  7550. \else \ifnum\subsecno=0
  7551. \putwordSection@tie @char\the\appendixno.\the\secno
  7552. \else \ifnum\subsubsecno=0
  7553. \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
  7554. \else
  7555. \putwordSection@tie
  7556. @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
  7557. \fi\fi\fi
  7558. }
  7559. % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
  7560. % If its value is nonempty, SUFFIX is output afterward.
  7561. %
  7562. \def\refx#1#2{%
  7563. {%
  7564. \indexnofonts
  7565. \otherbackslash
  7566. \expandafter\global\expandafter\let\expandafter\thisrefX
  7567. \csname XR#1\endcsname
  7568. }%
  7569. \ifx\thisrefX\relax
  7570. % If not defined, say something at least.
  7571. \angleleft un\-de\-fined\angleright
  7572. \iflinks
  7573. \ifhavexrefs
  7574. {\toks0 = {#1}% avoid expansion of possibly-complex value
  7575. \message{\linenumber Undefined cross reference `\the\toks0'.}}%
  7576. \else
  7577. \ifwarnedxrefs\else
  7578. \global\warnedxrefstrue
  7579. \message{Cross reference values unknown; you must run TeX again.}%
  7580. \fi
  7581. \fi
  7582. \fi
  7583. \else
  7584. % It's defined, so just use it.
  7585. \thisrefX
  7586. \fi
  7587. #2% Output the suffix in any case.
  7588. }
  7589. % This is the macro invoked by entries in the aux file. Usually it's
  7590. % just a \def (we prepend XR to the control sequence name to avoid
  7591. % collisions). But if this is a float type, we have more work to do.
  7592. %
  7593. \def\xrdef#1#2{%
  7594. {% The node name might contain 8-bit characters, which in our current
  7595. % implementation are changed to commands like @'e. Don't let these
  7596. % mess up the control sequence name.
  7597. \indexnofonts
  7598. \turnoffactive
  7599. \xdef\safexrefname{#1}%
  7600. }%
  7601. %
  7602. \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref
  7603. %
  7604. % Was that xref control sequence that we just defined for a float?
  7605. \expandafter\iffloat\csname XR\safexrefname\endcsname
  7606. % it was a float, and we have the (safe) float type in \iffloattype.
  7607. \expandafter\let\expandafter\floatlist
  7608. \csname floatlist\iffloattype\endcsname
  7609. %
  7610. % Is this the first time we've seen this float type?
  7611. \expandafter\ifx\floatlist\relax
  7612. \toks0 = {\do}% yes, so just \do
  7613. \else
  7614. % had it before, so preserve previous elements in list.
  7615. \toks0 = \expandafter{\floatlist\do}%
  7616. \fi
  7617. %
  7618. % Remember this xref in the control sequence \floatlistFLOATTYPE,
  7619. % for later use in \listoffloats.
  7620. \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0
  7621. {\safexrefname}}%
  7622. \fi
  7623. }
  7624. % Read the last existing aux file, if any. No error if none exists.
  7625. %
  7626. \def\tryauxfile{%
  7627. \openin 1 \jobname.aux
  7628. \ifeof 1 \else
  7629. \readdatafile{aux}%
  7630. \global\havexrefstrue
  7631. \fi
  7632. \closein 1
  7633. }
  7634. \def\setupdatafile{%
  7635. \catcode`\^^@=\other
  7636. \catcode`\^^A=\other
  7637. \catcode`\^^B=\other
  7638. \catcode`\^^C=\other
  7639. \catcode`\^^D=\other
  7640. \catcode`\^^E=\other
  7641. \catcode`\^^F=\other
  7642. \catcode`\^^G=\other
  7643. \catcode`\^^H=\other
  7644. \catcode`\^^K=\other
  7645. \catcode`\^^L=\other
  7646. \catcode`\^^N=\other
  7647. \catcode`\^^P=\other
  7648. \catcode`\^^Q=\other
  7649. \catcode`\^^R=\other
  7650. \catcode`\^^S=\other
  7651. \catcode`\^^T=\other
  7652. \catcode`\^^U=\other
  7653. \catcode`\^^V=\other
  7654. \catcode`\^^W=\other
  7655. \catcode`\^^X=\other
  7656. \catcode`\^^Z=\other
  7657. \catcode`\^^[=\other
  7658. \catcode`\^^\=\other
  7659. \catcode`\^^]=\other
  7660. \catcode`\^^^=\other
  7661. \catcode`\^^_=\other
  7662. % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
  7663. % in xref tags, i.e., node names. But since ^^e4 notation isn't
  7664. % supported in the main text, it doesn't seem desirable. Furthermore,
  7665. % that is not enough: for node names that actually contain a ^
  7666. % character, we would end up writing a line like this: 'xrdef {'hat
  7667. % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
  7668. % argument, and \hat is not an expandable control sequence. It could
  7669. % all be worked out, but why? Either we support ^^ or we don't.
  7670. %
  7671. % The other change necessary for this was to define \auxhat:
  7672. % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
  7673. % and then to call \auxhat in \setq.
  7674. %
  7675. \catcode`\^=\other
  7676. %
  7677. % Special characters. Should be turned off anyway, but...
  7678. \catcode`\~=\other
  7679. \catcode`\[=\other
  7680. \catcode`\]=\other
  7681. \catcode`\"=\other
  7682. \catcode`\_=\other
  7683. \catcode`\|=\other
  7684. \catcode`\<=\other
  7685. \catcode`\>=\other
  7686. \catcode`\$=\other
  7687. \catcode`\#=\other
  7688. \catcode`\&=\other
  7689. \catcode`\%=\other
  7690. \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
  7691. %
  7692. % This is to support \ in node names and titles, since the \
  7693. % characters end up in a \csname. It's easier than
  7694. % leaving it active and making its active definition an actual \
  7695. % character. What I don't understand is why it works in the *value*
  7696. % of the xrdef. Seems like it should be a catcode12 \, and that
  7697. % should not typeset properly. But it works, so I'm moving on for
  7698. % now. --karl, 15jan04.
  7699. \catcode`\\=\other
  7700. %
  7701. % Make the characters 128-255 be printing characters.
  7702. {%
  7703. \count1=128
  7704. \def\loop{%
  7705. \catcode\count1=\other
  7706. \advance\count1 by 1
  7707. \ifnum \count1<256 \loop \fi
  7708. }%
  7709. }%
  7710. %
  7711. % @ is our escape character in .aux files, and we need braces.
  7712. \catcode`\{=1
  7713. \catcode`\}=2
  7714. \catcode`\@=0
  7715. }
  7716. \def\readdatafile#1{%
  7717. \begingroup
  7718. \setupdatafile
  7719. \input\jobname.#1
  7720. \endgroup}
  7721. \message{insertions,}
  7722. % including footnotes.
  7723. \newcount \footnoteno
  7724. % The trailing space in the following definition for supereject is
  7725. % vital for proper filling; pages come out unaligned when you do a
  7726. % pagealignmacro call if that space before the closing brace is
  7727. % removed. (Generally, numeric constants should always be followed by a
  7728. % space to prevent strange expansion errors.)
  7729. \def\supereject{\par\penalty -20000\footnoteno =0 }
  7730. % @footnotestyle is meaningful for Info output only.
  7731. \let\footnotestyle=\comment
  7732. {\catcode `\@=11
  7733. %
  7734. % Auto-number footnotes. Otherwise like plain.
  7735. \gdef\footnote{%
  7736. \let\indent=\ptexindent
  7737. \let\noindent=\ptexnoindent
  7738. \global\advance\footnoteno by \@ne
  7739. \edef\thisfootno{$^{\the\footnoteno}$}%
  7740. %
  7741. % In case the footnote comes at the end of a sentence, preserve the
  7742. % extra spacing after we do the footnote number.
  7743. \let\@sf\empty
  7744. \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
  7745. %
  7746. % Remove inadvertent blank space before typesetting the footnote number.
  7747. \unskip
  7748. \thisfootno\@sf
  7749. \dofootnote
  7750. }%
  7751. % Don't bother with the trickery in plain.tex to not require the
  7752. % footnote text as a parameter. Our footnotes don't need to be so general.
  7753. %
  7754. % Oh yes, they do; otherwise, @ifset (and anything else that uses
  7755. % \parseargline) fails inside footnotes because the tokens are fixed when
  7756. % the footnote is read. --karl, 16nov96.
  7757. %
  7758. \gdef\dofootnote{%
  7759. \insert\footins\bgroup
  7760. % We want to typeset this text as a normal paragraph, even if the
  7761. % footnote reference occurs in (for example) a display environment.
  7762. % So reset some parameters.
  7763. \hsize=\pagewidth
  7764. \interlinepenalty\interfootnotelinepenalty
  7765. \splittopskip\ht\strutbox % top baseline for broken footnotes
  7766. \splitmaxdepth\dp\strutbox
  7767. \floatingpenalty\@MM
  7768. \leftskip\z@skip
  7769. \rightskip\z@skip
  7770. \spaceskip\z@skip
  7771. \xspaceskip\z@skip
  7772. \parindent\defaultparindent
  7773. %
  7774. \smallfonts \rm
  7775. %
  7776. % Because we use hanging indentation in footnotes, a @noindent appears
  7777. % to exdent this text, so make it be a no-op. makeinfo does not use
  7778. % hanging indentation so @noindent can still be needed within footnote
  7779. % text after an @example or the like (not that this is good style).
  7780. \let\noindent = \relax
  7781. %
  7782. % Hang the footnote text off the number. Use \everypar in case the
  7783. % footnote extends for more than one paragraph.
  7784. \everypar = {\hang}%
  7785. \textindent{\thisfootno}%
  7786. %
  7787. % Don't crash into the line above the footnote text. Since this
  7788. % expands into a box, it must come within the paragraph, lest it
  7789. % provide a place where TeX can split the footnote.
  7790. \footstrut
  7791. %
  7792. % Invoke rest of plain TeX footnote routine.
  7793. \futurelet\next\fo@t
  7794. }
  7795. }%end \catcode `\@=11
  7796. % In case a @footnote appears in a vbox, save the footnote text and create
  7797. % the real \insert just after the vbox finished. Otherwise, the insertion
  7798. % would be lost.
  7799. % Similarly, if a @footnote appears inside an alignment, save the footnote
  7800. % text to a box and make the \insert when a row of the table is finished.
  7801. % And the same can be done for other insert classes. --kasal, 16nov03.
  7802. % Replace the \insert primitive by a cheating macro.
  7803. % Deeper inside, just make sure that the saved insertions are not spilled
  7804. % out prematurely.
  7805. %
  7806. \def\startsavinginserts{%
  7807. \ifx \insert\ptexinsert
  7808. \let\insert\saveinsert
  7809. \else
  7810. \let\checkinserts\relax
  7811. \fi
  7812. }
  7813. % This \insert replacement works for both \insert\footins{foo} and
  7814. % \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}.
  7815. %
  7816. \def\saveinsert#1{%
  7817. \edef\next{\noexpand\savetobox \makeSAVEname#1}%
  7818. \afterassignment\next
  7819. % swallow the left brace
  7820. \let\temp =
  7821. }
  7822. \def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}}
  7823. \def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1}
  7824. \def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi}
  7825. \def\placesaveins#1{%
  7826. \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname
  7827. {\box#1}%
  7828. }
  7829. % eat @SAVE -- beware, all of them have catcode \other:
  7830. {
  7831. \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-)
  7832. \gdef\gobblesave @SAVE{}
  7833. }
  7834. % initialization:
  7835. \def\newsaveins #1{%
  7836. \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}%
  7837. \next
  7838. }
  7839. \def\newsaveinsX #1{%
  7840. \csname newbox\endcsname #1%
  7841. \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts
  7842. \checksaveins #1}%
  7843. }
  7844. % initialize:
  7845. \let\checkinserts\empty
  7846. \newsaveins\footins
  7847. \newsaveins\margin
  7848. % @image. We use the macros from epsf.tex to support this.
  7849. % If epsf.tex is not installed and @image is used, we complain.
  7850. %
  7851. % Check for and read epsf.tex up front. If we read it only at @image
  7852. % time, we might be inside a group, and then its definitions would get
  7853. % undone and the next image would fail.
  7854. \openin 1 = epsf.tex
  7855. \ifeof 1 \else
  7856. % Do not bother showing banner with epsf.tex v2.7k (available in
  7857. % doc/epsf.tex and on ctan).
  7858. \def\epsfannounce{\toks0 = }%
  7859. \input epsf.tex
  7860. \fi
  7861. \closein 1
  7862. %
  7863. % We will only complain once about lack of epsf.tex.
  7864. \newif\ifwarnednoepsf
  7865. \newhelp\noepsfhelp{epsf.tex must be installed for images to
  7866. work. It is also included in the Texinfo distribution, or you can get
  7867. it from ftp://tug.org/tex/epsf.tex.}
  7868. %
  7869. \def\image#1{%
  7870. \ifx\epsfbox\thisisundefined
  7871. \ifwarnednoepsf \else
  7872. \errhelp = \noepsfhelp
  7873. \errmessage{epsf.tex not found, images will be ignored}%
  7874. \global\warnednoepsftrue
  7875. \fi
  7876. \else
  7877. \imagexxx #1,,,,,\finish
  7878. \fi
  7879. }
  7880. %
  7881. % Arguments to @image:
  7882. % #1 is (mandatory) image filename; we tack on .eps extension.
  7883. % #2 is (optional) width, #3 is (optional) height.
  7884. % #4 is (ignored optional) html alt text.
  7885. % #5 is (ignored optional) extension.
  7886. % #6 is just the usual extra ignored arg for parsing stuff.
  7887. \newif\ifimagevmode
  7888. \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
  7889. \catcode`\^^M = 5 % in case we're inside an example
  7890. \normalturnoffactive % allow _ et al. in names
  7891. % If the image is by itself, center it.
  7892. \ifvmode
  7893. \imagevmodetrue
  7894. \else \ifx\centersub\centerV
  7895. % for @center @image, we need a vbox so we can have our vertical space
  7896. \imagevmodetrue
  7897. \vbox\bgroup % vbox has better behavior than vtop herev
  7898. \fi\fi
  7899. %
  7900. \ifimagevmode
  7901. \nobreak\medskip
  7902. % Usually we'll have text after the image which will insert
  7903. % \parskip glue, so insert it here too to equalize the space
  7904. % above and below.
  7905. \nobreak\vskip\parskip
  7906. \nobreak
  7907. \fi
  7908. %
  7909. % Leave vertical mode so that indentation from an enclosing
  7910. % environment such as @quotation is respected.
  7911. % However, if we're at the top level, we don't want the
  7912. % normal paragraph indentation.
  7913. % On the other hand, if we are in the case of @center @image, we don't
  7914. % want to start a paragraph, which will create a hsize-width box and
  7915. % eradicate the centering.
  7916. \ifx\centersub\centerV\else \noindent \fi
  7917. %
  7918. % Output the image.
  7919. \ifpdf
  7920. \dopdfimage{#1}{#2}{#3}%
  7921. \else
  7922. % \epsfbox itself resets \epsf?size at each figure.
  7923. \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
  7924. \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
  7925. \epsfbox{#1.eps}%
  7926. \fi
  7927. %
  7928. \ifimagevmode
  7929. \medskip % space after a standalone image
  7930. \fi
  7931. \ifx\centersub\centerV \egroup \fi
  7932. \endgroup}
  7933. % @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables,
  7934. % etc. We don't actually implement floating yet, we always include the
  7935. % float "here". But it seemed the best name for the future.
  7936. %
  7937. \envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish}
  7938. % There may be a space before second and/or third parameter; delete it.
  7939. \def\eatcommaspace#1, {#1,}
  7940. % #1 is the optional FLOATTYPE, the text label for this float, typically
  7941. % "Figure", "Table", "Example", etc. Can't contain commas. If omitted,
  7942. % this float will not be numbered and cannot be referred to.
  7943. %
  7944. % #2 is the optional xref label. Also must be present for the float to
  7945. % be referable.
  7946. %
  7947. % #3 is the optional positioning argument; for now, it is ignored. It
  7948. % will somehow specify the positions allowed to float to (here, top, bottom).
  7949. %
  7950. % We keep a separate counter for each FLOATTYPE, which we reset at each
  7951. % chapter-level command.
  7952. \let\resetallfloatnos=\empty
  7953. %
  7954. \def\dofloat#1,#2,#3,#4\finish{%
  7955. \let\thiscaption=\empty
  7956. \let\thisshortcaption=\empty
  7957. %
  7958. % don't lose footnotes inside @float.
  7959. %
  7960. % BEWARE: when the floats start float, we have to issue warning whenever an
  7961. % insert appears inside a float which could possibly float. --kasal, 26may04
  7962. %
  7963. \startsavinginserts
  7964. %
  7965. % We can't be used inside a paragraph.
  7966. \par
  7967. %
  7968. \vtop\bgroup
  7969. \def\floattype{#1}%
  7970. \def\floatlabel{#2}%
  7971. \def\floatloc{#3}% we do nothing with this yet.
  7972. %
  7973. \ifx\floattype\empty
  7974. \let\safefloattype=\empty
  7975. \else
  7976. {%
  7977. % the floattype might have accents or other special characters,
  7978. % but we need to use it in a control sequence name.
  7979. \indexnofonts
  7980. \turnoffactive
  7981. \xdef\safefloattype{\floattype}%
  7982. }%
  7983. \fi
  7984. %
  7985. % If label is given but no type, we handle that as the empty type.
  7986. \ifx\floatlabel\empty \else
  7987. % We want each FLOATTYPE to be numbered separately (Figure 1,
  7988. % Table 1, Figure 2, ...). (And if no label, no number.)
  7989. %
  7990. \expandafter\getfloatno\csname\safefloattype floatno\endcsname
  7991. \global\advance\floatno by 1
  7992. %
  7993. {%
  7994. % This magic value for \lastsection is output by \setref as the
  7995. % XREFLABEL-title value. \xrefX uses it to distinguish float
  7996. % labels (which have a completely different output format) from
  7997. % node and anchor labels. And \xrdef uses it to construct the
  7998. % lists of floats.
  7999. %
  8000. \edef\lastsection{\floatmagic=\safefloattype}%
  8001. \setref{\floatlabel}{Yfloat}%
  8002. }%
  8003. \fi
  8004. %
  8005. % start with \parskip glue, I guess.
  8006. \vskip\parskip
  8007. %
  8008. % Don't suppress indentation if a float happens to start a section.
  8009. \restorefirstparagraphindent
  8010. }
  8011. % we have these possibilities:
  8012. % @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap
  8013. % @float Foo,lbl & no caption: Foo 1.1
  8014. % @float Foo & @caption{Cap}: Foo: Cap
  8015. % @float Foo & no caption: Foo
  8016. % @float ,lbl & Caption{Cap}: 1.1: Cap
  8017. % @float ,lbl & no caption: 1.1
  8018. % @float & @caption{Cap}: Cap
  8019. % @float & no caption:
  8020. %
  8021. \def\Efloat{%
  8022. \let\floatident = \empty
  8023. %
  8024. % In all cases, if we have a float type, it comes first.
  8025. \ifx\floattype\empty \else \def\floatident{\floattype}\fi
  8026. %
  8027. % If we have an xref label, the number comes next.
  8028. \ifx\floatlabel\empty \else
  8029. \ifx\floattype\empty \else % if also had float type, need tie first.
  8030. \appendtomacro\floatident{\tie}%
  8031. \fi
  8032. % the number.
  8033. \appendtomacro\floatident{\chaplevelprefix\the\floatno}%
  8034. \fi
  8035. %
  8036. % Start the printed caption with what we've constructed in
  8037. % \floatident, but keep it separate; we need \floatident again.
  8038. \let\captionline = \floatident
  8039. %
  8040. \ifx\thiscaption\empty \else
  8041. \ifx\floatident\empty \else
  8042. \appendtomacro\captionline{: }% had ident, so need a colon between
  8043. \fi
  8044. %
  8045. % caption text.
  8046. \appendtomacro\captionline{\scanexp\thiscaption}%
  8047. \fi
  8048. %
  8049. % If we have anything to print, print it, with space before.
  8050. % Eventually this needs to become an \insert.
  8051. \ifx\captionline\empty \else
  8052. \vskip.5\parskip
  8053. \captionline
  8054. %
  8055. % Space below caption.
  8056. \vskip\parskip
  8057. \fi
  8058. %
  8059. % If have an xref label, write the list of floats info. Do this
  8060. % after the caption, to avoid chance of it being a breakpoint.
  8061. \ifx\floatlabel\empty \else
  8062. % Write the text that goes in the lof to the aux file as
  8063. % \floatlabel-lof. Besides \floatident, we include the short
  8064. % caption if specified, else the full caption if specified, else nothing.
  8065. {%
  8066. \atdummies
  8067. %
  8068. % since we read the caption text in the macro world, where ^^M
  8069. % is turned into a normal character, we have to scan it back, so
  8070. % we don't write the literal three characters "^^M" into the aux file.
  8071. \scanexp{%
  8072. \xdef\noexpand\gtemp{%
  8073. \ifx\thisshortcaption\empty
  8074. \thiscaption
  8075. \else
  8076. \thisshortcaption
  8077. \fi
  8078. }%
  8079. }%
  8080. \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident
  8081. \ifx\gtemp\empty \else : \gtemp \fi}}%
  8082. }%
  8083. \fi
  8084. \egroup % end of \vtop
  8085. %
  8086. % place the captured inserts
  8087. %
  8088. % BEWARE: when the floats start floating, we have to issue warning
  8089. % whenever an insert appears inside a float which could possibly
  8090. % float. --kasal, 26may04
  8091. %
  8092. \checkinserts
  8093. }
  8094. % Append the tokens #2 to the definition of macro #1, not expanding either.
  8095. %
  8096. \def\appendtomacro#1#2{%
  8097. \expandafter\def\expandafter#1\expandafter{#1#2}%
  8098. }
  8099. % @caption, @shortcaption
  8100. %
  8101. \def\caption{\docaption\thiscaption}
  8102. \def\shortcaption{\docaption\thisshortcaption}
  8103. \def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption}
  8104. \def\defcaption#1#2{\egroup \def#1{#2}}
  8105. % The parameter is the control sequence identifying the counter we are
  8106. % going to use. Create it if it doesn't exist and assign it to \floatno.
  8107. \def\getfloatno#1{%
  8108. \ifx#1\relax
  8109. % Haven't seen this figure type before.
  8110. \csname newcount\endcsname #1%
  8111. %
  8112. % Remember to reset this floatno at the next chap.
  8113. \expandafter\gdef\expandafter\resetallfloatnos
  8114. \expandafter{\resetallfloatnos #1=0 }%
  8115. \fi
  8116. \let\floatno#1%
  8117. }
  8118. % \setref calls this to get the XREFLABEL-snt value. We want an @xref
  8119. % to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we
  8120. % first read the @float command.
  8121. %
  8122. \def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}%
  8123. % Magic string used for the XREFLABEL-title value, so \xrefX can
  8124. % distinguish floats from other xref types.
  8125. \def\floatmagic{!!float!!}
  8126. % #1 is the control sequence we are passed; we expand into a conditional
  8127. % which is true if #1 represents a float ref. That is, the magic
  8128. % \lastsection value which we \setref above.
  8129. %
  8130. \def\iffloat#1{\expandafter\doiffloat#1==\finish}
  8131. %
  8132. % #1 is (maybe) the \floatmagic string. If so, #2 will be the
  8133. % (safe) float type for this float. We set \iffloattype to #2.
  8134. %
  8135. \def\doiffloat#1=#2=#3\finish{%
  8136. \def\temp{#1}%
  8137. \def\iffloattype{#2}%
  8138. \ifx\temp\floatmagic
  8139. }
  8140. % @listoffloats FLOATTYPE - print a list of floats like a table of contents.
  8141. %
  8142. \parseargdef\listoffloats{%
  8143. \def\floattype{#1}% floattype
  8144. {%
  8145. % the floattype might have accents or other special characters,
  8146. % but we need to use it in a control sequence name.
  8147. \indexnofonts
  8148. \turnoffactive
  8149. \xdef\safefloattype{\floattype}%
  8150. }%
  8151. %
  8152. % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE.
  8153. \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax
  8154. \ifhavexrefs
  8155. % if the user said @listoffloats foo but never @float foo.
  8156. \message{\linenumber No `\safefloattype' floats to list.}%
  8157. \fi
  8158. \else
  8159. \begingroup
  8160. \leftskip=\tocindent % indent these entries like a toc
  8161. \let\do=\listoffloatsdo
  8162. \csname floatlist\safefloattype\endcsname
  8163. \endgroup
  8164. \fi
  8165. }
  8166. % This is called on each entry in a list of floats. We're passed the
  8167. % xref label, in the form LABEL-title, which is how we save it in the
  8168. % aux file. We strip off the -title and look up \XRLABEL-lof, which
  8169. % has the text we're supposed to typeset here.
  8170. %
  8171. % Figures without xref labels will not be included in the list (since
  8172. % they won't appear in the aux file).
  8173. %
  8174. \def\listoffloatsdo#1{\listoffloatsdoentry#1\finish}
  8175. \def\listoffloatsdoentry#1-title\finish{{%
  8176. % Can't fully expand XR#1-lof because it can contain anything. Just
  8177. % pass the control sequence. On the other hand, XR#1-pg is just the
  8178. % page number, and we want to fully expand that so we can get a link
  8179. % in pdf output.
  8180. \toksA = \expandafter{\csname XR#1-lof\endcsname}%
  8181. %
  8182. % use the same \entry macro we use to generate the TOC and index.
  8183. \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}%
  8184. \writeentry
  8185. }}
  8186. \message{localization,}
  8187. % For single-language documents, @documentlanguage is usually given very
  8188. % early, just after @documentencoding. Single argument is the language
  8189. % (de) or locale (de_DE) abbreviation.
  8190. %
  8191. {
  8192. \catcode`\_ = \active
  8193. \globaldefs=1
  8194. \parseargdef\documentlanguage{\begingroup
  8195. \let_=\normalunderscore % normal _ character for filenames
  8196. \tex % read txi-??.tex file in plain TeX.
  8197. % Read the file by the name they passed if it exists.
  8198. \openin 1 txi-#1.tex
  8199. \ifeof 1
  8200. \documentlanguagetrywithoutunderscore{#1_\finish}%
  8201. \else
  8202. \globaldefs = 1 % everything in the txi-LL files needs to persist
  8203. \input txi-#1.tex
  8204. \fi
  8205. \closein 1
  8206. \endgroup % end raw TeX
  8207. \endgroup}
  8208. %
  8209. % If they passed de_DE, and txi-de_DE.tex doesn't exist,
  8210. % try txi-de.tex.
  8211. %
  8212. \gdef\documentlanguagetrywithoutunderscore#1_#2\finish{%
  8213. \openin 1 txi-#1.tex
  8214. \ifeof 1
  8215. \errhelp = \nolanghelp
  8216. \errmessage{Cannot read language file txi-#1.tex}%
  8217. \else
  8218. \globaldefs = 1 % everything in the txi-LL files needs to persist
  8219. \input txi-#1.tex
  8220. \fi
  8221. \closein 1
  8222. }
  8223. }% end of special _ catcode
  8224. %
  8225. \newhelp\nolanghelp{The given language definition file cannot be found or
  8226. is empty. Maybe you need to install it? Putting it in the current
  8227. directory should work if nowhere else does.}
  8228. % This macro is called from txi-??.tex files; the first argument is the
  8229. % \language name to set (without the "\lang@" prefix), the second and
  8230. % third args are \{left,right}hyphenmin.
  8231. %
  8232. % The language names to pass are determined when the format is built.
  8233. % See the etex.log file created at that time, e.g.,
  8234. % /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log.
  8235. %
  8236. % With TeX Live 2008, etex now includes hyphenation patterns for all
  8237. % available languages. This means we can support hyphenation in
  8238. % Texinfo, at least to some extent. (This still doesn't solve the
  8239. % accented characters problem.)
  8240. %
  8241. \catcode`@=11
  8242. \def\txisetlanguage#1#2#3{%
  8243. % do not set the language if the name is undefined in the current TeX.
  8244. \expandafter\ifx\csname lang@#1\endcsname \relax
  8245. \message{no patterns for #1}%
  8246. \else
  8247. \global\language = \csname lang@#1\endcsname
  8248. \fi
  8249. % but there is no harm in adjusting the hyphenmin values regardless.
  8250. \global\lefthyphenmin = #2\relax
  8251. \global\righthyphenmin = #3\relax
  8252. }
  8253. % Helpers for encodings.
  8254. % Set the catcode of characters 128 through 255 to the specified number.
  8255. %
  8256. \def\setnonasciicharscatcode#1{%
  8257. \count255=128
  8258. \loop\ifnum\count255<256
  8259. \global\catcode\count255=#1\relax
  8260. \advance\count255 by 1
  8261. \repeat
  8262. }
  8263. \def\setnonasciicharscatcodenonglobal#1{%
  8264. \count255=128
  8265. \loop\ifnum\count255<256
  8266. \catcode\count255=#1\relax
  8267. \advance\count255 by 1
  8268. \repeat
  8269. }
  8270. % @documentencoding sets the definition of non-ASCII characters
  8271. % according to the specified encoding.
  8272. %
  8273. \parseargdef\documentencoding{%
  8274. % Encoding being declared for the document.
  8275. \def\declaredencoding{\csname #1.enc\endcsname}%
  8276. %
  8277. % Supported encodings: names converted to tokens in order to be able
  8278. % to compare them with \ifx.
  8279. \def\ascii{\csname US-ASCII.enc\endcsname}%
  8280. \def\latnine{\csname ISO-8859-15.enc\endcsname}%
  8281. \def\latone{\csname ISO-8859-1.enc\endcsname}%
  8282. \def\lattwo{\csname ISO-8859-2.enc\endcsname}%
  8283. \def\utfeight{\csname UTF-8.enc\endcsname}%
  8284. %
  8285. \ifx \declaredencoding \ascii
  8286. \asciichardefs
  8287. %
  8288. \else \ifx \declaredencoding \lattwo
  8289. \setnonasciicharscatcode\active
  8290. \lattwochardefs
  8291. %
  8292. \else \ifx \declaredencoding \latone
  8293. \setnonasciicharscatcode\active
  8294. \latonechardefs
  8295. %
  8296. \else \ifx \declaredencoding \latnine
  8297. \setnonasciicharscatcode\active
  8298. \latninechardefs
  8299. %
  8300. \else \ifx \declaredencoding \utfeight
  8301. \setnonasciicharscatcode\active
  8302. \utfeightchardefs
  8303. %
  8304. \else
  8305. \message{Unknown document encoding #1, ignoring.}%
  8306. %
  8307. \fi % utfeight
  8308. \fi % latnine
  8309. \fi % latone
  8310. \fi % lattwo
  8311. \fi % ascii
  8312. }
  8313. % A message to be logged when using a character that isn't available
  8314. % the default font encoding (OT1).
  8315. %
  8316. \def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}}
  8317. % Take account of \c (plain) vs. \, (Texinfo) difference.
  8318. \def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
  8319. % First, make active non-ASCII characters in order for them to be
  8320. % correctly categorized when TeX reads the replacement text of
  8321. % macros containing the character definitions.
  8322. \setnonasciicharscatcode\active
  8323. %
  8324. % Latin1 (ISO-8859-1) character definitions.
  8325. \def\latonechardefs{%
  8326. \gdef^^a0{\tie}
  8327. \gdef^^a1{\exclamdown}
  8328. \gdef^^a2{\missingcharmsg{CENT SIGN}}
  8329. \gdef^^a3{{\pounds}}
  8330. \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
  8331. \gdef^^a5{\missingcharmsg{YEN SIGN}}
  8332. \gdef^^a6{\missingcharmsg{BROKEN BAR}}
  8333. \gdef^^a7{\S}
  8334. \gdef^^a8{\"{}}
  8335. \gdef^^a9{\copyright}
  8336. \gdef^^aa{\ordf}
  8337. \gdef^^ab{\guillemetleft}
  8338. \gdef^^ac{$\lnot$}
  8339. \gdef^^ad{\-}
  8340. \gdef^^ae{\registeredsymbol}
  8341. \gdef^^af{\={}}
  8342. %
  8343. \gdef^^b0{\textdegree}
  8344. \gdef^^b1{$\pm$}
  8345. \gdef^^b2{$^2$}
  8346. \gdef^^b3{$^3$}
  8347. \gdef^^b4{\'{}}
  8348. \gdef^^b5{$\mu$}
  8349. \gdef^^b6{\P}
  8350. %
  8351. \gdef^^b7{$^.$}
  8352. \gdef^^b8{\cedilla\ }
  8353. \gdef^^b9{$^1$}
  8354. \gdef^^ba{\ordm}
  8355. %
  8356. \gdef^^bb{\guillemetright}
  8357. \gdef^^bc{$1\over4$}
  8358. \gdef^^bd{$1\over2$}
  8359. \gdef^^be{$3\over4$}
  8360. \gdef^^bf{\questiondown}
  8361. %
  8362. \gdef^^c0{\`A}
  8363. \gdef^^c1{\'A}
  8364. \gdef^^c2{\^A}
  8365. \gdef^^c3{\~A}
  8366. \gdef^^c4{\"A}
  8367. \gdef^^c5{\ringaccent A}
  8368. \gdef^^c6{\AE}
  8369. \gdef^^c7{\cedilla C}
  8370. \gdef^^c8{\`E}
  8371. \gdef^^c9{\'E}
  8372. \gdef^^ca{\^E}
  8373. \gdef^^cb{\"E}
  8374. \gdef^^cc{\`I}
  8375. \gdef^^cd{\'I}
  8376. \gdef^^ce{\^I}
  8377. \gdef^^cf{\"I}
  8378. %
  8379. \gdef^^d0{\DH}
  8380. \gdef^^d1{\~N}
  8381. \gdef^^d2{\`O}
  8382. \gdef^^d3{\'O}
  8383. \gdef^^d4{\^O}
  8384. \gdef^^d5{\~O}
  8385. \gdef^^d6{\"O}
  8386. \gdef^^d7{$\times$}
  8387. \gdef^^d8{\O}
  8388. \gdef^^d9{\`U}
  8389. \gdef^^da{\'U}
  8390. \gdef^^db{\^U}
  8391. \gdef^^dc{\"U}
  8392. \gdef^^dd{\'Y}
  8393. \gdef^^de{\TH}
  8394. \gdef^^df{\ss}
  8395. %
  8396. \gdef^^e0{\`a}
  8397. \gdef^^e1{\'a}
  8398. \gdef^^e2{\^a}
  8399. \gdef^^e3{\~a}
  8400. \gdef^^e4{\"a}
  8401. \gdef^^e5{\ringaccent a}
  8402. \gdef^^e6{\ae}
  8403. \gdef^^e7{\cedilla c}
  8404. \gdef^^e8{\`e}
  8405. \gdef^^e9{\'e}
  8406. \gdef^^ea{\^e}
  8407. \gdef^^eb{\"e}
  8408. \gdef^^ec{\`{\dotless i}}
  8409. \gdef^^ed{\'{\dotless i}}
  8410. \gdef^^ee{\^{\dotless i}}
  8411. \gdef^^ef{\"{\dotless i}}
  8412. %
  8413. \gdef^^f0{\dh}
  8414. \gdef^^f1{\~n}
  8415. \gdef^^f2{\`o}
  8416. \gdef^^f3{\'o}
  8417. \gdef^^f4{\^o}
  8418. \gdef^^f5{\~o}
  8419. \gdef^^f6{\"o}
  8420. \gdef^^f7{$\div$}
  8421. \gdef^^f8{\o}
  8422. \gdef^^f9{\`u}
  8423. \gdef^^fa{\'u}
  8424. \gdef^^fb{\^u}
  8425. \gdef^^fc{\"u}
  8426. \gdef^^fd{\'y}
  8427. \gdef^^fe{\th}
  8428. \gdef^^ff{\"y}
  8429. }
  8430. % Latin9 (ISO-8859-15) encoding character definitions.
  8431. \def\latninechardefs{%
  8432. % Encoding is almost identical to Latin1.
  8433. \latonechardefs
  8434. %
  8435. \gdef^^a4{\euro}
  8436. \gdef^^a6{\v S}
  8437. \gdef^^a8{\v s}
  8438. \gdef^^b4{\v Z}
  8439. \gdef^^b8{\v z}
  8440. \gdef^^bc{\OE}
  8441. \gdef^^bd{\oe}
  8442. \gdef^^be{\"Y}
  8443. }
  8444. % Latin2 (ISO-8859-2) character definitions.
  8445. \def\lattwochardefs{%
  8446. \gdef^^a0{\tie}
  8447. \gdef^^a1{\ogonek{A}}
  8448. \gdef^^a2{\u{}}
  8449. \gdef^^a3{\L}
  8450. \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
  8451. \gdef^^a5{\v L}
  8452. \gdef^^a6{\'S}
  8453. \gdef^^a7{\S}
  8454. \gdef^^a8{\"{}}
  8455. \gdef^^a9{\v S}
  8456. \gdef^^aa{\cedilla S}
  8457. \gdef^^ab{\v T}
  8458. \gdef^^ac{\'Z}
  8459. \gdef^^ad{\-}
  8460. \gdef^^ae{\v Z}
  8461. \gdef^^af{\dotaccent Z}
  8462. %
  8463. \gdef^^b0{\textdegree}
  8464. \gdef^^b1{\ogonek{a}}
  8465. \gdef^^b2{\ogonek{ }}
  8466. \gdef^^b3{\l}
  8467. \gdef^^b4{\'{}}
  8468. \gdef^^b5{\v l}
  8469. \gdef^^b6{\'s}
  8470. \gdef^^b7{\v{}}
  8471. \gdef^^b8{\cedilla\ }
  8472. \gdef^^b9{\v s}
  8473. \gdef^^ba{\cedilla s}
  8474. \gdef^^bb{\v t}
  8475. \gdef^^bc{\'z}
  8476. \gdef^^bd{\H{}}
  8477. \gdef^^be{\v z}
  8478. \gdef^^bf{\dotaccent z}
  8479. %
  8480. \gdef^^c0{\'R}
  8481. \gdef^^c1{\'A}
  8482. \gdef^^c2{\^A}
  8483. \gdef^^c3{\u A}
  8484. \gdef^^c4{\"A}
  8485. \gdef^^c5{\'L}
  8486. \gdef^^c6{\'C}
  8487. \gdef^^c7{\cedilla C}
  8488. \gdef^^c8{\v C}
  8489. \gdef^^c9{\'E}
  8490. \gdef^^ca{\ogonek{E}}
  8491. \gdef^^cb{\"E}
  8492. \gdef^^cc{\v E}
  8493. \gdef^^cd{\'I}
  8494. \gdef^^ce{\^I}
  8495. \gdef^^cf{\v D}
  8496. %
  8497. \gdef^^d0{\DH}
  8498. \gdef^^d1{\'N}
  8499. \gdef^^d2{\v N}
  8500. \gdef^^d3{\'O}
  8501. \gdef^^d4{\^O}
  8502. \gdef^^d5{\H O}
  8503. \gdef^^d6{\"O}
  8504. \gdef^^d7{$\times$}
  8505. \gdef^^d8{\v R}
  8506. \gdef^^d9{\ringaccent U}
  8507. \gdef^^da{\'U}
  8508. \gdef^^db{\H U}
  8509. \gdef^^dc{\"U}
  8510. \gdef^^dd{\'Y}
  8511. \gdef^^de{\cedilla T}
  8512. \gdef^^df{\ss}
  8513. %
  8514. \gdef^^e0{\'r}
  8515. \gdef^^e1{\'a}
  8516. \gdef^^e2{\^a}
  8517. \gdef^^e3{\u a}
  8518. \gdef^^e4{\"a}
  8519. \gdef^^e5{\'l}
  8520. \gdef^^e6{\'c}
  8521. \gdef^^e7{\cedilla c}
  8522. \gdef^^e8{\v c}
  8523. \gdef^^e9{\'e}
  8524. \gdef^^ea{\ogonek{e}}
  8525. \gdef^^eb{\"e}
  8526. \gdef^^ec{\v e}
  8527. \gdef^^ed{\'{\dotless{i}}}
  8528. \gdef^^ee{\^{\dotless{i}}}
  8529. \gdef^^ef{\v d}
  8530. %
  8531. \gdef^^f0{\dh}
  8532. \gdef^^f1{\'n}
  8533. \gdef^^f2{\v n}
  8534. \gdef^^f3{\'o}
  8535. \gdef^^f4{\^o}
  8536. \gdef^^f5{\H o}
  8537. \gdef^^f6{\"o}
  8538. \gdef^^f7{$\div$}
  8539. \gdef^^f8{\v r}
  8540. \gdef^^f9{\ringaccent u}
  8541. \gdef^^fa{\'u}
  8542. \gdef^^fb{\H u}
  8543. \gdef^^fc{\"u}
  8544. \gdef^^fd{\'y}
  8545. \gdef^^fe{\cedilla t}
  8546. \gdef^^ff{\dotaccent{}}
  8547. }
  8548. % UTF-8 character definitions.
  8549. %
  8550. % This code to support UTF-8 is based on LaTeX's utf8.def, with some
  8551. % changes for Texinfo conventions. It is included here under the GPL by
  8552. % permission from Frank Mittelbach and the LaTeX team.
  8553. %
  8554. \newcount\countUTFx
  8555. \newcount\countUTFy
  8556. \newcount\countUTFz
  8557. \gdef\UTFviiiTwoOctets#1#2{\expandafter
  8558. \UTFviiiDefined\csname u8:#1\string #2\endcsname}
  8559. %
  8560. \gdef\UTFviiiThreeOctets#1#2#3{\expandafter
  8561. \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname}
  8562. %
  8563. \gdef\UTFviiiFourOctets#1#2#3#4{\expandafter
  8564. \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname}
  8565. \gdef\UTFviiiDefined#1{%
  8566. \ifx #1\relax
  8567. \message{\linenumber Unicode char \string #1 not defined for Texinfo}%
  8568. \else
  8569. \expandafter #1%
  8570. \fi
  8571. }
  8572. \begingroup
  8573. \catcode`\~13
  8574. \catcode`\"12
  8575. \def\UTFviiiLoop{%
  8576. \global\catcode\countUTFx\active
  8577. \uccode`\~\countUTFx
  8578. \uppercase\expandafter{\UTFviiiTmp}%
  8579. \advance\countUTFx by 1
  8580. \ifnum\countUTFx < \countUTFy
  8581. \expandafter\UTFviiiLoop
  8582. \fi}
  8583. \countUTFx = "C2
  8584. \countUTFy = "E0
  8585. \def\UTFviiiTmp{%
  8586. \xdef~{\noexpand\UTFviiiTwoOctets\string~}}
  8587. \UTFviiiLoop
  8588. \countUTFx = "E0
  8589. \countUTFy = "F0
  8590. \def\UTFviiiTmp{%
  8591. \xdef~{\noexpand\UTFviiiThreeOctets\string~}}
  8592. \UTFviiiLoop
  8593. \countUTFx = "F0
  8594. \countUTFy = "F4
  8595. \def\UTFviiiTmp{%
  8596. \xdef~{\noexpand\UTFviiiFourOctets\string~}}
  8597. \UTFviiiLoop
  8598. \endgroup
  8599. \begingroup
  8600. \catcode`\"=12
  8601. \catcode`\<=12
  8602. \catcode`\.=12
  8603. \catcode`\,=12
  8604. \catcode`\;=12
  8605. \catcode`\!=12
  8606. \catcode`\~=13
  8607. \gdef\DeclareUnicodeCharacter#1#2{%
  8608. \countUTFz = "#1\relax
  8609. %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%
  8610. \begingroup
  8611. \parseXMLCharref
  8612. \def\UTFviiiTwoOctets##1##2{%
  8613. \csname u8:##1\string ##2\endcsname}%
  8614. \def\UTFviiiThreeOctets##1##2##3{%
  8615. \csname u8:##1\string ##2\string ##3\endcsname}%
  8616. \def\UTFviiiFourOctets##1##2##3##4{%
  8617. \csname u8:##1\string ##2\string ##3\string ##4\endcsname}%
  8618. \expandafter\expandafter\expandafter\expandafter
  8619. \expandafter\expandafter\expandafter
  8620. \gdef\UTFviiiTmp{#2}%
  8621. \endgroup}
  8622. \gdef\parseXMLCharref{%
  8623. \ifnum\countUTFz < "A0\relax
  8624. \errhelp = \EMsimple
  8625. \errmessage{Cannot define Unicode char value < 00A0}%
  8626. \else\ifnum\countUTFz < "800\relax
  8627. \parseUTFviiiA,%
  8628. \parseUTFviiiB C\UTFviiiTwoOctets.,%
  8629. \else\ifnum\countUTFz < "10000\relax
  8630. \parseUTFviiiA;%
  8631. \parseUTFviiiA,%
  8632. \parseUTFviiiB E\UTFviiiThreeOctets.{,;}%
  8633. \else
  8634. \parseUTFviiiA;%
  8635. \parseUTFviiiA,%
  8636. \parseUTFviiiA!%
  8637. \parseUTFviiiB F\UTFviiiFourOctets.{!,;}%
  8638. \fi\fi\fi
  8639. }
  8640. \gdef\parseUTFviiiA#1{%
  8641. \countUTFx = \countUTFz
  8642. \divide\countUTFz by 64
  8643. \countUTFy = \countUTFz
  8644. \multiply\countUTFz by 64
  8645. \advance\countUTFx by -\countUTFz
  8646. \advance\countUTFx by 128
  8647. \uccode `#1\countUTFx
  8648. \countUTFz = \countUTFy}
  8649. \gdef\parseUTFviiiB#1#2#3#4{%
  8650. \advance\countUTFz by "#10\relax
  8651. \uccode `#3\countUTFz
  8652. \uppercase{\gdef\UTFviiiTmp{#2#3#4}}}
  8653. \endgroup
  8654. \def\utfeightchardefs{%
  8655. \DeclareUnicodeCharacter{00A0}{\tie}
  8656. \DeclareUnicodeCharacter{00A1}{\exclamdown}
  8657. \DeclareUnicodeCharacter{00A3}{\pounds}
  8658. \DeclareUnicodeCharacter{00A8}{\"{ }}
  8659. \DeclareUnicodeCharacter{00A9}{\copyright}
  8660. \DeclareUnicodeCharacter{00AA}{\ordf}
  8661. \DeclareUnicodeCharacter{00AB}{\guillemetleft}
  8662. \DeclareUnicodeCharacter{00AD}{\-}
  8663. \DeclareUnicodeCharacter{00AE}{\registeredsymbol}
  8664. \DeclareUnicodeCharacter{00AF}{\={ }}
  8665. \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}
  8666. \DeclareUnicodeCharacter{00B4}{\'{ }}
  8667. \DeclareUnicodeCharacter{00B8}{\cedilla{ }}
  8668. \DeclareUnicodeCharacter{00BA}{\ordm}
  8669. \DeclareUnicodeCharacter{00BB}{\guillemetright}
  8670. \DeclareUnicodeCharacter{00BF}{\questiondown}
  8671. \DeclareUnicodeCharacter{00C0}{\`A}
  8672. \DeclareUnicodeCharacter{00C1}{\'A}
  8673. \DeclareUnicodeCharacter{00C2}{\^A}
  8674. \DeclareUnicodeCharacter{00C3}{\~A}
  8675. \DeclareUnicodeCharacter{00C4}{\"A}
  8676. \DeclareUnicodeCharacter{00C5}{\AA}
  8677. \DeclareUnicodeCharacter{00C6}{\AE}
  8678. \DeclareUnicodeCharacter{00C7}{\cedilla{C}}
  8679. \DeclareUnicodeCharacter{00C8}{\`E}
  8680. \DeclareUnicodeCharacter{00C9}{\'E}
  8681. \DeclareUnicodeCharacter{00CA}{\^E}
  8682. \DeclareUnicodeCharacter{00CB}{\"E}
  8683. \DeclareUnicodeCharacter{00CC}{\`I}
  8684. \DeclareUnicodeCharacter{00CD}{\'I}
  8685. \DeclareUnicodeCharacter{00CE}{\^I}
  8686. \DeclareUnicodeCharacter{00CF}{\"I}
  8687. \DeclareUnicodeCharacter{00D0}{\DH}
  8688. \DeclareUnicodeCharacter{00D1}{\~N}
  8689. \DeclareUnicodeCharacter{00D2}{\`O}
  8690. \DeclareUnicodeCharacter{00D3}{\'O}
  8691. \DeclareUnicodeCharacter{00D4}{\^O}
  8692. \DeclareUnicodeCharacter{00D5}{\~O}
  8693. \DeclareUnicodeCharacter{00D6}{\"O}
  8694. \DeclareUnicodeCharacter{00D8}{\O}
  8695. \DeclareUnicodeCharacter{00D9}{\`U}
  8696. \DeclareUnicodeCharacter{00DA}{\'U}
  8697. \DeclareUnicodeCharacter{00DB}{\^U}
  8698. \DeclareUnicodeCharacter{00DC}{\"U}
  8699. \DeclareUnicodeCharacter{00DD}{\'Y}
  8700. \DeclareUnicodeCharacter{00DE}{\TH}
  8701. \DeclareUnicodeCharacter{00DF}{\ss}
  8702. \DeclareUnicodeCharacter{00E0}{\`a}
  8703. \DeclareUnicodeCharacter{00E1}{\'a}
  8704. \DeclareUnicodeCharacter{00E2}{\^a}
  8705. \DeclareUnicodeCharacter{00E3}{\~a}
  8706. \DeclareUnicodeCharacter{00E4}{\"a}
  8707. \DeclareUnicodeCharacter{00E5}{\aa}
  8708. \DeclareUnicodeCharacter{00E6}{\ae}
  8709. \DeclareUnicodeCharacter{00E7}{\cedilla{c}}
  8710. \DeclareUnicodeCharacter{00E8}{\`e}
  8711. \DeclareUnicodeCharacter{00E9}{\'e}
  8712. \DeclareUnicodeCharacter{00EA}{\^e}
  8713. \DeclareUnicodeCharacter{00EB}{\"e}
  8714. \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}
  8715. \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}
  8716. \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}
  8717. \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}
  8718. \DeclareUnicodeCharacter{00F0}{\dh}
  8719. \DeclareUnicodeCharacter{00F1}{\~n}
  8720. \DeclareUnicodeCharacter{00F2}{\`o}
  8721. \DeclareUnicodeCharacter{00F3}{\'o}
  8722. \DeclareUnicodeCharacter{00F4}{\^o}
  8723. \DeclareUnicodeCharacter{00F5}{\~o}
  8724. \DeclareUnicodeCharacter{00F6}{\"o}
  8725. \DeclareUnicodeCharacter{00F8}{\o}
  8726. \DeclareUnicodeCharacter{00F9}{\`u}
  8727. \DeclareUnicodeCharacter{00FA}{\'u}
  8728. \DeclareUnicodeCharacter{00FB}{\^u}
  8729. \DeclareUnicodeCharacter{00FC}{\"u}
  8730. \DeclareUnicodeCharacter{00FD}{\'y}
  8731. \DeclareUnicodeCharacter{00FE}{\th}
  8732. \DeclareUnicodeCharacter{00FF}{\"y}
  8733. \DeclareUnicodeCharacter{0100}{\=A}
  8734. \DeclareUnicodeCharacter{0101}{\=a}
  8735. \DeclareUnicodeCharacter{0102}{\u{A}}
  8736. \DeclareUnicodeCharacter{0103}{\u{a}}
  8737. \DeclareUnicodeCharacter{0104}{\ogonek{A}}
  8738. \DeclareUnicodeCharacter{0105}{\ogonek{a}}
  8739. \DeclareUnicodeCharacter{0106}{\'C}
  8740. \DeclareUnicodeCharacter{0107}{\'c}
  8741. \DeclareUnicodeCharacter{0108}{\^C}
  8742. \DeclareUnicodeCharacter{0109}{\^c}
  8743. \DeclareUnicodeCharacter{0118}{\ogonek{E}}
  8744. \DeclareUnicodeCharacter{0119}{\ogonek{e}}
  8745. \DeclareUnicodeCharacter{010A}{\dotaccent{C}}
  8746. \DeclareUnicodeCharacter{010B}{\dotaccent{c}}
  8747. \DeclareUnicodeCharacter{010C}{\v{C}}
  8748. \DeclareUnicodeCharacter{010D}{\v{c}}
  8749. \DeclareUnicodeCharacter{010E}{\v{D}}
  8750. \DeclareUnicodeCharacter{0112}{\=E}
  8751. \DeclareUnicodeCharacter{0113}{\=e}
  8752. \DeclareUnicodeCharacter{0114}{\u{E}}
  8753. \DeclareUnicodeCharacter{0115}{\u{e}}
  8754. \DeclareUnicodeCharacter{0116}{\dotaccent{E}}
  8755. \DeclareUnicodeCharacter{0117}{\dotaccent{e}}
  8756. \DeclareUnicodeCharacter{011A}{\v{E}}
  8757. \DeclareUnicodeCharacter{011B}{\v{e}}
  8758. \DeclareUnicodeCharacter{011C}{\^G}
  8759. \DeclareUnicodeCharacter{011D}{\^g}
  8760. \DeclareUnicodeCharacter{011E}{\u{G}}
  8761. \DeclareUnicodeCharacter{011F}{\u{g}}
  8762. \DeclareUnicodeCharacter{0120}{\dotaccent{G}}
  8763. \DeclareUnicodeCharacter{0121}{\dotaccent{g}}
  8764. \DeclareUnicodeCharacter{0124}{\^H}
  8765. \DeclareUnicodeCharacter{0125}{\^h}
  8766. \DeclareUnicodeCharacter{0128}{\~I}
  8767. \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}
  8768. \DeclareUnicodeCharacter{012A}{\=I}
  8769. \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}
  8770. \DeclareUnicodeCharacter{012C}{\u{I}}
  8771. \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}
  8772. \DeclareUnicodeCharacter{0130}{\dotaccent{I}}
  8773. \DeclareUnicodeCharacter{0131}{\dotless{i}}
  8774. \DeclareUnicodeCharacter{0132}{IJ}
  8775. \DeclareUnicodeCharacter{0133}{ij}
  8776. \DeclareUnicodeCharacter{0134}{\^J}
  8777. \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}
  8778. \DeclareUnicodeCharacter{0139}{\'L}
  8779. \DeclareUnicodeCharacter{013A}{\'l}
  8780. \DeclareUnicodeCharacter{0141}{\L}
  8781. \DeclareUnicodeCharacter{0142}{\l}
  8782. \DeclareUnicodeCharacter{0143}{\'N}
  8783. \DeclareUnicodeCharacter{0144}{\'n}
  8784. \DeclareUnicodeCharacter{0147}{\v{N}}
  8785. \DeclareUnicodeCharacter{0148}{\v{n}}
  8786. \DeclareUnicodeCharacter{014C}{\=O}
  8787. \DeclareUnicodeCharacter{014D}{\=o}
  8788. \DeclareUnicodeCharacter{014E}{\u{O}}
  8789. \DeclareUnicodeCharacter{014F}{\u{o}}
  8790. \DeclareUnicodeCharacter{0150}{\H{O}}
  8791. \DeclareUnicodeCharacter{0151}{\H{o}}
  8792. \DeclareUnicodeCharacter{0152}{\OE}
  8793. \DeclareUnicodeCharacter{0153}{\oe}
  8794. \DeclareUnicodeCharacter{0154}{\'R}
  8795. \DeclareUnicodeCharacter{0155}{\'r}
  8796. \DeclareUnicodeCharacter{0158}{\v{R}}
  8797. \DeclareUnicodeCharacter{0159}{\v{r}}
  8798. \DeclareUnicodeCharacter{015A}{\'S}
  8799. \DeclareUnicodeCharacter{015B}{\'s}
  8800. \DeclareUnicodeCharacter{015C}{\^S}
  8801. \DeclareUnicodeCharacter{015D}{\^s}
  8802. \DeclareUnicodeCharacter{015E}{\cedilla{S}}
  8803. \DeclareUnicodeCharacter{015F}{\cedilla{s}}
  8804. \DeclareUnicodeCharacter{0160}{\v{S}}
  8805. \DeclareUnicodeCharacter{0161}{\v{s}}
  8806. \DeclareUnicodeCharacter{0162}{\cedilla{t}}
  8807. \DeclareUnicodeCharacter{0163}{\cedilla{T}}
  8808. \DeclareUnicodeCharacter{0164}{\v{T}}
  8809. \DeclareUnicodeCharacter{0168}{\~U}
  8810. \DeclareUnicodeCharacter{0169}{\~u}
  8811. \DeclareUnicodeCharacter{016A}{\=U}
  8812. \DeclareUnicodeCharacter{016B}{\=u}
  8813. \DeclareUnicodeCharacter{016C}{\u{U}}
  8814. \DeclareUnicodeCharacter{016D}{\u{u}}
  8815. \DeclareUnicodeCharacter{016E}{\ringaccent{U}}
  8816. \DeclareUnicodeCharacter{016F}{\ringaccent{u}}
  8817. \DeclareUnicodeCharacter{0170}{\H{U}}
  8818. \DeclareUnicodeCharacter{0171}{\H{u}}
  8819. \DeclareUnicodeCharacter{0174}{\^W}
  8820. \DeclareUnicodeCharacter{0175}{\^w}
  8821. \DeclareUnicodeCharacter{0176}{\^Y}
  8822. \DeclareUnicodeCharacter{0177}{\^y}
  8823. \DeclareUnicodeCharacter{0178}{\"Y}
  8824. \DeclareUnicodeCharacter{0179}{\'Z}
  8825. \DeclareUnicodeCharacter{017A}{\'z}
  8826. \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}
  8827. \DeclareUnicodeCharacter{017C}{\dotaccent{z}}
  8828. \DeclareUnicodeCharacter{017D}{\v{Z}}
  8829. \DeclareUnicodeCharacter{017E}{\v{z}}
  8830. \DeclareUnicodeCharacter{01C4}{D\v{Z}}
  8831. \DeclareUnicodeCharacter{01C5}{D\v{z}}
  8832. \DeclareUnicodeCharacter{01C6}{d\v{z}}
  8833. \DeclareUnicodeCharacter{01C7}{LJ}
  8834. \DeclareUnicodeCharacter{01C8}{Lj}
  8835. \DeclareUnicodeCharacter{01C9}{lj}
  8836. \DeclareUnicodeCharacter{01CA}{NJ}
  8837. \DeclareUnicodeCharacter{01CB}{Nj}
  8838. \DeclareUnicodeCharacter{01CC}{nj}
  8839. \DeclareUnicodeCharacter{01CD}{\v{A}}
  8840. \DeclareUnicodeCharacter{01CE}{\v{a}}
  8841. \DeclareUnicodeCharacter{01CF}{\v{I}}
  8842. \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}
  8843. \DeclareUnicodeCharacter{01D1}{\v{O}}
  8844. \DeclareUnicodeCharacter{01D2}{\v{o}}
  8845. \DeclareUnicodeCharacter{01D3}{\v{U}}
  8846. \DeclareUnicodeCharacter{01D4}{\v{u}}
  8847. \DeclareUnicodeCharacter{01E2}{\={\AE}}
  8848. \DeclareUnicodeCharacter{01E3}{\={\ae}}
  8849. \DeclareUnicodeCharacter{01E6}{\v{G}}
  8850. \DeclareUnicodeCharacter{01E7}{\v{g}}
  8851. \DeclareUnicodeCharacter{01E8}{\v{K}}
  8852. \DeclareUnicodeCharacter{01E9}{\v{k}}
  8853. \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}
  8854. \DeclareUnicodeCharacter{01F1}{DZ}
  8855. \DeclareUnicodeCharacter{01F2}{Dz}
  8856. \DeclareUnicodeCharacter{01F3}{dz}
  8857. \DeclareUnicodeCharacter{01F4}{\'G}
  8858. \DeclareUnicodeCharacter{01F5}{\'g}
  8859. \DeclareUnicodeCharacter{01F8}{\`N}
  8860. \DeclareUnicodeCharacter{01F9}{\`n}
  8861. \DeclareUnicodeCharacter{01FC}{\'{\AE}}
  8862. \DeclareUnicodeCharacter{01FD}{\'{\ae}}
  8863. \DeclareUnicodeCharacter{01FE}{\'{\O}}
  8864. \DeclareUnicodeCharacter{01FF}{\'{\o}}
  8865. \DeclareUnicodeCharacter{021E}{\v{H}}
  8866. \DeclareUnicodeCharacter{021F}{\v{h}}
  8867. \DeclareUnicodeCharacter{0226}{\dotaccent{A}}
  8868. \DeclareUnicodeCharacter{0227}{\dotaccent{a}}
  8869. \DeclareUnicodeCharacter{0228}{\cedilla{E}}
  8870. \DeclareUnicodeCharacter{0229}{\cedilla{e}}
  8871. \DeclareUnicodeCharacter{022E}{\dotaccent{O}}
  8872. \DeclareUnicodeCharacter{022F}{\dotaccent{o}}
  8873. \DeclareUnicodeCharacter{0232}{\=Y}
  8874. \DeclareUnicodeCharacter{0233}{\=y}
  8875. \DeclareUnicodeCharacter{0237}{\dotless{j}}
  8876. \DeclareUnicodeCharacter{02DB}{\ogonek{ }}
  8877. \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}
  8878. \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}
  8879. \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}
  8880. \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}
  8881. \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}
  8882. \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}
  8883. \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}
  8884. \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}
  8885. \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}
  8886. \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}
  8887. \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}
  8888. \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}
  8889. \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}
  8890. \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}
  8891. \DeclareUnicodeCharacter{1E20}{\=G}
  8892. \DeclareUnicodeCharacter{1E21}{\=g}
  8893. \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}
  8894. \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}
  8895. \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}
  8896. \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}
  8897. \DeclareUnicodeCharacter{1E26}{\"H}
  8898. \DeclareUnicodeCharacter{1E27}{\"h}
  8899. \DeclareUnicodeCharacter{1E30}{\'K}
  8900. \DeclareUnicodeCharacter{1E31}{\'k}
  8901. \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}
  8902. \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}
  8903. \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}
  8904. \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}
  8905. \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}
  8906. \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}
  8907. \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}
  8908. \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}
  8909. \DeclareUnicodeCharacter{1E3E}{\'M}
  8910. \DeclareUnicodeCharacter{1E3F}{\'m}
  8911. \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}
  8912. \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}
  8913. \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}
  8914. \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}
  8915. \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}
  8916. \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}
  8917. \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}
  8918. \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}
  8919. \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}
  8920. \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}
  8921. \DeclareUnicodeCharacter{1E54}{\'P}
  8922. \DeclareUnicodeCharacter{1E55}{\'p}
  8923. \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}
  8924. \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}
  8925. \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}
  8926. \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}
  8927. \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}
  8928. \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}
  8929. \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}
  8930. \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}
  8931. \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}
  8932. \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}
  8933. \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}
  8934. \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}
  8935. \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}
  8936. \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}
  8937. \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}
  8938. \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}
  8939. \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}
  8940. \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}
  8941. \DeclareUnicodeCharacter{1E7C}{\~V}
  8942. \DeclareUnicodeCharacter{1E7D}{\~v}
  8943. \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}
  8944. \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}
  8945. \DeclareUnicodeCharacter{1E80}{\`W}
  8946. \DeclareUnicodeCharacter{1E81}{\`w}
  8947. \DeclareUnicodeCharacter{1E82}{\'W}
  8948. \DeclareUnicodeCharacter{1E83}{\'w}
  8949. \DeclareUnicodeCharacter{1E84}{\"W}
  8950. \DeclareUnicodeCharacter{1E85}{\"w}
  8951. \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}
  8952. \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}
  8953. \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}
  8954. \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}
  8955. \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}
  8956. \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}
  8957. \DeclareUnicodeCharacter{1E8C}{\"X}
  8958. \DeclareUnicodeCharacter{1E8D}{\"x}
  8959. \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}
  8960. \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}
  8961. \DeclareUnicodeCharacter{1E90}{\^Z}
  8962. \DeclareUnicodeCharacter{1E91}{\^z}
  8963. \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}
  8964. \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}
  8965. \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}
  8966. \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}
  8967. \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}
  8968. \DeclareUnicodeCharacter{1E97}{\"t}
  8969. \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}
  8970. \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}
  8971. \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}
  8972. \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}
  8973. \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}
  8974. \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}
  8975. \DeclareUnicodeCharacter{1EBC}{\~E}
  8976. \DeclareUnicodeCharacter{1EBD}{\~e}
  8977. \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}
  8978. \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}
  8979. \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}
  8980. \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}
  8981. \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}
  8982. \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}
  8983. \DeclareUnicodeCharacter{1EF2}{\`Y}
  8984. \DeclareUnicodeCharacter{1EF3}{\`y}
  8985. \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}
  8986. \DeclareUnicodeCharacter{1EF8}{\~Y}
  8987. \DeclareUnicodeCharacter{1EF9}{\~y}
  8988. \DeclareUnicodeCharacter{2013}{--}
  8989. \DeclareUnicodeCharacter{2014}{---}
  8990. \DeclareUnicodeCharacter{2018}{\quoteleft}
  8991. \DeclareUnicodeCharacter{2019}{\quoteright}
  8992. \DeclareUnicodeCharacter{201A}{\quotesinglbase}
  8993. \DeclareUnicodeCharacter{201C}{\quotedblleft}
  8994. \DeclareUnicodeCharacter{201D}{\quotedblright}
  8995. \DeclareUnicodeCharacter{201E}{\quotedblbase}
  8996. \DeclareUnicodeCharacter{2022}{\bullet}
  8997. \DeclareUnicodeCharacter{2026}{\dots}
  8998. \DeclareUnicodeCharacter{2039}{\guilsinglleft}
  8999. \DeclareUnicodeCharacter{203A}{\guilsinglright}
  9000. \DeclareUnicodeCharacter{20AC}{\euro}
  9001. \DeclareUnicodeCharacter{2192}{\expansion}
  9002. \DeclareUnicodeCharacter{21D2}{\result}
  9003. \DeclareUnicodeCharacter{2212}{\minus}
  9004. \DeclareUnicodeCharacter{2217}{\point}
  9005. \DeclareUnicodeCharacter{2261}{\equiv}
  9006. }% end of \utfeightchardefs
  9007. % US-ASCII character definitions.
  9008. \def\asciichardefs{% nothing need be done
  9009. \relax
  9010. }
  9011. % Make non-ASCII characters printable again for compatibility with
  9012. % existing Texinfo documents that may use them, even without declaring a
  9013. % document encoding.
  9014. %
  9015. \setnonasciicharscatcode \other
  9016. \message{formatting,}
  9017. \newdimen\defaultparindent \defaultparindent = 15pt
  9018. \chapheadingskip = 15pt plus 4pt minus 2pt
  9019. \secheadingskip = 12pt plus 3pt minus 2pt
  9020. \subsecheadingskip = 9pt plus 2pt minus 2pt
  9021. % Prevent underfull vbox error messages.
  9022. \vbadness = 10000
  9023. % Don't be very finicky about underfull hboxes, either.
  9024. \hbadness = 6666
  9025. % Following George Bush, get rid of widows and orphans.
  9026. \widowpenalty=10000
  9027. \clubpenalty=10000
  9028. % Use TeX 3.0's \emergencystretch to help line breaking, but if we're
  9029. % using an old version of TeX, don't do anything. We want the amount of
  9030. % stretch added to depend on the line length, hence the dependence on
  9031. % \hsize. We call this whenever the paper size is set.
  9032. %
  9033. \def\setemergencystretch{%
  9034. \ifx\emergencystretch\thisisundefined
  9035. % Allow us to assign to \emergencystretch anyway.
  9036. \def\emergencystretch{\dimen0}%
  9037. \else
  9038. \emergencystretch = .15\hsize
  9039. \fi
  9040. }
  9041. % Parameters in order: 1) textheight; 2) textwidth;
  9042. % 3) voffset; 4) hoffset; 5) binding offset; 6) topskip;
  9043. % 7) physical page height; 8) physical page width.
  9044. %
  9045. % We also call \setleading{\textleading}, so the caller should define
  9046. % \textleading. The caller should also set \parskip.
  9047. %
  9048. \def\internalpagesizes#1#2#3#4#5#6#7#8{%
  9049. \voffset = #3\relax
  9050. \topskip = #6\relax
  9051. \splittopskip = \topskip
  9052. %
  9053. \vsize = #1\relax
  9054. \advance\vsize by \topskip
  9055. \outervsize = \vsize
  9056. \advance\outervsize by 2\topandbottommargin
  9057. \pageheight = \vsize
  9058. %
  9059. \hsize = #2\relax
  9060. \outerhsize = \hsize
  9061. \advance\outerhsize by 0.5in
  9062. \pagewidth = \hsize
  9063. %
  9064. \normaloffset = #4\relax
  9065. \bindingoffset = #5\relax
  9066. %
  9067. \ifpdf
  9068. \pdfpageheight #7\relax
  9069. \pdfpagewidth #8\relax
  9070. % if we don't reset these, they will remain at "1 true in" of
  9071. % whatever layout pdftex was dumped with.
  9072. \pdfhorigin = 1 true in
  9073. \pdfvorigin = 1 true in
  9074. \fi
  9075. %
  9076. \setleading{\textleading}
  9077. %
  9078. \parindent = \defaultparindent
  9079. \setemergencystretch
  9080. }
  9081. % @letterpaper (the default).
  9082. \def\letterpaper{{\globaldefs = 1
  9083. \parskip = 3pt plus 2pt minus 1pt
  9084. \textleading = 13.2pt
  9085. %
  9086. % If page is nothing but text, make it come out even.
  9087. \internalpagesizes{607.2pt}{6in}% that's 46 lines
  9088. {\voffset}{.25in}%
  9089. {\bindingoffset}{36pt}%
  9090. {11in}{8.5in}%
  9091. }}
  9092. % Use @smallbook to reset parameters for 7x9.25 trim size.
  9093. \def\smallbook{{\globaldefs = 1
  9094. \parskip = 2pt plus 1pt
  9095. \textleading = 12pt
  9096. %
  9097. \internalpagesizes{7.5in}{5in}%
  9098. {-.2in}{0in}%
  9099. {\bindingoffset}{16pt}%
  9100. {9.25in}{7in}%
  9101. %
  9102. \lispnarrowing = 0.3in
  9103. \tolerance = 700
  9104. \hfuzz = 1pt
  9105. \contentsrightmargin = 0pt
  9106. \defbodyindent = .5cm
  9107. }}
  9108. % Use @smallerbook to reset parameters for 6x9 trim size.
  9109. % (Just testing, parameters still in flux.)
  9110. \def\smallerbook{{\globaldefs = 1
  9111. \parskip = 1.5pt plus 1pt
  9112. \textleading = 12pt
  9113. %
  9114. \internalpagesizes{7.4in}{4.8in}%
  9115. {-.2in}{-.4in}%
  9116. {0pt}{14pt}%
  9117. {9in}{6in}%
  9118. %
  9119. \lispnarrowing = 0.25in
  9120. \tolerance = 700
  9121. \hfuzz = 1pt
  9122. \contentsrightmargin = 0pt
  9123. \defbodyindent = .4cm
  9124. }}
  9125. % Use @afourpaper to print on European A4 paper.
  9126. \def\afourpaper{{\globaldefs = 1
  9127. \parskip = 3pt plus 2pt minus 1pt
  9128. \textleading = 13.2pt
  9129. %
  9130. % Double-side printing via postscript on Laserjet 4050
  9131. % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
  9132. % To change the settings for a different printer or situation, adjust
  9133. % \normaloffset until the front-side and back-side texts align. Then
  9134. % do the same for \bindingoffset. You can set these for testing in
  9135. % your texinfo source file like this:
  9136. % @tex
  9137. % \global\normaloffset = -6mm
  9138. % \global\bindingoffset = 10mm
  9139. % @end tex
  9140. \internalpagesizes{673.2pt}{160mm}% that's 51 lines
  9141. {\voffset}{\hoffset}%
  9142. {\bindingoffset}{44pt}%
  9143. {297mm}{210mm}%
  9144. %
  9145. \tolerance = 700
  9146. \hfuzz = 1pt
  9147. \contentsrightmargin = 0pt
  9148. \defbodyindent = 5mm
  9149. }}
  9150. % Use @afivepaper to print on European A5 paper.
  9151. % From romildo@urano.iceb.ufop.br, 2 July 2000.
  9152. % He also recommends making @example and @lisp be small.
  9153. \def\afivepaper{{\globaldefs = 1
  9154. \parskip = 2pt plus 1pt minus 0.1pt
  9155. \textleading = 12.5pt
  9156. %
  9157. \internalpagesizes{160mm}{120mm}%
  9158. {\voffset}{\hoffset}%
  9159. {\bindingoffset}{8pt}%
  9160. {210mm}{148mm}%
  9161. %
  9162. \lispnarrowing = 0.2in
  9163. \tolerance = 800
  9164. \hfuzz = 1.2pt
  9165. \contentsrightmargin = 0pt
  9166. \defbodyindent = 2mm
  9167. \tableindent = 12mm
  9168. }}
  9169. % A specific text layout, 24x15cm overall, intended for A4 paper.
  9170. \def\afourlatex{{\globaldefs = 1
  9171. \afourpaper
  9172. \internalpagesizes{237mm}{150mm}%
  9173. {\voffset}{4.6mm}%
  9174. {\bindingoffset}{7mm}%
  9175. {297mm}{210mm}%
  9176. %
  9177. % Must explicitly reset to 0 because we call \afourpaper.
  9178. \globaldefs = 0
  9179. }}
  9180. % Use @afourwide to print on A4 paper in landscape format.
  9181. \def\afourwide{{\globaldefs = 1
  9182. \afourpaper
  9183. \internalpagesizes{241mm}{165mm}%
  9184. {\voffset}{-2.95mm}%
  9185. {\bindingoffset}{7mm}%
  9186. {297mm}{210mm}%
  9187. \globaldefs = 0
  9188. }}
  9189. % @pagesizes TEXTHEIGHT[,TEXTWIDTH]
  9190. % Perhaps we should allow setting the margins, \topskip, \parskip,
  9191. % and/or leading, also. Or perhaps we should compute them somehow.
  9192. %
  9193. \parseargdef\pagesizes{\pagesizesyyy #1,,\finish}
  9194. \def\pagesizesyyy#1,#2,#3\finish{{%
  9195. \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
  9196. \globaldefs = 1
  9197. %
  9198. \parskip = 3pt plus 2pt minus 1pt
  9199. \setleading{\textleading}%
  9200. %
  9201. \dimen0 = #1\relax
  9202. \advance\dimen0 by \voffset
  9203. %
  9204. \dimen2 = \hsize
  9205. \advance\dimen2 by \normaloffset
  9206. %
  9207. \internalpagesizes{#1}{\hsize}%
  9208. {\voffset}{\normaloffset}%
  9209. {\bindingoffset}{44pt}%
  9210. {\dimen0}{\dimen2}%
  9211. }}
  9212. % Set default to letter.
  9213. %
  9214. \letterpaper
  9215. \message{and turning on texinfo input format.}
  9216. \def^^L{\par} % remove \outer, so ^L can appear in an @comment
  9217. % DEL is a comment character, in case @c does not suffice.
  9218. \catcode`\^^? = 14
  9219. % Define macros to output various characters with catcode for normal text.
  9220. \catcode`\"=\other \def\normaldoublequote{"}
  9221. \catcode`\$=\other \def\normaldollar{$}%$ font-lock fix
  9222. \catcode`\+=\other \def\normalplus{+}
  9223. \catcode`\<=\other \def\normalless{<}
  9224. \catcode`\>=\other \def\normalgreater{>}
  9225. \catcode`\^=\other \def\normalcaret{^}
  9226. \catcode`\_=\other \def\normalunderscore{_}
  9227. \catcode`\|=\other \def\normalverticalbar{|}
  9228. \catcode`\~=\other \def\normaltilde{~}
  9229. % This macro is used to make a character print one way in \tt
  9230. % (where it can probably be output as-is), and another way in other fonts,
  9231. % where something hairier probably needs to be done.
  9232. %
  9233. % #1 is what to print if we are indeed using \tt; #2 is what to print
  9234. % otherwise. Since all the Computer Modern typewriter fonts have zero
  9235. % interword stretch (and shrink), and it is reasonable to expect all
  9236. % typewriter fonts to have this, we can check that font parameter.
  9237. %
  9238. \def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
  9239. % Same as above, but check for italic font. Actually this also catches
  9240. % non-italic slanted fonts since it is impossible to distinguish them from
  9241. % italic fonts. But since this is only used by $ and it uses \sl anyway
  9242. % this is not a problem.
  9243. \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
  9244. % Turn off all special characters except @
  9245. % (and those which the user can use as if they were ordinary).
  9246. % Most of these we simply print from the \tt font, but for some, we can
  9247. % use math or other variants that look better in normal text.
  9248. \catcode`\"=\active
  9249. \def\activedoublequote{{\tt\char34}}
  9250. \let"=\activedoublequote
  9251. \catcode`\~=\active \def\activetilde{{\tt\char126}} \let~ = \activetilde
  9252. \chardef\hat=`\^
  9253. \catcode`\^=\active \def\activehat{{\tt \hat}} \let^ = \activehat
  9254. \catcode`\_=\active
  9255. \def_{\ifusingtt\normalunderscore\_}
  9256. \let\realunder=_
  9257. % Subroutine for the previous macro.
  9258. \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
  9259. \catcode`\|=\active
  9260. \def|{{\tt\char124}}
  9261. \chardef \less=`\<
  9262. \catcode`\<=\active \def\activeless{{\tt \less}}\let< = \activeless
  9263. \chardef \gtr=`\>
  9264. \catcode`\>=\active \def\activegtr{{\tt \gtr}}\let> = \activegtr
  9265. \catcode`\+=\active \def+{{\tt \char 43}}
  9266. \catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
  9267. % used for headline/footline in the output routine, in case the page
  9268. % breaks in the middle of an @tex block.
  9269. \def\texinfochars{%
  9270. \let< = \activeless
  9271. \let> = \activegtr
  9272. \let~ = \activetilde
  9273. \let^ = \activehat
  9274. \markupsetuplqdefault \markupsetuprqdefault
  9275. \let\b = \strong
  9276. \let\i = \smartitalic
  9277. % in principle, all other definitions in \tex have to be undone too.
  9278. }
  9279. % If a .fmt file is being used, characters that might appear in a file
  9280. % name cannot be active until we have parsed the command line.
  9281. % So turn them off again, and have \everyjob (or @setfilename) turn them on.
  9282. % \otherifyactive is called near the end of this file.
  9283. \def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
  9284. % Used sometimes to turn off (effectively) the active characters even after
  9285. % parsing them.
  9286. \def\turnoffactive{%
  9287. \normalturnoffactive
  9288. \otherbackslash
  9289. }
  9290. \catcode`\@=0
  9291. % \backslashcurfont outputs one backslash character in current font,
  9292. % as in \char`\\.
  9293. \global\chardef\backslashcurfont=`\\
  9294. \global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work
  9295. % \realbackslash is an actual character `\' with catcode other, and
  9296. % \doublebackslash is two of them (for the pdf outlines).
  9297. {\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}}
  9298. % In texinfo, backslash is an active character; it prints the backslash
  9299. % in fixed width font.
  9300. \catcode`\\=\active % @ for escape char from now on.
  9301. % The story here is that in math mode, the \char of \backslashcurfont
  9302. % ends up printing the roman \ from the math symbol font (because \char
  9303. % in math mode uses the \mathcode, and plain.tex sets
  9304. % \mathcode`\\="026E). It seems better for @backslashchar{} to always
  9305. % print a typewriter backslash, hence we use an explicit \mathchar,
  9306. % which is the decimal equivalent of "715c (class 7, e.g., use \fam;
  9307. % ignored family value; char position "5C). We can't use " for the
  9308. % usual hex value because it has already been made active.
  9309. @def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}}
  9310. @let@backslashchar = @normalbackslash % @backslashchar{} is for user documents.
  9311. % On startup, @fixbackslash assigns:
  9312. % @let \ = @normalbackslash
  9313. % \rawbackslash defines an active \ to do \backslashcurfont.
  9314. % \otherbackslash defines an active \ to be a literal `\' character with
  9315. % catcode other. We switch back and forth between these.
  9316. @gdef@rawbackslash{@let\=@backslashcurfont}
  9317. @gdef@otherbackslash{@let\=@realbackslash}
  9318. % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
  9319. % the literal character `\'. Also revert - to its normal character, in
  9320. % case the active - from code has slipped in.
  9321. %
  9322. {@catcode`- = @active
  9323. @gdef@normalturnoffactive{%
  9324. @let-=@normaldash
  9325. @let"=@normaldoublequote
  9326. @let$=@normaldollar %$ font-lock fix
  9327. @let+=@normalplus
  9328. @let<=@normalless
  9329. @let>=@normalgreater
  9330. @let\=@normalbackslash
  9331. @let^=@normalcaret
  9332. @let_=@normalunderscore
  9333. @let|=@normalverticalbar
  9334. @let~=@normaltilde
  9335. @markupsetuplqdefault
  9336. @markupsetuprqdefault
  9337. @unsepspaces
  9338. }
  9339. }
  9340. % Make _ and + \other characters, temporarily.
  9341. % This is canceled by @fixbackslash.
  9342. @otherifyactive
  9343. % If a .fmt file is being used, we don't want the `\input texinfo' to show up.
  9344. % That is what \eatinput is for; after that, the `\' should revert to printing
  9345. % a backslash.
  9346. %
  9347. @gdef@eatinput input texinfo{@fixbackslash}
  9348. @global@let\ = @eatinput
  9349. % On the other hand, perhaps the file did not have a `\input texinfo'. Then
  9350. % the first `\' in the file would cause an error. This macro tries to fix
  9351. % that, assuming it is called before the first `\' could plausibly occur.
  9352. % Also turn back on active characters that might appear in the input
  9353. % file name, in case not using a pre-dumped format.
  9354. %
  9355. @gdef@fixbackslash{%
  9356. @ifx\@eatinput @let\ = @normalbackslash @fi
  9357. @catcode`+=@active
  9358. @catcode`@_=@active
  9359. }
  9360. % Say @foo, not \foo, in error messages.
  9361. @escapechar = `@@
  9362. % These (along with & and #) are made active for url-breaking, so need
  9363. % active definitions as the normal characters.
  9364. @def@normaldot{.}
  9365. @def@normalquest{?}
  9366. @def@normalslash{/}
  9367. % These look ok in all fonts, so just make them not special.
  9368. % @hashchar{} gets its own user-level command, because of #line.
  9369. @catcode`@& = @other @def@normalamp{&}
  9370. @catcode`@# = @other @def@normalhash{#}
  9371. @catcode`@% = @other @def@normalpercent{%}
  9372. @let @hashchar = @normalhash
  9373. @c Finally, make ` and ' active, so that txicodequoteundirected and
  9374. @c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we
  9375. @c don't make ` and ' active, @code will not get them as active chars.
  9376. @c Do this last of all since we use ` in the previous @catcode assignments.
  9377. @catcode`@'=@active
  9378. @catcode`@`=@active
  9379. @markupsetuplqdefault
  9380. @markupsetuprqdefault
  9381. @c Local variables:
  9382. @c eval: (add-hook 'write-file-hooks 'time-stamp)
  9383. @c page-delimiter: "^\\\\message"
  9384. @c time-stamp-start: "def\\\\texinfoversion{"
  9385. @c time-stamp-format: "%:y-%02m-%02d.%02H"
  9386. @c time-stamp-end: "}"
  9387. @c End:
  9388. @c vim:sw=2:
  9389. @ignore
  9390. arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115
  9391. @end ignore