texinfo.tex 319 KB

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