texinfo.tex 284 KB

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